git-svn-id: https://svn.eduke32.com/eduke32@404 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-11 21:18:21 +00:00
parent 3d867963b9
commit 3509a4dc8c
5 changed files with 49 additions and 28 deletions

View file

@ -47,7 +47,7 @@ static int osdversionstringlen;
static int osdpos=0; // position next character will be written at
static int osdlines=1; // # lines of text in the buffer
static int osdrows=20; // # lines of the buffer that are visible
static int osdrowscur=0;
static int osdrowscur=-1;
static int osdscroll=0;
static int osdcols=60; // width of onscreen display in text columns
static int osdmaxrows=20; // maximum number of lines which can fit on the screen
@ -367,13 +367,12 @@ int OSD_HandleKey(int sc, int press)
if (sc == osdkey) {
if (press) {
osdscroll = -osdscroll;
if (osdrowscur == 0)
if (osdrowscur == -1)
osdscroll = 1;
else if (osdrowscur == osdrows)
osdscroll = -1;
osdrowscur += osdscroll;
OSD_CaptureInput(osdscroll == 1);
bflushchars();
}
return 0;//sc;
} else if (!osdinput) {
@ -417,7 +416,7 @@ int OSD_HandleKey(int sc, int press)
{
tabc = findsymbol(osdedittmp, NULL);
if (tabc)
if (tabc && findsymbol(osdedittmp, tabc->next))
{
symbol_t *i=tabc;
@ -516,7 +515,10 @@ int OSD_HandleKey(int sc, int press)
if (sc == 15) { // tab
} else if (sc == 1) { // escape
OSD_ShowDisplay(0);
// OSD_ShowDisplay(0);
osdscroll = -1;
osdrowscur += osdscroll;
OSD_CaptureInput(0);
} else if (sc == 201) { // page up
if (osdhead < osdlines-1)
osdhead++;
@ -686,6 +688,7 @@ void OSD_CaptureInput(int cap)
grabmouse(osdinput == 0);
onshowosd(osdinput);
if (osdinput) releaseallbuttons();
bflushchars();
}
//
@ -708,16 +711,16 @@ void OSD_Draw(void)
if (!osdinited) return;
if (osdrowscur == 1)
if (osdrowscur == 0)
OSD_ShowDisplay(osdvisible ^ 1);
if (osdrowscur == osdrows)
osdscroll = 0;
else
{
if ((osdrowscur < osdrows && osdscroll == 1) || osdrowscur < 0)
if ((osdrowscur < osdrows && osdscroll == 1) || osdrowscur < -1)
osdrowscur++;
else if ((osdrowscur > 0 && osdscroll == -1) || osdrowscur > osdrows)
else if ((osdrowscur > -1 && osdscroll == -1) || osdrowscur > osdrows)
osdrowscur--;
}
@ -732,7 +735,7 @@ void OSD_Draw(void)
clearbackground(osdcols,osdrowscur+1);
if (osdversionstring[0])
drawosdstr(osdcols-osdversionstringlen,osdrowscur,osdversionstring,osdcols,0,2);
drawosdstr(osdcols-osdversionstringlen,osdrowscur,osdversionstring,osdversionstringlen,0,2);
for (; lines>0; lines--, row--) {
drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);

View file

@ -580,6 +580,7 @@ void polymost_glinit()
{
GLfloat col[4];
#if 0
if (!Bstrcmp(glinfo.vendor, "ATI Technologies Inc."))
{
initprintf("polymost_glinit(): ATI detected, GL_FOG_HINT = GL_DONT_CARE\n");
@ -589,6 +590,10 @@ void polymost_glinit()
{
bglHint(GL_FOG_HINT,GL_NICEST);
}
#else
bglHint(GL_FOG_HINT,GL_DONT_CARE);
#endif
bglFogi(GL_FOG_MODE,GL_EXP2);
bglFogf(GL_FOG_DENSITY,1.0); //must be > 0, default is 1
/* bglFogf(GL_FOG_START,0.0); //default is 0

View file

@ -9890,6 +9890,30 @@ void app_main(int argc,char **argv)
RTS_Init(ud.rtsname);
if (numlumps) initprintf("Using .RTS file: %s\n",ud.rtsname);
initprintf("Initializing OSD...\n");
OSD_SetFunctions(
#ifdef _WIN32
GAME_drawosdchar,
GAME_drawosdstr,
GAME_drawosdcursor,
GAME_getcolumnwidth,
GAME_getrowheight,
#else
NULL,
NULL,
NULL,
NULL,
NULL,
#endif
GAME_clearbackground,
(int(*)(void))GetTime,
GAME_onshowosd
);
OSD_SetParameters(0,2, 0,0, 4,0);
OSD_SetVersionString(HEAD2);
registerosdcommands();
if (setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0)
{
int i = 0;
@ -9918,23 +9942,6 @@ void app_main(int argc,char **argv)
ScreenBPP = bpp[i];
}
initprintf("Initializing OSD...\n");
OSD_SetFunctions(
GAME_drawosdchar,
GAME_drawosdstr,
GAME_drawosdcursor,
GAME_getcolumnwidth,
GAME_getrowheight,
GAME_clearbackground,
(int(*)(void))GetTime,
GAME_onshowosd
);
OSD_SetParameters(0,2, 0,0, 4,0);
OSD_SetVersionString(HEAD2);
OSD_ResizeDisplay(ScreenWidth,ScreenHeight);
registerosdcommands();
initprintf("Checking music inits...\n");
MusicStartup();
initprintf("Checking sound inits...\n");

View file

@ -353,7 +353,13 @@ static void DoUserDef(char bSet, const long *lLabelID, const long *lVar2)
case USERDEFS_SCREEN_SIZE:
if (bSet)
ud.screen_size = lValue;
{
if (ud.screen_size != lValue)
{
ud.screen_size = lValue;
vscrn();
}
}
else
SetGameVarID(*lVar2, ud.screen_size, g_i, g_p);
break;

View file

@ -488,7 +488,7 @@ void vscrn(void)
long i, j, ss, x1, x2, y1, y2;
if (ud.screen_size < 0) ud.screen_size = 0;
else if (ud.screen_size > 63) ud.screen_size = 64;
else if (ud.screen_size > 64) ud.screen_size = 64;
if (ud.screen_size == 0) flushperms();