allows loading some resources directly from files, bypassing res-ndx (temporary)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@617 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -18,16 +18,25 @@
|
||||
|
||||
#include "gfxintrn.h"
|
||||
|
||||
extern char *_cur_resfile_name;
|
||||
|
||||
DWORD
|
||||
LoadCelFile (PVOID pStr)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
// FIXME: this theoretically needs a mechanism to prevent races
|
||||
if (_cur_resfile_name)
|
||||
// something else is loading resources atm
|
||||
return 0;
|
||||
|
||||
if ((fp = res_OpenResFile (pStr, "rb")) != NULL)
|
||||
{
|
||||
MEM_HANDLE hData;
|
||||
|
||||
_cur_resfile_name = pStr;
|
||||
hData = _GetCelData (fp, LengthResFile (fp));
|
||||
_cur_resfile_name = 0;
|
||||
res_CloseResFile (fp);
|
||||
return ((DWORD)hData);
|
||||
}
|
||||
@@ -40,11 +49,18 @@ LoadFontFile (PVOID pStr)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
// FIXME: this theoretically needs a mechanism to prevent races
|
||||
if (_cur_resfile_name)
|
||||
// something else is loading resources atm
|
||||
return 0;
|
||||
|
||||
if ((fp = res_OpenResFile (pStr, "rb")) != NULL)
|
||||
{
|
||||
MEM_HANDLE hData;
|
||||
|
||||
_cur_resfile_name = pStr;
|
||||
hData = _GetFontData (fp, LengthResFile (fp));
|
||||
_cur_resfile_name = 0;
|
||||
res_CloseResFile (fp);
|
||||
return ((DWORD)hData);
|
||||
}
|
||||
|
||||
@@ -18,17 +18,26 @@
|
||||
|
||||
#include "sndintrn.h"
|
||||
|
||||
extern char *_cur_resfile_name;
|
||||
|
||||
SOUND_REF
|
||||
LoadSoundFile (PVOID pStr)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
// FIXME: this theoretically needs a mechanism to prevent races
|
||||
if (_cur_resfile_name)
|
||||
// something else is loading resources atm
|
||||
return 0;
|
||||
|
||||
fp = res_OpenResFile (pStr, "rb");
|
||||
if (fp)
|
||||
{
|
||||
MEM_HANDLE hData;
|
||||
|
||||
_cur_resfile_name = pStr;
|
||||
hData = _GetSoundBankData (fp, LengthResFile (fp));
|
||||
_cur_resfile_name = 0;
|
||||
|
||||
res_CloseResFile (fp);
|
||||
|
||||
@@ -43,12 +52,19 @@ LoadMusicFile (PVOID pStr)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
// FIXME: this theoretically needs a mechanism to prevent races
|
||||
if (_cur_resfile_name)
|
||||
// something else is loading resources atm
|
||||
return 0;
|
||||
|
||||
fp = res_OpenResFile (pStr, "rb");
|
||||
if (fp)
|
||||
{
|
||||
MEM_HANDLE hData;
|
||||
|
||||
_cur_resfile_name = pStr;
|
||||
hData = _GetMusicData (fp, LengthResFile (fp));
|
||||
_cur_resfile_name = 0;
|
||||
|
||||
res_CloseResFile (fp);
|
||||
|
||||
|
||||
@@ -18,17 +18,26 @@
|
||||
|
||||
#include "strintrn.h"
|
||||
|
||||
extern char *_cur_resfile_name;
|
||||
|
||||
STRING_TABLE
|
||||
LoadStringTableFile (PVOID pStr)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
// FIXME: this theoretically needs a mechanism to prevent races
|
||||
if (_cur_resfile_name)
|
||||
// something else is loading resources atm
|
||||
return 0;
|
||||
|
||||
fp = res_OpenResFile (pStr, "rb");
|
||||
if (fp)
|
||||
{
|
||||
MEM_HANDLE hData;
|
||||
|
||||
_cur_resfile_name = pStr;
|
||||
hData = _GetStringData (fp, LengthResFile (fp));
|
||||
_cur_resfile_name = 0;
|
||||
res_CloseResFile (fp);
|
||||
|
||||
return (BUILD_STRING_TABLE (hData));
|
||||
|
||||
Reference in New Issue
Block a user