gl_draw.c (Draw_ConbackPic): new proc for drawing the normal conback image

in fitzmode mode otherwise drawing the custom QuakeSpasm conback from memory.
(Draw_ConsoleBackground): use the new Draw_ConbackPic().
Makefile, Makefile.w32, Makefile.w64: added conback.c to the build.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@53 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-02-18 16:55:28 +00:00
parent fa7aa93450
commit 45b0f40128
4 changed files with 52 additions and 5 deletions

View file

@ -131,7 +131,7 @@ cl_main.o gl_fog.o gl_test.o main.o pr_cmds.o snd_dma.o view
cl_parse.o gl_mesh.o gl_texmgr.o mathlib.o pr_edict.o snd_mem.o wad.o \
cl_tent.o gl_model.o gl_vidsdl.o menu.o pr_exec.o snd_mix.o world.o \
cmd.o gl_refrag.o gl_warp.o net_dgrm.o r_alias.o snd_sdl.o zone.o \
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o conback.o
# ------------------------
# build rules for Linux

View file

@ -86,7 +86,8 @@ cl_main.o gl_fog.o gl_test.o main.o pr_cmds.o snd_dma.o view
cl_parse.o gl_mesh.o gl_texmgr.o mathlib.o pr_edict.o snd_mem.o wad.o \
cl_tent.o gl_model.o gl_vidsdl.o menu.o pr_exec.o snd_mix.o world.o \
cmd.o gl_refrag.o gl_warp.o net_dgrm.o r_alias.o snd_sdl.o zone.o \
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o Fitzquake.res
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o conback.o \
Fitzquake.res
# ------------------------
# build rules for mingw :

View file

@ -86,7 +86,8 @@ cl_main.o gl_fog.o gl_test.o main.o pr_cmds.o snd_dma.o view
cl_parse.o gl_mesh.o gl_texmgr.o mathlib.o pr_edict.o snd_mem.o wad.o \
cl_tent.o gl_model.o gl_vidsdl.o menu.o pr_exec.o snd_mix.o world.o \
cmd.o gl_refrag.o gl_warp.o net_dgrm.o r_alias.o snd_sdl.o zone.o \
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o Fitzquake.res
common.o gl_rlight.o host_cmd.o net_loop.o r_brush.o sv_main.o conback.o \
Fitzquake.res
# ------------------------
# build rules for mingw-w64 :

View file

@ -273,9 +273,10 @@ qpic_t *Draw_CachePic (char *path)
glpic_t *gl;
for (pic=menu_cachepics, i=0 ; i<menu_numcachepics ; pic++, i++)
{
if (!strcmp (path, pic->name))
return &pic->pic;
}
if (menu_numcachepics == MAX_CACHED_PICS)
Sys_Error ("menu_numcachepics == MAX_CACHED_PICS");
menu_numcachepics++;
@ -309,6 +310,50 @@ qpic_t *Draw_CachePic (char *path)
return &pic->pic;
}
/*
================
Draw_ConbackPic -- QuakeSpasm custom conback drawing.
================
*/
extern char *get_conback(void);
qpic_t *Draw_ConbackPic (void)
{
if (fitzmode) {
return Draw_CachePic ("gfx/conback.lmp");
} else {
/* QuakeSpasm customization: */
cachepic_t *pic;
int i;
qpic_t *dat;
glpic_t *gl;
for (pic=menu_cachepics, i=0 ; i<menu_numcachepics ; pic++, i++)
{
if (!strcmp ("gfx/conback.lmp", pic->name))
return &pic->pic;
}
if (menu_numcachepics == MAX_CACHED_PICS)
Sys_Error ("menu_numcachepics == MAX_CACHED_PICS");
menu_numcachepics++;
strcpy (pic->name, "gfx/conback.lmp");
/* load custom conback, image in memory */
dat = (qpic_t *)get_conback ();
SwapPic (dat);
pic->pic.width = dat->width;
pic->pic.height = dat->height;
gl = (glpic_t *)pic->pic.data;
gl->gltexture = TexMgr_LoadImage (NULL, "gfx/conback.lmp", dat->width, dat->height, SRC_INDEXED, dat->data,
"", (src_offset_t)dat->data,
TEXPREF_ALPHA | TEXPREF_PAD | TEXPREF_NOPICMIP); //johnfitz -- TexMgr
gl->sl = 0;
gl->sh = (float)dat->width/(float)TexMgr_PadConditional(dat->width); //johnfitz
gl->tl = 0;
gl->th = (float)dat->height/(float)TexMgr_PadConditional(dat->height); //johnfitz
return &pic->pic;
} /* -- QuakeSpasm */
}
/*
================
Draw_MakePic -- johnfitz -- generate pics from internal data
@ -548,7 +593,7 @@ void Draw_ConsoleBackground (void)
qpic_t *pic;
float alpha;
pic = Draw_CachePic ("gfx/conback.lmp");
pic = Draw_ConbackPic ();
pic->width = vid.conwidth;
pic->height = vid.conheight;