Moved all non-CODE resources to starcon.ls2.
At this point, only loading ships ever changes the resource index. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2957 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -396,8 +396,6 @@ Battle (void)
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
SetResourceIndex (hResIndex);
|
||||
|
||||
#if !(DEMO_MODE || CREATE_JOURNAL)
|
||||
if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE) {
|
||||
// In Supermelee, the RNG is already initialised.
|
||||
|
||||
@@ -1298,7 +1298,6 @@ DoResponsePhrase (RESPONSE_REF R, RESPONSE_FUNC response_func,
|
||||
static void
|
||||
HailAlien (void)
|
||||
{
|
||||
RESOURCE_INDEX hOldIndex;
|
||||
ENCOUNTER_STATE ES;
|
||||
FONT PlayerFont, OldFont;
|
||||
MUSIC_REF SongRef = 0;
|
||||
@@ -1308,9 +1307,7 @@ HailAlien (void)
|
||||
memset (pCurInputState, 0, sizeof (*pCurInputState));
|
||||
|
||||
ES.InputFunc = DoCommunication;
|
||||
hOldIndex = SetResourceIndex (hResIndex);
|
||||
PlayerFont = LoadFont (PLAYER_FONT);
|
||||
SetResourceIndex (hOldIndex);
|
||||
|
||||
CommData.AlienFrame = CaptureDrawable (
|
||||
LoadGraphic (CommData.AlienFrameRes));
|
||||
@@ -1434,7 +1431,6 @@ COUNT
|
||||
InitCommunication (CONVERSATION which_comm)
|
||||
{
|
||||
COUNT status;
|
||||
RESOURCE_INDEX hOldIndex;
|
||||
LOCDATA *LocDataPtr;
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1505,8 +1501,6 @@ InitCommunication (CONVERSATION which_comm)
|
||||
BuildBattle (1);
|
||||
}
|
||||
|
||||
hOldIndex = SetResourceIndex (hResIndex);
|
||||
|
||||
LocDataPtr = init_race (
|
||||
status != YEHAT_REBEL_SHIP ? which_comm :
|
||||
YEHAT_REBEL_CONVERSATION);
|
||||
@@ -1548,8 +1542,6 @@ InitCommunication (CONVERSATION which_comm)
|
||||
(*CommData.uninit_encounter_func) (); // cleanup
|
||||
}
|
||||
|
||||
SetResourceIndex (hOldIndex);
|
||||
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
status = 0;
|
||||
|
||||
@@ -185,7 +185,6 @@ COUNT
|
||||
InitEncounter (void)
|
||||
{
|
||||
COUNT i;
|
||||
RESOURCE_INDEX hOldIndex;
|
||||
FRAME SegueFrame;
|
||||
STAMP s;
|
||||
TEXT t;
|
||||
@@ -194,8 +193,6 @@ InitEncounter (void)
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
|
||||
hOldIndex = SetResourceIndex (hResIndex);
|
||||
|
||||
SetContext (SpaceContext);
|
||||
SetContextFont (TinyFont);
|
||||
|
||||
@@ -319,8 +316,6 @@ InitEncounter (void)
|
||||
DestroyDrawable (ReleaseDrawable (SegueFrame));
|
||||
ScreenTransition (3, NULL);
|
||||
|
||||
SetResourceIndex (hOldIndex);
|
||||
|
||||
UnlockMutex (GraphicsLock);
|
||||
|
||||
{
|
||||
@@ -722,7 +717,6 @@ ExitUninitEncounter:
|
||||
void
|
||||
EncounterBattle (void)
|
||||
{
|
||||
RESOURCE_INDEX hLastIndex;
|
||||
ACTIVITY OldActivity;
|
||||
extern UWORD nth_frame;
|
||||
InputContext *savedPlayerInput;
|
||||
@@ -731,8 +725,6 @@ EncounterBattle (void)
|
||||
|
||||
SET_GAME_STATE (BATTLE_SEGUE, 1);
|
||||
|
||||
hLastIndex = SetResourceIndex (hResIndex);
|
||||
|
||||
OldActivity = GLOBAL (CurrentActivity);
|
||||
if (LOBYTE (OldActivity) == IN_LAST_BATTLE)
|
||||
GLOBAL (CurrentActivity) = MAKE_WORD (IN_LAST_BATTLE, 0);
|
||||
@@ -783,7 +775,6 @@ EncounterBattle (void)
|
||||
PlayerInput[0] = savedPlayerInput;
|
||||
}
|
||||
|
||||
SetResourceIndex (hResIndex);
|
||||
// MicroFont = CaptureFont (
|
||||
// LoadFont (MICRO_FONT)
|
||||
// );
|
||||
@@ -792,8 +783,6 @@ EncounterBattle (void)
|
||||
|
||||
GLOBAL (CurrentActivity) = OldActivity;
|
||||
|
||||
SetResourceIndex (hLastIndex);
|
||||
|
||||
UnlockMutex (GraphicsLock);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,10 +142,6 @@ LoadSC2Data (void)
|
||||
{
|
||||
if (FlagStatFrame == 0)
|
||||
{
|
||||
RESOURCE_INDEX hOldIndex;
|
||||
|
||||
hOldIndex = SetResourceIndex (hResIndex);
|
||||
|
||||
FlagStatFrame = CaptureDrawable (
|
||||
LoadGraphic (FLAGSTAT_MASK_PMAP_ANIM));
|
||||
if (FlagStatFrame == NULL)
|
||||
@@ -158,8 +154,6 @@ LoadSC2Data (void)
|
||||
|
||||
FontGradFrame = CaptureDrawable (
|
||||
LoadGraphic (FONTGRAD_PMAP_ANIM));
|
||||
|
||||
SetResourceIndex (hOldIndex);
|
||||
}
|
||||
|
||||
CreateRadar ();
|
||||
|
||||
@@ -31,9 +31,6 @@ load_gravity_well (BYTE selector)
|
||||
RES_TYPE rt;
|
||||
RES_INSTANCE ri;
|
||||
RES_PACKAGE rp;
|
||||
RESOURCE_INDEX hLastIndex;
|
||||
|
||||
hLastIndex = SetResourceIndex (hResIndex);
|
||||
|
||||
if (selector == NUMBER_OF_PLANET_TYPES)
|
||||
{
|
||||
@@ -67,7 +64,6 @@ load_gravity_well (BYTE selector)
|
||||
}
|
||||
}
|
||||
|
||||
SetResourceIndex (hLastIndex);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -39,6 +39,9 @@ load_ship (DWORD RaceResIndex, BOOLEAN LoadBattleData)
|
||||
|
||||
CodeRef = CaptureCodeRes (LoadCodeRes (INITIAL_CODE_RES),
|
||||
&GlobData, &RDPtr);
|
||||
|
||||
SetResourceIndex (hOldIndex);
|
||||
|
||||
if (!CodeRef)
|
||||
goto BadLoad;
|
||||
RDPtr->CodeRef = CodeRef;
|
||||
@@ -117,7 +120,6 @@ load_ship (DWORD RaceResIndex, BOOLEAN LoadBattleData)
|
||||
}
|
||||
|
||||
ExitFunc:
|
||||
SetResourceIndex (hOldIndex);
|
||||
CloseResourceIndex (h);
|
||||
|
||||
return RDPtr;
|
||||
|
||||
@@ -451,10 +451,8 @@ DrawArmadaPickShip (BOOLEAN draw_salvage_frame, RECT *pPickRect)
|
||||
STAMP s;
|
||||
TEXT t;
|
||||
CONTEXT OldContext;
|
||||
RESOURCE_INDEX hLastIndex;
|
||||
FRAME PickFrame;
|
||||
|
||||
hLastIndex = SetResourceIndex (hResIndex);
|
||||
OldContext = SetContext (SpaceContext);
|
||||
|
||||
PickFrame = CaptureDrawable (LoadGraphic (SC2_PICK_PMAP_ANIM));
|
||||
@@ -554,6 +552,5 @@ DrawArmadaPickShip (BOOLEAN draw_salvage_frame, RECT *pPickRect)
|
||||
DestroyDrawable (ReleaseDrawable (PickFrame));
|
||||
|
||||
SetContext (OldContext);
|
||||
SetResourceIndex (hLastIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user