Commit Graph

345 Commits

Author SHA1 Message Date
Max Bradbury fd91e333a5 optimise new_unique_id() 2020-06-28 09:19:55 +01:00
Max Bradbury 6689fe1e1f refactor new_unique_id() 2020-06-27 20:22:15 +01:00
Max Bradbury 5f736cc653 skeleton of merge functionality 2020-06-27 19:28:17 +01:00
Max Bradbury b08e514b12 add_dialogue() 2020-06-24 19:43:36 +01:00
Max Bradbury e32027e0af only change item id on clash; test add_item 2020-06-24 18:45:06 +01:00
Max Bradbury cbbbcb7196 try/check ID functions 2020-06-24 18:36:28 +01:00
Max Bradbury 401bfe4695 check sorting 2020-06-24 15:36:39 +01:00
Max Bradbury 93a50e6b86 don't try to get tiles with ID of zero; test this 2020-06-24 15:30:16 +01:00
Max Bradbury 5de02c5950 better test for duplicate IDs 2020-06-24 15:15:13 +01:00
Max Bradbury 4ed5e0bce8 check if avatar exists 2020-06-24 15:14:41 +01:00
Max Bradbury 04c0ebca69 add new tile/room functions; redo Not Found errors 2020-06-24 14:33:15 +01:00
Max Bradbury f517f5c8fd "new id" functions 2020-06-24 13:21:00 +01:00
Max Bradbury 9e14109f9f more ID functions 2020-06-24 13:06:47 +01:00
Max Bradbury d8925c9eb9 more public 2020-06-24 13:05:32 +01:00
Max Bradbury 2a19611f20 make ID public so we can process ending IDs 2020-06-24 13:04:53 +01:00
Max Bradbury 6ab2e81468 fix comment 2020-06-24 12:58:26 +01:00
Max Bradbury 6ee58224c1 "add palette" functions 2020-06-24 12:58:02 +01:00
Max Bradbury 67628e4879 "new id" and "add thing" functions 2020-06-24 12:40:15 +01:00
Max Bradbury 7405090009 document this odd if statement 2020-06-24 12:39:49 +01:00
Max Bradbury 632aaff4b9 todo 2020-06-24 12:39:26 +01:00
Max Bradbury 58ffb92e52 more inlining 2020-06-23 20:35:12 +01:00
Max Bradbury 0889710bdb more ID functions 2020-06-23 17:01:21 +01:00
Max Bradbury 62d4f12bc9 don't need to worry about SPR A, since to_base36 will never produce capital letters 2020-06-23 17:00:46 +01:00
Max Bradbury 9264be83ef import no longer used 2020-06-23 16:55:03 +01:00
Max Bradbury b88f69af17 fix some false assumptions about tile IDs (0 is reserved!) 2020-06-23 16:46:49 +01:00
Max Bradbury 62f488c24e sort and dedupe IDs 2020-06-23 16:36:33 +01:00
Max Bradbury 0626d8d069 use new_unique_id() and remove old imports/calls to base36 functions 2020-06-23 16:26:08 +01:00
Max Bradbury eb5a0f1344 test new_unique_id() 2020-06-23 16:23:24 +01:00
Max Bradbury 280dea62ae implement unique ID function 2020-06-23 16:14:22 +01:00
Max Bradbury 2ca4e7db18 todo error 2020-06-23 15:59:08 +01:00
Max Bradbury 6a4a46e868 remove redundant return 2020-06-23 15:34:28 +01:00
Max Bradbury 2e779a9b08 undo accidental commit 2020-06-23 13:11:20 +01:00
Max Bradbury 453eba2139 todo: other potential errors 2020-06-23 13:06:55 +01:00
Max Bradbury 716554e88b error for parsing game 2020-06-23 13:05:53 +01:00
Max Bradbury 4d33a0a284 handle errors on sprite parsing 2020-06-23 13:01:04 +01:00
Max Bradbury 7773949a8e use default room format on error 2020-06-23 13:00:34 +01:00
Max Bradbury d9764b6b42 error for room type 2020-06-23 12:48:42 +01:00
Max Bradbury 96e9432f06 error for room format 2020-06-23 12:44:44 +01:00
Max Bradbury edbf9575d7 "get sprite" and "get avatar" functions 2020-06-18 20:32:11 +01:00
Max Bradbury b468c680b3 let version fail gracefully 2020-06-18 19:56:33 +01:00
Max Bradbury f85078d0e7 remove unused avatar 2020-06-18 19:15:20 +01:00
Max Bradbury 9f25aef3a2 remove numeric check and just do sprites in the order that they were imported 2020-06-18 18:38:25 +01:00
Max Bradbury 168f3559e0 replace tile ID with string 2020-06-18 17:47:54 +01:00
Max Bradbury bf5b3a8d20 remove avatar (treat it as sprite) 2020-06-18 17:46:30 +01:00
Max Bradbury 4430ee74aa dummy return value 2020-06-18 14:44:39 +01:00
Max Bradbury fe6f3f5c84 convert int IDs to strings 2020-06-18 14:44:20 +01:00
Max Bradbury e895f932a6 skeleton stuff 2020-06-18 13:56:50 +01:00
Max Bradbury 1ce479afaa clarification 2020-06-18 09:11:54 +01:00
Max Bradbury 4ed5ed3d65 implement Clone 2020-05-31 16:12:23 +01:00
Max Bradbury 3e985962c8 special treatment of multi-line game name 2020-04-30 21:48:51 +01:00
Max Bradbury 87101064f0 no need for assignment here 2020-04-30 20:18:37 +01:00
Max Bradbury c06dc237a6 handle empty dialogue line (poorly...) 2020-04-30 20:18:15 +01:00
Max Bradbury ef310d6fb7 add dialogue name for 7.0 2020-04-30 19:44:20 +01:00
Max Bradbury 32a369118c quote/unquote functions 2020-04-30 18:54:28 +01:00
Max Bradbury e9f1a1afcf redo ending transformations 2020-04-29 21:17:29 +01:00
Max Bradbury e760027ae4 handle errors for exit 2020-04-29 20:43:49 +01:00
Max Bradbury 5bfcc9ab4c handle error in position 2020-04-29 20:16:15 +01:00
Max Bradbury 56f85470ff stop this one from complaining 2020-04-29 18:53:39 +01:00
Max Bradbury 50a8249e3a remove unused import 2020-04-29 18:34:28 +01:00
Max Bradbury 9d5b7af316 error handling for position 2020-04-29 18:33:22 +01:00
Max Bradbury 6533de8b8c import 2020-04-29 16:59:00 +01:00
Max Bradbury 1772d8f2e8 missing test resource 2020-04-29 16:57:25 +01:00
Max Bradbury af3388f9f2 test out-of-bounds pixels 2020-04-29 09:28:20 +01:00
Max Bradbury 93209bd3fb remove debug stuff 2020-04-29 09:23:48 +01:00
Max Bradbury 8bd323b8a0 dedupe animation frames handling 2020-04-29 08:27:35 +01:00
Max Bradbury 8d8515bb8a rework image 2020-04-29 08:23:51 +01:00
Max Bradbury 76eca72699 allow non-16x16 rooms 2020-04-28 19:30:18 +01:00
Max Bradbury b2f601e778 handle NaN in images 2020-04-28 18:12:56 +01:00
Max Bradbury f899f03dbe allow inlining (this did not provide a statistically significant performance boost - oh well) 2020-04-28 18:00:31 +01:00
Max Bradbury dd00686de0 add transition and dialogue for exits (7.0) 2020-04-28 08:34:35 +01:00
Max Bradbury 0133731e97 allow variables to have a default value of "" 2020-04-26 20:44:44 +01:00
Max Bradbury f0667b621a fix failing tests (sprite ID "A" converts to 10...) 2020-04-26 13:37:08 +01:00
Max Bradbury 3e72e242f3 failure warning for base36 parsing 2020-04-26 13:33:53 +01:00
Max Bradbury 1be81293e6 remove avatar 2020-04-26 13:33:26 +01:00
Max Bradbury daa46e26ee be a bit more fussy about checking for segment names - game title "PALACE" was being parsed as a palette... :( 2020-04-26 13:33:04 +01:00
Max Bradbury cf1ca6f1b5 reimplement avatar as a plain sprite; handle sprite items as these are mostly needed for avatar 2020-04-26 13:31:20 +01:00
Max Bradbury ed6552f39c debug messages for bad position data 2020-04-25 14:18:34 +01:00
Max Bradbury 41a08d7a61 debug message for bad pixels 2020-04-25 14:18:09 +01:00
Max Bradbury f18b0de251 check if line is numeric before appending it to pixel data; check if colour ID is ok 2020-04-25 14:17:52 +01:00
Max Bradbury 5184060372 move this function to lib so we can use it elsewhere 2020-04-25 14:17:12 +01:00
Max Bradbury 9e8d032ced handle game segments better 2020-04-24 21:51:31 +01:00
Max Bradbury 408e46ef7e new function for splitting game data into segments 2020-04-24 18:52:27 +01:00
Max Bradbury e8effb3579 fix input warning 2020-04-24 18:20:05 +01:00
Max Bradbury f2d9f84307 revert to 16x16 rooms as that covers standard bitsy as well as bitsy hd 2020-04-24 18:11:27 +01:00
Max Bradbury c4158e2b66 infer room format 2020-04-24 18:10:10 +01:00
Max Bradbury c9bab425a2 handle optional version/format lines 2020-04-24 18:09:54 +01:00
Max Bradbury 2955a81296 tidyup 2020-04-24 18:09:08 +01:00
Max Bradbury a0d109c0b8 handle optional game version and room format; transform line endings 2020-04-24 18:08:21 +01:00
Max Bradbury ebb172df7e handle room formats 2020-04-24 18:07:32 +01:00
Max Bradbury 1c6e3eb515 turn room format and room type into enums; transform line endings 2020-04-24 18:06:17 +01:00
Max Bradbury f4b82c3a67 missing field 2020-04-23 16:42:01 +01:00
Max Bradbury f2ec5d44bd add line endings property so we can convert later 2020-04-23 12:07:45 +01:00
Max Bradbury 096eb39bf6 optional version handling 2020-04-23 12:03:39 +01:00
Max Bradbury 6e7240e2d7 streamline this 2020-04-23 08:57:46 +01:00
Max Bradbury d1254988bc allow game to have font data (not really parsed for now) 2020-04-23 07:43:52 +01:00
Max Bradbury f740496727 don't strip newlines from endings 2020-04-23 06:57:07 +01:00
Max Bradbury d955f4ee71 fix ending from string (allow "END " in dialogue, and multi-line dialogues) 2020-04-23 06:50:38 +01:00
Max Bradbury 7a8ec4e5d2 fix executable name 2020-04-19 08:14:52 +01:00
Max Bradbury 858a45f69d remove unused import 2020-04-19 08:14:26 +01:00
Max Bradbury 76e6c2477c test configurations 2020-04-19 08:13:55 +01:00
Max Bradbury dacccdc100 better example program 2020-04-19 07:34:11 +01:00
github-actions[bot] 1e0c129dca
Format Rust code using rustfmt 2020-04-18 17:08:16 +00:00
Max Bradbury f550c3696f handle errors for game 2020-04-18 18:07:25 +01:00
Max Bradbury 4f8c4e5195 Merge remote-tracking branch 'origin/master' 2020-04-18 17:48:42 +01:00
Max Bradbury 434e98cc60 implement error handling for game 2020-04-18 17:48:29 +01:00
github-actions[bot] 8983aa60d1
Format Rust code using rustfmt 2020-04-18 16:43:25 +00:00
Max Bradbury c47c4205aa implement error handling for avatar 2020-04-18 17:42:32 +01:00
github-actions[bot] cba6c16414
Format Rust code using rustfmt 2020-04-18 15:58:30 +00:00
Max Bradbury 074b51d5d9 fix failing error 2020-04-18 16:46:41 +01:00
Max Bradbury 8b05645c6b allow trailing spaces in dialogues 2020-04-18 16:32:50 +01:00
Max Bradbury 2e5d063371 more testing 2020-04-18 16:20:29 +01:00
Max Bradbury 0414fe757a optional room palette is now handled 2020-04-18 16:14:01 +01:00
Max Bradbury c954e56ea9 error handling for position 2020-04-18 16:12:06 +01:00
Max Bradbury 78b2319d4f implement optional palette id for room 2020-04-18 15:50:01 +01:00
Max Bradbury c441fce485 implement optional name for avatar 2020-04-18 15:49:33 +01:00
Max Bradbury 596be936d9 try to handle old "SET" rooms 2020-04-18 15:33:04 +01:00
Max Bradbury fe3fac5e2b handle old room format 2020-04-18 15:28:51 +01:00
Max Bradbury 7c76a9d3d2 go through more test data 2020-04-18 15:02:27 +01:00
Max Bradbury 9234ed1c63 test data 2020-04-18 14:48:25 +01:00
Max Bradbury e71c87ad4c handle room wall array 2020-04-18 14:39:17 +01:00
Max Bradbury 7c566ab9d3 update test results 2020-04-18 14:03:01 +01:00
Max Bradbury 2b8039d77d go through more test data 2020-04-18 13:40:37 +01:00
Max Bradbury e6845d7a39 fix avatar ordering 2020-04-18 13:38:41 +01:00
Max Bradbury e328661fbf avatar ordering fixed 2020-04-18 13:38:20 +01:00
Max Bradbury 96b956e0f2 fix font output 2020-04-18 13:37:26 +01:00
Max Bradbury cf8389ddd8 game version handling done 2020-04-18 12:49:51 +01:00
Max Bradbury 16e399b312 export font and text direction to string 2020-04-18 12:46:46 +01:00
Max Bradbury e1bf7cbae4 test RTL and font options 2020-04-18 12:45:43 +01:00
Max Bradbury 935075e7a1 redo version as a struct 2020-04-18 11:03:24 +01:00
Max Bradbury c8a4b4a8bc use room_format_line() 2020-04-18 10:48:14 +01:00
Max Bradbury c200957679 these are public functions, not for internal use 2020-04-18 10:46:33 +01:00
Max Bradbury c467489dd5 remove some unnecessary imports and call them inline 2020-04-18 10:46:07 +01:00
Max Bradbury cc0780b9cd implement font and text direction; call std and mock directly instead of importing 2020-04-18 10:45:01 +01:00
Max Bradbury c5604f2964 don't import mock, just reference directly 2020-04-18 10:26:42 +01:00
Max Bradbury f77c8b2d4e handle bitsy version as major and minor versions (uint); helper functions for game version/format 2020-04-17 09:37:03 +01:00
Max Bradbury 5413be82bc test framework for archive of bitsy game data 2020-04-14 00:41:05 +01:00
Max Bradbury 833e44a019 update mocks 2020-04-14 00:40:29 +01:00
Max Bradbury 88c4f36e31 make tile wall "optional" (specified or not); tile colour id 2020-04-14 00:40:14 +01:00
Max Bradbury b479275d7e room/position for sprite are actually optional! you can make a sprite and never place it anywhere;
colour id for sprite
2020-04-14 00:38:50 +01:00
Max Bradbury 389cfe5f10 error handling for position 2020-04-14 00:37:02 +01:00
Max Bradbury 5d1c515192 item colour id 2020-04-14 00:36:31 +01:00
Max Bradbury b4e05cdc1b trim whitespace around game data 2020-04-14 00:34:03 +01:00
Max Bradbury cc347dbf99 allow empty dialogues (needs fixing) 2020-04-14 00:32:24 +01:00
Max Bradbury a7c81f7f6c avatar.room -> room_id; add colour_id; game data line helper functions 2020-04-14 00:25:45 +01:00
Max Bradbury bfe679dfc8 move test resources 2020-04-14 00:17:40 +01:00
Max Bradbury 2ee08dd264 fix failing test for room 2020-04-13 19:26:11 +01:00
Max Bradbury df2d0105e6 dedupe optional line for tile 2020-04-13 19:25:49 +01:00
Max Bradbury 5d76798ace dedupe optional line for room 2020-04-13 19:14:57 +01:00
Max Bradbury 6dc9bbcc2d dedupe optional lines for item 2020-04-13 19:12:21 +01:00
Max Bradbury ba6d4e8b40 redundant comment 2020-04-13 19:11:51 +01:00