X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=d02f2ccad59e8cdfc0155d590e6a37deb51fc930;hb=9073d88279c0b9c5be103a6bb4d5c608ab0d90cc;hp=0737cd79819653211c767bd71710f3bf841ee912;hpb=6c244f56b4911dc83930193a43497388b91696af;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 0737cd79..d02f2cca 100644 --- a/src/screens.c +++ b/src/screens.c @@ -75,9 +75,9 @@ static int setup_mode = SETUP_MODE_MAIN; static int mSX = SX; static int mSY = SY; #else -#define mSX (SX + (game_status == MAINMENU ? global.menu_draw_xoffset_MAIN : \ +#define mSX (SX + (game_status == GAME_MODE_MAIN ? global.menu_draw_xoffset_MAIN : \ global.menu_draw_xoffset)) -#define mSY (SY + (game_status == MAINMENU ? global.menu_draw_yoffset_MAIN : \ +#define mSY (SY + (game_status == GAME_MODE_MAIN ? global.menu_draw_yoffset_MAIN : \ global.menu_draw_yoffset)) #endif @@ -199,7 +199,6 @@ void DrawMainMenu() KeyboardAutoRepeatOn(); ActivateJoystick(); - SetMouseCursor(CURSOR_DEFAULT); SetDrawDeactivationMask(REDRAW_NONE); SetDrawBackgroundMask(REDRAW_FIELD); @@ -209,7 +208,7 @@ void DrawMainMenu() /* needed if last screen was the playing screen, invoked from level editor */ if (level_editor_test_game) { - game_status = LEVELED; + game_status = GAME_MODE_EDITOR; DrawLevelEd(); return; } @@ -258,7 +257,7 @@ void DrawMainMenu() DrawText(mSX + 32, mSY + 8*32, "Setup", FONT_MENU_1); DrawText(mSX + 32, mSY + 9*32, "Quit", FONT_MENU_1); - DrawText(mSX + 32 + name_width, mSY + 2*32, setup.player_name, FONT_INPUT); + DrawText(mSX + 32 + name_width, mSY + 2*32, setup.player_name, FONT_INPUT_1); DrawText(mSX + level_width + 5 * 32, mSY + 3*32, int2str(level_nr,3), FONT_VALUE_1); @@ -407,14 +406,14 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) { if (y == 0) { - game_status = TYPENAME; + game_status = GAME_MODE_PSEUDO_TYPENAME; HandleTypeName(strlen(setup.player_name), 0); } else if (y == 1) { if (leveldir_first) { - game_status = CHOOSELEVEL; + game_status = GAME_MODE_LEVELS; SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); @@ -425,7 +424,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) } else if (y == 2) { - game_status = HALLOFFAME; + game_status = GAME_MODE_SCORES; DrawHallOfFame(-1); } else if (y == 3) @@ -433,12 +432,12 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) if (leveldir_current->readonly && strcmp(setup.player_name, "Artsoft") != 0) Request("This level is read only !", REQ_CONFIRM); - game_status = LEVELED; + game_status = GAME_MODE_EDITOR; DrawLevelEd(); } else if (y == 4) { - game_status = HELPSCREEN; + game_status = GAME_MODE_INFO; DrawHelpScreen(); } else if (y == 5) @@ -452,14 +451,14 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) else #endif { - game_status = PLAYING; + game_status = GAME_MODE_PLAYING; StopAnimation(); InitGame(); } } else if (y == 6) { - game_status = SETUP; + game_status = GAME_MODE_SETUP; setup_mode = SETUP_MODE_MAIN; DrawSetupScreen(); } @@ -468,7 +467,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); if (Request("Do you really want to quit ?", REQ_ASK | REQ_STAY_CLOSED)) - game_status = EXITGAME; + game_status = GAME_MODE_QUIT; } } } @@ -477,7 +476,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) out: - if (game_status == MAINMENU) + if (game_status == GAME_MODE_MAIN) { DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, FALSE); DoAnimation(); @@ -492,116 +491,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) static long helpscreen_state; static int helpscreen_step[MAX_HELPSCREEN_ELS]; static int helpscreen_frame[MAX_HELPSCREEN_ELS]; -#if 0 -static int OLD_helpscreen_action[] = -{ - GFX_SPIELER1_DOWN,4,2, - GFX_SPIELER1_UP,4,2, - GFX_SPIELER1_LEFT,4,2, - GFX_SPIELER1_RIGHT,4,2, - GFX_SPIELER1_PUSH_LEFT,4,2, - GFX_SPIELER1_PUSH_RIGHT,4,2, HA_NEXT, - GFX_ERDREICH,1,100, HA_NEXT, - GFX_LEERRAUM,1,100, HA_NEXT, - GFX_MORAST_LEER,1,100, HA_NEXT, - GFX_BETON,1,100, HA_NEXT, - GFX_MAUERWERK,1,100, HA_NEXT, - GFX_MAUER_L1, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_R1, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_UP, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_DOWN,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_UNSICHTBAR,1,100, HA_NEXT, - GFX_FELSBODEN,1,100, HA_NEXT, - GFX_CHAR_A,30,4, GFX_CHAR_AUSRUF,32,4, HA_NEXT, - GFX_EDELSTEIN,2,5, HA_NEXT, - GFX_DIAMANT,2,5, HA_NEXT, - GFX_EDELSTEIN_BD,2,5, HA_NEXT, - GFX_EDELSTEIN_GELB,2,5, GFX_EDELSTEIN_ROT,2,5, - GFX_EDELSTEIN_LILA,2,5, HA_NEXT, - GFX_FELSBROCKEN,4,5, HA_NEXT, - GFX_BOMBE,1,50, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_KOKOSNUSS,1,50, GFX_CRACKINGNUT,3,1, GFX_EDELSTEIN,1,10, HA_NEXT, - GFX_ERZ_EDEL,1,50, GFX_EXPLOSION,8,1, GFX_EDELSTEIN,1,10, HA_NEXT, - GFX_ERZ_DIAM,1,50, GFX_EXPLOSION,8,1, GFX_DIAMANT,1,10, HA_NEXT, - GFX_ERZ_EDEL_BD,1,50, GFX_EXPLOSION,8,1,GFX_EDELSTEIN_BD,1,10,HA_NEXT, - GFX_ERZ_EDEL_GELB,1,50, GFX_EXPLOSION,8,1, - GFX_EDELSTEIN_GELB,1,10, GFX_ERZ_EDEL_ROT,1,50, - GFX_EXPLOSION,8,1, GFX_EDELSTEIN_ROT,1,10, - GFX_ERZ_EDEL_LILA,1,50, GFX_EXPLOSION,8,1, - GFX_EDELSTEIN_LILA,1,10, HA_NEXT, - GFX_GEBLUBBER,4,4, HA_NEXT, - GFX_SCHLUESSEL1,4,25, HA_NEXT, - GFX_PFORTE1,4,25, HA_NEXT, - GFX_PFORTE1X,4,25, HA_NEXT, - GFX_DYNAMIT_AUS,1,100, HA_NEXT, - GFX_DYNAMIT,7,6, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_DYNABOMB+0,4,3, GFX_DYNABOMB+3,1,3, GFX_DYNABOMB+2,1,3, - GFX_DYNABOMB+1,1,3, GFX_DYNABOMB+0,1,3, GFX_EXPLOSION,8,1, - GFX_LEERRAUM,1,10, HA_NEXT, - GFX_DYNABOMB_NR,1,100, HA_NEXT, - GFX_DYNABOMB_SZ,1,100, HA_NEXT, - GFX_FLIEGER+4,1,3, GFX_FLIEGER+0,1,3, GFX_FLIEGER+4,1,3, - GFX_FLIEGER+5,1,3, GFX_FLIEGER+1,1,3, GFX_FLIEGER+5,1,3, - GFX_FLIEGER+6,1,3, GFX_FLIEGER+2,1,3, GFX_FLIEGER+6,1,3, - GFX_FLIEGER+7,1,3, GFX_FLIEGER+3,1,3, GFX_FLIEGER+7,1,3, HA_NEXT, - GFX_KAEFER+4,1,1, GFX_KAEFER+0,1,1, GFX_KAEFER+4,1,1, - GFX_KAEFER+5,1,1, GFX_KAEFER+1,1,1, GFX_KAEFER+5,1,1, - GFX_KAEFER+6,1,1, GFX_KAEFER+2,1,1, GFX_KAEFER+6,1,1, - GFX_KAEFER+7,1,1, GFX_KAEFER+3,1,1, GFX_KAEFER+7,1,1, HA_NEXT, - GFX_BUTTERFLY,2,2, HA_NEXT, - GFX_FIREFLY,2,2, HA_NEXT, - GFX_PACMAN+0,1,3, GFX_PACMAN+4,1,2, GFX_PACMAN+0,1,3, - GFX_PACMAN+1,1,3, GFX_PACMAN+5,1,2, GFX_PACMAN+1,1,3, - GFX_PACMAN+2,1,3, GFX_PACMAN+6,1,2, GFX_PACMAN+2,1,3, - GFX_PACMAN+3,1,3, GFX_PACMAN+7,1,2, GFX_PACMAN+3,1,3, HA_NEXT, - GFX_MAMPFER+0,4,1, GFX_MAMPFER+3,1,1, GFX_MAMPFER+2,1,1, - GFX_MAMPFER+1,1,1, GFX_MAMPFER+0,1,1, HA_NEXT, - GFX_MAMPFER2+0,4,1, GFX_MAMPFER2+3,1,1, GFX_MAMPFER2+2,1,1, - GFX_MAMPFER2+1,1,1, GFX_MAMPFER2+0,1,1, HA_NEXT, - GFX_ROBOT+0,4,1, GFX_ROBOT+3,1,1, GFX_ROBOT+2,1,1, - GFX_ROBOT+1,1,1, GFX_ROBOT+0,1,1, HA_NEXT, - GFX_MOLE_DOWN,4,2, - GFX_MOLE_UP,4,2, - GFX_MOLE_LEFT,4,2, - GFX_MOLE_RIGHT,4,2, HA_NEXT, - GFX_PINGUIN_DOWN,4,2, - GFX_PINGUIN_UP,4,2, - GFX_PINGUIN_LEFT,4,2, - GFX_PINGUIN_RIGHT,4,2, HA_NEXT, - GFX_SCHWEIN_DOWN,4,2, - GFX_SCHWEIN_UP,4,2, - GFX_SCHWEIN_LEFT,4,2, - GFX_SCHWEIN_RIGHT,4,2, HA_NEXT, - GFX_DRACHE_DOWN,4,2, - GFX_DRACHE_UP,4,2, - GFX_DRACHE_LEFT,4,2, - GFX_DRACHE_RIGHT,4,2, HA_NEXT, - GFX_SONDE_START,8,1, HA_NEXT, - GFX_ABLENK,4,1, HA_NEXT, - GFX_BIRNE_AUS,1,25, GFX_BIRNE_EIN,1,25, HA_NEXT, - GFX_ZEIT_VOLL,1,25, GFX_ZEIT_LEER,1,25, HA_NEXT, - GFX_TROPFEN,1,25, GFX_AMOEBING,4,1, GFX_AMOEBE_LEBT,1,10, HA_NEXT, - GFX_AMOEBE_TOT+2,2,50, GFX_AMOEBE_TOT,2,50, HA_NEXT, - GFX_AMOEBE_LEBT,4,40, HA_NEXT, - GFX_AMOEBE_LEBT,1,10, GFX_AMOEBING,4,2, HA_NEXT, - GFX_AMOEBE_LEBT,1,25, GFX_AMOEBE_TOT,1,25, GFX_EXPLOSION,8,1, - GFX_DIAMANT,1,10, HA_NEXT, - GFX_LIFE,1,100, HA_NEXT, - GFX_LIFE_ASYNC,1,100, HA_NEXT, - GFX_MAGIC_WALL_OFF,4,2, HA_NEXT, - GFX_MAGIC_WALL_BD_OFF,4,2, HA_NEXT, - GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2, - GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2, - GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT, - GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2, - GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT, - GFX_SOKOBAN_OBJEKT,1,100, HA_NEXT, - GFX_SOKOBAN_FELD_LEER,1,100, HA_NEXT, - GFX_SOKOBAN_FELD_VOLL,1,100, HA_NEXT, - GFX_SPEED_PILL,1,100, HA_NEXT, - HA_END -}; -#endif static int helpscreen_action[] = { @@ -710,9 +599,11 @@ static int helpscreen_action[] = IMG_EXPLOSION, 16, IMG_EMPTY_SPACE, 20, HA_NEXT, - EL_DYNABOMB_INCREASE_NUMBER, -1, HA_NEXT, + IMG_DYNABOMB_INCREASE_NUMBER, -1, HA_NEXT, + + IMG_DYNABOMB_INCREASE_SIZE, -1, HA_NEXT, - EL_DYNABOMB_INCREASE_SIZE, -1, HA_NEXT, + IMG_DYNABOMB_INCREASE_POWER, -1, HA_NEXT, IMG_SPACESHIP_RIGHT, 16, IMG_SPACESHIP_UP, 16, @@ -842,6 +733,7 @@ static char *helpscreen_eltext[][2] = {"Dyna Bomb: Explodes in 4 directions","with variable explosion size"}, {"Dyna Bomb: Increases the number of", "dyna bombs available at a time"}, {"Dyna Bomb: Increases the size of", "explosion of dyna bombs"}, + {"Dyna Bomb: Increases the power of", "explosion of dyna bombs"}, {"Spaceship: Moves at the left side", "of walls; don't touch it!"}, {"Bug: Moves at the right side", "of walls; don't touch it!"}, {"Butterfly: Moves at the right side", "of walls; don't touch it!"}, @@ -1209,7 +1101,7 @@ void HandleHelpScreen(int button) { FadeSounds(); - game_status = MAINMENU; + game_status = GAME_MODE_MAIN; DrawMainMenu(); } } @@ -1239,7 +1131,7 @@ void HandleHelpScreen(int button) void HandleTypeName(int newxpos, Key key) { static int xpos = 0, ypos = 2; - int font_width = getFontWidth(FONT_INPUT_ACTIVE); + int font_width = getFontWidth(FONT_INPUT_1_ACTIVE); int name_width = getFontWidth(FONT_MENU_1) * strlen("Name:"); int startx = mSX + 32 + name_width; int starty = mSY + ypos * 32; @@ -1248,8 +1140,8 @@ void HandleTypeName(int newxpos, Key key) { xpos = newxpos; - DrawText(startx, starty, setup.player_name, FONT_INPUT_ACTIVE); - DrawText(startx + xpos * font_width, starty, "_", FONT_INPUT_ACTIVE); + DrawText(startx, starty, setup.player_name, FONT_INPUT_1_ACTIVE); + DrawText(startx + xpos * font_width, starty, "_", FONT_INPUT_1_ACTIVE); return; } @@ -1269,23 +1161,23 @@ void HandleTypeName(int newxpos, Key key) setup.player_name[xpos + 1] = 0; xpos++; - DrawText(startx, starty, setup.player_name, FONT_INPUT_ACTIVE); - DrawText(startx + xpos * font_width, starty, "_", FONT_INPUT_ACTIVE); + DrawText(startx, starty, setup.player_name, FONT_INPUT_1_ACTIVE); + DrawText(startx + xpos * font_width, starty, "_", FONT_INPUT_1_ACTIVE); } else if ((key == KSYM_Delete || key == KSYM_BackSpace) && xpos > 0) { xpos--; setup.player_name[xpos] = 0; - DrawText(startx + xpos * font_width, starty, "_ ", FONT_INPUT_ACTIVE); + DrawText(startx + xpos * font_width, starty, "_ ", FONT_INPUT_1_ACTIVE); } else if (key == KSYM_Return && xpos > 0) { - DrawText(startx, starty, setup.player_name, FONT_INPUT); - DrawText(startx + xpos * font_width, starty, " ", FONT_INPUT_ACTIVE); + DrawText(startx, starty, setup.player_name, FONT_INPUT_1); + DrawText(startx + xpos * font_width, starty, " ", FONT_INPUT_1_ACTIVE); SaveSetup(); - game_status = MAINMENU; + game_status = GAME_MODE_MAIN; } BackToFront(); @@ -1343,7 +1235,8 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, DrawText(SX + offset, SY + offset, title_string, FONT_TITLE_1); - game_status = CHOOSELEVEL; /* force LEVELS font on artwork setup screen */ + /* force LEVELS font on artwork setup screen */ + game_status = GAME_MODE_LEVELS; for(i=0; inode_parent; DrawChooseTree(ti_ptr); } - else if (game_status == SETUP) + else if (game_status == GAME_MODE_SETUP) { execSetupArtwork(); } else { - game_status = MAINMENU; + game_status = GAME_MODE_MAIN; DrawMainMenu(); } @@ -1597,13 +1490,13 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, TapeErase(); } - if (game_status == SETUP) + if (game_status == GAME_MODE_SETUP) { execSetupArtwork(); } else { - game_status = MAINMENU; + game_status = GAME_MODE_MAIN; DrawMainMenu(); } } @@ -1612,7 +1505,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, BackToFront(); - if (game_status == CHOOSELEVEL || game_status == SETUP) + if (game_status == GAME_MODE_LEVELS || game_status == GAME_MODE_SETUP) DoAnimation(); } @@ -1662,16 +1555,22 @@ static void drawHallOfFameList(int first_entry, int highlight_position) for(i=0; iLevelSolved) @@ -3029,7 +2928,7 @@ static void CreateScreenScrollbars() GDI_STATE, GD_BUTTON_UNPRESSED, GDI_DESIGN_UNPRESSED, gd_bitmap_unpressed, gd_x1, gd_y1, GDI_DESIGN_PRESSED, gd_bitmap_pressed, gd_x2, gd_y2, - GDI_BORDER_SIZE, SC_BORDER_SIZE, + GDI_BORDER_SIZE, SC_BORDER_SIZE, SC_BORDER_SIZE, GDI_EVENT_MASK, event_mask, GDI_CALLBACK_ACTION, HandleScreenGadgets, GDI_END); @@ -3111,29 +3010,29 @@ static void HandleScreenGadgets(struct GadgetInfo *gi) { int id = gi->custom_id; - if (game_status != CHOOSELEVEL && game_status != SETUP) + if (game_status != GAME_MODE_LEVELS && game_status != GAME_MODE_SETUP) return; switch (id) { case SCREEN_CTRL_ID_SCROLL_UP: - if (game_status == CHOOSELEVEL) + if (game_status == GAME_MODE_LEVELS) HandleChooseLevel(SX,SY + 32, 0,0, MB_MENU_MARK); - else if (game_status == SETUP) + else if (game_status == GAME_MODE_SETUP) HandleSetupScreen(SX,SY + 32, 0,0, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_DOWN: - if (game_status == CHOOSELEVEL) + if (game_status == GAME_MODE_LEVELS) HandleChooseLevel(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK); - else if (game_status == SETUP) + else if (game_status == GAME_MODE_SETUP) HandleSetupScreen(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_VERTICAL: - if (game_status == CHOOSELEVEL) + if (game_status == GAME_MODE_LEVELS) HandleChooseLevel(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE); - else if (game_status == SETUP) + else if (game_status == GAME_MODE_SETUP) HandleSetupScreen(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE); break;