Supertux: updated patch
This commit is contained in:
@@ -91,7 +91,7 @@ index 6680c04..401eacc 100644
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
diff --git a/src/control/input_manager.cpp b/src/control/input_manager.cpp
|
diff --git a/src/control/input_manager.cpp b/src/control/input_manager.cpp
|
||||||
index 588e4b7..57884d1 100644
|
index 3925293..7a20971 100644
|
||||||
--- a/src/control/input_manager.cpp
|
--- a/src/control/input_manager.cpp
|
||||||
+++ b/src/control/input_manager.cpp
|
+++ b/src/control/input_manager.cpp
|
||||||
@@ -19,8 +19,8 @@
|
@@ -19,8 +19,8 @@
|
||||||
@@ -108,7 +108,7 @@ index 588e4b7..57884d1 100644
|
|||||||
@@ -33,9 +33,9 @@ InputManager::InputManager(KeyboardConfig& keyboard_config,
|
@@ -33,9 +33,9 @@ InputManager::InputManager(KeyboardConfig& keyboard_config,
|
||||||
JoystickConfig& joystick_config) :
|
JoystickConfig& joystick_config) :
|
||||||
controller(new Controller),
|
controller(new Controller),
|
||||||
m_use_game_controller(true),
|
m_use_game_controller(joystick_config.use_game_controller),
|
||||||
- keyboard_manager(new KeyboardManager(this, keyboard_config)),
|
- keyboard_manager(new KeyboardManager(this, keyboard_config)),
|
||||||
- joystick_manager(new JoystickManager(this, joystick_config)),
|
- joystick_manager(new JoystickManager(this, joystick_config)),
|
||||||
- game_controller_manager(new GameControllerManager(this))
|
- game_controller_manager(new GameControllerManager(this))
|
||||||
@@ -157,12 +157,12 @@ index 588e4b7..57884d1 100644
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
diff --git a/src/control/input_manager.hpp b/src/control/input_manager.hpp
|
diff --git a/src/control/input_manager.hpp b/src/control/input_manager.hpp
|
||||||
index c8e0df6..5dd6c60 100644
|
index ff5146c..713af95 100644
|
||||||
--- a/src/control/input_manager.hpp
|
--- a/src/control/input_manager.hpp
|
||||||
+++ b/src/control/input_manager.hpp
|
+++ b/src/control/input_manager.hpp
|
||||||
@@ -68,8 +68,8 @@ private:
|
@@ -68,8 +68,8 @@ private:
|
||||||
public:
|
public:
|
||||||
bool m_use_game_controller;
|
bool& m_use_game_controller;
|
||||||
std::unique_ptr<KeyboardManager> keyboard_manager;
|
std::unique_ptr<KeyboardManager> keyboard_manager;
|
||||||
- std::unique_ptr<JoystickManager> joystick_manager;
|
- std::unique_ptr<JoystickManager> joystick_manager;
|
||||||
- std::unique_ptr<GameControllerManager> game_controller_manager;
|
- std::unique_ptr<GameControllerManager> game_controller_manager;
|
||||||
@@ -172,7 +172,7 @@ index c8e0df6..5dd6c60 100644
|
|||||||
private:
|
private:
|
||||||
InputManager(const InputManager&);
|
InputManager(const InputManager&);
|
||||||
diff --git a/src/control/keyboard_config.hpp b/src/control/keyboard_config.hpp
|
diff --git a/src/control/keyboard_config.hpp b/src/control/keyboard_config.hpp
|
||||||
index e848067..fe1b785 100644
|
index 6f8d88e..86894e8 100644
|
||||||
--- a/src/control/keyboard_config.hpp
|
--- a/src/control/keyboard_config.hpp
|
||||||
+++ b/src/control/keyboard_config.hpp
|
+++ b/src/control/keyboard_config.hpp
|
||||||
@@ -25,6 +25,8 @@
|
@@ -25,6 +25,8 @@
|
||||||
@@ -268,7 +268,7 @@ index 07885f9..ae02e33 100644
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
diff --git a/src/gui/dialog.cpp b/src/gui/dialog.cpp
|
diff --git a/src/gui/dialog.cpp b/src/gui/dialog.cpp
|
||||||
index 57d74e4..66bf674 100644
|
index 98a910b..0d61a08 100644
|
||||||
--- a/src/gui/dialog.cpp
|
--- a/src/gui/dialog.cpp
|
||||||
+++ b/src/gui/dialog.cpp
|
+++ b/src/gui/dialog.cpp
|
||||||
@@ -14,6 +14,8 @@
|
@@ -14,6 +14,8 @@
|
||||||
@@ -281,10 +281,10 @@ index 57d74e4..66bf674 100644
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp
|
diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp
|
||||||
index 7d3b52f..a043fb3 100644
|
index 69cecf6..6eda865 100644
|
||||||
--- a/src/gui/menu.cpp
|
--- a/src/gui/menu.cpp
|
||||||
+++ b/src/gui/menu.cpp
|
+++ b/src/gui/menu.cpp
|
||||||
@@ -625,7 +625,9 @@ Menu::get_item_by_id(int id)
|
@@ -383,7 +383,9 @@ Menu::get_item_by_id(int id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ index 7d3b52f..a043fb3 100644
|
|||||||
|
|
||||||
const MenuItem&
|
const MenuItem&
|
||||||
diff --git a/src/object/player.cpp b/src/object/player.cpp
|
diff --git a/src/object/player.cpp b/src/object/player.cpp
|
||||||
index d48d410..d2cb99c 100644
|
index c59f763..9d4a237 100644
|
||||||
--- a/src/object/player.cpp
|
--- a/src/object/player.cpp
|
||||||
+++ b/src/object/player.cpp
|
+++ b/src/object/player.cpp
|
||||||
@@ -160,6 +160,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) :
|
@@ -160,6 +160,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) :
|
||||||
@@ -328,7 +328,7 @@ index d48d410..d2cb99c 100644
|
|||||||
physic.reset();
|
physic.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,12 +534,14 @@ Player::handle_horizontal_input()
|
@@ -534,12 +542,14 @@ Player::handle_horizontal_input()
|
||||||
|
|
||||||
float dirsign = 0;
|
float dirsign = 0;
|
||||||
if(!duck || physic.get_velocity_y() != 0) {
|
if(!duck || physic.get_velocity_y() != 0) {
|
||||||
@@ -346,7 +346,7 @@ index d48d410..d2cb99c 100644
|
|||||||
old_dir = dir;
|
old_dir = dir;
|
||||||
dir = RIGHT;
|
dir = RIGHT;
|
||||||
dirsign = 1;
|
dirsign = 1;
|
||||||
@@ -724,7 +734,7 @@ Player::handle_vertical_input()
|
@@ -732,7 +742,7 @@ Player::handle_vertical_input()
|
||||||
{
|
{
|
||||||
// Press jump key
|
// Press jump key
|
||||||
if(controller->pressed(Controller::JUMP)) jump_button_timer.start(JUMP_GRACE_TIME);
|
if(controller->pressed(Controller::JUMP)) jump_button_timer.start(JUMP_GRACE_TIME);
|
||||||
@@ -355,7 +355,7 @@ index d48d410..d2cb99c 100644
|
|||||||
jump_button_timer.stop();
|
jump_button_timer.stop();
|
||||||
if (duck) {
|
if (duck) {
|
||||||
// when running, only jump a little bit; else do a backflip
|
// when running, only jump a little bit; else do a backflip
|
||||||
@@ -764,7 +774,7 @@ Player::handle_vertical_input()
|
@@ -772,7 +782,7 @@ Player::handle_vertical_input()
|
||||||
|
|
||||||
|
|
||||||
// Let go of jump key
|
// Let go of jump key
|
||||||
@@ -364,7 +364,7 @@ index d48d410..d2cb99c 100644
|
|||||||
if (!backflipping && jumping && physic.get_velocity_y() < 0) {
|
if (!backflipping && jumping && physic.get_velocity_y() < 0) {
|
||||||
jumping = false;
|
jumping = false;
|
||||||
early_jump_apex();
|
early_jump_apex();
|
||||||
@@ -846,6 +856,8 @@ Player::handle_input()
|
@@ -854,6 +864,8 @@ Player::handle_input()
|
||||||
/* Handle vertical movement: */
|
/* Handle vertical movement: */
|
||||||
if (!stone) handle_vertical_input();
|
if (!stone) handle_vertical_input();
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ index d48d410..d2cb99c 100644
|
|||||||
/* Shoot! */
|
/* Shoot! */
|
||||||
if (controller->pressed(Controller::ACTION) && (player_status->bonus == FIRE_BONUS || player_status->bonus == ICE_BONUS)) {
|
if (controller->pressed(Controller::ACTION) && (player_status->bonus == FIRE_BONUS || player_status->bonus == ICE_BONUS)) {
|
||||||
if((player_status->bonus == FIRE_BONUS &&
|
if((player_status->bonus == FIRE_BONUS &&
|
||||||
@@ -1190,6 +1202,13 @@ Player::draw(DrawingContext& context)
|
@@ -1208,6 +1220,13 @@ Player::draw(DrawingContext& context)
|
||||||
context.draw_surface(airarrow, Vector(px, py), LAYER_HUD - 1);
|
context.draw_surface(airarrow, Vector(px, py), LAYER_HUD - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ index d48d410..d2cb99c 100644
|
|||||||
std::string sa_prefix = "";
|
std::string sa_prefix = "";
|
||||||
std::string sa_postfix = "";
|
std::string sa_postfix = "";
|
||||||
|
|
||||||
@@ -1766,4 +1785,65 @@ Player::handle_input_climbing()
|
@@ -1784,4 +1803,65 @@ Player::handle_input_climbing()
|
||||||
physic.set_acceleration(0, 0);
|
physic.set_acceleration(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,10 +454,10 @@ index d48d410..d2cb99c 100644
|
|||||||
+
|
+
|
||||||
/* EOF */
|
/* EOF */
|
||||||
diff --git a/src/object/player.hpp b/src/object/player.hpp
|
diff --git a/src/object/player.hpp b/src/object/player.hpp
|
||||||
index 4d178aa..bf42dd5 100644
|
index f606e04..cfc6451 100644
|
||||||
--- a/src/object/player.hpp
|
--- a/src/object/player.hpp
|
||||||
+++ b/src/object/player.hpp
|
+++ b/src/object/player.hpp
|
||||||
@@ -246,6 +246,7 @@ private:
|
@@ -247,6 +247,7 @@ private:
|
||||||
|
|
||||||
void handle_horizontal_input();
|
void handle_horizontal_input();
|
||||||
void handle_vertical_input();
|
void handle_vertical_input();
|
||||||
@@ -465,7 +465,7 @@ index 4d178aa..bf42dd5 100644
|
|||||||
|
|
||||||
void activate();
|
void activate();
|
||||||
void deactivate();
|
void deactivate();
|
||||||
@@ -322,6 +323,15 @@ public:
|
@@ -327,6 +328,15 @@ public:
|
||||||
|
|
||||||
SurfacePtr airarrow; /**< arrow indicating Tux' position when he's above the camera */
|
SurfacePtr airarrow; /**< arrow indicating Tux' position when he's above the camera */
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ index 277f993..356dae0 100644
|
|||||||
PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1;
|
PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1;
|
||||||
|
|
||||||
diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp
|
diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp
|
||||||
index 8c2635e..fa862a3 100644
|
index d4b0a69..a296960 100644
|
||||||
--- a/src/supertux/gameconfig.cpp
|
--- a/src/supertux/gameconfig.cpp
|
||||||
+++ b/src/supertux/gameconfig.cpp
|
+++ b/src/supertux/gameconfig.cpp
|
||||||
@@ -34,7 +34,7 @@ Config::Config() :
|
@@ -34,7 +34,7 @@ Config::Config() :
|
||||||
@@ -517,7 +517,7 @@ index 8c2635e..fa862a3 100644
|
|||||||
try_vsync(true),
|
try_vsync(true),
|
||||||
show_fps(false),
|
show_fps(false),
|
||||||
diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp
|
diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp
|
||||||
index c5ca4e8..00010c1 100644
|
index 20d51f1..d801b27 100644
|
||||||
--- a/src/supertux/main.cpp
|
--- a/src/supertux/main.cpp
|
||||||
+++ b/src/supertux/main.cpp
|
+++ b/src/supertux/main.cpp
|
||||||
@@ -20,6 +20,9 @@
|
@@ -20,6 +20,9 @@
|
||||||
@@ -530,7 +530,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -129,7 +132,7 @@ public:
|
@@ -130,7 +133,7 @@ public:
|
||||||
if (!PHYSFS_init(argv0))
|
if (!PHYSFS_init(argv0))
|
||||||
{
|
{
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
@@ -539,7 +539,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
throw std::runtime_error(msg.str());
|
throw std::runtime_error(msg.str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -144,50 +147,9 @@ public:
|
@@ -145,50 +148,9 @@ public:
|
||||||
|
|
||||||
void find_datadir()
|
void find_datadir()
|
||||||
{
|
{
|
||||||
@@ -592,7 +592,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +215,7 @@ class SDLSubsystem
|
@@ -254,7 +216,7 @@ class SDLSubsystem
|
||||||
public:
|
public:
|
||||||
SDLSubsystem()
|
SDLSubsystem()
|
||||||
{
|
{
|
||||||
@@ -601,7 +601,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
{
|
{
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "Couldn't initialize SDL: " << SDL_GetError();
|
msg << "Couldn't initialize SDL: " << SDL_GetError();
|
||||||
@@ -272,7 +234,7 @@ public:
|
@@ -273,7 +235,7 @@ public:
|
||||||
void
|
void
|
||||||
Main::init_video()
|
Main::init_video()
|
||||||
{
|
{
|
||||||
@@ -610,7 +610,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
|
|
||||||
const char* icon_fname = "images/engine/icons/supertux-256x256.png";
|
const char* icon_fname = "images/engine/icons/supertux-256x256.png";
|
||||||
SDL_Surface* icon = IMG_Load_RW(get_physfs_SDLRWops(icon_fname), true);
|
SDL_Surface* icon = IMG_Load_RW(get_physfs_SDLRWops(icon_fname), true);
|
||||||
@@ -282,7 +244,7 @@ Main::init_video()
|
@@ -283,7 +245,7 @@ Main::init_video()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -619,7 +619,7 @@ index c5ca4e8..00010c1 100644
|
|||||||
SDL_FreeSurface(icon);
|
SDL_FreeSurface(icon);
|
||||||
}
|
}
|
||||||
SDL_ShowCursor(0);
|
SDL_ShowCursor(0);
|
||||||
@@ -398,6 +360,14 @@ Main::run(int argc, char** argv)
|
@@ -399,6 +361,14 @@ Main::run(int argc, char** argv)
|
||||||
{
|
{
|
||||||
CommandLineArguments args;
|
CommandLineArguments args;
|
||||||
|
|
||||||
@@ -635,47 +635,47 @@ index c5ca4e8..00010c1 100644
|
|||||||
{
|
{
|
||||||
args.parse_args(argc, argv);
|
args.parse_args(argc, argv);
|
||||||
diff --git a/src/supertux/menu/joystick_menu.cpp b/src/supertux/menu/joystick_menu.cpp
|
diff --git a/src/supertux/menu/joystick_menu.cpp b/src/supertux/menu/joystick_menu.cpp
|
||||||
index adde0c5..b9eeef3 100644
|
index 0b6ba9b..bd7a493 100644
|
||||||
--- a/src/supertux/menu/joystick_menu.cpp
|
--- a/src/supertux/menu/joystick_menu.cpp
|
||||||
+++ b/src/supertux/menu/joystick_menu.cpp
|
+++ b/src/supertux/menu/joystick_menu.cpp
|
||||||
@@ -54,6 +54,7 @@ JoystickMenu::recreate_menu()
|
@@ -56,6 +56,7 @@ JoystickMenu::recreate_menu()
|
||||||
!m_input_manager.use_game_controller())
|
&m_auto_joystick_cfg)
|
||||||
->set_help(_("Use manual configuration instead of SDL2's automatic GameController support"));
|
->set_help(_("Use manual configuration instead of SDL2's automatic GameController support"));
|
||||||
|
|
||||||
+#if 0
|
+#if 0
|
||||||
if (m_input_manager.use_game_controller())
|
if (m_input_manager.use_game_controller())
|
||||||
{
|
{
|
||||||
m_joysticks_available = false;
|
m_joysticks_available = false;
|
||||||
@@ -84,13 +85,14 @@ JoystickMenu::recreate_menu()
|
@@ -86,13 +87,14 @@ JoystickMenu::recreate_menu()
|
||||||
add_toggle(MNID_JUMP_WITH_UP, _("Jump with Up"), g_config->joystick_config.jump_with_up_joy);
|
add_toggle(MNID_JUMP_WITH_UP, _("Jump with Up"), &g_config->joystick_config.jump_with_up_joy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
+#endif
|
+#endif
|
||||||
{
|
{
|
||||||
m_joysticks_available = false;
|
m_joysticks_available = false;
|
||||||
|
|
||||||
add_inactive(-1, _("No Joysticks found"));
|
add_inactive(_("No Joysticks found"));
|
||||||
add_entry(MNID_SCAN_JOYSTICKS, _("Scan for Joysticks"));
|
add_entry(MNID_SCAN_JOYSTICKS, _("Scan for Joysticks"));
|
||||||
}
|
}
|
||||||
- }
|
- }
|
||||||
+ //}
|
+// }
|
||||||
|
|
||||||
add_hl();
|
add_hl();
|
||||||
add_back(_("Back"));
|
add_back(_("Back"));
|
||||||
@@ -118,7 +120,7 @@ JoystickMenu::menu_action(MenuItem* item)
|
@@ -124,7 +126,7 @@ JoystickMenu::menu_action(MenuItem* item)
|
||||||
if (0 <= item->id && item->id < Controller::CONTROLCOUNT)
|
return;
|
||||||
{
|
}
|
||||||
item->change_input(_("Press Button"));
|
micf->change_input(_("Press Button"));
|
||||||
- m_input_manager.joystick_manager->bind_next_event_to(static_cast<Controller::Control>(item->id));
|
- m_input_manager.joystick_manager->bind_next_event_to(static_cast<Controller::Control>(item->id));
|
||||||
+ //m_input_manager.joystick_manager->bind_next_event_to(static_cast<Controller::Control>(item->id));
|
+ //m_input_manager.joystick_manager->bind_next_event_to(static_cast<Controller::Control>(item->id));
|
||||||
}
|
}
|
||||||
else if (item->id == MNID_JUMP_WITH_UP)
|
else if (item->id == MNID_AUTO_JOYSTICK_CFG)
|
||||||
{
|
{
|
||||||
diff --git a/src/supertux/menu/keyboard_menu.cpp b/src/supertux/menu/keyboard_menu.cpp
|
diff --git a/src/supertux/menu/keyboard_menu.cpp b/src/supertux/menu/keyboard_menu.cpp
|
||||||
index 9b25f8c..2c05d16 100644
|
index 2078b9f..bcc6226 100644
|
||||||
--- a/src/supertux/menu/keyboard_menu.cpp
|
--- a/src/supertux/menu/keyboard_menu.cpp
|
||||||
+++ b/src/supertux/menu/keyboard_menu.cpp
|
+++ b/src/supertux/menu/keyboard_menu.cpp
|
||||||
@@ -82,9 +82,9 @@ KeyboardMenu::get_key_name(SDL_Keycode key)
|
@@ -83,9 +83,9 @@ KeyboardMenu::get_key_name(SDL_Keycode key) const
|
||||||
return _("Right Alt");
|
return _("Right Alt");
|
||||||
case SDLK_LALT:
|
case SDLK_LALT:
|
||||||
return _("Left Alt");
|
return _("Left Alt");
|
||||||
@@ -688,7 +688,7 @@ index 9b25f8c..2c05d16 100644
|
|||||||
default:
|
default:
|
||||||
return SDL_GetKeyName(static_cast<SDL_Keycode>(key));
|
return SDL_GetKeyName(static_cast<SDL_Keycode>(key));
|
||||||
diff --git a/src/supertux/menu/keyboard_menu.hpp b/src/supertux/menu/keyboard_menu.hpp
|
diff --git a/src/supertux/menu/keyboard_menu.hpp b/src/supertux/menu/keyboard_menu.hpp
|
||||||
index 3230f34..5eedfd8 100644
|
index 98d84a2..14baf3e 100644
|
||||||
--- a/src/supertux/menu/keyboard_menu.hpp
|
--- a/src/supertux/menu/keyboard_menu.hpp
|
||||||
+++ b/src/supertux/menu/keyboard_menu.hpp
|
+++ b/src/supertux/menu/keyboard_menu.hpp
|
||||||
@@ -21,6 +21,8 @@
|
@@ -21,6 +21,8 @@
|
||||||
@@ -701,13 +701,13 @@ index 3230f34..5eedfd8 100644
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp
|
diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp
|
||||||
index f9e4821..b8d3fc0 100644
|
index 26f6d69..b884d2e 100644
|
||||||
--- a/src/supertux/menu/options_menu.cpp
|
--- a/src/supertux/menu/options_menu.cpp
|
||||||
+++ b/src/supertux/menu/options_menu.cpp
|
+++ b/src/supertux/menu/options_menu.cpp
|
||||||
@@ -104,25 +104,15 @@ OptionsMenu::OptionsMenu(bool complete)
|
@@ -126,22 +126,13 @@ OptionsMenu::OptionsMenu(bool complete) :
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resolutions.clear();
|
||||||
- int display_mode_count = SDL_GetNumDisplayModes(0);
|
- int display_mode_count = SDL_GetNumDisplayModes(0);
|
||||||
std::string last_display_mode;
|
std::string last_display_mode;
|
||||||
- for(int i = 0; i < display_mode_count; ++i)
|
- for(int i = 0; i < display_mode_count; ++i)
|
||||||
@@ -720,20 +720,17 @@ index f9e4821..b8d3fc0 100644
|
|||||||
- log_warning << "failed to get display mode: " << SDL_GetError() << std::endl;
|
- log_warning << "failed to get display mode: " << SDL_GetError() << std::endl;
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
+ SDL_Rect mode = *(SDL_ListModes(NULL, 0)[i]);
|
||||||
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
- out << mode.w << "x" << mode.h << "@" << mode.refresh_rate;
|
out << mode.w << "x" << mode.h;
|
||||||
+ out << SDL_ListModes(NULL, 0)[i]->w << "x" << SDL_ListModes(NULL, 0)[i]->h << "@60";
|
- if(mode.refresh_rate)
|
||||||
|
- out << "@" << mode.refresh_rate;
|
||||||
if(last_display_mode == out.str())
|
if(last_display_mode == out.str())
|
||||||
continue;
|
continue;
|
||||||
last_display_mode = out.str();
|
last_display_mode = out.str();
|
||||||
fullscreen_res->list.push_back(out.str());
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
fullscreen_res->list.push_back("Desktop");
|
|
||||||
|
|
||||||
diff --git a/src/supertux/screen_manager.cpp b/src/supertux/screen_manager.cpp
|
diff --git a/src/supertux/screen_manager.cpp b/src/supertux/screen_manager.cpp
|
||||||
index 85d9f63..15304de 100644
|
index 23f1086..960276b 100644
|
||||||
--- a/src/supertux/screen_manager.cpp
|
--- a/src/supertux/screen_manager.cpp
|
||||||
+++ b/src/supertux/screen_manager.cpp
|
+++ b/src/supertux/screen_manager.cpp
|
||||||
@@ -195,7 +195,7 @@ ScreenManager::update_gamelogic(float elapsed_time)
|
@@ -195,7 +195,7 @@ ScreenManager::update_gamelogic(float elapsed_time)
|
||||||
@@ -782,7 +779,7 @@ index 85d9f63..15304de 100644
|
|||||||
event.key.keysym.sym == SDLK_F12)
|
event.key.keysym.sym == SDLK_F12)
|
||||||
{
|
{
|
||||||
take_screenshot();
|
take_screenshot();
|
||||||
@@ -376,7 +362,7 @@ ScreenManager::run(DrawingContext &context)
|
@@ -370,7 +356,7 @@ ScreenManager::run(DrawingContext &context)
|
||||||
timestep *= m_speed;
|
timestep *= m_speed;
|
||||||
game_time += timestep;
|
game_time += timestep;
|
||||||
|
|
||||||
@@ -792,7 +789,7 @@ index 85d9f63..15304de 100644
|
|||||||
frames += 1;
|
frames += 1;
|
||||||
}
|
}
|
||||||
diff --git a/src/supertux/screen_manager.hpp b/src/supertux/screen_manager.hpp
|
diff --git a/src/supertux/screen_manager.hpp b/src/supertux/screen_manager.hpp
|
||||||
index 20259bf..d3cee66 100644
|
index 3cd3889..09797d1 100644
|
||||||
--- a/src/supertux/screen_manager.hpp
|
--- a/src/supertux/screen_manager.hpp
|
||||||
+++ b/src/supertux/screen_manager.hpp
|
+++ b/src/supertux/screen_manager.hpp
|
||||||
@@ -64,7 +64,7 @@ private:
|
@@ -64,7 +64,7 @@ private:
|
||||||
@@ -805,19 +802,21 @@ index 20259bf..d3cee66 100644
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
diff --git a/src/util/log.cpp b/src/util/log.cpp
|
diff --git a/src/util/log.cpp b/src/util/log.cpp
|
||||||
index 255a427..b788a5e 100644
|
index 2ace6de..1e34498 100644
|
||||||
--- a/src/util/log.cpp
|
--- a/src/util/log.cpp
|
||||||
+++ b/src/util/log.cpp
|
+++ b/src/util/log.cpp
|
||||||
@@ -18,18 +18,94 @@
|
@@ -18,20 +18,96 @@
|
||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
+#ifdef ANDROID
|
+#ifdef __ANDROID__
|
||||||
+#include <android/log.h>
|
+#include <android/log.h>
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
#include "math/rectf.hpp"
|
#include "math/rectf.hpp"
|
||||||
#include "supertux/console.hpp"
|
#include "supertux/console.hpp"
|
||||||
|
#include "supertux/gameconfig.hpp"
|
||||||
|
#include "supertux/globals.hpp"
|
||||||
|
|
||||||
+#ifdef ANDROID
|
+#ifdef ANDROID
|
||||||
+class _android_debugbuf: public std::streambuf
|
+class _android_debugbuf: public std::streambuf
|
||||||
@@ -903,6 +902,31 @@ index 255a427..b788a5e 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::ostream& log_generic_f (const char *prefix, const char* file, int line, bool use_console_buffer = true)
|
static std::ostream& log_generic_f (const char *prefix, const char* file, int line, bool use_console_buffer = true)
|
||||||
|
diff --git a/src/util/log.hpp b/src/util/log.hpp
|
||||||
|
index b256a74..1a75474 100644
|
||||||
|
--- a/src/util/log.hpp
|
||||||
|
+++ b/src/util/log.hpp
|
||||||
|
@@ -45,6 +45,20 @@ void log_info_callback(const std::string& str);
|
||||||
|
void log_error_callback(const std::string& str);
|
||||||
|
void log_warning_callback(const std::string& str);
|
||||||
|
|
||||||
|
+#ifdef __ANDROID__
|
||||||
|
+#include <sstream>
|
||||||
|
+// Where else to put this, eh?
|
||||||
|
+namespace std
|
||||||
|
+{
|
||||||
|
+ template < typename T > std::string to_string( const T& n )
|
||||||
|
+ {
|
||||||
|
+ std::ostringstream ss;
|
||||||
|
+ ss << n ;
|
||||||
|
+ return ss.str() ;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
diff --git a/src/video/gl/gl_lightmap.cpp b/src/video/gl/gl_lightmap.cpp
|
diff --git a/src/video/gl/gl_lightmap.cpp b/src/video/gl/gl_lightmap.cpp
|
||||||
index 97cf70a..3b39497 100644
|
index 97cf70a..3b39497 100644
|
||||||
--- a/src/video/gl/gl_lightmap.cpp
|
--- a/src/video/gl/gl_lightmap.cpp
|
||||||
@@ -916,7 +940,7 @@ index 97cf70a..3b39497 100644
|
|||||||
|
|
||||||
GLLightmap::~GLLightmap()
|
GLLightmap::~GLLightmap()
|
||||||
diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp
|
diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp
|
||||||
index 12ee0a5..a1a3f8d 100644
|
index 229db78..a725286 100644
|
||||||
--- a/src/video/gl/gl_painter.cpp
|
--- a/src/video/gl/gl_painter.cpp
|
||||||
+++ b/src/video/gl/gl_painter.cpp
|
+++ b/src/video/gl/gl_painter.cpp
|
||||||
@@ -14,6 +14,9 @@
|
@@ -14,6 +14,9 @@
|
||||||
@@ -974,7 +998,7 @@ index 12ee0a5..a1a3f8d 100644
|
|||||||
surface_data->get_uv_left(),
|
surface_data->get_uv_left(),
|
||||||
surface_data->get_uv_top(),
|
surface_data->get_uv_top(),
|
||||||
surface_data->get_uv_right(),
|
surface_data->get_uv_right(),
|
||||||
@@ -387,4 +399,11 @@ GLPainter::draw_inverse_ellipse(const DrawingRequest& request)
|
@@ -388,4 +400,11 @@ GLPainter::draw_inverse_ellipse(const DrawingRequest& request)
|
||||||
glColor4f(1, 1, 1, 1);
|
glColor4f(1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1028,10 +1052,10 @@ index bb3dd75..6ac8add 100644
|
|||||||
private:
|
private:
|
||||||
GLPainter(const GLPainter&) = delete;
|
GLPainter(const GLPainter&) = delete;
|
||||||
diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp
|
diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp
|
||||||
index 8f4a18ee..aa5670a 100644
|
index 7ec1a0e..b644490 100644
|
||||||
--- a/src/video/gl/gl_renderer.cpp
|
--- a/src/video/gl/gl_renderer.cpp
|
||||||
+++ b/src/video/gl/gl_renderer.cpp
|
+++ b/src/video/gl/gl_renderer.cpp
|
||||||
@@ -43,35 +43,13 @@
|
@@ -44,35 +44,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GLRenderer::GLRenderer() :
|
GLRenderer::GLRenderer() :
|
||||||
@@ -1070,7 +1094,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
|
|
||||||
#ifdef USE_GLBINDING
|
#ifdef USE_GLBINDING
|
||||||
|
|
||||||
@@ -107,15 +85,6 @@ GLRenderer::GLRenderer() :
|
@@ -108,15 +86,6 @@ GLRenderer::GLRenderer() :
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1086,7 +1110,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
// Init the projection matrix, viewport and stuff
|
// Init the projection matrix, viewport and stuff
|
||||||
apply_config();
|
apply_config();
|
||||||
|
|
||||||
@@ -136,8 +105,8 @@ GLRenderer::GLRenderer() :
|
@@ -137,8 +106,8 @@ GLRenderer::GLRenderer() :
|
||||||
|
|
||||||
GLRenderer::~GLRenderer()
|
GLRenderer::~GLRenderer()
|
||||||
{
|
{
|
||||||
@@ -1097,7 +1121,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -213,7 +182,14 @@ void
|
@@ -214,7 +183,14 @@ void
|
||||||
GLRenderer::flip()
|
GLRenderer::flip()
|
||||||
{
|
{
|
||||||
assert_gl("drawing");
|
assert_gl("drawing");
|
||||||
@@ -1113,7 +1137,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -229,9 +205,17 @@ GLRenderer::apply_config()
|
@@ -230,9 +206,17 @@ GLRenderer::apply_config()
|
||||||
{
|
{
|
||||||
apply_video_mode();
|
apply_video_mode();
|
||||||
|
|
||||||
@@ -1134,7 +1158,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
|
|
||||||
float pixel_aspect_ratio = 1.0f;
|
float pixel_aspect_ratio = 1.0f;
|
||||||
if (g_config->aspect_size != Size(0, 0))
|
if (g_config->aspect_size != Size(0, 0))
|
||||||
@@ -264,9 +248,9 @@ GLRenderer::apply_config()
|
@@ -265,9 +249,9 @@ GLRenderer::apply_config()
|
||||||
{
|
{
|
||||||
// Clear both buffers so that we get a clean black border without junk
|
// Clear both buffers so that we get a clean black border without junk
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
@@ -1146,7 +1170,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
glViewport(m_viewport.x, m_viewport.y, m_viewport.w, m_viewport.h);
|
glViewport(m_viewport.x, m_viewport.y, m_viewport.w, m_viewport.h);
|
||||||
@@ -285,102 +269,15 @@ GLRenderer::apply_config()
|
@@ -286,102 +270,15 @@ GLRenderer::apply_config()
|
||||||
void
|
void
|
||||||
GLRenderer::apply_video_mode()
|
GLRenderer::apply_video_mode()
|
||||||
{
|
{
|
||||||
@@ -1258,7 +1282,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -433,9 +330,9 @@ GLRenderer::to_logical(int physical_x, int physical_y)
|
@@ -434,9 +331,9 @@ GLRenderer::to_logical(int physical_x, int physical_y)
|
||||||
void
|
void
|
||||||
GLRenderer::set_gamma(float gamma)
|
GLRenderer::set_gamma(float gamma)
|
||||||
{
|
{
|
||||||
@@ -1272,7 +1296,7 @@ index 8f4a18ee..aa5670a 100644
|
|||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
diff --git a/src/video/gl/gl_renderer.hpp b/src/video/gl/gl_renderer.hpp
|
diff --git a/src/video/gl/gl_renderer.hpp b/src/video/gl/gl_renderer.hpp
|
||||||
index 5da04a8..b73eb9d 100644
|
index 3aa37b4..0e3cbe7 100644
|
||||||
--- a/src/video/gl/gl_renderer.hpp
|
--- a/src/video/gl/gl_renderer.hpp
|
||||||
+++ b/src/video/gl/gl_renderer.hpp
|
+++ b/src/video/gl/gl_renderer.hpp
|
||||||
@@ -27,8 +27,8 @@
|
@@ -27,8 +27,8 @@
|
||||||
@@ -1290,8 +1314,8 @@ index 5da04a8..b73eb9d 100644
|
|||||||
Vector to_logical(int physical_x, int physical_y) override;
|
Vector to_logical(int physical_x, int physical_y) override;
|
||||||
void set_gamma(float gamma) override;
|
void set_gamma(float gamma) override;
|
||||||
|
|
||||||
- SDL_Window* get_window() const { return m_window; }
|
- SDL_Window* get_window() const override { return m_window; }
|
||||||
+ //SDL_Window* get_window() const { return m_window; }
|
+ //SDL_Window* get_window() const override { return m_window; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void apply_video_mode();
|
void apply_video_mode();
|
||||||
@@ -1507,7 +1531,7 @@ index 7cb634f..787d702 100644
|
|||||||
void set_texture_params();
|
void set_texture_params();
|
||||||
};
|
};
|
||||||
diff --git a/src/video/gl/gl_video_system.cpp b/src/video/gl/gl_video_system.cpp
|
diff --git a/src/video/gl/gl_video_system.cpp b/src/video/gl/gl_video_system.cpp
|
||||||
index 87b0ab7..328a58c 100644
|
index d93c6cd..b65b0bd 100644
|
||||||
--- a/src/video/gl/gl_video_system.cpp
|
--- a/src/video/gl/gl_video_system.cpp
|
||||||
+++ b/src/video/gl/gl_video_system.cpp
|
+++ b/src/video/gl/gl_video_system.cpp
|
||||||
@@ -69,6 +69,7 @@ void
|
@@ -69,6 +69,7 @@ void
|
||||||
@@ -1657,11 +1681,11 @@ index 46be85c..72f7cb8 100644
|
|||||||
class Size;
|
class Size;
|
||||||
class Vector;
|
class Vector;
|
||||||
diff --git a/src/video/video_system.cpp b/src/video/video_system.cpp
|
diff --git a/src/video/video_system.cpp b/src/video/video_system.cpp
|
||||||
index dd736d0..726c81a 100644
|
index 105e427..898dea7 100644
|
||||||
--- a/src/video/video_system.cpp
|
--- a/src/video/video_system.cpp
|
||||||
+++ b/src/video/video_system.cpp
|
+++ b/src/video/video_system.cpp
|
||||||
@@ -19,7 +19,7 @@
|
@@ -20,7 +20,7 @@
|
||||||
#include <config.h>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
-#include "video/sdl/sdl_video_system.hpp"
|
-#include "video/sdl/sdl_video_system.hpp"
|
||||||
@@ -1669,7 +1693,7 @@ index dd736d0..726c81a 100644
|
|||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
#include "video/gl/gl_video_system.hpp"
|
#include "video/gl/gl_video_system.hpp"
|
||||||
@@ -31,33 +31,15 @@ VideoSystem::create(VideoSystem::Enum video_system)
|
@@ -32,33 +32,15 @@ VideoSystem::create(VideoSystem::Enum video_system)
|
||||||
switch(video_system)
|
switch(video_system)
|
||||||
{
|
{
|
||||||
case AUTO_VIDEO:
|
case AUTO_VIDEO:
|
||||||
|
|||||||
Reference in New Issue
Block a user