mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 22:21:15 +00:00
Update assets
This commit is contained in:
parent
e6d374c843
commit
d1d5671c0b
@ -5,6 +5,12 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <interleaf.h>
|
#include <interleaf.h>
|
||||||
#include <object.h>
|
#include <object.h>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
|
struct AssetView {
|
||||||
|
std::string_view name;
|
||||||
|
std::string_view extra;
|
||||||
|
};
|
||||||
|
|
||||||
si::Interleaf::Version version = si::Interleaf::Version2_2;
|
si::Interleaf::Version version = si::Interleaf::Version2_2;
|
||||||
uint32_t bufferSize = 65536;
|
uint32_t bufferSize = 65536;
|
||||||
@ -16,32 +22,74 @@ si::MemoryBuffer mxHd;
|
|||||||
|
|
||||||
void CreateWidescreen()
|
void CreateWidescreen()
|
||||||
{
|
{
|
||||||
|
std::string result = out + "/widescreen.si";
|
||||||
|
constexpr const AssetView widescreenBitmaps[] = {
|
||||||
|
{"GaraDoor_Background_Wide",
|
||||||
|
"World:current, StartWith:\\Lego\\Scripts\\Isle\\Isle;1160, RemoveWith:\\Lego\\Scripts\\Isle\\Isle;1161"}
|
||||||
|
};
|
||||||
|
|
||||||
si::Interleaf si;
|
si::Interleaf si;
|
||||||
mxHd.seek(0, si::MemoryBuffer::SeekStart);
|
mxHd.seek(0, si::MemoryBuffer::SeekStart);
|
||||||
si.Read(&mxHd);
|
si.Read(&mxHd);
|
||||||
|
|
||||||
si::Object GaraDoor_Background_Wide;
|
int i = 0;
|
||||||
const char extra[] =
|
for (const AssetView& asset : widescreenBitmaps) {
|
||||||
"World:current, StartWith:\\Lego\\Scripts\\Isle\\Isle;1160, RemoveWith:\\Lego\\Scripts\\Isle\\Isle;1161";
|
si::Object* object = new si::Object;
|
||||||
GaraDoor_Background_Wide.type_ = si::MxOb::Bitmap;
|
std::string file = std::string("widescreen/") + std::string(asset.name) + ".bmp";
|
||||||
GaraDoor_Background_Wide.flags_ = MxDSAction::c_enabled | MxDSAction::c_bit4;
|
object->id_ = i;
|
||||||
GaraDoor_Background_Wide.duration_ = -1;
|
object->type_ = si::MxOb::Bitmap;
|
||||||
GaraDoor_Background_Wide.loops_ = 1;
|
object->flags_ = MxDSAction::c_enabled | MxDSAction::c_bit4;
|
||||||
GaraDoor_Background_Wide.extra_ = si::bytearray(extra, sizeof(extra));
|
object->duration_ = -1;
|
||||||
GaraDoor_Background_Wide.presenter_ = "MxStillPresenter";
|
object->loops_ = 1;
|
||||||
GaraDoor_Background_Wide.name_ = "GaraDoor_Background_Wide";
|
object->extra_ = si::bytearray(asset.extra.data(), asset.extra.length());
|
||||||
GaraDoor_Background_Wide.filetype_ = si::MxOb::STL;
|
object->presenter_ = "MxStillPresenter";
|
||||||
GaraDoor_Background_Wide.location_ = si::Vector3(-240.0, 0.0, -1.0);
|
object->name_ = asset.name;
|
||||||
GaraDoor_Background_Wide.direction_ = si::Vector3(0, 0, 0);
|
object->filetype_ = si::MxOb::STL;
|
||||||
GaraDoor_Background_Wide.up_ = si::Vector3(0, 1.0, 0);
|
object->location_ = si::Vector3(-240.0, 0.0, -1.0);
|
||||||
GaraDoor_Background_Wide.ReplaceWithFile("widescreen/GaraDoor_Background_Wide.bmp");
|
object->direction_ = si::Vector3(0, 0, 0);
|
||||||
si.AppendChild(&GaraDoor_Background_Wide);
|
object->up_ = si::Vector3(0, 1.0, 0);
|
||||||
|
object->ReplaceWithFile(file.c_str());
|
||||||
|
si.AppendChild(object);
|
||||||
|
depfile << result << ": " << (std::filesystem::current_path() / file).string() << std::endl;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
std::string file = out + "/widescreen.si";
|
si.Write(result.c_str());
|
||||||
depfile << file << ": " << (std::filesystem::current_path() / "widescreen/GaraDoor_Background_Wide.bmp").string()
|
}
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
si.Write(file.c_str());
|
void CreateHDMusic()
|
||||||
|
{
|
||||||
|
std::string result = out + "/hdmusic.si";
|
||||||
|
constexpr const AssetView wavAudio[] = {{"JBMusic1_HD", "Replace:\\Lego\\Scripts\\Isle\\Jukebox;55"}};
|
||||||
|
|
||||||
|
si::Interleaf si;
|
||||||
|
mxHd.seek(0, si::MemoryBuffer::SeekStart);
|
||||||
|
si.Read(&mxHd);
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for (const AssetView& asset : wavAudio) {
|
||||||
|
si::Object* object = new si::Object;
|
||||||
|
std::string file = std::string("hdmusic/") + std::string(asset.name) + ".wav";
|
||||||
|
object->id_ = i;
|
||||||
|
object->type_ = si::MxOb::Sound;
|
||||||
|
object->flags_ = MxDSAction::c_enabled;
|
||||||
|
object->duration_ = 125850;
|
||||||
|
object->loops_ = 1;
|
||||||
|
object->extra_ = si::bytearray(asset.extra.data(), asset.extra.length());
|
||||||
|
object->presenter_ = "MxWavePresenter";
|
||||||
|
object->name_ = asset.name;
|
||||||
|
object->filetype_ = si::MxOb::WAV;
|
||||||
|
object->location_ = si::Vector3(0, 0, 0);
|
||||||
|
object->direction_ = si::Vector3(0, 0, 0);
|
||||||
|
object->up_ = si::Vector3(0, 1.0, 0);
|
||||||
|
object->volume_ = 79;
|
||||||
|
object->ReplaceWithFile(file.c_str());
|
||||||
|
si.AppendChild(object);
|
||||||
|
depfile << result << ": " << (std::filesystem::current_path() / file).string() << std::endl;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
si.Write(result.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@ -56,5 +104,6 @@ int main(int argc, char* argv[])
|
|||||||
mxHd.WriteU32(bufferCount);
|
mxHd.WriteU32(bufferCount);
|
||||||
|
|
||||||
CreateWidescreen();
|
CreateWidescreen();
|
||||||
|
CreateHDMusic();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user