65 Commits

Author SHA1 Message Date
Mark de Wever
71d9ce8052 Fix compilation with gcc-4.7 in C++0x mode. 2011-07-08 19:49:02 +00:00
Mark de Wever
3f098b5064 Strip trailing whitespace. 2011-04-17 07:34:51 +00:00
Mark de Wever
487c110e9e Make g++-4.6 compile Wesnoth with --std=c++0x.
Not sure whether the requirement for public default constructor is a bug
in g++ or that it's really required/allowed to require it.
2011-04-09 20:42:47 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
f82fcc6c85 Allowed skipping over [insert_tag] children when visiting vconfig objects. 2010-12-28 15:09:06 +00:00
Mark de Wever
d8f47129c8 Remove unneeded includes. 2010-11-21 13:57:15 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Guillaume Melquiond
ae7cc0a6d2 Modified vconfig so that it is no longer forced...
...to return translatable strings after variable expansion.

In particular, the engine no longer tries to expand variables inside
plain numbers or booleans.
2010-08-19 22:07:53 +00:00
Guillaume Melquiond
ba06242145 Removed unused assignment operator for class vconfig. 2010-08-14 14:15:25 +00:00
Guillaume Melquiond
d48a63a995 Avoided copying scoped units. (Partial fix for bug #16363.)
This brings the profile footprint of variable_info from 9% to 4%.
2010-08-06 17:31:14 +00:00
Guillaume Melquiond
908e470543 Avoided copies. 2010-07-23 14:43:40 +00:00
Guillaume Melquiond
85a6592a1c Cleaned typing of proxy iterators a bit. 2010-07-23 14:43:28 +00:00
Guillaume Melquiond
050cd9495a Removed auto_ptr from proxy iterator. 2010-07-23 13:34:01 +00:00
Alexander van Gessel
e0f819292f Split vconfig no-arg constructor into unconstructed_vconfig() and...
...empty_vconfig(), the latter of which is backed by an empty config
object, rather than NULL.

This should eliminate segfaults due to accidental dereferencing of
the nullpointer in default-constructed vconfigs
2010-05-25 01:54:52 +01:00
Guillaume Melquiond
76c34a23d3 Modified WML attributes so that they are stored with...
...smaller effective types when they are not translatable.

This patch considerably reduces the memory footprint of WML and speeds it up.

It should not change any WML behavior, except for a few corner cases
detailled below:

- "off" is no longer a synonym for "no" (it wasn't used anyway),

- _"42" is no longer an integer,

- untranslatable "true" and "false" are stored as booleans, hence
  displayed as "yes" and "no",

- "042" is now understood as octal notation (hence 34) rather than decimal,

- hexadecimal notation "0x42" is now recognized.
2010-05-24 08:01:31 +00:00
Guillaume Melquiond
8119629789 Removed functions [v]config::all_children_iterator::get_index. 2010-04-05 06:00:00 +00:00
Guillaume Melquiond
bf148d8dd9 Switched variable_info::array_range to config::child_itors.
Fixed [set_variable/join] when separator and remove_empty attributes
are combined.
2010-04-05 05:59:53 +00:00
Guillaume Melquiond
1896b603f1 Prevented t_string non-const references from being returned by functions.
(Original patch #1139 by Frank Richter.)

This avoids leaking an implementation detail from the config class and
opens the door to a considerable reduction of the memory footprint of
lexical data.
2010-03-27 09:32:58 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Guillaume Melquiond
b181364752 Cleaned code a bit. 2009-07-19 16:30:17 +00:00
Mark de Wever
c4f596742b Add some comment about an unsafe situation. 2009-04-17 22:46:20 +00:00
Guillaume Melquiond
0b688ca871 Removed almost unused function vconfig::get_attribute. 2009-04-12 16:01:18 +00:00
Guillaume Melquiond
55ab65ecec Removed config::all_children_iterator...
...and vconfig::all_children_iterator default constructors.
2009-04-12 14:13:46 +00:00
Guillaume Melquiond
60808a88ba Got rid of pointers to config objects. Removed code duplication along the way. 2009-04-04 17:51:20 +00:00
Patrick Parker
cd378cecfa make the public memory-managed vconfig constructor a little friendlier
eliminate one vconfig pass-by-value (many more remain)
2009-02-26 01:34:22 +00:00
Mark de Wever
20c52979b8 Add some support for default constructed vconfigs.
Before a default constructed vconfig would crash on operator[]. This has
been fixed, some other issues remain, see the @todo.
2009-01-28 20:44:42 +00:00
Patrick Parker
0ecc9308df real fix for bug #12803 (revert workaround)
* make sure all event handlers created from WML menu item commands use
  memory managed vconfigs

* a flaw with vconfig::all_children_iterator losing track of the
  volatility flag
2009-01-02 04:09:46 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Ignacio R. Morelle
ef256c7233 Made weapon and second_weapon variables be autostored on events. 2008-09-06 18:54:36 +00:00
Patrick Parker
ddca21e0c4 a comment explaining vconfig::operator[]'s return type,
...as requested by Mordante
2008-07-25 15:13:03 +00:00
Mark de Wever
384c3ef6b0 Remove the const of returned copies of strings. 2008-07-23 20:13:33 +00:00
Patrick Parker
a00bf368fd a real fix for [insert_tag] infinite recursion...
...(for example, inside spawned events.)

attempt to fix the unit_map problem with duplicate ID's (but
apparently not successfully)
2008-06-10 08:51:23 +00:00
Mark de Wever
30c19f0704 Update doxygen comment style. 2008-05-18 13:59:35 +00:00
Patrick Parker
c6b6c20bd9 prevent [insert_tag] from infinite recursion in vconfig::get_parsed_config()
optimize hash_memory_manager lookups using std::set instead of std::vector
2008-04-18 04:29:37 +00:00
Patrick Parker
bf481d299c preventing the WML from doing very bad things with memory...
...when using [insert_tag], and I spotted some minor bugs in other
game_events as I was making the change
2008-04-17 08:52:03 +00:00
Patrick Parker
1348cf80d2 new tag [insert_tag], as discussed on wiki/FutureWML
* note: there are ways you can make this crash with bad WML
  these will be safeguarded against further in a later update
2008-04-13 06:43:09 +00:00
Mark de Wever
d9bd18057c Make sure #include "variable.hpp" can be used...
...without the need to include more items.
2008-04-12 09:43:57 +00:00
Mark de Wever
001af46e6e Updated all headers to 2008. 2008-02-16 08:47:16 +00:00
Mark de Wever
b329535ef7 Do a cleanup of some includes introduced in 2007-12-22T12:08:47Z!koraq@xs4all.nl,
spotted by Sapient.
2007-12-22 21:00:02 +00:00
Mark de Wever
8e06d2fe22 Unclutter includes. 2007-12-22 12:08:47 +00:00
Mark de Wever
996290638a While working on some new code I got an error,
fixed it by declaring the unit_map class.
2007-11-23 05:34:27 +00:00
Gunter Labes
ae9e10f260 codeclean run
set svn:eol-style to native where missing
2007-08-31 19:09:40 +00:00
Mark de Wever
080eb69f60 Updated the headers to state GPL 2+ and a few changelog cleanups. 2007-08-15 13:41:56 +00:00
Patrick Parker
f984170cdd add some utility methods for variable_info 2007-08-05 20:56:23 +00:00
Patrick Parker
82c98d883f some minor bugfixes and reorganization for the WML variable handling 2007-08-05 19:11:58 +00:00
Patrick Parker
f0afaf3673 major code cleanup for WML variable retrieval, and a new feature
* fix a bug where containers could only be stored at the top-level

* fix a bug where both x and y had to be specified in location filters

* no longer needs to store __length reserved keyword inside array
  variables

* better handling/reporting of invalid WML variable type usage

* new key find_in= to allow searching a variable of previously stored 
  locations when using the standard location filter
2007-08-04 22:42:42 +00:00
Mark de Wever
bb01934b85 A rather large update which updates the copyright info
* Wesnoth is distributed under the terms of the GPL version 2, made
  that more explicit

* updated the copyright range to 2007

* updated Dave's email adress
2007-07-21 07:28:04 +00:00
Patrick Parker
ce45600bb6 dont check entity_location unless a corresponding [filter] exists 2007-06-08 02:51:48 +00:00
Patrick Parker
2eb7b2a132 explicitly construct the vconfig[] return type from t_string& to t_string
and also add const to prevent inadvertant misuse
2007-04-17 21:49:09 +00:00
Patrick Parker
9f755ec4e9 a second step towards supporting WML menu items
- add the [set_menu_item] command to game_events.cpp
2007-03-25 22:15:34 +00:00