Merged changes from 1.1 branch.
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 - gpGlobals->baseEdict);
|
||||
}
|
||||
inline edict_t *PEntityOfEntIndex(int iEntIndex)
|
||||
{
|
||||
if (iEntIndex >= 0 && iEntIndex < gpGlobals->maxEntities)
|
||||
{
|
||||
return (edict_t *)(gpGlobals->baseEdict + iEntIndex);
|
||||
}
|
||||
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,6 +5,7 @@ SMSDK = ..
|
||||
SRCDS_BASE = ~/srcds
|
||||
HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
MMSOURCE17 = ../../../mmsource-1.7
|
||||
|
||||
#####################################
|
||||
@@ -28,8 +29,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 = $(MMSOURCE17)/core-legacy
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
SRCDS = $(SRCDS_BASE)
|
||||
@@ -37,14 +39,26 @@ 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 = $(MMSOURCE17)/core
|
||||
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 = $(MMSOURCE17)/core
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/l4d
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
CFLAGS += -DSE_EPISODEONE=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
|
||||
|
||||
LINK = vstdlib_i486.so tier0_i486.so -static-libgcc
|
||||
|
||||
@@ -90,7 +104,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
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ SMSDK = ../..
|
||||
SRCDS_BASE = ~/srcds
|
||||
HL2SDK_ORIG = ../../../hl2sdk
|
||||
HL2SDK_OB = ../../../hl2sdk-ob
|
||||
HL2SDK_L4D = ../../../hl2sdk-l4d
|
||||
MMSOURCE17 = ../../../mmsource-1.7
|
||||
|
||||
#####################################
|
||||
@@ -31,8 +32,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 = $(MMSOURCE17)/core-legacy
|
||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||
SRCDS = $(SRCDS_BASE)
|
||||
@@ -40,14 +42,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 = $(MMSOURCE17)/core
|
||||
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 = $(MMSOURCE17)/core
|
||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||
SRCDS = $(SRCDS_BASE)/l4d
|
||||
override ENGSET = true
|
||||
endif
|
||||
|
||||
ifeq "$(USEMETA)" "true"
|
||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||
@@ -56,6 +68,7 @@ ifeq "$(USEMETA)" "true"
|
||||
|
||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||
-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
|
||||
@@ -106,7 +119,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
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
#include <dirent.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/stat.h>
|
||||
#define PLATFORM_MAX_PATH PATH_MAX
|
||||
#define PLATFORM_LIB_EXT "so"
|
||||
#define PLATFORM_MAX_PATH PATH_MAX
|
||||
#define PLATFORM_SEP_CHAR '/'
|
||||
#define PLATFORM_SEP_ALTCHAR '\\'
|
||||
#define PLATFORM_EXTERN_C extern "C" __attribute__((visibility("default")))
|
||||
|
||||
Reference in New Issue
Block a user