Alibek Omarov 2 months ago
parent
commit
78181ba33d
63 changed files with 207 additions and 119 deletions
  1. +0
    -3
      .gitmodules
  2. +1
    -1
      cl_dll/cdll_int.cpp
  3. +3
    -1
      cl_dll/death.cpp
  4. +1
    -1
      cl_dll/demo.cpp
  5. +2
    -1
      cl_dll/enginecallback.h
  6. +2
    -2
      cl_dll/health.cpp
  7. +5
    -1
      cl_dll/in_camera.cpp
  8. +1
    -1
      cl_dll/in_defs.h
  9. +1
    -1
      cl_dll/input.cpp
  10. +5
    -1
      cl_dll/inputw32.cpp
  11. +2
    -1
      cl_dll/menu.cpp
  12. +3
    -2
      cl_dll/render/gl_aurora.cpp
  13. +1
    -1
      cl_dll/render/gl_aurora.h
  14. +4
    -3
      cl_dll/render/gl_export.h
  15. +4
    -2
      cl_dll/render/gl_movie.cpp
  16. +2
    -1
      cl_dll/render/gl_rmain.cpp
  17. +6
    -3
      cl_dll/render/gl_rpart.cpp
  18. +4
    -2
      cl_dll/render/gl_shader.cpp
  19. +3
    -1
      cl_dll/render/gl_shadows.cpp
  20. +2
    -1
      cl_dll/render/gl_sprite.cpp
  21. +10
    -4
      cl_dll/render/gl_studio_draw.cpp
  22. +2
    -1
      cl_dll/render/gl_studio_init.cpp
  23. +1
    -1
      cl_dll/render/gl_studiodecal.h
  24. +2
    -1
      cl_dll/render/gl_world_new.cpp
  25. +27
    -4
      cl_dll/render/vertex_fmt.h
  26. +1
    -1
      cl_dll/vgui_SpectatorPanel.cpp
  27. +1
    -1
      cl_dll/vgui_paranoiatext.cpp
  28. +2
    -2
      cl_dll/vgui_pickup.h
  29. +4
    -3
      cl_dll/vgui_subtitles.cpp
  30. +1
    -0
      cl_dll/wscript
  31. +4
    -0
      common/port.h
  32. +1
    -7
      dlls/cbase.h
  33. +3
    -3
      dlls/extdll.h
  34. +1
    -1
      dlls/util.h
  35. +12
    -1
      engine/cdll_int.h
  36. +1
    -1
      engine/eiface.h
  37. +1
    -1
      game_shared/bitvec.h
  38. +4
    -2
      game_shared/bone_setup.cpp
  39. +3
    -3
      game_shared/common.cpp
  40. +6
    -3
      game_shared/material.cpp
  41. +3
    -1
      game_shared/mathlib.cpp
  42. +1
    -0
      game_shared/mathlib.h
  43. +2
    -2
      game_shared/matrix.h
  44. +6
    -4
      game_shared/stringlib.cpp
  45. +2
    -2
      game_shared/utlarray.h
  46. +2
    -2
      game_shared/utlmemory.h
  47. +10
    -5
      game_shared/vector.h
  48. +1
    -1
      game_shared/vgui_grid.h
  49. +2
    -2
      game_shared/vgui_helpers.h
  50. +2
    -2
      game_shared/vgui_listbox.h
  51. +2
    -2
      game_shared/vgui_loadtga.cpp
  52. +1
    -1
      game_shared/vgui_loadtga.h
  53. +2
    -2
      game_shared/vgui_scrollbar2.cpp
  54. +1
    -1
      game_shared/vgui_slider2.cpp
  55. +3
    -3
      game_shared/virtualfs.h
  56. +5
    -3
      game_shared/voice_status.cpp
  57. +6
    -6
      game_shared/voice_vgui_tweakdlg.cpp
  58. +9
    -7
      pm_shared/meshdesc.cpp
  59. +1
    -1
      pm_shared/pm_math.cpp.unused
  60. +1
    -2
      pm_shared/trace.cpp
  61. BIN
     
  62. BIN
     
  63. +6
    -0
      wscript

+ 0
- 3
.gitmodules View File

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

+ 1
- 1
cl_dll/cdll_int.cpp 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"


+ 3
- 1
cl_dll/death.cpp 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;


+ 1
- 1
cl_dll/demo.cpp 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;


+ 2
- 1
cl_dll/enginecallback.h 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)


+ 2
- 2
cl_dll/health.cpp 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])
{


+ 5
- 1
cl_dll/in_camera.cpp 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

+ 1
- 1
cl_dll/in_defs.h 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 );


+ 1
- 1
cl_dll/input.cpp View File

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




+ 5
- 1
cl_dll/inputw32.cpp 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

+ 2
- 1
cl_dll/menu.cpp 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++;


+ 3
- 2
cl_dll/render/gl_aurora.cpp 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];



+ 1
- 1
cl_dll/render/gl_aurora.h 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 );


+ 4
- 3
cl_dll/render/gl_export.h 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 );


+ 4
- 2
cl_dll/render/gl_movie.cpp 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 )
{


+ 2
- 1
cl_dll/render/gl_rmain.cpp 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';



+ 6
- 3
cl_dll/render/gl_rpart.cpp 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 );


+ 4
- 2
cl_dll/render/gl_shader.cpp 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;



+ 3
- 1
cl_dll/render/gl_shadows.cpp 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];



+ 2
- 1
cl_dll/render/gl_sprite.cpp 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;


+ 10
- 4
cl_dll/render/gl_studio_draw.cpp 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];



+ 2
- 1
cl_dll/render/gl_studio_init.cpp 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;


+ 1
- 1
cl_dll/render/gl_studiodecal.h 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,


+ 2
- 1
cl_dll/render/gl_world_new.cpp 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;


+ 27
- 4
cl_dll/render/vertex_fmt.h 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

+ 1
- 1
cl_dll/vgui_SpectatorPanel.cpp 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



+ 1
- 1
cl_dll/vgui_paranoiatext.cpp 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"


+ 2
- 2
cl_dll/vgui_pickup.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


+ 4
- 3
cl_dll/vgui_subtitles.cpp 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)


+ 1
- 0
cl_dll/wscript View File

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


+ 4
- 0
common/port.h 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

+ 1
- 7
dlls/cbase.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 );


+ 3
- 3
dlls/extdll.h 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



+ 1
- 1
dlls/util.h 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);


+ 12
- 1
engine/cdll_int.h 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



+ 1
- 1
engine/eiface.h 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


+ 1
- 1
game_shared/bitvec.h View File

@@ -13,7 +13,7 @@


#include <assert.h>
#include <string.h>

class CBitVecAccessor
{


+ 4
- 2
game_shared/bone_setup.cpp 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;


+ 3
- 3
game_shared/common.cpp 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>

/*
============


+ 6
- 3
game_shared/material.cpp 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 )
{


+ 3
- 1
game_shared/mathlib.cpp 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;


+ 1
- 0
game_shared/mathlib.h 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)


+ 2
- 2
game_shared/matrix.h 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


+ 6
- 4
game_shared/stringlib.cpp 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

//============


+ 2
- 2
game_shared/utlarray.h 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


+ 2
- 2
game_shared/utlmemory.h 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.


+ 10
- 5
game_shared/vector.h 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; }


+ 1
- 1
game_shared/vgui_grid.h View File

@@ -12,7 +12,7 @@
#endif


#include "vgui_panel.h"
#include "VGUI_Panel.h"


namespace vgui


+ 2
- 2
game_shared/vgui_helpers.h 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;}


+ 2
- 2
game_shared/vgui_listbox.h 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


+ 2
- 2
game_shared/vgui_loadtga.cpp 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"


// ---------------------------------------------------------------------- //


+ 1
- 1
game_shared/vgui_loadtga.h View File

@@ -12,7 +12,7 @@
#endif


#include "vgui_bitmaptga.h"
#include "VGUI_BitmapTGA.h"


vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename);


+ 2
- 2
game_shared/vgui_scrollbar2.cpp 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>


+ 1
- 1
game_shared/vgui_slider2.cpp View File

@@ -5,7 +5,7 @@
// $NoKeywords: $
//=============================================================================

#include "VGUI_Slider2.h"
#include "vgui_slider2.h"

#include<VGUI_InputSignal.h>
#include<VGUI_App.h>


+ 3
- 3
game_shared/virtualfs.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;


+ 5
- 3
game_shared/voice_status.cpp 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);
}



+ 6
- 6
game_shared/voice_vgui_tweakdlg.cpp 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"



+ 9
- 7
pm_shared/meshdesc.cpp 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;


pm_shared/pm_math.cpp → pm_shared/pm_math.cpp.unused 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])

+ 1
- 2
pm_shared/trace.cpp 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"


BIN
View File


BIN
View File


+ 6
- 0
wscript 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 = [


Loading…
Cancel
Save