Skip to content

Commit

Permalink
renamed _UI define to UI_BUILD
Browse files Browse the repository at this point in the history
Identifiers starting with _ and an uppercase letter are prohibited; in particular this clashes with the Mac STL
  • Loading branch information
mrwonko committed Nov 5, 2015
1 parent 6a60c0b commit 40023bf
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions codemp/game/bg_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif defined(_CGAME)
#include "cgame/cg_local.h"
#elif defined(_UI)
#elif defined(UI_BUILD)
#include "ui/ui_local.h"
#endif

Expand Down Expand Up @@ -331,7 +331,7 @@ qboolean BG_FileExists(const char *fileName)
trap->FS_Open(fileName, &fh, FS_READ);
#elif _CGAME
trap->FS_Open(fileName, &fh, FS_READ);
#elif _UI
#elif UI_BUILD
trap->FS_Open(fileName, &fh, FS_READ);
#endif
if (fh > 0)
Expand All @@ -340,7 +340,7 @@ qboolean BG_FileExists(const char *fileName)
trap->FS_Close(fh);
#elif _CGAME
trap->FS_Close(fh);
#elif _UI
#elif UI_BUILD
trap->FS_Close(fh);
#endif
return qtrue;
Expand Down Expand Up @@ -3092,7 +3092,7 @@ int BG_ModelCache(const char *modelName, const char *skinName)
#define MAX_POOL_SIZE 3000000 //1024000
#elif defined(_CGAME) //don't need as much for cgame stuff. 2mb will be fine.
#define MAX_POOL_SIZE 2048000
#elif defined(_UI) //And for the ui the only thing we'll be using this for anyway is allocating anim data for g2 menu models
#elif defined(UI_BUILD) //And for the ui the only thing we'll be using this for anyway is allocating anim data for g2 menu models
#define MAX_POOL_SIZE 512000
#endif

Expand Down
2 changes: 1 addition & 1 deletion codemp/game/bg_panimate.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion codemp/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down
8 changes: 4 additions & 4 deletions codemp/game/bg_saberLoad.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand All @@ -41,7 +41,7 @@ extern stringID_table_t animTable[MAX_ANIMATIONS+1];
int BG_SoundIndex( const char *sound ) {
#ifdef _GAME
return G_SoundIndex( sound );
#elif defined(_CGAME) || defined(_UI)
#elif defined(_CGAME) || defined(UI_BUILD)
return trap->S_RegisterSound( sound );
#endif
}
Expand Down Expand Up @@ -2287,7 +2287,7 @@ void WP_SaberLoadParms( void )
}

if ( (totallen + len+1) >= MAX_SABER_DATA_SIZE ) {
#ifdef _UI
#ifdef UI_BUILD
Com_Error( ERR_FATAL, "WP_SaberLoadParms: Saber extensions (*.sab) are too large!\nRan out of space before reading %s", holdChar );
#else
Com_Error( ERR_DROP, "WP_SaberLoadParms: Saber extensions (*.sab) are too large!\nRan out of space before reading %s", holdChar );
Expand All @@ -2312,7 +2312,7 @@ void WP_SaberLoadParms( void )
}
}

#ifdef _UI
#ifdef UI_BUILD
qboolean WP_IsSaberTwoHanded( const char *saberName )
{
int twoHanded;
Expand Down
6 changes: 3 additions & 3 deletions codemp/game/bg_saga.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down Expand Up @@ -997,7 +997,7 @@ void BG_SiegeParseClassFile(const char *filename, siegeClassDesc_t *descBuffer)
#elif defined(_CGAME)
bgSiegeClasses[bgNumSiegeClasses].uiPortraitShader = 0;
memset(bgSiegeClasses[bgNumSiegeClasses].uiPortrait,0,sizeof(bgSiegeClasses[bgNumSiegeClasses].uiPortrait));
#elif defined(_UI) //ui
#elif defined(UI_BUILD) //ui
bgSiegeClasses[bgNumSiegeClasses].uiPortraitShader = trap->R_RegisterShaderNoMip(parseBuf);
memcpy(bgSiegeClasses[bgNumSiegeClasses].uiPortrait,parseBuf,sizeof(bgSiegeClasses[bgNumSiegeClasses].uiPortrait));
#endif
Expand All @@ -1015,7 +1015,7 @@ void BG_SiegeParseClassFile(const char *filename, siegeClassDesc_t *descBuffer)
#else //cgame, ui
#if defined(_CGAME)
bgSiegeClasses[bgNumSiegeClasses].classShader = trap->R_RegisterShaderNoMip(parseBuf);
#elif defined(_UI)
#elif defined(UI_BUILD)
bgSiegeClasses[bgNumSiegeClasses].classShader = trap->R_RegisterShaderNoMip(parseBuf);
#endif
assert( bgSiegeClasses[bgNumSiegeClasses].classShader );
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/bg_slidemove.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down
12 changes: 6 additions & 6 deletions codemp/game/bg_vehicleLoad.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#elif _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down Expand Up @@ -227,14 +227,14 @@ static qboolean BG_ParseVehWeaponParm( vehWeaponInfo_t *vehWeapon, const char *p
#endif
break;
case VF_SHADER: // (cgame only) take the string, call trap_R_RegisterShader
#ifdef _UI
#ifdef UI_BUILD
*(int *)(b+vehWeaponField->ofs) = trap->R_RegisterShaderNoMip( value );
#elif CGAME
*(int *)(b+vehWeaponField->ofs) = trap->R_RegisterShader( value );
#endif
break;
case VF_SHADER_NOMIP:// (cgame only) take the string, call trap_R_RegisterShaderNoMip
#if defined(_CGAME) || defined(_UI)
#if defined(_CGAME) || defined(UI_BUILD)
*(int *)(b+vehWeaponField->ofs) = trap->R_RegisterShaderNoMip( value );
#endif
break;
Expand Down Expand Up @@ -874,14 +874,14 @@ static qboolean BG_ParseVehicleParm( vehicleInfo_t *vehicle, const char *parmNam
#endif
break;
case VF_SHADER: // (cgame only) take the string, call trap_R_RegisterShader
#ifdef _UI
#ifdef UI_BUILD
*(int *)(b+vehField->ofs) = trap->R_RegisterShaderNoMip( value );
#elif _CGAME
*(int *)(b+vehField->ofs) = trap->R_RegisterShader( value );
#endif
break;
case VF_SHADER_NOMIP:// (cgame only) take the string, call trap_R_RegisterShaderNoMip
#if defined(_CGAME) || defined(_UI)
#if defined(_CGAME) || defined(UI_BUILD)
*(int *)(b+vehField->ofs) = trap->R_RegisterShaderNoMip( value );
#endif
break;
Expand Down Expand Up @@ -1189,7 +1189,7 @@ int VEH_LoadVehicle( const char *vehicleName )
#endif
}

#if defined(_CGAME) || defined(_UI)
#if defined(_CGAME) || defined(UI_BUILD)
if ( VALIDSTRING( vehicle->skin ) )
trap->R_RegisterSkin( va( "models/players/%s/model_%s.skin", vehicle->model, vehicle->skin) );
#endif
Expand Down
2 changes: 1 addition & 1 deletion codemp/qcommon/q_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ qboolean Info_Validate( const char *s );
qboolean Info_NextPair( const char **s, char *key, char *value );

// this is only here so the functions in q_shared.c and bg_*.c can link
#if defined( _GAME ) || defined( _CGAME ) || defined( _UI )
#if defined( _GAME ) || defined( _CGAME ) || defined( UI_BUILD )
void (*Com_Error)( int level, const char *error, ... );
void (*Com_Printf)( const char *msg, ... );
#else
Expand Down
2 changes: 1 addition & 1 deletion codemp/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(MPUIIncludeDirectories
if(WIN32)
set(MPUILibraries "odbc32" "odbccp32") # what are these even?
endif(WIN32)
set(MPUIDefines ${MPSharedDefines} "_UI")
set(MPUIDefines ${MPSharedDefines} "UI_BUILD")

set(MPUIGameFiles
"${MPDir}/game/bg_misc.c"
Expand Down
18 changes: 9 additions & 9 deletions codemp/ui/ui_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.

#ifdef _CGAME
#include "cgame/cg_local.h"
#elif _UI
#elif UI_BUILD
#include "ui/ui_local.h"
#endif

Expand Down Expand Up @@ -75,7 +75,7 @@ typedef struct scrollInfo_s {
qboolean scrollDir;
} scrollInfo_t;

#ifdef _UI // Defined in ui_main.c, not in the namespace
#ifdef UI_BUILD // Defined in ui_main.c, not in the namespace
// Some extern functions hoisted from the middle of this file to get all the non-cgame,
// non-namespace stuff together
extern void UI_SaberDrawBlades( itemDef_t *item, vec3_t origin, vec3_t angles );
Expand Down Expand Up @@ -3448,7 +3448,7 @@ void Leaving_EditField(itemDef_t *item)
}
}

#ifdef _UI
#ifdef UI_BUILD
qboolean Item_TextField_HandleKey( itemDef_t *item, int key );
void Item_TextField_Paste( itemDef_t *item ) {
int pasteLen, i;
Expand Down Expand Up @@ -3485,7 +3485,7 @@ qboolean Item_TextField_HandleKey(itemDef_t *item, int key) {
if ( key & K_CHAR_FLAG ) {
key &= ~K_CHAR_FLAG;

#ifdef _UI
#ifdef UI_BUILD
if ( key == 'v' - 'a' + 1 ) { // ctrl-v is paste
Item_TextField_Paste( item );
return qtrue;
Expand Down Expand Up @@ -5264,7 +5264,7 @@ void Item_Model_Paint(itemDef_t *item)
}

// a moves datapad anim is playing
#ifdef _UI
#ifdef UI_BUILD
if (uiInfo.moveAnimTime && (uiInfo.moveAnimTime < uiInfo.uiDC.realTime))
{
if (modelPtr)
Expand Down Expand Up @@ -7084,7 +7084,7 @@ ItemParse_asset_model
*/
qboolean ItemParse_asset_model_go( itemDef_t *item, const char *name,int *runTimeLength )
{
#ifdef _UI
#ifdef UI_BUILD
int g2Model;
modelDef_t *modelPtr;
Item_ValidateTypeData(item);
Expand Down Expand Up @@ -7184,7 +7184,7 @@ qboolean ItemParse_asset_model( itemDef_t *item, int handle ) {
return qfalse;
}

#ifdef _UI
#ifdef UI_BUILD
if (!Q_stricmp(token.string,"ui_char_model") )
{
char modelPath[MAX_QPATH] = {0};
Expand Down Expand Up @@ -8066,7 +8066,7 @@ qboolean ItemParse_cvarFloat( itemDef_t *item, int handle ) {
return qfalse;
}

#ifdef _UI
#ifdef UI_BUILD
char currLanguage[32][128];
static const char languageString[32] = "@MENUS_MYLANGUAGE";
#endif
Expand Down Expand Up @@ -8104,7 +8104,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) {
// languages
if (!Q_stricmp(token.string,"feeder") && item->special == FEEDER_LANGUAGES)
{
#ifdef _UI
#ifdef UI_BUILD
for (; multiPtr->count < uiInfo.languageCount; multiPtr->count++)
{
// The displayed text
Expand Down

0 comments on commit 40023bf

Please sign in to comment.