reduced warnings to 0 on VC++
This commit is contained in:
parent
4a0fb23c33
commit
c661b3043a
80 changed files with 233 additions and 72 deletions
|
@ -11,6 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
#include "events.hpp"
|
||||
#include "font.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "display.hpp"
|
||||
#include "events.hpp"
|
||||
|
|
|
@ -10,8 +10,12 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "ai.hpp"
|
||||
#include "ai2.hpp"
|
||||
#include "ai_attack.hpp"
|
||||
#include "ai_move.hpp"
|
||||
#include "dialogs.hpp"
|
||||
|
@ -187,6 +191,8 @@ ai_interface* create_ai(const std::string& name, ai_interface::info& info)
|
|||
return new sample_ai(info);
|
||||
else if(name == "idle_ai")
|
||||
return new idle_ai(info);
|
||||
else if(name == "ai2")
|
||||
return new ai2(info);
|
||||
else if(name != "")
|
||||
lg::err(lg::ai) << "AI not found: '" << name << "'\n";
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "ai_attack.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "ai_move.hpp"
|
||||
#include "display.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include "array.hpp"
|
||||
#include "display.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "cavegen.hpp"
|
||||
#include "log.hpp"
|
||||
#include "pathfind.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "clipboard.hpp"
|
||||
|
||||
#if defined(_X11) && !defined(__APPLE__)
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
#ifndef CONFIG_HPP_INCLUDED
|
||||
#define CONFIG_HPP_INCLUDED
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "cursor.hpp"
|
||||
#include "game_config.hpp"
|
||||
#include "image.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "dialogs.hpp"
|
||||
#include "events.hpp"
|
||||
#include "font.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "display.hpp"
|
||||
#include "events.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "../global.hpp"
|
||||
|
||||
#include "scenario_editor.hpp"
|
||||
|
||||
scenario_editor::scenario_editor(game_data& gameinfo, const config& game_config, CVideo& video)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include "clipboard.hpp"
|
||||
#include "cursor.hpp"
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
//include files for opendir(3), readdir(3), etc. These files may vary
|
||||
//from platform to platform, since these functions are NOT ANSI-conforming
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "font.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
12
src/game.cpp
12
src/game.cpp
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
|
@ -144,6 +141,7 @@ LEVEL_RESULT play_game(display& disp, game_state& state, config& game_config,
|
|||
|
||||
recorder.save_game(units_data,label,snapshot,state.starting_pos);
|
||||
} catch(gamestatus::save_game_failed& e) {
|
||||
e;
|
||||
gui::show_dialog(disp,NULL,"",_("The game could not be saved"),gui::MESSAGE);
|
||||
retry = true;
|
||||
};
|
||||
|
@ -205,6 +203,7 @@ LEVEL_RESULT play_game(display& disp, game_state& state, config& game_config,
|
|||
try {
|
||||
save_game(state);
|
||||
} catch(gamestatus::save_game_failed& e) {
|
||||
e;
|
||||
gui::show_dialog(disp,NULL,"",_("The game could not be saved"),gui::MESSAGE);
|
||||
retry = true;
|
||||
}
|
||||
|
@ -297,6 +296,7 @@ void read_game_cfg(preproc_map& defines, std::vector<line_source>& line_src, con
|
|||
std::cerr << "wrote checksum: '" << checksum_cfg.write() << "'\n";
|
||||
write_file(fname_checksum,checksum_cfg.write());
|
||||
} catch(io_exception& e) {
|
||||
e;
|
||||
std::cerr << "could not write to cache '" << fname << "'\n";
|
||||
}
|
||||
|
||||
|
@ -834,6 +834,7 @@ bool game_controller::load_game()
|
|||
gui::OK_ONLY);
|
||||
return false;
|
||||
} catch(io_exception& e) {
|
||||
e;
|
||||
gui::show_dialog(disp(),NULL,"",_("File I/O Error while reading the game"),gui::OK_ONLY);
|
||||
return false;
|
||||
}
|
||||
|
@ -1131,10 +1132,13 @@ void game_controller::download_campaigns()
|
|||
|
||||
gui::show_dialog(disp(),NULL,_("Campaign Installed"),_("The campaign has been installed."),gui::OK_ONLY);
|
||||
} catch(config::error& e) {
|
||||
e;
|
||||
gui::show_dialog(disp(),NULL,_("Error"),_("Network communication error."),gui::OK_ONLY);
|
||||
} catch(network::error& e) {
|
||||
e;
|
||||
gui::show_dialog(disp(),NULL,_("Error"),_("Remote host disconnected."),gui::OK_ONLY);
|
||||
} catch(io_exception& e) {
|
||||
e;
|
||||
gui::show_dialog(disp(),NULL,_("Error"),_("There was a problem creating the files necessary to install this campaign."),gui::OK_ONLY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game_config.hpp"
|
||||
#include "wesconfig.h"
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game_events.hpp"
|
||||
#include "image.hpp"
|
||||
#include "language.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "filesystem.hpp"
|
||||
#include "game_config.hpp"
|
||||
#include "gamestatus.hpp"
|
||||
|
@ -467,6 +470,7 @@ config& save_index()
|
|||
} catch(io_exception& e) {
|
||||
std::cerr << "error reading save index: '" << e.what() << "'\n";
|
||||
} catch(config::error& e) {
|
||||
e;
|
||||
std::cerr << "error parsing save index config file\n";
|
||||
save_index_cfg.clear();
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "gettext.hpp"
|
||||
|
||||
#include <cstring>
|
||||
|
|
28
src/global.hpp
Executable file
28
src/global.hpp
Executable file
|
@ -0,0 +1,28 @@
|
|||
#ifndef DISABLE_4786_HPP_INCLUDED
|
||||
#define DISABLE_4786_HPP_INCLUDED
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
//disable the warning to let us know about 'this' being used in
|
||||
//initializer list, since it's a common thing to want to do
|
||||
//for callbacks, and there is no other way to easily workaround the warning
|
||||
#pragma warning(disable:4355)
|
||||
|
||||
//disable the warnings for long template names
|
||||
#pragma warning(disable:4503)
|
||||
#pragma warning(disable:4786)
|
||||
|
||||
//the following code causes the incredibly irritating warning 4786 to really
|
||||
//be muted in Visual C++ 6. No-one seems to know *why* it works (possibly not even Microsoft)
|
||||
//but it does. So don't ask, and just leave it there.
|
||||
|
||||
class warning4786WorkAround {
|
||||
public:
|
||||
warning4786WorkAround() {}
|
||||
};
|
||||
|
||||
static warning4786WorkAround VariableThatHacksWarning4786IntoBeingMutedForSomeUnknownReason;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "halo.hpp"
|
||||
#include "image.hpp"
|
||||
#include "preferences.hpp"
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "about.hpp"
|
||||
#include "cursor.hpp"
|
||||
#include "events.hpp"
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct config;
|
||||
struct display;
|
||||
class config;
|
||||
class display;
|
||||
struct game_data;
|
||||
struct gamemap;
|
||||
class gamemap;
|
||||
|
||||
namespace help {
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "config.hpp"
|
||||
|
@ -294,10 +296,10 @@ hotkey_item& get_hotkey(int keycode, bool shift, bool ctrl, bool alt, bool cmd,
|
|||
hotkey_item& get_hotkey(const SDL_KeyboardEvent& event, bool mods)
|
||||
{
|
||||
return get_hotkey(event.keysym.sym,
|
||||
event.keysym.mod & KMOD_SHIFT,
|
||||
event.keysym.mod & KMOD_CTRL,
|
||||
event.keysym.mod & KMOD_ALT,
|
||||
event.keysym.mod & KMOD_LMETA,
|
||||
(event.keysym.mod & KMOD_SHIFT) != 0,
|
||||
(event.keysym.mod & KMOD_CTRL) != 0,
|
||||
(event.keysym.mod & KMOD_ALT) != 0,
|
||||
(event.keysym.mod & KMOD_LMETA) != 0,
|
||||
mods);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "filesystem.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "events.hpp"
|
||||
#include "font.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "key.hpp"
|
||||
|
||||
#define KEY_TEST 0
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "font.hpp"
|
||||
#include "language.hpp"
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "log.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game.hpp"
|
||||
#include "map.hpp"
|
||||
#include "pathfind.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "display.hpp"
|
||||
#include "font.hpp"
|
||||
#include "language.hpp"
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "mapgen_dialog.hpp"
|
||||
|
||||
#include "events.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "mouse.hpp"
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "cursor.hpp"
|
||||
#include "events.hpp"
|
||||
#include "filesystem.hpp"
|
||||
|
@ -172,8 +174,7 @@ void multiplayer_game_setup_dialog::set_area(const SDL_Rect& area)
|
|||
_("Name of game") + std::string(":"),xpos,ypos).h + border_size;
|
||||
string_map i18n_symbols;
|
||||
i18n_symbols["login"] = preferences::login();
|
||||
name_entry_.assign(new gui::textbox(disp_,width-20,
|
||||
vgettext("$login's game", i18n_symbols)));
|
||||
name_entry_.assign(new gui::textbox(disp_,width-20,vgettext("$login's game", i18n_symbols)));
|
||||
name_entry_->set_location(xpos,ypos);
|
||||
name_entry_->set_dirty();
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "language.hpp"
|
||||
#include "log.hpp"
|
||||
#include "multiplayer.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "events.hpp"
|
||||
#include "font.hpp"
|
||||
#include "language.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "events.hpp"
|
||||
#include "filesystem.hpp"
|
||||
#include "font.hpp"
|
||||
|
@ -306,7 +308,7 @@ RESULT enter(display& disp, config& game_data, const config& terrain_data, dialo
|
|||
}
|
||||
|
||||
const bool enter = key[SDLK_RETURN] && !old_enter;
|
||||
old_enter = key[SDLK_RETURN];
|
||||
old_enter = key[SDLK_RETURN] != 0;
|
||||
if(enter && message_entry.text().empty() == false) {
|
||||
const std::string& text = message_entry.text();
|
||||
|
||||
|
@ -337,7 +339,7 @@ RESULT enter(display& disp, config& game_data, const config& terrain_data, dialo
|
|||
return QUIT;
|
||||
}
|
||||
|
||||
last_escape = bool(key[SDLK_ESCAPE]);
|
||||
last_escape = key[SDLK_ESCAPE] != 0;
|
||||
|
||||
events::raise_process_event();
|
||||
events::raise_draw_event();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "log.hpp"
|
||||
#include "network.hpp"
|
||||
#include "network_worker.hpp"
|
||||
|
@ -218,7 +220,7 @@ server_manager::~server_manager()
|
|||
|
||||
bool server_manager::is_running() const
|
||||
{
|
||||
return static_cast<bool>(server_socket);
|
||||
return server_socket != NULL;
|
||||
}
|
||||
|
||||
size_t nconnections()
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "log.hpp"
|
||||
#include "network_worker.hpp"
|
||||
#include "network.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game.hpp"
|
||||
#include "pathfind.hpp"
|
||||
#include "util.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "pathutils.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "cursor.hpp"
|
||||
#include "events.hpp"
|
||||
#include "filesystem.hpp"
|
||||
|
@ -554,6 +556,7 @@ LEVEL_RESULT play_level(game_data& gameinfo, const config& game_config,
|
|||
replaying = do_replay(gui,map,gameinfo,units,teams,
|
||||
player_number,status,state_of_game);
|
||||
} catch(replay::error& e) {
|
||||
e;
|
||||
std::cerr << "caught replay::error\n";
|
||||
gui::show_dialog(gui,NULL,"",_("The file you have tried to load is corrupt"),gui::OK_ONLY);
|
||||
|
||||
|
@ -806,6 +809,7 @@ redo_turn:
|
|||
}
|
||||
} //end catch
|
||||
catch(replay::error& e) {
|
||||
e;
|
||||
std::cerr << "caught replay::error\n";
|
||||
gui::show_dialog(gui,NULL,"",_("The file you have tried to load is corrupt"),
|
||||
gui::OK_ONLY);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "events.hpp"
|
||||
#include "help.hpp"
|
||||
|
@ -1146,6 +1148,7 @@ void turn_info::end_turn()
|
|||
config starting_pos;
|
||||
recorder.save_game(gameinfo_,_("Auto-Save"),snapshot,state_of_game_.starting_pos);
|
||||
} catch(gamestatus::save_game_failed& e) {
|
||||
e;
|
||||
gui::show_dialog(gui_,NULL,"",_("Could not auto save the game. Please save the game manually."),gui::MESSAGE);
|
||||
//do not bother retrying, since the user can just save the game
|
||||
}
|
||||
|
@ -1402,6 +1405,7 @@ void turn_info::save_game(const std::string& message, gui::DIALOG_TYPE dialog_ty
|
|||
gui::show_dialog(gui_,NULL,_("Saved"),_("The game has been saved"), gui::OK_ONLY);
|
||||
}
|
||||
} catch(gamestatus::save_game_failed& e) {
|
||||
e;
|
||||
gui::show_dialog(gui_,NULL,_("Error"),_("The game could not be saved"),gui::MESSAGE);
|
||||
//do not bother retrying, since the user can just try to save the game again
|
||||
};
|
||||
|
@ -2414,6 +2418,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
|
|||
turn_end = do_replay(gui_,map_,gameinfo_,units_,teams_,
|
||||
team_num_,status_,state_of_game_,&replay_obj);
|
||||
} catch(replay::error& e) {
|
||||
e;
|
||||
//notify remote hosts of out of sync error
|
||||
config cfg;
|
||||
config& info = cfg.add_child("info");
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "cursor.hpp"
|
||||
|
@ -1049,15 +1051,15 @@ void show_hotkeys_dialog (display & disp, config *save_config)
|
|||
restorer.restore();
|
||||
disp.update_display();
|
||||
|
||||
const hotkey::hotkey_item& oldhk = hotkey::get_hotkey(key, mod & KMOD_SHIFT,
|
||||
mod & KMOD_CTRL, mod & KMOD_ALT, mod & KMOD_LMETA);
|
||||
const hotkey::hotkey_item& oldhk = hotkey::get_hotkey(key, (mod & KMOD_SHIFT) != 0,
|
||||
(mod & KMOD_CTRL) != 0, (mod & KMOD_ALT) != 0, (mod & KMOD_LMETA) != 0);
|
||||
hotkey::hotkey_item& newhk = hotkey::get_visible_hotkey(menu_.selection());
|
||||
|
||||
if(oldhk.get_id() != newhk.get_id() && !oldhk.null()) {
|
||||
gui::show_dialog(disp,NULL,"",_("This HotKey is already in use."),gui::MESSAGE);
|
||||
} else {
|
||||
newhk.set_key(key, mod & KMOD_SHIFT,
|
||||
mod & KMOD_CTRL, mod & KMOD_ALT, mod & KMOD_LMETA);
|
||||
newhk.set_key(key, (mod & KMOD_SHIFT) != 0,
|
||||
(mod & KMOD_CTRL) != 0, (mod & KMOD_ALT) != 0, (mod & KMOD_LMETA) != 0);
|
||||
|
||||
menu_.change_item(menu_.selection(), 2, newhk.get_name());
|
||||
};
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "filesystem.hpp"
|
||||
#include "publish_campaign.hpp"
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include "race.hpp"
|
||||
#include "replay.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "ai_interface.hpp"
|
||||
#include "dialogs.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "font.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "input_stream.hpp"
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <fcntl.h>
|
||||
|
@ -7,8 +9,11 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#endif
|
||||
|
||||
input_stream::input_stream(const std::string& path) : fd_(-1), path_(path)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if(path == "") {
|
||||
return;
|
||||
}
|
||||
|
@ -25,18 +30,22 @@ input_stream::input_stream(const std::string& path) : fd_(-1), path_(path)
|
|||
} else {
|
||||
std::cerr << "opened fifo at '" << path << "'. Server commands may be written to this file.\n";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
input_stream::~input_stream()
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if(fd_ != -1) {
|
||||
close(fd_);
|
||||
unlink(path_.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool input_stream::read_line(std::string& str)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if(fd_ == -1) {
|
||||
return false;
|
||||
}
|
||||
|
@ -56,4 +65,7 @@ bool input_stream::read_line(std::string& str)
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "cursor.hpp"
|
||||
#include "events.hpp"
|
||||
|
@ -744,16 +746,16 @@ int show_dialog(display& disp, surface image,
|
|||
int mousex, mousey;
|
||||
const int mouse_flags = SDL_GetMouseState(&mousex,&mousey);
|
||||
|
||||
const bool new_right_button = mouse_flags&SDL_BUTTON_RMASK;
|
||||
const bool new_left_button = mouse_flags&SDL_BUTTON_LMASK;
|
||||
const bool new_right_button = (mouse_flags&SDL_BUTTON_RMASK) != 0;
|
||||
const bool new_left_button = (mouse_flags&SDL_BUTTON_LMASK) != 0;
|
||||
const bool new_key_down = key[SDLK_SPACE] || key[SDLK_RETURN] ||
|
||||
key[SDLK_ESCAPE];
|
||||
|
||||
const bool new_up_arrow = key[SDLK_UP];
|
||||
const bool new_down_arrow = key[SDLK_DOWN];
|
||||
const bool new_up_arrow = key[SDLK_UP] != 0;
|
||||
const bool new_down_arrow = key[SDLK_DOWN] != 0;
|
||||
|
||||
const bool new_page_up = key[SDLK_PAGEUP];
|
||||
const bool new_page_down = key[SDLK_PAGEDOWN];
|
||||
const bool new_page_up = key[SDLK_PAGEUP] != 0;
|
||||
const bool new_page_down = key[SDLK_PAGEDOWN] != 0;
|
||||
|
||||
if((!key_down && key[SDLK_RETURN] || menu_.double_clicked()) &&
|
||||
(type == YES_NO || type == OK_CANCEL || type == OK_ONLY || type == CLOSE_ONLY)) {
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include "filesystem.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "statistics.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game_config.hpp"
|
||||
#include "game_events.hpp"
|
||||
#include "gamestatus.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "terrain.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "font.hpp"
|
||||
#include "language.hpp"
|
||||
#include "log.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "thread.hpp"
|
||||
|
||||
namespace threading {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "cursor.hpp"
|
||||
#include "display.hpp"
|
||||
|
@ -124,6 +126,7 @@ const config get_tips_of_day()
|
|||
try {
|
||||
cfg.read(preprocess_file("data/tips.cfg"));
|
||||
} catch(config::error& e) {
|
||||
e;
|
||||
std::cerr << "Could not read tips.cfg\n";
|
||||
}
|
||||
|
||||
|
@ -258,7 +261,7 @@ TITLE_RESULT show_title(display& screen, config& tips_of_day, int* ntip)
|
|||
|
||||
CKey key;
|
||||
|
||||
bool last_escape = key[SDLK_ESCAPE];
|
||||
bool last_escape = key[SDLK_ESCAPE] != 0;
|
||||
|
||||
update_whole_screen();
|
||||
|
||||
|
@ -287,7 +290,7 @@ TITLE_RESULT show_title(display& screen, config& tips_of_day, int* ntip)
|
|||
if(!last_escape && key[SDLK_ESCAPE])
|
||||
return QUIT_GAME;
|
||||
|
||||
last_escape = key[SDLK_ESCAPE];
|
||||
last_escape = key[SDLK_ESCAPE] != 0;
|
||||
|
||||
events::pump();
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "font.hpp"
|
||||
#include "show_dialog.hpp"
|
||||
#include "tooltips.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "font.hpp"
|
||||
#include "game_config.hpp"
|
||||
#include "gamestatus.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "actions.hpp"
|
||||
#include "events.hpp"
|
||||
#include "game_config.hpp"
|
||||
|
@ -613,8 +615,6 @@ bool unit_attack(display& disp, unit_map& units, const gamemap& map,
|
|||
int xloc = disp.get_location_x(a);
|
||||
int yloc = disp.get_location_y(a);
|
||||
|
||||
SDL_Rect area = disp.map_area();
|
||||
|
||||
//we try to scroll the map if the unit is at the edge.
|
||||
//keep track of the old position, and if the map moves at all,
|
||||
//then recenter it on the unit
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
#include "game_config.hpp"
|
||||
#include "gamestatus.hpp"
|
||||
#include "language.hpp"
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "global.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "button.hpp"
|
||||
#include "../display.hpp"
|
||||
#include "../game.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "combo.hpp"
|
||||
#include "button.hpp"
|
||||
#include "../show_dialog.hpp"
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "../font.hpp"
|
||||
#include "../events.hpp"
|
||||
#include "../language.hpp"
|
||||
|
@ -124,6 +126,8 @@ void file_chooser::draw_contents() {
|
|||
void file_chooser::process() {
|
||||
CKey key;
|
||||
int mousex, mousey;
|
||||
SDL_GetMouseState(&mousex,&mousey);
|
||||
|
||||
// The menu does not implement focus functionality, so we fake
|
||||
// it. We give the file list focus whenever the filename textbox
|
||||
// does not have focus. Inflexible but easy solution.
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "label.hpp"
|
||||
#include "../font.hpp"
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
//disable the very annoying VC++ warning 4786
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#endif
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "menu.hpp"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "../global.hpp"
|
||||
|
||||
#include "progressbar.hpp"
|
||||
|
||||
#include "../display.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "scrollarea.hpp"
|
||||
#include "../display.hpp"
|
||||
#include "../image.hpp"
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "scrollbar.hpp"
|
||||
#include "../display.hpp"
|
||||
#include "../image.hpp"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "scrollpane.hpp"
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
/// \param callback a callback interface for warning that the grip has been moved
|
||||
scrollpane(display &d);
|
||||
|
||||
void add_widget(widget* w, int x, int x, int z_order = 0);
|
||||
void add_widget(widget* w, int x, int y, int z_order = 0);
|
||||
void remove_widget(widget* w);
|
||||
void clear();
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "slider.hpp"
|
||||
#include "../display.hpp"
|
||||
#include "../image.hpp"
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "../global.hpp"
|
||||
|
||||
#include "textbox.hpp"
|
||||
#include "../clipboard.hpp"
|
||||
#include "../font.hpp"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "../global.hpp"
|
||||
|
||||
#include "widget.hpp"
|
||||
#include "../display.hpp"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue