From a351cbfc2a547e3407cf78fbcc93e585cac486d4 Mon Sep 17 00:00:00 2001 From: LMH Date: Sat, 15 Nov 2014 12:25:34 -1000 Subject: [PATCH] New powerups added to worldmap cheat menu --- src/object/player.cpp | 6 ++---- src/object/player.hpp | 1 - src/supertux/menu/worldmap_cheat_menu.cpp | 10 ++++++++++ src/supertux/menu/worldmap_cheat_menu.hpp | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 25b6cef75..c40a9ee6d 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -132,7 +132,6 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) : jump_early_apex(), on_ice(), ice_this_frame(), - light(1.0f,1.0f,1.0f), lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light-tiny.sprite")), dir(), old_dir(), @@ -1229,9 +1228,8 @@ Player::draw(DrawingContext& context) ; // don't draw Tux else { sprite->draw(context, get_pos(), LAYER_OBJECTS + 1); - // illuminate Tux in dark areas with earthflower bonus - context.get_light( get_bbox().get_middle(), &light ); - if (light.red + light.green + light.blue < 3.0 && player_status->bonus == EARTH_BONUS){ + // draw light with earthflower bonus + if (player_status->bonus == EARTH_BONUS){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, get_pos() + Vector(dir==LEFT ? 0 : 32, 0), 0); diff --git a/src/object/player.hpp b/src/object/player.hpp index 4205f9f7a..3de1abddc 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -282,7 +282,6 @@ private: bool jump_early_apex; bool on_ice; bool ice_this_frame; - Color light; SpritePtr lightsprite; public: diff --git a/src/supertux/menu/worldmap_cheat_menu.cpp b/src/supertux/menu/worldmap_cheat_menu.cpp index f566b0748..fbecf32b4 100644 --- a/src/supertux/menu/worldmap_cheat_menu.cpp +++ b/src/supertux/menu/worldmap_cheat_menu.cpp @@ -31,6 +31,8 @@ WorldmapCheatMenu::WorldmapCheatMenu() add_entry(MNID_GROW, _("Bonus: Grow")); add_entry(MNID_FIRE, _("Bonus: Fire")); add_entry(MNID_ICE, _("Bonus: Ice")); + add_entry(MNID_AIR, _("Bonus: Air")); + add_entry(MNID_EARTH, _("Bonus: Earth")); add_entry(MNID_SHRINK, _("Bonus: None")); add_hl(); add_entry(MNID_FINISH_LEVEL, _("Finish Level")); @@ -68,6 +70,14 @@ WorldmapCheatMenu::menu_action(MenuItem* item) status->bonus = ICE_BONUS; break; + case MNID_AIR: + status->bonus = AIR_BONUS; + break; + + case MNID_EARTH: + status->bonus = EARTH_BONUS; + break; + case MNID_SHRINK: status->bonus = NO_BONUS; break; diff --git a/src/supertux/menu/worldmap_cheat_menu.hpp b/src/supertux/menu/worldmap_cheat_menu.hpp index 15433df37..c287d499d 100644 --- a/src/supertux/menu/worldmap_cheat_menu.hpp +++ b/src/supertux/menu/worldmap_cheat_menu.hpp @@ -27,6 +27,8 @@ private: MNID_GROW, MNID_FIRE, MNID_ICE, + MNID_AIR, + MNID_EARTH, MNID_SHRINK, MNID_FINISH_LEVEL, MNID_RESET_LEVEL, -- 2.11.0