Skip to content

Commit

Permalink
zenkit migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Jun 19, 2024
1 parent 7aa42c9 commit 927851a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions game/graphics/lightgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ LightGroup::LightGroup(const SceneGlobals& scene)
for(int i = 0; i < count; ++i) {
zen->read_object_begin(obj);

presets.push_back(zenkit::LightPreset::parse(
*zen,
Gothic::inst().version().game == 1 ? zenkit::GameVersion::GOTHIC_1
: zenkit::GameVersion::GOTHIC_2));
zenkit::LightPreset preset {};
preset.load(*zen, Gothic::inst().version().game == 1 ? zenkit::GameVersion::GOTHIC_1
: zenkit::GameVersion::GOTHIC_2);
presets.emplace_back(std::move(preset));

if(!zen->read_object_end()) {
zen->skip_object(true);
Expand Down
2 changes: 1 addition & 1 deletion game/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void Resources::loadVdfs(const std::vector<std::u16string>& modvdfs, bool modFil

for(auto& i:archives) {
try {
auto in = phoenix::buffer::mmap(i.name);
auto in = zenkit::Read::from(i.name);
#ifdef __IOS__
// causes OOM on iPhone7
if(i.name.find(u"Speech")!=std::string::npos)
Expand Down
8 changes: 5 additions & 3 deletions game/world/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ World::World(GameSession& game, std::string_view file, bool startup, std::functi
}

try {
auto buf = entry->open();
auto world = zenkit::World::parse(buf, version().game == 1 ? zenkit::GameVersion::GOTHIC_1
: zenkit::GameVersion::GOTHIC_2);
auto buf = entry->open_read();
zenkit::World world;
world.load(buf.get(), version().game == 1 ? zenkit::GameVersion::GOTHIC_1
: zenkit::GameVersion::GOTHIC_2);

loadProgress(20);
auto& worldMesh = world.world_mesh;

Expand Down

0 comments on commit 927851a

Please sign in to comment.