rnd-20020919-1-src
[rocksndiamonds.git] / src / main.h
index 823a230fe7cccf5526f109dec2c185b259f477c4..7f4252d7dd284efd1acc4443b356c546c1fa5f08 100644 (file)
@@ -346,9 +346,11 @@ struct ElementInfo
   char *sound_class_name;      /* classification for custom sound effects */
   char *editor_description;    /* short description for level editor */
 
-  int graphic;
-  int direction_graphic[4];    /* special graphics for left/right/up/down */
-  boolean has_direction_graphic;
+  int graphic[NUM_GFX_ACTIONS_MAPPED];
+
+                               /* special graphics for left/right/up/down */
+  int direction_graphic[NUM_GFX_ACTIONS_MAPPED][4];
+  boolean has_direction_graphic[NUM_GFX_ACTIONS_MAPPED];
 };
 
 struct GraphicInfo
@@ -364,6 +366,7 @@ struct NewGraphicInfo
   int anim_frames;
   int anim_delay;
   int anim_mode;
+  boolean anim_global_sync;
   boolean anim_vertical;
 };
 
@@ -1475,15 +1478,34 @@ extern struct FileInfo         *image_files, *sound_files;
 #define NUM_SOUNDS             55
 
 
+/* values for animation action types */
+#define GFX_ACTION_UNKNOWN             0
+#define GFX_ACTION_DEFAULT             1
+#define GFX_ACTION_WAITING             2
+#define GFX_ACTION_MOVING              3
+#define GFX_ACTION_DIGGING             4
+#define GFX_ACTION_COLLECTING          5
+#define GFX_ACTION_PUSHING             6
+#define GFX_ACTION_PASSING             7
+#define GFX_ACTION_IMPACT              8
+#define GFX_ACTION_ACTIVATING          9
+#define GFX_ACTION_BURNING             10
+#define GFX_ACTION_OTHER               11
+
+#define NUM_GFX_ACTIONS                        12
+#define NUM_GFX_ACTIONS_MAPPED         6
+
+
 /* values for image configuration suffixes */
-#define GFXARG_XPOS                            0
-#define GFXARG_YPOS                            1
-#define GFXARG_FRAMES                          2
-#define GFXARG_DELAY                           3
-#define GFXARG_PINGPONG                                4
-#define GFXARG_PINGPONG2                       5
-#define GFXARG_REVERSE                         6
-#define GFXARG_VERTICAL                                7
+#define GFX_ARG_XPOS                           0
+#define GFX_ARG_YPOS                           1
+#define GFX_ARG_FRAMES                         2
+#define GFX_ARG_DELAY                          3
+#define GFX_ARG_PINGPONG                       4
+#define GFX_ARG_PINGPONG2                      5
+#define GFX_ARG_REVERSE                                6
+#define GFX_ARG_GLOBAL_SYNC                    7
+#define GFX_ARG_VERTICAL                       8
 
 /* values for image configuration */
 #define IMG_EMPTY_SPACE                                0
@@ -1792,163 +1814,157 @@ extern struct FileInfo               *image_files, *sound_files;
 #define IMG_SP_PORT_XY                         303
 #define IMG_SP_SNIKSNAK                                304
 #define IMG_SP_SNIKSNAK_LEFT                   305
-#define IMG_SP_SNIKSNAK_LEFT_MOVING            306
-#define IMG_SP_SNIKSNAK_RIGHT                  307
-#define IMG_SP_SNIKSNAK_RIGHT_MOVING           308
-#define IMG_SP_SNIKSNAK_UP                     309
-#define IMG_SP_SNIKSNAK_UP_MOVING              310
-#define IMG_SP_SNIKSNAK_DOWN                   311
-#define IMG_SP_SNIKSNAK_DOWN_MOVING            312
-#define IMG_SP_ELECTRON                                313
-#define IMG_SP_ELECTRON_MOVING                 314
-#define IMG_SP_TERMINAL                                315
-#define IMG_SP_TERMINAL_RUNNING                        316
-#define IMG_SP_TERMINAL_ACTIVE                 317
-#define IMG_SP_TERMINAL_ACTIVE_RUNNING         318
-#define IMG_SP_BUGGY_BASE                      319
-#define IMG_SP_BUGGY_BASE_ACTIVATING           320
-#define IMG_SP_HARD_BASE1                      321
-#define IMG_SP_HARD_BASE2                      322
-#define IMG_SP_HARD_BASE3                      323
-#define IMG_SP_HARD_BASE4                      324
-#define IMG_SP_HARD_BASE5                      325
-#define IMG_SP_HARD_BASE6                      326
-#define IMG_INVISIBLE_STEELWALL                        327
-#define IMG_INVISIBLE_STEELWALL_ON             328
-#define IMG_INVISIBLE_SAND                     329
-#define IMG_INVISIBLE_SAND_ON                  330
-#define IMG_INVISIBLE_WALL                     331
-#define IMG_INVISIBLE_WALL_ON                  332
-#define IMG_EM_KEY1                            333
-#define IMG_EM_KEY2                            334
-#define IMG_EM_KEY3                            335
-#define IMG_EM_KEY4                            336
-#define IMG_EM_GATE1                           337
-#define IMG_EM_GATE2                           338
-#define IMG_EM_GATE3                           339
-#define IMG_EM_GATE4                           340
-#define IMG_EM_GATE1_GRAY                      341
-#define IMG_EM_GATE2_GRAY                      342
-#define IMG_EM_GATE3_GRAY                      343
-#define IMG_EM_GATE4_GRAY                      344
-#define IMG_SP_EXPLOSION                       345
-#define IMG_SP_EXPLOSION_INFOTRON              346
-#define IMG_CONVEYOR_BELT1_MIDDLE              347
-#define IMG_CONVEYOR_BELT1_MIDDLE_RUNNING      348
-#define IMG_CONVEYOR_BELT1_LEFT                        349
-#define IMG_CONVEYOR_BELT1_LEFT_RUNNING                350
-#define IMG_CONVEYOR_BELT1_RIGHT               351
-#define IMG_CONVEYOR_BELT1_RIGHT_RUNNING       352
-#define IMG_CONVEYOR_BELT1_SWITCH_LEFT         353
-#define IMG_CONVEYOR_BELT1_SWITCH_MIDDLE       354
-#define IMG_CONVEYOR_BELT1_SWITCH_RIGHT                355
-#define IMG_CONVEYOR_BELT2_MIDDLE              356
-#define IMG_CONVEYOR_BELT2_MIDDLE_RUNNING      357
-#define IMG_CONVEYOR_BELT2_LEFT                        358
-#define IMG_CONVEYOR_BELT2_LEFT_RUNNING                359
-#define IMG_CONVEYOR_BELT2_RIGHT               360
-#define IMG_CONVEYOR_BELT2_RIGHT_RUNNING       361
-#define IMG_CONVEYOR_BELT2_SWITCH_LEFT         362
-#define IMG_CONVEYOR_BELT2_SWITCH_MIDDLE       363
-#define IMG_CONVEYOR_BELT2_SWITCH_RIGHT                364
-#define IMG_CONVEYOR_BELT3_MIDDLE              365
-#define IMG_CONVEYOR_BELT3_MIDDLE_RUNNING      366
-#define IMG_CONVEYOR_BELT3_LEFT                        367
-#define IMG_CONVEYOR_BELT3_LEFT_RUNNING                368
-#define IMG_CONVEYOR_BELT3_RIGHT               369
-#define IMG_CONVEYOR_BELT3_RIGHT_RUNNING       370
-#define IMG_CONVEYOR_BELT3_SWITCH_LEFT         371
-#define IMG_CONVEYOR_BELT3_SWITCH_MIDDLE       372
-#define IMG_CONVEYOR_BELT3_SWITCH_RIGHT                373
-#define IMG_CONVEYOR_BELT4_MIDDLE              374
-#define IMG_CONVEYOR_BELT4_MIDDLE_RUNNING      375
-#define IMG_CONVEYOR_BELT4_LEFT                        376
-#define IMG_CONVEYOR_BELT4_LEFT_RUNNING                377
-#define IMG_CONVEYOR_BELT4_RIGHT               378
-#define IMG_CONVEYOR_BELT4_RIGHT_RUNNING       379
-#define IMG_CONVEYOR_BELT4_SWITCH_LEFT         380
-#define IMG_CONVEYOR_BELT4_SWITCH_MIDDLE       381
-#define IMG_CONVEYOR_BELT4_SWITCH_RIGHT                382
-#define IMG_SWITCHGATE_SWITCH_UP               383
-#define IMG_SWITCHGATE_SWITCH_DOWN             384
-#define IMG_LIGHT_SWITCH_OFF                   385
-#define IMG_LIGHT_SWITCH_ON                    386
-#define IMG_TIMEGATE_WHEEL                     387
-#define IMG_TIMEGATE_WHEEL_RUNNING             388
-#define IMG_ENVELOPE                           389
-#define IMG_SIGN_EXCLAMATION                   390
-#define IMG_SIGN_STOP                          391
-#define IMG_LANDMINE                           392
-#define IMG_STEELWALL_SLANTED                  393
-#define IMG_EXTRA_TIME                         394
-#define IMG_SHIELD_ACTIVE                      395
-#define IMG_SHIELD_PASSIVE                     396
-#define IMG_SWITCHGATE_CLOSED                  397
-#define IMG_SWITCHGATE_OPENING                 398
-#define IMG_SWITCHGATE_OPEN                    399
-#define IMG_SWITCHGATE_CLOSING                 400
-#define IMG_TIMEGATE_CLOSED                    401
-#define IMG_TIMEGATE_OPENING                   402
-#define IMG_TIMEGATE_OPEN                      403
-#define IMG_TIMEGATE_CLOSING                   404
-#define IMG_BALLOON                            405
-#define IMG_BALLOON_MOVING                     406
-#define IMG_BALLOON_WINDROSE_LEFT              407
-#define IMG_BALLOON_WINDROSE_RIGHT             408
-#define IMG_BALLOON_WINDROSE_UP                        409
-#define IMG_BALLOON_WINDROSE_DOWN              410
-#define IMG_BALLOON_WINDROSE_ALL               411
-#define IMG_EMC_STEELWALL1                     412
-#define IMG_EMC_STEELWALL2                     413
-#define IMG_EMC_STEELWALL3                     414
-#define IMG_EMC_STEELWALL4                     415
-#define IMG_EMC_WALL_PILLAR_UPPER              416
-#define IMG_EMC_WALL_PILLAR_MIDDLE             417
-#define IMG_EMC_WALL_PILLAR_LOWER              418
-#define IMG_EMC_WALL4                          419
-#define IMG_EMC_WALL5                          420
-#define IMG_EMC_WALL6                          421
-#define IMG_EMC_WALL7                          422
-#define IMG_EMC_WALL8                          423
-#define IMG_ARROW_BLUE_LEFT                    424
-#define IMG_ARROW_BLUE_RIGHT                   425
-#define IMG_ARROW_BLUE_UP                      426
-#define IMG_ARROW_BLUE_DOWN                    427
-#define IMG_ARROW_RED_LEFT                     428
-#define IMG_ARROW_RED_RIGHT                    429
-#define IMG_ARROW_RED_UP                       430
-#define IMG_ARROW_RED_DOWN                     431
-#define IMG_SCROLLBAR_BLUE                     432
-#define IMG_SCROLLBAR_RED                      433
-#define IMG_SCROLLBAR_GREEN                    434
-#define IMG_SCROLLBAR_YELLOW                   435
-#define IMG_PEARL                              436
-#define IMG_PEARL_BREAKING                     437
-#define IMG_CRYSTAL                            438
-#define IMG_WALL_PEARL                         439
-#define IMG_WALL_CRYSTAL                       440
-#define IMG_SPRING                             441
-#define IMG_TUBE_RIGHT_DOWN                    442
-#define IMG_TUBE_HORIZONTAL_DOWN               443
-#define IMG_TUBE_LEFT_DOWN                     444
-#define IMG_TUBE_HORIZONTAL                    445
-#define IMG_TUBE_VERTICAL_RIGHT                        446
-#define IMG_TUBE_ALL                           447
-#define IMG_TUBE_VERTICAL_LEFT                 448
-#define IMG_TUBE_VERTICAL                      449
-#define IMG_TUBE_RIGHT_UP                      450
-#define IMG_TUBE_HORIZONTAL_UP                 451
-#define IMG_TUBE_LEFT_UP                       452
-#define IMG_TRAP_INACTIVE                      453
-#define IMG_TRAP_ACTIVE                                454
-#define IMG_TRAP_ACTIVATING                    455
-#define IMG_BD_WALL                            456
-#define IMG_BD_ROCK                            457
-#define IMG_BD_ROCK_FALLING                    458
-#define IMG_BD_ROCK_PUSHING                    459
-#define IMG_DX_BOMB                            460
-
-#define NUM_IMAGE_FILES                                461
+#define IMG_SP_SNIKSNAK_RIGHT                  306
+#define IMG_SP_SNIKSNAK_UP                     307
+#define IMG_SP_SNIKSNAK_DOWN                   308
+#define IMG_SP_ELECTRON                                309
+#define IMG_SP_TERMINAL                                310
+#define IMG_SP_TERMINAL_ACTIVE                 311
+#define IMG_SP_BUGGY_BASE                      312
+#define IMG_SP_BUGGY_BASE_ACTIVATING           313
+#define IMG_SP_HARD_BASE1                      314
+#define IMG_SP_HARD_BASE2                      315
+#define IMG_SP_HARD_BASE3                      316
+#define IMG_SP_HARD_BASE4                      317
+#define IMG_SP_HARD_BASE5                      318
+#define IMG_SP_HARD_BASE6                      319
+#define IMG_INVISIBLE_STEELWALL                        320
+#define IMG_INVISIBLE_STEELWALL_ON             321
+#define IMG_INVISIBLE_SAND                     322
+#define IMG_INVISIBLE_SAND_ON                  323
+#define IMG_INVISIBLE_WALL                     324
+#define IMG_INVISIBLE_WALL_ON                  325
+#define IMG_EM_KEY1                            326
+#define IMG_EM_KEY2                            327
+#define IMG_EM_KEY3                            328
+#define IMG_EM_KEY4                            329
+#define IMG_EM_GATE1                           330
+#define IMG_EM_GATE2                           331
+#define IMG_EM_GATE3                           332
+#define IMG_EM_GATE4                           333
+#define IMG_EM_GATE1_GRAY                      334
+#define IMG_EM_GATE2_GRAY                      335
+#define IMG_EM_GATE3_GRAY                      336
+#define IMG_EM_GATE4_GRAY                      337
+#define IMG_SP_EXPLOSION                       338
+#define IMG_SP_EXPLOSION_INFOTRON              339
+#define IMG_CONVEYOR_BELT1_MIDDLE              340
+#define IMG_CONVEYOR_BELT1_MIDDLE_RUNNING      341
+#define IMG_CONVEYOR_BELT1_LEFT                        342
+#define IMG_CONVEYOR_BELT1_LEFT_RUNNING                343
+#define IMG_CONVEYOR_BELT1_RIGHT               344
+#define IMG_CONVEYOR_BELT1_RIGHT_RUNNING       345
+#define IMG_CONVEYOR_BELT1_SWITCH_LEFT         346
+#define IMG_CONVEYOR_BELT1_SWITCH_MIDDLE       347
+#define IMG_CONVEYOR_BELT1_SWITCH_RIGHT                348
+#define IMG_CONVEYOR_BELT2_MIDDLE              349
+#define IMG_CONVEYOR_BELT2_MIDDLE_RUNNING      350
+#define IMG_CONVEYOR_BELT2_LEFT                        351
+#define IMG_CONVEYOR_BELT2_LEFT_RUNNING                352
+#define IMG_CONVEYOR_BELT2_RIGHT               353
+#define IMG_CONVEYOR_BELT2_RIGHT_RUNNING       354
+#define IMG_CONVEYOR_BELT2_SWITCH_LEFT         355
+#define IMG_CONVEYOR_BELT2_SWITCH_MIDDLE       356
+#define IMG_CONVEYOR_BELT2_SWITCH_RIGHT                357
+#define IMG_CONVEYOR_BELT3_MIDDLE              358
+#define IMG_CONVEYOR_BELT3_MIDDLE_RUNNING      359
+#define IMG_CONVEYOR_BELT3_LEFT                        360
+#define IMG_CONVEYOR_BELT3_LEFT_RUNNING                361
+#define IMG_CONVEYOR_BELT3_RIGHT               362
+#define IMG_CONVEYOR_BELT3_RIGHT_RUNNING       363
+#define IMG_CONVEYOR_BELT3_SWITCH_LEFT         364
+#define IMG_CONVEYOR_BELT3_SWITCH_MIDDLE       365
+#define IMG_CONVEYOR_BELT3_SWITCH_RIGHT                366
+#define IMG_CONVEYOR_BELT4_MIDDLE              367
+#define IMG_CONVEYOR_BELT4_MIDDLE_RUNNING      368
+#define IMG_CONVEYOR_BELT4_LEFT                        369
+#define IMG_CONVEYOR_BELT4_LEFT_RUNNING                370
+#define IMG_CONVEYOR_BELT4_RIGHT               371
+#define IMG_CONVEYOR_BELT4_RIGHT_RUNNING       372
+#define IMG_CONVEYOR_BELT4_SWITCH_LEFT         373
+#define IMG_CONVEYOR_BELT4_SWITCH_MIDDLE       374
+#define IMG_CONVEYOR_BELT4_SWITCH_RIGHT                375
+#define IMG_SWITCHGATE_SWITCH_UP               376
+#define IMG_SWITCHGATE_SWITCH_DOWN             377
+#define IMG_LIGHT_SWITCH_OFF                   378
+#define IMG_LIGHT_SWITCH_ON                    379
+#define IMG_TIMEGATE_WHEEL                     380
+#define IMG_TIMEGATE_WHEEL_RUNNING             381
+#define IMG_ENVELOPE                           382
+#define IMG_SIGN_EXCLAMATION                   383
+#define IMG_SIGN_STOP                          384
+#define IMG_LANDMINE                           385
+#define IMG_STEELWALL_SLANTED                  386
+#define IMG_EXTRA_TIME                         387
+#define IMG_SHIELD_ACTIVE                      388
+#define IMG_SHIELD_PASSIVE                     389
+#define IMG_SWITCHGATE_CLOSED                  390
+#define IMG_SWITCHGATE_OPENING                 391
+#define IMG_SWITCHGATE_OPEN                    392
+#define IMG_SWITCHGATE_CLOSING                 393
+#define IMG_TIMEGATE_CLOSED                    394
+#define IMG_TIMEGATE_OPENING                   395
+#define IMG_TIMEGATE_OPEN                      396
+#define IMG_TIMEGATE_CLOSING                   397
+#define IMG_BALLOON                            398
+#define IMG_BALLOON_MOVING                     399
+#define IMG_BALLOON_WINDROSE_LEFT              400
+#define IMG_BALLOON_WINDROSE_RIGHT             401
+#define IMG_BALLOON_WINDROSE_UP                        402
+#define IMG_BALLOON_WINDROSE_DOWN              403
+#define IMG_BALLOON_WINDROSE_ALL               404
+#define IMG_EMC_STEELWALL1                     405
+#define IMG_EMC_STEELWALL2                     406
+#define IMG_EMC_STEELWALL3                     407
+#define IMG_EMC_STEELWALL4                     408
+#define IMG_EMC_WALL_PILLAR_UPPER              409
+#define IMG_EMC_WALL_PILLAR_MIDDLE             410
+#define IMG_EMC_WALL_PILLAR_LOWER              411
+#define IMG_EMC_WALL4                          412
+#define IMG_EMC_WALL5                          413
+#define IMG_EMC_WALL6                          414
+#define IMG_EMC_WALL7                          415
+#define IMG_EMC_WALL8                          416
+#define IMG_ARROW_BLUE_LEFT                    417
+#define IMG_ARROW_BLUE_RIGHT                   418
+#define IMG_ARROW_BLUE_UP                      419
+#define IMG_ARROW_BLUE_DOWN                    420
+#define IMG_ARROW_RED_LEFT                     421
+#define IMG_ARROW_RED_RIGHT                    422
+#define IMG_ARROW_RED_UP                       423
+#define IMG_ARROW_RED_DOWN                     424
+#define IMG_SCROLLBAR_BLUE                     425
+#define IMG_SCROLLBAR_RED                      426
+#define IMG_SCROLLBAR_GREEN                    427
+#define IMG_SCROLLBAR_YELLOW                   428
+#define IMG_PEARL                              429
+#define IMG_PEARL_BREAKING                     430
+#define IMG_CRYSTAL                            431
+#define IMG_WALL_PEARL                         432
+#define IMG_WALL_CRYSTAL                       433
+#define IMG_SPRING                             434
+#define IMG_TUBE_RIGHT_DOWN                    435
+#define IMG_TUBE_HORIZONTAL_DOWN               436
+#define IMG_TUBE_LEFT_DOWN                     437
+#define IMG_TUBE_HORIZONTAL                    438
+#define IMG_TUBE_VERTICAL_RIGHT                        439
+#define IMG_TUBE_ALL                           440
+#define IMG_TUBE_VERTICAL_LEFT                 441
+#define IMG_TUBE_VERTICAL                      442
+#define IMG_TUBE_RIGHT_UP                      443
+#define IMG_TUBE_HORIZONTAL_UP                 444
+#define IMG_TUBE_LEFT_UP                       445
+#define IMG_TRAP_INACTIVE                      446
+#define IMG_TRAP_ACTIVE                                447
+#define IMG_TRAP_ACTIVATING                    448
+#define IMG_BD_WALL                            449
+#define IMG_BD_ROCK                            450
+#define IMG_BD_ROCK_FALLING                    451
+#define IMG_BD_ROCK_PUSHING                    452
+#define IMG_DX_BOMB                            453
+
+#define NUM_IMAGE_FILES                                454
+
 
 /* values for sound configuration suffixes */
 /* (currently none) */
@@ -2187,8 +2203,9 @@ extern struct FileInfo           *image_files, *sound_files;
 
 /* for DrawGraphicAnimation() [tools.c] and AnimateToon() [cartoons.c] */
 #define ANIM_NORMAL            0
-#define ANIM_PINGPONG          1
-#define ANIM_REVERSE           2
+#define ANIM_REVERSE           (1 << 0)
+#define ANIM_PINGPONG          (1 << 1)
+#define ANIM_PINGPONG2         (1 << 2)
 
 /* values for game_emulation */
 #define EMU_NONE               0