1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/stub_plugin/engine_api.cpp Tue Apr 06 07:36:14 2004 +0000
1.3 @@ -0,0 +1,259 @@
1.4 +// vi: set ts=4 sw=4 :
1.5 +// vim: set tw=75 :
1.6 +
1.7 +/*
1.8 + * Copyright (c) 2001-2003 Will Day <[email protected]>
1.9 + *
1.10 + * This file is part of Metamod.
1.11 + *
1.12 + * Metamod is free software; you can redistribute it and/or modify it
1.13 + * under the terms of the GNU General Public License as published by the
1.14 + * Free Software Foundation; either version 2 of the License, or (at
1.15 + * your option) any later version.
1.16 + *
1.17 + * Metamod is distributed in the hope that it will be useful, but
1.18 + * WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.20 + * General Public License for more details.
1.21 + *
1.22 + * You should have received a copy of the GNU General Public License
1.23 + * along with Metamod; if not, write to the Free Software Foundation,
1.24 + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.25 + *
1.26 + * In addition, as a special exception, the author gives permission to
1.27 + * link the code of this program with the Half-Life Game Engine ("HL
1.28 + * Engine") and Modified Game Libraries ("MODs") developed by Valve,
1.29 + * L.L.C ("Valve"). You must obey the GNU General Public License in all
1.30 + * respects for all of the code used other than the HL Engine and MODs
1.31 + * from Valve. If you modify this file, you may extend this exception
1.32 + * to your version of the file, but you are not obligated to do so. If
1.33 + * you do not wish to do so, delete this exception statement from your
1.34 + * version.
1.35 + *
1.36 + */
1.37 +
1.38 +#include <extdll.h>
1.39 +
1.40 +#include <meta_api.h>
1.41 +
1.42 +enginefuncs_t meta_engfuncs =
1.43 +{
1.44 + NULL, // pfnPrecacheModel()
1.45 + NULL, // pfnPrecacheSound()
1.46 + NULL, // pfnSetModel()
1.47 + NULL, // pfnModelIndex()
1.48 + NULL, // pfnModelFrames()
1.49 +
1.50 + NULL, // pfnSetSize()
1.51 + NULL, // pfnChangeLevel()
1.52 + NULL, // pfnGetSpawnParms()
1.53 + NULL, // pfnSaveSpawnParms()
1.54 +
1.55 + NULL, // pfnVecToYaw()
1.56 + NULL, // pfnVecToAngles()
1.57 + NULL, // pfnMoveToOrigin()
1.58 + NULL, // pfnChangeYaw()
1.59 + NULL, // pfnChangePitch()
1.60 +
1.61 + NULL, // pfnFindEntityByString()
1.62 + NULL, // pfnGetEntityIllum()
1.63 + NULL, // pfnFindEntityInSphere()
1.64 + NULL, // pfnFindClientInPVS()
1.65 + NULL, // pfnEntitiesInPVS()
1.66 +
1.67 + NULL, // pfnMakeVectors()
1.68 + NULL, // pfnAngleVectors()
1.69 +
1.70 + NULL, // pfnCreateEntity()
1.71 + NULL, // pfnRemoveEntity()
1.72 + NULL, // pfnCreateNamedEntity()
1.73 +
1.74 + NULL, // pfnMakeStatic()
1.75 + NULL, // pfnEntIsOnFloor()
1.76 + NULL, // pfnDropToFloor()
1.77 +
1.78 + NULL, // pfnWalkMove()
1.79 + NULL, // pfnSetOrigin()
1.80 +
1.81 + NULL, // pfnEmitSound()
1.82 + NULL, // pfnEmitAmbientSound()
1.83 +
1.84 + NULL, // pfnTraceLine()
1.85 + NULL, // pfnTraceToss()
1.86 + NULL, // pfnTraceMonsterHull()
1.87 + NULL, // pfnTraceHull()
1.88 + NULL, // pfnTraceModel()
1.89 + NULL, // pfnTraceTexture()
1.90 + NULL, // pfnTraceSphere()
1.91 + NULL, // pfnGetAimVector()
1.92 +
1.93 + NULL, // pfnServerCommand()
1.94 + NULL, // pfnServerExecute()
1.95 + NULL, // pfnClientCommand()
1.96 +
1.97 + NULL, // pfnParticleEffect()
1.98 + NULL, // pfnLightStyle()
1.99 + NULL, // pfnDecalIndex()
1.100 + NULL, // pfnPointContents()
1.101 +
1.102 + NULL, // pfnMessageBegin()
1.103 + NULL, // pfnMessageEnd()
1.104 +
1.105 + NULL, // pfnWriteByte()
1.106 + NULL, // pfnWriteChar()
1.107 + NULL, // pfnWriteShort()
1.108 + NULL, // pfnWriteLong()
1.109 + NULL, // pfnWriteAngle()
1.110 + NULL, // pfnWriteCoord()
1.111 + NULL, // pfnWriteString()
1.112 + NULL, // pfnWriteEntity()
1.113 +
1.114 + NULL, // pfnCVarRegister()
1.115 + NULL, // pfnCVarGetFloat()
1.116 + NULL, // pfnCVarGetString()
1.117 + NULL, // pfnCVarSetFloat()
1.118 + NULL, // pfnCVarSetString()
1.119 +
1.120 + NULL, // pfnAlertMessage()
1.121 + NULL, // pfnEngineFprintf()
1.122 +
1.123 + NULL, // pfnPvAllocEntPrivateData()
1.124 + NULL, // pfnPvEntPrivateData()
1.125 + NULL, // pfnFreeEntPrivateData()
1.126 +
1.127 + NULL, // pfnSzFromIndex()
1.128 + NULL, // pfnAllocString()
1.129 +
1.130 + NULL, // pfnGetVarsOfEnt()
1.131 + NULL, // pfnPEntityOfEntOffset()
1.132 + NULL, // pfnEntOffsetOfPEntity()
1.133 + NULL, // pfnIndexOfEdict()
1.134 + NULL, // pfnPEntityOfEntIndex()
1.135 + NULL, // pfnFindEntityByVars()
1.136 + NULL, // pfnGetModelPtr()
1.137 +
1.138 + NULL, // pfnRegUserMsg()
1.139 +
1.140 + NULL, // pfnAnimationAutomove()
1.141 + NULL, // pfnGetBonePosition()
1.142 +
1.143 + NULL, // pfnFunctionFromName()
1.144 + NULL, // pfnNameForFunction()
1.145 +
1.146 + NULL, // pfnClientPrintf()
1.147 + NULL, // pfnServerPrint()
1.148 +
1.149 + NULL, // pfnCmd_Args()
1.150 + NULL, // pfnCmd_Argv()
1.151 + NULL, // pfnCmd_Argc()
1.152 +
1.153 + NULL, // pfnGetAttachment()
1.154 +
1.155 + NULL, // pfnCRC32_Init()
1.156 + NULL, // pfnCRC32_ProcessBuffer()
1.157 + NULL, // pfnCRC32_ProcessByte()
1.158 + NULL, // pfnCRC32_Final()
1.159 +
1.160 + NULL, // pfnRandomLong()
1.161 + NULL, // pfnRandomFloat()
1.162 +
1.163 + NULL, // pfnSetView()
1.164 + NULL, // pfnTime()
1.165 + NULL, // pfnCrosshairAngle()
1.166 +
1.167 + NULL, // pfnLoadFileForMe()
1.168 + NULL, // pfnFreeFile()
1.169 +
1.170 + NULL, // pfnEndSection()
1.171 + NULL, // pfnCompareFileTime()
1.172 + NULL, // pfnGetGameDir()
1.173 + NULL, // pfnCvar_RegisterVariable()
1.174 + NULL, // pfnFadeClientVolume()
1.175 + NULL, // pfnSetClientMaxspeed()
1.176 + NULL, // pfnCreateFakeClient()
1.177 + NULL, // pfnRunPlayerMove()
1.178 + NULL, // pfnNumberOfEntities()
1.179 +
1.180 + NULL, // pfnGetInfoKeyBuffer()
1.181 + NULL, // pfnInfoKeyValue()
1.182 + NULL, // pfnSetKeyValue()
1.183 + NULL, // pfnSetClientKeyValue()
1.184 +
1.185 + NULL, // pfnIsMapValid()
1.186 + NULL, // pfnStaticDecal()
1.187 + NULL, // pfnPrecacheGeneric()
1.188 + NULL, // pfnGetPlayerUserId()
1.189 + NULL, // pfnBuildSoundMsg()
1.190 + NULL, // pfnIsDedicatedServer()
1.191 + NULL, // pfnCVarGetPointer()
1.192 + NULL, // pfnGetPlayerWONId()
1.193 +
1.194 + NULL, // pfnInfo_RemoveKey()
1.195 + NULL, // pfnGetPhysicsKeyValue()
1.196 + NULL, // pfnSetPhysicsKeyValue()
1.197 + NULL, // pfnGetPhysicsInfoString()
1.198 + NULL, // pfnPrecacheEvent()
1.199 + NULL, // pfnPlaybackEvent()
1.200 +
1.201 + NULL, // pfnSetFatPVS()
1.202 + NULL, // pfnSetFatPAS()
1.203 +
1.204 + NULL, // pfnCheckVisibility()
1.205 +
1.206 + NULL, // pfnDeltaSetField()
1.207 + NULL, // pfnDeltaUnsetField()
1.208 + NULL, // pfnDeltaAddEncoder()
1.209 + NULL, // pfnGetCurrentPlayer()
1.210 + NULL, // pfnCanSkipPlayer()
1.211 + NULL, // pfnDeltaFindField()
1.212 + NULL, // pfnDeltaSetFieldByIndex()
1.213 + NULL, // pfnDeltaUnsetFieldByIndex()
1.214 +
1.215 + NULL, // pfnSetGroupMask()
1.216 +
1.217 + NULL, // pfnCreateInstancedBaseline()
1.218 + NULL, // pfnCvar_DirectSet()
1.219 +
1.220 + NULL, // pfnForceUnmodified()
1.221 +
1.222 + NULL, // pfnGetPlayerStats()
1.223 +
1.224 + NULL, // pfnAddServerCommand()
1.225 +
1.226 + // Added in SDK 2.2:
1.227 + NULL, // pfnVoice_GetClientListening()
1.228 + NULL, // pfnVoice_SetClientListening()
1.229 +
1.230 + // Added for HL 1109 (no SDK update):
1.231 + NULL, // pfnGetPlayerAuthId()
1.232 +
1.233 + // Added 2003/11/10 (no SDK update):
1.234 + NULL, // pfnSequenceGet()
1.235 + NULL, // pfnSequencePickSentence()
1.236 + NULL, // pfnGetFileSize()
1.237 + NULL, // pfnGetApproxWavePlayLen()
1.238 + NULL, // pfnIsCareerMatch()
1.239 + NULL, // pfnGetLocalizedStringLength()
1.240 + NULL, // pfnRegisterTutorMessageShown()
1.241 + NULL, // pfnGetTimesTutorMessageShown()
1.242 + NULL, // pfnProcessTutorMessageDecayBuffer()
1.243 + NULL, // pfnConstructTutorMessageDecayBuffer()
1.244 + NULL, // pfnResetTutorMessageDecayData()
1.245 +};
1.246 +
1.247 +C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine,
1.248 + int *interfaceVersion)
1.249 +{
1.250 + if(!pengfuncsFromEngine) {
1.251 + UTIL_LogPrintf("GetEngineFunctions called with null pengfuncsFromEngine");
1.252 + return(FALSE);
1.253 + }
1.254 + else if(*interfaceVersion != ENGINE_INTERFACE_VERSION) {
1.255 + UTIL_LogPrintf("GetEngineFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
1.256 + // Tell metamod what version we had, so it can figure out who is out of date.
1.257 + *interfaceVersion = ENGINE_INTERFACE_VERSION;
1.258 + return(FALSE);
1.259 + }
1.260 + memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
1.261 + return(TRUE);
1.262 +}