First working compilation.

This commit is contained in:
Julian
2020-02-25 21:46:51 -03:00
parent 6cdc2ea18c
commit f2d8d91baf
88 changed files with 1959 additions and 13767 deletions

View File

@@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@@ -15,6 +15,8 @@
#ifndef EIFACE_H
#define EIFACE_H
#include "archtypes.h" // DAL
#ifdef HLDEMO_BUILD
#define INTERFACE_VERSION 001
#else // !HLDEMO_BUILD, i.e., regular version of HL
@@ -24,6 +26,7 @@
#include <stdio.h>
#include "custom.h"
#include "cvardef.h"
#include "Sequence.h"
//
// Defines entity interface between engine and DLLs.
// This header file included by engine files and DLL files.
@@ -60,9 +63,10 @@ typedef enum
// For integrity checking of content on clients
typedef enum
{
force_exactfile, // File on client must exactly match server's file
force_model_samebounds, // For model files only, the geometry must fit in the same bbox
force_model_specifybounds, // For model files only, the geometry must fit in the specified bbox
force_exactfile, // File on client must exactly match server's file
force_model_samebounds, // For model files only, the geometry must fit in the same bbox
force_model_specifybounds, // For model files only, the geometry must fit in the specified bbox
force_model_specifybounds_if_avail, // For Steam model files only, the geometry must fit in the specified bbox (if the file is available)
} FORCE_TYPE;
// Returned by TraceLine
@@ -96,6 +100,7 @@ typedef struct
#include "../common/crc.h"
// Engine hands this to DLLs for functionality callbacks
typedef struct enginefuncs_s
{
@@ -161,8 +166,13 @@ typedef struct enginefuncs_s
void (*pfnCVarSetFloat) (const char *szVarName, float flValue);
void (*pfnCVarSetString) (const char *szVarName, const char *szValue);
void (*pfnAlertMessage) (ALERT_TYPE atype, char *szFmt, ...);
#ifdef HLSDK_3_2_OLD_EIFACE
void (*pfnEngineFprintf) (FILE *pfile, char *szFmt, ...);
void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, long cb);
#else
void (*pfnEngineFprintf) (void *pfile, char *szFmt, ...);
void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, int32 cb);
#endif
void* (*pfnPvEntPrivateData) (edict_t *pEdict);
void (*pfnFreeEntPrivateData) (edict_t *pEdict);
const char* (*pfnSzFromIndex) (int iString);
@@ -177,8 +187,13 @@ typedef struct enginefuncs_s
int (*pfnRegUserMsg) (const char *pszName, int iSize);
void (*pfnAnimationAutomove) (const edict_t* pEdict, float flTime);
void (*pfnGetBonePosition) (const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
#ifdef HLSDK_3_2_OLD_EIFACE
unsigned long (*pfnFunctionFromName) ( const char *pName );
const char *(*pfnNameForFunction) ( unsigned long function );
#else
uint32 (*pfnFunctionFromName) ( const char *pName );
const char *(*pfnNameForFunction) ( uint32 function );
#endif
void (*pfnClientPrintf) ( edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg ); // JOHN: engine callbacks so game DLL can print messages to individual clients
void (*pfnServerPrint) ( const char *szMsg );
const char *(*pfnCmd_Args) ( void ); // these 3 added
@@ -189,7 +204,11 @@ typedef struct enginefuncs_s
void (*pfnCRC32_ProcessBuffer) (CRC32_t *pulCRC, void *p, int len);
void (*pfnCRC32_ProcessByte) (CRC32_t *pulCRC, unsigned char ch);
CRC32_t (*pfnCRC32_Final) (CRC32_t pulCRC);
#ifdef HLSDK_3_2_OLD_EIFACE
long (*pfnRandomLong) (long lLow, long lHigh);
#else
int32 (*pfnRandomLong) (int32 lLow, int32 lHigh);
#endif
float (*pfnRandomFloat) (float flLow, float flHigh);
void (*pfnSetView) (const edict_t *pClient, const edict_t *pViewent );
float (*pfnTime) ( void );
@@ -259,9 +278,49 @@ typedef struct enginefuncs_s
qboolean (*pfnVoice_GetClientListening)(int iReceiver, int iSender);
qboolean (*pfnVoice_SetClientListening)(int iReceiver, int iSender, qboolean bListen);
const char *(*pfnGetPlayerAuthId) ( edict_t *e );
const char *(*pfnGetPlayerAuthId) ( edict_t *e );
// PSV: Added for CZ training map
// const char *(*pfnKeyNameForBinding) ( const char* pBinding );
sequenceEntry_s* (*pfnSequenceGet) ( const char* fileName, const char* entryName );
sentenceEntry_s* (*pfnSequencePickSentence) ( const char* groupName, int pickMethod, int *picked );
// LH: Give access to filesize via filesystem
int (*pfnGetFileSize) ( char *filename );
unsigned int (*pfnGetApproxWavePlayLen) (const char *filepath);
// MDC: Added for CZ career-mode
int (*pfnIsCareerMatch) ( void );
// BGC: return the number of characters of the localized string referenced by using "label"
int (*pfnGetLocalizedStringLength) (const char *label);
// BGC: added to facilitate persistent storage of tutor message decay values for
// different career game profiles. Also needs to persist regardless of mp.dll being
// destroyed and recreated.
void (*pfnRegisterTutorMessageShown) (int mid);
int (*pfnGetTimesTutorMessageShown) (int mid);
void (*pfnProcessTutorMessageDecayBuffer) (int *buffer, int bufferLength);
void (*pfnConstructTutorMessageDecayBuffer) (int *buffer, int bufferLength);
void (*pfnResetTutorMessageDecayData) ( void );
// Added 2005/08/11 (no SDK update):
void (*pfnQueryClientCvarValue) (const edict_t *player, const char *cvarName);
// Added 2005/11/21 (no SDK update):
void (*pfnQueryClientCvarValue2) (const edict_t *player, const char *cvarName, int requestID);
// Added 2009/06/19 (no SDK update):
int (*pfnEngCheckParm) (const char *pchCmdLineToken, char **pchNextVal);
#ifdef __METAMOD_BUILD__
//extra (future updates)
void * extra_functions[16];
#endif /*__METAMOD_BUILD__*/
} enginefuncs_t;
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 138
// Passed to pfnKeyValue
@@ -270,7 +329,11 @@ typedef struct KeyValueData_s
char *szClassName; // in: entity classname
char *szKeyName; // in: name of key
char *szValue; // in: value of key
#ifdef HLSDK_3_2_OLD_EIFACE
long fHandled; // out: DLL sets to true if key-value pair was understood
#else
int32 fHandled; // out: DLL sets to true if key-value pair was understood
#endif
} KeyValueData;
@@ -357,9 +420,11 @@ typedef enum _fieldtypes
FIELD_TYPECOUNT, // MUST BE LAST
} FIELDTYPE;
#ifndef linux
#ifndef offsetof
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif
#endif
#define _FIELD(type,name,fieldtype,count,flags) { fieldtype, #name, offsetof(type, name), count, flags }
#define DEFINE_FIELD(type,name,fieldtype) _FIELD(type, name, fieldtype, 1, 0)
@@ -380,7 +445,16 @@ typedef struct
short flags;
} TYPEDESCRIPTION;
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
// Fixed MSVC compiling, by Nikolay "The Storm" Baklicharov.
#if defined _MSC_VER && _MSC_VER >= 1400
#ifndef ARRAYSIZE
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
#endif
#else /* MSVC 8.0 */
#ifndef ARRAYSIZE
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
#endif
#endif
typedef struct
{
@@ -481,6 +555,14 @@ typedef struct
void (*pfnOnFreeEntPrivateData)(edict_t *pEnt);
void (*pfnGameShutdown)(void);
int (*pfnShouldCollide)( edict_t *pentTouched, edict_t *pentOther );
// Added 2005/08/11 (no SDK update):
void (*pfnCvarValue)( const edict_t *pEnt, const char *value );
// Added 2005/11/21 (no SDK update):
// value is "Bad CVAR request" on failure (i.e that user is not connected or the cvar does not exist).
// value is "Bad Player" if invalid player edict.
void (*pfnCvarValue2)( const edict_t *pEnt, int requestID, const char *cvarName, const char *value );
} NEW_DLL_FUNCTIONS;
typedef int (*NEW_DLL_FUNCTIONS_FN)( NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
@@ -490,4 +572,4 @@ extern NEW_DLL_FUNCTIONS gNewDLLFunctions;
typedef int (*APIFUNCTION)( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
typedef int (*APIFUNCTION2)( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
#endif EIFACE_H
#endif /* EIFACE_H */