Revert "Adapt the menu properly when resizing the window."
This reverts commit 4b2811b56b
.
This commit is contained in:
parent
dabda7f436
commit
3c866fe150
147
src/title.c
147
src/title.c
|
@ -211,15 +211,12 @@ This is the main title screen, with the stars whirling past and the
|
||||||
*/
|
*/
|
||||||
int title_show()
|
int title_show()
|
||||||
{
|
{
|
||||||
int continueSaveSlot = -1;
|
int continueSaveSlot;
|
||||||
|
|
||||||
int lastScreenW = -1;
|
int prx;
|
||||||
int lastScreenH = -1;
|
int pry;
|
||||||
|
int sfx;
|
||||||
int prx = 0;
|
int sfy;
|
||||||
int pry = 0;
|
|
||||||
int sfx = 0;
|
|
||||||
int sfy = 0;
|
|
||||||
|
|
||||||
int then;
|
int then;
|
||||||
int now;
|
int now;
|
||||||
|
@ -251,59 +248,14 @@ int title_show()
|
||||||
renderer_update();
|
renderer_update();
|
||||||
screen_clear(black);
|
screen_clear(black);
|
||||||
|
|
||||||
|
continueSaveSlot = save_initSlots();
|
||||||
|
|
||||||
gfx_loadBackground("gfx/spirit.jpg");
|
gfx_loadBackground("gfx/spirit.jpg");
|
||||||
|
|
||||||
SDL_Surface *prlogo, *sflogo;
|
SDL_Surface *prlogo, *sflogo;
|
||||||
prlogo = gfx_loadImage("gfx/prlogo.png");
|
prlogo = gfx_loadImage("gfx/prlogo.png");
|
||||||
sflogo = gfx_loadImage("gfx/sflogo.png");
|
sflogo = gfx_loadImage("gfx/sflogo.png");
|
||||||
|
|
||||||
// Set the star motion
|
|
||||||
engine.ssx = -0.5;
|
|
||||||
engine.ssy = 0;
|
|
||||||
engine.smx = 0;
|
|
||||||
engine.smy = 0;
|
|
||||||
|
|
||||||
then = SDL_GetTicks();
|
|
||||||
|
|
||||||
for (int i = 0 ; i < 15 ; i++)
|
|
||||||
{
|
|
||||||
aliens[i] = alien_defs[rand() % 3];
|
|
||||||
if ((rand() % 5) == 0)
|
|
||||||
aliens[i] = alien_defs[CD_TRANSPORTSHIP];
|
|
||||||
if ((rand() % 5) == 0)
|
|
||||||
aliens[i] = alien_defs[CD_MINER];
|
|
||||||
aliens[i].x = rand() % screen->w;
|
|
||||||
aliens[i].y = rand() % (screen->h - 40);
|
|
||||||
aliens[i].dx = 1 + rand() % 3;
|
|
||||||
aliens[i].face = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(buildVersion, "Version %s", VERSION );
|
|
||||||
|
|
||||||
SDL_Rect optionRec;
|
|
||||||
|
|
||||||
// Initializing is actually unnecessary as these will get
|
|
||||||
// overridden; these are just here to suppress compiler warnings.
|
|
||||||
optionRec.x = screen->w / 2 - 110;
|
|
||||||
optionRec.y = screen->h / 3 + 45;
|
|
||||||
optionRec.h = 22;
|
|
||||||
optionRec.w = 215;
|
|
||||||
|
|
||||||
screen_drawBackground();
|
|
||||||
|
|
||||||
engine.done = 0;
|
|
||||||
player_flushInput();
|
|
||||||
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
|
||||||
|
|
||||||
audio_playMusic("music/walking_among_androids.ogg", 1);
|
|
||||||
|
|
||||||
while (!engine.done)
|
|
||||||
{
|
|
||||||
if ((lastScreenW != screen->w) || (lastScreenH != screen->h))
|
|
||||||
{
|
|
||||||
lastScreenW = screen->w;
|
|
||||||
lastScreenH = screen->h;
|
|
||||||
|
|
||||||
prx = ((screen->w - prlogo->w) / 2);
|
prx = ((screen->w - prlogo->w) / 2);
|
||||||
pry = ((screen->h - prlogo->h) / 2);
|
pry = ((screen->h - prlogo->h) / 2);
|
||||||
|
|
||||||
|
@ -329,23 +281,58 @@ int title_show()
|
||||||
gfx_createTextObject(TS_QUIT, "QUIT",
|
gfx_createTextObject(TS_QUIT, "QUIT",
|
||||||
-1, screen->h / 3 + 150, FONT_WHITE);
|
-1, screen->h / 3 + 150, FONT_WHITE);
|
||||||
|
|
||||||
continueSaveSlot = save_initSlots();
|
|
||||||
|
|
||||||
createOptionsMenu();
|
createOptionsMenu();
|
||||||
createDifficultyMenu();
|
createDifficultyMenu();
|
||||||
gfx_createTextObject(TS_BACK_TO_MAIN_MENU, "BACK TO MAIN MENU", -1, 0, FONT_WHITE);
|
gfx_createTextObject(TS_BACK_TO_MAIN_MENU, "BACK TO MAIN MENU", -1, 0, FONT_WHITE);
|
||||||
|
|
||||||
createCheatMenu();
|
createCheatMenu();
|
||||||
|
|
||||||
|
// Set the star motion
|
||||||
|
engine.ssx = -0.5;
|
||||||
|
engine.ssy = 0;
|
||||||
|
engine.smx = 0;
|
||||||
|
engine.smy = 0;
|
||||||
|
|
||||||
|
then = SDL_GetTicks();
|
||||||
|
|
||||||
|
for (int i = 0 ; i < 15 ; i++)
|
||||||
|
{
|
||||||
|
aliens[i] = alien_defs[rand() % 3];
|
||||||
|
if ((rand() % 5) == 0)
|
||||||
|
aliens[i] = alien_defs[CD_TRANSPORTSHIP];
|
||||||
|
if ((rand() % 5) == 0)
|
||||||
|
aliens[i] = alien_defs[CD_MINER];
|
||||||
|
aliens[i].x = rand() % screen->w;
|
||||||
|
aliens[i].y = rand() % (screen->h - 40);
|
||||||
|
aliens[i].dx = 1 + rand() % 3;
|
||||||
|
aliens[i].face = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(buildVersion, "Version %s", VERSION );
|
||||||
|
|
||||||
|
SDL_Rect optionRec;
|
||||||
|
|
||||||
optionRec.x = screen->w / 2 - 110;
|
optionRec.x = screen->w / 2 - 110;
|
||||||
|
optionRec.y = screen->h / 3 + 45;
|
||||||
optionRec.h = 22;
|
optionRec.h = 22;
|
||||||
optionRec.w = 215;
|
optionRec.w = 215;
|
||||||
|
|
||||||
optionRec.y = screen->h / 3 + 26 + (20 * selectedOption);
|
if (continueSaveSlot != -1)
|
||||||
if ((menuType > MENU_MAIN) && (selectedOption == listLength))
|
{
|
||||||
optionRec.y += 20;
|
selectedOption = 3;
|
||||||
|
optionRec.y += 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
screen_drawBackground();
|
||||||
|
|
||||||
|
engine.done = 0;
|
||||||
|
player_flushInput();
|
||||||
|
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
|
||||||
|
|
||||||
|
audio_playMusic("music/walking_among_androids.ogg", 1);
|
||||||
|
|
||||||
|
while (!engine.done)
|
||||||
|
{
|
||||||
renderer_update();
|
renderer_update();
|
||||||
screen_unBuffer();
|
screen_unBuffer();
|
||||||
|
|
||||||
|
@ -416,8 +403,9 @@ int title_show()
|
||||||
{
|
{
|
||||||
engine.keyState[KEY_UP] = 0;
|
engine.keyState[KEY_UP] = 0;
|
||||||
WRAP_ADD(selectedOption, -1, 1, listLength + 1);
|
WRAP_ADD(selectedOption, -1, 1, listLength + 1);
|
||||||
if ((menuType == MENU_MAIN) && (selectedOption == 3) &&
|
if (menuType == MENU_MAIN)
|
||||||
(continueSaveSlot == -1))
|
if (selectedOption == 3)
|
||||||
|
if (continueSaveSlot == -1)
|
||||||
selectedOption = 2;
|
selectedOption = 2;
|
||||||
}
|
}
|
||||||
if (engine.keyState[KEY_DOWN])
|
if (engine.keyState[KEY_DOWN])
|
||||||
|
@ -431,24 +419,24 @@ int title_show()
|
||||||
}
|
}
|
||||||
|
|
||||||
optionRec.y = screen->h / 3 + 26 + (20 * selectedOption);
|
optionRec.y = screen->h / 3 + 26 + (20 * selectedOption);
|
||||||
if ((menuType > MENU_MAIN) && (selectedOption == listLength))
|
if (menuType > MENU_MAIN)
|
||||||
|
if (selectedOption == listLength)
|
||||||
optionRec.y += 20;
|
optionRec.y += 20;
|
||||||
|
|
||||||
|
if (!skip)
|
||||||
|
{
|
||||||
|
gfx_renderString("Copyright Parallel Realities 2003",
|
||||||
|
5, gfx_background->h - 60, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
||||||
|
5, gfx_background->h - 40, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString("Copyright 2015-2017 Julie Marchant",
|
||||||
|
5, gfx_background->h - 20, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString(buildVersion, gfx_background->w - 6 - strlen(buildVersion) * 9,
|
||||||
|
gfx_background->h - 20, FONT_WHITE, 0, gfx_background);
|
||||||
|
screen_addBuffer(0, 0, screen->w, screen->h);
|
||||||
skip = 1;
|
skip = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skip)
|
|
||||||
{
|
|
||||||
gfx_renderString("Copyright Parallel Realities 2003",
|
|
||||||
5, screen->h - 60, FONT_WHITE, 0, screen);
|
|
||||||
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
|
||||||
5, screen->h - 40, FONT_WHITE, 0, screen);
|
|
||||||
gfx_renderString("Copyright 2015-2019 Julie Marchant",
|
|
||||||
5, screen->h - 20, FONT_WHITE, 0, screen);
|
|
||||||
gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9,
|
|
||||||
screen->h - 20, FONT_WHITE, 0, screen);
|
|
||||||
screen_addBuffer(0, screen->h - 40, screen->w, 40);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player_getInput();
|
player_getInput();
|
||||||
|
@ -457,6 +445,15 @@ int title_show()
|
||||||
{
|
{
|
||||||
if ((now - then <= 27500) && (!skip))
|
if ((now - then <= 27500) && (!skip))
|
||||||
{
|
{
|
||||||
|
gfx_renderString("Copyright Parallel Realities 2003",
|
||||||
|
5, screen->h - 60, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
|
||||||
|
5, screen->h - 40, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString("Copyright 2015-2019 Julie Marchant",
|
||||||
|
5, screen->h - 20, FONT_WHITE, 0, gfx_background);
|
||||||
|
gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9,
|
||||||
|
screen->h - 20, FONT_WHITE, 0, gfx_background);
|
||||||
|
screen_addBuffer(0, screen->h - 40, screen->w, 40);
|
||||||
skip = 1;
|
skip = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue