mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 02:30:46 +00:00
Improved alt+enter and a few other things
git-svn-id: https://svn.eduke32.com/eduke32@114 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
65697dbd4f
commit
37493f57ee
6 changed files with 52 additions and 43 deletions
|
@ -159,22 +159,22 @@ char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] =
|
|||
static char * mousedefaults[] =
|
||||
{
|
||||
"Fire",
|
||||
"Strafe",
|
||||
"Move_Forward",
|
||||
"",
|
||||
"",
|
||||
"MedKit",
|
||||
"Jetpack",
|
||||
"",
|
||||
"Next_Weapon",
|
||||
"Previous_Weapon"
|
||||
};
|
||||
|
||||
|
||||
static char * mouseclickeddefaults[] =
|
||||
{
|
||||
"",
|
||||
"Open",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -255,9 +255,12 @@ void playanm(char *fn,char t)
|
|||
{
|
||||
while(totalclock < ototalclock)
|
||||
{
|
||||
extern char restorepalette;
|
||||
if( KB_KeyWaiting() )
|
||||
goto ENDOFANIMLOOP;
|
||||
handleevents(); getpackets();
|
||||
if(restorepalette == 1)
|
||||
setgamepalette(&ps[myconnectindex],tempbuf,2);
|
||||
}
|
||||
|
||||
if(t == 10) ototalclock += 14;
|
||||
|
|
|
@ -83,8 +83,8 @@ int32 JoystickAnalogueSaturate[MAXJOYAXES];
|
|||
//
|
||||
|
||||
int32 ScreenMode = 1;
|
||||
int32 ScreenWidth = 800;
|
||||
int32 ScreenHeight = 600;
|
||||
int32 ScreenWidth = 1024;
|
||||
int32 ScreenHeight = 768;
|
||||
int32 ScreenBPP = 32;
|
||||
|
||||
static char setupfilename[256]={SETUPFILENAME};
|
||||
|
@ -224,7 +224,7 @@ void CONFIG_SetDefaults( void )
|
|||
ud.detail = 1;
|
||||
ud.lockout = 0;
|
||||
ud.pwlockout[0] = '\0';
|
||||
ud.crosshair = 1;
|
||||
ud.crosshair = 2;
|
||||
ud.m_marker = 1;
|
||||
ud.m_ffire = 1;
|
||||
ud.levelstats = 0;
|
||||
|
@ -266,8 +266,7 @@ void CONFIG_SetDefaults( void )
|
|||
for (i=0; i<MAXMOUSEBUTTONS; i++) {
|
||||
MouseFunctions[i][0] = CONFIG_FunctionNameToNum( mousedefaults[i] );
|
||||
CONTROL_MapButton( MouseFunctions[i][0], i, 0, controldevice_mouse );
|
||||
if (i<4) continue;
|
||||
|
||||
if (i>=4) continue;
|
||||
MouseFunctions[i][1] = CONFIG_FunctionNameToNum( mouseclickeddefaults[i] );
|
||||
CONTROL_MapButton( MouseFunctions[i][1], i, 1, controldevice_mouse );
|
||||
}
|
||||
|
|
|
@ -333,6 +333,18 @@ void getpackets(void)
|
|||
sampletimer();
|
||||
AudioUpdate();
|
||||
|
||||
if(ALT_IS_PRESSED && KB_KeyPressed(sc_Enter))
|
||||
{
|
||||
if(setgamemode(!ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP)) {
|
||||
OSD_Printf("Failed setting fullscreen video mode.\n");
|
||||
if (setgamemode(ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP))
|
||||
gameexit("Failed to recover from failure to set fullscreen video mode.\n");
|
||||
}
|
||||
else ScreenMode = !ScreenMode;
|
||||
KB_ClearKeyDown(sc_Enter);
|
||||
restorepalette = 1;
|
||||
}
|
||||
|
||||
// only dispatch commands here when not in a game
|
||||
if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); }
|
||||
|
||||
|
@ -356,25 +368,30 @@ void getpackets(void)
|
|||
if (i != other)
|
||||
sendpacket(i,packbuf,packbufleng);
|
||||
}
|
||||
|
||||
/*
|
||||
j = packbuf[1];
|
||||
playerquitflag[j] = 0;
|
||||
Bsprintf(buf,"%s is history!",ud.user_name[j]);
|
||||
adduserquote(buf);
|
||||
|
||||
numplayers--;
|
||||
ud.multimode--;
|
||||
|
||||
if(j == connecthead && networkmode == 0 )
|
||||
gameexit( " \nThe 'MASTER/First player' just quit the game. All\nplayers are returned from the game.");
|
||||
else
|
||||
j = -1;
|
||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||
{
|
||||
connectpoint2[numplayers] = -1;
|
||||
connectpoint2[numplayers-1] = connecthead;
|
||||
}
|
||||
if (playerquitflag[i]) { j = i; continue; }
|
||||
|
||||
if (numplayers < 2)
|
||||
sound(GENERIC_AMBIENCE17);
|
||||
if (i == connecthead) connecthead = connectpoint2[connecthead];
|
||||
else connectpoint2[j] = connectpoint2[i];
|
||||
|
||||
numplayers--;
|
||||
ud.multimode--;
|
||||
|
||||
Bsprintf(buf,"%s is history!",ud.user_name[i]);
|
||||
adduserquote(buf);
|
||||
|
||||
if (numplayers < 2)
|
||||
sound(GENERIC_AMBIENCE17);
|
||||
|
||||
if(i == 0 && networkmode == 0 ) */
|
||||
gameexit( "Game aborted from menu; disconnected.");
|
||||
// }
|
||||
|
||||
break;
|
||||
|
||||
|
@ -8177,7 +8194,7 @@ void Startup(void)
|
|||
inittimer(TICRATE);
|
||||
|
||||
//initprintf("* Hold Esc to Abort. *\n");
|
||||
initprintf("Loading art header.\n");
|
||||
initprintf("Loading art header...\n");
|
||||
if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
|
||||
gameexit("Failed loading art.");
|
||||
|
||||
|
@ -8540,6 +8557,7 @@ void app_main(int argc,char **argv)
|
|||
ScreenHeight = 600; // JBF: was 200
|
||||
ScreenBPP = 32; */
|
||||
while(setgamemode(0,xres[i],yres[i],bpp[i]) < 0) {
|
||||
initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],bpp[i]);
|
||||
i++;
|
||||
}
|
||||
ScreenWidth = xres[i];
|
||||
|
@ -8601,14 +8619,6 @@ void app_main(int argc,char **argv)
|
|||
|
||||
MAIN_LOOP_RESTART:
|
||||
|
||||
if(ALT_IS_PRESSED && KB_KeyPressed(sc_Enter))
|
||||
{
|
||||
if(setgamemode(!ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0)
|
||||
setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP);
|
||||
else ScreenMode = !ScreenMode;
|
||||
KB_ClearKeyDown(sc_Enter);
|
||||
}
|
||||
|
||||
if(ud.warp_on == 0)
|
||||
Logo();
|
||||
else if(ud.warp_on == 1)
|
||||
|
@ -9757,7 +9767,7 @@ char domovethings(void)
|
|||
ps[myconnectindex].ftq = 116, ps[myconnectindex].fta = 60;
|
||||
|
||||
if(j < 0 && networkmode == 0 )
|
||||
gameexit( " \nThe 'MASTER/First player' just quit the game. All\nplayers are returned from the game.");
|
||||
gameexit( "The server/master player just quit the game; disconnected.");
|
||||
}
|
||||
|
||||
if ((numplayers >= 2) && ((movefifoplc&7) == 7))
|
||||
|
|
|
@ -552,14 +552,6 @@ void menus(void)
|
|||
long l,m;
|
||||
char *p = NULL;
|
||||
|
||||
if(ALT_IS_PRESSED && KB_KeyPressed(sc_Enter))
|
||||
{
|
||||
if(setgamemode(!ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0)
|
||||
setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP);
|
||||
else ScreenMode = !ScreenMode;
|
||||
KB_ClearKeyDown(sc_Enter);
|
||||
}
|
||||
|
||||
getpackets();
|
||||
|
||||
if(ControllerType == 1 && CONTROL_MousePresent)
|
||||
|
@ -2237,7 +2229,8 @@ cheat_for_port_credits:
|
|||
switch (io) {
|
||||
case 0: if (x==io) ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1;
|
||||
modval(0,3,(int *)&ud.crosshair,1,probey==io);
|
||||
gametextpal(d,yy, ud.crosshair ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
|
||||
{ char *s[] = { "OFF", "ON [100%]", "ON [50%]", "ON [25%]" };
|
||||
gametextpal(d,yy,s[ud.crosshair], MENUHIGHLIGHT(io), 0); break; }
|
||||
case 1: if (x==io) ud.levelstats = 1-ud.levelstats;
|
||||
modval(0,1,(int *)&ud.levelstats,1,probey==io);
|
||||
gametextpal(d,yy, ud.levelstats ? "Shown" : "Hidden", MENUHIGHLIGHT(io), 0); break;
|
||||
|
|
|
@ -313,6 +313,8 @@ int loadplayer(signed char spot)
|
|||
if(kdfread((char *)redefined_quotes[i],MAXQUOTELEN,1,fil) != 1) goto corrupt;
|
||||
}
|
||||
|
||||
if (kdfread(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||
|
||||
ReadGameVars(fil);
|
||||
|
||||
kclose(fil);
|
||||
|
@ -677,6 +679,8 @@ int saveplayer(signed char spot)
|
|||
dfwrite(redefined_quotes[i],MAXQUOTELEN, 1, fil);
|
||||
}
|
||||
|
||||
dfwrite(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil);
|
||||
|
||||
SaveGameVars(fil);
|
||||
|
||||
fclose(fil);
|
||||
|
|
Loading…
Reference in a new issue