Skip to content
Browse files

widget: Remove CurrentStatsTemplate.

  • Loading branch information...
1 parent 2521e71 commit a6371405372731a6e1da2d2b83e3e775b0de5ebe @Cyp Cyp committed
Showing with 7 additions and 25 deletions.
  1. +7 −10 src/design.cpp
  2. +0 −4 src/hci.cpp
  3. +0 −9 src/intdisplay.cpp
  4. +0 −2 src/intdisplay.h
View
17 src/design.cpp
@@ -343,7 +343,8 @@ static UDWORD desCompID;
static UDWORD droidTemplID;
/* The current design being edited on the design screen */
-DROID_TEMPLATE sCurrDesign;
+static DROID_TEMPLATE sCurrDesign;
+static bool haveCurrentDesign = false;
static void intDisplayStatForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);
static void intDisplayViewForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);
@@ -400,7 +401,7 @@ static bool _intAddDesign(bool bShowCentreScreen)
return false;
}
- CurrentStatsTemplate = NULL;
+ haveCurrentDesign = false;
/* Initialise the current design */
sCurrDesign = sDefaultDesignTemplate;
@@ -2971,7 +2972,7 @@ static void desCreateDefaultTemplate(void)
intSetDesignStats(&sCurrDesign);
widgDelete(psWScreen, IDDES_SYSTEMFORM);
desSysMode = IDES_NOSYSTEM;
- CurrentStatsTemplate = (BASE_STATS *) &sCurrDesign;
+ haveCurrentDesign = true;
}
/* Remove the design widgets from the widget screen */
@@ -3955,7 +3956,7 @@ static void intDisplayViewForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
RenderWindowFrame(FRAME_NORMAL, x0, y0, x1 - x0, y1 - y0);
- if (CurrentStatsTemplate)
+ if (haveCurrentDesign)
{
pie_SetGeometricOffset((DES_CENTERFORMX + DES_3DVIEWX) + (DES_3DVIEWWIDTH / 2),
(DES_CENTERFORMY + DES_3DVIEWY) + (DES_3DVIEWHEIGHT / 4) + 32);
@@ -3973,13 +3974,12 @@ static void intDisplayViewForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
Position.y = -100;
Position.z = BUTTON_DEPTH;
- templateRadius = (SWORD)(getComponentDroidTemplateRadius((DROID_TEMPLATE *)
- CurrentStatsTemplate));
+ templateRadius = getComponentDroidTemplateRadius(&sCurrDesign);
//scale the object around the OBJECT_RADIUS so that half size objects are draw are draw 75% the size of normal objects
falseScale = (DESIGN_DROID_SCALE * OBJECT_RADIUS) / templateRadius;
//display large droid view in the design screen
- displayComponentButtonTemplate((DROID_TEMPLATE *)&sCurrDesign, &Rotation, &Position, true, falseScale);
+ displayComponentButtonTemplate(&sCurrDesign, &Rotation, &Position, true, falseScale);
}
}
@@ -3992,10 +3992,7 @@ void intDisplayTemplateButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
static void intDisplayComponentButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
{
- BASE_STATS *OldCurStatsTemplate = CurrentStatsTemplate;
-
intDisplayStatsButton(psWidget, xOffset, yOffset);
- CurrentStatsTemplate = OldCurStatsTemplate;
}
/* General display window for the design form SOLID BACKGROUND - NOT TRANSPARENT*/
View
4 src/hci.cpp
@@ -310,10 +310,6 @@ COMPONENT_STATS **apsExtraSysList;
// store the objects that are being used for the object bar
std::vector<BASE_OBJECT *> apsObjectList;
-
-/* The current design being edited on the design screen */
-extern DROID_TEMPLATE sCurrDesign;
-
/* Flags to check whether the power bars are currently on the screen */
static bool powerBarUp = false;
static bool StatsUp = false;
View
9 src/intdisplay.cpp
@@ -93,8 +93,6 @@ static int FormCloseAudioID; // ID of sfx to play when form closes.
static int FormOpenCount; // Count used to ensure only one sfx played when two forms opening.
static int FormCloseCount; // Count used to ensure only one sfx played when two forms closeing.
-BASE_STATS *CurrentStatsTemplate = NULL;
-
#define DEFAULT_BUTTON_ROTATION (45)
static UDWORD ManuPower = 0; // Power required to manufacture the current item.
@@ -1022,19 +1020,12 @@ void intDisplayStatsButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
}
}
}
-
- if (Down)
- {
- CurrentStatsTemplate = Stat;
- }
-
}
else
{
IMDType = IMDTYPE_COMPONENT;
//BLANK button for now - AB 9/1/98
Object = NULL;
- CurrentStatsTemplate = NULL;
}
View
2 src/intdisplay.h
@@ -75,8 +75,6 @@ extern RENDERED_BUTTON ObjectBuffers[NUM_OBJECTBUFFERS];
extern RENDERED_BUTTON StatBuffers[NUM_STATBUFFERS];
extern RENDERED_BUTTON System0Buffers[NUM_SYSTEM0BUFFERS];
-extern BASE_STATS *CurrentStatsTemplate;
-
// Set audio IDs for form opening/closing anims.
void SetFormAudioIDs(int OpenID,int CloseID);

0 comments on commit a637140

Please sign in to comment.
Something went wrong with that request. Please try again.