added new stars
This commit is contained in:
1 parent
69cb2f7cd3
commit
650ef4f460
240 files changed
+6977
-44
No files matched your search
@@ -45,6 +45,10 @@ bool GalaxyMenu::InitGalaxyMenu(std::string config_json, float scale) {
|
||||
star.name = stars_pt.second.get<std::string>("name", "error");
|
||||
star.scale = stars_pt.second.get<float>("scale", 0.0f);
|
||||
star.texture = stars_pt.second.get<std::string>("texture", "error");
|
||||
|
||||
star.textureName = GetFileName(star.texture);
|
||||
ResourceManager->TexList.AddTexture(star.texture);
|
||||
|
||||
star.position = Eigen::Vector2f(stars_pt.second.get<float>("position.x_coord", 0.0f), stars_pt.second.get<float>("position.y_coord", 0.0f));
|
||||
|
||||
/*..Levels..*/
|
||||
@@ -122,8 +126,8 @@ void GalaxyMenu::UpdateGalaxyMenu(float s_width, float s_height, size_t dt) {
|
||||
|
||||
tex_size = textureSizeNormalize(
|
||||
Eigen::Vector2f(
|
||||
((float)SE::ResourceManager->TexList.GetTextureWidth("star_" + std::to_string(i) + "_" + std::to_string(j))),
|
||||
((float)SE::ResourceManager->TexList.GetTextureHeight("star_" + std::to_string(i) + "_" + std::to_string(j))))
|
||||
((float)SE::ResourceManager->TexList.GetTextureWidth(galaxies[i].Stars[j].textureName)),
|
||||
((float)SE::ResourceManager->TexList.GetTextureHeight(galaxies[i].Stars[j].textureName)))
|
||||
); // normalized
|
||||
star_params.push_back(std::make_pair(
|
||||
Eigen::Vector2f(
|
||||
@@ -202,10 +206,10 @@ void GalaxyMenu::DrawGalaxyMenu() {
|
||||
if (stars_params.size() >= i) {
|
||||
for (int j = 0; j < stars_params[i].size(); j++) {
|
||||
if (planetHoverIndex == j) {
|
||||
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList["star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover"]);
|
||||
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList[galaxies[i].Stars[j].textureName]);
|
||||
}
|
||||
else {
|
||||
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList["star_" + std::to_string(i) + "_" + std::to_string(j)]);
|
||||
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList[galaxies[i].Stars[j].textureName]);
|
||||
}
|
||||
SE::Renderer->DrawRect(
|
||||
Eigen::Vector2f(
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
|
||||
// ::#Params#::
|
||||
std::string texture;
|
||||
std::string textureName;
|
||||
std::string name;
|
||||
Eigen::Vector2f position;
|
||||
float scale;
|
||||
|
||||
@@ -631,7 +631,11 @@ void TGameLevel::ReloadLevel()
|
||||
}
|
||||
BkgTexture = *rowIterator;
|
||||
|
||||
#ifdef NDEBUG
|
||||
ResourceManager->TexList.AddTexture("level_background/" + BkgTexture);
|
||||
#else
|
||||
ResourceManager->TexList.AddTexture("level_background/debug/" + BkgTexture);
|
||||
#endif
|
||||
|
||||
++rowIterator;
|
||||
|
||||
|
||||
+5
-17
@@ -130,7 +130,7 @@ void TMyApplication::InnerInit()
|
||||
// ------- UI -------
|
||||
|
||||
// TESTS of menu
|
||||
if (Menu.GalaxMenu.InitGalaxyMenu("galaxy_ptree.json")) {
|
||||
if (Menu.GalaxMenu.InitGalaxyMenu("levels/galaxy_ptree.json")) {
|
||||
std::cout << "ok" << std::endl;
|
||||
}
|
||||
else {
|
||||
@@ -318,10 +318,10 @@ void TMyApplication::LoadResources()
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/matte_screen.png", "matte_screen"));
|
||||
for (int i = 0; i < galaxies.size(); i++) {
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/galaxies/galaxy_" + std::to_string(i) + ".png", "galaxy_" + std::to_string(i)));
|
||||
for (int j = 0; j < galaxies[i]; j++) {
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j)));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover" + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover"));
|
||||
}
|
||||
//for (int j = 0; j < galaxies[i]; j++) {
|
||||
// TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j)));
|
||||
// TextureNamesToLoad.push_back(std::pair<std::string, std::string>("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover" + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover"));
|
||||
//}
|
||||
}
|
||||
|
||||
/*..buttons and level list plane textures..*/
|
||||
@@ -329,18 +329,6 @@ void TMyApplication::LoadResources()
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("black_square.png", "black_square"));
|
||||
|
||||
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot1.png", "levelshot1"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot2.png", "levelshot2"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot3.png", "levelshot3"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot4.png", "levelshot4"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot5.png", "levelshot5"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot6.png", "levelshot6"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot7.png", "levelshot7"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot8.png", "levelshot8"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot9.png", "levelshot9"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot10.png", "levelshot10"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot11.png", "levelshot11"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("levelshot12.png", "levelshot12"));
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>("game_end.png", "game_end"));
|
||||
|
||||
TextureNamesToLoad.push_back(std::pair<std::string, std::string>(CONST_BLOCK_TEXTURE1 + ".png", CONST_BLOCK_TEXTURE1));
|
||||
|
||||
Reference in new issue
Block a user