diff --git a/mk/windoze/Glest.suo b/mk/windoze/Glest.suo index b9dcaee0..b11f8de1 100755 Binary files a/mk/windoze/Glest.suo and b/mk/windoze/Glest.suo differ diff --git a/mk/windoze/glest_game.vcproj b/mk/windoze/glest_game.vcproj index a3082753..2d811574 100755 --- a/mk/windoze/glest_game.vcproj +++ b/mk/windoze/glest_game.vcproj @@ -133,7 +133,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" - AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl" + AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;"../../source/win32_deps/openal-soft-1.12.854/include"" AdditionalUsingDirectories="" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS" StringPooling="true" @@ -155,7 +155,7 @@ /> + + @@ -668,10 +672,6 @@ - - diff --git a/source/shared_lib/include/platform/sdl/factory_repository.h b/source/shared_lib/include/platform/sdl/factory_repository.h index c20861e3..89785ba5 100644 --- a/source/shared_lib/include/platform/sdl/factory_repository.h +++ b/source/shared_lib/include/platform/sdl/factory_repository.h @@ -24,12 +24,10 @@ #include "graphics_factory_gl2.h" #include "sound_factory_ds8.h" -#else +#endif #include "sound_factory_openal.h" -#endif - using std::string; using Shared::Graphics::GraphicsFactory; @@ -41,12 +39,10 @@ using Shared::Graphics::Gl::GraphicsFactoryGl; using Shared::Graphics::Gl::GraphicsFactoryGl2; using Shared::Sound::Ds8::SoundFactoryDs8; -#else +#endif using Shared::Sound::OpenAL::SoundFactoryOpenAL; -#endif - namespace Shared{ namespace Platform{ // ===================================================== @@ -67,12 +63,10 @@ private: GraphicsFactoryGl2 graphicsFactoryGl2; SoundFactoryDs8 soundFactoryDs8; -#else +#endif SoundFactoryOpenAL soundFactoryOpenAL; -#endif - public: static FactoryRepository &getInstance(); diff --git a/source/shared_lib/sources/platform/win32/factory_repository.cpp b/source/shared_lib/sources/platform/win32/factory_repository.cpp new file mode 100644 index 00000000..8f05f14b --- /dev/null +++ b/source/shared_lib/sources/platform/win32/factory_repository.cpp @@ -0,0 +1,49 @@ +// ============================================================== +// This file is part of Glest Shared Library (www.glest.org) +// +// Copyright (C) 2001-2008 Martiņo Figueroa +// +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version +// ============================================================== + +#include "factory_repository.h" + +#include "leak_dumper.h" + +namespace Shared{ namespace Platform{ + +// ===================================================== +// class FactoryRepository +// ===================================================== + +FactoryRepository &FactoryRepository::getInstance(){ + static FactoryRepository factoryRepository; + return factoryRepository; +} + +GraphicsFactory *FactoryRepository::getGraphicsFactory(const string &name){ + if(name == "OpenGL"){ + return &graphicsFactoryGl; + } + else if(name == "OpenGL2"){ + return &graphicsFactoryGl2; + } + + throw runtime_error("Unknown graphics factory: " + name); +} + +SoundFactory *FactoryRepository::getSoundFactory(const string &name){ + if(name == "DirectSound8"){ + return &soundFactoryDs8; + } + if(name == "OpenAL") { + return &soundFactoryOpenAL; + } + + throw runtime_error("Unknown sound factory: " + name); +} + +}}//end namespace