loading works!!

This commit is contained in:
Asuro
2025-03-11 01:19:13 +01:00
parent c7377c3452
commit ffad8f8460
11 changed files with 306 additions and 38 deletions

View File

@@ -38,7 +38,7 @@ namespace Generated
}
const StaticPuzzleCard& GetCard(const StaticPuzzleData& data, StaticPuzzleCardHandle H)
{
// assert(IsValid(H));
assert(IsValid(H));
return data.Cards[H.Idx];
}
@@ -203,7 +203,7 @@ namespace Generated
if (dataChanged)
{
char path[128]{0};
bx::snprintf(path, sizeof(path), "game/data/%s.pzl", obj.PuzzleName);
bx::snprintf(path, sizeof(path), "game/data/puzzles/%s.pzl", obj.PuzzleName);
Serializer ser;
ser.Init(path);
if (Save(&obj, 1, ser))
@@ -231,4 +231,15 @@ namespace Generated
lhs += rhs;
return lhs;
}
PuzPos operator-=(PuzPos lhs, const PuzPos& rhs)
{
lhs.X -= rhs.X;
lhs.Y -= rhs.Y;
return lhs;
}
PuzPos operator-(PuzPos lhs, const PuzPos& rhs)
{
lhs -= rhs;
return lhs;
}
} // namespace Generated