Added preliminary support for Left 4 Dead; some things may not yet work.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#ifndef _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
|
||||
#define _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
|
||||
|
||||
#if defined ORANGEBOX_BUILD
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#define CONVAR_REGISTER(object) ConVar_Register(0, object)
|
||||
|
||||
inline bool IsFlagSet(ConCommandBase *cmd, int flag)
|
||||
@@ -43,6 +43,14 @@
|
||||
{
|
||||
engine->InsertServerCommand(buf);
|
||||
}
|
||||
inline ConCommandBase *FindCommandBase(const char *name)
|
||||
{
|
||||
return icvar->FindCommandBase(name);
|
||||
}
|
||||
inline ConCommand *FindCommand(const char *name)
|
||||
{
|
||||
return icvar->FindCommand(name);
|
||||
}
|
||||
#else
|
||||
class CCommand
|
||||
{
|
||||
@@ -69,11 +77,71 @@
|
||||
{
|
||||
engine->InsertServerCommand(buf);
|
||||
}
|
||||
inline ConCommandBase *FindCommandBase(const char *name)
|
||||
{
|
||||
ConCommandBase *pBase = icvar->GetCommands();
|
||||
while (pBase)
|
||||
{
|
||||
if (strcmp(pBase->GetName(), name) == 0)
|
||||
{
|
||||
if (pBase->IsCommand())
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pBase;
|
||||
}
|
||||
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
inline ConCommand *FindCommand(const char *name)
|
||||
{
|
||||
ConCommandBase *pBase = icvar->GetCommands();
|
||||
while (pBase)
|
||||
{
|
||||
if (strcmp(pBase->GetName(), name) == 0)
|
||||
{
|
||||
if (!pBase->IsCommand())
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return static_cast<ConCommand *>(pBase);
|
||||
}
|
||||
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
|
||||
|
||||
#define CONVAR_REGISTER(object) ConCommandBaseMgr::OneTimeInit(object)
|
||||
typedef FnChangeCallback FnChangeCallback_t;
|
||||
#endif //ORANGEBOX_BUILD
|
||||
#endif //SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
|
||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
inline int IndexOfEdict(const edict_t *pEdict)
|
||||
{
|
||||
return ((int)pEdict - (int)gpGlobals->baseEdict) >> 4;
|
||||
}
|
||||
inline edict_t *PEntityOfEntIndex(int iEntIndex)
|
||||
{
|
||||
if (iEntIndex >= 0 && iEntIndex < gpGlobals->maxEntities)
|
||||
{
|
||||
return (edict_t *)((int)gpGlobals->baseEdict + (iEntIndex << 4));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
inline int IndexOfEdict(const edict_t *pEdict)
|
||||
{
|
||||
return engine->IndexOfEdict(pEdict);
|
||||
}
|
||||
inline edict_t *PEntityOfEntIndex(int iEntIndex)
|
||||
{
|
||||
return engine->PEntityOfEntIndex(iEntIndex);
|
||||
}
|
||||
#endif //SOURCE_ENGINE >= SE_LEFT4DEAD
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
|
||||
|
||||
@@ -5,8 +5,9 @@ SMSDK = ..
|
||||
SRCDS_BASE = ~/srcds
|
||||
HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
SOURCEMM14 = ../../../sourcemm-1.4
|
||||
SOURCEMM16 = ../../../sourcemm-1.6
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
SOURCEMM14 = ../../../mmsource-legacy
|
||||
SOURCEMM16 = ../../../mmsource
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
@@ -29,8 +30,9 @@ CPP = gcc-4.1
|
||||
override ENGSET = false
|
||||
ifeq "$(ENGINE)" "original"
|
||||
HL2SDK = $(HL2SDK_ORIG)
|
||||
HL2PUB = $(HL2SDK_ORIG)/public
|
||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/linux_sdk
|
||||
CFLAGS += -DSOURCE_ENGINE=2
|
||||
METAMOD = $(SOURCEMM14)
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
SRCDS = $(SRCDS_BASE)
|
||||
@@ -38,20 +40,32 @@ ifeq "$(ENGINE)" "original"
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangebox"
|
||||
HL2SDK = $(HL2SDK_OB)
|
||||
HL2PUB = $(HL2SDK_OB)/public
|
||||
HL2LIB = $(HL2SDK_OB)/lib/linux
|
||||
CFLAGS += -DORANGEBOX_BUILD
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=3
|
||||
METAMOD = $(SOURCEMM16)
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/orangebox
|
||||
override ENGSET = true
|
||||
endif
|
||||
ifeq "$(ENGINE)" "left4dead"
|
||||
HL2SDK = $(HL2SDK_L4D)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=4
|
||||
METAMOD = $(SOURCEMM16)
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/l4d_demo
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
CFLAGS += -DSE_EPISODEONE=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
|
||||
|
||||
LINK = vstdlib_i486.so tier0_i486.so -static-libgcc
|
||||
|
||||
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK) -I$(SMSDK)/jit \
|
||||
-I$(SMSDK)/jit/x86 -I$(SMSDK)/extensions -I$(SMSDK)/sourcepawn
|
||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK) -I$(SMSDK)/jit -I$(SMSDK)/jit/x86 \
|
||||
-I$(SMSDK)/extensions -I$(SMSDK)/sourcepawn
|
||||
|
||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
||||
@@ -91,7 +105,7 @@ all: check
|
||||
|
||||
check:
|
||||
if [ "$(ENGSET)" == "false" ]; then \
|
||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
||||
echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
+23
-10
@@ -5,8 +5,9 @@ SMSDK = ../..
|
||||
SRCDS_BASE = ~/srcds
|
||||
HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
SOURCEMM14 = ../../../sourcemm-1.4
|
||||
SOURCEMM16 = ../../../sourcemm-1.6
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
SOURCEMM14 = ../../../mmsource-legacy
|
||||
SOURCEMM16 = ../../../mmsource
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
@@ -32,8 +33,9 @@ CPP = gcc-4.1
|
||||
override ENGSET = false
|
||||
ifeq "$(ENGINE)" "original"
|
||||
HL2SDK = $(HL2SDK_ORIG)
|
||||
HL2PUB = $(HL2SDK_ORIG)/public
|
||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/linux_sdk
|
||||
CFLAGS += -DSOURCE_ENGINE=2
|
||||
METAMOD = $(SOURCEMM14)
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
SRCDS = $(SRCDS_BASE)
|
||||
@@ -41,14 +43,24 @@ ifeq "$(ENGINE)" "original"
|
||||
endif
|
||||
ifeq "$(ENGINE)" "orangebox"
|
||||
HL2SDK = $(HL2SDK_OB)
|
||||
HL2PUB = $(HL2SDK_OB)/public
|
||||
HL2LIB = $(HL2SDK_OB)/lib/linux
|
||||
CFLAGS += -DORANGEBOX_BUILD
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=3
|
||||
METAMOD = $(SOURCEMM16)
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/orangebox
|
||||
override ENGSET = true
|
||||
endif
|
||||
ifeq "$(ENGINE)" "left4dead"
|
||||
HL2SDK = $(HL2SDK_L4D)
|
||||
HL2PUB = $(HL2SDK)/public
|
||||
HL2LIB = $(HL2SDK)/lib/linux
|
||||
CFLAGS += -DSOURCE_ENGINE=4
|
||||
METAMOD = $(SOURCEMM16)
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/l4d_demo
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
ifeq "$(USEMETA)" "true"
|
||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||
@@ -56,8 +68,9 @@ ifeq "$(USEMETA)" "true"
|
||||
LINK += $(LINK_HL2)
|
||||
|
||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
||||
-I$(SMSDK)/public/sourcepawn
|
||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
||||
|
||||
CFLAGS += -DSE_EPISODEONE=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
|
||||
else
|
||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
||||
endif
|
||||
@@ -108,7 +121,7 @@ all: check
|
||||
|
||||
check:
|
||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
||||
echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user