Make some progress in getting static plugins to link.

Still many redefined symbols (and I expect more to come), and many
undefined symbols too.
This commit is contained in:
Bill Currie 2012-02-15 09:50:40 +09:00
parent 5f5305d61d
commit 96b80433d8
21 changed files with 138 additions and 413 deletions

View file

@ -128,8 +128,6 @@ typedef struct vid_render_funcs_s {
void (*SCR_UpdateScreen) (double realtime, SCR_Func scr_3dfunc,
SCR_Func *scr_funcs);
void (*SCR_DrawRam) (void);
void (*SCR_DrawFPS) (void);
void (*SCR_DrawTime) (void);
void (*SCR_DrawTurtle) (void);
void (*SCR_DrawPause) (void);
struct tex_s *(*SCR_CaptureBGR) (void);

View file

@ -16,6 +16,7 @@ extern quat_t crosshair_color;
extern struct cvar_s *d_mipcap;
extern struct cvar_s *d_mipscale;
extern struct cvar_s *gl_driver;
extern struct cvar_s *gl_affinemodels;
extern struct cvar_s *gl_anisotropy;
extern struct cvar_s *gl_clear;

View file

@ -20,7 +20,8 @@ EXTRA_LTLIBRARIES= \
common_sources= \
crosshair.c noisetextures.c r_alias.c r_bsp.c r_cvar.c r_dyn_textures.c \
r_efrag.c r_ent.c r_graph.c r_light.c r_main.c r_part.c r_screen.c
r_efrag.c r_ent.c r_graph.c r_light.c r_main.c r_part.c r_screen.c \
vid_common.c
renderer_libs= \
@vid_render_static_plugin_libs@ \

View file

@ -9,7 +9,7 @@ gl_src = \
gl_draw.c gl_dyn_lights.c gl_dyn_part.c gl_dyn_textures.c \
gl_fog.c gl_graph.c gl_lightmap.c gl_mod_alias.c gl_mod_sprite.c \
gl_rmain.c gl_rmisc.c gl_rsurf.c gl_screen.c gl_sky.c \
gl_sky_clip.c gl_textures.c gl_warp.c
gl_sky_clip.c gl_textures.c gl_warp.c qfgl_ext.c vid_common_gl.c vtxarray.c
libgl_la_SOURCES= $(gl_src)

View file

@ -15,7 +15,8 @@ shader_gen= \
glsl_src = \
glsl_alias.c glsl_bsp.c glsl_draw.c glsl_fog.c glsl_lightmap.c \
glsl_main.c glsl_particles.c glsl_screen.c glsl_sprite.c glsl_textures.c
glsl_main.c glsl_particles.c glsl_screen.c glsl_sprite.c glsl_textures.c \
qfglsl.c vid_common_glsl.c
noinst_LTLIBRARIES= libglsl.la
BUILT_SOURCES= $(shader_gen)

View file

@ -56,6 +56,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "compat.h"
#include "d_iface.h"
#include "r_internal.h"
VISIBLE int glsl_palette;
VISIBLE int glsl_colormap;

View file

@ -10,8 +10,8 @@ noinst_LTLIBRARIES= libsw.la $(asm)
EXTRA_LTLIBRARIES=libswrend_asm.la
asm_src= \
d_draw.S d_parta.S d_polysa.S d_scana.S d_spr8.S d_varsa.S fpua.S \
surf8.S sw_raclipa.S sw_raliasa.S sw_rdrawa.S sw_redgea.S \
d_copy.S d_draw.S d_parta.S d_polysa.S d_scana.S d_spr8.S d_varsa.S \
fpua.S surf8.S sw_raclipa.S sw_raliasa.S sw_rdrawa.S sw_redgea.S \
sw_rvarsa.S transform.S
sw_src= \
@ -19,7 +19,8 @@ sw_src= \
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c fpu.c nonintel.c \
screen.c sw_graph.c sw_raclip.c sw_ralias.c sw_rbsp.c sw_rdraw.c \
sw_redge.c sw_rmain.c sw_rmisc.c sw_rpart.c sw_rsky.c sw_rsprite.c \
sw_rsurf.c
sw_rsurf.c \
vid_common_sw.c
libswrend_asm_la_LDFLAGS= @STATIC@
libswrend_asm_la_SOURCES= $(asm_src)

View file

@ -10,7 +10,8 @@ sw32_src= \
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c screen.c \
sw32_graph.c sw32_raclip.c sw32_ralias.c sw32_rbsp.c \
sw32_rdraw.c sw32_redge.c sw32_rmain.c sw32_rmisc.c sw32_rpart.c \
sw32_rsky.c sw32_rsprite.c sw32_rsurf.c
sw32_rsky.c sw32_rsprite.c sw32_rsurf.c \
vid_common_sw32.c
libsw32_la_SOURCES= $(sw32_src)

View file

@ -40,6 +40,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/vid.h"
#include "compat.h"
#include "r_internal.h"
VISIBLE unsigned short d_8to16table[256];
unsigned char d_15to8table[65536];

View file

@ -0,0 +1,118 @@
/*
vid_render_gl.c
Common functions and data for the video plugins
Copyright (C) 2012 Bill Currie <bill@taniwha.org>
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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "QF/plugin/general.h"
#include "QF/plugin/vid_render.h"
#include "mod_internal.h"
#include "r_internal.h"
static vid_model_funcs_t model_funcs = {
Mod_LoadExternalTextures,
Mod_LoadLighting,
Mod_SubdivideSurface,
Mod_ProcessTexture,
Mod_LoadAliasModel,
Mod_LoadSpriteModel,
Skin_SetColormap,
Skin_SetSkin,
Skin_SetupSkin,
Skin_SetTranslation,
Skin_ProcessTranslation,
Skin_InitTranslations,
Skin_Init_Textures,
Skin_SetPlayerSkin,
};
vid_render_funcs_t vid_render_funcs = {
Draw_Init,
Draw_Character,
Draw_String,
Draw_nString,
Draw_AltString,
Draw_ConsoleBackground,
Draw_Crosshair,
Draw_CrosshairAt,
Draw_TileClear,
Draw_Fill,
Draw_TextBox,
Draw_FadeScreen,
Draw_BlendScreen,
Draw_CachePic,
Draw_UncachePic,
Draw_MakePic,
Draw_DestroyPic,
Draw_PicFromWad,
Draw_Pic,
Draw_Picf,
Draw_SubPic,
SCR_UpdateScreen,
SCR_DrawRam,
SCR_DrawTurtle,
SCR_DrawPause,
SCR_CaptureBGR,
SCR_ScreenShot,
SCR_DrawStringToSnap,
Fog_Update,
Fog_ParseWorldspawn,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_AddEfrags,
R_RemoveEfrags,
R_EnqueueEntity,
R_LineGraph,
R_AllocDlight,
R_AllocEntity,
R_RenderView,
R_DecayLights,
D_FlushCaches,
0,
&model_funcs
};
vid_render_data_t vid_render_data = {
&vid, &r_refdef, &scr_vrect,
0, 0, 0,
0,
0, 0,
0.0,
true, false, false, false,
0,
0, 0,
0,
0.0, 0.0,
0,
r_origin, vpn, vright, vup
};

View file

@ -37,91 +37,6 @@
static general_funcs_t plugin_info_general_funcs = {
};
static vid_model_funcs_t model_funcs = {
Mod_LoadExternalTextures,
Mod_LoadLighting,
Mod_SubdivideSurface,
Mod_ProcessTexture,
Mod_LoadAliasModel,
Mod_LoadSpriteModel,
Skin_SetColormap,
Skin_SetSkin,
Skin_SetupSkin,
Skin_SetTranslation,
Skin_ProcessTranslation,
Skin_InitTranslations,
Skin_Init_Textures,
Skin_SetPlayerSkin,
};
vid_render_funcs_t vid_render_funcs = {
Draw_Init,
Draw_Character,
Draw_String,
Draw_nString,
Draw_AltString,
Draw_ConsoleBackground,
Draw_Crosshair,
Draw_CrosshairAt,
Draw_TileClear,
Draw_Fill,
Draw_TextBox,
Draw_FadeScreen,
Draw_BlendScreen,
Draw_CachePic,
Draw_UncachePic,
Draw_MakePic,
Draw_DestroyPic,
Draw_PicFromWad,
Draw_Pic,
Draw_Picf,
Draw_SubPic,
SCR_UpdateScreen,
SCR_DrawRam,
SCR_DrawFPS,
SCR_DrawTime,
SCR_DrawTurtle,
SCR_DrawPause,
SCR_CaptureBGR,
SCR_ScreenShot,
SCR_DrawStringToSnap,
Fog_Update,
Fog_ParseWorldspawn,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_AddEfrags,
R_RemoveEfrags,
R_EnqueueEntity,
R_LineGraph,
R_AllocDlight,
R_AllocEntity,
R_RenderView,
R_DecayLights,
D_FlushCaches,
0,
&model_funcs
};
vid_render_data_t vid_render_data = {
&vid, &r_refdef, &scr_vrect,
0, 0, 0,
0,
0, 0,
0.0,
true, false, false, false,
0,
0, 0,
0,
0.0, 0.0,
0,
r_origin, vpn, vright, vup
};
static general_data_t plugin_info_general_data;
static plugin_funcs_t plugin_info_funcs = {

View file

@ -37,91 +37,6 @@
static general_funcs_t plugin_info_general_funcs = {
};
static vid_model_funcs_t model_funcs = {
Mod_LoadExternalTextures,
Mod_LoadLighting,
Mod_SubdivideSurface,
Mod_ProcessTexture,
Mod_LoadAliasModel,
Mod_LoadSpriteModel,
Skin_SetColormap,
Skin_SetSkin,
Skin_SetupSkin,
Skin_SetTranslation,
Skin_ProcessTranslation,
Skin_InitTranslations,
Skin_Init_Textures,
Skin_SetPlayerSkin,
};
vid_render_funcs_t vid_render_funcs = {
Draw_Init,
Draw_Character,
Draw_String,
Draw_nString,
Draw_AltString,
Draw_ConsoleBackground,
Draw_Crosshair,
Draw_CrosshairAt,
Draw_TileClear,
Draw_Fill,
Draw_TextBox,
Draw_FadeScreen,
Draw_BlendScreen,
Draw_CachePic,
Draw_UncachePic,
Draw_MakePic,
Draw_DestroyPic,
Draw_PicFromWad,
Draw_Pic,
Draw_Picf,
Draw_SubPic,
SCR_UpdateScreen,
SCR_DrawRam,
SCR_DrawFPS,
SCR_DrawTime,
SCR_DrawTurtle,
SCR_DrawPause,
SCR_CaptureBGR,
SCR_ScreenShot,
SCR_DrawStringToSnap,
Fog_Update,
Fog_ParseWorldspawn,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_AddEfrags,
R_RemoveEfrags,
R_EnqueueEntity,
R_LineGraph,
R_AllocDlight,
R_AllocEntity,
R_RenderView,
R_DecayLights,
D_FlushCaches,
0,
&model_funcs
};
vid_render_data_t vid_render_data = {
&vid, &r_refdef, &scr_vrect,
0, 0, 0,
0,
0, 0,
0.0,
true, false, false, false,
0,
0, 0,
0,
0.0, 0.0,
0,
r_origin, vpn, vright, vup
};
static general_data_t plugin_info_general_data;
static plugin_funcs_t plugin_info_funcs = {

View file

@ -37,91 +37,6 @@
static general_funcs_t plugin_info_general_funcs = {
};
static vid_model_funcs_t model_funcs = {
Mod_LoadExternalTextures,
Mod_LoadLighting,
Mod_SubdivideSurface,
Mod_ProcessTexture,
Mod_LoadAliasModel,
Mod_LoadSpriteModel,
Skin_SetColormap,
Skin_SetSkin,
Skin_SetupSkin,
Skin_SetTranslation,
Skin_ProcessTranslation,
Skin_InitTranslations,
Skin_Init_Textures,
Skin_SetPlayerSkin,
};
vid_render_funcs_t vid_render_funcs = {
Draw_Init,
Draw_Character,
Draw_String,
Draw_nString,
Draw_AltString,
Draw_ConsoleBackground,
Draw_Crosshair,
Draw_CrosshairAt,
Draw_TileClear,
Draw_Fill,
Draw_TextBox,
Draw_FadeScreen,
Draw_BlendScreen,
Draw_CachePic,
Draw_UncachePic,
Draw_MakePic,
Draw_DestroyPic,
Draw_PicFromWad,
Draw_Pic,
Draw_Picf,
Draw_SubPic,
SCR_UpdateScreen,
SCR_DrawRam,
SCR_DrawFPS,
SCR_DrawTime,
SCR_DrawTurtle,
SCR_DrawPause,
SCR_CaptureBGR,
SCR_ScreenShot,
SCR_DrawStringToSnap,
Fog_Update,
Fog_ParseWorldspawn,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_AddEfrags,
R_RemoveEfrags,
R_EnqueueEntity,
R_LineGraph,
R_AllocDlight,
R_AllocEntity,
R_RenderView,
R_DecayLights,
D_FlushCaches,
0,
&model_funcs
};
vid_render_data_t vid_render_data = {
&vid, &r_refdef, &scr_vrect,
0, 0, 0,
0,
0, 0,
0.0,
true, false, false, false,
0,
0, 0,
0,
0.0, 0.0,
0,
r_origin, vpn, vright, vup
};
static general_data_t plugin_info_general_data;
static plugin_funcs_t plugin_info_funcs = {

View file

@ -37,91 +37,6 @@
static general_funcs_t plugin_info_general_funcs = {
};
static vid_model_funcs_t model_funcs = {
Mod_LoadExternalTextures,
Mod_LoadLighting,
Mod_SubdivideSurface,
Mod_ProcessTexture,
Mod_LoadAliasModel,
Mod_LoadSpriteModel,
Skin_SetColormap,
Skin_SetSkin,
Skin_SetupSkin,
Skin_SetTranslation,
Skin_ProcessTranslation,
Skin_InitTranslations,
Skin_Init_Textures,
Skin_SetPlayerSkin,
};
vid_render_funcs_t vid_render_funcs = {
Draw_Init,
Draw_Character,
Draw_String,
Draw_nString,
Draw_AltString,
Draw_ConsoleBackground,
Draw_Crosshair,
Draw_CrosshairAt,
Draw_TileClear,
Draw_Fill,
Draw_TextBox,
Draw_FadeScreen,
Draw_BlendScreen,
Draw_CachePic,
Draw_UncachePic,
Draw_MakePic,
Draw_DestroyPic,
Draw_PicFromWad,
Draw_Pic,
Draw_Picf,
Draw_SubPic,
SCR_UpdateScreen,
SCR_DrawRam,
SCR_DrawFPS,
SCR_DrawTime,
SCR_DrawTurtle,
SCR_DrawPause,
SCR_CaptureBGR,
SCR_ScreenShot,
SCR_DrawStringToSnap,
Fog_Update,
Fog_ParseWorldspawn,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_AddEfrags,
R_RemoveEfrags,
R_EnqueueEntity,
R_LineGraph,
R_AllocDlight,
R_AllocEntity,
R_RenderView,
R_DecayLights,
D_FlushCaches,
0,
&model_funcs
};
vid_render_data_t vid_render_data = {
&vid, &r_refdef, &scr_vrect,
0, 0, 0,
0,
0, 0,
0.0,
true, false, false, false,
0,
0, 0,
0,
0.0, 0.0,
0,
r_origin, vpn, vright, vup
};
static general_data_t plugin_info_general_data;
static plugin_funcs_t plugin_info_funcs = {

View file

@ -16,11 +16,9 @@ lib_LTLIBRARIES= @JOY_TARGETS@
noinst_LTLIBRARIES= @VID_TARGETS@ @vid_libs@
EXTRA_LTLIBRARIES= \
libQFjs.la libQFfbdev.la libQFglx.la libQFglslx.la libQFsvga.la \
libQFtdfx.la libQFx11.la libQFsdl.la libQFsdl32.la libQFsgl.la \
libQFsglsl.la libQFwgl.la \
libQFjs.la libQFfbdev.la libQFsvga.la libQFx11.la libQFsdl.la libQFwgl.la \
libvid_asm.la libvid_common.la libvid_gl.la libvid_glsl.la libvid_sdl.la \
libvid_sw.la libvid_sw32.la libvid_svga.la libvid_x11.la
libvid_svga.la libvid_x11.la
libvid_asm_la_SOURCES= d_copy.S
libvid_asm_la_CFLAGS= @PREFER_NON_PIC@
@ -52,22 +50,6 @@ libvid_common_la_SOURCES= \
libvid_common_la_CFLAGS= @PREFER_NON_PIC@
libvid_common_la_LDFLAGS= @STATIC@
libvid_sw_la_SOURCES= vid_common_sw.c
libvid_sw_la_CFLAGS= @PREFER_NON_PIC@
libvid_sw_la_LDFLAGS= @STATIC@
libvid_sw32_la_SOURCES= vid_common_sw32.c
libvid_sw32_la_CFLAGS= @PREFER_NON_PIC@
libvid_sw32_la_LDFLAGS= @STATIC@
libvid_gl_la_SOURCES= vid_common_gl.c qfgl_ext.c vtxarray.c
libvid_gl_la_CFLAGS= @PREFER_NON_PIC@
libvid_gl_la_LDFLAGS= @STATIC@
libvid_glsl_la_SOURCES= vid_common_glsl.c qfglsl.c vtxarray.c
libvid_glsl_la_CFLAGS= @PREFER_NON_PIC@
libvid_glsl_la_LDFLAGS= @STATIC@
libvid_x11_la_SOURCES= in_x11.c context_x11.c dga_check.c
libvid_x11_la_CFLAGS= @PREFER_NON_PIC@ $(X_CFLAGS)
libvid_x11_la_LDFLAGS= @STATIC@
@ -88,7 +70,7 @@ fbdev_h= fbset_modes_y.h
YFLAGS = -d
YACCLEX_CLEANFILES= $(fbdev_c) $(fbdev_h)
fbdev_libs=libvid_common.la libvid_sw.la
fbdev_libs=libvid_common.la
libQFfbdev_la_CFLAGS= @PREFER_NON_PIC@
libQFfbdev_la_SOURCES= fbset.c fbset_modes_y.y fbset_modes_l.l \
in_fbdev.c vid_fbdev.c
@ -96,61 +78,21 @@ libQFfbdev_la_LDFLAGS= @STATIC@
libQFfbdev_la_LIBADD= $(fbdev_libs)
libQFfbdev_la_DEPENDENCIES= $(fbdev_libs)
#
# OpenGL in X Window
#
glx_libs=libvid_common.la libvid_gl.la libvid_x11.la
libQFglx_la_CFLAGS= @PREFER_NON_PIC@ $(X_CFLAGS)
libQFglx_la_SOURCES= vid_glx.c
libQFglx_la_LDFLAGS= @STATIC@
libQFglx_la_LIBADD= $(glx_libs)
libQFglx_la_DEPENDENCIES= $(glx_libs)
#
# OpenGL in X Window
#
glslx_libs=libvid_common.la libvid_glsl.la libvid_x11.la
libQFglslx_la_CFLAGS= @PREFER_NON_PIC@ $(X_CFLAGS)
libQFglslx_la_SOURCES= vid_glx.c
libQFglslx_la_LDFLAGS= @STATIC@
libQFglslx_la_LIBADD= $(glslx_libs)
libQFglslx_la_DEPENDENCIES= $(glslx_libs)
#
# Simple DirectMedia Library
#
sdl_libs=libvid_common.la libvid_sw.la libvid_sdl.la
sdl_libs=libvid_common.la libvid_sdl.la
libQFsdl_la_CFLAGS= @PREFER_NON_PIC@ $(SDL_CFLAGS)
libQFsdl_la_SOURCES= vid_sdl.c
libQFsdl_la_LDFLAGS= @STATIC@
libQFsdl_la_LIBADD= $(sdl_libs)
libQFsdl_la_DEPENDENCIES= $(sdl_libs)
sdl32_libs=libvid_common.la libvid_sw32.la libvid_sdl.la
libQFsdl32_la_CFLAGS= @PREFER_NON_PIC@ $(SDL_CFLAGS)
libQFsdl32_la_SOURCES= vid_sdl32.c
libQFsdl32_la_LDFLAGS= @STATIC@
libQFsdl32_la_LIBADD= $(sdl32_libs)
libQFsdl32_la_DEPENDENCIES= $(sdl32_libs)
sgl_libs=libvid_common.la libvid_gl.la libvid_sdl.la
libQFsgl_la_CFLAGS= @PREFER_NON_PIC@ $(SDL_CFLAGS)
libQFsgl_la_SOURCES= vid_sgl.c
libQFsgl_la_LDFLAGS= @STATIC@
libQFsgl_la_LIBADD= $(sgl_libs)
libQFsgl_la_DEPENDENCIES= $(sgl_libs)
sglsl_libs=libvid_common.la libvid_glsl.la libvid_sdl.la
libQFsglsl_la_CFLAGS= @PREFER_NON_PIC@ $(SDL_CFLAGS)
libQFsglsl_la_SOURCES= vid_sgl.c
libQFsglsl_la_LDFLAGS= @STATIC@
libQFsglsl_la_LIBADD= $(sglsl_libs)
libQFsglsl_la_DEPENDENCIES= $(sglsl_libs)
#
# SVGAlib
#
svga_libs=$(asm) libvid_common.la libvid_sw.la libvid_svga.la
svga_libs=$(asm) libvid_common.la libvid_svga.la
libQFsvga_la_CFLAGS= @PREFER_NON_PIC@ $(SVGA_CFLAGS)
libQFsvga_la_SOURCES= vid_svgalib.c
libQFsvga_la_LDFLAGS= @STATIC@
@ -180,7 +122,7 @@ libQFwgl_la_DEPENDENCIES= $(wgl_libs)
#
# X11 software rendering
#
x11_libs=libvid_common.la libvid_sw.la libvid_x11.la
x11_libs=libvid_common.la libvid_x11.la
libQFx11_la_CFLAGS= @PREFER_NON_PIC@ $(X_CFLAGS)
libQFx11_la_SOURCES= vid_x11.c
libQFx11_la_LDFLAGS= @STATIC@