diff --git a/SQCSim-common/define.h b/SQCSim-common/define.h index 337a9be..5ed4b13 100644 --- a/SQCSim-common/define.h +++ b/SQCSim-common/define.h @@ -37,7 +37,7 @@ typedef uint8_t BlockType; typedef uint8_t BoostType; enum BLOCK_TYPE { BTYPE_AIR, BTYPE_DIRT, BTYPE_GRASS, BTYPE_METAL, BTYPE_ICE, BTYPE_LAST }; -enum BOOST_TYPE { BTYPE_SPEED, BTYPE_HEAL, BTYPE_DAMAGE, BTYPE_INVINCIBLE }; +enum BOOST_TYPE { BTYPE_SPEED, BTYPE_HEAL, BTYPE_DAMAGE, BTYPE_INVINCIBLE, BTYPE_BOOST_LAST }; typedef uint64_t Timestamp; #ifdef _WIN32 diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index bacea3b..018c5e5 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -378,6 +378,15 @@ void Engine::LoadResource() { m_blockinfo[BTYPE_METAL] = new BlockInfo(BTYPE_METAL, "Metal", u, v, s, 1); m_textureAtlas.TextureIndexToCoord(texIceIndex, u, v, s, s); m_blockinfo[BTYPE_ICE] = new BlockInfo(BTYPE_ICE, "Ice", u, v, s, 1); + m_textureAtlas.TextureIndexToCoord(texBoostHeal, u, v, s, s); + m_boostinfo[BTYPE_HEAL] = new BoostInfo(BTYPE_HEAL, "Heal", u, v, s, 1); + m_textureAtlas.TextureIndexToCoord(texBoostDmg, u, v, s, s); + m_boostinfo[BTYPE_DAMAGE] = new BoostInfo(BTYPE_DAMAGE, "Dmg", u, v, s, 1); + m_textureAtlas.TextureIndexToCoord(texBoostSpd, u, v, s, s); + m_boostinfo[BTYPE_SPEED] = new BoostInfo(BTYPE_SPEED, "Spd", u, v, s, 1); + m_textureAtlas.TextureIndexToCoord(texIceIndex, u, v, s, s); + m_boostinfo[BTYPE_INVINCIBLE] = new BoostInfo(BTYPE_INVINCIBLE, "Inv", u, v, s, 1); + std::cout << " Loading and compiling shaders ..." << std::endl; if (!m_shader01.Load(SHADER_PATH "shader01.vert", SHADER_PATH "shader01.frag", true)) { diff --git a/SQCSim2021/engine.h b/SQCSim2021/engine.h index 0ed8b39..4f4f67f 100644 --- a/SQCSim2021/engine.h +++ b/SQCSim2021/engine.h @@ -5,6 +5,7 @@ #include #include "../SQCSim-common/array2d.h" #include "../SQCSim-common/blockinfo.h" +#include "../SQCSim-common/boostinfo.h" #include "../SQCSim-common/bullet.h" #include "../SQCSim-common/chunk.h" #include "../SQCSim-common/world.h" @@ -61,6 +62,7 @@ private: Connector m_conn; Shader m_shader01; BlockInfo* m_blockinfo[BTYPE_LAST]; + BoostInfo* m_boostinfo[BTYPE_BOOST_LAST]; TextureAtlas m_textureAtlas = TextureAtlas(BTYPE_LAST); World m_world = World();