From f8d4b6c9ef8aa7c201298340bf4d1d9c497bb2a7 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 30 Nov 2014 04:23:22 +0000 Subject: [PATCH] Fix displaying a savegame preview shot when in OpenGL and/or when the selected slot is empty. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4780 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 3 +++ polymer/eduke32/source/menus.c | 46 +++++++++++++++++----------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 87ee08178..4df5eecb7 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4343,6 +4343,9 @@ static void G_ReadGLFrame(void) const int32_t xf = divscale16(xdim, 320); // (xdim<<16)/320 const int32_t yf = divscale16(ydim, 200); // (ydim<<16)/200 + tilesiz[TILE_SAVESHOT].x = 200; + tilesiz[TILE_SAVESHOT].y = 320; + if (!frame) { Bmemset(pic, 0, 320 * 200); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 41adb8787..2d13ddf15 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -1723,33 +1723,33 @@ static void M_PreMenuDraw(MenuID_t cm, MenuEntry_t *entry, const vec2_t origin) rotatesprite_fs(origin.x + (99<<16), origin.y + (50<<16), 65536L,512,WINDOWBORDER1,24,0,10); rotatesprite_fs(origin.x + (103<<16), origin.y + (144<<16), 65536L,1024+512,WINDOWBORDER1,24,0,10); - if (ud.savegame[M_SAVE.currentEntry][0]) - { - j = 0; - for (i = 0; i < 10; ++i) - if (((MenuString_t*)M_SAVE.entrylist[i]->entry)->editfield) - j |= 1; + j = 0; + for (i = 0; i < 10; ++i) + if (((MenuString_t*)M_SAVE.entrylist[i]->entry)->editfield) + j |= 1; - rotatesprite_fs(origin.x + (101<<16), origin.y + (97<<16), 65536L>>1,512,j?TILE_SAVESHOT:TILE_LOADSHOT,-32,0,4+10+64); - - if (g_oldverSavegame[M_SAVE.currentEntry]) - { - mmenutext(origin.x + (53<<16), origin.y + (70<<16), "Previous"); - mmenutext(origin.x + (58<<16), origin.y + (90<<16), "Version"); - -#ifndef DROIDMENU - Bsprintf(tempbuf,"Saved: %d.%d.%d %d-bit", savehead.majorver, savehead.minorver, - savehead.bytever, 8*savehead.ptrsize); - mgametext(origin.x + (31<<16), origin.y + (104<<16), tempbuf); - Bsprintf(tempbuf,"Our: %d.%d.%d %d-bit", SV_MAJOR_VER, SV_MINOR_VER, BYTEVERSION, - (int32_t)(8*sizeof(intptr_t))); - mgametext(origin.x + ((31+16)<<16), origin.y + (114<<16), tempbuf); -#endif - } - } + if (j) + rotatesprite_fs(origin.x + (101<<16), origin.y + (97<<16), 65536L>>1,512,TILE_SAVESHOT,-32,0,4+10+64); + else if (ud.savegame[M_SAVE.currentEntry][0]) + rotatesprite_fs(origin.x + (101<<16), origin.y + (97<<16), 65536L>>1,512,TILE_LOADSHOT,-32,0,4+10+64); else mmenutext(origin.x + (69<<16), origin.y + (70<<16), "Empty"); + if (ud.savegame[M_SAVE.currentEntry][0] && g_oldverSavegame[M_SAVE.currentEntry]) + { + mmenutext(origin.x + (53<<16), origin.y + (70<<16), "Previous"); + mmenutext(origin.x + (58<<16), origin.y + (90<<16), "Version"); + +#ifndef DROIDMENU + Bsprintf(tempbuf,"Saved: %d.%d.%d %d-bit", savehead.majorver, savehead.minorver, + savehead.bytever, 8*savehead.ptrsize); + mgametext(origin.x + (31<<16), origin.y + (104<<16), tempbuf); + Bsprintf(tempbuf,"Our: %d.%d.%d %d-bit", SV_MAJOR_VER, SV_MINOR_VER, BYTEVERSION, + (int32_t)(8*sizeof(intptr_t))); + mgametext(origin.x + ((31+16)<<16), origin.y + (114<<16), tempbuf); +#endif + } + if (ud.multimode > 1) { Bsprintf(tempbuf, "Players: %-2d ", ud.multimode);