From 2b85433e4f5ec7f96251e7d2effb475616a06d35 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 18 Jul 2008 23:29:20 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@866 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/include/osd.h | 4 ++++ polymer/build/src/osd.c | 5 +++++ polymer/eduke32/Makefile.deps | 2 +- polymer/eduke32/source/osdfuncs.c | 10 ++++++---- polymer/eduke32/source/premap.c | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/polymer/build/include/osd.h b/polymer/build/include/osd.h index 6cb846b15..70a52b19b 100644 --- a/polymer/build/include/osd.h +++ b/polymer/build/include/osd.h @@ -32,8 +32,12 @@ const char *stripcolorcodes(const char *t); #define OSDCMD_SHOWHELP 1 int OSD_ParsingScript(void); + int OSD_OSDKey(void); + int OSD_Exec(const char *szScript); + +char *OSD_GetFmt(char *ptr); char *OSD_GetTextPtr(void); char *OSD_GetFmtPtr(void); diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index 20acf5038..55aac2298 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -1655,6 +1655,11 @@ char *OSD_GetFmtPtr(void) return (&osdfmt[0]); } +char *OSD_GetFmt(char *ptr) +{ + return (ptr - &osdtext[0] + &osdfmt[0]); +} + // // addnewsymbol() -- Allocates space for a new symbol and attaches it // appropriately to the lists, sorted. diff --git a/polymer/eduke32/Makefile.deps b/polymer/eduke32/Makefile.deps index ad5567505..6f733d009 100644 --- a/polymer/eduke32/Makefile.deps +++ b/polymer/eduke32/Makefile.deps @@ -20,7 +20,7 @@ $(OBJ)/rts.$o: $(SRC)/rts.c $(duke3d_h) $(OBJ)/config.$o: $(SRC)/config.c $(duke3d_h) $(SRC)/jmact/scriplib.h $(INC)/_functio.h $(OBJ)/testcd.$o: $(SRC)/testcd.c $(OBJ)/winbits.$o: $(SRC)/winbits.c -$(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h +$(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h $(EINC)/osd.h $(OBJ)/osdcmds.$o: $(SRC)/osdcmds.c $(INC)/osdcmds.h $(EINC)/osd.h $(duke3d_h) $(OBJ)/astub.$o: $(SRC)/astub.c $(SRC)/mapster32.h $(EINC)/build.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/editor.h diff --git a/polymer/eduke32/source/osdfuncs.c b/polymer/eduke32/source/osdfuncs.c index 18126b34f..5dfeb9206 100644 --- a/polymer/eduke32/source/osdfuncs.c +++ b/polymer/eduke32/source/osdfuncs.c @@ -18,6 +18,7 @@ void GAME_drawosdchar(int x, int y, char ch, int shade, int pal) void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal) { short ac; + char *ptr = OSD_GetTextPtr(); UNREFERENCED_PARAMETER(shade); UNREFERENCED_PARAMETER(pal); @@ -32,10 +33,11 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal) ac = *ch-'!'+STARTALPHANUM; if (ac < STARTALPHANUM || ac > ENDALPHANUM) return; - if (ch > OSD_GetTextPtr() && ch < OSD_GetTextPtr() + TEXTSIZE) - rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, (*(ch-OSD_GetTextPtr()+OSD_GetFmtPtr())&~0x1F)>>4, - *(ch-OSD_GetTextPtr()+OSD_GetFmtPtr())&~0xE0, 8|16, 0, 0, xdim-1, ydim-1); - else + // use the format byte if the text falls within the bounds of the console buffer + if (ch > ptr && ch < (ptr + TEXTSIZE)) + rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, (*(OSD_GetFmt(ch))&~0x1F)>>4, + *(OSD_GetFmt(ch))&~0xE0, 8|16, 0, 0, xdim-1, ydim-1); + else rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, shade, pal, 8|16, 0, 0, xdim-1, ydim-1); x += OSDCHAR_WIDTH; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index bbb62317e..a1fbba9d6 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1858,7 +1858,7 @@ int enterlevel(int g) // variables are set by pointer... OnEvent(EVENT_ENTERLEVEL, -1, -1, -1); - OSD_Printf(OSDTEXT_BROWN OSDTEXT_BRIGHT "E%dL%d: %s\n",ud.volume_number+1,ud.level_number+1,map[(ud.volume_number*MAXLEVELS)+ud.level_number].name); + OSD_Printf(OSDTEXT_YELLOW "E%dL%d: %s\n",ud.volume_number+1,ud.level_number+1,map[(ud.volume_number*MAXLEVELS)+ud.level_number].name); return 0; }