mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 07:23:01 +00:00
Merge branch 'level-scripts' of github.com:sm64ex-coop-dev/sm64ex-coop into level-scripts
This commit is contained in:
commit
e037e3b65e
1 changed files with 10 additions and 5 deletions
|
@ -9,14 +9,19 @@ extern "C" {
|
||||||
///////////
|
///////////
|
||||||
|
|
||||||
static TexData* LoadTextureFromFile(GfxData *aGfxData, const String& aFile) {
|
static TexData* LoadTextureFromFile(GfxData *aGfxData, const String& aFile) {
|
||||||
|
|
||||||
// Image file
|
// Image file
|
||||||
String _TexturePath = aFile.SubString(aFile.Find('/') + 1); // Remove the "actors/"
|
SysPath _Filename = fstring("%s/%s.png", aGfxData->mPackFolder.c_str(), aFile.begin());
|
||||||
SysPath _Filename = fstring("%s/%s.png", aGfxData->mPackFolder.c_str(), _TexturePath.begin());
|
|
||||||
FILE *_File = fopen(_Filename.c_str(), "rb");
|
FILE *_File = fopen(_Filename.c_str(), "rb");
|
||||||
|
// Check as if we're an Actor.
|
||||||
if (!_File) {
|
if (!_File) {
|
||||||
PrintError(" ERROR: Unable to open file \"%s\"", _Filename.c_str());
|
String _TexturePath = aFile.SubString(aFile.Find('/') + 1); // Remove the "actors/"
|
||||||
return NULL;
|
SysPath _ActorFilename = fstring("%s/%s.png", aGfxData->mPackFolder.c_str(), _TexturePath.begin());
|
||||||
|
_File = fopen(_ActorFilename.c_str(), "rb");
|
||||||
|
// The file does not exist in either spot!
|
||||||
|
if (!_File) {
|
||||||
|
PrintError(" ERROR: Unable to open file at \"%s\" or \"%s\"", _Filename.c_str(), _ActorFilename.c_str());
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Texture data
|
// Texture data
|
||||||
|
|
Loading…
Reference in a new issue