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];
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();
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);
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);
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;
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);
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)
{
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);
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<MAX_MENU_ENTRIES_ON_SCREEN; i++)
{
int entry = first_entry + i;
- DrawText(SX, SY + 64 + i * 32, "..................................",
+ DrawText(mSX, mSY + 64 + i * 32, "..................................",
(entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
- DrawText(SX, SY + 64 + i * 32, int2str(entry + 1, 3),
+ DrawText(mSX, mSY + 64 + i * 32, int2str(entry + 1, 3),
(entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
- DrawText(SX + 64, SY + 64 + i * 32, highscore[entry].Name,
+ DrawText(mSX + 64, mSY + 64 + i * 32, highscore[entry].Name,
(entry == highlight_position ? FONT_TEXT_3 : FONT_TEXT_1));
- DrawText(SX + 14 * 32 + 16, SY + 64 + i * 32,
+ DrawText(mSX + 14 * 32 + 16, mSY + 64 + i * 32,
int2str(highscore[entry].Score, 5),
(entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
}
!*(boolean *)(setup_info[pos].value))
font_nr = FONT_OPTION_OFF;
- DrawText(SX + xpos * 32, SY + ypos * 32,
+ DrawText(mSX + xpos * 32, mSY + ypos * 32,
(xpos == 3 ? " " : " "), font_nr);
- DrawText(SX + xpos * 32, SY + ypos * 32, value_string, font_nr);
+ DrawText(mSX + xpos * 32, mSY + ypos * 32, value_string, font_nr);
}
static void changeSetupValue(int pos)
title_string = "Setup Shortcuts";
}
- DrawText(SX + 16, SY + 16, title_string, FONT_TITLE_1);
+ DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1);
num_setup_info = 0;
for(i=0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++)
if (setup_info[i].type & TYPE_STRING)
font_nr = FONT_MENU_2;
- DrawText(SX + 32, SY + ypos * 32, setup_info[i].text, font_nr);
+ DrawText(mSX + 32, mSY + ypos * 32, setup_info[i].text, font_nr);
if (setup_info[i].type & TYPE_ENTER_MENU)
initCursor(i, IMG_MENU_BUTTON_RIGHT);
{
ClearWindow();
- DrawText(SX+16, SY+16, "Setup Input", FONT_TITLE_1);
+ DrawText(mSX+16, mSY+16, "Setup Input", FONT_TITLE_1);
initCursor(0, IMG_MENU_BUTTON);
initCursor(1, IMG_MENU_BUTTON);
drawCursorXY(10, 0, IMG_MENU_BUTTON_LEFT);
drawCursorXY(12, 0, IMG_MENU_BUTTON_RIGHT);
- DrawText(SX+32, SY+2*32, "Player:", FONT_MENU_1);
- DrawText(SX+32, SY+3*32, "Device:", FONT_MENU_1);
- DrawText(SX+32, SY+15*32, "Back", FONT_MENU_1);
+ DrawText(mSX+32, mSY+2*32, "Player:", FONT_MENU_1);
+ DrawText(mSX+32, mSY+3*32, "Device:", FONT_MENU_1);
+ DrawText(mSX+32, mSY+15*32, "Back", FONT_MENU_1);
#if 0
DeactivateJoystickForCalibration();
custom_key = setup.input[player_nr].key;
- DrawText(SX+11*32, SY+2*32, int2str(player_nr + 1, 1), FONT_INPUT_ACTIVE);
+ DrawText(mSX+11*32, mSY+2*32, int2str(player_nr + 1, 1), FONT_INPUT_ACTIVE);
DrawGraphicThruMask(8, 2, PLAYER_NR_GFX(IMG_PLAYER_1, player_nr), 0);
if (setup.input[player_nr].use_joystick)
{
char *device_name = setup.input[player_nr].joy.device_name;
- DrawText(SX+8*32, SY+3*32,
+ DrawText(mSX+8*32, mSY+3*32,
joystick_name[getJoystickNrFromDeviceName(device_name)],
FONT_VALUE_1);
- DrawText(SX+32, SY+4*32, "Calibrate", FONT_MENU_1);
+ DrawText(mSX+32, mSY+4*32, "Calibrate", FONT_MENU_1);
}
else
{
- DrawText(SX+8*32, SY+3*32, "Keyboard ", FONT_VALUE_1);
- DrawText(SX+32, SY+4*32, "Customize", FONT_MENU_1);
+ DrawText(mSX+8*32, mSY+3*32, "Keyboard ", FONT_VALUE_1);
+ DrawText(mSX+32, mSY+4*32, "Customize", FONT_MENU_1);
}
- DrawText(SX+32, SY+5*32, "Actual Settings:", FONT_MENU_1);
+ DrawText(mSX+32, mSY+5*32, "Actual Settings:", FONT_MENU_1);
drawCursorXY(1, 4, IMG_MENU_BUTTON_LEFT);
drawCursorXY(1, 5, IMG_MENU_BUTTON_RIGHT);
drawCursorXY(1, 6, IMG_MENU_BUTTON_UP);
drawCursorXY(1, 7, IMG_MENU_BUTTON_DOWN);
- DrawText(SX+2*32, SY+6*32, ":", FONT_VALUE_OLD);
- DrawText(SX+2*32, SY+7*32, ":", FONT_VALUE_OLD);
- DrawText(SX+2*32, SY+8*32, ":", FONT_VALUE_OLD);
- DrawText(SX+2*32, SY+9*32, ":", FONT_VALUE_OLD);
- DrawText(SX+32, SY+10*32, "Snap Field:", FONT_VALUE_OLD);
- DrawText(SX+32, SY+12*32, "Place Bomb:", FONT_VALUE_OLD);
+ DrawText(mSX+2*32, mSY+6*32, ":", FONT_VALUE_OLD);
+ DrawText(mSX+2*32, mSY+7*32, ":", FONT_VALUE_OLD);
+ DrawText(mSX+2*32, mSY+8*32, ":", FONT_VALUE_OLD);
+ DrawText(mSX+2*32, mSY+9*32, ":", FONT_VALUE_OLD);
+ DrawText(mSX+32, mSY+10*32, "Snap Field:", FONT_VALUE_OLD);
+ DrawText(mSX+32, mSY+12*32, "Place Bomb:", FONT_VALUE_OLD);
for (i=0; i<6; i++)
{
int ypos = 6 + i + (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);
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)
/* 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);
}
}
}
- 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);
{
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 */
}