Overview
Comment: | Use the new move list functions in move list import/export functions, and change the type of replay_size from Uint16 to size_t. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cafa4fd29bb4a262372379de966d6988 |
User & Date: | user on 2022-06-26 04:05:02 |
Other Links: | manifest | tags |
Context
2022-06-28
| ||
03:57 | Some more changes in game.c and in documentation, to work with the new move list encoding/decoding functions. check-in: c295ff21b6 user: user tags: trunk | |
2022-06-26
| ||
04:05 | Use the new move list functions in move list import/export functions, and change the type of replay_size from Uint16 to size_t. check-in: cafa4fd29b user: user tags: trunk | |
2022-06-22
| ||
22:40 | Start to implement move list encoding, to be used in future if coordinate input is implemented (and possibly other features that might benefit from this capability). check-in: 77553ee70b user: user tags: trunk | |
Changes
Modified class.doc from [0fe9aa62ea] to [854a736d64].
︙ | |||
1552 1553 1554 1555 1556 1557 1558 | 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | - + | HeightAt ( x y -- height ) Finds the greatest height among objects at the specified location. HitMe ( dir -- bool ) ** Checks hardness/sharpness and shoving like is done by Move, subject to From and Arg3. The direction is a direction relative to From, not to Self. The result is 1 if shoving or sharpness is successful, or 0 |
︙ |
Modified game.c from [104890bd44] to [dd24aafcf7].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + - + | #include "smallxrm.h" #include "heromesh.h" #include "quarks.h" #include "cursorshapes.h" #include "names.h" MoveItem*replay_list; size_t replay_size; |
︙ | |||
55 56 57 58 59 60 61 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | - + - + - - | return (v==EOF?0:v); } int decode_move_list(FILE*fp) { // Decodes a move list from the file, and stores it in replay_list and replay_count. // Returns the number of moves (replay_count). MoveItem v; |
︙ | |||
293 294 295 296 297 298 299 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - + | static void save_replay(void) { long sz=replay_size; if(solution_replay || !replay_list) return; if(sz<replay_count+6) { replay_list=realloc(replay_list,sz=replay_count+6); if(!replay_list) fatal("Allocation failed\n"); |
︙ | |||
323 324 325 326 327 328 329 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - + - + | i=3; if(replay_list[2]&1) { while(i<sz && replay_list[i]) i++; i++; } if(replay_list[2]&2) i+=8; if(i>=sz || sz-i>0xFFFF) goto notfound; |
︙ | |||
709 710 711 712 713 714 715 | 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | - - - - + - - - + | int i; if(!arg || !arg[strspn(arg," \t")]) return; fp=popen(arg,"r"); if(!fp) { screen_message("Unable to open pipe for reading"); return; } |
︙ |
Modified heromesh.h from [afc1524574] to [e542ddb045].
︙ | |||
319 320 321 322 323 324 325 | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | + - + | void swap_world(void); // == game == typedef Uint8 MoveItem; extern MoveItem*replay_list; extern size_t replay_size; |
︙ |