- worked off remaining variableScope and unusedVariable in UI (unless I popped new ones up)

- fixed an issue with atoms

Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
Harry Young 2013-08-13 00:49:39 +02:00
parent 020b75608b
commit ebaa118d4f
10 changed files with 29 additions and 40 deletions

View file

@ -1744,7 +1744,8 @@ void UI_InitRanksData( char* ranksName ) {
refreshRank:
/* using our current cvar'd rank, do a compare. if we find a match, set our player to that rank in the menu */
for ( int i=0, uis.currentRank=0; i < MAX_RANKS; i++ ) {
int i;
for ( i=0, uis.currentRank=0; i < MAX_RANKS; i++ ) {
if ( !Q_stricmp( uis.rankSet.rankNames[i].consoleName, UI_Cvar_VariableString( "ui_playerRank" ) ) ) {
uis.currentRank = i;
break;

View file

@ -1337,7 +1337,7 @@ static void UI_ParseLibraryText()
{
char *token;
char *buffer,*holdPtr;
int i,len;
int len;
memset(libraryText,0,sizeof(libraryText));
@ -1348,7 +1348,6 @@ static void UI_ParseLibraryText()
COM_BeginParseSession();
buffer = LibraryText;
i = 1; // Zero is null string
while ( buffer )
{
token = COM_ParseExt( &buffer, qtrue );

View file

@ -573,10 +573,11 @@ int UI_GetAnim ( int anim, int weapon, qboolean upper )
//1 handed weapon - "phaser"
case WP_5:
case WP_10:
if (upper)
if (upper){
return BOTH_STAND1; //TORSO_WEAPONIDLE1
else
} else {
return BOTH_STAND1;
}
break;
//Generic tools - "everything else"
case WP_4:

View file

@ -355,7 +355,7 @@ void MenuField_Draw( menufield_s *f )
int w;
int style;
qboolean focus;
int color,titleColor;
int color;
menuframework_s *menu;
int offset;
@ -453,6 +453,7 @@ void MenuField_Draw( menufield_s *f )
if ( f->field.titleEnum )
{
int titleColor;
if (f->field.titlecolor)
{
titleColor = f->field.titlecolor;

View file

@ -1552,8 +1552,6 @@ PlayerSettingsMenu_Graphics
*/
void PlayerModelMenu_Graphics (void)
{
int i;
// Draw the basic screen layout
UI_MenuFrame2(&s_playermodel.menu);
@ -1655,6 +1653,7 @@ void PlayerModelMenu_Graphics (void)
//paint the selected model white
{
int i;
for ( i = 0; i < MAX_MENULISTITEMS; i++ )
{
if ( s_playermodel.charMenu[i].textcolor == CT_WHITE && s_playermodel.charMenu[i].textcolor2 == CT_WHITE )

View file

@ -1110,7 +1110,6 @@ static void PlayerModel_MenuInit(int menuFrom)
static char playername[32];
static char modelname[32];
static char skinname[32];
static char skinnameviewed[32];
// zero set all our globals
memset( &s_playermodel, 0 ,sizeof(playermodel_t) );

View file

@ -387,7 +387,6 @@ UI_RunLerpFrame
===============
*/
static void UI_RunLerpFrame( playerInfo_t *ci, lerpFrame_t *lf, int newAnimation ) {
int f;
animation_t *anim;
// see if the animation sequence is switching
@ -413,7 +412,7 @@ static void UI_RunLerpFrame( playerInfo_t *ci, lerpFrame_t *lf, int newAnimation
} else {
lf->frameTime = lf->oldFrameTime + anim->frameLerp;
}
f = ( lf->frameTime - lf->animationTime ) / anim->frameLerp;
int f = ( lf->frameTime - lf->animationTime ) / anim->frameLerp;
if ( f >= anim->numFrames ) {
f -= anim->numFrames;
if ( anim->loopFrames ) {
@ -605,7 +604,6 @@ UI_PlayerAngles
static void UI_PlayerAngles( playerInfo_t *pi, vec3_t legs[3], vec3_t torso[3], vec3_t head[3] ) {
vec3_t legsAngles, torsoAngles, headAngles;
float dest;
float adjust;
VectorCopy( pi->viewAngles, headAngles );
headAngles[YAW] = AngleMod( headAngles[YAW] );
@ -625,10 +623,8 @@ static void UI_PlayerAngles( playerInfo_t *pi, vec3_t legs[3], vec3_t torso[3],
// adjust legs for movement dir
if ( !uis.spinView ) {
//adjust = UI_MovedirAdjustment( pi ); //TiM: Do we really need this?
adjust = 0;
legsAngles[YAW] = headAngles[YAW] + adjust;
torsoAngles[YAW] = headAngles[YAW] + /*0.25 **/ adjust;
legsAngles[YAW] = headAngles[YAW];
torsoAngles[YAW] = headAngles[YAW];
// torso
UI_SwingAngles( torsoAngles[YAW], 25, 90, SWINGSPEED, &pi->torso.yawAngle, &pi->torso.yawing );
@ -736,7 +732,6 @@ void UI_DrawPlayer( float x, float y, float w, float h, vec3_t pOrigin, playerIn
vec3_t maxs = {16, 16, 32};
float len;
float xx;
int anim;
if ( !pi->legsModel || !pi->torsoModel || !pi->headModel || !pi->animations[0].numFrames ) {
return;
@ -813,7 +808,7 @@ void UI_DrawPlayer( float x, float y, float w, float h, vec3_t pOrigin, playerIn
//whup, time to play a random emote
if ( pi->randomEmote && uis.realtime > pi->nextEmoteTime ) {
//randomly pick an anim
anim = irandom( BOTH_STAND1_RANDOM2, BOTH_STAND1_RANDOM11 );
int anim = irandom( BOTH_STAND1_RANDOM2, BOTH_STAND1_RANDOM11 );
//make sure we can play this emote
if ( pi->animations[anim].numFrames > 0 ) {

View file

@ -79,7 +79,6 @@ static void Text_Init( menutext_s *t )
{
int x;
int y;
int w=0,w2,w3;
int h,lines;
char buff[512];
char buff2[512];
@ -98,10 +97,10 @@ static void Text_Init( menutext_s *t )
}
else
{
int w=0,w2=0,w3=0;
// Button text (text can be clicked on)
if (t->buttontextEnum)
{
w = w2 = w3 = 0;
if (menu_button_text[t->buttontextEnum][0])
{
@ -528,9 +527,8 @@ void Bitmap_Draw( menubitmap_s *b )
float h;
vec4_t tempcolor;
float* color;
int colorI;
char highlight;
int textStyle,incY;
int textStyle;
menuframework_s *menu;
textStyle = b->textStyle;
@ -644,6 +642,7 @@ void Bitmap_Draw( menubitmap_s *b )
// If there's text to go on top of the bitmap
if ((b->textEnum) || (b->textPtr))
{
int colorI;
// Bitmap is highlighted, use textcolor2
if (highlight)
{
@ -669,6 +668,7 @@ void Bitmap_Draw( menubitmap_s *b )
// Is there a 2nd line of button text?
if (b->textEnum2)
{
int incY;
if (textStyle & UI_SMALLFONT)
{
incY=PROP_HEIGHT * 1.15;
@ -1267,10 +1267,6 @@ static void SpinControl_Init( menulist_s *s )
}
static sfxHandle_t SpinControl_InitListRender( menulist_s* s ) {
int bestWidth=0;
int i;
int widthOffset;
int heightOffset;
if ( !s->generic.parent->displaySpinList ) {
if ( (s->generic.flags & QMF_HASMOUSEFOCUS) ) { //we clicked on the button, and the list wasn't open lol
@ -1278,7 +1274,10 @@ static sfxHandle_t SpinControl_InitListRender( menulist_s* s ) {
{
//init the data area
memset( &s->drawList, 0, sizeof( drawList_t ) );
int bestWidth=0;
int i;
int widthOffset;
int heightOffset;
//first, find the longest string in the list
for ( i=0; i<s->numitems; i++ ) {
if ( s->listnames ) {
@ -1495,7 +1494,7 @@ SpinControl_Draw
*/
static void SpinControl_Draw( menulist_s *s )
{
int x,y,listX,buttonColor,buttonTextColor;
int x,y,buttonColor,buttonTextColor;
int boxWidth,color;
char text[64];
@ -1549,6 +1548,7 @@ static void SpinControl_Draw( menulist_s *s )
}
else
{
int listX;
// Draw button and button text
trap_R_SetColor( colorTable[buttonColor]);
//if (!s->focusHeight && !s->focusWidth)
@ -2300,16 +2300,12 @@ void Menu_Draw( menuframework_s *menu )
#ifndef NDEBUG
if( uis.debug ) {
int x;
int y;
int w;
int h;
if( !( itemptr->flags & QMF_INACTIVE ) ) {
x = itemptr->left;
y = itemptr->top;
w = itemptr->right - itemptr->left + 1;
h = itemptr->bottom - itemptr->top + 1;
int x = itemptr->left;
int y = itemptr->top;
int w = itemptr->right - itemptr->left + 1;
int h = itemptr->bottom - itemptr->top + 1;
if (itemptr->flags & QMF_HASMOUSEFOCUS) {
UI_DrawRect(x, y, w, h, colorYellow );

View file

@ -21,9 +21,9 @@ void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
}*/
int PASSFLOAT( float x ) {
float floatTemp;
int floatTemp;
floatTemp = x;
return *(int *)&floatTemp;
return floatTemp;
}
void trap_Print( const char *string ) {

View file

@ -121,8 +121,6 @@ M_TacticalMenu_Graphics
*/
static void M_TacticalMenu_Graphics (void) {
menubitmap_s *holdWeapon;
int i,length,xWeaponStart;
int numColor,roundColor;
vec4_t bgColor = { 0.1, 0.1, 0.1, .75 };