[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp font.cpp ga...
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp font.cpp ga... |
Date: |
Sat, 19 Mar 2005 05:26:43 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/03/19 10:26:43
Modified files:
src : dialogs.cpp dialogs.hpp font.cpp
game_events.cpp game_events.hpp help.cpp
help.hpp playlevel.cpp playlevel.hpp
playturn.cpp playturn.hpp
src/sdl_ttf : SDL_ttf.c SDL_ttf.h
Log message:
Const-correctness on play_level, and play_turn.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.89&tr2=1.90&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.hpp.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.cpp.diff?tr1=1.122&tr2=1.123&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.cpp.diff?tr1=1.127&tr2=1.128&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.hpp.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.77&tr2=1.78&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.hpp.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.cpp.diff?tr1=1.185&tr2=1.186&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.hpp.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.343&tr2=1.344&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.hpp.diff?tr1=1.64&tr2=1.65&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_ttf/SDL_ttf.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_ttf/SDL_ttf.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.89 wesnoth/src/dialogs.cpp:1.90
--- wesnoth/src/dialogs.cpp:1.89 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/dialogs.cpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.89 2005/03/18 21:21:48 ydirson Exp $ */
+/* $Id: dialogs.cpp,v 1.90 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -163,7 +163,7 @@
return true;
}
-void show_objectives(display& disp, config& level_info)
+void show_objectives(display& disp, const config& level_info)
{
static const std::string no_objectives(_("No objectives available"));
const std::string& name = level_info["name"];
Index: wesnoth/src/dialogs.hpp
diff -u wesnoth/src/dialogs.hpp:1.31 wesnoth/src/dialogs.hpp:1.32
--- wesnoth/src/dialogs.hpp:1.31 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/dialogs.hpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: dialogs.hpp,v 1.31 2005/03/18 21:21:48 ydirson Exp $ */
+/* $Id: dialogs.hpp,v 1.32 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -36,7 +36,7 @@
bool animate_unit_advancement(const game_data& info,unit_map& units,
gamemap::location loc, display& gui, size_t choice);
-void show_objectives(display& disp, config& level_info);
+void show_objectives(display& disp, const config& level_info);
// Ask user if I should really save the game and what name I should use
// returns 0 iff user wants to save the game
Index: wesnoth/src/font.cpp
diff -u wesnoth/src/font.cpp:1.122 wesnoth/src/font.cpp:1.123
--- wesnoth/src/font.cpp:1.122 Tue Mar 15 22:13:34 2005
+++ wesnoth/src/font.cpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: font.cpp,v 1.122 2005/03/15 22:13:34 gruikya Exp $ */
+/* $Id: font.cpp,v 1.123 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -42,6 +42,15 @@
#define WRN_FT lg::warn(lg::display)
#define ERR_FT lg::err(lg::display)
+//Deliberately breaking compilation with the original SDL_ttf library. Remove
+//the lines below to be able to do this anyway, however this is buggy and may
+//cause random memory corruption errors depending on the OS / Version of
+//Freetype / Language you are using!
+//
+#ifndef SDL_TTF_WESNOTH
+#error Please use the SDL_ttf files in the sdl_ttf directory, and not the
original SDL_ttf library.
+#endif
+
namespace {
// Signed int. Negative values mean "no subset".
@@ -435,11 +444,6 @@
continue;
font_style_setter const style_setter(ttfont, style_);
- //DEBUG
- if (itor->text[0] == 'æ') {
- std::cerr << "Nihongo detected:\n";
- }
-
surface s = surface(TTF_RenderUNICODE_Blended(ttfont, (Uint16
const *)&(itor->ucs2_text.front()), color_));
if(!s.null())
surfs_.push_back(s);
Index: wesnoth/src/game_events.cpp
diff -u wesnoth/src/game_events.cpp:1.127 wesnoth/src/game_events.cpp:1.128
--- wesnoth/src/game_events.cpp:1.127 Sat Mar 19 04:26:53 2005
+++ wesnoth/src/game_events.cpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: game_events.cpp,v 1.127 2005/03/19 04:26:53 Sirp Exp $ */
+/* $Id: game_events.cpp,v 1.128 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -141,7 +141,7 @@
std::map<gamemap::location,unit>* units = NULL;
std::vector<team>* teams = NULL;
game_state* state_of_game = NULL;
-game_data* game_data_ptr = NULL;
+const game_data* game_data_ptr = NULL;
gamestatus* status_ptr = NULL;
std::set<std::string> used_items;
@@ -1553,10 +1553,11 @@
state_of_game->variables[key] = value;
}
-manager::manager(config& cfg, display& gui_, gamemap& map_,
+manager::manager(const config& cfg, display& gui_, gamemap& map_,
std::map<gamemap::location,unit>& units_,
std::vector<team>& teams_,
- game_state& state_of_game_, gamestatus& status, game_data&
game_data_)
+ game_state& state_of_game_, gamestatus& status,
+ const game_data& game_data_)
{
const config::child_list& events_list = cfg.get_children("event");
for(config::child_list::const_iterator i = events_list.begin();
Index: wesnoth/src/game_events.hpp
diff -u wesnoth/src/game_events.hpp:1.25 wesnoth/src/game_events.hpp:1.26
--- wesnoth/src/game_events.hpp:1.25 Thu Mar 10 00:00:06 2005
+++ wesnoth/src/game_events.hpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: game_events.hpp,v 1.25 2005/03/10 00:00:06 ydirson Exp $ */
+/* $Id: game_events.hpp,v 1.26 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -42,9 +42,9 @@
struct manager {
//note that references will be maintained, and must remain valid
//for the life of the object.
- manager(config& scenario_cfg, display& disp, gamemap& map,
- std::map<gamemap::location,unit>& units, std::vector<team>&
teams,
- game_state& state_of_game, gamestatus& status, game_data&
data);
+ manager(const config& scenario_cfg, display& disp, gamemap& map,
+ std::map<gamemap::location,unit>& units,
std::vector<team>& teams,
+ game_state& state_of_game, gamestatus& status, const
game_data& data);
~manager();
};
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.77 wesnoth/src/help.cpp:1.78
--- wesnoth/src/help.cpp:1.77 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/help.cpp Sat Mar 19 10:26:43 2005
@@ -485,7 +485,7 @@
namespace {
const config *game_cfg = NULL;
- game_data *game_info = NULL;
+ const game_data *game_info = NULL;
gamemap *map = NULL;
// The default toplevel.
help::section toplevel;
@@ -656,7 +656,7 @@
namespace help {
-help_manager::help_manager(const config *cfg, game_data *gameinfo, gamemap
*_map) {
+help_manager::help_manager(const config *cfg, const game_data *gameinfo,
gamemap *_map) {
game_cfg = cfg == NULL ? &dummy_cfg : cfg;
game_info = gameinfo;
map = _map;
@@ -1030,7 +1030,7 @@
advance_end = next_units.end();
advance_it != advance_end; ++advance_it) {
std::string unit_id = *advance_it;
- std::map<std::string,unit_type>::iterator
new_type = game_info->unit_types.find(unit_id);
+ std::map<std::string,unit_type>::const_iterator
new_type = game_info->unit_types.find(unit_id);
if(new_type != game_info->unit_types.end()) {
std::string lang_unit =
new_type->second.language_name();
std::string ref_id =
std::string("unit_") + new_type->second.id();
Index: wesnoth/src/help.hpp
diff -u wesnoth/src/help.hpp:1.17 wesnoth/src/help.hpp:1.18
--- wesnoth/src/help.hpp:1.17 Thu Nov 18 04:08:32 2004
+++ wesnoth/src/help.hpp Sat Mar 19 10:26:43 2005
@@ -23,7 +23,7 @@
namespace help {
struct help_manager {
- help_manager(const config *game_config, game_data *game_info, gamemap
*map);
+ help_manager(const config *game_config, const game_data *game_info,
gamemap *map);
~help_manager();
};
Index: wesnoth/src/playlevel.cpp
diff -u wesnoth/src/playlevel.cpp:1.185 wesnoth/src/playlevel.cpp:1.186
--- wesnoth/src/playlevel.cpp:1.185 Wed Mar 16 21:49:37 2005
+++ wesnoth/src/playlevel.cpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: playlevel.cpp,v 1.185 2005/03/16 21:49:37 ydirson Exp $ */
+/* $Id: playlevel.cpp,v 1.186 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -119,7 +119,7 @@
}
}
-LEVEL_RESULT play_level(game_data& gameinfo, const config& game_config,
+LEVEL_RESULT play_level(const game_data& gameinfo, const config& game_config,
config* level, CVideo& video,
game_state& state_of_game,
const std::vector<config*>& story)
@@ -597,7 +597,7 @@
try {
play_turn(gameinfo,state_of_game,status,game_config,
- level, key, gui, map,
teams, player_number,
+ *level, key, gui,
map, teams, player_number,
units, textbox_info,
replay_sender);
} catch(end_turn_exception& end_turn) {
if (end_turn.redo ==
player_number)
@@ -616,9 +616,9 @@
const cursor::setter
cursor_setter(cursor::WAIT);
turn_info
turn_data(gameinfo,state_of_game,status,
-
game_config,level,key,gui,
+
game_config,*level,key,gui,
map,teams,player_number,units,
-
turn_info::BROWSE_AI,textbox_info,replay_sender);
+
turn_info::BROWSE_AI,textbox_info,replay_sender);
ai_interface::info
ai_info(gui,map,gameinfo,units,teams,player_number,status,turn_data);
util::scoped_ptr<ai_interface>
ai_obj(create_ai(team_it->ai_algorithm(),ai_info));
@@ -635,8 +635,10 @@
LOG_NG << "is networked...\n";
turn_info
turn_data(gameinfo,state_of_game,status,
-
game_config,level,key,gui,
-
map,teams,player_number,units,turn_info::BROWSE_NETWORKED,textbox_info,replay_sender);
+
game_config,*level,key,gui,
+
map,teams,player_number,units,
+
turn_info::BROWSE_NETWORKED,
+
textbox_info,replay_sender);
for(;;) {
@@ -853,8 +855,8 @@
}
turn_info turn_data(gameinfo,state_of_game,status,
- game_config,level,key,gui,
-
map,teams,player_number,units,turn_info::BROWSE_NETWORKED,textbox_info,replay_sender);
+ game_config,*level,key,gui,
+
map,teams,player_number,units,turn_info::BROWSE_NETWORKED,textbox_info,replay_sender);
turn_data.save_game(_("A network disconnection has occured, and
the game cannot continue. Do you want to save the game?"),gui::YES_NO);
if(disconnect) {
Index: wesnoth/src/playlevel.hpp
diff -u wesnoth/src/playlevel.hpp:1.20 wesnoth/src/playlevel.hpp:1.21
--- wesnoth/src/playlevel.hpp:1.20 Thu Mar 10 20:43:48 2005
+++ wesnoth/src/playlevel.hpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: playlevel.hpp,v 1.20 2005/03/10 20:43:48 ydirson Exp $ */
+/* $Id: playlevel.hpp,v 1.21 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -37,7 +37,7 @@
int redo;
};
-LEVEL_RESULT play_level(game_data& gameinfo, const config& terrain_config,
+LEVEL_RESULT play_level(const game_data& gameinfo, const config&
terrain_config,
config* level, CVideo& video,
game_state& state_of_game,
const std::vector<config*>& story);
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.343 wesnoth/src/playturn.cpp:1.344
--- wesnoth/src/playturn.cpp:1.343 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/playturn.cpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.343 2005/03/18 21:21:48 ydirson Exp $ */
+/* $Id: playturn.cpp,v 1.344 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -60,9 +60,9 @@
--commands_disabled;
}
-void play_turn(game_data& gameinfo, game_state& state_of_game,
- gamestatus& status, const config& terrain_config,
- config* level, CKey& key, display& gui, gamemap& map,
+void play_turn(const game_data& gameinfo, game_state& state_of_game,
+ const gamestatus& status, const config& terrain_config,
+ const config& level, CKey& key, display& gui, gamemap& map,
std::vector<team>& teams, int team_num,
std::map<gamemap::location,unit>& units,
turn_info::floating_textbox& textbox,
@@ -139,11 +139,12 @@
turn_data.send_data();
}
-turn_info::turn_info(game_data& gameinfo, game_state& state_of_game,
- gamestatus& status, const config& terrain_config, config*
level,
- CKey& key, display& gui, gamemap& map,
- std::vector<team>& teams, int team_num,
- unit_map& units, TURN_MODE mode, floating_textbox&
textbox, replay_network_sender& replay_sender)
+turn_info::turn_info(const game_data& gameinfo, game_state& state_of_game,
+ const gamestatus& status, const config& terrain_config,
+ const config& level, CKey& key, display& gui, gamemap& map,
+ std::vector<team>& teams, int team_num, unit_map& units,
+ TURN_MODE mode, floating_textbox& textbox,
+ replay_network_sender& replay_sender)
: paths_wiper(gui),
gameinfo_(gameinfo), state_of_game_(state_of_game), status_(status),
terrain_config_(terrain_config), level_(level),
@@ -1611,7 +1612,7 @@
void turn_info::write_game_snapshot(config& start) const
{
- start.values = level_->values;
+ start.values = level_.values;
start["snapshot"] = "yes";
@@ -1923,7 +1924,7 @@
gui_.draw(); //clear the old menu
- if((*level_)["disallow_recall"] == "yes") {
+ if(level_["disallow_recall"] == "yes") {
gui::show_dialog(gui_,NULL,"",_("You are separated from your
soldiers and may not recall them"));
} else if(recall_list.empty()) {
gui::show_dialog(gui_,NULL,"",_("There are no troops available
to recall\n\
@@ -2095,7 +2096,7 @@
void turn_info::objectives()
{
- dialogs::show_objectives(gui_,*level_);
+ dialogs::show_objectives(gui_,level_);
}
void turn_info::unit_list()
Index: wesnoth/src/playturn.hpp
diff -u wesnoth/src/playturn.hpp:1.64 wesnoth/src/playturn.hpp:1.65
--- wesnoth/src/playturn.hpp:1.64 Thu Mar 10 22:29:57 2005
+++ wesnoth/src/playturn.hpp Sat Mar 19 10:26:43 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.hpp,v 1.64 2005/03/10 22:29:57 ydirson Exp $ */
+/* $Id: playturn.hpp,v 1.65 2005/03/19 10:26:43 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -79,11 +79,12 @@
enum TURN_MODE { PLAY_TURN, BROWSE_NETWORKED, BROWSE_AI };
- turn_info(game_data& gameinfo, game_state& state_of_game,
- gamestatus& status, const config& terrain_config, config*
level,
- CKey& key, display& gui, gamemap& map,
- std::vector<team>& teams, int team_num,
- unit_map& units, TURN_MODE mode, floating_textbox& textbox,
replay_network_sender& network_sender);
+ turn_info(const game_data& gameinfo, game_state& state_of_game,
+ const gamestatus& status, const config& terrain_config,
+ const config& level, CKey& key, display& gui, gamemap& map,
+ std::vector<team>& teams, int team_num, unit_map& units,
+ TURN_MODE mode, floating_textbox& textbox,
+ replay_network_sender& network_sender);
void turn_slice();
@@ -201,11 +202,11 @@
void change_side_controller(const std::string& side, const std::string&
player, bool orphan_side=false);
- game_data& gameinfo_;
+ const game_data& gameinfo_;
game_state& state_of_game_;
- gamestatus& status_;
+ const gamestatus& status_;
const config& terrain_config_;
- config* level_;
+ const config& level_;
CKey key_;
display& gui_;
gamemap& map_;
@@ -253,8 +254,9 @@
replay_network_sender& replay_sender_;
};
-void play_turn(game_data& gameinfo, game_state& state_of_game,
- gamestatus& status, const config& terrain_config, config* level,
+void play_turn(const game_data& gameinfo, game_state& state_of_game,
+ const gamestatus& status, const config& terrain_config,
+ const config& level,
CKey& key, display& gui, gamemap& map,
std::vector<team>& teams, int team_num,
std::map<gamemap::location,unit>& units,
Index: wesnoth/src/sdl_ttf/SDL_ttf.c
diff -u wesnoth/src/sdl_ttf/SDL_ttf.c:1.6 wesnoth/src/sdl_ttf/SDL_ttf.c:1.7
--- wesnoth/src/sdl_ttf/SDL_ttf.c:1.6 Wed Mar 16 20:42:41 2005
+++ wesnoth/src/sdl_ttf/SDL_ttf.c Sat Mar 19 10:26:43 2005
@@ -20,7 +20,7 @@
address@hidden
*/
-/* $Id: SDL_ttf.c,v 1.6 2005/03/16 20:42:41 gruikya Exp $ */
+/* $Id: SDL_ttf.c,v 1.7 2005/03/19 10:26:43 gruikya Exp $ */
#include <math.h>
#include <stdio.h>
@@ -439,7 +439,9 @@
if ( ! cached->index ) {
cached->index = FT_Get_Char_Index( face, ch );
}
+ //error = FT_Load_Glyph( face, cached->index, FT_LOAD_DEFAULT |
FT_LOAD_NO_BITMAP );
error = FT_Load_Glyph( face, cached->index, FT_LOAD_DEFAULT );
+
if( error ) {
return error;
}
Index: wesnoth/src/sdl_ttf/SDL_ttf.h
diff -u wesnoth/src/sdl_ttf/SDL_ttf.h:1.2 wesnoth/src/sdl_ttf/SDL_ttf.h:1.3
--- wesnoth/src/sdl_ttf/SDL_ttf.h:1.2 Thu Nov 18 19:22:59 2004
+++ wesnoth/src/sdl_ttf/SDL_ttf.h Sat Mar 19 10:26:43 2005
@@ -20,7 +20,7 @@
address@hidden
*/
-/* $Id: SDL_ttf.h,v 1.2 2004/11/18 19:22:59 gruikya Exp $ */
+/* $Id: SDL_ttf.h,v 1.3 2005/03/19 10:26:43 gruikya Exp $ */
/* This library is a wrapper around the excellent FreeType 2.0 library,
available at:
@@ -43,6 +43,7 @@
#define SDL_TTF_MAJOR_VERSION 2
#define SDL_TTF_MINOR_VERSION 0
#define SDL_TTF_PATCHLEVEL 7
+#define SDL_TTF_WESNOTH 1
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_ttf library.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src dialogs.cpp dialogs.hpp font.cpp ga...,
Philippe Plantier <=