-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
468 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "Core.h" | ||
#include "UnCore.h" | ||
#include "GameFileSystem.h" | ||
#include "GameFileSystemSmite.h" | ||
|
||
#if SMITE | ||
static FSmiteManifest* GSmiteManifest = NULL; | ||
|
||
void LoadSmiteManifest(const CGameFileInfo* info) { | ||
guard(LoadSmiteManifest); | ||
|
||
appPrintf("Loading Smite manifest %s...\n", *info->GetRelativeName()); | ||
|
||
FArchive* loader = info->CreateReader(); | ||
assert(loader); | ||
loader->Game = GAME_Smite; | ||
if(GSmiteManifest != nullptr) { | ||
delete GSmiteManifest; | ||
} | ||
GSmiteManifest = new FSmiteManifest; | ||
GSmiteManifest->Serialize(*loader); | ||
delete loader; | ||
|
||
unguard | ||
} | ||
|
||
|
||
FArchive* GetSmiteBlob(const FGuid& guid, int level, const char* ext) { | ||
guard(GetSmiteBlob); | ||
|
||
if(GSmiteManifest == nullptr) { | ||
return nullptr; | ||
} | ||
|
||
TArray<FSmiteFile>* item = GSmiteManifest->Files.Find(guid); | ||
if(item == nullptr) { | ||
return nullptr; | ||
} | ||
|
||
int i; | ||
for(i = 0; i < item->Num(); i++) { | ||
FSmiteFile* entry = item->GetData() + i; | ||
if(entry->tier == level) { | ||
FString* bulk = GSmiteManifest->BulkFiles.Find(entry->guid); | ||
char filename[512]; | ||
appSprintf(ARRAY_ARG(filename), "%s.%s", bulk->GetDataArray().GetData(), ext); | ||
const CGameFileInfo* info = CGameFileInfo::Find(filename); | ||
if(info == nullptr) { | ||
return nullptr; | ||
} | ||
|
||
FArchive* Ar = info->CreateReader(); | ||
Ar->Game = GAME_Smite; | ||
Ar->Seek(entry->offset); | ||
byte *data = (byte*)appMalloc(entry->blob_size); | ||
Ar->Serialize(data, entry->blob_size); | ||
delete Ar; | ||
Ar = new FMemReader(data, entry->blob_size); | ||
Ar->Game = GAME_Smite; | ||
return Ar; | ||
} | ||
} | ||
unguard | ||
|
||
return nullptr; | ||
} | ||
#endif // SMITE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "Core.h" | ||
#include "UnCore.h" | ||
|
||
#if SMITE | ||
struct FSmiteFile { | ||
int32 tier; | ||
int32 size; | ||
int32 offset; | ||
int32 blob_size; | ||
FGuid guid; | ||
|
||
friend FArchive& operator<<(FArchive &Ar, FSmiteFile &H) | ||
{ | ||
return Ar << H.tier << H.size << H.offset << H.blob_size << H.guid; | ||
} | ||
}; | ||
|
||
struct FSmiteManifest | ||
{ | ||
TMap<FGuid, TArray<FSmiteFile>> Files; | ||
TMap<FGuid, FString> BulkFiles; | ||
|
||
void Serialize(FArchive& Ar) | ||
{ | ||
Ar << Files; | ||
Ar << BulkFiles; | ||
} | ||
}; | ||
|
||
void LoadSmiteManifest(const CGameFileInfo* info); | ||
|
||
FArchive* GetSmiteBlob(const FGuid& guid, int level, const char* ext); | ||
|
||
#endif // SMITE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/Zunawe/md5-c |
Oops, something went wrong.