From: Holger Schemel Date: Fri, 7 Mar 2003 00:01:14 +0000 (+0100) Subject: rnd-20030307-1-src X-Git-Tag: 3.0.0^2~125 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b8ccb648b89e24b27f8a60e2d8e9a4680322bd86;p=rocksndiamonds.git rnd-20030307-1-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index a5ea0940..be598547 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -3154,5 +3154,13 @@ struct ConfigInfo image_config[] = { "global.num_toons", "20" }, + { "menu.draw_xoffset", "0" }, + { "menu.draw_yoffset", "0" }, + { "menu.draw_xoffset.MAIN", "0" }, + { "menu.draw_yoffset.MAIN", "0" }, + + { "door.step_offset", "2" }, + { "door.step_delay", "10" }, + { NULL, NULL } }; diff --git a/src/conftime.h b/src/conftime.h index df5c19f5..64cae4a1 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-03-06 23:15]" +#define COMPILE_DATE_STRING "[2003-03-07 00:59]" diff --git a/src/files.c b/src/files.c index d9d927b7..4eecf9fd 100644 --- a/src/files.c +++ b/src/files.c @@ -1703,6 +1703,12 @@ void LoadSpecialMenuDesignSettings() /* !!! CHANGE THIS !!! (redundant initialization) !!! */ global.num_toons = 20; + global.menu_draw_xoffset = 0; + global.menu_draw_yoffset = 0; + global.menu_draw_xoffset_MAIN = 0; + global.menu_draw_yoffset_MAIN = 0; + global.door_step_offset = 2; + global.door_step_delay = 10; if ((setup_file_list = loadSetupFileList(filename)) == NULL) return; @@ -1711,5 +1717,29 @@ void LoadSpecialMenuDesignSettings() if (value != NULL) global.num_toons = get_integer_from_string(value); + value = getTokenValue(setup_file_list, "menu.draw_xoffset"); + if (value != NULL) + global.menu_draw_xoffset = get_integer_from_string(value); + + value = getTokenValue(setup_file_list, "menu.draw_yoffset"); + if (value != NULL) + global.menu_draw_yoffset = get_integer_from_string(value); + + value = getTokenValue(setup_file_list, "menu.draw_xoffset.MAIN"); + if (value != NULL) + global.menu_draw_xoffset_MAIN = get_integer_from_string(value); + + value = getTokenValue(setup_file_list, "menu.draw_yoffset.MAIN"); + if (value != NULL) + global.menu_draw_yoffset_MAIN = get_integer_from_string(value); + + value = getTokenValue(setup_file_list, "door.step_offset"); + if (value != NULL) + global.door_step_offset = get_integer_from_string(value); + + value = getTokenValue(setup_file_list, "door.step_delay"); + if (value != NULL) + global.door_step_delay = get_integer_from_string(value); + freeSetupFileList(setup_file_list); } diff --git a/src/init.c b/src/init.c index 222d4c15..b689911c 100644 --- a/src/init.c +++ b/src/init.c @@ -188,6 +188,12 @@ static void InitArtworkConfig() "name", "sort_priority", "global.num_toons", + "menu.draw_xoffset", + "menu.draw_yoffset", + "menu.draw_xoffset.MAIN", + "menu.draw_yoffset.MAIN", + "door.step_offset", + "door.step_delay", NULL }; static char *ignore_sound_tokens[] = diff --git a/src/main.h b/src/main.h index aa5926f5..5cb0c225 100644 --- a/src/main.h +++ b/src/main.h @@ -1050,6 +1050,14 @@ struct GlobalInfo int num_toons; + int menu_draw_xoffset; + int menu_draw_yoffset; + int menu_draw_xoffset_MAIN; + int menu_draw_yoffset_MAIN; + + int door_step_offset; + int door_step_delay; + float frames_per_second; boolean fps_slowdown; int fps_slowdown_factor; diff --git a/src/screens.c b/src/screens.c index b16ca49c..285aa2cf 100644 --- a/src/screens.c +++ b/src/screens.c @@ -71,6 +71,16 @@ static void HandleChooseTree(int, int, int, int, int, TreeInfo **); static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS]; static int setup_mode = SETUP_MODE_MAIN; +#if 0 +static int mSX = SX; +static int mSY = SY; +#else +#define mSX (SX + (game_status == MAINMENU ? global.menu_draw_xoffset_MAIN : \ + global.menu_draw_xoffset)) +#define mSY (SY + (game_status == MAINMENU ? global.menu_draw_yoffset_MAIN : \ + global.menu_draw_yoffset)) +#endif + #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) #define NUM_SCROLLBAR_BITMAPS 2 static Bitmap *scrollbar_bitmap[NUM_SCROLLBAR_BITMAPS]; @@ -171,6 +181,11 @@ void DrawMainMenu() int name_width = getFontWidth(FONT_MENU_1) * strlen("Name:"); int i; +#if 0 + mSX = SX + global.menu_draw_xoffset; + mSY = SY + global.menu_draw_yoffset; +#endif + UnmapAllGadgets(); FadeSounds(); @@ -225,16 +240,16 @@ void DrawMainMenu() DrawHeadline(); - DrawText(SX + 32, SY + 2*32, name_text, FONT_MENU_1); - DrawText(SX + 32 + name_width, SY + 2*32, setup.player_name, FONT_INPUT); - DrawText(SX + 32, SY + 3*32, "Level:", FONT_MENU_1); - DrawText(SX + 11 * 32, SY + 3*32, int2str(level_nr,3), FONT_VALUE_1); - DrawText(SX + 32, SY + 4*32, "Hall Of Fame", FONT_MENU_1); - DrawText(SX + 32, SY + 5*32, "Level Creator", FONT_MENU_1); - DrawText(SY + 32, SY + 6*32, "Info Screen", FONT_MENU_1); - DrawText(SX + 32, SY + 7*32, "Start Game", FONT_MENU_1); - DrawText(SX + 32, SY + 8*32, "Setup", FONT_MENU_1); - DrawText(SX + 32, SY + 9*32, "Quit", FONT_MENU_1); + DrawText(mSX + 32, mSY + 2*32, name_text, FONT_MENU_1); + DrawText(mSX + 32 + name_width, mSY + 2*32, setup.player_name, FONT_INPUT); + DrawText(mSX + 32, mSY + 3*32, "Level:", FONT_MENU_1); + DrawText(mSX + 11 * 32, mSY + 3*32, int2str(level_nr,3), FONT_VALUE_1); + DrawText(mSX + 32, mSY + 4*32, "Hall Of Fame", FONT_MENU_1); + DrawText(mSX + 32, mSY + 5*32, "Level Creator", FONT_MENU_1); + DrawText(mSY + 32, mSY + 6*32, "Info Screen", FONT_MENU_1); + DrawText(mSX + 32, mSY + 7*32, "Start Game", FONT_MENU_1); + DrawText(mSX + 32, mSY + 8*32, "Setup", FONT_MENU_1); + DrawText(mSX + 32, mSY + 9*32, "Quit", FONT_MENU_1); DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, TRUE); @@ -354,7 +369,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) level_nr = new_level_nr; - DrawText(SX + 11 * 32, SY + 3 * 32, int2str(level_nr, 3), FONT_VALUE_1); + DrawText(mSX + 11 * 32, mSY + 3 * 32, int2str(level_nr, 3), FONT_VALUE_1); LoadLevel(level_nr); DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, TRUE); @@ -937,8 +952,8 @@ void OLD_DrawHelpScreenElAction(int start) void DrawHelpScreenElAction(int start) { int i = 0, j = 0; - int xstart = SX + 16; - int ystart = SY + 64 + 2 * 32; + int xstart = mSX + 16; + int ystart = mSY + 64 + 2 * 32; int ystep = TILEY + 4; int graphic; int frame_count; @@ -1011,7 +1026,7 @@ void DrawHelpScreenElAction(int start) void DrawHelpScreenElText(int start) { int i; - int xstart = SX + 56, ystart = SY + 65 + 2 * 32, ystep = TILEY + 4; + int xstart = mSX + 56, ystart = mSY + 65 + 2 * 32, ystep = TILEY + 4; int ybottom = SYSIZE - 20; SetMainBackgroundImage(IMG_BACKGROUND_INFO); @@ -1221,8 +1236,8 @@ void HandleTypeName(int newxpos, Key key) static int xpos = 0, ypos = 2; int font_width = getFontWidth(FONT_INPUT_ACTIVE); int name_width = getFontWidth(FONT_MENU_1) * strlen("Name:"); - int startx = SX + 32 + name_width; - int starty = SY + ypos * 32; + int startx = mSX + 32 + name_width; + int starty = mSY + ypos * 32; if (newxpos) { @@ -1337,7 +1352,7 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, strncpy(buffer, node->name , max_buffer_len); buffer[max_buffer_len] = '\0'; - DrawText(SX + 32, SY + ypos * 32, buffer, FONT_TEXT_1 + node->color); + DrawText(mSX + 32, mSY + ypos * 32, buffer, FONT_TEXT_1 + node->color); if (node->parent_link) initCursor(i, IMG_MENU_BUTTON_LEFT); @@ -1636,20 +1651,20 @@ static void drawHallOfFameList(int first_entry, int highlight_position) SetMainBackgroundImage(IMG_BACKGROUND_SCORES); ClearWindow(); - DrawText(SX + 80, SY + 8, "Hall Of Fame", FONT_TITLE_1); + DrawText(mSX + 80, mSY + 8, "Hall Of Fame", FONT_TITLE_1); DrawTextFCentered(46, FONT_TITLE_2, "HighScores of Level %d", level_nr); for(i=0; i 3 ? i-3 : 0); - DrawText(SX + 3*32, SY + ypos*32, + DrawText(mSX + 3*32, mSY + ypos*32, " ", FONT_VALUE_1); - DrawText(SX + 3*32, SY + ypos*32, + DrawText(mSX + 3*32, mSY + ypos*32, (setup.input[player_nr].use_joystick ? custom[i].text : getKeyNameFromKey(*custom[i].key)), FONT_VALUE_1); @@ -2477,17 +2492,17 @@ void CustomizeKeyboard(int player_nr) custom_key = setup.input[player_nr].key; ClearWindow(); - DrawText(SX + 16, SY + 16, "Keyboard Input", FONT_TITLE_1); + DrawText(mSX + 16, mSY + 16, "Keyboard Input", FONT_TITLE_1); BackToFront(); InitAnimation(); step_nr = 0; - DrawText(SX, SY + (2+2*step_nr)*32, + DrawText(mSX, mSY + (2+2*step_nr)*32, customize_step[step_nr].text, FONT_INPUT_ACTIVE); - DrawText(SX, SY + (2+2*step_nr+1)*32, + DrawText(mSX, mSY + (2+2*step_nr+1)*32, "Key:", FONT_INPUT_ACTIVE); - DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, + DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD); while(!finished) @@ -2527,32 +2542,32 @@ void CustomizeKeyboard(int player_nr) /* got new key binding */ *customize_step[step_nr].key = key; - DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, + DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, " ", FONT_VALUE_1); - DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, + DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, getKeyNameFromKey(key), FONT_VALUE_1); step_nr++; /* un-highlight last query */ - DrawText(SX, SY+(2+2*(step_nr-1))*32, + DrawText(mSX, mSY+(2+2*(step_nr-1))*32, customize_step[step_nr-1].text, FONT_MENU_1); - DrawText(SX, SY+(2+2*(step_nr-1)+1)*32, + DrawText(mSX, mSY+(2+2*(step_nr-1)+1)*32, "Key:", FONT_MENU_1); /* press 'Enter' to leave */ if (step_nr == 6) { - DrawText(SX + 16, SY + 15*32+16, + DrawText(mSX + 16, mSY + 15*32+16, "Press Enter", FONT_TITLE_1); break; } /* query next key binding */ - DrawText(SX, SY+(2+2*step_nr)*32, + DrawText(mSX, mSY+(2+2*step_nr)*32, customize_step[step_nr].text, FONT_INPUT_ACTIVE); - DrawText(SX, SY+(2+2*step_nr+1)*32, + DrawText(mSX, mSY+(2+2*step_nr+1)*32, "Key:", FONT_INPUT_ACTIVE); - DrawText(SX + 4*32, SY+(2+2*step_nr+1)*32, + DrawText(mSX + 4*32, mSY+(2+2*step_nr+1)*32, getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD); } @@ -2615,13 +2630,13 @@ static boolean CalibrateJoystickMain(int player_nr) } } - DrawText(SX, SY + 6 * 32, " ROTATE JOYSTICK ", FONT_TITLE_1); - DrawText(SX, SY + 7 * 32, "IN ALL DIRECTIONS", FONT_TITLE_1); - DrawText(SX + 16, SY + 9 * 32, " IF ALL BALLS ", FONT_TITLE_1); - DrawText(SX, SY + 10 * 32, " ARE YELLOW, ", FONT_TITLE_1); - DrawText(SX, SY + 11 * 32, " CENTER JOYSTICK ", FONT_TITLE_1); - DrawText(SX, SY + 12 * 32, " AND ", FONT_TITLE_1); - DrawText(SX, SY + 13 * 32, "PRESS ANY BUTTON!", FONT_TITLE_1); + DrawText(mSX, mSY + 6 * 32, " ROTATE JOYSTICK ", FONT_TITLE_1); + DrawText(mSX, mSY + 7 * 32, "IN ALL DIRECTIONS", FONT_TITLE_1); + DrawText(mSX + 16, mSY + 9 * 32, " IF ALL BALLS ", FONT_TITLE_1); + DrawText(mSX, mSY + 10 * 32, " ARE YELLOW, ", FONT_TITLE_1); + DrawText(mSX, mSY + 11 * 32, " CENTER JOYSTICK ", FONT_TITLE_1); + DrawText(mSX, mSY + 12 * 32, " AND ", FONT_TITLE_1); + DrawText(mSX, mSY + 13 * 32, "PRESS ANY BUTTON!", FONT_TITLE_1); joy_value = Joystick(player_nr); last_x = (joy_value & JOY_LEFT ? -1 : joy_value & JOY_RIGHT ? +1 : 0); @@ -2772,8 +2787,8 @@ void CalibrateJoystick(int player_nr) { ClearWindow(); - DrawText(SX + 16, SY + 6*32, " JOYSTICK NOT ", FONT_TITLE_1); - DrawText(SX, SY + 7*32, " AVAILABLE ", FONT_TITLE_1); + DrawText(mSX + 16, mSY + 6*32, " JOYSTICK NOT ", FONT_TITLE_1); + DrawText(mSX, mSY + 7*32, " AVAILABLE ", FONT_TITLE_1); BackToFront(); Delay(2000); /* show error message for two seconds */ } diff --git a/src/tools.c b/src/tools.c index 979eead9..7a4f1014 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2056,8 +2056,8 @@ unsigned int MoveDoor(unsigned int door_state) static int door1 = DOOR_OPEN_1; static int door2 = DOOR_CLOSE_2; static unsigned long door_delay = 0; - int x, start, stepsize = 2; - unsigned long door_delay_value = stepsize * 5; + int x, start, stepsize = global.door_step_offset; + unsigned long door_delay_value = global.door_step_delay; if (door_state == DOOR_GET_STATE) return(door1 | door2);