This commit is contained in:
Alibek Omarov 2020-09-01 18:05:40 +03:00
commit 78181ba33d
63 changed files with 207 additions and 119 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "utils/vgui"]
path = utils/vgui
url = https://github.com/FWGS/vgui-dev

View File

@ -21,7 +21,7 @@
#include "hud.h"
#include "cl_util.h"
#include "netadr.h"
#include "vgui_schememanager.h"
#include "vgui_SchemeManager.h"
#include "pm_shared.h"
#include "pm_defs.h"

View File

@ -174,7 +174,9 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
gHUD.m_Spectator.DeathMessage(victim);
for ( int i = 0; i < MAX_DEATHNOTICES; i++ )
int i;
for ( i = 0; i < MAX_DEATHNOTICES; i++ )
{
if ( rgDeathNoticeList[i].iId == 0 )
break;

View File

@ -18,7 +18,7 @@
#include "demo_api.h"
#include <memory.h>
#define DLLEXPORT __declspec( dllexport )
//#define DLLEXPORT __declspec( dllexport )
int g_demosniper = 0;
int g_demosniperdamage = 0;

View File

@ -20,7 +20,8 @@ extern cl_enginefunc_t gEngfuncs;
extern render_api_t gRenderfuncs;
#define GET_CLIENT_TIME (*gEngfuncs.GetClientTime)
#define GET_CLIENT_OLDTIME (*gEngfuncs.GetClientOldTime)
//#define GET_CLIENT_OLDTIME (*gEngfuncs.GetClientOldTime)
#define GET_CLIENT_OLDTIME (*gEngfuncs.pfnGetClientOldTime)
#define CVAR_REGISTER (*gEngfuncs.pfnRegisterVariable)
#define CVAR_GET_FLOAT (*gEngfuncs.pfnGetCvarFloat)
#define CVAR_GET_STRING (*gEngfuncs.pfnGetCvarString)

View File

@ -400,7 +400,7 @@ int CHudHealth::DrawPain(float flTime)
int CHudHealth::DrawDamage(float flTime)
{
int r, g, b, a;
int r, g, b, a, i;
DAMAGE_IMAGE *pdmg;
if (!m_bitsDamage)
@ -413,7 +413,7 @@ int CHudHealth::DrawDamage(float flTime)
ScaleColors(r, g, b, a);
// Draw all the items
for (int i = 0; i < NUM_DMG_TYPES; i++)
for (i = 0; i < NUM_DMG_TYPES; i++)
{
if (m_bitsDamage & giDmgFlags[i])
{

View File

@ -4,6 +4,8 @@
//
// $NoKeywords: $
//=============================================================================
#if 0
// TODO: import hlsdk-xash3d input
#include "hud.h"
#include "cl_util.h"
@ -618,4 +620,6 @@ int DLLEXPORT CL_IsThirdPerson( void )
void DLLEXPORT CL_CameraOffset( float *ofs )
{
VectorCopy( cam_ofs, ofs );
}
}
#endif

View File

@ -16,7 +16,7 @@
// fall over
#define ROLL 2
#define DLLEXPORT __declspec( dllexport )
#include <exportdef.h>
void V_StartPitchDrift( void );
void V_StopPitchDrift( void );

View File

@ -22,7 +22,7 @@
#include "in_defs.h"
#include <string.h>
#include <mathlib.h>
#include <ctype.h>
#include "vgui_TeamFortressViewport.h"

View File

@ -7,6 +7,8 @@
// in_win.c -- windows 95 mouse and joystick code
// 02/21/97 JCB Added extended DirectInput code to support external controllers.
/// TODO: import hlsdk-xash3d input interface
#if 0
#include "hud.h"
#include "cl_util.h"
@ -960,4 +962,6 @@ void IN_Init (void)
IN_StartupMouse ();
IN_StartupJoystick ();
}
}
#endif

View File

@ -84,7 +84,8 @@ int CHudMenu :: Draw( float flTime )
// count the number of newlines
int nlc = 0;
for ( int i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ )
int i;
for ( i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ )
{
if ( g_szMenuString[i] == '\n' )
nlc++;

View File

@ -1049,7 +1049,7 @@ bool CParticleSystem :: UpdateParticle( CParticle *part, float frametime )
return true;
}
void CParticleSystem :: DrawParticle( CParticle *part, vec3_t &right, vec3_t &up )
void CParticleSystem :: DrawParticle( CParticle *part, const vec3_t &right, const vec3_t &up )
{
float fSize = part->m_fSize;
@ -1083,10 +1083,11 @@ void CParticleSystem :: DrawParticle( CParticle *part, vec3_t &right, vec3_t &up
{
if( pDraw->pType->m_iDrawCond == CONTENTS_SPOTLIGHT )
{
int i;
if( !m_fHasProjectionLighting )
continue; // fast reject
for( int i = 0; i < MAX_DLIGHTS; i++ )
for( i = 0; i < MAX_DLIGHTS; i++ )
{
CDynLight *pl = &tr.dlights[i];

View File

@ -152,7 +152,7 @@ public:
// MUST CHECK WHETHER THIS RESULT IS NULL!
// returns false if the particle has died
bool UpdateParticle( CParticle *part, float frametime );
void DrawParticle( CParticle *part, Vector &right, Vector &up );
void DrawParticle( CParticle *part, const Vector &right, const Vector &up );
// Utility functions that have to be public
bool ParticleIsVisible( CParticle* part );

View File

@ -16,8 +16,9 @@ GNU General Public License for more details.
#ifndef GL_EXPORT_H
#define GL_EXPORT_H
#include <windows.h>
// not needed since we have GL_GetProcAddress in RenderAPI
//#include <windows.h>
#include <stdarg.h>
#ifndef APIENTRY
#define APIENTRY
#endif
@ -1350,7 +1351,7 @@ EXTERN void ( APIENTRY *pglGetFinalCombinerInputParameterfvNV )( GLenum, GLenum,
EXTERN void ( APIENTRY *pglGetFinalCombinerInputParameterivNV )( GLenum, GLenum, GLint * );
EXTERN void ( APIENTRY *pglGenerateMipmap )( GLenum target );
EXTERN void ( APIENTRY *pglDrawBuffersARB)( GLsizei n, const GLenum *bufs );
EXTERN PROC ( WINAPI *pwglGetProcAddress)( const char * );
//EXTERN PROC ( WINAPI *pwglGetProcAddress)( const char * );
EXTERN void ( APIENTRY *pglBindVertexArray )( GLuint array );
EXTERN void ( APIENTRY *pglDeleteVertexArrays )( GLsizei n, const GLuint *arrays );

View File

@ -39,8 +39,9 @@ int R_PrecacheCinematic( const char *cinname )
if( Q_stricmp( UTIL_FileExtension( cinname ), "avi" ))
return -1;
int i;
// first check for co-existing
for( int i = 0; i < MAX_MOVIES; i++ )
for( i = 0; i < MAX_MOVIES; i++ )
{
if( !Q_stricmp( tr.cinematics[i].name, cinname ))
{
@ -104,7 +105,8 @@ void R_InitCinematics( void )
void R_FreeCinematics( void )
{
for( int i = 0; i < MAX_MOVIES; i++ )
int i;
for( i = 0; i < MAX_MOVIES; i++ )
{
if( tr.cinematics[i].state )
{

View File

@ -87,7 +87,8 @@ void R_BuildViewPassHierarchy( void )
if( glState.stack_position > 0 )
num_faces = R_GetPrevInstance()->frame.num_subview_faces;
for( unsigned int i = 0; i < glState.stack_position; i++ )
unsigned int i;
for( i = 0; i < glState.stack_position; i++ )
empty[i] = ' ';
empty[i] = '\0';

View File

@ -509,7 +509,8 @@ bool CQuakePartSystem :: ParseRandomVector( char *&pfile, RandomRange out[3] )
{
char token[256];
for( int i = 0; i < 3 && pfile != NULL; i++ )
int i;
for( i = 0; i < 3 && pfile != NULL; i++ )
{
pfile = COM_ParseLine( pfile, token );
out[i] = RandomRange( token );
@ -904,7 +905,8 @@ void CQuakePartSystem :: ExplosionParticles( const Vector &pos )
flags = (FPART_STRETCH|FPART_BOUNCE|FPART_FRICTION);
for( int i = 0; i < 384; i++ )
int i;
for( i = 0; i < 384; i++ )
{
src.m_vecOrigin.x = pos.x + RANDOM_LONG( -16, 16 );
src.m_vecOrigin.y = pos.y + RANDOM_LONG( -16, 16 );
@ -1128,7 +1130,8 @@ void CQuakePartSystem :: BulletParticles( const Vector &org, const Vector &dir )
// sparks
int flags = (FPART_STRETCH|FPART_BOUNCE|FPART_FRICTION|FPART_ADDITIVE);
for( int i = 0; i < count; i++ )
int i;
for( i = 0; i < count; i++ )
{
src.m_vecOrigin.x = org[0] + dir[0] * 2 + RANDOM_FLOAT( -1, 1 );
src.m_vecOrigin.y = org[1] + dir[1] * 2 + RANDOM_FLOAT( -1, 1 );

View File

@ -1146,8 +1146,9 @@ word GL_FindUberShader( const char *glname, const char *options )
return (word)(prog - glsl_programs);
}
int i;
// find free spot
for( int i = 1; i < num_glsl_programs; i++ )
for( i = 1; i < num_glsl_programs; i++ )
if( !glsl_programs[i].name[0] )
break;
@ -1188,8 +1189,9 @@ word GL_FindShader( const char *glname, const char *vpname, const char *fpname,
return (word)(prog - glsl_programs);
}
int i;
// find free spot
for( int i = 1; i < num_glsl_programs; i++ )
for( i = 1; i < num_glsl_programs; i++ )
if( !glsl_programs[i].name[0] )
break;

View File

@ -144,7 +144,9 @@ static int R_ComputeCropBounds( const matrix4x4 &lightViewProjection, Vector bou
frustum.DisablePlane( FRUSTUM_NEAR );
frustum.DisablePlane( FRUSTUM_FAR );
for( int i = 0; i < prevRI->frame.solid_faces.Count(); i++ )
int i;
for( i = 0; i < prevRI->frame.solid_faces.Count(); i++ )
{
CSolidEntry *entry = &prevRI->frame.solid_faces[i];

View File

@ -95,7 +95,8 @@ mspriteframe_t *CSpriteModelRenderer :: GetSpriteFrame( int frame, float yaw )
// are positive, so we don't have to worry about division by zero
float targettime = m_clTime - ((int)( m_clTime / fullinterval )) * fullinterval;
for( int i = 0; i < (numframes - 1); i++ )
int i;
for( i = 0; i < (numframes - 1); i++ )
{
if( pintervals[i] > targettime )
break;

View File

@ -1363,7 +1363,9 @@ void CStudioModelRenderer :: StudioMergeBones( matrix3x4 &transform, matrix3x4 b
for( int i = 0; i < m_pStudioHeader->numbones; i++ )
{
for( int j = 0; j < m_pParentHeader->numbones; j++ )
int j;
for( j = 0; j < m_pParentHeader->numbones; j++ )
{
if( !Q_stricmp( pchildbones[i].name, pparentbones[j].name ))
{
@ -1697,7 +1699,7 @@ void CStudioModelRenderer :: StudioStaticLight( cl_entity_t *ent, mstudiolight_t
m_pModelInstance->light_update = false;
// init state if was not in frustum
if( abs( m_pModelInstance->cached_frame - tr.realframecount ) > 2 )
if( Q_abs( m_pModelInstance->cached_frame - tr.realframecount ) > 2 )
m_pModelInstance->oldlight = m_pModelInstance->newlight;
}
@ -2849,7 +2851,9 @@ void CStudioModelRenderer :: RenderDeferredStudioList( void )
RI->currentmodel = NULL;
m_pCurrentMaterial = NULL;
for( int i = 0; i < RI->frame.solid_meshes.Count(); i++ )
int i;
for( i = 0; i < RI->frame.solid_meshes.Count(); i++ )
{
CSolidEntry *entry = &RI->frame.solid_meshes[i];
@ -3731,7 +3735,9 @@ void CStudioModelRenderer :: RenderSolidStudioList( void )
RI->currentmodel = NULL;
m_pCurrentMaterial = NULL;
for( int i = 0; i < RI->frame.solid_meshes.Count(); i++ )
int i;
for( i = 0; i < RI->frame.solid_meshes.Count(); i++ )
{
CSolidEntry *entry = &RI->frame.solid_meshes[i];

View File

@ -1541,8 +1541,9 @@ void CStudioModelRenderer :: SetupSubmodelVerts( const mstudiomodel_t *pSubModel
// search for submodel offset
int offset = (byte *)pSubModel - (byte *)m_pStudioHeader;
int j;
for( int j = 0; j < MAXSTUDIOMODELS; j++ )
for( j = 0; j < MAXSTUDIOMODELS; j++ )
{
if( m_tbnverts->submodels[j].submodel_offset == offset )
break;

View File

@ -16,7 +16,7 @@ GNU General Public License for more details.
#ifndef GL_STUDIODECAL_H
#define GL_STUDIODECAL_H
typedef enum
enum
{
DECAL_CLIP_MINUSU = 0x1,
DECAL_CLIP_MINUSV = 0x2,

View File

@ -304,9 +304,10 @@ void GL_LoadAndRebuildCubemaps( int refParams )
// now all the cubemaps are recreated, so we can starts to upload them
if( world->loading_cubemaps )
{
int i;
Mod_LoadCubemap( &world->defaultCubemap );
for( int i = 0; i < world->num_cubemaps; i++ )
for( i = 0; i < world->num_cubemaps; i++ )
{
mcubemap_t *cm = &world->cubemaps[i];
Vector vecStart, vecEnd;

View File

@ -17,8 +17,11 @@ GNU General Public License for more details.
#ifndef VERTEX_FMT_H
#define VERTEX_FMT_H
#ifdef _MSC_VER
#define no_align __declspec(align(1))
#else
#define no_align
#endif
// name specific:
// fisrt letter is model type: B - BrushModel, G - Grass, D - Decal, S - StudioModel
// next four letters is always equal "vert" for more readability
@ -48,6 +51,7 @@ typedef struct
byte styles[MAXLIGHTMAPS]; // light styles
} bvert_v0_gl21_t;
#pragma pack(1)
// 84 bytes here
no_align typedef struct
{
@ -62,7 +66,7 @@ no_align typedef struct
byte lights0[4]; // packed light numbers
byte lights1[4]; // packed light numbers
} bvert_v0_gl30_t;
#pragma pack()
/*
=============================================================
@ -128,7 +132,7 @@ typedef struct
float normal[3]; // normal
float boneid; // control bones
} svert_v0_gl21_t;
#pragma pack(1)
// 24 bytes
no_align typedef struct
{
@ -137,7 +141,7 @@ no_align typedef struct
char normal[3]; // normal
char boneid; // control bones
} svert_v0_gl30_t;
#pragma pack()
// version 1. have bump, no boneweights, no vertexlight
// 68 bytes
typedef struct
@ -150,6 +154,7 @@ typedef struct
float boneid; // control bones
} svert_v1_gl21_t;
#pragma pack(1)
// 32 bytes
no_align typedef struct
{
@ -160,6 +165,7 @@ no_align typedef struct
char binormal[3]; // binormal
char boneid; // control bones
} svert_v1_gl30_t;
#pragma pack()
// version 2. no bump, single bone, has vertex lighting
// 56 bytes
@ -170,6 +176,7 @@ typedef struct
float normal[3]; // normal
float light[MAXLIGHTMAPS]; // packed color
} svert_v2_gl21_t;
#pragma pack(1)
// 40 bytes
no_align typedef struct
@ -179,6 +186,7 @@ no_align typedef struct
char normal[3]; // normal
float light[MAXLIGHTMAPS]; // packed color
} svert_v2_gl30_t;
#pragma pack()
// version 3. have bump, single bone, has vertex lighting
// 96 bytes
@ -192,6 +200,7 @@ typedef struct
float tangent[3]; // tangent
float binormal[3]; // binormal
} svert_v3_gl21_t;
#pragma pack(1)
// 64 bytes
no_align typedef struct
@ -204,6 +213,7 @@ no_align typedef struct
char tangent[3]; // tangent
char binormal[3]; // binormal
} svert_v3_gl30_t;
#pragma pack()
// version 4. no bump, have boneweights, no vertexlight
// 72 bytes
@ -216,6 +226,8 @@ typedef struct
float weight[4]; // boneweights
} svert_v4_gl21_t;
#pragma pack(1)
// 32 bytes
no_align typedef struct
{
@ -225,6 +237,7 @@ no_align typedef struct
char boneid[4]; // control bones
byte weight[4]; // boneweights
} svert_v4_gl30_t;
#pragma pack()
// version 5. have bump, have boneweights, no vertexlight
// 96 bytes
@ -239,6 +252,7 @@ typedef struct
float weight[4]; // boneweights
} svert_v5_gl21_t;
#pragma pack(1)
// 40 bytes
no_align typedef struct
{
@ -250,6 +264,7 @@ no_align typedef struct
char boneid[4]; // control bones
byte weight[4]; // boneweights
} svert_v5_gl30_t;
#pragma pack()
// version 6. no bump, single bone, has lightmaps
// 76 bytes
@ -263,6 +278,8 @@ typedef struct
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v6_gl21_t;
#pragma pack(1)
// 60 bytes
no_align typedef struct
{
@ -273,6 +290,7 @@ no_align typedef struct
char normal[3]; // normal
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v6_gl30_t;
#pragma pack()
// version 7. have bump, single bone, has lightmaps
// 100 bytes
@ -288,6 +306,7 @@ typedef struct
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v7_gl21_t;
#pragma pack(1)
// 68 bytes
no_align typedef struct
{
@ -300,6 +319,7 @@ no_align typedef struct
char binormal[3]; // binormal
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v7_gl30_t;
#pragma pack()
// version 8. includes all posible combination, slowest
// 164 bytes here
@ -319,6 +339,8 @@ typedef struct
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v8_gl21_t;
#pragma pack(1)
// 108 bytes here
no_align typedef struct
{
@ -335,5 +357,6 @@ no_align typedef struct
float deluxe[MAXLIGHTMAPS]; // packed lightdir
byte styles[MAXLIGHTMAPS]; // light styles
} svert_v8_gl30_t;
#pragma pack()
#endif//VERTEX_FMT_H

View File

@ -17,7 +17,7 @@
#include "pm_shared.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_SpectatorPanel.h"
#include "vgui_scorepanel.h"
#include "vgui_ScorePanel.h"
#define PANEL_HEIGHT 32

View File

@ -6,7 +6,7 @@
#include "VGUI_TextImage.h"
#include "../engine/keydefs.h"
#include "triangleapi.h"
#include "../game_shared/vgui_LoadTGA.h"
#include "../game_shared/vgui_loadtga.h"
#include "r_studioint.h"
#include "com_model.h"
#include "stringlib.h"

View File

@ -9,7 +9,7 @@ using namespace vgui;
#include "vgui_shadowtext.h"
#include "VGUI_TextImage.h"
Font* FontFromMessage(const char* &ptext);
Font* FontFromMessage(char* &ptext);
void CheckPanel();
@ -38,7 +38,7 @@ public:
void SetMessage( client_textmessage_t *msg )
{
setSize(ScreenWidth, 16);
const char *text = msg->pMessage;
char *text = (char*)msg->pMessage;
Font *pFont = FontFromMessage(text);
char buf[1024];
sprintf(buf, text, g_ammoAdded); // text message should contain %d substring

View File

@ -20,7 +20,7 @@ cvar_t *scroll_speed;
cvar_t *fade_speed;
Font* FontFromMessage(const char* &ptext)
Font* FontFromMessage(char* &ptext)
{
char fontname[64] = "Default Text";
if (ptext != NULL && ptext[0] != 0)
@ -154,7 +154,7 @@ void CSubtitle::AddMessage( client_textmessage_t *msg )
// SchemeHandle_t hTextScheme = pSchemes->getSchemeHandle( "Default Text" );
// Font *pFont = pSchemes->getFont( hTextScheme );
const char *pText = msg->pMessage;
char *pText = (char*)msg->pMessage;
client_textmessage_t *postMsg = NULL;
if (pText[0] == '$')
{
@ -244,7 +244,8 @@ void CSubtitle::paintBackground()
// find oldest child to start fading int
float mintime = 99999;
for (int i = 0; i < m_pLayer->getChildCount(); i++)
int i;
for (i = 0; i < m_pLayer->getChildCount(); i++)
{
CSubtitleTextPanel *chld = (CSubtitleTextPanel*)m_pLayer->getChild(i);
if (chld->isVisible() && chld->m_fBirthTime < mintime)

View File

@ -28,6 +28,7 @@ def build(bld):
includes = [
'.',
'hl/',
'render/',
'../dlls',
'../common',
'../engine',

View File

@ -156,4 +156,8 @@ GNU General Public License for more details.
#include <SDL.h>
#endif
#ifndef MAX_PATH
#define MAX_PATH PATH_MAX
#endif
#endif // PORT_H

View File

@ -66,13 +66,7 @@ CBaseEntity
#include "meshdesc.h"
// C functions for external declarations that call the appropriate C++ methods
#ifdef _WIN32
#define EXPORT _declspec( dllexport )
#else
#define EXPORT /* */
#endif
#include "exportdef.h"
extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
extern "C" EXPORT int GetNewDLLFunctions( NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );

View File

@ -14,7 +14,7 @@
****/
#ifndef EXTDLL_H
#define EXTDLL_H
#include "port.h"
//
// Global header file for extension DLLs
@ -42,7 +42,7 @@
#else // _WIN32
#define FALSE 0
#define TRUE (!FALSE)
typedef unsigned long ULONG;
//typedef unsigned long ULONG;
typedef unsigned char BYTE;
typedef int BOOL;
#define MAX_PATH PATH_MAX
@ -53,7 +53,7 @@ typedef int BOOL;
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
//#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
#endif
#endif //_WIN32

View File

@ -270,7 +270,7 @@ typedef enum { ignore_monsters=1, dont_ignore_monsters=0, missile=2 } IGNORE_MON
typedef enum { ignore_glass=1, dont_ignore_glass=0 } IGNORE_GLASS;
extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr);
extern void UTIL_TraceLine (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, IGNORE_GLASS ignoreGlass, edict_t *pentIgnore, TraceResult *ptr);
typedef enum { point_hull=0, human_hull=1, large_hull=2, head_hull=3 };
enum { point_hull=0, human_hull=1, large_hull=2, head_hull=3 };
extern void UTIL_TraceHull (const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, int hullNumber, edict_t *pentIgnore, TraceResult *ptr);
extern TraceResult UTIL_GetGlobalTrace (void);
extern void UTIL_TraceModel (const Vector &vecStart, const Vector &vecEnd, int hullNumber, edict_t *pentModel, TraceResult *ptr);

View File

@ -27,12 +27,23 @@ extern "C" {
#endif
#include "const.h"
#define MAX_ALIAS_NAME 32
typedef struct cmdalias_s
{
struct cmdalias_s *next;
char name[MAX_ALIAS_NAME];
char *value;
} cmdalias_t;
#include <alert.h>
#ifndef offsetof
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif
// this file is included by both the engine and the client-dll,
// so make sure engine declarations aren't done twice

View File

@ -88,7 +88,7 @@ typedef struct
int fPlayTrack;
} CDStatus;
typedef unsigned int CRC32_t;
//typedef unsigned int CRC32_t;
// Engine hands this to DLLs for functionality callbacks
typedef struct enginefuncs_s

View File

@ -13,7 +13,7 @@
#include <assert.h>
#include <string.h>
class CBitVecAccessor
{

View File

@ -1108,8 +1108,9 @@ float CStudioBoneSetup :: SetController( int iController, float flValue, float &
mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)m_pStudioHeader + m_pStudioHeader->bonecontrollerindex);
int i;
// find first controller that matches the index
for( int i = 0; i < m_pStudioHeader->numbonecontrollers; i++, pbonecontroller++ )
for( i = 0; i < m_pStudioHeader->numbonecontrollers; i++, pbonecontroller++ )
{
if( pbonecontroller->index == iController )
break;
@ -1170,8 +1171,9 @@ float CStudioBoneSetup :: GetController( int iController, float ctlValue )
mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)m_pStudioHeader + m_pStudioHeader->bonecontrollerindex);
int i;
// find first controller that matches the index
for( int i = 0; i < m_pStudioHeader->numbonecontrollers; i++, pbonecontroller++ )
for( i = 0; i < m_pStudioHeader->numbonecontrollers; i++, pbonecontroller++ )
{
if( pbonecontroller->index == iController )
break;

View File

@ -13,8 +13,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#define NOMINMAX
#include <windows.h>
//#define NOMINMAX
//#include <windows.h>
#include <stdio.h>
#include <vector.h>
#include <matrix.h>
@ -23,7 +23,7 @@ GNU General Public License for more details.
#include <const.h>
#include <com_model.h>
#include <fcntl.h>
#include <io.h>
//#include <io.h>
/*
============

View File

@ -250,8 +250,9 @@ void COM_InitMatdef( void )
{
if( !Q_strlen( token )) break; // end of line
int i;
// find the free sound slot
for( int i = 0; mat->impact_parts[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
for( i = 0; mat->impact_parts[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
if( i < MAX_MAT_SOUNDS )
{
@ -265,8 +266,9 @@ void COM_InitMatdef( void )
{
if( !Q_strlen( token )) break; // end of line
int i;
// find the free sound slot
for( int i = 0; mat->impact_sounds[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
for( i = 0; mat->impact_sounds[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
if( i < MAX_MAT_SOUNDS )
{
@ -280,8 +282,9 @@ void COM_InitMatdef( void )
{
if( !Q_strlen( token )) break; // end of line
int i;
// find the free sound slot
for( int i = 0; mat->step_sounds[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
for( i = 0; mat->step_sounds[i] != NULL && i < MAX_MAT_SOUNDS; i++ );
if( i < MAX_MAT_SOUNDS )
{

View File

@ -42,7 +42,9 @@ fast box on planeside test
*/
int SignbitsForPlane( const Vector &normal )
{
for( int bits = 0, i = 0; i < 3; i++ )
int bits, i;
for( bits = 0, i = 0; i < 3; i++ )
if( normal[i] < 0.0f )
bits |= 1<<i;
return bits;

View File

@ -34,6 +34,7 @@ typedef float vec_t;
#define Q_round( x, y ) (floor( x / y + 0.5 ) * y )
#define Q_square( a ) ((a) * (a))
#define Q_sign( x ) ( x >= 0 ? 1.0 : -1.0 )
#define Q_abs( x ) ((x)<0?-(x):x)
#define bound( min, num, max ) ((num) >= (min) ? ((num) < (max) ? (num) : (max)) : (min))
#define saturate( val ) ((val) >= 0 ? ((val) < 1 ? (val) : 1) : 0)

View File

@ -206,8 +206,8 @@ public:
mat[0][2], mat[1][2], mat[2][2] );
}
Vector matrix3x3::VectorRotate( const Vector &v ) const;
Vector matrix3x3::VectorIRotate( const Vector &v ) const;
Vector VectorRotate( const Vector &v ) const;
Vector VectorIRotate( const Vector &v ) const;
// copy as OpenGl matrix
inline void CopyToArray( float *rgfl ) const

View File

@ -3,12 +3,14 @@
// stringlib.cpp - safety string routines
//=======================================================================
#define NOMINMAX
#include <windows.h>
//#define NOMINMAX
//#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <mathlib.h>
#include <stringlib.h>
#include "stringlib.h"
#include <ctype.h>
#pragma warning(disable : 4244) // MIPS
//============

View File

@ -171,7 +171,7 @@ public:
CUtlBlockVector( int growSize = 0, int initSize = 0 )
: CUtlArray< T, CUtlBlockMemory< T, int > >( growSize, initSize ) {}
};
#if 0
//-----------------------------------------------------------------------------
// The CUtlArrayFixed class:
// A array class with a fixed allocation scheme
@ -189,7 +189,7 @@ public:
CUtlArrayMT( typename BaseClass::ElemType_t* pMemory, int numElements ) : BaseClass( pMemory, numElements ) {}
};
#endif
//-----------------------------------------------------------------------------
// The CUtlArrayFixed class:
// A array class with a fixed allocation scheme

View File

@ -16,10 +16,10 @@
#include <string.h>
#include <malloc.h>
#include <new.h>
#include <new>
#define ALIGN_VALUE( val, alignment ) (( val + alignment - 1 ) & ~( alignment - 1 ))
#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) )
#define stackalloc( _size ) alloca( ALIGN_VALUE( _size, 16 ) )
#define stackfree( _p ) 0
// Swap two of anything.

View File

@ -4,7 +4,7 @@
//=======================================================================
#ifndef VECTOR_H
#define VECTOR_H
#include <port.h>
#include <math.h>
#include <float.h>
#include <stdlib.h>
@ -31,15 +31,16 @@
#define vec2_t Vector2D
#define vec3_t Vector
#define vec4_t Vector4D
#ifdef _MSC_VER
#pragma warning( disable : 4244 ) // disable 'possible loss of data converting float to int' warning message
#pragma warning( disable : 4305 ) // disable 'truncation from 'const double' to 'float' warning message
#endif
class NxVec3;
class Radian;
inline void SinCos( float angle, float *sine, float *cosine )
{
#if defined _MSC_VER && defined _M_I386
__asm
{
push ecx
@ -51,6 +52,10 @@ inline void SinCos( float angle, float *sine, float *cosine )
fstp dword ptr [ecx]
pop ecx
}
#else
*sine = sin(angle);
*cosine = cos(angle);
#endif
}
inline float Q_rsqrt( float number )
@ -151,9 +156,9 @@ class NxVec3;
//=========================================================
// 3D Vector
//=========================================================
class Vector // same data-layout as engine's vec3_t,
struct Vector // same data-layout as engine's vec3_t,
{ // which is a float[3]
public:
//public:
// Construction/destruction
inline Vector(void) { }
inline Vector(float X, float Y, float Z) { x = X; y = Y; z = Z; }

View File

@ -12,7 +12,7 @@
#endif
#include "vgui_panel.h"
#include "VGUI_Panel.h"
namespace vgui

View File

@ -12,8 +12,8 @@
#endif
#include "vgui_panel.h"
#include "vgui_label.h"
#include "VGUI_Panel.h"
#include "VGUI_Label.h"
inline int PanelTop(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return y;}

View File

@ -15,8 +15,8 @@
#include "VGUI_Panel.h"
#include "VGUI_IntChangeSignal.h"
#include "VGUI_Slider2.h"
#include "VGUI_ScrollBar2.h"
#include "vgui_slider2.h"
#include "vgui_scrollbar2.h"
namespace vgui

View File

@ -7,9 +7,9 @@
#include "wrect.h"
#include "../cl_dll/cl_dll.h"
#include "vgui.h"
#include "VGUI.h"
#include "vgui_loadtga.h"
#include "vgui_inputstream.h"
#include "VGUI_InputStream.h"
// ---------------------------------------------------------------------- //

View File

@ -12,7 +12,7 @@
#endif
#include "vgui_bitmaptga.h"
#include "VGUI_BitmapTGA.h"
vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename);

View File

@ -6,8 +6,8 @@
//=============================================================================
#include "VGUI_ScrollBar2.h"
#include "VGUI_Slider2.h"
#include "vgui_scrollbar2.h"
#include "vgui_slider2.h"
#include "vgui_loadtga.h"
#include<VGUI_IntChangeSignal.h>

View File

@ -5,7 +5,7 @@
// $NoKeywords: $
//=============================================================================
#include "VGUI_Slider2.h"
#include "vgui_slider2.h"
#include<VGUI_InputSignal.h>
#include<VGUI_App.h>

View File

@ -6,7 +6,7 @@
#define VIRTUALFS_H
#include <stdio.h>
#include <stdarg.h>
#define FS_MEM_BLOCK 65535
#define FS_MSG_BLOCK 8192
@ -169,7 +169,7 @@ _forceinline size_t CVirtualFS :: IPrint( const char *message )
return Insert( message, Q_strlen( message ));
}
_forceinline size_t CVirtualFS :: Printf( const char *fmt, ... )
size_t CVirtualFS :: Printf( const char *fmt, ... )
{
size_t result;
va_list args;
@ -181,7 +181,7 @@ _forceinline size_t CVirtualFS :: Printf( const char *fmt, ... )
return result;
}
_forceinline size_t CVirtualFS :: IPrintf( const char *fmt, ... )
size_t CVirtualFS :: IPrintf( const char *fmt, ... )
{
size_t result;
va_list args;

View File

@ -44,7 +44,7 @@
#include "VGUI_TextImage.h"
#include "vgui_loadtga.h"
#include "vgui_helpers.h"
#include "vgui_mousecode.h"
#include "VGUI_MouseCode.h"
@ -97,7 +97,9 @@ int __MsgFunc_ReqState(const char *pszName, int iSize, void *pbuf)
return 1;
}
// Q_strupr
//#include "stringlib.h"
// TODO: fix stringlib in client
int g_BannedPlayerPrintCount;
void ForEachBannedPlayer(char id[16])
{
@ -109,7 +111,7 @@ void ForEachBannedPlayer(char id[16])
id[8], id[9], id[10], id[11],
id[12], id[13], id[14], id[15]
);
strupr(str);
// Q_strupr(str, str);
gEngfuncs.pfnConsolePrint(str);
}

View File

@ -7,17 +7,17 @@
#include "../cl_dll/hud.h"
#include "../cl_dll/cl_util.h"
#include "../cl_dll/vgui_teamfortressviewport.h"
#include "../cl_dll/vgui_TeamFortressViewport.h"
#include "vgui_actionsignal.h"
#include "VGUI_ActionSignal.h"
#include "voice_vgui_tweakdlg.h"
#include "voice_vgui_tweakdlg.h"
#include "vgui_panel.h"
#include "vgui_scrollbar.h"
#include "vgui_slider.h"
#include "VGUI_Panel.h"
#include "VGUI_ScrollBar.h"
#include "VGUI_Slider.h"
#include "ivoicetweak.h"
#include "vgui_button.h"
#include "VGUI_Button.h"
#include "vgui_checkbutton2.h"
#include "vgui_helpers.h"

View File

@ -13,8 +13,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
//#define WIN32_LEAN_AND_MEAN
//#include "windows.h"
#include <alert.h>
#include "vector.h"
#include "matrix.h"
@ -36,7 +36,7 @@ GNU General Public License for more details.
#endif
#include "enginecallback.h"
#include <new> // placement
CMeshDesc *UTIL_GetCollisionMesh( int modelindex )
{
model_t *mod = (model_t *)MODEL_HANDLE( modelindex );
@ -52,10 +52,10 @@ CMeshDesc *UTIL_GetCollisionMesh( int modelindex )
if( !mod->cache.data )
return NULL;
CMeshDesc *bodyMesh = (CMeshDesc *)Mem_Alloc( sizeof( CMeshDesc ));
CMeshDesc *bodyMesh = new (Mem_Alloc( sizeof( CMeshDesc )) ) CMeshDesc();
if( !bodyMesh ) return NULL;
bodyMesh->CMeshDesc::CMeshDesc();
// bodyMesh->CMeshDesc();
bodyMesh->SetDebugName( mod->name );
bodyMesh->SetModel( mod );
@ -932,7 +932,8 @@ bool CMeshDesc :: StudioConstructMesh( void )
static Vector4D q[MAXSTUDIOBONES];
int totalVertSize = 0;
for( int i = 0; i < phdr->numbones; i++, pbone++, panim++ )
int i;
for( i = 0; i < phdr->numbones; i++, pbone++, panim++ )
{
StudioCalcBoneTransform( 0, pbone, panim, pos[i], q[i] );
}
@ -1151,7 +1152,8 @@ bool CMeshDesc :: FinishMeshBuild( void )
return false;
}
for( int i = 0; i < 3; i++ )
int i;
for( i = 0; i < 3; i++ )
{
// spread the mins / maxs by a pixel
m_mesh.mins[i] -= 1.0f;

View File

@ -27,7 +27,7 @@
#pragma warning(disable : 4244)
vec3_t vec3_origin = {0,0,0};
vec3_t vec3_origin = Vector(0,0,0);
#ifndef VECTOR_H
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])

View File

@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
//#include "windows.h"
#include <alert.h>
#include "vector.h"
#include "matrix.h"

Binary file not shown.

Binary file not shown.

View File

@ -179,6 +179,12 @@ def configure(conf):
'-Werror=bool-compare',
'-Werror=bool-operation',
'-Wstrict-aliasing',
'-Wno-attributes',
'-Wno-missing-pragmas',
'-Wno-overloaded-virtual',
'-Wno-unknown-pragmas',
'-Wno-write-strings',
'-std=gnu++98'
]
c_compiler_optional_flags = [