mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 18:48:04 -07:00
[OTR] Initial support for PNG textures (#1634)
This commit is contained in:
parent
fba4839705
commit
ec88b90ed8
15 changed files with 59 additions and 327 deletions
|
@ -93,7 +93,27 @@ static void ExporterProgramEnd()
|
|||
|
||||
for (auto item : lst)
|
||||
{
|
||||
std::vector<std::string> splitPath = StringHelper::Split(item, ".");
|
||||
|
||||
if (splitPath.size() >= 3) {
|
||||
std::string extension = splitPath.at(splitPath.size() - 1);
|
||||
std::string format = splitPath.at(splitPath.size() - 2);
|
||||
splitPath.pop_back();
|
||||
splitPath.pop_back();
|
||||
std::string afterPath = std::accumulate(splitPath.begin(), splitPath.end(), std::string(""));
|
||||
if (extension == "png" && (format == "rgba32" || format == "rgb5a1" || format == "i4" || format == "i8" || format == "ia4" || format == "ia8" || format == "ia16" || format == "ci4" || format == "ci8")) {
|
||||
Globals::Instance->buildRawTexture = true;
|
||||
Globals::Instance->BuildAssetTexture(item, ZTexture::GetTextureTypeFromString(format), afterPath);
|
||||
Globals::Instance->buildRawTexture = false;
|
||||
|
||||
auto fileData = File::ReadAllBytes(afterPath);
|
||||
printf("otrArchive->AddFile(%s)\n", StringHelper::Split(afterPath, "Extract/")[1].c_str());
|
||||
otrArchive->AddFile(StringHelper::Split(afterPath, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
|
||||
}
|
||||
}
|
||||
|
||||
auto fileData = File::ReadAllBytes(item);
|
||||
printf("otrArchive->AddFile(%s)\n", StringHelper::Split(item, "Extract/")[1].c_str());
|
||||
otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
BIN
OTRExporter/assets/textures/parameter_static/gDPad.ia16.png
Normal file
BIN
OTRExporter/assets/textures/parameter_static/gDPad.ia16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Loading…
Add table
Add a link
Reference in a new issue