Make it easier to compile q3 statically.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6215 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2022-03-08 05:32:38 +00:00
parent 1c32a8ef8c
commit 1a5c8da880
5 changed files with 17 additions and 6 deletions

View File

@ -134,8 +134,8 @@ endif
ifeq (,$(findstring DNO_OPUS,$(FTE_CONFIG_EXTRA))) ifeq (,$(findstring DNO_OPUS,$(FTE_CONFIG_EXTRA)))
USE_OPUS=1 USE_OPUS=1
endif endif
ifeq (,$(findstring DNO_BOTLIB,$(FTE_CONFIG_EXTRA))) ifneq (,$(findstring DLINK_QUAKE3,$(FTE_CONFIG_EXTRA)))
USE_BOTLIB=1 LINK_QUAKE3=1
endif endif
ifeq (,$(findstring DNO_VORBISFILE,$(FTE_CONFIG_EXTRA))) ifeq (,$(findstring DNO_VORBISFILE,$(FTE_CONFIG_EXTRA)))
USE_VORBISFILE=1 USE_VORBISFILE=1
@ -944,9 +944,9 @@ COMMON_OBJS = \
q1bsp.o \ q1bsp.o \
q2pmove.o q2pmove.o
ifeq (1,$(USE_BOTLIB)) ifeq (1,$(LINK_QUAKE3))
BOTLIB_CFLAGS=-I$(BOTLIB_DIR) -DBOTLIB -DBOTLIB_STATIC ALL_CFLAGS+=-I$(BOTLIB_DIR) -DBOTLIB -DBOTLIB_STATIC -DSTATIC_Q3
BOTLIB_OBJS = \ COMMON_OBJS += \
clq3_parse.o \ clq3_parse.o \
cl_ui.o \ cl_ui.o \
cl_cg.o \ cl_cg.o \
@ -2534,4 +2534,5 @@ install: sv-rel gl-rel mingl-rel qcc-rel
version: version:
@echo $(SVN_VERSION) @echo $(SVN_VERSION)
@echo $(SVN_DATE) @echo $(SVN_DATE)
@echo $(FTE_CONFIG_EXTRA)

View File

@ -208,6 +208,7 @@
#ifdef AVAIL_JPEGLIB #ifdef AVAIL_JPEGLIB
-DLINK_JPEG -DLINK_JPEG
#endif #endif
//-DLINK_QUAKE3 //ask the makefile to bake the quake3 plugin into the engine itself.
//-DNO_OPUS //-DNO_OPUS
//-DNO_SPEEX //disable static speex //-DNO_SPEEX //disable static speex

View File

@ -42,7 +42,7 @@ static struct
#endif #endif
#ifdef STATIC_Q3 #ifdef STATIC_Q3
{"Q3", Plug_Q3_Init}, {"quake3", Plug_Q3_Init},
#endif #endif
{NULL} {NULL}
}; };

View File

@ -10,8 +10,10 @@ plugmsgfuncs_t *msgfuncs;
plugworldfuncs_t *worldfuncs; plugworldfuncs_t *worldfuncs;
plugmasterfuncs_t *masterfuncs; plugmasterfuncs_t *masterfuncs;
#ifndef STATIC_Q3
double realtime; double realtime;
struct netprim_s msg_nullnetprim; struct netprim_s msg_nullnetprim;
#endif
//mostly for access to sv.state or svs.sockets //mostly for access to sv.state or svs.sockets
q3serverstate_t sv3; q3serverstate_t sv3;
@ -1694,10 +1696,12 @@ static struct q3gamecode_s q3funcs =
}, },
}; };
#ifndef STATIC_Q3
void Q3_Frame(double enginetime, double gametime) void Q3_Frame(double enginetime, double gametime)
{ {
realtime = enginetime; realtime = enginetime;
} }
#endif
void Q3_Shutdown(void) void Q3_Shutdown(void)
{ {
@ -1731,7 +1735,9 @@ qboolean Plug_Init(void)
Con_Printf("Engine is already using a q3-derived gamecode plugin.\n"); Con_Printf("Engine is already using a q3-derived gamecode plugin.\n");
return false; return false;
} }
#ifndef STATIC_Q3
plugfuncs->ExportFunction("Tick", Q3_Frame); plugfuncs->ExportFunction("Tick", Q3_Frame);
#endif
drawfuncs = plugfuncs->GetEngineInterface(plug2dfuncs_name, sizeof(*drawfuncs)); drawfuncs = plugfuncs->GetEngineInterface(plug2dfuncs_name, sizeof(*drawfuncs));
scenefuncs = plugfuncs->GetEngineInterface(plug3dfuncs_name, sizeof(*scenefuncs)); scenefuncs = plugfuncs->GetEngineInterface(plug3dfuncs_name, sizeof(*scenefuncs));

View File

@ -1,3 +1,6 @@
#ifndef FTEPLUGIN
#define FTEPLUGIN
#endif
#include "../plugins/plugin.h" #include "../plugins/plugin.h"
#include "clq3defs.h" #include "clq3defs.h"