diff --git a/sc2/src/sc2code/battle.c b/sc2/src/sc2code/battle.c index 9f4848d22..656d90d93 100644 --- a/sc2/src/sc2code/battle.c +++ b/sc2/src/sc2code/battle.c @@ -28,6 +28,7 @@ # endif #endif #include "resinst.h" +#include "nameref.h" #include "setup.h" #include "settings.h" #include "sounds.h" @@ -215,11 +216,11 @@ BattleSong (BOOLEAN DoPlay) if (BattleRef == 0) { if (LOBYTE (GLOBAL (CurrentActivity)) != IN_HYPERSPACE) - BattleRef = LoadMusicInstance (BATTLE_MUSIC); + BattleRef = LoadMusic (BATTLE_MUSIC); else if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1) - BattleRef = LoadMusicInstance (HYPERSPACE_MUSIC); + BattleRef = LoadMusic (HYPERSPACE_MUSIC); else - BattleRef = LoadMusicInstance (QUASISPACE_MUSIC); + BattleRef = LoadMusic (QUASISPACE_MUSIC); } if (DoPlay) diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index 395d63916..524f39713 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -33,6 +33,7 @@ #include "settings.h" #include "setup.h" #include "sounds.h" +#include "nameref.h" #include "uqmdebug.h" #include "libs/graphics/gfx_common.h" #include "libs/inplib.h" @@ -1331,25 +1332,25 @@ HailAlien (void) ES.InputFunc = DoCommunication; hOldIndex = SetResourceIndex (hResIndex); - PlayerFont = CaptureFont ((FONT_REF)LoadGraphic (PLAYER_FONT)); + PlayerFont = CaptureFont ((FONT_REF)LoadFont (PLAYER_FONT)); SetResourceIndex (hOldIndex); CommData.AlienFrame = CaptureDrawable ( - LoadGraphicInstance ((RESOURCE)CommData.AlienFrame)); + LoadGraphic ((RESOURCE)CommData.AlienFrame)); CommData.AlienFont = CaptureFont ((FONT_REF) - LoadGraphic ((RESOURCE)CommData.AlienFont)); + LoadFont ((RESOURCE)CommData.AlienFont)); CommData.AlienColorMap = CaptureColorMap ( - LoadColorMapInstance ((RESOURCE)CommData.AlienColorMap)); + LoadColorMap ((RESOURCE)CommData.AlienColorMap)); if ((CommData.AlienSongFlags & LDASF_USE_ALTERNATE) && CommData.AlienAltSong) - SongRef = LoadMusicInstance ((RESOURCE)CommData.AlienAltSong); + SongRef = LoadMusic ((RESOURCE)CommData.AlienAltSong); if (SongRef) CommData.AlienSong = SongRef; else - CommData.AlienSong = LoadMusicInstance ((RESOURCE)CommData.AlienSong); + CommData.AlienSong = LoadMusic ((RESOURCE)CommData.AlienSong); CommData.ConversationPhrases = CaptureStringTable ( - LoadStringTableInstance ((RESOURCE)CommData.ConversationPhrases)); + LoadStringTable ((RESOURCE)CommData.ConversationPhrases)); // init subtitle cache context TextCacheContext = CaptureContext (CreateContext ()); diff --git a/sc2/src/sc2code/credits.c b/sc2/src/sc2code/credits.c index 6bd9fd898..aec6ce17d 100644 --- a/sc2/src/sc2code/credits.c +++ b/sc2/src/sc2code/credits.c @@ -556,7 +556,7 @@ StartCredits (void) CreditsBack = CaptureDrawable (LoadGraphic (CREDITS_BACK_ANIM)); // load fonts for (fdef = CreditsFont; fdef->size; ++fdef) - fdef->font = CaptureFont (LoadGraphic (fdef->res)); + fdef->font = CaptureFont (LoadFont (fdef->res)); CreditsRate = CREDITS_BASE_RATE; CreditsRunning = FALSE; @@ -714,7 +714,7 @@ Credits (BOOLEAN WithOuttakes) Task CredTask; CREDITS_INPUT_STATE cis; - hMusic = LoadMusicInstance (CREDITS_MUSIC); + hMusic = LoadMusic (CREDITS_MUSIC); LockMutex (GraphicsLock); SetContext (ScreenContext); diff --git a/sc2/src/sc2code/encount.c b/sc2/src/sc2code/encount.c index b0ca406f5..d50f53c82 100644 --- a/sc2/src/sc2code/encount.c +++ b/sc2/src/sc2code/encount.c @@ -189,7 +189,7 @@ InitEncounter (void) SetContext (SpaceContext); SetContextFont (TinyFont); - MR = LoadMusicInstance (REDALERT_MUSIC); + MR = LoadMusic (REDALERT_MUSIC); PlayMusic (MR, FALSE, 1); SegueFrame = CaptureDrawable (LoadGraphic (SEGUE_PMAP_ANIM)); UnlockMutex (GraphicsLock); @@ -767,7 +767,7 @@ EncounterBattle (void) SetResourceIndex (hResIndex); // MicroFont = CaptureFont ( -// LoadGraphic (MICRO_FONT) +// LoadFont (MICRO_FONT) // ); // MenuSounds = CaptureSound (LoadSound (MENU_SOUNDS)); // LoadSC2Data (); diff --git a/sc2/src/sc2code/globdata.c b/sc2/src/sc2code/globdata.c index 2b5202959..c86f72806 100644 --- a/sc2/src/sc2code/globdata.c +++ b/sc2/src/sc2code/globdata.c @@ -23,6 +23,7 @@ #include "master.h" #include "setup.h" #include "resinst.h" +#include "nameref.h" #include "build.h" #include "state.h" #include "gamestr.h" diff --git a/sc2/src/sc2code/gravwell.c b/sc2/src/sc2code/gravwell.c index 686ac5980..2fdad9caf 100644 --- a/sc2/src/sc2code/gravwell.c +++ b/sc2/src/sc2code/gravwell.c @@ -18,6 +18,7 @@ #include "element.h" #include "resinst.h" +#include "nameref.h" #include "setup.h" diff --git a/sc2/src/sc2code/init.c b/sc2/src/sc2code/init.c index e779a4751..b11f195cc 100644 --- a/sc2/src/sc2code/init.c +++ b/sc2/src/sc2code/init.c @@ -23,6 +23,7 @@ #include "init.h" #include "port.h" #include "resinst.h" +#include "nameref.h" #include "setup.h" #include "units.h" diff --git a/sc2/src/sc2code/intro.c b/sc2/src/sc2code/intro.c index a868d01fb..3308a6c7f 100644 --- a/sc2/src/sc2code/intro.c +++ b/sc2/src/sc2code/intro.c @@ -23,6 +23,7 @@ #include "sounds.h" #include "fmv.h" #include "resinst.h" +#include "nameref.h" #include "libs/graphics/gfx_common.h" #include "libs/graphics/drawable.h" #include "libs/sound/sound.h" diff --git a/sc2/src/sc2code/libs/gfxlib.h b/sc2/src/sc2code/libs/gfxlib.h index d27562946..0567251cd 100644 --- a/sc2/src/sc2code/libs/gfxlib.h +++ b/sc2/src/sc2code/libs/gfxlib.h @@ -234,7 +234,6 @@ extern BOOLEAN InstallGraphicResTypes (COUNT cel_type, COUNT font_type); extern DWORD LoadCelFile (PVOID pStr); extern DWORD LoadFontFile (PVOID pStr); extern DWORD LoadGraphicInstance (DWORD res); -extern DWORD LoadGraphic (DWORD res); extern DRAWABLE LoadDisplayPixmap (PRECT area, FRAME frame); extern FRAME SetContextFontEffect (FRAME EffectFrame); extern FONT SetContextFont (FONT Font); diff --git a/sc2/src/sc2code/libs/graphics/resgfx.c b/sc2/src/sc2code/libs/graphics/resgfx.c index 73099e5e3..5b899ef0a 100644 --- a/sc2/src/sc2code/libs/graphics/resgfx.c +++ b/sc2/src/sc2code/libs/graphics/resgfx.c @@ -18,12 +18,10 @@ #include "gfxintrn.h" -static COUNT _gfx_type; BOOLEAN InstallGraphicResTypes (COUNT cel_type, COUNT font_type) { - _gfx_type = cel_type; InstallResTypeVectors (cel_type, _GetCelData, _ReleaseCelData); InstallResTypeVectors (font_type, _GetFontData, _ReleaseFontData); return (TRUE); @@ -41,12 +39,3 @@ LoadGraphicInstance (DWORD res) return ((DWORD)hData); } -DWORD -LoadGraphic (DWORD res) -{ - if (_gfx_type) - return (LoadGraphicInstance (res)); - else - return (LoadCelFile ((PVOID)res)); -} - diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index 546fbfdc8..5730d74da 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -2178,7 +2178,7 @@ DoMelee (PMELEE_STATE pMS) DestroyMusic (pMS->hMusic); pMS->hMusic = 0; } - pMS->hMusic = LoadMusicInstance (MELEE_MUSIC); + pMS->hMusic = LoadMusic (MELEE_MUSIC); pMS->Initialized = TRUE; pMS->MeleeOption = START_MELEE; diff --git a/sc2/src/sc2code/nameref.h b/sc2/src/sc2code/nameref.h index b64e8715f..158551c71 100644 --- a/sc2/src/sc2code/nameref.h +++ b/sc2/src/sc2code/nameref.h @@ -21,11 +21,13 @@ #include "restypes.h" -#define LoadCodeRes(r) LoadCodeResInstance (r) -#define LoadColorMap(r) LoadColorMapInstance (r) -#define LoadStringTable(r) LoadStringTableInstance(r) -#define LoadSound(r) LoadSoundInstance(r) -#define LoadMusic(r) LoadMusicInstance(r) +#define LoadCodeRes LoadCodeResInstance +#define LoadGraphic LoadGraphicInstance +#define LoadFont LoadGraphicInstance +#define LoadColorMap LoadColorMapInstance +#define LoadStringTable LoadStringTableInstance +#define LoadSound LoadSoundInstance +#define LoadMusic LoadMusicInstance #define INIT_INSTANCES() do \ { \ diff --git a/sc2/src/sc2code/outfit.c b/sc2/src/sc2code/outfit.c index 8a39bda38..4ce9efe11 100644 --- a/sc2/src/sc2code/outfit.c +++ b/sc2/src/sc2code/outfit.c @@ -22,6 +22,7 @@ #include "gameopt.h" #include "gamestr.h" #include "resinst.h" +#include "nameref.h" #include "settings.h" #include "starbase.h" #include "setup.h" @@ -624,7 +625,7 @@ DoOutfit (PMENU_STATE pMS) pMS->CurFrame = CaptureDrawable ( LoadGraphic (MODULES_PMAP_ANIM)); - pMS->hMusic = LoadMusicInstance (OUTFIT_MUSIC); + pMS->hMusic = LoadMusic (OUTFIT_MUSIC); pMS->CurState = OUTFIT_FUEL; pMS->ModuleFrame = CaptureDrawable ( LoadGraphic (SISMODS_MASK_PMAP_ANIM)); diff --git a/sc2/src/sc2code/pickship.c b/sc2/src/sc2code/pickship.c index 31f976cdd..f855b65d4 100644 --- a/sc2/src/sc2code/pickship.c +++ b/sc2/src/sc2code/pickship.c @@ -22,6 +22,7 @@ #include "pickmele.h" #include "races.h" #include "resinst.h" +#include "nameref.h" #include "settings.h" #include "setup.h" #include "sounds.h" diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index 0486d0917..1bbd23fac 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -1859,7 +1859,7 @@ LoadLanderData (void) ri = GET_INSTANCE (ORBIT1_MUSIC); rp = GET_PACKAGE (ORBIT1_MUSIC); for (i = 0; i < NUM_ORBIT_THEMES; ++i, ++ri) - OrbitMusic[i] = LoadMusicInstance (MAKE_RESOURCE (rp, rt, ri)); + OrbitMusic[i] = LoadMusic (MAKE_RESOURCE (rp, rt, ri)); } } } diff --git a/sc2/src/sc2code/planets/planets.c b/sc2/src/sc2code/planets/planets.c index 0589bb3a7..cf85c2cd8 100644 --- a/sc2/src/sc2code/planets/planets.c +++ b/sc2/src/sc2code/planets/planets.c @@ -24,6 +24,7 @@ #include "uqmdebug.h" #include "libs/graphics/gfx_common.h" #include "resinst.h" +#include "nameref.h" extern int rotate_planet_task (PVOID data); @@ -278,7 +279,7 @@ FreePlanet (void) void LoadStdLanderFont (PLANET_INFO *info) { - info->LanderFont = CaptureFont (LoadGraphic (LANDER_FONT)); + info->LanderFont = CaptureFont (LoadFont (LANDER_FONT)); info->LanderFontEff = CaptureDrawable ( LoadGraphic (LANDER_FONTEFF_PMAP_ANIM)); } diff --git a/sc2/src/sc2code/planets/solarsys.c b/sc2/src/sc2code/planets/solarsys.c index 99e5c720d..389d2c2b9 100644 --- a/sc2/src/sc2code/planets/solarsys.c +++ b/sc2/src/sc2code/planets/solarsys.c @@ -205,7 +205,7 @@ LoadIPData (void) SunCMap = CaptureColorMap (LoadColorMap (IPSUN_COLOR_MAP)); SunFrame = CaptureDrawable (LoadGraphic (SUN_MASK_PMAP_ANIM)); - SpaceMusic = LoadMusicInstance (IP_MUSIC); + SpaceMusic = LoadMusic (IP_MUSIC); } } diff --git a/sc2/src/sc2code/restart.c b/sc2/src/sc2code/restart.c index 2019e1b6d..a600c6cde 100644 --- a/sc2/src/sc2code/restart.c +++ b/sc2/src/sc2code/restart.c @@ -27,6 +27,7 @@ #include "intel.h" #include "melee.h" #include "resinst.h" +#include "nameref.h" #include "settings.h" #include "load.h" #include "setup.h" @@ -124,7 +125,7 @@ DoRestart (PMENU_STATE pMS) DestroyMusic (pMS->hMusic); pMS->hMusic = 0; } - pMS->hMusic = LoadMusicInstance (MAINMENU_MUSIC); + pMS->hMusic = LoadMusic (MAINMENU_MUSIC); InactTimeOut = (pMS->hMusic ? 120 : 20) * ONE_SECOND; PlayMusic (pMS->hMusic, TRUE, 1); diff --git a/sc2/src/sc2code/setup.c b/sc2/src/sc2code/setup.c index 1d282059d..e29f5615d 100644 --- a/sc2/src/sc2code/setup.c +++ b/sc2/src/sc2code/setup.c @@ -169,11 +169,11 @@ InitKernel (void) for (counter = 0; counter < NUM_PLAYERS; ++counter) InitQueue (&race_q[counter], MAX_SHIPS_PER_SIDE, sizeof (STARSHIP)); - StarConFont = CaptureFont (LoadGraphic (STARCON_FONT)); + StarConFont = CaptureFont (LoadFont (STARCON_FONT)); if (StarConFont == NULL) return FALSE; - TinyFont = CaptureFont (LoadGraphic (TINY_FONT)); + TinyFont = CaptureFont (LoadFont (TINY_FONT)); if (TinyFont == NULL) return FALSE; @@ -185,12 +185,11 @@ InitKernel (void) if (StatusFrame == NULL) return FALSE; - GameStrings = CaptureStringTable (LoadStringTableInstance ( - STARCON_GAME_STRINGS)); + GameStrings = CaptureStringTable (LoadStringTable (STARCON_GAME_STRINGS)); if (GameStrings == 0) return FALSE; - MicroFont = CaptureFont (LoadGraphic (MICRO_FONT)); + MicroFont = CaptureFont (LoadFont (MICRO_FONT)); if (MicroFont == NULL) return FALSE; diff --git a/sc2/src/sc2code/shipyard.c b/sc2/src/sc2code/shipyard.c index a7c48afde..75acf5e9e 100644 --- a/sc2/src/sc2code/shipyard.c +++ b/sc2/src/sc2code/shipyard.c @@ -1221,7 +1221,7 @@ DoShipyard (PMENU_STATE pMS) pMS->CurString = CaptureColorMap ( LoadColorMap (HANGAR_COLOR_TAB)); - pMS->hMusic = LoadMusicInstance (SHIPYARD_MUSIC); + pMS->hMusic = LoadMusic (SHIPYARD_MUSIC); LockMutex (GraphicsLock); SetTransitionSource (NULL); diff --git a/sc2/src/sc2code/starbase.c b/sc2/src/sc2code/starbase.c index 84ce8cde9..3431d805d 100644 --- a/sc2/src/sc2code/starbase.c +++ b/sc2/src/sc2code/starbase.c @@ -24,6 +24,7 @@ #include "load.h" #include "starbase.h" #include "resinst.h" +#include "nameref.h" #include "settings.h" #include "setup.h" #include "sounds.h" @@ -261,8 +262,9 @@ rotate_starbase(void *data) STAMP s; Task task = (Task) data; - s.origin.x = s.origin.y = 0; -s.origin.x = SAFE_X, s.origin.y = SAFE_Y + 4; + //s.origin.x = s.origin.y = 0; + s.origin.x = SAFE_X; + s.origin.y = SAFE_Y + 4; s.frame = IncFrameIndex (pMenuState->CurFrame); TimeIn = GetTimeCounter (); while (!Task_ReadState (task, TASK_EXIT)) @@ -322,11 +324,12 @@ DoStarBase (PMENU_STATE pMS) UnlockMutex (GraphicsLock); - s.origin.x = s.origin.y = 0; -s.origin.x = SAFE_X, s.origin.y = SAFE_Y + 4; + //s.origin.x = s.origin.y = 0; + s.origin.x = SAFE_X; + s.origin.y = SAFE_Y + 4; s.frame = CaptureDrawable (LoadGraphic (STARBASE_ANIM)); pMS->CurFrame = s.frame; - pMS->hMusic = LoadMusicInstance (STARBASE_MUSIC); + pMS->hMusic = LoadMusic (STARBASE_MUSIC); LockMutex (GraphicsLock); SetTransitionSource (NULL);