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:
Spoike 2005-01-05 08:11:33 +00:00
parent defad00c26
commit 94da52bb17
1 changed files with 65 additions and 35 deletions

View File

@ -400,10 +400,9 @@ void SWDraw_Init (void)
int i, x;
char *tempchars = COM_LoadMallocFile("gfx/menu/conchars.lmp");
char *in, *out;
if (!tempchars)
Sys_Error("No charset found\n");
draw_chars = BZ_Malloc(8*8*256*8);
if (tempchars)
{
draw_chars = BZ_Malloc(256*256);
out = draw_chars;
for (i = 0; i < 8*8; i+=1)
@ -438,6 +437,26 @@ void SWDraw_Init (void)
}
Z_Free(tempchars);
}
else
{ //nope, that failed too.
//use our built in fallback
{
int width;
int height;
qbyte *image;
extern qbyte default_conchar[11356];
image = ReadTargaFile(default_conchar, sizeof(default_conchar), &width, &height, false);
draw_chars = BZ_Malloc(256*256);
for (i = 0; i < 256*256; i++)
draw_chars[i] = image[i*4]?15:0;//GetPalette(image[i*4], image[i*4+1], image[i*4+2]);
BZ_Free(image);
}
}
}
if (!draw_chars)
Sys_Error("Failed to find suitable console charactures\n");
draw_disc = W_SafeGetLumpName ("disc");
@ -1782,7 +1801,18 @@ void SWDraw_ConsoleBackground (int lines)
if (!conback)
conback = (mpic_t *)SWDraw_SafeCachePic ("gfx/menu/conback.lmp");
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)
lines = vid.conheight;