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 WEAPON *gpActiveSel; // NULL means off, 1 means just the menu bar, otherwise
// this points to the active weapon menu item // 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); 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; m_rgColumnSizes[iSlot] = 1;
gpActiveSel = GetFirstPos( iSlot ); gpActiveSel = GetFirstPos( iSlot );
// Wargon: hud_fastswitch äëÿ íîâîãî HUD'à. // Wargon: hud_fastswitch для нового HUD'а.
if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0)) if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0))
{ {
ServerCmd(gpActiveSel->szName); ServerCmd(gpActiveSel->szName);
@ -642,7 +642,7 @@ void WeaponsResource :: SelectSlot( int iSlot, int fAdvance, int iDirection )
m_iSelectedColumn = iSlot; m_iSelectedColumn = iSlot;
gpActiveSel = GetFirstPos( iSlot ); gpActiveSel = GetFirstPos( iSlot );
// Wargon: hud_fastswitch äëÿ íîâîãî HUD'à. // Wargon: hud_fastswitch для нового HUD'а.
if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0)) if (gpActiveSel && fastSwitch && !(GetNextActivePos(gpActiveSel->iSlot, gpActiveSel->iSlotPos)) && (iSlot != 0))
{ {
ServerCmd(gpActiveSel->szName); 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: // Purpose:
// //

View File

@ -21,7 +21,7 @@
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
#include "netadr.h" #include "netadr.h"
#include "vgui_schememanager.h" #include "vgui_SchemeManager.h"
#include "pm_shared.h" #include "pm_shared.h"
#include "pm_defs.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); typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf);
#include <vector.h> #include <vector.h>
#define EXPORT _declspec( dllexport )
#include "../engine/cdll_int.h" #include "../engine/cdll_int.h"
#include "cdll_dll.h" #include "cdll_dll.h"

View File

@ -17,9 +17,8 @@
// //
#include "cvardef.h" #include "cvardef.h"
#include "port.h"
#define EXPORT _declspec( dllexport ) #include "exportdef.h"
#define DLLEXPORT __declspec( dllexport )
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #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) \ #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 HOOK_COMMAND(x, y) gEngfuncs.pfnAddCommand( x, __CmdFunc_##y );
#define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \ #define DECLARE_COMMAND(y, x) void __CmdFunc_##x( void ) \
{ \ { \
gHUD.##y.UserCmd_##x( ); \ gHUD.y.UserCmd_##x( ); \
} }
#define SPR_Set (*gEngfuncs.pfnSPR_Set) #define SPR_Set (*gEngfuncs.pfnSPR_Set)

View File

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

View File

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

View File

@ -20,7 +20,8 @@ extern cl_enginefunc_t gEngfuncs;
extern render_api_t gRenderfuncs; extern render_api_t gRenderfuncs;
#define GET_CLIENT_TIME (*gEngfuncs.GetClientTime) #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_REGISTER (*gEngfuncs.pfnRegisterVariable)
#define CVAR_GET_FLOAT (*gEngfuncs.pfnGetCvarFloat) #define CVAR_GET_FLOAT (*gEngfuncs.pfnGetCvarFloat)
#define CVAR_GET_STRING (*gEngfuncs.pfnGetCvarString) #define CVAR_GET_STRING (*gEngfuncs.pfnGetCvarString)
@ -77,7 +78,7 @@ extern render_api_t gRenderfuncs;
#define Sys_DoubleTime (*gRenderfuncs.pfnTime) #define Sys_DoubleTime (*gRenderfuncs.pfnTime)
// sound functions (we can't use macroses - this names is collide with standard windows methods) // 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 ); } inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); }
// render api callbacks // 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 ))) #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 ) 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: // Purpose:
// //
@ -22,8 +22,6 @@
#include "gl_local.h" #include "gl_local.h"
#include "gl_studio.h" #include "gl_studio.h"
#define DLLEXPORT __declspec( dllexport )
void Game_AddObjects( void ); void Game_AddObjects( void );
extern vec3_t v_origin; 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: // Purpose:
// //

View File

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

View File

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

View File

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

View File

@ -18,9 +18,9 @@
// implementation of CHudHealth class // implementation of CHudHealth class
// //
#include "STDIO.H" #include "stdio.h"
#include "STDLIB.H" #include "stdlib.h"
#include "MATH.H" #include "math.h"
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
@ -400,7 +400,7 @@ int CHudHealth::DrawPain(float flTime)
int CHudHealth::DrawDamage(float flTime) int CHudHealth::DrawDamage(float flTime)
{ {
int r, g, b, a; int r, g, b, a, i;
DAMAGE_IMAGE *pdmg; DAMAGE_IMAGE *pdmg;
if (!m_bitsDamage) if (!m_bitsDamage)
@ -413,7 +413,7 @@ int CHudHealth::DrawDamage(float flTime)
ScaleColors(r, g, b, a); ScaleColors(r, g, b, a);
// Draw all the items // 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]) if (m_bitsDamage & giDmgFlags[i])
{ {
@ -427,7 +427,7 @@ int CHudHealth::DrawDamage(float flTime)
// check for bits that should be expired // 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]; DAMAGE_IMAGE *pdmg = &m_dmg[i];

View File

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

View File

@ -29,8 +29,12 @@
#define RGB_REDISH 0x00FF1010 //255,160,0 #define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0 #define RGB_GREENISH 0x0000A000 //0,160,0
#include "port.h"
#include "wrect.h" #include "wrect.h"
#ifdef XASH_WIN32
#include "windows.h" #include "windows.h"
#endif
#include "cl_dll.h" #include "cl_dll.h"
#include "render_api.h" #include "render_api.h"
#include "enginecallback.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" #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: // Purpose:
// //

View File

@ -58,7 +58,7 @@ void CHud::Think(void)
m_flDeadTime = gEngfuncs.GetClientTime(); m_flDeadTime = gEngfuncs.GetClientTime();
} }
// Wargon: Исправление бага эффекта grayscale, остававшегося после загрузки из мертвого состояния. // Wargon: Исправление бага эффекта grayscale, остававшегося после загрузки из мертвого состояния.
if (gHUD.m_Health.m_iHealth > 0) if (gHUD.m_Health.m_iHealth > 0)
{ {
m_flDeadTime = 0; m_flDeadTime = 0;
@ -97,7 +97,7 @@ void CHud::Think(void)
if( mod < 30 ) mod = 30; if( mod < 30 ) mod = 30;
if( g_iGunMode == 3 || lastFixedFov == 30 ) if( g_iGunMode == 3 || lastFixedFov == 30 )
mod *= 2; // хаками халфа полнится (c) mod *= 2; // хаками халфа полнится (c)
mod /= 30; mod /= 30;
if( m_flFOV < targetFOV ) 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_fOldTime = m_flTime; // save time of previous redraw
m_flTime = flTime; m_flTime = flTime;
m_flTimeDelta = (double)m_flTime - m_fOldTime; m_flTimeDelta = (double)m_flTime - m_fOldTime;
static m_flShotTime = 0; static int m_flShotTime = 0;
#if 0 #if 0
// g-cont. disabled for users request // g-cont. disabled for users request
@ -258,7 +258,7 @@ int CHud :: Redraw( float flTime, int intermission )
} }
// buz: draw crosshair // 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(( 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( )) 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 ) int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b )
{ {
// find the end of the string // 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? { // 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: // Purpose:
// //
@ -12,7 +12,11 @@
#include "hud_servers.h" #include "hud_servers.h"
#include "net_api.h" #include "net_api.h"
#include <string.h> #include <string.h>
#if XASH_WIN32
#include <winsock.h> #include <winsock.h>
#else
#include <arpa/inet.h>
#endif
static int context_id; static int context_id;
@ -599,7 +603,7 @@ int CompareField( CHudServers::server_t *p1, CHudServers::server_t *p2, const ch
return stricmp( sz1, sz2 ); 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 if (!p1 || !p2) // No meaningful comparison
return 0; return 0;
@ -750,7 +754,7 @@ int CHudServers::LoadMasterAddresses( int maxservers, int *count, netadr_t *padr
char szMaster[ 256 ]; char szMaster[ 256 ];
char szMasterFile[256]; char szMasterFile[256];
char *pbuffer = NULL; char *pbuffer = NULL;
char *pstart = NULL ; const char *pstart = NULL ;
netadr_t adr; netadr_t adr;
char szAdr[64]; char szAdr[64];
int nPort; 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: // Purpose:
// //

View File

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

View File

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

View File

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

View File

@ -1,9 +1,10 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
// //
// Purpose: // Purpose:
// //
// $NoKeywords: $ // $NoKeywords: $
//============================================================================= //=============================================================================
// TODO: import hlsdk-xash3d input
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
@ -15,7 +16,9 @@
#include "camera.h" #include "camera.h"
#include "in_defs.h" #include "in_defs.h"
#include "gl_local.h" #include "gl_local.h"
#if XASH_WIN32
#include "windows.h" #include "windows.h"
#endif
float CL_KeyState (kbutton_t *key); float CL_KeyState (kbutton_t *key);
@ -88,6 +91,10 @@ void CAM_ToFirstPerson(void);
void CAM_StartDistance(void); void CAM_StartDistance(void);
void CAM_EndDistance(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 //-------------------------------------------------- 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: // Purpose:
// //
@ -16,7 +16,7 @@
// fall over // fall over
#define ROLL 2 #define ROLL 2
#define DLLEXPORT __declspec( dllexport ) #include <exportdef.h>
void V_StartPitchDrift( void ); void V_StartPitchDrift( void );
void V_StopPitchDrift( 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: // Purpose:
// //
@ -22,7 +22,7 @@
#include "in_defs.h" #include "in_defs.h"
#include <string.h> #include <string.h>
#include <mathlib.h> #include <mathlib.h>
#include <ctype.h>
#include "vgui_TeamFortressViewport.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) else if (viewangles[PITCH] < -gHUD.m_SpecTank_coneVer)
viewangles[PITCH] = -gHUD.m_SpecTank_coneVer; viewangles[PITCH] = -gHUD.m_SpecTank_coneVer;
// âñåì ñïàñèáî, âñå ñâîáîäíû // всем спасибо, все свободны
gEngfuncs.SetViewAngles( (float *)viewangles ); 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: // Purpose:
// //
@ -7,6 +7,8 @@
// in_win.c -- windows 95 mouse and joystick code // in_win.c -- windows 95 mouse and joystick code
// 02/21/97 JCB Added extended DirectInput code to support external controllers. // 02/21/97 JCB Added extended DirectInput code to support external controllers.
/// TODO: import hlsdk-xash3d input interface
#if 0
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
@ -961,3 +963,5 @@ void IN_Init (void)
IN_StartupMouse (); IN_StartupMouse ();
IN_StartupJoystick (); 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: // Purpose:
// //

View File

@ -84,7 +84,8 @@ int CHudMenu :: Draw( float flTime )
// count the number of newlines // count the number of newlines
int nlc = 0; 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' ) if ( g_szMenuString[i] == '\n' )
nlc++; nlc++;

View File

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

View File

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

View File

@ -929,7 +929,9 @@ void CParticleSystem :: DrawSystem( void )
{ {
if( pParticle->m_fSize <= 0 || !ParticleIsVisible( pParticle )) if( pParticle->m_fSize <= 0 || !ParticleIsVisible( pParticle ))
continue; 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; 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; 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; point[3] = origin + up * -fSinSize + right * fCosSize;
ClearBounds( absmin, absmax ); ClearBounds( absmin, absmax );
for( int i = 0; i < 4; i++ ) int i;
for( i = 0; i < 4; i++ )
AddPointToBounds( point[i], absmin, absmax ); AddPointToBounds( point[i], absmin, absmax );
int iContents = CONTENTS_NONE; 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 ) if( pDraw->pType->m_iDrawCond == CONTENTS_SPOTLIGHT )
{ {
int i;
if( !m_fHasProjectionLighting ) if( !m_fHasProjectionLighting )
continue; // fast reject continue; // fast reject
for( int i = 0; i < MAX_DLIGHTS; i++ ) for( i = 0; i < MAX_DLIGHTS; i++ )
{ {
CDynLight *pl = &tr.dlights[i]; CDynLight *pl = &tr.dlights[i];

View File

@ -152,7 +152,7 @@ public:
// MUST CHECK WHETHER THIS RESULT IS NULL! // MUST CHECK WHETHER THIS RESULT IS NULL!
// returns false if the particle has died // returns false if the particle has died
bool UpdateParticle( CParticle *part, float frametime ); 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 // Utility functions that have to be public
bool ParticleIsVisible( CParticle* part ); 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. GNU General Public License for more details.
*/ */
#include <stdarg.h>
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
#include "const.h" #include "const.h"

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ GNU General Public License for more details.
*/ */
#define EXTERN #define EXTERN
#include "gl_export.h"
#include "hud.h" #include "hud.h"
#include "cl_util.h" #include "cl_util.h"
#include "gl_local.h" #include "gl_local.h"
@ -355,7 +355,7 @@ DebugCallback
For ARB_debug_output 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]; static char string[8192];
char *msg; char *msg;
@ -502,10 +502,10 @@ static void GL_InitExtensions( void )
} }
// get our various GL strings // get our various GL strings
glConfig.vendor_string = pglGetString( GL_VENDOR ); glConfig.vendor_string = (const char*)pglGetString( GL_VENDOR );
glConfig.renderer_string = pglGetString( GL_RENDERER ); glConfig.renderer_string = (const char*)pglGetString( GL_RENDERER );
glConfig.version_string = pglGetString( GL_VERSION ); glConfig.version_string = (const char*)pglGetString( GL_VERSION );
glConfig.extensions_string = pglGetString( GL_EXTENSIONS ); glConfig.extensions_string = (const char*)pglGetString( GL_EXTENSIONS );
if( Q_stristr( glConfig.renderer_string, "geforce" )) if( Q_stristr( glConfig.renderer_string, "geforce" ))
glConfig.hardware_type = GLHW_NVIDIA; glConfig.hardware_type = GLHW_NVIDIA;

View File

@ -16,8 +16,9 @@ GNU General Public License for more details.
#ifndef GL_EXPORT_H #ifndef GL_EXPORT_H
#define 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 #ifndef APIENTRY
#define APIENTRY #define APIENTRY
#endif #endif
@ -1350,7 +1351,7 @@ EXTERN void ( APIENTRY *pglGetFinalCombinerInputParameterfvNV )( GLenum, GLenum,
EXTERN void ( APIENTRY *pglGetFinalCombinerInputParameterivNV )( GLenum, GLenum, GLint * ); EXTERN void ( APIENTRY *pglGetFinalCombinerInputParameterivNV )( GLenum, GLenum, GLint * );
EXTERN void ( APIENTRY *pglGenerateMipmap )( GLenum target ); EXTERN void ( APIENTRY *pglGenerateMipmap )( GLenum target );
EXTERN void ( APIENTRY *pglDrawBuffersARB)( GLsizei n, const GLenum *bufs ); 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 *pglBindVertexArray )( GLuint array );
EXTERN void ( APIENTRY *pglDeleteVertexArrays )( GLsizei n, const GLuint *arrays ); 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 ) 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 )) if( !Q_stricmp( grasstexs[i].name, name ))
return i; // found return i; // found

View File

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

View File

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

View File

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

View File

@ -509,7 +509,8 @@ bool CQuakePartSystem :: ParseRandomVector( char *&pfile, RandomRange out[3] )
{ {
char token[256]; 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 ); pfile = COM_ParseLine( pfile, token );
out[i] = RandomRange( token ); out[i] = RandomRange( token );
@ -904,7 +905,8 @@ void CQuakePartSystem :: ExplosionParticles( const Vector &pos )
flags = (FPART_STRETCH|FPART_BOUNCE|FPART_FRICTION); 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.x = pos.x + RANDOM_LONG( -16, 16 );
src.m_vecOrigin.y = pos.y + 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 // sparks
int flags = (FPART_STRETCH|FPART_BOUNCE|FPART_FRICTION|FPART_ADDITIVE); 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.x = org[0] + dir[0] * 2 + RANDOM_FLOAT( -1, 1 );
src.m_vecOrigin.y = org[1] + dir[1] * 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); return (word)(prog - glsl_programs);
} }
int i;
// find free spot // 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] ) if( !glsl_programs[i].name[0] )
break; break;
@ -1188,8 +1189,9 @@ word GL_FindShader( const char *glname, const char *vpname, const char *fpname,
return (word)(prog - glsl_programs); return (word)(prog - glsl_programs);
} }
int i;
// find free spot // 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] ) if( !glsl_programs[i].name[0] )
break; break;

View File

@ -144,7 +144,9 @@ static int R_ComputeCropBounds( const matrix4x4 &lightViewProjection, Vector bou
frustum.DisablePlane( FRUSTUM_NEAR ); frustum.DisablePlane( FRUSTUM_NEAR );
frustum.DisablePlane( FRUSTUM_FAR ); 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]; CSolidEntry *entry = &prevRI->frame.solid_faces[i];
@ -194,7 +196,7 @@ static int R_ComputeCropBounds( const matrix4x4 &lightViewProjection, Vector bou
} }
// add studio models too // 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 )) if( !R_StudioGetBounds( &prevRI->frame.solid_meshes[i], worldBounds ))
continue; 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 // are positive, so we don't have to worry about division by zero
float targettime = m_clTime - ((int)( m_clTime / fullinterval )) * fullinterval; 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 ) if( pintervals[i] > targettime )
break; break;

View File

@ -646,7 +646,7 @@ StudioInterpolateControllers
*/ */
void CStudioModelRenderer :: StudioInterpolateControllers( cl_entity_t *e, float dadt ) void CStudioModelRenderer :: StudioInterpolateControllers( cl_entity_t *e, float dadt )
{ {
// buz: õàê, ïîçâîëÿþùèé íå èíòåðïîëèðîâàòü êîíòðîëëåðû äëÿ ñòàöèîíàðíîãî ïóëåìåòà // buz: хак, позволяющий не интерполировать контроллеры для стационарного пулемета
if( RI->currententity->curstate.renderfx == 51 ) if( RI->currententity->curstate.renderfx == 51 )
dadt = 1.0f; 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 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 )) 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; m_pModelInstance->light_update = false;
// init state if was not in frustum // 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; m_pModelInstance->oldlight = m_pModelInstance->newlight;
} }
@ -2849,7 +2851,9 @@ void CStudioModelRenderer :: RenderDeferredStudioList( void )
RI->currentmodel = NULL; RI->currentmodel = NULL;
m_pCurrentMaterial = 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]; CSolidEntry *entry = &RI->frame.solid_meshes[i];
@ -3731,7 +3735,9 @@ void CStudioModelRenderer :: RenderSolidStudioList( void )
RI->currentmodel = NULL; RI->currentmodel = NULL;
m_pCurrentMaterial = 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]; CSolidEntry *entry = &RI->frame.solid_meshes[i];

View File

@ -1216,7 +1216,7 @@ void CStudioModelRenderer :: SetupSubmodelVerts( const mstudiomodel_t *pSubModel
smooth_tbn = true; smooth_tbn = true;
// first create trifan array from studiomodel mesh // first create trifan array from studiomodel mesh
while( count = *( ptricmds++ )) while(( count = *( ptricmds++ )))
{ {
bool strip = ( count < 0 ) ? false : true; bool strip = ( count < 0 ) ? false : true;
int vertexState = 0; int vertexState = 0;
@ -1541,8 +1541,9 @@ void CStudioModelRenderer :: SetupSubmodelVerts( const mstudiomodel_t *pSubModel
// search for submodel offset // search for submodel offset
int offset = (byte *)pSubModel - (byte *)m_pStudioHeader; 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 ) if( m_tbnverts->submodels[j].submodel_offset == offset )
break; break;

View File

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

View File

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

View File

@ -146,7 +146,7 @@ check cubemap sides for valid
*/ */
static bool Mod_CheckCubemap( const char *name ) 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; int valid_sides = 0;
char sidename[64]; char sidename[64];
int iCompare; int iCompare;
@ -175,7 +175,7 @@ remove cubemap images from HDD
*/ */
static void Mod_DeleteCubemap( const char *name ) 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]; char sidename[64];
for( int i = 0; i < 6; i++ ) 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 // now all the cubemaps are recreated, so we can starts to upload them
if( world->loading_cubemaps ) if( world->loading_cubemaps )
{ {
int i;
Mod_LoadCubemap( &world->defaultCubemap ); 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]; mcubemap_t *cm = &world->cubemaps[i];
Vector vecStart, vecEnd; Vector vecStart, vecEnd;
@ -327,7 +328,7 @@ void GL_LoadAndRebuildCubemaps( int refParams )
// bind cubemaps onto world surfaces // bind cubemaps onto world surfaces
// so we don't need to search them again // 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]; msurface_t *surf = &worldmodel->surfaces[i];
mextrasurf_t *es = surf->info; mextrasurf_t *es = surf->info;
@ -404,7 +405,7 @@ static void Mod_LoadCubemaps( const byte *base, const dlump_t *l )
cm->size = 4; 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 // build a cubemap name like enum
Q_snprintf( out->name, sizeof( out->name ), "maps/env/%s/cube#%i", world->name, i ); 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 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; msurface_t *surf1, *surf2;
surf1 = &worldmodel->surfaces[(unsigned short)*a]; surf1 = &worldmodel->surfaces[*a];
surf2 = &worldmodel->surfaces[(unsigned short)*b]; surf2 = &worldmodel->surfaces[*b];
if( FBitSet( surf1->flags, SURF_DRAWSKY ) && !FBitSet( surf2->flags, SURF_DRAWSKY )) if( FBitSet( surf1->flags, SURF_DRAWSKY ) && !FBitSet( surf2->flags, SURF_DRAWSKY ))
return -1; return -1;
@ -1001,13 +1002,13 @@ Mod_SurfaceCompareInGame
sort faces to reduce shader switches 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; msurface_t *surf1, *surf2;
mextrasurf_t *esrf1, *esrf2; mextrasurf_t *esrf1, *esrf2;
surf1 = &worldmodel->surfaces[(unsigned short)*a]; surf1 = &worldmodel->surfaces[*a];
surf2 = &worldmodel->surfaces[(unsigned short)*b]; surf2 = &worldmodel->surfaces[*b];
esrf1 = surf1->info; esrf1 = surf1->info;
esrf2 = surf2->info; esrf2 = surf2->info;

View File

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

View File

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

View File

@ -174,7 +174,8 @@ void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIn
} }
// find an empty string slot // 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] ) if ( ! *g_szLineBuffer[i] )
break; 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 ) 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 // 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 ) ) if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) )
break; break;
@ -155,7 +156,7 @@ void CHudStatusIcons::DisableIcon( char *pszIconName )
if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) ) if ( !stricmp( m_IconList[i].szSpriteName, pszIconName ) )
{ {
// clear the item from the list // 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; return;
} }
} }

View File

@ -18,9 +18,10 @@
// implementation of class-less helper functions // implementation of class-less helper functions
// //
#include "STDIO.H" #include <stdio.h>
#include "STDLIB.H" #include <stdlib.h>
#include "MATH.H" #include <math.h>
#include <stdarg.h>
#include "hud.h" #include "hud.h"
#include "cl_util.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 char buffer[2048]; // must support > 1k messages
va_list args; 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: // Purpose:
// //

View File

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

View File

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

View File

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

View File

@ -32,7 +32,7 @@
#include "vgui_int.h" #include "vgui_int.h"
#include "vgui_TeamFortressViewport.h" #include "vgui_TeamFortressViewport.h"
#include "vgui_ServerBrowser.h" #include "vgui_ServerBrowser.h"
#include "..\game_shared\vgui_LoadTGA.h" #include "../game_shared/vgui_loadtga.h"
// Arrow filenames // Arrow filenames
char *sArrowFilenames[] = 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: // Purpose:
// //

View File

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

View File

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

View File

@ -1,4 +1,4 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
// //
// Purpose: // Purpose:
// //
@ -17,7 +17,7 @@
#include "pm_shared.h" #include "pm_shared.h"
#include "vgui_TeamFortressViewport.h" #include "vgui_TeamFortressViewport.h"
#include "vgui_SpectatorPanel.h" #include "vgui_SpectatorPanel.h"
#include "vgui_scorepanel.h" #include "vgui_ScorePanel.h"
#define PANEL_HEIGHT 32 #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: // Purpose:
// //

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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