From: Ingo Ruhnke Date: Sun, 3 Aug 2014 03:44:02 +0000 (+0200) Subject: Merge branch 'feature/sdl2' X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b4ffa23e2beb6d10f8f5f2fccd4b41fb3e344759;p=supertux.git Merge branch 'feature/sdl2' Conflicts: .gitignore WHATSNEW.txt data/fonts/zh-white-big.stf data/fonts/zh-white.stf data/images/engine/fonts/zh/shadow.png data/images/engine/fonts/zh/white.png data/images/powerups/egg/egg.sprite data/images/tiles.strf data/levels/bonus1/az.po data/levels/bonus1/ne.po data/levels/bonus1/sv.po data/levels/bonus2/az.po data/levels/bonus2/pt_BR.po data/levels/incubator/az.po data/levels/incubator/de.po data/levels/incubator/nn.po data/levels/incubator/pt_BR.po data/levels/incubator/ru.po data/levels/incubator/sv.po data/levels/incubator/worldmap.stwm data/levels/world1/ar.po data/levels/world1/az.po data/levels/world1/be.po data/levels/world1/ca.po data/levels/world1/cmn.po data/levels/world1/cs.po data/levels/world1/da.po data/levels/world1/de.po data/levels/world1/el.po data/levels/world1/eo.po data/levels/world1/es.po data/levels/world1/et.po data/levels/world1/fi.po data/levels/world1/fr.po data/levels/world1/hi_IN.po data/levels/world1/hr.po data/levels/world1/hu.po data/levels/world1/it.po data/levels/world1/ja.po data/levels/world1/lt.po data/levels/world1/nb.po data/levels/world1/ne.po data/levels/world1/nl.po data/levels/world1/nn.po data/levels/world1/pl.po data/levels/world1/pt.po data/levels/world1/pt_BR.po data/levels/world1/ro.po data/levels/world1/ru.po data/levels/world1/sl.po data/levels/world1/sv.po data/levels/world1/tr.po data/levels/world1/uk.po data/levels/world1/uz.po data/levels/world1/vi.po data/levels/world1/zh_CN.po data/levels/world1/zh_TW.po data/levels/world2/az.po data/levels/world2/cs.po data/levels/world2/de.po data/levels/world2/hu.po data/levels/world2/nn.po data/levels/world2/pt_BR.po data/levels/world2/sv.po data/locale/ar.po data/locale/az.po data/locale/be.po data/locale/ca.po data/locale/cmn.po data/locale/cs.po data/locale/da.po data/locale/de.po data/locale/el.po data/locale/eo.po data/locale/es.po data/locale/et.po data/locale/fi.po data/locale/fr.po data/locale/hi_IN.po data/locale/hr.po data/locale/hu.po data/locale/it.po data/locale/ja.po data/locale/lt.po data/locale/nb.po data/locale/ne.po data/locale/nl.po data/locale/nn.po data/locale/pl.po data/locale/pt.po data/locale/pt_BR.po data/locale/ro.po data/locale/ru.po data/locale/sl.po data/locale/sv.po data/locale/tr.po data/locale/uk.po data/locale/uz.po data/locale/vi.po data/locale/zh_CN.po data/locale/zh_TW.po external/squirrel/squirrel/sqdebug.cpp src/object/bonus_block.cpp src/object/explosion.cpp src/object/player.cpp src/supertux/game_session.cpp src/supertux/level.cpp src/supertux/main.cpp src/supertux/resources.cpp src/video/sdl/sdl_renderer.cpp src/worldmap/worldmap.cpp --- b4ffa23e2beb6d10f8f5f2fccd4b41fb3e344759 diff --cc data/images/powerups/egg/egg-0.png index 000000000,6f63e35c6..8d6105ff9 mode 000000,100644..100644 Binary files differ diff --cc src/object/bonus_block.cpp index 83cab765c,6f4c05726..5d6afcfbe --- a/src/object/bonus_block.cpp +++ b/src/object/bonus_block.cpp @@@ -373,55 -370,51 +373,98 @@@ BonusBlock::try_drop(Player *player { sector->add_object(new PowerUp(get_pos() + Vector(0, 32), "images/powerups/iceflower/iceflower.sprite")); sound_manager->play("sounds/upgrade.wav"); + countdown = true; + break; + } + + case CONTENT_STAR: + { + sector->add_object(new Star(get_pos() + Vector(0, 32), direction)); + sound_manager->play("sounds/upgrade.wav"); + countdown = true; + break; + } + + case CONTENT_1UP: + { + sector->add_object(new OneUp(get_pos(), DOWN)); + sound_manager->play("sounds/upgrade.wav"); + countdown = true; + break; + } + + case CONTENT_CUSTOM: + { + //NOTE: non-portable trampolines could be moved to CONTENT_CUSTOM, but they should not drop + object->set_pos(get_pos() + Vector(0, 32)); + sector->add_object(object); + object = 0; + sound_manager->play("sounds/upgrade.wav"); + countdown = true; + break; + } + + case CONTENT_SCRIPT: + { break; } // because scripts always run, this prevents default contents from being assumed + + case CONTENT_LIGHT: + { + try_open(player); + break; + } + case CONTENT_TRAMPOLINE: + { + try_open(player); + break; + } + case CONTENT_RAIN: + { + try_open(player); break; } + + case CONTENT_STAR: + { + sector->add_object(new Star(get_pos() + Vector(0, 32), direction)); + sound_manager->play("sounds/upgrade.wav"); + break; + } + + case CONTENT_1UP: + { + sector->add_object(new OneUp(get_pos(), DOWN)); + sound_manager->play("sounds/upgrade.wav"); + break; + } + + case CONTENT_CUSTOM: + { + //TODO: non-portable trampolines could be moved to CONTENT_CUSTOM, but they should not drop + object->set_pos(get_pos() + Vector(0, 32)); + sector->add_object(object); + object = 0; + sound_manager->play("sounds/upgrade.wav"); + break; + } + + case CONTENT_SCRIPT: + { break; } // because scripts always run, this prevents default contents from being assumed + + case CONTENT_LIGHT: + { + try_open(player); + break; + } + case CONTENT_TRAMPOLINE: + { + try_open(player); + break; + } + case CONTENT_RAIN: + { + try_open(player); + break; + } case CONTENT_EXPLODE: { hit_counter = 1; // multiple hits of coin explode is not allowed @@@ -437,12 -429,11 +480,20 @@@ Sector::current()->run_script(stream, "powerup-script"); } ++<<<<<<< HEAD + if(countdown){ // only decrease hit counter if try_open was not called + if(hit_counter == 1){ + sprite->set_action("empty"); + }else{ + hit_counter--; + } ++======= + if(hit_counter <= 0 || contents == CONTENT_LIGHT){ //use 0 to allow infinite hits + }else if(hit_counter == 1){ + sprite->set_action("empty"); + }else{ + hit_counter--; ++>>>>>>> feature/sdl2 } } diff --cc src/object/explosion.cpp index 5a22fa78b,543ef2b3f..b7428c012 --- a/src/object/explosion.cpp +++ b/src/object/explosion.cpp @@@ -65,11 -65,13 +65,10 @@@ Explosion::explode( return; state = STATE_EXPLODING; - set_action("default", 1); //TODO: the less-threatening short_fuse explosion should look less-threatening + set_action(hurt ? "default" : "pop", 1); sprite->set_animation_loops(1); //TODO: this is necessary because set_action will not set "loops" when "action" is the default action - if (hurt) - sound_manager->play("sounds/explosion.wav", get_pos()); - else - sound_manager->play("sounds/firecracker.ogg", get_pos()); - + sprite->set_angle(graphicsRandom.randf(0, 360)); // a random rotation on the sprite to make explosions appear more random - sound_manager->play(hurt ? "sounds/explosion.wav" : "sounds/firecracker.ogg", get_pos()); - ++ sound_manager->play(hurt ? "sounds/explosion.wav" : "sounds/firecracker.ogg", get_pos()); #if 0 // spawn some particles diff --cc src/supertux/level.cpp index 3ecc6a11d,cf01cc7a8..00d333579 --- a/src/supertux/level.cpp +++ b/src/supertux/level.cpp @@@ -129,8 -129,8 +129,7 @@@ Level::load(const std::string& filepath } if (license == "") { - log_warning << "The level author \"" << author << "\" did not specify a license for this level \"" << name << "\". You might not be allowed to share it." << std::endl; - + log_warning << "[" << filepath << "] The level author \"" << author << "\" did not specify a license for this level \"" << name << "\". You might not be allowed to share it." << std::endl; - } } catch(std::exception& e) { std::stringstream msg; diff --cc src/worldmap/worldmap.cpp index c74e945df,3061a9527..e65cad050 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@@ -381,9 -376,6 +381,10 @@@ WorldMap::get_level_target_time(LevelTi return; level_lisp->get("target-time", level.target_time); + + last_position = level.pos; + last_target_time = level.target_time; ++ } catch(std::exception& e) { log_warning << "Problem when reading level target time: " << e.what() << std::endl; return;