diff --git a/README.md b/README.md index e621f4f747b3d1f717011122f8fcdb25e5928a2c..972c01d3466c2ad35e9bb86ad02b7363b71cca00 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ <p float="left"> <img src="assets/images/Screenshot_0.png" width="280" /> <img src="assets/images/Screenshot_1.png" width="280" /> + <img src="assets/images/Screenshot_2.png" width="280" /> </p> diff --git a/assets/images/Screenshot_2.png b/assets/images/Screenshot_2.png new file mode 100644 index 0000000000000000000000000000000000000000..0f2eabdc42b9522152efdca9f1637a9f26ecf2dd Binary files /dev/null and b/assets/images/Screenshot_2.png differ diff --git a/source/main.cpp b/source/main.cpp index 71c6376aa083d33cf3f6b63edad7e97f11493949..74d321b84f11338748102796797672eab6d8aae2 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -46,35 +46,18 @@ int main(int argc, const char * argv[]) { std::cout << "Group Inited" << std::endl; //? Image 1 - /*std::vector<int> map = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, - 0, 0, 0, 3, 2, 2, 3, 0, 0, 0, - 0, 0, 3, 2, 1, 1, 2, 3, 0, 0, - 0, 3, 2, 2, 1, 1, 2, 2, 3, 0, - 0, 3, 2, 1, 1, 1, 1, 2, 3, 0, - 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - };*/ - std::vector<int> map = { - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, - 2, 0, 0, 1, 3, 1, 1, 2, 1, 1, 3, 1, 0, 0, 2, - 2, 0, 0, 3, 1, 1, 2, 2, 2, 1, 1, 3, 0, 0, 2, - 1, 0, 0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 0, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 2, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, - 1, 1, 0, 0, 2, 2, 0, 1, 0, 2, 2, 0, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, + 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, + 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, + 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, + 6, 6, 6, 6, 6, 6, 6, 7, 8, 9, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + }; size_t x = 0; @@ -83,26 +66,26 @@ int main(int argc, const char * argv[]) { std::vector<std::unique_ptr<megu::Image>> images; megu::Texture texture_0; - texture_0.store(megu::TextureBuffer("assets/textures/Cube_White.png")); + texture_0.store(megu::TextureBuffer("assets/textures/Cube_Red.png")); megu::Texture texture_1; - texture_1.store(megu::TextureBuffer("assets/textures/Cube_White.png")); + texture_1.store(megu::TextureBuffer("assets/textures/Cube_Green.png")); megu::Texture texture_2; - texture_2.store(megu::TextureBuffer("assets/textures/Cube_Red.png")); + texture_2.store(megu::TextureBuffer("assets/textures/Cube_Blue.png")); megu::Texture texture_3; - texture_3.store(megu::TextureBuffer("assets/textures/Cube_Blue.png")); + texture_3.store(megu::TextureBuffer("assets/textures/Cube_Yellow.png")); for(auto id : map) { - if(x == 15) { + if(x == 10) { x = 0; ++y; } if(id != 0) { - switch (id) { + switch (id % 4) { case 1: images.push_back(std::make_unique<megu::Image>(texture_1)); break; @@ -120,9 +103,9 @@ int main(int argc, const char * argv[]) { break; } - glm::vec2 pos = to_screen_coordinate({x, y}, 32.f, 32.f, 0.f); + glm::vec2 pos = to_screen_coordinate({x, y}, 32.f, 32.f, static_cast<float>(id)-3.f); - images.back()->setPosition({pos.x + window.width()/2 + 24.f, pos.y + window.height()/8}); + images.back()->setPosition({pos.x + window.width()/2, pos.y + window.height()/8}); } ++x;