# HG changeset patch # User spq@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1217165763 0 # Node ID 98541d3b922036078c497fb6be656bdd7dba59b1 # Parent abfe54ebae150da0b091591d32e5b38f4ebb00d6 * add some std types to swig wrapper (fife.i.templ) * remove the types in interfaces that used them * add possibility to list video modes to engine settings class diff -r abfe54ebae15 -r 98541d3b9220 engine/core/controller/engine.i --- a/engine/core/controller/engine.i Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/controller/engine.i Sun Jul 27 13:36:03 2008 +0000 @@ -47,6 +47,7 @@ void setBitsPerPixel(unsigned int bitsperpixel); unsigned int getBitsPerPixel() const; std::vector getPossibleBitsPerPixel() const; + std::vector > getPossibleResolutions() const; void setFullScreen(bool fullscreen); bool isFullScreen() const; void setInitialVolume(float volume); diff -r abfe54ebae15 -r 98541d3b9220 engine/core/controller/enginesettings.cpp --- a/engine/core/controller/enginesettings.cpp Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/controller/enginesettings.cpp Sun Jul 27 13:36:03 2008 +0000 @@ -24,6 +24,7 @@ #include // 3rd party library includes +#include // FIFE includes // These includes are split up in two parts, separated by one empty line @@ -64,7 +65,19 @@ throw NotSet("Glyphs for default font are not set"); } } - + + std::vector > EngineSettings::getPossibleResolutions() const { + SDL_Rect **modes = SDL_ListModes(NULL, ((getRenderBackend() != "SDL") ? (SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL) : 0) | (isFullScreen() ? SDL_FULLSCREEN : 0)); + if(modes == (SDL_Rect **)0) + throw NotFound("No VideoMode Found"); + + std::vector > result; + if(modes != (SDL_Rect **)-1) + for(unsigned int i = 0; modes[i]; ++i) + result.push_back(std::pair(modes[i]->w, modes[i]->h)); + return result; + } + void EngineSettings::setBitsPerPixel(unsigned int bitsperpixel) { std::vector pv = getPossibleBitsPerPixel(); std::vector::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); diff -r abfe54ebae15 -r 98541d3b9220 engine/core/controller/enginesettings.h --- a/engine/core/controller/enginesettings.h Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/controller/enginesettings.h Sun Jul 27 13:36:03 2008 +0000 @@ -67,7 +67,11 @@ /** Gets all possible bits per pixel values */ std::vector getPossibleBitsPerPixel() const; - + + /** Gets all possible screen resolutions + */ + std::vector > getPossibleResolutions() const; + /** Sets fullscreen / windowed mode */ void setFullScreen(bool fullscreen) { diff -r abfe54ebae15 -r 98541d3b9220 engine/core/model/model.i --- a/engine/core/model/model.i Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/model/model.i Sun Jul 27 13:36:03 2008 +0000 @@ -24,8 +24,6 @@ #include "model/model.h" %} -%include "std_list.i" - namespace FIFE { class Map; class Object; diff -r abfe54ebae15 -r 98541d3b9220 engine/core/model/structures/layer.i --- a/engine/core/model/structures/layer.i Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/model/structures/layer.i Sun Jul 27 13:36:03 2008 +0000 @@ -24,8 +24,6 @@ #include "model/structures/layer.h" %} -%include "std_vector.i" - %include "model/metamodel/modelcoords.i" %include "model/metamodel/grids/cellgrids.i" %include "util/structures/utilstructures.i" diff -r abfe54ebae15 -r 98541d3b9220 engine/core/model/structures/map.i --- a/engine/core/model/structures/map.i Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/model/structures/map.i Sun Jul 27 13:36:03 2008 +0000 @@ -24,8 +24,6 @@ #include "model/structures/map.h" %} -%include "std_list.i" - %include "util/base/utilbase.i" namespace FIFE { diff -r abfe54ebae15 -r 98541d3b9220 engine/core/vfs/vfs.i --- a/engine/core/vfs/vfs.i Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/core/vfs/vfs.i Sun Jul 27 13:36:03 2008 +0000 @@ -26,7 +26,6 @@ %} %include "vfs/raw/rawdata.i" -%include "std_set.i" namespace std{ %template(StringSet) set; diff -r abfe54ebae15 -r 98541d3b9220 engine/swigwrappers/lua/fife.i.templ --- a/engine/swigwrappers/lua/fife.i.templ Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/swigwrappers/lua/fife.i.templ Sun Jul 27 13:36:03 2008 +0000 @@ -1,7 +1,10 @@ %module fife %include "std_string.i" %include "std_vector.i" +%include "std_pair.i" +%include "std_list.i" +%include "std_set.i" $inclusions -%include swigwrappers/python/intmaps.i.templ \ No newline at end of file +%include swigwrappers/python/intmaps.i.templ diff -r abfe54ebae15 -r 98541d3b9220 engine/swigwrappers/python/fife.i.templ --- a/engine/swigwrappers/python/fife.i.templ Sat Jul 26 17:35:02 2008 +0000 +++ b/engine/swigwrappers/python/fife.i.templ Sun Jul 27 13:36:03 2008 +0000 @@ -1,6 +1,10 @@ %module(directors="1") fife %include "std_string.i" %include "std_vector.i" +%include "std_pair.i" +%include "std_list.i" +%include "std_map.i" +%include "std_set.i" %include "typemaps.i" %include "exception.i" @@ -27,6 +31,9 @@ %template(FloatVector) vector; %template(DoubleVector) vector; %template(BoolVector) vector; + + %template(UintUintPair) pair; + %template(UintUintPairVector) vector >; }; %{