Cleanups, comments.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2858 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-09-22 19:55:47 +00:00
parent dd6baea996
commit 35f2a40d9c
5 changed files with 22 additions and 16 deletions
+2 -2
View File
@@ -140,10 +140,10 @@ ambient_anim_task (void *data)
memset (AnimFrame, 0, sizeof (AnimFrame));
for (i = 0; i < CommData.NumAnimations; i++)
if (CommData.AlienAmbientArray[i].AnimFlags & YOYO_ANIM)
AnimFrame[i] = SetAbsFrameIndex (CommFrame,
AnimFrame[i] = SetAbsFrameIndex (CommFrame,
CommData.AlienAmbientArray[i].StartIndex);
else
AnimFrame[i] = SetAbsFrameIndex (CommFrame,
AnimFrame[i] = SetAbsFrameIndex (CommFrame,
(COUNT)(CommData.AlienAmbientArray[i].StartIndex
+ CommData.AlienAmbientArray[i].NumFrames - 1));
+5
View File
@@ -25,16 +25,21 @@
typedef enum
{
UP_DIR,
// Animation indices are increasing
DOWN_DIR,
// Animation indices are decreasing
NO_DIR
} ANIM_DIR;
typedef enum
{
PICTURE_ANIM,
// Parts of a picture are replaced
COLOR_ANIM
// Colormap tricks on a picture
} ANIM_TYPE;
// Describes an active animation.
struct SEQUENCE
{
COUNT Alarm;
+3 -2
View File
@@ -280,7 +280,7 @@ InitSIS (void)
InitPlanetInfo ();
InitGroupInfo (TRUE);
GLOBAL (glob_flags) = NUM_READ_SPEEDS >> 1;
GLOBAL (glob_flags) = 0;
GLOBAL (ElementWorth[COMMON]) = 1;
GLOBAL_SIS (ElementAmounts[COMMON]) = 0;
@@ -352,7 +352,8 @@ InitSIS (void)
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (SOL_X);
GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (SOL_Y);
CurStarDescPtr = 0;
GLOBAL (autopilot.x) = GLOBAL (autopilot.y) = ~0;
GLOBAL (autopilot.x) = ~0;
GLOBAL (autopilot.y) = ~0;
/* In case the program is exited before the full game is terminated,
* make sure that the temporary files are deleted.
+10 -11
View File
@@ -25,13 +25,17 @@
#include "velocity.h"
// XXX: the following should be moved to commanim.h
// Animation types:
#define RANDOM_ANIM (1 << 0)
// Next index is randomly chose
// The next index is randomly chosen.
#define CIRCULAR_ANIM (1 << 1)
//
// After the last index has been reached, the animation starts over.
#define YOYO_ANIM (1 << 2)
// After the last index has been reached, the order that the
// animation frames are used is reversed.
#define ANIM_MASK (RANDOM_ANIM | CIRCULAR_ANIM | YOYO_ANIM)
// Mask of all animation types.
#define WAIT_TALKING (1 << 3)
#define PAUSE_TALKING (1 << 4)
@@ -48,7 +52,7 @@ typedef struct
// Index of the first image (for image animation) or
// index of the first color map (for palette animation)
BYTE NumFrames;
// number of frames
// Number of frames in the animation.
BYTE AnimFlags;
// One of RANDOM_ANIM, CIRCULAR_ANIM, or YOYO_ANIM
@@ -886,12 +890,10 @@ START_GAME_STATE
ADD_GAME_STATE (ORZ_STACK1, 1)
END_GAME_STATE
#define READ_SPEED_MASK ((1 << 3) - 1)
#define NUM_READ_SPEEDS 5
// Values for GAME_STATE.glob_flags:
#define COMBAT_SPEED_SHIFT 6
#define COMBAT_SPEED_MASK (((1 << 2) - 1) << COMBAT_SPEED_SHIFT)
#define NUM_COMBAT_SPEEDS 4
#define MUSIC_DISABLED (1 << 3)
#define SOUND_DISABLED (1 << 4)
#define CYBORG_ENABLED (1 << 5)
@@ -923,8 +925,8 @@ typedef UWORD ACTIVITY;
typedef struct
{
// XXX: cur_state is obsolete now and was replaced by process.c:zoom_out
BYTE cur_state, glob_flags;
BYTE glob_flags;
// See above for the meaning of the bits.
BYTE CrewCost, FuelCost;
BYTE ModuleCost[NUM_MODULES];
@@ -1011,9 +1013,6 @@ extern void setGameState32 (int startBit, DWORD val
extern CONTEXT RadarContext;
extern void DiscardStarMap (void *CodeRef);
extern void RetrieveStarMap (void);
extern void FreeSC2Data (void);
extern BOOLEAN LoadSC2Data (void);
+2 -1
View File
@@ -379,9 +379,10 @@ LoadClockState (CLOCK_STATE *ClockPtr, DECODE_REF fh)
static void
LoadGameState (GAME_STATE *GSPtr, DECODE_REF fh)
{
BYTE dummy8;
DWORD tmpd;
cread_8 (fh, &GSPtr->cur_state); /* obsolete */
cread_8 (fh, &dummy8); /* obsolete */
cread_8 (fh, &GSPtr->glob_flags);
cread_8 (fh, &GSPtr->CrewCost);
cread_8 (fh, &GSPtr->FuelCost);