Support for a version string to stick in the lower right hand corner of the OSD

git-svn-id: https://svn.eduke32.com/eduke32@403 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-11 04:38:10 +00:00
parent 5d79272ac2
commit 3d867963b9
6 changed files with 29 additions and 6 deletions

View file

@ -54,6 +54,9 @@ void OSD_ResizeDisplay(int w,int h);
// captures and frees osd input
void OSD_CaptureInput(int cap);
// sets the console version string
void OSD_SetVersionString(const char *version);
// shows or hides the onscreen display
void OSD_ShowDisplay(int onf);

View file

@ -42,6 +42,8 @@ static void _internal_onshowosd(int);
// history display
static char osdtext[TEXTSIZE];
static char osdversionstring[32];
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
@ -102,7 +104,6 @@ static void (*clearbackground)(int,int) = _internal_clearbackground;
static int (*gettime)(void) = _internal_gettime;
static void (*onshowosd)(int) = _internal_onshowosd;
static void _internal_drawosdchar(int x, int y, char ch, int shade, int pal)
{
int i,j,k;
@ -729,7 +730,10 @@ void OSD_Draw(void)
begindrawing();
clearbackground(osdcols,osdrowscur+1);
if (osdversionstring[0])
drawosdstr(osdcols-osdversionstringlen,osdrowscur,osdversionstring,osdcols,0,2);
for (; lines>0; lines--, row--) {
drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
topoffs+=osdcols;
@ -744,7 +748,7 @@ void OSD_Draw(void)
drawosdchar(3+x,osdrowscur,osdeditbuf[osdeditwinstart+x],osdeditshade,osdeditpal);
drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrowscur,osdovertype,keytime);
enddrawing();
}
@ -1003,6 +1007,16 @@ int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const o
return 0;
}
//
// OSD_SetVersionString()
//
void OSD_SetVersionString(const char *version)
{
if (!osdinited) OSD_Init();
strcpy(osdversionstring,version);
osdversionstringlen = strlen(osdversionstring);
}
//
// addnewsymbol() -- Allocates space for a new symbol and attaches it

View file

@ -4298,6 +4298,7 @@ int ExtPreInit(int *argc,char ***argv)
wm_setapptitle("Mapster32"VERSION);
OSD_SetLogFile("mapster32.log");
OSD_SetVersionString("Mapster32"VERSION);
initprintf("Mapster32"VERSION" ("__DATE__" "__TIME__")\n");
initprintf("Copyright (c) 2006 EDuke32 team\n\n");
return 0;

View file

@ -9931,6 +9931,8 @@ void app_main(int argc,char **argv)
GAME_onshowosd
);
OSD_SetParameters(0,2, 0,0, 4,0);
OSD_SetVersionString(HEAD2);
OSD_ResizeDisplay(ScreenWidth,ScreenHeight);
registerosdcommands();
initprintf("Checking music inits...\n");

View file

@ -94,12 +94,16 @@ extern "C" {
// Number of JOY axes
#define MAXJOYAXES 8
#define MAXJOYAXES 6
// Number of GamePad axes
#define MAXGAMEPADAXES 2
// Number of axes
#define MAXAXES 6
// NORMAL axis scale
#define NORMALAXISSCALE (65536)

View file

@ -4,5 +4,4 @@ void GAME_drawosdcursor(int x, int y, int type, int lastkeypress);
int GAME_getcolumnwidth(int w);
int GAME_getrowheight(int w);
void GAME_clearbackground(int c, int r);
void GAME_onshowosd(int shown);
void GAME_onshowosd(int shown);