2006-04-13 20:47:06 +00:00
|
|
|
#include "duke3d.h"
|
|
|
|
#include "build.h"
|
|
|
|
#include "namesdyn.h"
|
2008-07-19 00:50:20 +00:00
|
|
|
#include "osdfuncs.h"
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
void GAME_drawosdchar(int x, int y, char ch, int shade, int pal)
|
|
|
|
{
|
|
|
|
short ac;
|
|
|
|
|
|
|
|
if (ch == 32) return;
|
|
|
|
ac = ch-'!'+STARTALPHANUM;
|
|
|
|
if (ac < STARTALPHANUM || ac > ENDALPHANUM) return;
|
|
|
|
|
|
|
|
rotatesprite(((x<<3)+x)<<16, (y<<3)<<16, 65536l, 0, ac, shade, pal, 8|16, 0, 0, xdim-1, ydim-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
|
|
|
|
{
|
|
|
|
short ac;
|
2008-07-18 23:29:20 +00:00
|
|
|
char *ptr = OSD_GetTextPtr();
|
2008-07-21 03:06:34 +00:00
|
|
|
char *fmt = OSD_GetFmtPtr();
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-11-15 01:16:55 +00:00
|
|
|
for (x = (x<<3)+x; len>0; len--, ch++, x++)
|
|
|
|
{
|
|
|
|
if (*ch == 32)
|
|
|
|
{
|
2008-06-30 07:30:48 +00:00
|
|
|
x += OSDCHAR_WIDTH;
|
2006-11-15 01:16:55 +00:00
|
|
|
continue;
|
|
|
|
}
|
2006-04-13 20:47:06 +00:00
|
|
|
ac = *ch-'!'+STARTALPHANUM;
|
|
|
|
if (ac < STARTALPHANUM || ac > ENDALPHANUM) return;
|
|
|
|
|
2008-07-18 23:29:20 +00:00
|
|
|
// use the format byte if the text falls within the bounds of the console buffer
|
|
|
|
if (ch > ptr && ch < (ptr + TEXTSIZE))
|
2008-07-21 03:06:34 +00:00
|
|
|
{
|
2008-07-21 10:20:41 +00:00
|
|
|
rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, (*(ch-ptr+fmt)&~0x1F)>>4,
|
2008-07-21 03:06:34 +00:00
|
|
|
*(ch-ptr+fmt)&~0xE0, 8|16, 0, 0, xdim-1, ydim-1);
|
|
|
|
}
|
2008-07-18 23:29:20 +00:00
|
|
|
else
|
2008-07-21 10:20:41 +00:00
|
|
|
rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, shade,
|
2008-07-20 00:39:06 +00:00
|
|
|
pal, 8|16, 0, 0, xdim-1, ydim-1);
|
2008-06-30 07:30:48 +00:00
|
|
|
x += OSDCHAR_WIDTH;
|
2006-04-13 20:47:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GAME_drawosdcursor(int x, int y, int type, int lastkeypress)
|
|
|
|
{
|
|
|
|
short ac;
|
|
|
|
|
|
|
|
if (type) ac = SMALLFNTCURSOR;
|
|
|
|
else ac = '_'-'!'+STARTALPHANUM;
|
|
|
|
|
|
|
|
if (!((GetTime()-lastkeypress) & 0x40l))
|
|
|
|
rotatesprite(((x<<3)+x)<<16, ((y<<3)+(type?-1:2))<<16, 65536l, 0, ac, 0, 8, 8|16, 0, 0, xdim-1, ydim-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int GAME_getcolumnwidth(int w)
|
|
|
|
{
|
|
|
|
return w/9;
|
|
|
|
}
|
|
|
|
|
|
|
|
int GAME_getrowheight(int w)
|
|
|
|
{
|
|
|
|
return w>>3;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GAME_onshowosd(int shown)
|
|
|
|
{
|
2007-02-16 00:11:25 +00:00
|
|
|
vscrn();
|
2006-04-13 20:47:06 +00:00
|
|
|
if (numplayers == 1)
|
|
|
|
if ((shown && !ud.pause_on) || (!shown && ud.pause_on))
|
|
|
|
KB_KeyDown[sc_Pause] = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//#define BGTILE 311
|
|
|
|
//#define BGTILE 1156
|
|
|
|
#define BGTILE 1141 // BIGHOLE
|
|
|
|
#define BORDTILE 3250 // VIEWBORDER
|
|
|
|
#define BITSTH 1+32+8+16 // high translucency
|
|
|
|
#define BITSTL 1+8+16 // low translucency
|
|
|
|
#define BITS 8+16+64 // solid
|
|
|
|
#define SHADE 16
|
|
|
|
#define PALETTE 4
|
|
|
|
void GAME_clearbackground(int c, int r)
|
|
|
|
{
|
2007-12-12 17:42:14 +00:00
|
|
|
int x, y, xsiz, ysiz, tx2, ty2;
|
|
|
|
int daydim, bits;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-03-22 10:23:57 +00:00
|
|
|
UNREFERENCED_PARAMETER(c);
|
2008-03-21 04:01:38 +00:00
|
|
|
|
2006-11-15 01:16:55 +00:00
|
|
|
if (getrendermode() < 3) bits = BITS;
|
|
|
|
else bits = BITSTL;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
daydim = r<<3;
|
|
|
|
|
2006-11-15 01:16:55 +00:00
|
|
|
xsiz = tilesizx[BGTILE];
|
|
|
|
tx2 = xdim/xsiz;
|
|
|
|
ysiz = tilesizy[BGTILE];
|
|
|
|
ty2 = daydim/ysiz;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-11-13 23:12:47 +00:00
|
|
|
for (x=0;x<=tx2;x++)
|
|
|
|
for (y=0;y<=ty2;y++)
|
2006-04-13 20:47:06 +00:00
|
|
|
rotatesprite(x*xsiz<<16,y*ysiz<<16,65536L,0,BGTILE,SHADE,PALETTE,bits,0,0,xdim,daydim);
|
|
|
|
|
2006-11-15 01:16:55 +00:00
|
|
|
xsiz = tilesizy[BORDTILE];
|
|
|
|
tx2 = xdim/xsiz;
|
2006-04-13 20:47:06 +00:00
|
|
|
ysiz = tilesizx[BORDTILE];
|
|
|
|
|
2006-11-13 23:12:47 +00:00
|
|
|
for (x=0;x<=tx2;x++)
|
2006-04-13 20:47:06 +00:00
|
|
|
rotatesprite(x*xsiz<<16,(daydim+ysiz+1)<<16,65536L,1536,BORDTILE,SHADE-12,PALETTE,BITS,0,0,xdim,daydim+ysiz+1);
|
|
|
|
}
|
|
|
|
|