Compare commits

...

19 Commits

Author SHA1 Message Date
Alibek Omarov a9d98679f3 dlls: fix build 2020-09-01 19:30:02 +03:00
Alibek Omarov e3cfefbd5c client: fix build after unsuccessful merge 2020-09-01 18:38:27 +03:00
Alibek Omarov 64c20a6276 vgui: include our vgui-dev repository 2020-09-01 18:09:03 +03:00
Alibek Omarov be9eb42899 gitignore: update 2020-09-01 18:07:47 +03:00
Alibek Omarov fbd76d6d68 client: fix build 2020-09-01 18:07:37 +03:00
Alibek Omarov 78181ba33d Merge branch 'master' of https://git.mentality.rip/FWGS/Paranoia2 2020-09-01 18:05:40 +03:00
mittorn 75c16f9550 client: fix some common issues, shut up warnings, disable input code, update vgui headers 2020-09-01 15:57:29 +03:00
Alibek Omarov 72c667be79 vgui: add our vgui-dev repository as submodule 2020-09-01 14:15:40 +03:00
Alibek Omarov a3150e6d61 vgui: remove old HLSDK 2.3 vgui 2020-09-01 14:15:06 +03:00
Alibek Omarov 0752a867ec game_shared: partially fix VGUI headers 2020-08-31 20:29:59 +03:00
Alibek Omarov c1948b0f89 engine: import headers from hlsdk-xash3d, fixes missing const modifiers 2020-08-31 20:29:36 +03:00
Alibek Omarov 0a331ca9a4 cl_dll: add more crossplatform typedefs, defines 2020-08-31 20:21:43 +03:00
Alibek Omarov 7679464869 features.h: fix conflicting with glibc header 2020-08-31 20:08:08 +03:00
Alibek Omarov b3aa71dfe4 cl_dll: convert backslashes to normal slashes 2020-08-31 20:07:01 +03:00
Alibek Omarov f641cd5b8b gitignore: add from hlsdk-xash3d 2020-08-31 20:02:01 +03:00
Alibek Omarov b5b7697b33 waf: add Waf build system 2020-08-31 20:01:38 +03:00
Alibek Omarov e11ac08f0c Add portability headers from engine 2020-08-31 20:00:54 +03:00
Alibek Omarov 72dd8114eb CP1251 to UTF-8 (to preserve original comments) 2020-08-31 19:55:47 +03:00
Alibek Omarov 5cc388c45e CRLF to LF 2020-08-31 19:50:41 +03:00
757 changed files with 336801 additions and 336913 deletions

28
.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
# Binaries
*.o
*.so
*/*.o
*/*/*.o
*.a
*.framework
*.exe
*.dll
*.pdb
build/
CMakeLists.txt.user
cmake_install.cmake
*.orig
*.cbp
*.dsw
*.vsxproj
*.vsproj
*.sln
.waf-*
waf-*
.waf3-*
waf3-*
.lock*
*.pyc
.vscode/
*.kate-swp
*.save

3
.gitmodules vendored Normal file
View File

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

View File

@ -32,7 +32,7 @@
WEAPON *gpActiveSel; // NULL means off, 1 means just the menu bar, otherwise
// this points to the active weapon menu item
//WEAPON *gpLastSel; // Last weapon menu selection buz: íàõ
//WEAPON *gpLastSel; // Last weapon menu selection buz: нах
client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, int iRes, int iCount);
@ -612,7 +612,7 @@ void WeaponsResource :: SelectSlot( int iSlot, int fAdvance, int iDirection )
m_rgColumnSizes[iSlot] = 1;
gpActiveSel = GetFirstPos( iSlot );
// Wargon: hud_fastswitch äëÿ íîâîãî HUD'à.
// Wargon: hud_fastswitch для нового HUD'а.
if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0))
{
ServerCmd(gpActiveSel->szName);
@ -642,7 +642,7 @@ void WeaponsResource :: SelectSlot( int iSlot, int fAdvance, int iDirection )
m_iSelectedColumn = iSlot;
gpActiveSel = GetFirstPos( iSlot );
// Wargon: hud_fastswitch äëÿ íîâîãî HUD'à.
// Wargon: hud_fastswitch для нового HUD'а.
if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0))
{
ServerCmd(gpActiveSel->szName);

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

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

@ -30,7 +30,6 @@ typedef unsigned short word;
typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf);
#include <vector.h>
#define EXPORT _declspec( dllexport )
#include "../engine/cdll_int.h"
#include "cdll_dll.h"

View File

@ -17,9 +17,8 @@
//
#include "cvardef.h"
#define EXPORT _declspec( dllexport )
#define DLLEXPORT __declspec( dllexport )
#include "port.h"
#include "exportdef.h"
#ifndef TRUE
#define TRUE 1
@ -135,14 +134,14 @@ extern "C" void DLLEXPORT HUD_StudioEvent( const struct mstudioevent_s *event, c
#define DECLARE_MESSAGE(y, x) int __MsgFunc_##x(const char *pszName, int iSize, void *pbuf) \
{ \
return gHUD.##y.MsgFunc_##x(pszName, iSize, pbuf ); \
return gHUD.y.MsgFunc_##x(pszName, iSize, pbuf ); \
}
#define HOOK_COMMAND(x, y) gEngfuncs.pfnAddCommand( x, __CmdFunc_##y );
#define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \
{ \
gHUD.##y.UserCmd_##x( ); \
gHUD.y.UserCmd_##x( ); \
}
#define SPR_Set (*gEngfuncs.pfnSPR_Set)

View File

@ -14,7 +14,7 @@ class MemBlock
public:
MemBlock(int numElements)
{
// элемент 0 используется в качестве начала списка занятых ячеек
// элемент 0 используется в качестве начала списка занятых ячеек
m_iArraySize = numElements + 1;
m_pArray = new chunk_t[m_iArraySize];
@ -38,7 +38,7 @@ public:
{
if (m_iArraySize > 1)
{
m_pArray[0].next = 0; // если он ссылается сам на себя, значит список занятых пуст
m_pArray[0].next = 0; // если он ссылается сам на себя, значит список занятых пуст
m_iFirstFree = 1;
for (int i = 1; i < m_iArraySize; ++i)
@ -51,9 +51,9 @@ public:
if (m_iFirstFree != m_iArraySize)
{
int savedFirstFree = m_pArray[m_iFirstFree].next;
m_pArray[m_iFirstFree].next = m_pArray[0].next; // добавляем свободную ячейку в
m_pArray[0].next = m_iFirstFree; // список занятых
m_iFirstFree = savedFirstFree; // исключаем ячейку из списка свободных
m_pArray[m_iFirstFree].next = m_pArray[0].next; // добавляем свободную ячейку в
m_pArray[0].next = m_iFirstFree; // список занятых
m_iFirstFree = savedFirstFree; // исключаем ячейку из списка свободных
return &(m_pArray[m_pArray[0].next].data);
}
else
@ -67,7 +67,7 @@ public:
bool StartPass( void )
{
m_iCurrent = 0; // начинаем обход с нулевого элемента
m_iCurrent = 0; // начинаем обход с нулевого элемента
if (m_iArraySize > 1)
return true;
@ -92,17 +92,17 @@ public:
void DeleteCurrent( void )
{
int delindex = m_pArray[m_iCurrent].next;
m_pArray[m_iCurrent].next = m_pArray[delindex].next; // выбрасываем элемент из цепи занятых
m_pArray[m_iCurrent].next = m_pArray[delindex].next; // выбрасываем элемент из цепи занятых
m_pArray[delindex].next = m_iFirstFree;
m_iFirstFree = delindex; // включаем элемент в начало цепи свободных
m_iFirstFree = delindex; // включаем элемент в начало цепи свободных
}
private:
chunk_t *m_pArray;
int m_iArraySize;
int m_iCurrent; // для прохождения через массив
int m_iCurrent; // для прохождения через массив
int m_iFirstFree; // начало списка свободных элементов
int m_iFirstFree; // начало списка свободных элементов
};

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

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

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)
@ -77,7 +78,7 @@ extern render_api_t gRenderfuncs;
#define Sys_DoubleTime (*gRenderfuncs.pfnTime)
// sound functions (we can't use macroses - this names is collide with standard windows methods)
inline void PlaySound( char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); }
// render api callbacks
@ -154,7 +155,7 @@ inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex(
#define IMAGE_EXISTS( path ) ( FILE_EXISTS( va( "%s.tga", path )) || FILE_EXISTS( va( "%s.dds", path )))
extern void ALERT( ALERT_TYPE level, char *szFmt, ... );
extern void ALERT( ALERT_TYPE level, const char *szFmt, ... );
inline bool FILE_EXISTS( const char *filename )
{

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -22,8 +22,6 @@
#include "gl_local.h"
#include "gl_studio.h"
#define DLLEXPORT __declspec( dllexport )
void Game_AddObjects( void );
extern vec3_t v_origin;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -6,6 +6,6 @@
#ifndef _GETFONT_H
#define _GETFONT_H
Font* FontFromMessage(const char* &ptext);
Font* FontFromMessage(const char* ptext);
#endif // _GETFONT_H

View File

@ -18,9 +18,9 @@
// implementation of CHudHealth class
//
#include "STDIO.H"
#include "STDLIB.H"
#include "MATH.H"
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include "hud.h"
#include "cl_util.h"
@ -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])
{
@ -427,7 +427,7 @@ int CHudHealth::DrawDamage(float flTime)
// check for bits that should be expired
for ( i = 0; i < NUM_DMG_TYPES; i++ )
for (int i = 0; i < NUM_DMG_TYPES; i++ )
{
DAMAGE_IMAGE *pdmg = &m_dmg[i];

View File

@ -36,7 +36,7 @@
#include "studio.h"
#include "demo.h"
#include "demo_api.h"
#include "vgui_scorepanel.h"
#include "vgui_ScorePanel.h"
#include "gl_local.h" // buz
#include "r_studioint.h"
@ -471,7 +471,7 @@ void MakeLight( void )
void GammaGraphInit();
void CanUseInit( void ); // Wargon: Èêîíêà þçà.
void CanUseInit( void ); // Wargon: Иконка юза.
// This is called every time the DLL is loaded
void CHud :: Init( void )
@ -484,7 +484,7 @@ void CHud :: Init( void )
SubtitleInit(); // buz
TabPanelInit(); // buz
CanUseInit(); // Wargon: Èêîíêà þçà.
CanUseInit(); // Wargon: Иконка юза.
// pointer to headshield entity
m_pHeadShieldEnt = &head_shield;
@ -708,7 +708,7 @@ void CHud :: VidInit( void )
p = m_pSpriteList;
int index = 0;
for ( j = 0; j < m_iSpriteCountAllRes; j++ )
for ( int j = 0; j < m_iSpriteCountAllRes; j++ )
{
if ( p->iRes == m_iRes )
{

View File

@ -29,8 +29,12 @@
#define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0
#include "port.h"
#include "wrect.h"
#ifdef XASH_WIN32
#include "windows.h"
#endif
#include "cl_dll.h"
#include "render_api.h"
#include "enginecallback.h"
@ -110,7 +114,7 @@ struct HUDLIST {
//
//-----------------------------------------------------
//
#include "..\game_shared\voice_status.h"
#include "../game_shared/voice_status.h"
#include "hud_spectator.h"

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -58,7 +58,7 @@ void CHud::Think(void)
m_flDeadTime = gEngfuncs.GetClientTime();
}
// Wargon: Исправление бага эффекта grayscale, остававшегося после загрузки из мертвого состояния.
// Wargon: Исправление бага эффекта grayscale, остававшегося после загрузки из мертвого состояния.
if (gHUD.m_Health.m_iHealth > 0)
{
m_flDeadTime = 0;
@ -97,7 +97,7 @@ void CHud::Think(void)
if( mod < 30 ) mod = 30;
if( g_iGunMode == 3 || lastFixedFov == 30 )
mod *= 2; // хаками халфа полнится (c)
mod *= 2; // хаками халфа полнится (c)
mod /= 30;
if( m_flFOV < targetFOV )
@ -158,7 +158,7 @@ int CHud :: Redraw( float flTime, int intermission )
m_fOldTime = m_flTime; // save time of previous redraw
m_flTime = flTime;
m_flTimeDelta = (double)m_flTime - m_fOldTime;
static m_flShotTime = 0;
static int m_flShotTime = 0;
#if 0
// g-cont. disabled for users request
@ -258,7 +258,7 @@ int CHud :: Redraw( float flTime, int intermission )
}
// buz: draw crosshair
// Wargon: Прицел рисуется только если hud_draw = 1.
// Wargon: Прицел рисуется только если hud_draw = 1.
if(( g_vSpread[0] && g_iGunMode == 1 && m_SpecTank_on == 0 ) && gHUD.m_pCvarDraw->value && cv_crosshair->value )
{
if( gViewPort && gViewPort->m_pParanoiaText && gViewPort->m_pParanoiaText->isVisible( ))
@ -359,7 +359,8 @@ int CHud :: DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int
int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b )
{
// find the end of the string
for ( char *szIt = szString; *szIt != 0; szIt++ )
char *szIt;
for ( szIt = szString; *szIt != 0; szIt++ )
{ // we should count the length?
}

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -12,7 +12,11 @@
#include "hud_servers.h"
#include "net_api.h"
#include <string.h>
#if XASH_WIN32
#include <winsock.h>
#else
#include <arpa/inet.h>
#endif
static int context_id;
@ -599,7 +603,7 @@ int CompareField( CHudServers::server_t *p1, CHudServers::server_t *p2, const ch
return stricmp( sz1, sz2 );
}
int CALLBACK ServerListCompareFunc( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname )
int ServerListCompareFunc( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname )
{
if (!p1 || !p2) // No meaningful comparison
return 0;
@ -750,7 +754,7 @@ int CHudServers::LoadMasterAddresses( int maxservers, int *count, netadr_t *padr
char szMaster[ 256 ];
char szMasterFile[256];
char *pbuffer = NULL;
char *pstart = NULL ;
const char *pstart = NULL ;
netadr_t adr;
char szAdr[64];
int nPort;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,9 +1,10 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// TODO: import hlsdk-xash3d input
#include "hud.h"
#include "cl_util.h"
@ -15,7 +16,9 @@
#include "camera.h"
#include "in_defs.h"
#include "gl_local.h"
#if XASH_WIN32
#include "windows.h"
#endif
float CL_KeyState (kbutton_t *key);
@ -88,6 +91,10 @@ void CAM_ToFirstPerson(void);
void CAM_StartDistance(void);
void CAM_EndDistance(void);
#if !XASH_WIN32
void SetCursorPos( int x, int y ) { }
void GetCursorPos( POINT *p ) { gEngfuncs.GetMousePosition( (int *)&p->x, (int *)&p->y ); }
#endif
//-------------------------------------------------- Local Functions

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -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

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -22,7 +22,7 @@
#include "in_defs.h"
#include <string.h>
#include <mathlib.h>
#include <ctype.h>
#include "vgui_TeamFortressViewport.h"
@ -773,7 +773,7 @@ void DLLEXPORT CL_CreateMove ( float frametime, struct usercmd_s *cmd, int activ
else if (viewangles[PITCH] < -gHUD.m_SpecTank_coneVer)
viewangles[PITCH] = -gHUD.m_SpecTank_coneVer;
// âñåì ñïàñèáî, âñå ñâîáîäíû
// всем спасибо, все свободны
gEngfuncs.SetViewAngles( (float *)viewangles );
}

1628
cl_dll/input_goldsource.cpp Normal file

File diff suppressed because it is too large Load Diff

93
cl_dll/input_mouse.cpp Normal file
View File

@ -0,0 +1,93 @@
#include "input_mouse.h"
#include "exportdef.h"
#include "hud.h"
#include "cl_util.h"
// shared between backends
Vector dead_viewangles(0, 0, 0);
cvar_t *sensitivity;
cvar_t *in_joystick;
FWGSInput fwgsInput;
#ifdef SUPPORT_GOLDSOURCE_INPUT
GoldSourceInput goldSourceInput;
AbstractInput* currentInput = &goldSourceInput;
#else
AbstractInput* currentInput = &fwgsInput;
#endif
extern "C" void DLLEXPORT IN_ClientMoveEvent( float forwardmove, float sidemove )
{
currentInput->IN_ClientMoveEvent(forwardmove, sidemove);
}
extern "C" void DLLEXPORT IN_ClientLookEvent( float relyaw, float relpitch )
{
currentInput->IN_ClientLookEvent(relyaw, relpitch);
}
void IN_Move( float frametime, usercmd_t *cmd )
{
currentInput->IN_Move(frametime, cmd);
}
extern "C" void DLLEXPORT IN_MouseEvent( int mstate )
{
currentInput->IN_MouseEvent(mstate);
}
extern "C" void DLLEXPORT IN_ClearStates( void )
{
currentInput->IN_ClearStates();
}
extern "C" void DLLEXPORT IN_ActivateMouse( void )
{
currentInput->IN_ActivateMouse();
}
extern "C" void DLLEXPORT IN_DeactivateMouse( void )
{
currentInput->IN_DeactivateMouse();
}
extern "C" void DLLEXPORT IN_Accumulate( void )
{
currentInput->IN_Accumulate();
}
/*
===========
IN_ResetMouse
===========
*/
void IN_ResetMouse( void )
{
gEngfuncs.pfnSetMousePos( gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY() );
}
void IN_Commands( void )
{
currentInput->IN_Commands();
}
void IN_Shutdown( void )
{
currentInput->IN_Shutdown();
}
void IN_Init( void )
{
#ifdef SUPPORT_GOLDSOURCE_INPUT
if (IsXashFWGS()) {
gEngfuncs.Con_Printf( "FWGS Xash3D input is in use\n" );
currentInput = &fwgsInput;
} else {
gEngfuncs.Con_Printf( "GoldSource input is in use\n" );
currentInput = &goldSourceInput;
}
#else
currentInput = &fwgsInput;
#endif
currentInput->IN_Init();
}

79
cl_dll/input_mouse.h Normal file
View File

@ -0,0 +1,79 @@
#pragma once
#ifndef INPUT_MOUSE_H
#define INPUT_MOUSE_H
#include "cl_dll.h"
#include "usercmd.h"
#include "in_defs.h"
class AbstractInput
{
public:
virtual void IN_ClientMoveEvent( float forwardmove, float sidemove ) = 0;
virtual void IN_ClientLookEvent( float relyaw, float relpitch ) = 0;
virtual void IN_Move( float frametime, usercmd_t *cmd ) = 0;
virtual void IN_MouseEvent( int mstate ) = 0;
virtual void IN_ClearStates( void ) = 0;
virtual void IN_ActivateMouse( void ) = 0;
virtual void IN_DeactivateMouse( void ) = 0;
virtual void IN_Accumulate( void ) = 0;
virtual void IN_Commands( void ) = 0;
virtual void IN_Shutdown( void ) = 0;
virtual void IN_Init( void ) = 0;
};
class FWGSInput : public AbstractInput
{
public:
virtual void IN_ClientMoveEvent( float forwardmove, float sidemove );
virtual void IN_ClientLookEvent( float relyaw, float relpitch );
virtual void IN_Move( float frametime, usercmd_t *cmd );
virtual void IN_MouseEvent( int mstate );
virtual void IN_ClearStates( void );
virtual void IN_ActivateMouse( void );
virtual void IN_DeactivateMouse( void );
virtual void IN_Accumulate( void );
virtual void IN_Commands( void );
virtual void IN_Shutdown( void );
virtual void IN_Init( void );
protected:
float ac_forwardmove;
float ac_sidemove;
int ac_movecount;
float rel_yaw;
float rel_pitch;
};
// No need for goldsource input support on the platforms that are not supported by GoldSource.
#if defined(GOLDSOURCE_SUPPORT) && (defined(_WIN32) || defined(__linux__) || defined(__APPLE__)) && (defined(__i386) || defined(_M_IX86))
#define SUPPORT_GOLDSOURCE_INPUT
class GoldSourceInput : public AbstractInput
{
public:
virtual void IN_ClientMoveEvent( float forwardmove, float sidemove ) {}
virtual void IN_ClientLookEvent( float relyaw, float relpitch ) {}
virtual void IN_Move( float frametime, usercmd_t *cmd );
virtual void IN_MouseEvent( int mstate );
virtual void IN_ClearStates( void );
virtual void IN_ActivateMouse( void );
virtual void IN_DeactivateMouse( void );
virtual void IN_Accumulate( void );
virtual void IN_Commands( void );
virtual void IN_Shutdown( void );
virtual void IN_Init( void );
protected:
void IN_GetMouseDelta( int *pOutX, int *pOutY);
void IN_MouseMove ( float frametime, usercmd_t *cmd);
void IN_StartupMouse (void);
int mouse_buttons;
int mouse_oldbuttonstate;
POINT current_pos;
int old_mouse_x, old_mouse_y, mx_accum, my_accum;
int mouseinitialized;
void* sdl2Lib;
};
#endif
#endif

293
cl_dll/input_xash3d.cpp Normal file
View File

@ -0,0 +1,293 @@
#include "hud.h"
#include "usercmd.h"
#include "cvardef.h"
#include "kbutton.h"
#include "keydefs.h"
#include "input_mouse.h"
extern cvar_t *sensitivity;
extern cvar_t *in_joystick;
extern kbutton_t in_strafe;
extern kbutton_t in_mlook;
extern kbutton_t in_speed;
extern kbutton_t in_jlook;
extern kbutton_t in_forward;
extern kbutton_t in_back;
extern kbutton_t in_moveleft;
extern kbutton_t in_moveright;
extern cvar_t *m_pitch;
extern cvar_t *m_yaw;
extern cvar_t *m_forward;
extern cvar_t *m_side;
extern cvar_t *lookstrafe;
extern cvar_t *lookspring;
extern cvar_t *cl_pitchdown;
extern cvar_t *cl_pitchup;
extern cvar_t *cl_yawspeed;
extern cvar_t *cl_sidespeed;
extern cvar_t *cl_forwardspeed;
extern cvar_t *cl_pitchspeed;
extern cvar_t *cl_movespeedkey;
cvar_t *cl_laddermode;
#define F 1U<<0 // Forward
#define B 1U<<1 // Back
#define L 1U<<2 // Left
#define R 1U<<3 // Right
#define T 1U<<4 // Forward stop
#define S 1U<<5 // Side stop
#define BUTTON_DOWN 1
#define IMPULSE_DOWN 2
#define IMPULSE_UP 4
int CL_IsDead( void );
int g_iVisibleMouse = 0;
extern int iMouseInUse;
extern Vector dead_viewangles;
void IN_ToggleButtons( float forwardmove, float sidemove )
{
static unsigned int moveflags = T | S;
if( forwardmove )
moveflags &= ~T;
else
{
//if( in_forward.state || in_back.state ) gEngfuncs.Con_Printf("Buttons pressed f%d b%d\n", in_forward.state, in_back.state);
if( !( moveflags & T ) )
{
//IN_ForwardUp();
//IN_BackUp();
//gEngfuncs.Con_Printf("Reset forwardmove state f%d b%d\n", in_forward.state, in_back.state);
in_forward.state &= ~BUTTON_DOWN;
in_back.state &= ~BUTTON_DOWN;
moveflags |= T;
}
}
if( sidemove )
moveflags &= ~S;
else
{
//gEngfuncs.Con_Printf("l%d r%d\n", in_moveleft.state, in_moveright.state);
//if( in_moveleft.state || in_moveright.state ) gEngfuncs.Con_Printf("Buttons pressed l%d r%d\n", in_moveleft.state, in_moveright.state);
if( !( moveflags & S ) )
{
//IN_MoverightUp();
//IN_MoveleftUp();
//gEngfuncs.Con_Printf("Reset sidemove state f%d b%d\n", in_moveleft.state, in_moveright.state);
in_moveleft.state &= ~BUTTON_DOWN;
in_moveright.state &= ~BUTTON_DOWN;
moveflags |= S;
}
}
if( forwardmove > 0.7f && !( moveflags & F ) )
{
moveflags |= F;
in_forward.state |= BUTTON_DOWN;
}
if( forwardmove < 0.7f && ( moveflags & F ) )
{
moveflags &= ~F;
in_forward.state &= ~BUTTON_DOWN;
}
if( forwardmove < -0.7f && !( moveflags & B ) )
{
moveflags |= B;
in_back.state |= BUTTON_DOWN;
}
if( forwardmove > -0.7f && ( moveflags & B ) )
{
moveflags &= ~B;
in_back.state &= ~BUTTON_DOWN;
}
if( sidemove > 0.9f && !( moveflags & R ) )
{
moveflags |= R;
in_moveright.state |= BUTTON_DOWN;
}
if( sidemove < 0.9f && ( moveflags & R ) )
{
moveflags &= ~R;
in_moveright.state &= ~BUTTON_DOWN;
}
if( sidemove < -0.9f && !( moveflags & L ) )
{
moveflags |= L;
in_moveleft.state |= BUTTON_DOWN;
}
if( sidemove > -0.9f && ( moveflags & L ) )
{
moveflags &= ~L;
in_moveleft.state &= ~BUTTON_DOWN;
}
}
void FWGSInput::IN_ClientMoveEvent( float forwardmove, float sidemove )
{
//gEngfuncs.Con_Printf("IN_MoveEvent\n");
ac_forwardmove += forwardmove;
ac_sidemove += sidemove;
ac_movecount++;
}
void FWGSInput::IN_ClientLookEvent( float relyaw, float relpitch )
{
rel_yaw += relyaw;
rel_pitch += relpitch;
}
// Rotate camera and add move values to usercmd
void FWGSInput::IN_Move( float frametime, usercmd_t *cmd )
{
Vector viewangles;
bool fLadder = false;
if( gHUD.m_iIntermission )
return; // we can't move during intermission
if( cl_laddermode->value != 2 )
{
cl_entity_t *pplayer = gEngfuncs.GetLocalPlayer();
if( pplayer )
fLadder = pplayer->curstate.movetype == MOVETYPE_FLY;
}
//if(ac_forwardmove || ac_sidemove)
//gEngfuncs.Con_Printf("Move: %f %f %f %f\n", ac_forwardmove, ac_sidemove, rel_pitch, rel_yaw);
#if 0
if( in_mlook.state & 1 )
{
V_StopPitchDrift();
}
#endif
if( CL_IsDead() )
{
viewangles = dead_viewangles; // HACKHACK: see below
}
else
{
gEngfuncs.GetViewAngles( viewangles );
}
if( gHUD.GetSensitivity() != 0 )
{
rel_yaw *= gHUD.GetSensitivity();
rel_pitch *= gHUD.GetSensitivity();
}
else
{
rel_yaw *= sensitivity->value;
rel_pitch *= sensitivity->value;
}
viewangles[YAW] += rel_yaw;
if( fLadder )
{
if( cl_laddermode->value == 1 )
viewangles[YAW] -= ac_sidemove * 5;
ac_sidemove = 0;
}
#if 0
if( gHUD.m_MOTD.m_bShow )
gHUD.m_MOTD.scroll += rel_pitch;
else
#endif
viewangles[PITCH] += rel_pitch;
if( viewangles[PITCH] > cl_pitchdown->value )
viewangles[PITCH] = cl_pitchdown->value;
if( viewangles[PITCH] < -cl_pitchup->value )
viewangles[PITCH] = -cl_pitchup->value;
// HACKHACK: change viewangles directly in viewcode,
// so viewangles when player is dead will not be changed on server
if( !CL_IsDead() )
{
gEngfuncs.SetViewAngles( viewangles );
}
dead_viewangles = viewangles; // keep them actual
if( ac_movecount )
{
IN_ToggleButtons( ac_forwardmove / ac_movecount, ac_sidemove / ac_movecount );
if( ac_forwardmove )
cmd->forwardmove = ac_forwardmove * cl_forwardspeed->value / ac_movecount;
if( ac_sidemove )
cmd->sidemove = ac_sidemove * cl_sidespeed->value / ac_movecount;
if( ( in_speed.state & 1 ) && ( ac_sidemove || ac_forwardmove ) )
{
cmd->forwardmove *= cl_movespeedkey->value;
cmd->sidemove *= cl_movespeedkey->value;
}
}
ac_sidemove = ac_forwardmove = rel_pitch = rel_yaw = 0;
ac_movecount = 0;
}
void FWGSInput::IN_MouseEvent( int mstate )
{
static int mouse_oldbuttonstate;
if ( iMouseInUse || g_iVisibleMouse )
return;
// perform button actions
for( int i = 0; i < 5; i++ )
{
if( ( mstate & ( 1 << i ) ) && !( mouse_oldbuttonstate & ( 1 << i ) ) )
{
gEngfuncs.Key_Event( K_MOUSE1 + i, 1 );
}
if( !( mstate & ( 1 << i ) ) && ( mouse_oldbuttonstate & ( 1 << i ) ) )
{
gEngfuncs.Key_Event( K_MOUSE1 + i, 0 );
}
}
mouse_oldbuttonstate = mstate;
}
// Stubs
void FWGSInput::IN_ClearStates( void )
{
//gEngfuncs.Con_Printf( "IN_ClearStates\n" );
}
void FWGSInput::IN_ActivateMouse( void )
{
//gEngfuncs.Con_Printf( "IN_ActivateMouse\n" );
}
void FWGSInput::IN_DeactivateMouse( void )
{
//gEngfuncs.Con_Printf( "IN_DeactivateMouse\n" );
}
void FWGSInput::IN_Accumulate( void )
{
//gEngfuncs.Con_Printf( "IN_Accumulate\n" );
}
void FWGSInput::IN_Commands( void )
{
//gEngfuncs.Con_Printf( "IN_Commands\n" );
}
void FWGSInput::IN_Shutdown( void )
{
}
// Register cvars and reset data
void FWGSInput::IN_Init( void )
{
sensitivity = gEngfuncs.pfnRegisterVariable( "sensitivity", "3", FCVAR_ARCHIVE );
in_joystick = gEngfuncs.pfnRegisterVariable( "joystick", "0", FCVAR_ARCHIVE );
cl_laddermode = gEngfuncs.pfnRegisterVariable( "cl_laddermode", "2", FCVAR_ARCHIVE );
ac_forwardmove = ac_sidemove = rel_yaw = rel_pitch = 0;
}

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -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"
@ -961,3 +963,5 @@ void IN_Init (void)
IN_StartupMouse ();
IN_StartupJoystick ();
}
#endif

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

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

@ -29,7 +29,7 @@ void ShowTip( client_textmessage_t *tempMessage ); // buz
void VGuiAddScreenMessage( client_textmessage_t *msg ); // buz
void VGuiAddPickupMessage( client_textmessage_t *msg ); // buz
// Wargon: Ñêðîëëÿùèéñÿ òåêñò.
// Wargon: Скроллящийся текст.
void VGuiAddScrollingMessage( client_textmessage_t *msg );
DECLARE_MESSAGE( m_Message, HudText )
@ -445,7 +445,7 @@ void CHudMessage::MessageAdd( const char *pName, float time )
VGuiAddPickupMessage( tempMessage );
return;
}
else if (tempMessage->effect == 6) // Wargon: Ñêðîëëÿùèéñÿ òåêñò.
else if (tempMessage->effect == 6) // Wargon: Скроллящийся текст.
{
VGuiAddScrollingMessage( tempMessage );
return;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -929,7 +929,9 @@ void CParticleSystem :: DrawSystem( void )
{
if( pParticle->m_fSize <= 0 || !ParticleIsVisible( pParticle ))
continue;
DrawParticle( pParticle, GetVLeft(), GetVUp( ));
Vector vLeft = GetVLeft();
Vector vUp = GetVUp();
DrawParticle( pParticle, vLeft, vUp);
}
}
@ -1049,7 +1051,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;
@ -1068,7 +1070,8 @@ void CParticleSystem :: DrawParticle( CParticle *part, vec3_t &right, vec3_t &up
point[3] = origin + up * -fSinSize + right * fCosSize;
ClearBounds( absmin, absmax );
for( int i = 0; i < 4; i++ )
int i;
for( i = 0; i < 4; i++ )
AddPointToBounds( point[i], absmin, absmax );
int iContents = CONTENTS_NONE;
@ -1083,10 +1086,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

@ -13,6 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include <stdarg.h>
#include "hud.h"
#include "cl_util.h"
#include "const.h"

View File

@ -211,13 +211,13 @@ void CL_BuildCubemaps_f( void )
{
mcubemap_t *m = &world->defaultCubemap;
FREE_TEXTURE( m->texture );
m->valid = m->texture = false;
m->valid = ( m->texture = false );
for( int i = 0; i < world->num_cubemaps; i++ )
{
mcubemap_t *m = &world->cubemaps[i];
FREE_TEXTURE( m->texture );
m->valid = m->texture = false;
m->valid = ( m->texture = false );
}
if( FBitSet( world->features, WORLD_HAS_SKYBOX ))

View File

@ -422,7 +422,7 @@ static void GL_DrawBilateralFilter( word hProgram, int pass )
case UT_COLORMAP:
if( pass == BILATERAL_PASS0 )
u->SetValue( tr.fbo_light.GetTexture() );
else if( pass = BILATERAL_PASS1 )
else if( pass == BILATERAL_PASS1 )
u->SetValue( tr.fbo_filter.GetTexture() );
else u->SetValue( tr.defscene_fbo->colortarget[0] );
break;
@ -435,7 +435,7 @@ static void GL_DrawBilateralFilter( word hProgram, int pass )
case UT_SCREENSIZEINV:
if( pass == BILATERAL_PASS0 )
u->SetValue( 1.0f / (float)glState.width, 0.0f );
else if( pass = BILATERAL_PASS1 )
else if( pass == BILATERAL_PASS1 )
u->SetValue( 0.0f, 1.0f / (float)glState.height );
else u->SetValue( 1.0f / (float)glState.width, 1.0f / (float)glState.height );
break;

View File

@ -751,7 +751,7 @@ get_next_light:
int ignored = -1;
int light = 255;
for( i = 0; i < count; i++ )
for( int i = 0; i < count; i++ )
{
if( indexes[i][0] == -1.0f )
continue;
@ -768,6 +768,7 @@ get_next_light:
if( ignored == -1 )
return;
int i;
for( i = 0; i < (int)cv_deferred_maxlights->value && lights[i] != 255; i++ );
if( i < (int)cv_deferred_maxlights->value )
lights[i] = light; // nearest light for surf

View File

@ -14,7 +14,7 @@ GNU General Public License for more details.
*/
#define EXTERN
#include "gl_export.h"
#include "hud.h"
#include "cl_util.h"
#include "gl_local.h"
@ -355,7 +355,7 @@ DebugCallback
For ARB_debug_output
========================
*/
static void CALLBACK GL_DebugOutput( GLuint source, GLuint type, GLuint id, GLuint severity, GLint length, const GLcharARB *message, GLvoid *userParam )
static void APIENTRY GL_DebugOutput( GLuint source, GLuint type, GLuint id, GLuint severity, GLint length, const GLcharARB *message, GLvoid *userParam )
{
static char string[8192];
char *msg;
@ -502,10 +502,10 @@ static void GL_InitExtensions( void )
}
// get our various GL strings
glConfig.vendor_string = pglGetString( GL_VENDOR );
glConfig.renderer_string = pglGetString( GL_RENDERER );
glConfig.version_string = pglGetString( GL_VERSION );
glConfig.extensions_string = pglGetString( GL_EXTENSIONS );
glConfig.vendor_string = (const char*)pglGetString( GL_VENDOR );
glConfig.renderer_string = (const char*)pglGetString( GL_RENDERER );
glConfig.version_string = (const char*)pglGetString( GL_VERSION );
glConfig.extensions_string = (const char*)pglGetString( GL_EXTENSIONS );
if( Q_stristr( glConfig.renderer_string, "geforce" ))
glConfig.hardware_type = GLHW_NVIDIA;

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

@ -1117,7 +1117,8 @@ find or add unique texture for grass
*/
byte R_GrassTextureForName( const char *name )
{
for( byte i = 0; i < GRASS_TEXTURES && grasstexs[i].name[0]; i++ )
byte i;
for( i = 0; i < GRASS_TEXTURES && grasstexs[i].name[0]; i++ )
{
if( !Q_stricmp( grasstexs[i].name, name ))
return i; // found

View File

@ -25,7 +25,7 @@ GNU General Public License for more details.
#include "gl_frustum.h"
#include "gl_primitive.h"
#include "cl_dlight.h"
#include "features.h"
#include "enginefeatures.h"
#include <utlarray.h>
#include <matrix.h>

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];
@ -194,7 +196,7 @@ static int R_ComputeCropBounds( const matrix4x4 &lightViewProjection, Vector bou
}
// add studio models too
for( i = 0; i < prevRI->frame.solid_meshes.Count(); i++ )
for( int i = 0; i < prevRI->frame.solid_meshes.Count(); i++ )
{
if( !R_StudioGetBounds( &prevRI->frame.solid_meshes[i], worldBounds ))
continue;

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

@ -646,7 +646,7 @@ StudioInterpolateControllers
*/
void CStudioModelRenderer :: StudioInterpolateControllers( cl_entity_t *e, float dadt )
{
// buz: õàê, ïîçâîëÿþùèé íå èíòåðïîëèðîâàòü êîíòðîëëåðû äëÿ ñòàöèîíàðíîãî ïóëåìåòà
// buz: хак, позволяющий не интерполировать контроллеры для стационарного пулемета
if( RI->currententity->curstate.renderfx == 51 )
dadt = 1.0f;
@ -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

@ -1216,7 +1216,7 @@ void CStudioModelRenderer :: SetupSubmodelVerts( const mstudiomodel_t *pSubModel
smooth_tbn = true;
// first create trifan array from studiomodel mesh
while( count = *( ptricmds++ ))
while(( count = *( ptricmds++ )))
{
bool strip = ( count < 0 ) ? false : true;
int vertexState = 0;
@ -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

@ -1137,7 +1137,7 @@ void CStudioModelRenderer :: AddDecalToModel( DecalBuildInfo_t& buildInfo )
float s = 1.0f / (float)ptexture->width;
float t = 1.0f / (float)ptexture->height;
while( numVerts = *( ptricmds++ ))
while(( numVerts = *( ptricmds++ )))
{
bool strip = ( numVerts < 0 ) ? false : true;
int vertexState = 0;

View File

@ -146,7 +146,7 @@ check cubemap sides for valid
*/
static bool Mod_CheckCubemap( const char *name )
{
char *suf[6] = { "px", "nx", "py", "ny", "pz", "nz" };
const char *suf[6] = { "px", "nx", "py", "ny", "pz", "nz" };
int valid_sides = 0;
char sidename[64];
int iCompare;
@ -175,7 +175,7 @@ remove cubemap images from HDD
*/
static void Mod_DeleteCubemap( const char *name )
{
char *suf[6] = { "px", "nx", "py", "ny", "pz", "nz" };
const char *suf[6] = { "px", "nx", "py", "ny", "pz", "nz" };
char sidename[64];
for( int i = 0; i < 6; i++ )
@ -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;
@ -327,7 +328,7 @@ void GL_LoadAndRebuildCubemaps( int refParams )
// bind cubemaps onto world surfaces
// so we don't need to search them again
for( i = 0; i < worldmodel->numsurfaces; i++ )
for( int i = 0; i < worldmodel->numsurfaces; i++ )
{
msurface_t *surf = &worldmodel->surfaces[i];
mextrasurf_t *es = surf->info;
@ -404,7 +405,7 @@ static void Mod_LoadCubemaps( const byte *base, const dlump_t *l )
cm->size = 4;
}
for( i = 0; i < count; i++, in++, out++ )
for( int i = 0; i < count; i++, in++, out++ )
{
// build a cubemap name like enum
Q_snprintf( out->name, sizeof( out->name ), "maps/env/%s/cube#%i", world->name, i );
@ -964,12 +965,12 @@ Mod_SurfaceCompareBuild
sort faces before lightmap building
=================
*/
static int Mod_SurfaceCompareBuild( const unsigned short **a, const unsigned short **b )
static int Mod_SurfaceCompareBuild( const unsigned short *a, const unsigned short *b )
{
msurface_t *surf1, *surf2;
surf1 = &worldmodel->surfaces[(unsigned short)*a];
surf2 = &worldmodel->surfaces[(unsigned short)*b];
surf1 = &worldmodel->surfaces[*a];
surf2 = &worldmodel->surfaces[*b];
if( FBitSet( surf1->flags, SURF_DRAWSKY ) && !FBitSet( surf2->flags, SURF_DRAWSKY ))
return -1;
@ -1001,13 +1002,13 @@ Mod_SurfaceCompareInGame
sort faces to reduce shader switches
=================
*/
static int Mod_SurfaceCompareInGame( const unsigned short **a, const unsigned short **b )
static int Mod_SurfaceCompareInGame( const unsigned short *a, const unsigned short *b )
{
msurface_t *surf1, *surf2;
mextrasurf_t *esrf1, *esrf2;
surf1 = &worldmodel->surfaces[(unsigned short)*a];
surf2 = &worldmodel->surfaces[(unsigned short)*b];
surf1 = &worldmodel->surfaces[*a];
surf2 = &worldmodel->surfaces[*b];
esrf1 = surf1->info;
esrf2 = surf2->info;

View File

@ -16,15 +16,15 @@
#include "triangleapi.h"
#include "gl_local.h"
#define DRIPSPEED 900 // скорость падения капель (пикс в сек)
#define SNOWSPEED 200 // скорость падения снежинок
#define DRIPSPEED 900 // скорость падения капель (пикс в сек)
#define SNOWSPEED 200 // скорость падения снежинок
#define SNOWFADEDIST 80
#define MAX_RAIN_VERTICES 65536 // snowflakes and waterrings draw as quads
#define MAX_RAIN_INDICES MAX_RAIN_VERTICES * 4
#define MAXDRIPS 40000 // лимит капель (можно увеличить при необходимости)
#define MAXFX 20000 // лимит дополнительных частиц (круги по воде и т.п.)
#define MAXDRIPS 40000 // лимит капель (можно увеличить при необходимости)
#define MAXFX 20000 // лимит дополнительных частиц (круги по воде и т.п.)
#define MODE_RAIN 0
#define MODE_SNOW 1
@ -32,7 +32,7 @@
#define DRIP_SPRITE_HALFHEIGHT 46
#define DRIP_SPRITE_HALFWIDTH 8
#define SNOW_SPRITE_HALFSIZE 3
#define MAX_RING_HALFSIZE 25 // "радиус" круга на воде, до которого он разрастается за секунду
#define MAX_RING_HALFSIZE 25 // "радиус" круга на воде, до которого он разрастается за секунду
typedef struct
{
@ -47,7 +47,7 @@ typedef struct
typedef struct cl_drip
{
float birthTime;
float minHeight; // капля будет уничтожена на этой высоте.
float minHeight; // капля будет уничтожена на этой высоте.
Vector origin;
float alpha;
float xDelta; // side speed
@ -90,10 +90,10 @@ static int m_iNumVerts, m_iNumIndex;
/*
=================================
ProcessRain
Перемещает существующие объекты, удаляет их при надобности,
и, если дождь включен, создает новые.
Перемещает существующие объекты, удаляет их при надобности,
и, если дождь включен, создает новые.
Должна вызываться каждый кадр.
Должна вызываться каждый кадр.
=================================
*/
void ProcessRain( void )
@ -132,7 +132,7 @@ void ProcessRain( void )
cl_drip *curDrip = g_dripsArray.GetCurrent();
// хранение отладочной информации
// хранение отладочной информации
float debug_lifetime = 0;
int debug_howmany = 0;
int debug_attempted = 0;
@ -330,7 +330,7 @@ void ProcessRain( void )
/*
=================================
WaterLandingEffect
создает круг на водной поверхности
создает круг на водной поверхности
=================================
*/
void WaterLandingEffect( cl_drip *drip )
@ -362,9 +362,9 @@ void WaterLandingEffect( cl_drip *drip )
/*
=================================
ProcessFXObjects
удаляет FX объекты, у которых вышел срок жизни
удаляет FX объекты, у которых вышел срок жизни
Каждый кадр вызывается перед ProcessRain
Каждый кадр вызывается перед ProcessRain
=================================
*/
void ProcessFXObjects( void )
@ -396,7 +396,7 @@ void ProcessFXObjects( void )
/*
=================================
ResetRain
очищает память, удаляя все объекты.
очищает память, удаляя все объекты.
=================================
*/
void ResetRain( void )
@ -415,7 +415,7 @@ void ResetRain( void )
=================================
DrawRain
Рисование капель и снежинок.
Рисование капель и снежинок.
=================================
*/
void DrawRain( void )
@ -628,7 +628,7 @@ void DrawRain( void )
=================================
DrawFXObjects
Рисование водяных кругов
Рисование водяных кругов
=================================
*/
void DrawFXObjects( void )
@ -738,7 +738,7 @@ void DrawFXObjects( void )
/*
=================================
InitRain
Инициализирует все переменные нулевыми значениями.
Инициализирует все переменные нулевыми значениями.
=================================
*/
void InitRain( void )

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -21,8 +21,6 @@
#include "com_model.h"
#include "gl_local.h"// buz
#define DLLEXPORT __declspec( dllexport )
extern "C"
{
void DLLEXPORT HUD_DrawNormalTriangles( void );

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

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -174,7 +174,8 @@ void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIn
}
// find an empty string slot
for ( int i = 0; i < MAX_LINES; i++ )
int i;
for ( i = 0; i < MAX_LINES; i++ )
{
if ( ! *g_szLineBuffer[i] )
break;

View File

@ -107,7 +107,8 @@ int CHudStatusIcons::MsgFunc_StatusIcon( const char *pszName, int iSize, void *p
void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue )
{
// check to see if the sprite is in the current list
for ( int i = 0; i < MAX_ICONSPRITES; i++ )
int i;
for ( i = 0; i < MAX_ICONSPRITES; i++ )
{
if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) )
break;
@ -155,7 +156,7 @@ void CHudStatusIcons::DisableIcon( char *pszIconName )
if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) )
{
// clear the item from the list
memset( &m_IconList[i], 0, sizeof icon_sprite_t );
memset( &m_IconList[i], 0, sizeof( icon_sprite_t ));
return;
}
}

View File

@ -18,9 +18,10 @@
// implementation of class-less helper functions
//
#include "STDIO.H"
#include "STDLIB.H"
#include "MATH.H"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdarg.h>
#include "hud.h"
#include "cl_util.h"
@ -43,7 +44,7 @@ pfnAlertMessage
=============
*/
void ALERT( ALERT_TYPE level, char *szFmt, ... )
void ALERT( ALERT_TYPE level, const char *szFmt, ... )
{
char buffer[2048]; // must support > 1k messages
va_list args;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -32,7 +32,7 @@
#include "vgui_int.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_ServerBrowser.h"
#include "..\game_shared\vgui_LoadTGA.h"
#include "../game_shared/vgui_loadtga.h"
// Arrow filenames
char *sArrowFilenames[] =

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -26,8 +26,8 @@
#include "cl_entity.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_ScorePanel.h"
#include "..\game_shared\vgui_helpers.h"
#include "..\game_shared\vgui_loadtga.h"
#include "../game_shared/vgui_helpers.h"
#include "../game_shared/vgui_loadtga.h"
#include "vgui_SpectatorPanel.h"
hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine
@ -303,7 +303,8 @@ void ScorePanel::Update()
void ScorePanel::SortTeams()
{
// clear out team scores
for ( int i = 1; i <= m_iNumTeams; i++ )
int i;
for ( i = 1; i <= m_iNumTeams; i++ )
{
if ( !g_TeamInfo[i].scores_overriden )
g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0;
@ -320,7 +321,8 @@ void ScorePanel::SortTeams()
continue; // skip over players who are not in a team
// find what team this player is in
for ( int j = 1; j <= m_iNumTeams; j++ )
int j;
for ( j = 1; j <= m_iNumTeams; j++ )
{
if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) )
break;
@ -462,7 +464,8 @@ void ScorePanel::SortPlayers( int iTeam, char *team )
void ScorePanel::RebuildTeams()
{
// clear out player counts from teams
for ( int i = 1; i <= m_iNumTeams; i++ )
int i;
for ( i = 1; i <= m_iNumTeams; i++ )
{
g_TeamInfo[i].players = 0;
}
@ -479,7 +482,8 @@ void ScorePanel::RebuildTeams()
continue; // skip over players who are not in a team
// is this player in an existing team?
for ( int j = 1; j <= m_iNumTeams; j++ )
int j;
for ( j = 1; j <= m_iNumTeams; j++ )
{
if ( g_TeamInfo[j].name[0] == '\0' )
break;
@ -541,7 +545,8 @@ void ScorePanel::FillGrid()
bool bNextRowIsGap = false;
for(int row=0; row < NUM_ROWS; row++)
int row;
for(row=0; row < NUM_ROWS; row++)
{
CGrid *pGridRow = &m_PlayerGrids[row];
pGridRow->SetRowUnderline(0, false, 0, 0, 0, 0, 0);

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -14,7 +14,7 @@
#include<VGUI_TextGrid.h>
#include<VGUI_Label.h>
#include<VGUI_TextImage.h>
#include "..\game_shared\vgui_listbox.h"
#include "../game_shared/vgui_listbox.h"
#include <ctype.h>
@ -222,8 +222,8 @@ private:
class ScoreTablePanel;
#include "..\game_shared\vgui_grid.h"
#include "..\game_shared\vgui_defaultinputsignal.h"
#include "../game_shared/vgui_grid.h"
#include "../game_shared/vgui_defaultinputsignal.h"
//-----------------------------------------------------------------------------
// Purpose: Scoreboard back panel

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -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

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -158,7 +158,7 @@ public:
drawSetTextFont(m_pFont);
drawSetTextColor(0, 250, 0, 0);
fff char* pos = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
fff char* pos = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
int xpos = 0;
while(*pos != 0)
@ -168,7 +168,7 @@ public:
xpos += 16;
}
pos = "абвгдежзийклмнопрстуфхцчшщъыьэюя";
pos = "абвгдежзийклмнопрстуфхцчшщъыьэюя";
xpos = 0;
while(*pos != 0)
@ -178,7 +178,7 @@ public:
xpos += 16;
} fffffffffff
drawSetTextPos(0,17);
char* textstring = "Изначально именовалась в правительственных объектах...";
char* textstring = "Изначально именовалась в правительственных объектах...";
drawPrintText(textstring, strlen(textstring) - 1);
int xpos = 0;
@ -192,7 +192,7 @@ public:
}
int wide, tall;
m_pFont->getTextSize("Изначально именовалась в правительственных объектах...", wide, tall);
m_pFont->getTextSize("Изначально именовалась в правительственных объектах...", wide, tall);
drawSetColor(100, 0, 0, 0);
drawFilledRect(0, 34, wide, 34+tall);
//gEngfuncs.Con_Printf("wide %d, tall %d\n", wide, tall);
@ -650,7 +650,7 @@ TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Pane
m_pRadio = NULL; // buz
m_pGamma = NULL; // buz
// Wargon: Скроллящийся текст.
// Wargon: Скроллящийся текст.
m_pScrollingMsg = NULL;
CreatePickupMessagePanels(); // buz
@ -754,7 +754,7 @@ TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Pane
m_pScreenMsg = new CScreenMessage();
m_pScreenMsg->setParent(this);
// Wargon: Скроллящийся текст.
// Wargon: Скроллящийся текст.
m_pScrollingMsg = new CScrollingMessage();
m_pScrollingMsg->setParent(this);
}
@ -802,7 +802,7 @@ void TeamFortressViewport::Initialize( void )
m_pTips->Initialize(); // buz
if (m_pScreenMsg)
m_pScreenMsg->Initialize(); // buz
// Wargon: Скроллящийся текст.
// Wargon: Скроллящийся текст.
if (m_pScrollingMsg)
m_pScrollingMsg->Initialize();
@ -1070,11 +1070,11 @@ try
pfile = gEngfuncs.COM_ParseFile(pfile, token);
}
}
catch( CException *e )
catch( ... /* CException *e */ )
{
e;
/*e;
//e->Delete();
e = NULL;
e = NULL;*/
m_iInitialized = false;
return newIndex;
}
@ -2366,7 +2366,8 @@ int TeamFortressViewport::MsgFunc_TeamScore( const char *pszName, int iSize, voi
char *TeamName = READ_STRING();
// find the team matching the name
for ( int i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ )
int i;
for ( i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ )
{
if ( !stricmp( TeamName, g_TeamInfo[i].name ) )
break;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -137,7 +137,7 @@ class CTips;
class CScreenMessage;
class CGammaView;
// Wargon: Ñêðîëëÿùèéñÿ òåêñò.
// Wargon: Скроллящийся текст.
class CScrollingMessage;
char* GetVGUITGAName(const char *pszName);
@ -670,7 +670,7 @@ public:
CGammaView *m_pGamma;
CScreenMessage *m_pScreenMsg;
// Wargon: Ñêðîëëÿùèéñÿ òåêñò.
// Wargon: Скроллящийся текст.
CScrollingMessage *m_pScrollingMsg;
};
@ -684,14 +684,14 @@ protected:
char m_pszCommand[MAX_COMMAND_SIZE];
int m_iCloseVGUIMenu;
public:
CMenuHandler_StringCommand( char *pszCommand )
CMenuHandler_StringCommand( const char *pszCommand )
{
strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE);
m_pszCommand[MAX_COMMAND_SIZE-1] = '\0';
m_iCloseVGUIMenu = false;
}
CMenuHandler_StringCommand( char *pszCommand, int iClose )
CMenuHandler_StringCommand( const char *pszCommand, int iClose )
{
strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE);
m_pszCommand[MAX_COMMAND_SIZE-1] = '\0';
@ -715,11 +715,11 @@ class CMenuHandler_StringCommandWatch : public CMenuHandler_StringCommand
{
private:
public:
CMenuHandler_StringCommandWatch( char *pszCommand ) : CMenuHandler_StringCommand( pszCommand )
CMenuHandler_StringCommandWatch( const char *pszCommand ) : CMenuHandler_StringCommand( pszCommand )
{
}
CMenuHandler_StringCommandWatch( char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose )
CMenuHandler_StringCommandWatch( const char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose )
{
}
@ -745,11 +745,11 @@ class CMenuHandler_StringCommandClassSelect : public CMenuHandler_StringCommand
{
private:
public:
CMenuHandler_StringCommandClassSelect( char *pszCommand ) : CMenuHandler_StringCommand( pszCommand )
CMenuHandler_StringCommandClassSelect( const char *pszCommand ) : CMenuHandler_StringCommand( pszCommand )
{
}
CMenuHandler_StringCommandClassSelect( char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose )
CMenuHandler_StringCommandClassSelect( const char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose )
{
}

View File

@ -11,7 +11,7 @@
#include "cdll_int.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_gamma.h"
//#include "..\game_shared\vgui_loadtga.h"
//#include "../game_shared/vgui_loadtga.h"
//#include<VGUI_TextImage.h>
#include "com_model.h"

View File

@ -12,7 +12,7 @@
#include "vgui_TeamFortressViewport.h"
#include "vgui_hud.h"
#include "vgui_paranoiatext.h" // Wargon
#include "..\game_shared\vgui_loadtga.h"
#include "../game_shared/vgui_loadtga.h"
#include<VGUI_TextImage.h>
#include "ammohistory.h"
@ -30,13 +30,13 @@
#define HEALTH_ZERO_ALPHA 150
#define HEALTH_ALPHA 70
// Wargon: Èêîíêà þçà.
// Wargon: Иконка юза.
#define USAGE_FADE_TIME 1
#define USAGE_ALPHA 70
static int resArray[] = { 320, 400, 512, 640, 800, 1024, 1152, 1280, 1600 };
// Wargon: Èêîíêà þçà.
// Wargon: Иконка юза.
int CanUseStatus;
int __MsgFunc_CanUse( const char *pszName, int iSize, void *pbuf )
{
@ -160,7 +160,7 @@ void CHud2::Initialize()
armor = -1;
stamina = 1;
m_fMedkitUpdateTime = 0;
m_fUsageUpdateTime = 0; // Wargon: Èêîíêà þçà.
m_fUsageUpdateTime = 0; // Wargon: Иконка юза.
}
CHud2::CHud2() : Panel(0, 0, XRES(640), YRES(480))
@ -396,7 +396,7 @@ CHud2::CHud2() : Panel(0, 0, XRES(640), YRES(480))
}
//
// Wargon: Èêîíêà þçà.
// Wargon: Иконка юза.
//
m_pUsageIcon = new CImageLabel( "usage", ScreenWidth / 2 - 12, ScreenHeight / 2 + 100 );
@ -443,7 +443,7 @@ void CHud2::solve()
{
float curtime = gEngfuncs.GetClientTime();
// Wargon: Èêîíêà þçà.
// Wargon: Иконка юза.
if (m_pUsageIcon)
{
m_fUsageUpdateTime = curtime;
@ -685,7 +685,7 @@ void CHud2::paint()
//
// draw ammo counters
//
if ( ShouldDrawHUD() ) // Wargon: Èíôîðìàöèÿ î ïàòðîíàõ ðèñóåòñÿ òîëüêî åñëè hud_draw = 1.
if ( ShouldDrawHUD() ) // Wargon: Информация о патронах рисуется только если hud_draw = 1.
{
WEAPON *pw = gHUD.m_Ammo.m_pWeapon; // shorthand
if (gHUD.m_SpecTank_on)

View File

@ -30,7 +30,7 @@ protected:
virtual void paint();
protected:
// Wargon: <EFBFBD>ךמםךא ‏חא.
// Wargon: Иконка юза.
CImageLabel *m_pUsageIcon;
float m_fUsageUpdateTime;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

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"
@ -17,8 +17,8 @@ extern engine_studio_api_t IEngineStudio;
#define WSIZE_X XRES(400);
#define WSIZE_Y YRES(400);
// возвращает 1, если тэг существует, и 0 в случае конца файла
// ptext останавливается на открывающей скобке тэга
// возвращает 1, если тэг существует, и 0 в случае конца файла
// ptext останавливается на открывающей скобке тэга
int FindNextTag(char* &ptext)
{
while (*ptext != '<')
@ -29,7 +29,7 @@ int FindNextTag(char* &ptext)
ptext++;
}
// теперь надо убедиться, что тэг имеет закрывающую скобку
// теперь надо убедиться, что тэг имеет закрывающую скобку
char* hlp = ptext;
while (*hlp != '>')
{
@ -43,10 +43,10 @@ int FindNextTag(char* &ptext)
}
// получает указатель на начало названия тэга, и доходит либо до пробела, либо
// до закрывающей скобки
// размер буфера - 32 символа
// возвращает 1, если у тэга есть параметры, и 0 - если нету
// получает указатель на начало названия тэга, и доходит либо до пробела, либо
// до закрывающей скобки
// размер буфера - 32 символа
// возвращает 1, если у тэга есть параметры, и 0 - если нету
int GetTagName(char* &ptext, char* bufTagName)
{
char* pstart = ptext;
@ -79,40 +79,40 @@ int GetTagName(char* &ptext, char* bufTagName)
}
// получает указатель на место сразу за именем тэга, и возвращает его параметры в буферах
// буферы должны быть размером в 32 байта
// предполагает, что конец файла наступить не должен до закрывающей скобки
// получает указатель на место сразу за именем тэга, и возвращает его параметры в буферах
// буферы должны быть размером в 32 байта
// предполагает, что конец файла наступить не должен до закрывающей скобки
int GetTagParameter(char* &ptext, char* bufParamName, char* bufParamValue)
{
// пропускаем начальные пробелы и переносы
// пропускаем начальные пробелы и переносы
while (*ptext == ' ' || *ptext == '\n')
ptext++;
// начинаем чтение названия параметра
// начинаем чтение названия параметра
char* start = ptext;
while (*ptext != '=')
{
if (*ptext == '>')
{
ptext++;
return 0; // тэг кончился
return 0; // тэг кончился
}
ptext++;
}
int paramNameLength = ptext - start;
if (paramNameLength > 31) paramNameLength = 31; // обрезать по буферу
if (paramNameLength > 31) paramNameLength = 31; // обрезать по буферу
memcpy(bufParamName, start, paramNameLength);
bufParamName[paramNameLength] = 0;
// теперь читаем его значение
ptext++; // перепрыгиваем знак равно
// теперь читаем его значение
ptext++; // перепрыгиваем знак равно
if (*ptext == '\"')
{
// аргумент заключен в кавычки
// аргумент заключен в кавычки
ptext++;
start = ptext;
while (1)
@ -339,7 +339,7 @@ private:
void OrthoQuad(int x1, int y1, int x2, int y2);
//==================================
// CMainPanel - главная панель окна.
// CMainPanel - главная панель окна.
//==================================
class CMainPanel : public Panel, public CRenderable
{
@ -473,7 +473,7 @@ private:
};
//==================================
// CMyButton - кнопка закрытия окна
// CMyButton - кнопка закрытия окна
//==================================
class CMyButton : public Button, public CRenderable
{
@ -569,7 +569,7 @@ private:
//==================================
// CMySlider - ползунок прокрутки в стиле паранойи
// CMySlider - ползунок прокрутки в стиле паранойи
//==================================
class CMySlider : public Slider
{
@ -603,7 +603,7 @@ public:
//==================================
// CMyScrollButton - кнопка прокрутки
// CMyScrollButton - кнопка прокрутки
//==================================
class CMyScrollbutton : public Button
{
@ -656,7 +656,7 @@ public:
//==================================
// CMyScrollPanel - прокручиваемая панель
// CMyScrollPanel - прокручиваемая панель
//==================================
class CMyScrollPanel : public ScrollPanel, public CRenderable
{
@ -1336,7 +1336,7 @@ int CParanoiaTextPanel::KeyInput(int down, int keynum, const char *pszCurrentBin
return 0;
}
// Wargon: Консоль, функциональные клавиши и кнопки мыши пропускаются.
// Wargon: Консоль, функциональные клавиши и кнопки мыши пропускаются.
case 96:
case 126:
case K_F1:
@ -1359,7 +1359,7 @@ int CParanoiaTextPanel::KeyInput(int down, int keynum, const char *pszCurrentBin
return 1;
}
// Wargon: Все остальные клавиши блокируются.
// Wargon: Все остальные клавиши блокируются.
return 0;
}

View File

@ -2,8 +2,8 @@
#define _PARANOIATEXT_H
using namespace vgui;
//#include "..\game_shared\vgui_checkbutton2.h"
#include "..\game_shared\vgui_loadtga.h"
//#include "../game_shared/vgui_checkbutton2.h"
#include "../game_shared/vgui_loadtga.h"
#include "VGUI_ScrollPanel.h"
class CMyScrollPanel;
@ -24,7 +24,7 @@ public:
int KeyInput(int down, int keynum, const char *pszCurrentBinding);
void paint();
void ResetBackground();
// void StateChanged(CCheckButton2 *pButton); // áóäåò èñïîëüçîâàíî äëÿ ïåðåêëþ÷åíèÿ ðåæèìà îòðèñîâêè ìèðà
// void StateChanged(CCheckButton2 *pButton); // будет использовано для переключения режима отрисовки мира
char m_loadedFileName[128];
void Render( void )

View File

@ -8,8 +8,8 @@ using namespace vgui;
#include "vgui_shadowtext.h"
#include "VGUI_TextImage.h"
#include "getfont.h"
Font* FontFromMessage(const 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

@ -11,7 +11,7 @@
#include "cdll_int.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_radio.h"
#include "..\game_shared\vgui_loadtga.h"
#include "../game_shared/vgui_loadtga.h"
#include "getfont.h"
#define RADIO_FADE_TIME 0.25
@ -50,7 +50,7 @@ void CRadioIcon::Initialize()
CRadioIcon::CRadioIcon() : Panel(0, 0, 10, 10)
{
if( m_pSpeakerBitmap = vgui_LoadTGANoInvertAlpha("gfx/vgui/speaker4.tga" ) )
if(( m_pSpeakerBitmap = vgui_LoadTGANoInvertAlpha("gfx/vgui/speaker4.tga" ) ))
m_pSpeakerBitmap->setColor( Color(255,255,255,1) );
else
gEngfuncs.Con_Printf("Cannot load gfx/vgui/speaker4.tga!\n");

View File

@ -7,9 +7,7 @@
using namespace vgui;
#include "vgui_shadowtext.h"
Font* FontFromMessage(const char* &ptext);
#include "getfont.h"
class CScreenMessage : public ShadowTextPanel
{
@ -38,7 +36,7 @@ public:
m_fadein = msg->fadein;
m_fadeout = msg->fadeout;
// Wargon: Если координаты заданы неправильно, то текст просто центрируется.
// Wargon: Если координаты заданы неправильно, то текст просто центрируется.
if (msg->x < 0 || msg->x > 1 || msg->y < 0 || msg->y > 1)
{
// gEngfuncs.Con_Printf("Error: invalid message coordinates!\n");
@ -98,7 +96,7 @@ protected:
float m_fadeout;
};
// Wargon: Код скроллящегося снизу вверх текста. Использован $effect 6.
// Wargon: Код скроллящегося снизу вверх текста. Использован $effect 6.
class CScrollingMessage : public ShadowTextPanel
{
public:

View File

@ -20,7 +20,7 @@ cvar_t *scroll_speed;
cvar_t *fade_speed;
Font* FontFromMessage(const char* &ptext)
Font* FontFromMessage(const 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

@ -11,7 +11,7 @@
#include "cdll_int.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_tabpanel.h"
#include "..\game_shared\vgui_loadtga.h"
#include "../game_shared/vgui_loadtga.h"
#include<VGUI_TextImage.h>
#include<VGUI_LineBorder.h>
#include "getfont.h"

View File

@ -11,7 +11,7 @@
#include "vgui_TeamFortressViewport.h"
#include "vgui_tips.h"
#include "vgui_shadowtext.h"
#include "..\game_shared\vgui_loadtga.h"
#include "../game_shared/vgui_loadtga.h"
#include "getfont.h"
#define TIPS_APPEAR_TIME 0.15
@ -30,9 +30,6 @@ void ShowTip( client_textmessage_t *tempMessage )
gEngfuncs.Con_Printf("Tips error: m_pTips or ViewPort is not constructed!\n");
}
Font* FontFromMessage(const char* &ptext);
void CTips::Initialize()
{
setVisible(false);
@ -196,7 +193,7 @@ void CTips::paintBackground()
// неважно, куда-бы это засунуть..
// неважно, куда-бы это засунуть..
#include "vgui_screenmsg.h"
@ -210,7 +207,7 @@ void VGuiAddScreenMessage( client_textmessage_t *msg )
gEngfuncs.Con_Printf("Screenmessage error: ViewPort is not constructed!\n");
}
// Wargon: Засуну и я это сюда. )
// Wargon: Засуну и я это сюда. )
void VGuiAddScrollingMessage( client_textmessage_t *msg )
{
if (gViewPort && gViewPort->m_pScrollingMsg)

168
cl_dll/wscript Normal file
View File

@ -0,0 +1,168 @@
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018
from waflib import Utils
import os
VGUI_SUPPORTED_OS = ['win32', 'darwin', 'linux']
def options(opt):
grp = opt.add_option_group('VGUI options')
grp.add_option('--vgui', action = 'store', dest = 'VGUI_DEV', default='utils/vgui',
help = 'path to vgui-dev repo [default: %default]')
grp.add_option('--disable-vgui', action = 'store_true', dest = 'NO_VGUI', default = False,
help = 'disable vgui_support [default: %default]')
grp.add_option('--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK', default=False,
help = 'skip checking VGUI sanity [default: %default]' )
return
def configure(conf):
conf.env.NO_VGUI = conf.options.NO_VGUI
if conf.options.NO_VGUI:
return
conf.start_msg('Does this architecture support VGUI?')
if conf.env.DEST_CPU != 'x86' and not (conf.env.DEST_CPU == 'x86_64' and not conf.options.ALLOW64):
conf.end_msg('no')
Logs.warn('vgui is not supported on this CPU: ' + str(conf.env.DEST_CPU))
conf.env.NO_VGUI = True
return
else:
conf.end_msg('yes')
conf.start_msg('Does this OS support VGUI?')
if conf.env.DEST_OS not in VGUI_SUPPORTED_OS:
conf.end_msg('no')
Logs.warn('vgui is not supported on this OS: ' + str(conf.env.DEST_OS))
conf.env.NO_VGUI = True
return
else:
conf.end_msg('yes')
conf.start_msg('Does this toolchain able to link VGUI?')
if conf.env.DEST_OS == 'win32' and conf.env.COMPILER_CXX == 'g++':
conf.end_msg('no')
# we have ABI incompatibility ONLY on MinGW
Logs.warn('vgui_support can\'t be built with MinGW')
conf.env.NO_VGUI = True
return
else:
conf.end_msg('yes')
if conf.env.NO_VGUI:
return
if conf.options.VGUI_DEV:
conf.start_msg('Configuring VGUI by provided path')
conf.env.VGUI_DEV = conf.options.VGUI_DEV
else:
conf.start_msg('Configuring VGUI by default path')
conf.env.VGUI_DEV = 'vgui-dev'
if conf.env.DEST_OS == 'win32':
conf.env.LIB_VGUI = ['vgui']
conf.env.LIBPATH_VGUI = [os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'lib/win32_vc6/'))]
else:
libpath = os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'lib'))
if conf.env.DEST_OS == 'linux':
conf.env.LIB_VGUI = [':vgui.so']
conf.env.LIBPATH_VGUI = [libpath]
elif conf.env.DEST_OS == 'darwin':
conf.env.LDFLAGS_VGUI = [os.path.join(libpath, 'vgui.dylib')]
else:
conf.fatal('vgui is not supported on this OS: ' + conf.env.DEST_OS)
conf.env.INCLUDES_VGUI = [os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'include'))]
conf.env.HAVE_VGUI = 1
conf.end_msg('yes: {0}, {1}, {2}'.format(conf.env.LIB_VGUI, conf.env.LIBPATH_VGUI, conf.env.INCLUDES_VGUI))
if conf.env.HAVE_VGUI and conf.options.VGUI_SANITY_CHECK:
try:
conf.check_cxx(
fragment='''
#include <VGUI.h>
int main( int argc, char **argv )
{
return 0;
}''',
msg = 'Checking for library VGUI sanity',
use = 'VGUI',
execute = False)
except conf.errors.ConfigurationError:
conf.fatal("Can't compile simple program. Check your path to vgui-dev repository.")
if conf.env.DEST_OS != 'win32':
conf.check_cc(lib='dl')
else:
conf.check_cxx(lib='user32')
def build(bld):
source = bld.path.ant_glob([
'render/*.cpp',
'*.cpp'
])
source += bld.path.parent.ant_glob([
'game_shared/bone_setup.cpp',
'game_shared/common.cpp',
'game_shared/ikcontext.cpp',
'game_shared/jigglebones.cpp',
'game_shared/material.cpp',
'game_shared/mathlib.cpp',
'game_shared/matrix.cpp',
'game_shared/procbones.cpp',
'game_shared/stringlib.cpp',
'game_shared/virtualfs.cpp',
'game_shared/vgui_checkbutton2.cpp',
'game_shared/vgui_grid.cpp',
'game_shared/vgui_helpers.cpp',
'game_shared/vgui_listbox.cpp',
'game_shared/vgui_loadtga.cpp',
'game_shared/vgui_scrollbar2.cpp',
'game_shared/vgui_slider2.cpp',
'game_shared/voice_banmgr.cpp',
'game_shared/voice_status.cpp',
'game_shared/voice_vgui_tweakdlg.cpp',
'pm_shared/*.cpp'
])
includes = [
'.',
'render/',
'../dlls',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public'
]
defines = ['CLIENT_DLL']
libs = ['VGUI']
if bld.env.DEST_OS != 'win32':
libs += ['DL']
else:
libs += ["USER32"]
if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR)
else:
install_path = bld.env.PREFIX
bld.shlib(
source = source,
target = 'client' + bld.env.POSTFIX,
name = 'client',
features = 'c cxx',
includes = includes,
defines = defines,
use = libs,
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

View File

@ -35,8 +35,8 @@
typedef struct cvar_s
{
char *name;
char *string;
const char *name;
const char *string;
int flags;
float value;
struct cvar_s *next;

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

Some files were not shown because too many files have changed in this diff Show More