Window position memory for win32

git-svn-id: https://svn.eduke32.com/eduke32@540 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-04-22 03:44:54 +00:00
parent ddb9379fce
commit 2148b4bebc
7 changed files with 59 additions and 20 deletions

View file

@ -219,6 +219,8 @@ EXTERN char walock[MAXTILES];
EXTERN long pow2long[32];
EXTERN long numtiles, picanm[MAXTILES], waloff[MAXTILES];
EXTERN int windowpos, windowx, windowy;
//These variables are for auto-mapping with the draw2dscreen function.
//When you load a new board, these bits are all set to 0 - since
//you haven't mapped out anything yet. Note that these arrays are

View file

@ -178,6 +178,14 @@ if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i);
if (readconfig(fp, "keychat", val, VL) > 0) keys[18] = Bstrtol(val, NULL, 16);
#endif
#ifdef RENDERTYPEWIN
if (readconfig(fp, "windowpos", val, VL) > 0) windowpos = Batoi(val);
windowx = -1;
if (readconfig(fp, "windowx", val, VL) > 0) windowx = Batoi(val);
windowy = -1;
if (readconfig(fp, "windowy", val, VL) > 0) windowy = Batoi(val);
#endif
if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); }
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
@ -229,6 +237,11 @@ int writesetup(const char *fn)
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
"maxrefreshfreq = %d\n"
"\n"
"; Window positioning, 0 = center, 1 = memory\n"
"windowpos = %d\n"
"windowx = %d\n"
"windowy = %d\n"
"\n"
#endif
"; 3D mode brightness setting\n"
"; 0 - lowest\n"
@ -313,7 +326,7 @@ int writesetup(const char *fn)
glusetexcache, glusetexcachecompression, gltexfiltermode, glanisotropy,
#endif
#ifdef RENDERTYPEWIN
maxrefreshfreq,
maxrefreshfreq, windowpos, windowx, windowy,
#endif
brightness,
#if 0

View file

@ -103,7 +103,7 @@ static void RestoreSystemColours(void);
static long desktopxdim=0,desktopydim=0,desktopbpp=0,modesetusing=-1;
long xres=-1, yres=-1, fullscreen=0, bpp=0, bytesperline=0, imageSize=0;
long frameplace=0, lockcount=0;
static int windowposx, windowposy, curvidmode = -1;
static int curvidmode = -1;
static int customxdim = 640, customydim = 480, custombpp = 8, customfs = 0;
static unsigned modeschecked=0;
unsigned maxrefreshfreq=60;
@ -3075,13 +3075,20 @@ static BOOL CreateAppWindow(int modenum)
w=width;
h=height;
}
SetWindowPos(hWindow, HWND_TOP, x, y, w, h, 0);
if (windowx == -1)
windowx = x;
if (windowy == -1)
windowy = y;
SetWindowText(hWindow, apptitle);
ShowWindow(hWindow, SW_SHOWNORMAL);
SetForegroundWindow(hWindow);
SetFocus(hWindow);
SetWindowPos(hWindow, HWND_TOP, windowpos?windowx:x, windowpos?windowy:y, w, h, 0);
// fullscreen?
if (!fs) {
if (bitspp > 8) {
@ -3663,10 +3670,18 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
return TRUE;
case WM_MOVE:
windowposx = LOWORD(lParam);
windowposy = HIWORD(lParam);
// windowx = LOWORD(lParam);
// windowy = HIWORD(lParam);
return 0;
case WM_MOVING:
{
RECT *RECTYMcRECT = (LPRECT)lParam;
windowx = RECTYMcRECT->left;
windowy = RECTYMcRECT->top;
return 0;
}
case WM_CLOSE:
quitevent = 1;
return 0;

View file

@ -5630,7 +5630,7 @@ int parsetilegroups(scriptfile *script)
if (scriptfile_getbraces(script,&end)) break;
s_TileGroups[tile_groups].pIds = Bcalloc(MAX_TILE_GROUP_ENTRIES,sizeof(long));
s_TileGroups[tile_groups].szText = strdup(name);
s_TileGroups[tile_groups].szText = Bstrdup(name);
while (script->textptr < end)
{

View file

@ -771,6 +771,11 @@ int32 CONFIG_ReadSetup(void)
#ifdef _WIN32
SCRIPT_GetNumber(scripthandle, "Updates", "CheckForUpdates", &checkforupdates);
SCRIPT_GetNumber(scripthandle, "Updates", "LastUpdateCheck", &lastupdatecheck);
SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPositioning", (int32 *)&windowpos);
windowx = -1;
SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPosX", (int32 *)&windowx);
windowy = -1;
SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPosY", (int32 *)&windowy);
#endif
}
@ -894,6 +899,9 @@ void CONFIG_WriteSetup(void)
#ifdef _WIN32
SCRIPT_PutNumber(scripthandle, "Updates", "CheckForUpdates", checkforupdates, false, false);
SCRIPT_PutNumber(scripthandle, "Updates", "LastUpdateCheck", lastupdatecheck, false, false);
SCRIPT_PutNumber(scripthandle, "Screen Setup", "WindowPositioning", windowpos, false, false);
SCRIPT_PutNumber(scripthandle, "Screen Setup", "WindowPosX", windowx, false, false);
SCRIPT_PutNumber(scripthandle, "Screen Setup", "WindowPosY", windowy, false, false);
#endif
// JBF 20031211

View file

@ -1,7 +1,7 @@
// Mapster32 tile grouping configuration file
// Press T on the tile selection screen to access the tileset selection menu
#include NAMES.H
#include "names.h"
tilegroup "Actors"
{
@ -9,7 +9,7 @@ tilegroup "Actors"
tiles
{
LIZTROOP LIZTROOPRUNNING LIZTROOPSTAYPUT LIZTROOPSHOOT LIZTROOPJETPACK
APLAYER LIZTROOP LIZTROOPRUNNING LIZTROOPSTAYPUT LIZTROOPSHOOT LIZTROOPJETPACK
LIZTROOPONTOILET LIZTROOPJUSTSIT LIZTROOPDUCKING
PIGCOP PIGCOPSTAYPUT PIGCOPDIVE
LIZMAN LIZMANSTAYPUT LIZMANSPITTING LIZMANFEEDING LIZMANJUMP
@ -92,7 +92,7 @@ tilegroup "Items"
}
}
tilegroup "Respawning items"
tilegroup "Respawn triggers"
{
hotkey "R"
@ -118,6 +118,7 @@ tilegroup "Exploding stuff"
FIREVASE 2066 BURNING FIRE BURNING2 FIRE2
}
}
tilegroup "Letters"
{
hotkey "L"