* Merge unified-sdl to trunk

* Bump Q3_VERSION to 1.35
This commit is contained in:
Tim Angus 2007-09-05 18:17:46 +00:00
parent 39abffeb3b
commit 672cfbf16f
188 changed files with 5071 additions and 41739 deletions

View file

@ -330,8 +330,6 @@ static int propMapB[26][3] = {
#define PROPB_SPACE_WIDTH 12
#define PROPB_HEIGHT 36
// bk001205 - code below duplicated in cgame/cg_drawtools.c
// bk001205 - FIXME: does this belong in ui_shared.c?
/*
=================
UI_DrawBannerString
@ -340,7 +338,7 @@ UI_DrawBannerString
static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
{
const char* s;
unsigned char ch; // bk001204 - unsigned
unsigned char ch;
float ax;
float ay;
float aw;
@ -450,10 +448,10 @@ int UI_ProportionalStringWidth( const char* str ) {
static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale, qhandle_t charset )
{
const char* s;
unsigned char ch; // bk001204 - unsigned
unsigned char ch;
float ax;
float ay;
float aw = 0; // bk001204 - init
float aw = 0;
float ah;
float frow;
float fcol;
@ -831,7 +829,6 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) {
UI_InGameMenu();
return;
// bk001204
case UIMENU_TEAM:
case UIMENU_POSTGAME:
default:

View file

@ -82,15 +82,6 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" );
downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" );
#if 0 // bk010104
fprintf( stderr, "\n\n-----------------------------------------------\n");
fprintf( stderr, "DB: downloadSize: %16d\n", downloadSize );
fprintf( stderr, "DB: downloadCount: %16d\n", downloadCount );
fprintf( stderr, "DB: downloadTime: %16d\n", downloadTime );
fprintf( stderr, "DB: UI realtime: %16d\n", uis.realtime ); // bk
fprintf( stderr, "DB: UI frametime: %16d\n", uis.frametime ); // bk
#endif
leftWidth = width = UI_ProportionalStringWidth( dlText ) * UI_ProportionalSizeScale( style );
width = UI_ProportionalStringWidth( etaText ) * UI_ProportionalSizeScale( style );
if (width > leftWidth) leftWidth = width;
@ -118,10 +109,6 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
UI_DrawProportionalString( leftWidth, 192,
va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), style, color_white );
} else {
// bk010108
//float elapsedTime = (float)(uis.realtime - downloadTime); // current - start (msecs)
//elapsedTime = elapsedTime * 0.001f; // in seconds
//if ( elapsedTime <= 0.0f ) elapsedTime == 0.0f;
if ( (uis.realtime - downloadTime) / 1000) {
xferRate = downloadCount / ((uis.realtime - downloadTime) / 1000);
//xferRate = (int)( ((float)downloadCount) / elapsedTime);
@ -129,9 +116,6 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
xferRate = 0;
}
//fprintf( stderr, "DB: elapsedTime: %16.8f\n", elapsedTime ); // bk
//fprintf( stderr, "DB: xferRate: %16d\n", xferRate ); // bk
UI_ReadableSize( xferRateBuf, sizeof xferRateBuf, xferRate );
// Extrapolate estimated completion time
@ -141,7 +125,7 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
// We do it in K (/1024) because we'd overflow around 4MB
n = (n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000;
UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, n ); // bk010104
UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, n );
//(n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000);
UI_DrawProportionalString( leftWidth, 160,

View file

@ -223,7 +223,7 @@ typedef struct
static controls_t s_controls;
static vec4_t controls_binding_color = {1.00f, 0.43f, 0.00f, 1.00f}; // bk: Win32 C4305
static vec4_t controls_binding_color = {1.00f, 0.43f, 0.00f, 1.00f};
static bind_t g_bindings[] =
{
@ -561,7 +561,6 @@ static void Controls_Update( void ) {
// disable all controls in all groups
for( i = 0; i < C_MAX; i++ ) {
controls = g_controls[i];
// bk001204 - parentheses
for( j = 0; (control = controls[j]) ; j++ ) {
control->flags |= (QMF_HIDDEN|QMF_INACTIVE);
}
@ -570,14 +569,12 @@ static void Controls_Update( void ) {
controls = g_controls[s_controls.section];
// enable controls in active group (and count number of items for vertical centering)
// bk001204 - parentheses
for( j = 0; (control = controls[j]) ; j++ ) {
control->flags &= ~(QMF_GRAYED|QMF_HIDDEN|QMF_INACTIVE);
}
// position controls
y = ( SCREEN_HEIGHT - j * SMALLCHAR_HEIGHT ) / 2;
// bk001204 - parentheses
for( j = 0; (control = controls[j]) ; j++, y += SMALLCHAR_HEIGHT ) {
control->x = 320;
control->y = y;

View file

@ -811,10 +811,5 @@ void UI_InitGameinfo( void ) {
UI_LoadArenas();
UI_LoadBots();
if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 4) ) {
uis.demoversion = qtrue;
}
else {
uis.demoversion = qfalse;
}
uis.demoversion = qfalse;
}

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_shared.h"
#include "../renderer/tr_types.h"
//NOTE: include the ui_public.h from the new UI
#include "../ui/ui_public.h" // bk001205 - yes, do have to use this
#include "../ui/ui_public.h"
//redefine to old API version
#undef UI_API_VERSION
#define UI_API_VERSION 4
@ -678,7 +678,7 @@ int trap_MemoryRemaining( void );
void trap_GetCDKey( char *buf, int buflen );
void trap_SetCDKey( char *buf );
qboolean trap_VerifyCDKey( const char *key, const char *chksum); // bk001208 - RC4
qboolean trap_VerifyCDKey( const char *key, const char *chksum);
void trap_SetPbClStatus( int status );

View file

@ -79,7 +79,7 @@ intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4,
UI_DrawConnectScreen( arg0 );
return 0;
case UI_HASUNIQUECDKEY: // mod authors need to observe this
return qtrue; // bk010117 - change this to qfalse for mods!
return qtrue; // change this to qfalse for mods!
}
return -1;
@ -156,7 +156,6 @@ vmCvar_t ui_server16;
vmCvar_t ui_cdkeychecked;
// bk001129 - made static to avoid aliasing.
static cvarTable_t cvarTable[] = {
{ &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE },
{ &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE },
@ -216,7 +215,6 @@ static cvarTable_t cvarTable[] = {
{ &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }
};
// bk001129 - made static to avoid aliasing
static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);

View file

@ -106,42 +106,6 @@ static void UI_Mods_ParseInfos( char *modDir, char *modDesc ) {
}
#if 0 // bk001204 - unused
/*
===============
UI_Mods_LoadModsFromFile
===============
*/
static void UI_Mods_LoadModsFromFile( char *filename ) {
int len;
fileHandle_t f;
char buf[1024];
len = trap_FS_FOpenFile( filename, &f, FS_READ );
if ( !f ) {
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
return;
}
if ( len >= sizeof(buf) ) {
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, sizeof(buf) ) );
trap_FS_FCloseFile( f );
return;
}
trap_FS_Read( buf, len, f );
buf[len] = 0;
trap_FS_FCloseFile( f );
len = strlen( filename );
if( !Q_stricmp(filename + len - 4,".mod") ) {
filename[len-4] = '\0';
}
UI_Mods_ParseInfos( filename, buf );
}
#endif
/*
===============
UI_Mods_LoadMods

View file

@ -327,7 +327,6 @@ void Bitmap_Draw( menubitmap_s *b )
if (b->shader)
UI_DrawHandlePic( x, y, w, h, b->shader );
// bk001204 - parentheses
if ( ( (b->generic.flags & QMF_PULSE)
|| (b->generic.flags & QMF_PULSEIFFOCUS) )
&& (Menu_ItemAtCursor( b->generic.parent ) == b))

View file

@ -47,16 +47,6 @@ typedef struct
static teammain_t s_teammain;
// bk001204 - unused
//static menuframework_s s_teammain_menu;
//static menuaction_s s_teammain_orders;
//static menuaction_s s_teammain_voice;
//static menuaction_s s_teammain_joinred;
//static menuaction_s s_teammain_joinblue;
//static menuaction_s s_teammain_joingame;
//static menuaction_s s_teammain_spectate;
/*
===============
TeamMain_MenuEvent

View file

@ -238,13 +238,6 @@ GRAPHICS OPTIONS MENU
#define GRAPHICSOPTIONS_ACCEPT0 "menu/art/accept_0"
#define GRAPHICSOPTIONS_ACCEPT1 "menu/art/accept_1"
static const char *s_drivers[] =
{
OPENGL_DRIVER_NAME,
_3DFX_DRIVER_NAME,
NULL
};
#define ID_BACK2 101
#define ID_FULLSCREEN 102
#define ID_LIST 103
@ -489,24 +482,9 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
trap_Cvar_Set( "r_glDriver", ( char * ) s_drivers[s_graphicsoptions.driver.curvalue] );
switch ( s_graphicsoptions.colordepth.curvalue )
{
case 0:
trap_Cvar_SetValue( "r_colorbits", 0 );
trap_Cvar_SetValue( "r_depthbits", 0 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 1:
trap_Cvar_SetValue( "r_colorbits", 16 );
trap_Cvar_SetValue( "r_depthbits", 16 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
break;
case 2:
trap_Cvar_SetValue( "r_colorbits", 32 );
trap_Cvar_SetValue( "r_depthbits", 24 );
break;
}
trap_Cvar_SetValue( "r_colorbits", 0 );
trap_Cvar_SetValue( "r_depthbits", 0 );
trap_Cvar_SetValue( "r_stencilbits", 0 );
trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );
if ( s_graphicsoptions.geometry.curvalue == 2 )