Overview
Comment: | Start to implement replay. (The replay implementation is not yet complete; it doesn't display the replay list anywhere, nor does it save it, nor replay solutions.) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1c62f22813b87ee215d981c1b0fa1e3d |
User & Date: | user on 2021-01-04 00:39:07 |
Other Links: | manifest | tags |
Context
2021-01-04
| ||
02:44 | Implement replay marks. check-in: 0393bebb68 user: user tags: trunk | |
00:39 | Start to implement replay. (The replay implementation is not yet complete; it doesn't display the replay list anywhere, nor does it save it, nor replay solutions.) check-in: 1c62f22813 user: user tags: trunk | |
2021-01-03
| ||
09:43 | Implement sliding check-in: 1490be64d5 user: user tags: trunk | |
Changes
Modified function.c from [5bdde93d2d] to [ee9cae7e1c].
︙ | |||
237 238 239 240 241 242 243 244 245 246 247 248 249 250 | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | + + + + | s=load_level(sqlite3_value_int(*argv)); if(s) sqlite3_result_error(cxt,s,-1); } static void fn_modstate(sqlite3_context*cxt,int argc,sqlite3_value**argv) { sqlite3_result_int(cxt,SDL_GetModState()); } static void fn_movenumber(sqlite3_context*cxt,int argc,sqlite3_value**argv) { sqlite3_result_int(cxt,replay_pos); } static void fn_mvalue(sqlite3_context*cxt,int argc,sqlite3_value**argv) { int a; if(sqlite3_value_type(*argv)==SQLITE_NULL) return; a=sqlite3_value_int(*argv)&0xFFFF; sqlite3_result_int64(cxt,a|((sqlite3_int64)TY_MESSAGE<<32LL)); } |
︙ | |||
933 934 935 936 937 938 939 940 941 942 943 944 945 946 | 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | + | sqlite3_create_function(userdb,"HEROMESH_UNESCAPE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_heromesh_unescape,0,0); sqlite3_create_function(userdb,"LEVEL",0,SQLITE_UTF8,&level_ord,fn_level,0,0); sqlite3_create_function(userdb,"LEVEL_CACHEID",0,SQLITE_UTF8|SQLITE_DETERMINISTIC,ptr0,fn_cacheid,0,0); sqlite3_create_function(userdb,"LEVEL_ID",0,SQLITE_UTF8,&level_id,fn_level,0,0); sqlite3_create_function(userdb,"LEVEL_TITLE",0,SQLITE_UTF8,0,fn_level_title,0,0); sqlite3_create_function(userdb,"LOAD_LEVEL",1,SQLITE_UTF8,0,fn_load_level,0,0); sqlite3_create_function(userdb,"MODSTATE",0,SQLITE_UTF8,0,fn_modstate,0,0); sqlite3_create_function(userdb,"MOVENUMBER",0,SQLITE_UTF8,0,fn_movenumber,0,0); sqlite3_create_function(userdb,"MVALUE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_mvalue,0,0); sqlite3_create_function(userdb,"NVALUE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_zero_extend,0,0); sqlite3_create_function(userdb,"OVALUE",1,SQLITE_UTF8,0,fn_ovalue,0,0); sqlite3_create_function(userdb,"PFHEIGHT",0,SQLITE_UTF8,&pfheight,fn_pfsize,0,0); sqlite3_create_function(userdb,"PFWIDTH",0,SQLITE_UTF8,&pfwidth,fn_pfsize,0,0); sqlite3_create_function(userdb,"PICTURE_SIZE",0,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_picture_size,0,0); sqlite3_create_function(userdb,"READ_LUMP_AT",2,SQLITE_UTF8,0,fn_read_lump_at,0,0); |
︙ |
Modified game.c from [9af2d99ebb] to [6ca5fb9cf3].
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + + + | #include "sqlite3.h" #include "smallxrm.h" #include "heromesh.h" #include "quarks.h" #include "cursorshapes.h" #include "names.h" Uint8*replay_list; Uint16 replay_size,replay_count,replay_pos,replay_mark; static volatile Uint8 timerflag; static int exam_scroll; static Uint8*inputs; static int inputs_size,inputs_count; static void redraw_game(void) { char buf[32]; |
︙ | |||
137 138 139 140 141 142 143 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - - - + + | draw_text(0,40,buf,0xF0,0xF1); SDL_UnlockSurface(screen); SDL_Flip(screen); } static void begin_level(int id) { const char*t; |
︙ | |||
392 393 394 395 396 397 398 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | - + + + + + + + + + + + + + + + + + + + + + + + | if(xy<0 || xy>=64*64) return; n=playfield[xy]; if(n==VOIDLINK) return; while(n!=VOIDLINK && objects[n]->up!=VOIDLINK) n=objects[n]->up; if(!classes[objects[n]->class]->gamehelp) return; s=sqlite3_mprintf("\x0C\x0E%s:%d\\ %s\x0B\x0F%s",classes[objects[n]->class]->name,objects[n]->image,classes[objects[n]->class]->name,classes[objects[n]->class]->gamehelp); if(!s) fatal("Allocation failed\n"); |
︙ | |||
457 458 459 460 461 462 463 464 465 466 467 468 | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | + - + + + + + + + + | } timerflag=1; return n; } static inline void input_move(Uint8 k) { const char*t=execute_turn(k); if(replay_pos==65534 && !gameover) t="Too many moves played"; if(t) { screen_message(t); gameover=-1; return; } |
︙ |
Modified heromesh.h from [ec8cb61a20] to [02acfa099d].
︙ | |||
247 248 249 250 251 252 253 254 255 256 257 258 259 260 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | + + + | void objtrash(Uint32 n); void annihilate(void); const char*execute_turn(int key); const char*init_level(void); // == game == extern Uint8*replay_list; extern Uint16 replay_size,replay_count,replay_pos,replay_mark; void run_game(void); void locate_me(int x,int y); // == edit == void run_editor(void); void write_empty_level_set(FILE*); |
︙ |