extensions/bintools/extension.cpp
author David Anderson <danderson@mozilla.com>
Thu Aug 08 20:26:36 2013 -0700 (2013-08-08)
changeset 3979 bdad6d9c8351
parent 3630 b72450a8be42
child 4188 89782d5fc91b
permissions -rw-r--r--
Use SSE when available for floating-point operations (bug 5841, r=her).
faluco@739
     1
/**
dvander@2783
     2
 * vim: set ts=4 sw=4 tw=99 noet:
ds@1330
     3
 * =============================================================================
ds@757
     4
 * SourceMod BinTools Extension
ds@3104
     5
 * Copyright (C) 2004-2010 AlliedModders LLC.  All rights reserved.
ds@1330
     6
 * =============================================================================
faluco@739
     7
 *
ds@1330
     8
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    10
 * Free Software Foundation.
dvander@1226
    11
 * 
ds@1330
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    15
 * details.
dvander@1226
    16
 *
ds@1330
    17
 * You should have received a copy of the GNU General Public License along with
ds@1330
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1226
    19
 *
ds@1330
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    27
 * or <http://www.sourcemod.net/license.php>.
faluco@739
    28
 *
faluco@739
    29
 * Version: $Id$
faluco@739
    30
 */
faluco@739
    31
dvander@2783
    32
#include <sourcemod_version.h>
faluco@739
    33
#include "extension.h"
faluco@739
    34
#include "CallMaker.h"
faluco@739
    35
faluco@739
    36
/**
faluco@739
    37
 * @file extension.cpp
ds@757
    38
 * @brief Implements BinTools extension code.
faluco@739
    39
 */
faluco@739
    40
ds@757
    41
BinTools g_BinTools;		/**< Global singleton for extension's main interface */
faluco@739
    42
CallMaker g_CallMaker;
pred@2504
    43
CallMaker2 g_CallMaker2;
faluco@739
    44
ISourcePawnEngine *g_SPEngine;
faluco@739
    45
faluco@739
    46
SMEXT_LINK(&g_BinTools);
faluco@739
    47
ds@757
    48
bool BinTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
faluco@739
    49
{
faluco@739
    50
	g_SPEngine = g_pSM->GetScriptingEngine();
faluco@739
    51
	g_pShareSys->AddInterface(myself, &g_CallMaker);
ds@3104
    52
ds@3104
    53
	/* IBinTools2 is only compatible with SH v5 */
ds@3104
    54
	if (g_pSM->GetShApiVersion() >= 5)
ds@3104
    55
	{
ds@3104
    56
		g_pShareSys->AddInterface(myself, &g_CallMaker2);
ds@3104
    57
	}
faluco@739
    58
faluco@739
    59
	return true;
faluco@739
    60
}
dvander@2783
    61
dvander@2790
    62
const char *BinTools::GetExtensionVerString()
dvander@2783
    63
{
asherkin@3630
    64
	return SM_VERSION_STRING;
dvander@2783
    65
}
dvander@2783
    66
dvander@2790
    67
const char *BinTools::GetExtensionDateString()
dvander@2783
    68
{
dvander@2783
    69
	return SM_BUILD_TIMESTAMP;
dvander@2783
    70
}
dvander@2783
    71