mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Check 'bpp' parameter to vidmode OSD command in EDuke32.
So that the game won't exit if you write 'vidmode 4' when intending 'setrendermode 4'. git-svn-id: https://svn.eduke32.com/eduke32@2311 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e59e7f0f3c
commit
7b09accdce
2 changed files with 16 additions and 7 deletions
|
@ -258,15 +258,16 @@ static int32_t osdcmd_vidmode(const osdfuncparm_t *parm)
|
|||
#ifdef USE_OPENGL
|
||||
case 1: // bpp switch
|
||||
tmp = Batol(parm->parms[0]);
|
||||
if (tmp==8 || tmp==16 || tmp==32)
|
||||
newbpp = tmp;
|
||||
break;
|
||||
if (!(tmp==8 || tmp==16 || tmp==32))
|
||||
return OSDCMD_SHOWHELP;
|
||||
newbpp = tmp;
|
||||
case 4: // fs, res, bpp switch
|
||||
newfullscreen = (Batol(parm->parms[3]) != 0);
|
||||
case 3: // res & bpp switch
|
||||
tmp = Batol(parm->parms[2]);
|
||||
if (tmp==8 || tmp==16 || tmp==32)
|
||||
newbpp = tmp;
|
||||
if (!(tmp==8 || tmp==16 || tmp==32))
|
||||
return OSDCMD_SHOWHELP;
|
||||
newbpp = tmp;
|
||||
#endif
|
||||
case 2: // res switch
|
||||
newx = Batol(parm->parms[0]);
|
||||
|
|
|
@ -371,12 +371,17 @@ static int32_t osdcmd_vidmode(const osdfuncparm_t *parm)
|
|||
{
|
||||
int32_t newbpp = ud.config.ScreenBPP, newwidth = ud.config.ScreenWidth,
|
||||
newheight = ud.config.ScreenHeight, newfs = ud.config.ScreenMode;
|
||||
int32_t tmp;
|
||||
|
||||
if (parm->numparms < 1 || parm->numparms > 4) return OSDCMD_SHOWHELP;
|
||||
|
||||
switch (parm->numparms)
|
||||
{
|
||||
case 1: // bpp switch
|
||||
newbpp = Batol(parm->parms[0]);
|
||||
tmp = Batol(parm->parms[0]);
|
||||
if (!(tmp==8 || tmp==16 || tmp==32))
|
||||
return OSDCMD_SHOWHELP;
|
||||
newbpp = tmp;
|
||||
break;
|
||||
case 2: // res switch
|
||||
newwidth = Batol(parm->parms[0]);
|
||||
|
@ -386,7 +391,10 @@ static int32_t osdcmd_vidmode(const osdfuncparm_t *parm)
|
|||
case 4:
|
||||
newwidth = Batol(parm->parms[0]);
|
||||
newheight = Batol(parm->parms[1]);
|
||||
newbpp = Batol(parm->parms[2]);
|
||||
tmp = Batol(parm->parms[2]);
|
||||
if (!(tmp==8 || tmp==16 || tmp==32))
|
||||
return OSDCMD_SHOWHELP;
|
||||
newbpp = tmp;
|
||||
if (parm->numparms == 4)
|
||||
newfs = (Batol(parm->parms[3]) != 0);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue