mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
It now runs without any gamedata.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@734 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
defad00c26
commit
94da52bb17
1 changed files with 65 additions and 35 deletions
|
@ -400,43 +400,62 @@ void SWDraw_Init (void)
|
||||||
int i, x;
|
int i, x;
|
||||||
char *tempchars = COM_LoadMallocFile("gfx/menu/conchars.lmp");
|
char *tempchars = COM_LoadMallocFile("gfx/menu/conchars.lmp");
|
||||||
char *in, *out;
|
char *in, *out;
|
||||||
if (!tempchars)
|
if (tempchars)
|
||||||
Sys_Error("No charset found\n");
|
{
|
||||||
|
draw_chars = BZ_Malloc(256*256);
|
||||||
|
|
||||||
|
out = draw_chars;
|
||||||
|
for (i = 0; i < 8*8; i+=1)
|
||||||
|
{
|
||||||
|
if ((i/8)&1)
|
||||||
|
{
|
||||||
|
in = tempchars + ((i)/8)*16*8*8+(i&7)*32*8 - 256*4+128;
|
||||||
|
for (x = 0; x < 16*8; x++)
|
||||||
|
*out++ = *in++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
in = tempchars + (i/8)*16*8*8+(i&7)*32*8;
|
||||||
|
for (x = 0; x < 16*8; x++)
|
||||||
|
*out++ = *in++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i < 8*8; i+=1)
|
||||||
|
{
|
||||||
|
if ((i/8)&1)
|
||||||
|
{
|
||||||
|
in = tempchars+128*128 + ((i)/8)*16*8*8+(i&7)*32*8 - 256*4+128;
|
||||||
|
for (x = 0; x < 16*8; x++)
|
||||||
|
*out++ = *in++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
in = tempchars+128*128 + (i/8)*16*8*8+(i&7)*32*8;
|
||||||
|
for (x = 0; x < 16*8; x++)
|
||||||
|
*out++ = *in++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Z_Free(tempchars);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //nope, that failed too.
|
||||||
|
//use our built in fallback
|
||||||
|
{
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
qbyte *image;
|
||||||
|
extern qbyte default_conchar[11356];
|
||||||
|
|
||||||
draw_chars = BZ_Malloc(8*8*256*8);
|
image = ReadTargaFile(default_conchar, sizeof(default_conchar), &width, &height, false);
|
||||||
|
|
||||||
out = draw_chars;
|
draw_chars = BZ_Malloc(256*256);
|
||||||
for (i = 0; i < 8*8; i+=1)
|
|
||||||
{
|
for (i = 0; i < 256*256; i++)
|
||||||
if ((i/8)&1)
|
draw_chars[i] = image[i*4]?15:0;//GetPalette(image[i*4], image[i*4+1], image[i*4+2]);
|
||||||
{
|
|
||||||
in = tempchars + ((i)/8)*16*8*8+(i&7)*32*8 - 256*4+128;
|
BZ_Free(image);
|
||||||
for (x = 0; x < 16*8; x++)
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
in = tempchars + (i/8)*16*8*8+(i&7)*32*8;
|
|
||||||
for (x = 0; x < 16*8; x++)
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8*8; i+=1)
|
|
||||||
{
|
|
||||||
if ((i/8)&1)
|
|
||||||
{
|
|
||||||
in = tempchars+128*128 + ((i)/8)*16*8*8+(i&7)*32*8 - 256*4+128;
|
|
||||||
for (x = 0; x < 16*8; x++)
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
in = tempchars+128*128 + (i/8)*16*8*8+(i&7)*32*8;
|
|
||||||
for (x = 0; x < 16*8; x++)
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Z_Free(tempchars);
|
|
||||||
}
|
}
|
||||||
if (!draw_chars)
|
if (!draw_chars)
|
||||||
Sys_Error("Failed to find suitable console charactures\n");
|
Sys_Error("Failed to find suitable console charactures\n");
|
||||||
|
@ -1782,7 +1801,18 @@ void SWDraw_ConsoleBackground (int lines)
|
||||||
if (!conback)
|
if (!conback)
|
||||||
conback = (mpic_t *)SWDraw_SafeCachePic ("gfx/menu/conback.lmp");
|
conback = (mpic_t *)SWDraw_SafeCachePic ("gfx/menu/conback.lmp");
|
||||||
if (!conback)
|
if (!conback)
|
||||||
Sys_Error("gfx/conback.lmp not found\n");
|
{
|
||||||
|
swcachepic_t *cp;
|
||||||
|
|
||||||
|
for (cp=swmenu_cachepics, v=0 ; v<swmenu_numcachepics ; cp++, v++)
|
||||||
|
if (!strcmp ("gfx/conback", cp->name))
|
||||||
|
break;
|
||||||
|
|
||||||
|
conback = Cache_Alloc(&cp->cache, sizeof(mpic_t) + 320*200, cp->name);
|
||||||
|
conback->width = 320;
|
||||||
|
conback->height = 200;
|
||||||
|
conback->flags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (lines > vid.conheight)
|
if (lines > vid.conheight)
|
||||||
lines = vid.conheight;
|
lines = vid.conheight;
|
||||||
|
|
Loading…
Reference in a new issue