[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src game.cpp map.cpp map.hpp pathutils....
From: |
Isaac Clerencia |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src game.cpp map.cpp map.hpp pathutils.... |
Date: |
Sat, 19 Feb 2005 04:26:31 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <address@hidden> 05/02/19 09:26:31
Modified files:
src : game.cpp map.cpp map.hpp pathutils.cpp
pathutils.hpp unit_types.cpp unit_types.hpp
Log message:
Removed some CRLF's
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.190&tr2=1.191&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/map.cpp.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/map.hpp.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathutils.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathutils.hpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.cpp.diff?tr1=1.78&tr2=1.79&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.hpp.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.190 wesnoth/src/game.cpp:1.191
--- wesnoth/src/game.cpp:1.190 Sat Feb 12 21:42:06 2005
+++ wesnoth/src/game.cpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.190 2005/02/12 21:42:06 Sirp Exp $ */
+/* $Id: game.cpp,v 1.191 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1649,8 +1649,8 @@
//just means the game should quit
} catch(end_level_exception&) {
std::cerr << "caught end_level_exception (quitting)\n";
- } catch(std::bad_alloc&) {
- std::cerr << "ran out of memory: game aborted\n";
+ } catch(std::bad_alloc&) {
+ std::cerr << "ran out of memory: game aborted\n";
} /*catch(...) {
std::cerr << "Unhandled exception. Exiting\n";
}*/
Index: wesnoth/src/map.cpp
diff -u wesnoth/src/map.cpp:1.48 wesnoth/src/map.cpp:1.49
--- wesnoth/src/map.cpp:1.48 Mon Feb 7 03:44:37 2005
+++ wesnoth/src/map.cpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: map.cpp,v 1.48 2005/02/07 03:44:37 Sirp Exp $ */
+/* $Id: map.cpp,v 1.49 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -83,25 +83,25 @@
{
return on_board(loc) && is_keep(get_terrain(loc));
}
-
-gamemap::location::DIRECTION gamemap::location::parse_direction(const
std::string& str)
-{
- if(str == "n") {
- return NORTH;
- } else if(str == "ne") {
- return NORTH_EAST;
- } else if(str == "se") {
- return SOUTH_EAST;
- } else if(str == "s") {
- return SOUTH;
- } else if(str == "sw") {
- return SOUTH_WEST;
- } else if(str == "nw") {
- return NORTH_WEST;
- } else {
- return NDIRECTIONS;
- }
-}
+
+gamemap::location::DIRECTION gamemap::location::parse_direction(const
std::string& str)
+{
+ if(str == "n") {
+ return NORTH;
+ } else if(str == "ne") {
+ return NORTH_EAST;
+ } else if(str == "se") {
+ return SOUTH_EAST;
+ } else if(str == "s") {
+ return SOUTH;
+ } else if(str == "sw") {
+ return SOUTH_WEST;
+ } else if(str == "nw") {
+ return NORTH_WEST;
+ } else {
+ return NDIRECTIONS;
+ }
+}
gamemap::location::location(const config& cfg) : x(-1), y(-1)
{
Index: wesnoth/src/map.hpp
diff -u wesnoth/src/map.hpp:1.31 wesnoth/src/map.hpp:1.32
--- wesnoth/src/map.hpp:1.31 Mon Feb 7 03:44:37 2005
+++ wesnoth/src/map.hpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: map.hpp,v 1.31 2005/02/07 03:44:37 Sirp Exp $ */
+/* $Id: map.hpp,v 1.32 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -52,8 +52,8 @@
struct location {
//any valid direction which can be moved in in our hexagonal
world.
enum DIRECTION { NORTH, NORTH_EAST, SOUTH_EAST, SOUTH,
- SOUTH_WEST, NORTH_WEST, NDIRECTIONS };
-
+ SOUTH_WEST, NORTH_WEST, NDIRECTIONS };
+
static DIRECTION parse_direction(const std::string& str);
location() : x(-1), y(-1) {}
Index: wesnoth/src/pathutils.cpp
diff -u wesnoth/src/pathutils.cpp:1.3 wesnoth/src/pathutils.cpp:1.4
--- wesnoth/src/pathutils.cpp:1.3 Mon Feb 7 03:44:37 2005
+++ wesnoth/src/pathutils.cpp Sat Feb 19 09:26:31 2005
@@ -34,19 +34,19 @@
++res;
res->x = a.x-1;
res->y = a.y - (is_even(a.x) ? 1:0);
-}
-
-gamemap::location::DIRECTION get_adjacent_direction(const gamemap::location&
from, const gamemap::location& to)
-{
- gamemap::location adj[6];
- get_adjacent_tiles(from,adj);
- for(size_t n = 0; n != 6; ++n) {
- if(adj[n] == to) {
- return static_cast<gamemap::location::DIRECTION>(n);
- }
- }
-
- return gamemap::location::NDIRECTIONS;
+}
+
+gamemap::location::DIRECTION get_adjacent_direction(const gamemap::location&
from, const gamemap::location& to)
+{
+ gamemap::location adj[6];
+ get_adjacent_tiles(from,adj);
+ for(size_t n = 0; n != 6; ++n) {
+ if(adj[n] == to) {
+ return static_cast<gamemap::location::DIRECTION>(n);
+ }
+ }
+
+ return gamemap::location::NDIRECTIONS;
}
bool tiles_adjacent(const gamemap::location& a, const gamemap::location& b)
Index: wesnoth/src/pathutils.hpp
diff -u wesnoth/src/pathutils.hpp:1.3 wesnoth/src/pathutils.hpp:1.4
--- wesnoth/src/pathutils.hpp:1.3 Mon Feb 7 03:44:37 2005
+++ wesnoth/src/pathutils.hpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: pathutils.hpp,v 1.3 2005/02/07 03:44:37 Sirp Exp $ */
+/* $Id: pathutils.hpp,v 1.4 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -22,10 +22,10 @@
//function which, given a location, will place all adjacent locations in
//res. res must point to an array of 6 location objects.
-void get_adjacent_tiles(const gamemap::location& a, gamemap::location* res);
-
-//function which returns the direction from 'from' to 'to'. If 'from' and 'to'
are not adjacent, then
-//the function will return 'NDIRECTIONS'.
+void get_adjacent_tiles(const gamemap::location& a, gamemap::location* res);
+
+//function which returns the direction from 'from' to 'to'. If 'from' and 'to'
are not adjacent, then
+//the function will return 'NDIRECTIONS'.
gamemap::location::DIRECTION get_adjacent_direction(const gamemap::location&
from, const gamemap::location& to);
//function which gives the number of hexes between two tiles (i.e. the minimum
Index: wesnoth/src/unit_types.cpp
diff -u wesnoth/src/unit_types.cpp:1.78 wesnoth/src/unit_types.cpp:1.79
--- wesnoth/src/unit_types.cpp:1.78 Wed Feb 9 23:32:01 2005
+++ wesnoth/src/unit_types.cpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: unit_types.cpp,v 1.78 2005/02/09 23:32:01 ydirson Exp $ */
+/* $Id: unit_types.cpp,v 1.79 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -141,18 +141,18 @@
attack_type::attack_type(const config& cfg)
{
const config::child_list& animations = cfg.get_children("animation");
- for(config::child_list::const_iterator an = animations.begin(); an !=
animations.end(); ++an) {
- const std::string& dir = (**an)["direction"];
+ for(config::child_list::const_iterator an = animations.begin(); an !=
animations.end(); ++an) {
+ const std::string& dir = (**an)["direction"];
if(dir == "") {
- animation_.push_back(unit_animation(**an));
- } else {
- const std::vector<std::string>& directions =
config::split(dir);
- for(std::vector<std::string>::const_iterator i =
directions.begin(); i != directions.end(); ++i) {
- const gamemap::location::DIRECTION d =
gamemap::location::parse_direction(*i);
- if(d != gamemap::location::NDIRECTIONS) {
-
direction_animation_[d].push_back(unit_animation(**an));
- }
- }
+ animation_.push_back(unit_animation(**an));
+ } else {
+ const std::vector<std::string>& directions =
config::split(dir);
+ for(std::vector<std::string>::const_iterator i =
directions.begin(); i != directions.end(); ++i) {
+ const gamemap::location::DIRECTION d =
gamemap::location::parse_direction(*i);
+ if(d != gamemap::location::NDIRECTIONS) {
+
direction_animation_[d].push_back(unit_animation(**an));
+ }
+ }
}
}
@@ -237,12 +237,12 @@
}
const unit_animation& attack_type::animation(const
gamemap::location::DIRECTION dir) const
-{
- const std::vector<unit_animation>* animation = &animation_;
- if(dir < sizeof(direction_animation_)/sizeof(*direction_animation_) &&
- direction_animation_[dir].empty() == false) {
- animation = &direction_animation_[dir];
- }
+{
+ const std::vector<unit_animation>* animation = &animation_;
+ if(dir < sizeof(direction_animation_)/sizeof(*direction_animation_) &&
+ direction_animation_[dir].empty() == false) {
+ animation = &direction_animation_[dir];
+ }
wassert(animation->empty() == false);
return (*animation)[rand()%animation->size()];
Index: wesnoth/src/unit_types.hpp
diff -u wesnoth/src/unit_types.hpp:1.58 wesnoth/src/unit_types.hpp:1.59
--- wesnoth/src/unit_types.hpp:1.58 Wed Feb 9 23:32:01 2005
+++ wesnoth/src/unit_types.hpp Sat Feb 19 09:26:31 2005
@@ -1,4 +1,4 @@
-/* $Id: unit_types.hpp,v 1.58 2005/02/09 23:32:01 ydirson Exp $ */
+/* $Id: unit_types.hpp,v 1.59 2005/02/19 09:26:31 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -99,7 +99,7 @@
bool matches_filter(const config& cfg) const;
bool apply_modification(const config& cfg,std::string* description);
private:
- std::vector<unit_animation> animation_;
+ std::vector<unit_animation> animation_;
std::vector<unit_animation> direction_animation_[6];
std::string name_;
std::string type_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src game.cpp map.cpp map.hpp pathutils....,
Isaac Clerencia <=