59043 Commits

Author SHA1 Message Date
Fabian Müller
6f9ee7a828 Redesigned the core loading procedure.
Cores are now validated, invalid ones are discarded.
The failsave mechanism now tries to load without add-ons in case of a
fail before it falls back to the default core.
Core definitions are now read from a cores.cfg in every add-ons'
toplevel.
2014-11-07 23:17:23 +01:00
Fabian Müller
7b073484cb Made the "broken" core less broken.
This makes sure that the broken core fails at loading and is not marked
as invalid during its config validation.
2014-11-07 23:17:23 +01:00
Fabian Müller
d98240e4f6 Removed the core file path from the preferences.
The new implementation works with the id only.
2014-11-07 23:17:23 +01:00
Fabian Müller
42c9475173 Load addons based on game_config::no_addons instead of command line.
This is to make sure that we can change the loading of addons at
runtime.

Can be used to provide a fallback solution.
2014-11-07 23:17:23 +01:00
Fabian Müller
21484aa5bc Add no_addon item to the game_config:: namespace.
This will be used to switch addons off during runtime.
Used for fallback if loading fails.
Can later be used to give gui controll over loading the addons.
2014-11-07 23:17:23 +01:00
Fabian Müller
632ce4aa44 Set the core_id preferences item at game launch.
The id of the used core is set and saved if given as a command line
interface.

This commit makes use of the new "core" command line option.
2014-11-07 23:17:23 +01:00
Fabian Müller
c6e118f084 Add the "core" command line option.
This option specifies a [core]'s id which is to be loaded.
Not used yet.
2014-11-07 23:17:23 +01:00
Chris Beck
2b388ab5b2 remove a useless argument in play_replay
video is ignored, it is always obtained from display
2014-11-07 16:30:23 -05:00
gfgtdf
eecf19b0c1 fix savegame reading. 2014-11-06 19:51:24 +01:00
Chris Beck
2c6ca47879 Merge branch 'master' of https://github.com/wesnoth/wesnoth 2014-11-05 21:27:31 -05:00
Chris Beck
7dbfd3c9c3 update changelog 2014-11-05 21:27:17 -05:00
Chris Beck
66ef80f543 update RELEASE_NOTES 2014-11-05 21:26:42 -05:00
mattsc
7f003a98af Update Xcode project file with lua_map_generator.cpp 2014-11-05 18:18:27 -08:00
Chris Beck
365001f86e C++ tests: don't load addons
Fixed using fabi's new --noaddons cmd line option.
2014-11-05 21:12:52 -05:00
Chris Beck
d2b7af8711 travis, wml test: incorporate fabi's --noaddons mode as an option
It's not necessary since travis has no add-ons but I put it there
anyways as an example to how others should run the mainline tests.
2014-11-05 21:01:58 -05:00
Fabian Müller
ca0674d684 Add --noaddons command line option.
This option prevents any add-ons from being loaded.
2014-11-06 02:43:33 +01:00
Chris Beck
fb793a10ce Merge pull request #324 from cbeck88/lua_map_generator
Lua map generator
2014-11-05 20:23:15 -05:00
Chris Beck
c785310f05 create_engine now catches mapgen_exceptions thrown by generators
It puts those messages in the error_message field of the map entry,
so we get nicer gui handling of the problem.
2014-11-05 18:40:48 -05:00
Chris Beck
6c85b4f4d8 use our loggers in lua map generator, make a better dtor for Rng 2014-11-05 18:40:47 -05:00
Chris Beck
a964bd0e88 pass the [generator] tag as argument to lua map generator functions 2014-11-05 18:40:47 -05:00
Chris Beck
d8fcd104ae add support to create scenarios in lua also 2014-11-05 18:40:47 -05:00
Chris Beck
ce99658dfe add lua libs for lua map generator, also add bindings for mt rng
Tested to work with this test scenario, and the mainline defaults:

     [label]
         x = {X}
         y = {Y}
         text = {STRING}
     [/label]
[multiplayer]
    id=lua_map_gen
    name= _ "Lua Map Gen Test Scenario"
    description= _ "test test test of lua map gen"
    map_generation="lua"
    [generator]
        id="test"
	config_name="Test Lua Map Generator"
	create_map = << local rng = Rng:create()

			print(rng:draw())
			print(rng:draw())
			print(rng:draw())

			local w = 50
		        local h = 40

			map=""
			for y=1,h do
			  local r = rng:draw() % 2
			  for x=1,w do
                            if x == 10 and y == 10 then
                              map = map .. " 1 "
 			    end
                            if x == (w-10) and y == (h-10) then
                              map = map .. " 2 "
 			    end
			    if ((x + y) % 2) == r then
			      map = map .. "Gg"
			    else
			      map = map .. "Md"
			    end
                            if x ~= w then
                              map = map .. ","
                            end
                          end
                          map = map .. "\n"
                        end
                        return map
                     >>
    [/generator]

    id = foo
    random_start_time=yes

    {DEFAULT_SCHEDULE}
    [event]
        name=prestart
        {LABEL 25 20 ("Lua map generator")}
    [/event]

    [side]
         [ai]
             villages_per_scout=8
         [/ai]
         id=RBY_Side1
         side=1
         save_id=RBY_Side1
         persistent=yes
         color=red
         team_name=Red
         user_team_name= _ "teamname^Red"
         controller=human
         canrecruit=yes
         shroud=no
         fog=no
         gold=1000000
    [/side]
    [side]
         [ai]
             villages_per_scout=8
         [/ai]
         id=RBY_Side2
         side=2
         save_id=RBY_Side2
         persistent=yes
         color=blue
         team_name=Blue
         user_team_name= _ "teamname^Blue"
         controller=human
         canrecruit=yes
         shroud=no
         fog=no
         gold=1000000
    [/side]
[/multiplayer]
2014-11-05 18:40:46 -05:00
Chris Beck
2da4c9157a add lua map generator type 2014-11-05 18:40:46 -05:00
Chris Beck
ab821fcfeb use the "mapgen" log channel rather than engine, for map generators 2014-11-05 18:40:46 -05:00
Chris Beck
e85eb66f5b put YAMG as a map generator rather than as a scenario generator
this way is a lot less buggy, the other way seems to cause
mysterious crashes
2014-11-05 18:40:45 -05:00
Chris Beck
43e3d37a21 fix bug #22484 (fix random map generation in mp create)
As described in bug report, mp create had a bizarre implementation
for random map vs scenario generation. Scenario generation was called
map generation, and map generation was impossible. We fix it and make
it work like it works in the rest of the game.

At time of writing the wiki describes map generation wml as follows:

```
To use the default [generator] your [scenario] tag must contain one of
the following keys:

scenario_generation=default
map_generation=default

If ‘scenario_generation’ is used, the engine will expect for your entire
[scenario] sub tags to be inside a [scenario] tag inside [generator].
Tags outside of this will be ignored. There may be value in this, but at
this writing, it’s not clear. ‘map_generation=default’ is simpler and
more commonly used. It is also necessary to use this key so that you can
regenerate a map in MP game creation. In its use only generator data is
in the [generator] tag, all other [scenario] data is placed outside of it.
The exception is if you are making an initial MP scenario available in MP
game creation, for this a [scenario] tag must appear inside of
[generator], containing the [scenario] subtags you want to use.
See “data/multiplayer/scenarios/Random_Scenario.cfg” for an example.
```

This commit essentially removes the "exception" pointed out above.
After this, the mp create dialog treats map and scenario generation
both in the "random maps" classification, and it handles them normally,
scenario generation replacing the entire scenario, and map generation
replacing only the map data of the scenario.
2014-11-05 18:40:45 -05:00
Chris Beck
75b61e6401 don't crash when attempting to configure a level with no sides
A similar assertion failure also exists in mp_create I believe.
It's a bit ugly to have to put this in src/game_initialization/
multiplayer.cpp, but probably the best thing if these classes
aren't going to be robust against corner cases like this.
2014-11-05 18:40:45 -05:00
Chris Beck
e0c7bc5175 travis: disable C++ unit tests when doing the CXX11 build
it is timing out too often, so don't run them, although we still
build them
2014-11-05 18:30:43 -05:00
gfgtdf
9fc66b7486 add assert
i believe replaying_ is always false, my local tests verifired this, If you get problems with this assert feel free to remove it.
2014-11-06 00:05:20 +01:00
Chris Beck
a97d344b40 move SDL_SavePNG to the SDL compilation group, on cmake also
This ports over this commit for scons:
ff857d1d2b6dc97e886774115499847c2256804b
2014-11-05 02:43:57 -05:00
Chris Beck
d137c378df capitalize xBRZ instances in src/help.cpp 2014-11-04 23:02:24 -05:00
Ignacio R. Morelle
69777695fe Update changelog 2014-11-04 23:15:36 -03:00
Ignacio R. Morelle
471ef92f11 Upgrade bundled Lua library to version 5.2.3 (bug #22893)
This fixes several bugs in the Lua interpreter:

 * http://www.lua.org/bugs.html#5.2.1
 * http://www.lua.org/bugs.html#5.2.2
 * http://www.lua.org/bugs.html#5.2.3

Released on December 2013, this is the latest stable version as of the
writing of this patch.

This commit consists of a merge of the full diff between versions 5.2.0
and 5.2.3, with paths fixed (.c vs. .cpp). I only had to manually
reconcile the following two commits:

 * f5e673e6443220c57e40cea31d430870b4f73925
   Replace all kinds of the constant pi representations.
 * 299a29f99a84767731dbadd540712d1a37e5e10d
   Fix an off-by-one past-the-end buffer read in lua
2014-11-04 23:15:06 -03:00
Chris Beck
85e60b9147 Merge pull request #304 from cbeck88/fixup_exception_handlers
Fixup exception handlers
2014-11-04 16:24:23 -05:00
Chris Beck
3787ec00c9 use standard loggers instead of std::cerr 2014-11-04 16:00:19 -05:00
Chris Beck
2885a3a9b3 don't catch game::error in playcampaign.cpp 2014-11-04 15:59:06 -05:00
Chris Beck
7e5632d36c button ctor throws game::error when it can't find its image
This partially reverts an earlier commit
28fe7e44

instead of changing the exception type to game::game_error,
(which I assume is meant for in-game errors?), we go back to
game::error which is now handled properly in playcampaign.cpp
and game_launcher.cpp

Tested that this does not reintroduce bug 22611.
2014-11-04 15:53:24 -05:00
Chris Beck
9e801244ea add game::error handler to game_launcher.cpp, also mapgen errors
Put the same handlers I added to playcampaign also for
game_launcher. It can't be good that we weren't catching
game::error anywhere...
2014-11-04 15:53:24 -05:00
Chris Beck
6c5b43f3be fixup exception handler for replays
For some reason I had apparently set it up to skip writing errors
to stderr unless it was a unit test...
2014-11-04 15:53:24 -05:00
Chris Beck
cbb28fd5b0 add exception handlers for "game::error" in playcampaign.cpp
I also add one for mapgen_exception, but this doesn't make so much
difference. It seems to be a big problem that we don't catch
game::error anywhere, I observed a similar bug being caused by
game::error being thrown directly by a button when it couldn't
find its image. The report was that it caused the game to crash
to desktop immediately (I think it was caught only in void main.)
2014-11-04 15:53:23 -05:00
Chris Beck
49d3653ed9 fixup commit which eliminated image::tile_size
It was redundant copy of game_config::tile_size

Fixes up 5a8485d22568b5478f448810c8a8a014d58c00de
2014-11-04 13:34:43 -05:00
Chris Beck
e8698e49be refactor gitignore: ignore all build scripts (*build*.sh) 2014-11-04 12:57:09 -05:00
Chris Beck
1401bc8d17 fixup travis 2014-11-04 12:47:47 -05:00
Chris Beck
8bf3a0ddd7 make the c++11 build non-strict
There's too much warnings for now
2014-11-04 12:45:40 -05:00
Chris Beck
5a8485d225 fixup a warning (c++11 unused variable) 2014-11-04 12:45:25 -05:00
Chris Beck
2f160de8a5 show scons parameters in .travis.yml 2014-11-04 12:26:52 -05:00
Chris Beck
2474c37659 fixup travis 2014-11-04 12:11:28 -05:00
Chris Beck
f7dd05a071 fixup .travis.yml 2014-11-04 12:01:40 -05:00
Chris Beck
37ca01a9f7 fixup travis 2014-11-04 11:55:59 -05:00
Chris Beck
043fe01c42 add a CXX11 build to travis 2014-11-04 11:42:31 -05:00