first tie-in for the renderer (Draw_Pic: the interface will likely change

to better match the real interface, but this will do for now)
This commit is contained in:
Bill Currie 2002-01-18 22:35:46 +00:00
parent ac71d101d2
commit 10acad1ee4
7 changed files with 104 additions and 23 deletions

View file

@ -46,3 +46,8 @@ void () main_menu =
Menu_Item (54, 132, "", quit);
Menu_End ();
};
void () menu_init =
{
main_menu ();
};

View file

@ -196,5 +196,7 @@ void R_DecayLights (double frametime);
void R_ClearDlights (void);
void R_LineGraph (int x, int y, int *h_vals, int count);
struct progs_s;
void R_Progs_Init (struct progs_s *pr);
#endif // __render_h

View file

@ -37,6 +37,7 @@ static const char rcsid[] =
#include "QF/hash.h"
#include "QF/plugin.h"
#include "QF/progs.h"
#include "QF/render.h"
#include "QF/vfs.h"
typedef struct menu_pic_s {
@ -214,6 +215,8 @@ Menu_Init (void)
PR_AddBuiltin (&menu_pr_state, "Menu_Item", bi_Menu_Item, -1);
PR_AddBuiltin (&menu_pr_state, "Menu_Cursor", bi_Menu_Cursor, -1);
PR_AddBuiltin (&menu_pr_state, "Menu_End", bi_Menu_End, -1);
R_Progs_Init (&menu_pr_state);
}
void

View file

@ -8,7 +8,9 @@ noinst_LTLIBRARIES= @VID_REND_NOINST_TARGETS@
EXTRA_LTLIBRARIES= libQFrenderer_sw.la libQFrenderer_sw32.la libQFrenderer_gl.la
common_sources= r_cvar.c r_efrag.c r_ent.c r_graph.c r_light.c r_main.c r_part.c
common_sources= \
r_cvar.c r_efrag.c r_ent.c r_graph.c r_light.c r_main.c \
r_part.c r_progs.c
libQFrenderer_gl_la_LDFLAGS= -version-info 1:0:0 -rpath $(libdir)
libQFrenderer_gl_la_LIBADD= gl/libgl.la

View file

@ -0,0 +1,58 @@
/*
r_progs.c
QC interface to the renderer
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
static const char rcsid[] =
"$Id$";
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "QF/console.h"
#include "QF/draw.h"
#include "QF/progs.h"
#include "QF/render.h"
static void
bi_Draw_Pic (progs_t *pr)
{
int x = G_INT (pr, OFS_PARM0);
int y = G_INT (pr, OFS_PARM1);
const char *path = G_STRING (pr, OFS_PARM2);
qpic_t *pic = Draw_CachePic (path, 1);
if (!pic) {
Con_DPrintf ("can't load %s\n", path);
return;
}
Draw_Pic (x, y, pic);
}
void
R_Progs_Init (progs_t *pr)
{
PR_AddBuiltin (pr, "Draw_Pic", bi_Draw_Pic, -1);
}

View file

@ -64,8 +64,10 @@ EXTRA_libqfnet_la_SOURCES= \
net_dos.c net_bw.c net_bsd.c net_ipx.c net_mp.c net_win.c net_wins.c \
net_wipx.c net_udp.c
cl_plugin_LIBS= \
$(CLIENT_PLUGIN_STATIC_LIBS)
client_LIBFILES= \
$(CLIENT_PLUGIN_STATIC_LIBS) \
$(top_builddir)/libs/video/targets/libQFjs.la \
$(top_builddir)/libs/audio/libQFcd.la \
$(top_builddir)/libs/audio/libQFsound.la
@ -108,7 +110,7 @@ soft_QFLIBS= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
# ... Linux FBDev
nq_fbdev_SOURCES= $(combined_sources) sys_unix.c
nq_fbdev_LDADD= $(soft_QFLIBS) \
nq_fbdev_LDADD= $(cl_plugin_LIBS) $(soft_QFLIBS) \
$(top_builddir)/libs/video/targets/libQFfbdev.la \
$(client_LIBS)
nq_fbdev_LDFLAGS= $(common_ldflags)
@ -118,7 +120,7 @@ nq_fbdev_DEPENDENCIES= $(soft_QFLIBS) \
# ... SciTech MGL
nq_mgl_SOURCES= $(combined_sources) sys_win.c
nq_mgl_LDADD= $(soft_QFLIBS) \
nq_mgl_LDADD= $(cl_plugin_LIBS) $(soft_QFLIBS) \
$(top_builddir)/libs/video/targets/libQFmgl.la \
$(client_LIBS) $(MGL_LIBS)
nq_mgl_LDFLAGS= $(common_ldflags)
@ -128,7 +130,7 @@ nq_mgl_DEPENDENCIES= $(soft_QFLIBS) \
# ... SDL, version 1.2 and higher
nq_sdl_SOURCES= $(combined_sources) sys_sdl.c
nq_sdl_LDADD= $(soft_QFLIBS) \
nq_sdl_LDADD= $(cl_plugin_LIBS) $(soft_QFLIBS) \
$(top_builddir)/libs/video/targets/libQFsdl.la \
$(client_LIBS) $(SDL_LIBS)
nq_sdl_LDFLAGS= $(common_ldflags)
@ -138,7 +140,8 @@ nq_sdl_DEPENDENCIES= $(soft_QFLIBS) \
# ... 32-bit software, SDL
nq_sdl32_SOURCES= $(combined_sources) sys_sdl.c
nq_sdl32_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_sw32.la \
nq_sdl32_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_sw32.la \
$(top_builddir)/libs/models/libQFmodels_sw.la \
$(top_builddir)/libs/video/targets/libQFsdl32.la \
$(client_LIBS) $(SDL_LIBS)
@ -150,7 +153,8 @@ nq_sdl32_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_sw32.la
# ... Linux SVGAlib
nq_svga_SOURCES= $(combined_sources) sys_unix.c
nq_svga_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
nq_svga_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
$(top_builddir)/libs/models/libQFmodels_sw.la \
$(top_builddir)/libs/video/targets/libQFsvga.la \
$(client_LIBS) $(SVGA_LIBS)
@ -162,7 +166,8 @@ nq_svga_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
# ... X11
nq_x11_SOURCES= $(combined_sources) sys_unix.c
nq_x11_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
nq_x11_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
$(top_builddir)/libs/models/libQFmodels_sw.la \
$(top_builddir)/libs/video/targets/libQFx11.la \
$(client_LIBS) \
@ -177,7 +182,8 @@ nq_x11_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
# ... Linux 3DFX
nq_3dfx_SOURCES= $(combined_sources) sys_unix.c
nq_3dfx_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
nq_3dfx_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
$(top_builddir)/libs/models/libQFmodels_gl.la \
$(top_builddir)/libs/video/targets/libQFtdfx.la \
$(client_LIBS) $(GLIDE_LIBS) $(SVGA_LIBS)
@ -190,7 +196,8 @@ nq_3dfx_DEPENDENCIES= \
# ... OpenGL in X Window
nq_glx_SOURCES= $(combined_sources) sys_unix.c
nq_glx_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
nq_glx_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
$(top_builddir)/libs/models/libQFmodels_gl.la \
$(top_builddir)/libs/video/targets/libQFglx.la \
$(client_LIBS) \
@ -204,7 +211,8 @@ nq_glx_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
# ... Simple Directmedia Layer, version 1.2 and higher, in GL mode
nq_sgl_SOURCES= $(combined_sources) sys_sdl.c
nq_sgl_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
nq_sgl_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
$(top_builddir)/libs/models/libQFmodels_gl.la \
$(top_builddir)/libs/video/targets/libQFsgl.la \
$(client_LIBS) \
@ -217,7 +225,8 @@ nq_sgl_DEPENDENCIES= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
# ... SGI/Microsoft WGL (Windows OpenGL)
nq_wgl_SOURCES= $(combined_sources) conproc.c sys_win.c
nq_wgl_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
nq_wgl_LDADD= $(cl_plugin_LIBS) \
$(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
$(top_builddir)/libs/models/libQFmodels_gl.la \
$(top_builddir)/libs/video/targets/libQFwgl.la \
$(client_LIBS) -lgdi32 -lcomctl32 -lwinmm

View file

@ -98,8 +98,10 @@ qw_master_SOURCES= master.c
qw_master_LDADD= $(NET_LIBS)
qw_master_LDFLAGS= $(common_ldflags)
cl_plugin_LIBS= \
$(CLIENT_PLUGIN_STATIC_LIBS)
qf_client_LIBS= \
$(CLIENT_PLUGIN_STATIC_LIBS) \
$(top_builddir)/libs/console/libQFconsole.la \
$(top_builddir)/libs/video/targets/libQFjs.la \
$(top_builddir)/libs/gamecode/engine/libQFgamecode.la \
@ -125,7 +127,7 @@ soft_LIBS= $(top_builddir)/libs/video/renderer/libQFrenderer_sw.la \
# ... Linux FBDev
qw_client_fbdev_SOURCES=$(common_sources) $(client_sources) cl_sys_unix.c
qw_client_fbdev_LDADD= $(soft_LIBS) \
qw_client_fbdev_LDADD= $(cl_plugin_LIBS) $(soft_LIBS) \
$(top_builddir)/libs/video/targets/libQFfbdev.la \
$(client_LIBS)
qw_client_fbdev_LDFLAGS=$(common_ldflags)
@ -136,7 +138,7 @@ qw_client_fbdev_DEPENDENCIES= \
# ... SciTech MGL
qw_client_mgl_SOURCES= $(common_sources) $(client_sources) cl_sys_win.c
qw_client_mgl_LDADD= $(soft_LIBS) \
qw_client_mgl_LDADD= $(cl_plugin_LIBS) $(soft_LIBS) \
$(top_builddir)/libs/video/targets/libQFmgl.la \
$(client_LIBS) $(MGL_LIBS)
qw_client_mgl_LDFLAGS= $(common_ldflags)
@ -147,7 +149,7 @@ qw_client_mgl_DEPENDENCIES= \
# ... Simple DirectMedia Layer, version 1.2 and higher
qw_client_sdl_SOURCES= $(common_sources) $(client_sources) cl_sys_sdl.c
qw_client_sdl_LDADD= $(soft_LIBS) \
qw_client_sdl_LDADD= $(cl_plugin_LIBS) $(soft_LIBS) \
$(top_builddir)/libs/video/targets/libQFsdl.la \
$(client_LIBS) $(SDL_LIBS)
qw_client_sdl_LDFLAGS= $(common_ldflags)
@ -158,7 +160,7 @@ qw_client_sdl_DEPENDENCIES= \
# ... 32-bit software, SDL
qw_client_sdl32_SOURCES=$(qw_client_sdl_SOURCES)
qw_client_sdl32_LDADD= $(top_builddir)/libs/video/renderer/libQFrenderer_sw32.la \
qw_client_sdl32_LDADD= $(cl_plugin_LIBS) $(top_builddir)/libs/video/renderer/libQFrenderer_sw32.la \
$(top_builddir)/libs/models/libQFmodels_sw.la \
$(top_builddir)/libs/video/targets/libQFsdl32.la \
$(client_LIBS) $(SDL_LIBS)
@ -171,7 +173,7 @@ qw_client_sdl32_DEPENDENCIES= \
# ... Linux SVGAlib
qw_client_svga_SOURCES= $(common_sources) $(client_sources) cl_sys_unix.c
qw_client_svga_LDADD= $(soft_LIBS) \
qw_client_svga_LDADD= $(cl_plugin_LIBS) $(soft_LIBS) \
$(top_builddir)/libs/video/targets/libQFsvga.la \
$(client_LIBS) $(SVGA_LIBS)
qw_client_svga_LDFAGS= $(common_ldflags)
@ -182,7 +184,7 @@ qw_client_svga_DEPENDENCIES= \
# ... X11
qw_client_x11_SOURCES= $(common_sources) $(client_sources) cl_sys_unix.c
qw_client_x11_LDADD= $(soft_LIBS) \
qw_client_x11_LDADD= $(cl_plugin_LIBS) $(soft_LIBS) \
$(top_builddir)/libs/video/targets/libQFx11.la \
$(client_LIBS) \
$(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB)
@ -199,7 +201,7 @@ opengl_LIBS= $(top_builddir)/libs/video/renderer/libQFrenderer_gl.la \
# ... OpenGL in X Window
qw_client_glx_SOURCES= $(common_sources) $(client_sources) cl_sys_unix.c
qw_client_glx_LDADD= $(opengl_LIBS) \
qw_client_glx_LDADD= $(cl_plugin_LIBS) $(opengl_LIBS) \
$(top_builddir)/libs/video/targets/libQFglx.la \
$(client_LIBS) \
$(X_PRE_LIBS) $(VIDMODE_LIBS) $(DGA_LIBS) $(X_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) $(DL_LIBS)
@ -211,7 +213,7 @@ qw_client_glx_DEPENDENCIES= \
# ... Linux 3DFX
qw_client_3dfx_SOURCES= $(common_sources) $(client_sources) cl_sys_unix.c
qw_client_3dfx_LDADD= $(opengl_LIBS) \
qw_client_3dfx_LDADD= $(cl_plugin_LIBS) $(opengl_LIBS) \
$(top_builddir)/libs/video/targets/libQFtdfx.la \
$(client_LIBS) $(GLIDE_LIBS) $(SVGA_LIBS)
qw_client_3dfx_LDFAGS= $(common_ldflags)
@ -222,7 +224,7 @@ qw_client_3dfx_DEPENDENCIES= \
# ... Simple DirectMedia Layer, version 1.2 and higher, in GL mode
qw_client_sgl_SOURCES= $(common_sources) $(client_sources) cl_sys_sdl.c
qw_client_sgl_LDADD= $(opengl_LIBS) \
qw_client_sgl_LDADD= $(cl_plugin_LIBS) $(opengl_LIBS) \
$(top_builddir)/libs/video/targets/libQFsgl.la \
$(client_LIBS) $(SDL_LIBS) $(DL_LIBS)
qw_client_sgl_LDFLAGS= $(common_ldflags)
@ -233,7 +235,7 @@ qw_client_sgl_DEPENDENCIES= \
# ... SGI/Microsoft WGL (Windows OpenGL)
qw_client_wgl_SOURCES= $(common_sources) $(client_sources) cl_sys_win.c
qw_client_wgl_LDADD= $(opengl_LIBS) \
qw_client_wgl_LDADD= $(cl_plugin_LIBS) $(opengl_LIBS) \
$(top_builddir)/libs/video/targets/libQFwgl.la \
$(client_LIBS) -lgdi32 -lwinmm
qw_client_wgl_LDFLAGS= $(common_ldflags)