ported SM's core to Orange Box

build is broken now in purpose

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401547
This commit is contained in:
Borja Ferrer
2007-10-14 00:04:21 +00:00
parent 36f6a760b5
commit b7d9d487cc
35 changed files with 2240 additions and 164 deletions
+3 -23
View File
@@ -32,6 +32,8 @@
#ifndef _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
#define _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
#include <compat_wrappers.h>
/**
* @file IRootConsoleMenu.h
* @brief Defines the interface for adding options to the "sm" console command.
@@ -51,7 +53,7 @@ namespace SourceMod
class IRootConsoleCommand
{
public:
virtual void OnRootConsoleCommand(const char *command, unsigned int argcount) =0;
virtual void OnRootConsoleCommand(const char *cmdname, const CCommand &command) =0;
};
/**
@@ -87,28 +89,6 @@ namespace SourceMod
*/
virtual void ConsolePrint(const char *fmt, ...) =0;
/**
* @brief Returns the string of an argument.
*
* @param argno The index of the argument.
* @return A string containing the argument, or nothing if invalid.
*/
virtual const char *GetArgument(unsigned int argno) =0;
/**
* @brief Returns the number of arguments.
*
* @return Number of arguments.
*/
virtual unsigned int GetArgumentCount() =0;
/**
* @brief Returns the entire argument string.
*
* @return String containing all arguments.
*/
virtual const char *GetArguments() =0;
/**
* @brief Draws a generic command/description pair.
* NOTE: The pair is currently four spaces indented and 16-N spaces of separation,
+82
View File
@@ -0,0 +1,82 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
#define _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
#if defined ORANGEBOX_BUILD
#include "convar_sm_ob.h"
#include "sourcemm_api.h"
#define CONVAR_REGISTER(object) ConVar_Register(0, object)
inline bool IsFlagSet(ConCommandBase *cmd, int flag)
{
return cmd->IsFlagSet(flag);
}
inline void InsertServerCommand(const char *buf)
{
engine->ServerCommand(buf);
}
#else
#include "sourcemm_api.h"
class CCommand
{
public:
inline const char *ArgS() const
{
return engine->Cmd_Args();
}
inline int ArgC() const
{
return engine->Cmd_Argc();
}
inline const char *Arg(int index) const
{
return engine->Cmd_Argv(index);
}
};
inline bool IsFlagSet(ConCommandBase *cmd, int flag)
{
return cmd->IsBitSet(flag);
}
inline void InsertServerCommand(const char *buf)
{
engine->InsertServerCommand(buf);
}
#define CONVAR_REGISTER(object) ConCommandBaseMgr::OneTimeInit(object)
typedef FnChangeCallback FnChangeCallback_t;
#endif //ORANGEBOX_BUILD
#endif //_INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
+48
View File
@@ -0,0 +1,48 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_METAMOD_WRAPPERS_H_
#define _INCLUDE_METAMOD_WRAPPERS_H_
/* Get iface wrappers */
#define GetEngineFactory engineFactory
#define GetServerFactory serverFactory
#define GetPhysicsFactory physicsFactory
#define GetFileSystemFactory fileSystemFactory
#define GetCGlobals pGlobals
#define UnregisterConCommandBase UnregisterConCmdBase
/* Valve interface wrappers */
#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
#endif //_INCLUDE_METAMOD_WRAPPERS_H_