mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
Status bar stuff... this adds new hotkeys for scaling the status bar (hold shift while pressing the shrink or enlarge screen buttons) and also adds support for a left-justified version of the full status bar
git-svn-id: https://svn.eduke32.com/eduke32@491 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ac95cded34
commit
ef8f308c9b
5 changed files with 72 additions and 45 deletions
|
@ -179,7 +179,7 @@ inline void setstatusbarscale(long sc)
|
||||||
|
|
||||||
static inline long sbarx(long x)
|
static inline long sbarx(long x)
|
||||||
{
|
{
|
||||||
if (ud.screen_size == 4) return scale(x<<16,ud.statusbarscale,100);
|
if (ud.screen_size == 4 || ud.statusbarmode == 1) return scale(x<<16,ud.statusbarscale,100);
|
||||||
return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100);
|
return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,9 @@ static void patchstatusbar(long x1, long y1, long x2, long y2)
|
||||||
clofx = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
clofx = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
||||||
clofy = (ydim - scale(ydim,ud.statusbarscale,100));
|
clofy = (ydim - scale(ydim,ud.statusbarscale,100));
|
||||||
|
|
||||||
rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1+clofx,cly1+clofy,clx2+clofx-1,cly2+clofy-1);
|
if (ud.statusbarmode == 0)
|
||||||
|
rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1+clofx,cly1+clofy,clx2+clofx-1,cly2+clofy-1);
|
||||||
|
else rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1,cly1,clx2+clofx-1,cly2+clofy-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setgamepalette(struct player_struct *player, char *pal, int set)
|
void setgamepalette(struct player_struct *player, char *pal, int set)
|
||||||
|
@ -4020,9 +4022,9 @@ void displayrooms(int snum,long smoothratio)
|
||||||
|
|
||||||
if (ud.camerahoriz > 299) ud.camerahoriz = 299;
|
if (ud.camerahoriz > 299) ud.camerahoriz = 299;
|
||||||
else if (ud.camerahoriz < -99) ud.camerahoriz = -99;
|
else if (ud.camerahoriz < -99) ud.camerahoriz = -99;
|
||||||
|
|
||||||
OnEvent(EVENT_DISPLAYROOMS, ps[screenpeek].i, screenpeek, -1);
|
OnEvent(EVENT_DISPLAYROOMS, ps[screenpeek].i, screenpeek, -1);
|
||||||
|
|
||||||
#ifdef SE40
|
#ifdef SE40
|
||||||
se40code(ud.camerax,ud.cameray,ud.cameraz,ud.cameraang,ud.camerahoriz,smoothratio);
|
se40code(ud.camerax,ud.cameray,ud.cameraz,ud.cameraang,ud.camerahoriz,smoothratio);
|
||||||
#endif
|
#endif
|
||||||
|
@ -7630,22 +7632,47 @@ static void nonsharedkeys(void)
|
||||||
if (BUTTON(gamefunc_Enlarge_Screen))
|
if (BUTTON(gamefunc_Enlarge_Screen))
|
||||||
{
|
{
|
||||||
CONTROL_ClearButton(gamefunc_Enlarge_Screen);
|
CONTROL_ClearButton(gamefunc_Enlarge_Screen);
|
||||||
if (ud.screen_size > 0)
|
if (!SHIFTS_IS_PRESSED)
|
||||||
sound(THUD);
|
{
|
||||||
if (ud.screen_size == 8 && ud.statusbarmode == 0 && bpp > 8 && ud.statusbarscale != 100)
|
if (ud.screen_size > 0)
|
||||||
ud.statusbarmode = 1;
|
sound(THUD);
|
||||||
else ud.screen_size -= 4;
|
if (ud.screen_size == 8 && ud.statusbarmode == 0 && bpp > 8)
|
||||||
|
ud.statusbarmode = 1;
|
||||||
|
else ud.screen_size -= 4;
|
||||||
|
|
||||||
|
if (ud.statusbarscale == 100 && ud.statusbarmode == 1)
|
||||||
|
{
|
||||||
|
ud.statusbarmode = 0;
|
||||||
|
ud.screen_size -= 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ud.statusbarscale += 8;
|
||||||
|
setstatusbarscale(ud.statusbarscale);
|
||||||
|
}
|
||||||
vscrn();
|
vscrn();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BUTTON(gamefunc_Shrink_Screen))
|
if (BUTTON(gamefunc_Shrink_Screen))
|
||||||
{
|
{
|
||||||
CONTROL_ClearButton(gamefunc_Shrink_Screen);
|
CONTROL_ClearButton(gamefunc_Shrink_Screen);
|
||||||
if (ud.screen_size < 64) sound(THUD);
|
if (!SHIFTS_IS_PRESSED)
|
||||||
if (ud.screen_size == 4 && ud.statusbarscale == 100 && ud.statusbarmode == 1)
|
{
|
||||||
ud.statusbarmode = 0;
|
if (ud.screen_size < 64) sound(THUD);
|
||||||
if (ud.screen_size == 8 && ud.statusbarmode == 1 && bpp > 8)
|
if (ud.screen_size == 8 && ud.statusbarmode == 1 && bpp > 8)
|
||||||
ud.statusbarmode = 0;
|
ud.statusbarmode = 0;
|
||||||
else ud.screen_size += 4;
|
else ud.screen_size += 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ud.statusbarscale -= 8;
|
||||||
|
if (ud.statusbarscale < 37)
|
||||||
|
ud.statusbarscale = 37;
|
||||||
|
setstatusbarscale(ud.statusbarscale);
|
||||||
|
if (ud.screen_size == 8)
|
||||||
|
ud.statusbarmode = 1;
|
||||||
|
}
|
||||||
vscrn();
|
vscrn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8189,7 +8216,7 @@ static int load_rancid_net(char *fn)
|
||||||
if (strtok(ip,":"))
|
if (strtok(ip,":"))
|
||||||
{
|
{
|
||||||
char *p = strtok(NULL,":");
|
char *p = strtok(NULL,":");
|
||||||
|
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
if (atoi(p) > 1024)
|
if (atoi(p) > 1024)
|
||||||
|
@ -10166,6 +10193,12 @@ MAIN_LOOP_RESTART:
|
||||||
else
|
else
|
||||||
i = 65536;
|
i = 65536;
|
||||||
|
|
||||||
|
if (ud.statusbarmode == 1 && ud.statusbarscale == 100)
|
||||||
|
{
|
||||||
|
ud.statusbarmode = 0;
|
||||||
|
vscrn();
|
||||||
|
}
|
||||||
|
|
||||||
displayrooms(screenpeek,i);
|
displayrooms(screenpeek,i);
|
||||||
displayrest(i);
|
displayrest(i);
|
||||||
|
|
||||||
|
|
|
@ -812,7 +812,7 @@ LABELS userdefslabels[]=
|
||||||
{ "automsg", USERDEFS_AUTOMSG, 0, 0 },
|
{ "automsg", USERDEFS_AUTOMSG, 0, 0 },
|
||||||
{ "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
|
{ "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
|
||||||
{ "team", USERDEFS_TEAM, 0, 0 },
|
{ "team", USERDEFS_TEAM, 0, 0 },
|
||||||
#if 0
|
#if 0
|
||||||
{ "myx", USERDEFS_MYX, 0, 0 },
|
{ "myx", USERDEFS_MYX, 0, 0 },
|
||||||
{ "omyx", USERDEFS_OMYX, 0, 0 },
|
{ "omyx", USERDEFS_OMYX, 0, 0 },
|
||||||
{ "myxvel", USERDEFS_MYXVEL, 0, 0 },
|
{ "myxvel", USERDEFS_MYXVEL, 0, 0 },
|
||||||
|
@ -1047,8 +1047,8 @@ char CheckEventSync(int iEventID)
|
||||||
case EVENT_DISPLAYCROSSHAIR:
|
case EVENT_DISPLAYCROSSHAIR:
|
||||||
case EVENT_DISPLAYREST:
|
case EVENT_DISPLAYREST:
|
||||||
case EVENT_DISPLAYROOMS:
|
case EVENT_DISPLAYROOMS:
|
||||||
case EVENT_DISPLAYWEAPON:
|
case EVENT_DISPLAYWEAPON:
|
||||||
case EVENT_DRAWWEAPON:
|
case EVENT_DRAWWEAPON:
|
||||||
case EVENT_ENTERLEVEL:
|
case EVENT_ENTERLEVEL:
|
||||||
case EVENT_FAKEDOMOVETHINGS:
|
case EVENT_FAKEDOMOVETHINGS:
|
||||||
case EVENT_GETLOADTILE:
|
case EVENT_GETLOADTILE:
|
||||||
|
|
|
@ -4784,10 +4784,10 @@ static int parse(void)
|
||||||
|
|
||||||
if (x1 > x2) swaplong(&x1,&x2);
|
if (x1 > x2) swaplong(&x1,&x2);
|
||||||
if (y1 > y2) swaplong(&y1,&y2);
|
if (y1 > y2) swaplong(&y1,&y2);
|
||||||
|
|
||||||
if (x1 < 0 || y1 < 0 || x2 > xdim-1 || y2 > ydim-1 || x2-x1 < 1 || y2-y1 < 1)
|
if (x1 < 0 || y1 < 0 || x2 > xdim-1 || y2 > ydim-1 || x2-x1 < 1 || y2-y1 < 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(USE_OPENGL) && defined(POLYMOST)
|
#if defined(USE_OPENGL) && defined(POLYMOST)
|
||||||
j = glprojectionhacks;
|
j = glprojectionhacks;
|
||||||
glprojectionhacks = 0;
|
glprojectionhacks = 0;
|
||||||
|
@ -4799,7 +4799,7 @@ static int parse(void)
|
||||||
vscrn();
|
vscrn();
|
||||||
#if defined(USE_OPENGL) && defined(POLYMOST)
|
#if defined(USE_OPENGL) && defined(POLYMOST)
|
||||||
glprojectionhacks = j;
|
glprojectionhacks = j;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ int MUSIC_Shutdown(void)
|
||||||
music_context = 0;
|
music_context = 0;
|
||||||
music_initialized = 0;
|
music_initialized = 0;
|
||||||
music_loopflag = MUSIC_PlayOnce;
|
music_loopflag = MUSIC_PlayOnce;
|
||||||
|
|
||||||
if (midifn != NULL)
|
if (midifn != NULL)
|
||||||
{
|
{
|
||||||
initprintf("Removing temporary file '%s'\n",midifn);
|
initprintf("Removing temporary file '%s'\n",midifn);
|
||||||
|
@ -227,7 +227,7 @@ int MUSIC_Shutdown(void)
|
||||||
Bfree(midifn);
|
Bfree(midifn);
|
||||||
midifn = NULL;
|
midifn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(MUSIC_Ok);
|
return(MUSIC_Ok);
|
||||||
} // MUSIC_Shutdown
|
} // MUSIC_Shutdown
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ int MUSIC_StopSong(void)
|
||||||
|
|
||||||
music_songdata = NULL;
|
music_songdata = NULL;
|
||||||
music_musicchunk = NULL;
|
music_musicchunk = NULL;
|
||||||
|
|
||||||
return(MUSIC_Ok);
|
return(MUSIC_Ok);
|
||||||
} // MUSIC_StopSong
|
} // MUSIC_StopSong
|
||||||
|
|
||||||
|
@ -386,14 +386,14 @@ void PlayMusic(char *_filename)
|
||||||
// save the file somewhere, so SDL_mixer can load it
|
// save the file somewhere, so SDL_mixer can load it
|
||||||
{
|
{
|
||||||
char *user = getenv("USERNAME");
|
char *user = getenv("USERNAME");
|
||||||
|
|
||||||
if (user) Bsprintf(tempbuf,"duke3d-%s.mid.%d",user,getpid());
|
if (user) Bsprintf(tempbuf,"duke3d-%s.mid.%d",user,getpid());
|
||||||
else Bsprintf(tempbuf,"duke3d.mid.%d",getpid());
|
else Bsprintf(tempbuf,"duke3d.mid.%d",getpid());
|
||||||
|
|
||||||
GetUnixPathFromEnvironment(filename, BMAX_PATH, tempbuf);
|
GetUnixPathFromEnvironment(filename, BMAX_PATH, tempbuf);
|
||||||
|
|
||||||
handle = SafeOpenWrite(filename, filetype_binary);
|
handle = SafeOpenWrite(filename, filetype_binary);
|
||||||
|
|
||||||
if (handle == -1)
|
if (handle == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -360,6 +360,16 @@ static int osdcmd_restartsound(const osdfuncparm_t *parm)
|
||||||
FX_StopAllSounds();
|
FX_StopAllSounds();
|
||||||
clearsoundlocks();
|
clearsoundlocks();
|
||||||
|
|
||||||
|
if (MusicToggle == 1)
|
||||||
|
{
|
||||||
|
if (ud.recstat != 2 && ps[myconnectindex].gm&MODE_GAME)
|
||||||
|
{
|
||||||
|
if (music_fn[0][(unsigned char)music_select] != NULL)
|
||||||
|
playmusic(&music_fn[0][(unsigned char)music_select][0]);
|
||||||
|
}
|
||||||
|
else playmusic(&env_music_fn[0][0]);
|
||||||
|
}
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,21 +438,6 @@ static int osdcmd_setstatusbarscale(const osdfuncparm_t *parm)
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int osdcmd_setstatusbarmode(const osdfuncparm_t *parm)
|
|
||||||
{
|
|
||||||
if (parm->numparms == 0)
|
|
||||||
{
|
|
||||||
OSD_Printf("\"cl_statusbarmode\" is \"%d\"\n", ud.statusbarmode);
|
|
||||||
return OSDCMD_SHOWHELP;
|
|
||||||
}
|
|
||||||
else if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
|
||||||
|
|
||||||
ud.statusbarmode = Batol(parm->parms[0]);
|
|
||||||
vscrn();
|
|
||||||
OSD_Printf("cl_statusbarmode %d\n", ud.statusbarmode);
|
|
||||||
return OSDCMD_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int osdcmd_spawn(const osdfuncparm_t *parm)
|
static int osdcmd_spawn(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
long x=0,y=0,z=0;
|
long x=0,y=0,z=0;
|
||||||
|
@ -924,7 +919,6 @@ int registerosdcommands(void)
|
||||||
|
|
||||||
OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
|
OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
|
||||||
|
|
||||||
OSD_RegisterFunction("cl_statusbarmode","cl_statusbarmode: enable/disable status bar drawing hack", osdcmd_setstatusbarmode);
|
|
||||||
OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale);
|
OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale);
|
||||||
OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu);
|
OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue