Moved all resource ID construction into its own file for easy replacement

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2960 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2008-04-06 07:53:42 +00:00
parent 7f65c19044
commit 37f0bcf5e6
9 changed files with 27 additions and 20 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7:
- Isolated all constructed resources into cons_res.c - Michael
- Fixed a crash when conversing with music disabled - Michael
- Moved all resources into starcon.ls2 - Michael
- Fixed compile errors when compiling without joystick support - Michael
+1 -1
View File
@@ -3,7 +3,7 @@ uqm_CFILES="battle.c battlecontrols.c border.c build.c cleanup.c clock.c
cnctdlg.c collide.c comm.c commanim.c commglue.c confirm.c credits.c
cyborg.c demo.c displist.c dummy.c encount.c flash.c fmv.c galaxy.c
gameev.c gameinp.c gameopt.c gendef.c getchar.c globdata.c gravity.c
gravwell.c grpinfo.c hyper.c init.c intel.c intro.c ipdisp.c load.c
cons_res.c grpinfo.c hyper.c init.c intel.c intro.c ipdisp.c load.c
loadmele.c loadship.c master.c melee.c menu.c misc.c oscill.c
outfit.c pickmele.c pickship.c plandata.c process.c restart.c save.c
settings.c setup.c setupmenu.c ship.c shipstat.c shipyard.c sis.c
@@ -21,7 +21,6 @@
#include "nameref.h"
#include "setup.h"
FRAME planet[NUM_VIEWS];
void
@@ -78,3 +77,21 @@ free_gravity_well (void)
}
}
FRAME
load_life_form (BYTE selector)
{
return CaptureDrawable (LoadGraphic (MAKE_RESOURCE (
GET_PACKAGE (LIFE00_MASK_PMAP_ANIM) + selector,
GFXRES,
GET_INSTANCE (LIFE00_MASK_PMAP_ANIM) + selector)));
}
MUSIC_REF
load_orbit_theme (BYTE selector)
{
RES_PACKAGE rp = GET_PACKAGE (ORBIT1_MUSIC);
RES_INSTANCE ri = GET_INSTANCE (ORBIT1_MUSIC) + selector;
RES_TYPE rt = GET_TYPE (ORBIT1_MUSIC);
return LoadMusic (MAKE_RESOURCE (rp, rt, ri));
}
-2
View File
@@ -207,8 +207,6 @@ extern BOOLEAN DeltaCrew (ELEMENT *ElementPtr, SIZE crew_delta);
extern void PreProcessStatus (ELEMENT *ShipPtr);
extern void PostProcessStatus (ELEMENT *ShipPtr);
extern void load_gravity_well (BYTE selector);
extern void free_gravity_well (void);
extern void spawn_planet (void);
extern void spawn_asteroid (ELEMENT *ElementPtr);
extern void animation_preprocess (ELEMENT *ElementPtr);
+1
View File
@@ -22,6 +22,7 @@
#include "battlecontrols.h"
#include "build.h"
#include "colors.h"
#include "cons_res.h"
#include "controls.h"
#include "gameopt.h"
#include "gamestr.h"
+1
View File
@@ -18,6 +18,7 @@
#include "build.h"
#include "colors.h"
#include "cons_res.h"
#include "element.h"
#include "globdata.h"
#include "init.h"
+1
View File
@@ -22,6 +22,7 @@
#include "colors.h"
#include "comm.h"
// for getLineWithinWidth
#include "cons_res.h"
#include "controls.h"
#include "file.h"
#include "fmv.h"
+2 -8
View File
@@ -1872,15 +1872,9 @@ LoadLanderData (void)
{
COUNT i;
RES_TYPE rt;
RES_INSTANCE ri;
RES_PACKAGE rp;
rt = GET_TYPE (ORBIT1_MUSIC);
ri = GET_INSTANCE (ORBIT1_MUSIC);
rp = GET_PACKAGE (ORBIT1_MUSIC);
for (i = 0; i < NUM_ORBIT_THEMES; ++i, ++ri)
OrbitMusic[i] = LoadMusic (MAKE_RESOURCE (rp, rt, ri));
for (i = 0; i < NUM_ORBIT_THEMES; ++i)
OrbitMusic[i] = load_orbit_theme (i);
}
}
}
+2 -8
View File
@@ -17,6 +17,7 @@
*/
#include "build.h"
#include "cons_res.h"
#include "controls.h"
#include "encount.h"
#include "gamestr.h"
@@ -35,7 +36,6 @@
#include "libs/inplib.h"
#include "libs/mathlib.h"
extern FRAME SpaceJunkFrame;
// define SPIN_ON_SCAN to allow the planet to spin
@@ -1384,13 +1384,7 @@ GeneratePlanetSide (void)
life_init_tab[i] = (BYTE)which_node + 1;
pSolarSysState->PlanetSideFrame[i + 3] =
CaptureDrawable (LoadGraphic (
MAKE_RESOURCE (
GET_PACKAGE (LIFE00_MASK_PMAP_ANIM)
+ which_node, GFXRES,
GET_INSTANCE (LIFE00_MASK_PMAP_ANIM)
+ which_node)));
load_life_form (which_node);
break;
}