git-svn-id: https://svn.eduke32.com/eduke32@866 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-07-18 23:29:20 +00:00
parent 3aefb0edaa
commit 2b85433e4f
5 changed files with 17 additions and 6 deletions

View file

@ -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);

View file

@ -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.

View file

@ -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

View file

@ -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;

View file

@ -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;
}