diff --git a/assets/blender/Channels.blend b/assets/blender/Channels.blend new file mode 100644 index 0000000..581fae0 --- /dev/null +++ b/assets/blender/Channels.blend @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd27bb60cdba42d3e3ce713ae86d9f27548ef031b4e6af68fb5aa7344584335 +size 1125796 diff --git a/src/game/Level.cpp b/src/game/Level.cpp index 962565f..98e5684 100644 --- a/src/game/Level.cpp +++ b/src/game/Level.cpp @@ -46,8 +46,9 @@ namespace Game bgfx::setTexture(1, rendering.DitherTextures.DitherSampler, rendering.DitherTextures.FinalTex); bgfx::setTexture(2, rendering.DitherTextures.RampSampler, rendering.DitherTextures.RampTex); bgfx::setUniform(currentMaterial.Uniforms[Material::UTime], timeValues); - bgfx::setUniform(currentMaterial.Uniforms[Material::UDotColor], TestColor); + bgfx::setUniform(currentMaterial.Uniforms[Material::UDotColor], &TestColor.x); bgfx::setUniform(currentMaterial.Uniforms[Material::UTexInfo], texInfo); + bgfx::setUniform(currentMaterial.Uniforms[Material::UBaseColor], &BaseColor.x); bgfx::submit(currentMaterial.ViewID, currentMaterial.Shader); } @@ -79,8 +80,7 @@ namespace Game bx::Error err; bx::DirectoryReader dirIter; bx::FileInfo info; - bx::FilePath puzzleDirPath{"game/data/puzzles"}; - uint32_t puzIdx = 0; + bx::FilePath puzzleDirPath{Puzzle::PuzzleFileDir}; if (dirIter.open(puzzleDirPath, &err)) { while (true) @@ -92,11 +92,6 @@ namespace Game if (info.type != bx::FileType::File) continue; bx::StringView pathEnd = info.filePath.getExt(); if (bx::strCmpI(pathEnd, ".pzl") != 0) continue; - if (puzIdx >= BX_COUNTOF(Puzzles)) - { - LOG_WARN("Too many puzzles!"); - break; - } bx::FilePath fullPath = puzzleDirPath; fullPath.join(info.filePath); @@ -104,10 +99,17 @@ namespace Game Generated::Deserializer ser; ser.Init(fullPath); - if (Generated::Load(&Puzzles[puzIdx].Data, 1, ser)) + Generated::PuzzleData dataBuf; + if (ser.ReadT("PZZL", dataBuf)) { - Puzzles[puzIdx].Setup(); - ++puzIdx; + if (dataBuf.ID >= BX_COUNTOF(Puzzles)) + { + LOG_ERROR("Puzzle ID out of bounds: %u", dataBuf.ID); + ser.Finish(); + continue; + } + Puzzles[dataBuf.ID].Data = dataBuf; + Puzzles[dataBuf.ID].Setup(); } else { @@ -284,9 +286,6 @@ namespace Game { EData.Transform.Position = {0.0f, -1.0f, 0.0f}; EData.Transform.Scale = {100.0f, 1.0f, 100.0f}; - EData.TestColor[0] = 0.3f; - EData.TestColor[1] = 0.325f; - EData.TestColor[2] = 0.3f; } } @@ -296,7 +295,6 @@ namespace Game EData.ModelHandle = GameRendering::Get().GetModelHandleFromPath("models/zurg.gltf"); EData.Transform.Position = {0.0f, 0.0f, 0.0f}; - EData.TestColor[0] = 0.0f; } void WorldPuzzle::Setup() diff --git a/src/game/Level.h b/src/game/Level.h index 6c5a023..505e0b3 100644 --- a/src/game/Level.h +++ b/src/game/Level.h @@ -17,7 +17,8 @@ namespace Game { struct EntityRenderData { - float TestColor[4]{1.0f, 1.0f, 1.0f, 1.0f}; + Vec4 TestColor{1.0f, 1.0f, 1.0f, 1.0f}; + Vec4 BaseColor{0.0f, 0.0f, 0.0f, 1.0f}; Transform Transform; uint16_t MaterialHandle = UINT16_MAX; uint16_t ModelHandle = UINT16_MAX; diff --git a/src/game/Puzzle.cpp b/src/game/Puzzle.cpp index 0426eb3..06e3e7d 100644 --- a/src/game/Puzzle.cpp +++ b/src/game/Puzzle.cpp @@ -5,6 +5,7 @@ #include "bx/bx.h" #include "imgui.h" #include +#include namespace { @@ -186,6 +187,11 @@ namespace Generated { constexpr float UIPuzBoxSize = 26; + void WritePuzzleFilePath(char* buf, int32_t bufSize, uint16_t puzID) + { + bx::snprintf(buf, bufSize, "%s/%u.pzl", Puzzle::PuzzleFileDir, puzID); + } + const char* GetShortNodeName(const PuzzleNode& node) { PuzzleElementType::Enum elemMax = PuzzleElementType::None; @@ -203,7 +209,22 @@ namespace Generated bool isVisible = true; if (ImGui::Begin("Puzzle", &isVisible)) { - ImGui::Text("%s", obj.PuzzleName); + if (ImGui::Button("Delete Puzzle")) + { + char filepath[128]{0}; + WritePuzzleFilePath(filepath, sizeof(filepath), obj.ID); + remove(filepath); + obj.ID = UINT16_MAX; + ImGui::End(); + return false; + } + int32_t val = obj.ID; + if (ImGui::InputInt("ID", &val)) + { + obj.ID = val; + dataChanged = true; + } + dataChanged = ImGui::InputText("Name", obj.PuzzleName, sizeof(obj.PuzzleName)) || dataChanged; int32_t W = obj.WidthTiles; int32_t H = obj.HeightTiles; @@ -232,13 +253,31 @@ namespace Generated for (int32_t y = 0; y < obj.HeightTiles; ++y) { + ImGui::PushID(y); for (int32_t x = 0; x < obj.WidthTiles; ++x) { + ImGui::PushID(x); PuzzleNode& node = obj.PlacedNodes[Puzzle::Config::MaxPuzzleSizeTiles * y + x]; ImVec2 pos = ImVec2{puzCursorStart.x + x * UIPuzBoxSize + 5, puzCursorStart.y + y * UIPuzBoxSize}; ImGui::SetCursorScreenPos(pos); ImGui::Text("%s", GetShortNodeName(node)); + ImGui::SetCursorScreenPos(pos); + if (x % Puzzle::Config::CardSize == 0 && y % Puzzle::Config::CardSize == 0) + { + ImGui::InvisibleButton("bn", {UIPuzBoxSize * 2, UIPuzBoxSize * 2}); + if (ImGui::BeginDragDropTarget()) + { + if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("cardtype", 0)) + { + uint32_t CardIdx = *reinterpret_cast(payload->Data); + obj.PlacedCards[obj.PlacedCardCount].RefCard = {(uint16_t)CardIdx}; + } + ImGui::EndDragDropTarget(); + } + } + ImGui::PopID(); } + ImGui::PopID(); } for (int32_t y = 0; y <= obj.HeightTiles; ++y) @@ -256,15 +295,13 @@ namespace Generated x % Puzzle::Config::CardSize == 0 ? 0xFFFFFFFF : 0x11FFFFFF); } - ImGui::Spacing(); - ImGui::Spacing(); + ImVec2 pos = ImVec2{puzCursorStart.x + obj.WidthTiles * UIPuzBoxSize + 5, + puzCursorStart.y + obj.HeightTiles * UIPuzBoxSize}; + ImGui::SetCursorScreenPos(pos); + ImGui::NewLine(); if (ImGui::TreeNodeEx("Available Cards", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) { - for (int32_t i = 0; i < obj.AvailableCardCount; ++i) - { - ImGui::Text("Card"); - } ImGui::TreePop(); } } @@ -273,10 +310,10 @@ namespace Generated if (dataChanged) { char path[128]{0}; - bx::snprintf(path, sizeof(path), "game/data/puzzles/%s.pzl", obj.PuzzleName); + WritePuzzleFilePath(path, sizeof(path), obj.ID); Serializer ser; ser.Init(path); - if (Save(&obj, 1, ser)) + if (ser.WriteT("PZZL", obj)) { LOG("Saved to %s", path); } diff --git a/src/game/Puzzle.h b/src/game/Puzzle.h index d1d6d26..cc18dcf 100644 --- a/src/game/Puzzle.h +++ b/src/game/Puzzle.h @@ -6,6 +6,7 @@ namespace Puzzle { + constexpr const char* PuzzleFileDir = "game/data/puzzles/"; struct Config { static constexpr uint32_t CardSize = 2; diff --git a/src/game/compiled-shaders/dx11/frag.bin b/src/game/compiled-shaders/dx11/frag.bin index 43ccdbe..8167e08 100644 --- a/src/game/compiled-shaders/dx11/frag.bin +++ b/src/game/compiled-shaders/dx11/frag.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:19091b33d3f9960f76ab77f07475bf6a50d97a59152cc26b05f452b1215fbb61 -size 3458 +oid sha256:3c2953a0e0de93277cbf340eff51557bb8a322b36255df693cebd8d175a5b003 +size 3900 diff --git a/src/game/compiled-shaders/glsl/frag.bin b/src/game/compiled-shaders/glsl/frag.bin index afbf9f1..8fbb81c 100644 --- a/src/game/compiled-shaders/glsl/frag.bin +++ b/src/game/compiled-shaders/glsl/frag.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eb10cc539e37200a8dc16006274990c6c44e0ab0e5bcde1b91580c240fc23ba7 -size 13225 +oid sha256:484b68fb533a5395db797f26c2a650228096c03d661d841b8eeb1e5f989b0fda +size 13317 diff --git a/src/game/compiled-shaders/spirv/frag.bin b/src/game/compiled-shaders/spirv/frag.bin index 75a4d5e..221f818 100644 --- a/src/game/compiled-shaders/spirv/frag.bin +++ b/src/game/compiled-shaders/spirv/frag.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4fc6090b25b95dffc1d9c3871a0335b6c1416722a595bf73426a162f3ea48901 -size 3599 +oid sha256:15289052836fd4c95c9ce84d4a0ec6a5ec33ec1679709a9d53d51cf7d2105182 +size 4430 diff --git a/src/game/data/puzzles/0.pzl b/src/game/data/puzzles/0.pzl new file mode 100644 index 0000000..03dc239 --- /dev/null +++ b/src/game/data/puzzles/0.pzl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46b544848f139d2a7f3dd20643596e338f0aaab45394c96ba67e8f058915c8d9 +size 18124 diff --git a/src/game/data/puzzles/hell yea.pzl b/src/game/data/puzzles/hell yea.pzl deleted file mode 100644 index aed0f8d..0000000 --- a/src/game/data/puzzles/hell yea.pzl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b9208edea8425a4f88b27a2c4d5efee5ba64fd8732a24fbada5ef0e89aa6073 -size 18110 diff --git a/src/game/data/puzzles/test.pzl b/src/game/data/puzzles/test.pzl deleted file mode 100644 index b983ed5..0000000 --- a/src/game/data/puzzles/test.pzl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:de5ca966c746712655f85e1333f1c7666bc6ceed22dd63d44830f01e96515836 -size 18110 diff --git a/src/game/data/static/puzzle.dat b/src/game/data/static/puzzle.dat index 5ca1242..3a28f6b 100644 Binary files a/src/game/data/static/puzzle.dat and b/src/game/data/static/puzzle.dat differ diff --git a/src/game/mini.def b/src/game/mini.def index 01d9fa9..f0a9e52 100644 --- a/src/game/mini.def +++ b/src/game/mini.def @@ -1,3 +1,43 @@ +type Vec2 +{ + f32 X + f32 Y +} + +type Vec3 +{ + f32 X + f32 Y + f32 Z +} + +type Vec4 +{ + f32 X + f32 Y + f32 Z + f32 W +} + +type Mat3 +{ + f32 M Arr(9) Default("{ + 1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 1.0f + }") +} + +type Mat4 +{ + f32 M Arr(16) Default("{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }") +} + type PuzPos { i8 X @@ -60,6 +100,8 @@ type PlacedPuzzleCard type PuzzleData { + u16 ID + str PuzzleName Arr(64) u8 WidthTiles u8 HeightTiles u32 AvailableCardCount @@ -69,5 +111,4 @@ type PuzzleData PuzzleNode PlacedNodes Arr(1024) u32 GoalPositionCount ElemPos GoalPositions Arr(16) - str PuzzleName Arr(64) } diff --git a/src/game/rendering/Rendering.cpp b/src/game/rendering/Rendering.cpp index a978ff3..0bd6b8d 100644 --- a/src/game/rendering/Rendering.cpp +++ b/src/game/rendering/Rendering.cpp @@ -13,10 +13,12 @@ #include "bx/constants.h" #include "bx/filepath.h" #include "bx/math.h" +#include "bx/string.h" #include "bx/timer.h" #include #include #include +#include #include #include @@ -505,18 +507,54 @@ namespace Game } Vec3 quadPos = level.UIQuads.Get({0}).EData.Transform.GetPosition(); ImGui::Text("%f %f %f", quadPos.x, quadPos.y, quadPos.z); + + if (ImGui::ColorEdit3("Base Color", &DefaultBaseColor.x)) + { + auto& tiles = GetInstance().GameLevel.PuzzleTiles; + for (int32_t i = 0; i < tiles.Count; ++i) + { + tiles.Data[i].EData.BaseColor = DefaultBaseColor; + } + } + if (ImGui::ColorEdit3("Dot Color", &DefaultTileColor.x)) + { + auto& tiles = GetInstance().GameLevel.PuzzleTiles; + for (int32_t i = 0; i < tiles.Count; ++i) + { + tiles.Data[i].EData.TestColor = DefaultTileColor; + } + } + ImGui::Text("Shader log:"); ImGui::TextWrapped("%s", GetShared().Dev.ShaderLog); } ImGui::End(); if (ImGui::Begin("Puzzles")) { - ImGui::Text("List"); + if (ImGui::Button("Add")) + { + bool found = false; + for (int32_t i = 0; i < BX_COUNTOF(level.Puzzles); ++i) + { + auto& puz = level.Puzzles[i].Data; + if (puz.ID == UINT16_MAX) + { + bx::strCopy(puz.PuzzleName, sizeof(puz.PuzzleName), "Unnamed Puzzle"); + puz.ID = i; + found = true; + break; + } + } + if (!found) + { + LOG_ERROR("Too many puzzles!"); + } + } ImGui::Separator(); for (int32_t i = 0; i < BX_COUNTOF(level.Puzzles); ++i) { auto& puzzleData = level.Puzzles[i].Data; - if (puzzleData.PuzzleName[0] == 0) continue; + if (puzzleData.ID == UINT16_MAX) continue; bool isSelected = debug.SelectedDebugLevel == i; ImGui::PushID("selectable"); @@ -525,21 +563,16 @@ namespace Game debug.SelectedDebugLevel = isSelected ? UINT16_MAX : i; } ImGui::PopID(); - if (isSelected) - { - ImGui::PushID("edit field"); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - ImGui::InputText("", puzzleData.PuzzleName, sizeof(Generated::PuzzleData::PuzzleName)); - ImGui::PopID(); - - if (!Generated::RenderDebugUI(puzzleData)) - { - debug.SelectedDebugLevel = UINT16_MAX; - } - } } } ImGui::End(); + if (debug.SelectedDebugLevel < BX_COUNTOF(level.Puzzles)) + { + if (!Generated::RenderDebugUI(level.Puzzles[debug.SelectedDebugLevel].Data)) + { + debug.SelectedDebugLevel = UINT16_MAX; + } + } if (ImGui::Begin("Cards")) { Generated::StaticPuzzleData& staticData = Generated::GetStaticPuzzleData(); @@ -559,7 +592,15 @@ namespace Game Generated::StaticPuzzleCard& card = staticData.Cards[i]; ImGui::PushID(i); - ImGui::Text("%i", i); + char cardName[64]{0}; + bx::snprintf(cardName, sizeof(cardName), "%i", i); + ImGui::Selectable(cardName); + if (ImGui::BeginDragDropSource()) + { + ImGui::Text("Card %i", i); + ImGui::SetDragDropPayload("cardtype", &i, sizeof(i)); + ImGui::EndDragDropSource(); + } Tools::ModelDropdown(card.ModelHandle); for (int32_t y = 0; y < Puzzle::Config::CardSize; ++y) @@ -634,6 +675,7 @@ namespace Game mat.Uniforms[Material::UTime] = bgfx::createUniform("u_time", bgfx::UniformType::Vec4); mat.Uniforms[Material::UDotColor] = bgfx::createUniform("u_testColor", bgfx::UniformType::Vec4); mat.Uniforms[Material::UTexInfo] = bgfx::createUniform("u_texInfo", bgfx::UniformType::Vec4); + mat.Uniforms[Material::UBaseColor] = bgfx::createUniform("u_baseColor", bgfx::UniformType::Vec4); mat.Textures[0].Handle = tex; mat.Textures[0].SamplerHandle = sampler; mat.ViewID = view; diff --git a/src/game/rendering/Rendering.h b/src/game/rendering/Rendering.h index a8c1b93..3158f6c 100644 --- a/src/game/rendering/Rendering.h +++ b/src/game/rendering/Rendering.h @@ -46,6 +46,7 @@ namespace Game UTime = 0, UDotColor = 1, UTexInfo = 2, + UBaseColor = 3, }; bgfx::ProgramHandle Shader; @@ -108,6 +109,8 @@ namespace Game uint16_t MainViewID = 10; float LastShaderLoadTime = 0.0f; int32_t DitherRecursion = 1; + Vec4 DefaultBaseColor; + Vec4 DefaultTileColor; public: void Setup(); diff --git a/src/game/shaders/frag.sc b/src/game/shaders/frag.sc index a950e32..38eeb20 100644 --- a/src/game/shaders/frag.sc +++ b/src/game/shaders/frag.sc @@ -11,6 +11,7 @@ SAMPLER2D(s_rampSampler, 2); uniform vec4 u_time; uniform vec4 u_testColor; uniform vec4 u_texInfo; +uniform vec4 u_baseColor; float calcBrightness(vec3 lightPos, vec3 vertPos, vec3 normal) { @@ -103,8 +104,7 @@ void main() float g = dither(brightness * texColor.g, v_uv0); float b = dither(brightness * texColor.b, v_uv0); // float3 finalColor = vec3(r, g, b); - float3 finalColor = dither(brightness, v_uv0); + float3 ditheredColor = dither(brightness, v_uv0); + float3 finalColor = mix(u_baseColor, texColor, ditheredColor); gl_FragColor = vec4(finalColor, 1.0); - // gl_FragColor = vec4(finalColor * 0.8 + subLayer * 0.2, 1.0); - // gl_FragColor = vec4(finalColor * 0.8 + vec3(uv % 1, 0.0) * 0.2, 1.0); } diff --git a/src/gen/Generated.cpp b/src/gen/Generated.cpp index 332ef61..2feba1b 100644 --- a/src/gen/Generated.cpp +++ b/src/gen/Generated.cpp @@ -22,6 +22,108 @@ namespace Generated } return isOk; } + bool Save(const Vec2* obj, uint32_t count, Serializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Save(&obj[i].X, 1, serializer) && isOk; + isOk = Save(&obj[i].Y, 1, serializer) && isOk; + } + return isOk; + } + bool Load(Vec2* obj, uint32_t count, Deserializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Load(&obj[i].X, 1, serializer) && isOk; + isOk = Load(&obj[i].Y, 1, serializer) && isOk; + } + return isOk; + } + bool Save(const Vec3* obj, uint32_t count, Serializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Save(&obj[i].X, 1, serializer) && isOk; + isOk = Save(&obj[i].Y, 1, serializer) && isOk; + isOk = Save(&obj[i].Z, 1, serializer) && isOk; + } + return isOk; + } + bool Load(Vec3* obj, uint32_t count, Deserializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Load(&obj[i].X, 1, serializer) && isOk; + isOk = Load(&obj[i].Y, 1, serializer) && isOk; + isOk = Load(&obj[i].Z, 1, serializer) && isOk; + } + return isOk; + } + bool Save(const Vec4* obj, uint32_t count, Serializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Save(&obj[i].X, 1, serializer) && isOk; + isOk = Save(&obj[i].Y, 1, serializer) && isOk; + isOk = Save(&obj[i].Z, 1, serializer) && isOk; + isOk = Save(&obj[i].W, 1, serializer) && isOk; + } + return isOk; + } + bool Load(Vec4* obj, uint32_t count, Deserializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Load(&obj[i].X, 1, serializer) && isOk; + isOk = Load(&obj[i].Y, 1, serializer) && isOk; + isOk = Load(&obj[i].Z, 1, serializer) && isOk; + isOk = Load(&obj[i].W, 1, serializer) && isOk; + } + return isOk; + } + bool Save(const Mat3* obj, uint32_t count, Serializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Save(obj[i].M, 9, serializer) && isOk; + } + return isOk; + } + bool Load(Mat3* obj, uint32_t count, Deserializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Load(obj[i].M, 9, serializer) && isOk; + } + return isOk; + } + bool Save(const Mat4* obj, uint32_t count, Serializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Save(obj[i].M, 16, serializer) && isOk; + } + return isOk; + } + bool Load(Mat4* obj, uint32_t count, Deserializer& serializer) + { + bool isOk = true; + for (uint32_t i = 0; i < count; ++i) + { + isOk = Load(obj[i].M, 16, serializer) && isOk; + } + return isOk; + } bool Save(const PuzPos* obj, uint32_t count, Serializer& serializer) { bool isOk = true; @@ -187,6 +289,7 @@ namespace Generated bool isOk = true; for (uint32_t i = 0; i < count; ++i) { + isOk = Save(&obj[i].ID, 1, serializer) && isOk; isOk = Save(&obj[i].WidthTiles, 1, serializer) && isOk; isOk = Save(&obj[i].HeightTiles, 1, serializer) && isOk; isOk = Save(&obj[i].AvailableCardCount, 1, serializer) && isOk; @@ -205,6 +308,7 @@ namespace Generated bool isOk = true; for (uint32_t i = 0; i < count; ++i) { + isOk = Load(&obj[i].ID, 1, serializer) && isOk; isOk = Load(&obj[i].WidthTiles, 1, serializer) && isOk; isOk = Load(&obj[i].HeightTiles, 1, serializer) && isOk; isOk = Load(&obj[i].AvailableCardCount, 1, serializer) && isOk; diff --git a/src/gen/Generated.h b/src/gen/Generated.h index fc0a6ed..2994819 100644 --- a/src/gen/Generated.h +++ b/src/gen/Generated.h @@ -52,6 +52,46 @@ namespace Generated "#", }; }; + struct Vec2 + { + static constexpr uint32_t Hash = 4242122113; + float X = {}; + float Y = {}; + }; + struct Vec3 + { + static constexpr uint32_t Hash = 1694997017; + float X = {}; + float Y = {}; + float Z = {}; + }; + struct Vec4 + { + static constexpr uint32_t Hash = 447058821; + float X = {}; + float Y = {}; + float Z = {}; + float W = {}; + }; + struct Mat3 + { + static constexpr uint32_t Hash = 3364737048; + float M[9] = { + 1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 1.0f + }; + }; + struct Mat4 + { + static constexpr uint32_t Hash = 1650094019; + float M[16] = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }; + }; struct PuzPos { static constexpr uint32_t Hash = 1834398141; @@ -102,7 +142,8 @@ namespace Generated }; struct PuzzleData { - static constexpr uint32_t Hash = 2015691597; + static constexpr uint32_t Hash = 255994202; + uint16_t ID = {}; uint8_t WidthTiles = {}; uint8_t HeightTiles = {}; uint32_t AvailableCardCount = {}; @@ -116,6 +157,16 @@ namespace Generated }; bool Save(const PuzzleElementType::Enum* obj, uint32_t count, Serializer& serializer); bool Load(PuzzleElementType::Enum* obj, uint32_t count, Deserializer& serializer); + bool Save(const Vec2* obj, uint32_t count, Serializer& serializer); + bool Load(Vec2* obj, uint32_t count, Deserializer& serializer); + bool Save(const Vec3* obj, uint32_t count, Serializer& serializer); + bool Load(Vec3* obj, uint32_t count, Deserializer& serializer); + bool Save(const Vec4* obj, uint32_t count, Serializer& serializer); + bool Load(Vec4* obj, uint32_t count, Deserializer& serializer); + bool Save(const Mat3* obj, uint32_t count, Serializer& serializer); + bool Load(Mat3* obj, uint32_t count, Deserializer& serializer); + bool Save(const Mat4* obj, uint32_t count, Serializer& serializer); + bool Load(Mat4* obj, uint32_t count, Deserializer& serializer); bool Save(const PuzPos* obj, uint32_t count, Serializer& serializer); bool Load(PuzPos* obj, uint32_t count, Deserializer& serializer); bool Save(const ElemPos* obj, uint32_t count, Serializer& serializer); diff --git a/src/models/ConcretePlane.glb b/src/models/ConcretePlane.glb index 621714b..b071319 100644 --- a/src/models/ConcretePlane.glb +++ b/src/models/ConcretePlane.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c3187769a45718de02c01904e832c38143faa7ddbffd88ce86d336257403ddb -size 1480 +oid sha256:1c5759a2e563ef4260920f50dfac9c057cb1e0ad69b0994bd420f1123b40eeae +size 1464