diff --git a/README.md b/README.md index de55c5e..8ae9a3b 100644 --- a/README.md +++ b/README.md @@ -43,4 +43,9 @@ Permission is granted to anyone to use this software for any purpose, including 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. \ No newline at end of file +3. This notice may not be removed or altered from any source distribution. + +### Items not made by me + +* [Coolvetica Font](http://typodermicfonts.com/coolvetica/) +* Creative Commons Artwork from [Artsader](http://www.moosader.com/artsader/) \ No newline at end of file diff --git a/client/client_application.cpp b/client/client_application.cpp index 9d273ae..c657d37 100644 --- a/client/client_application.cpp +++ b/client/client_application.cpp @@ -44,6 +44,16 @@ void ClientApplication::Init(int argc, char* argv[]) { ConfigUtility& config = ConfigUtility::GetSingleton(); config.Load("rsc/config.cfg", false, argc, argv); + //------------------------- + //Initialize SDL + //------------------------- + + if (SDL_Init(0)) { + std::ostringstream msg; + msg << "Failed to initialize SDL: " << SDL_GetError(); + throw(std::runtime_error(msg.str())); + } + //------------------------- //create and check the window //------------------------- @@ -85,18 +95,15 @@ void ClientApplication::Init(int argc, char* argv[]) { switch(windowInfo.subsystem) { case SDL_SYSWM_WINDOWS: platform = "Microsoft Windows"; - fontPath = "C:/Windows/Fonts/arialbd.ttf"; break; case SDL_SYSWM_X11: platform = "X Window System"; - fontPath = "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf"; break; //NOTE: OS X is currently unsupported, but it could be case SDL_SYSWM_COCOA: platform = "Apple OS X"; - fontPath = "/System/Library/Fonts/arialbd.ttf"; break; default: @@ -109,11 +116,6 @@ void ClientApplication::Init(int argc, char* argv[]) { std::cout << (int)windowInfo.version.minor << "."; std::cout << (int)windowInfo.version.patch << " on "; std::cout << platform << std::endl; - - //handle the default font paths - if (config["client.font"].size() == 0) { - config["client.font"] = fontPath; - } } else { std::ostringstream msg; @@ -256,6 +258,7 @@ void ClientApplication::Quit() { BaseScene::SetRenderer(nullptr); SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); + SDL_Quit(); std::cout << "Clean exit" << std::endl; } diff --git a/rsc/config.cfg b/rsc/config.cfg index d14ea1c..51c528b 100644 --- a/rsc/config.cfg +++ b/rsc/config.cfg @@ -13,9 +13,6 @@ server.dbname = database.db #client.screen.h = 600 #client.screen.f = false #NOTE: fullscreen option is currently disabled -#set this to overwrite the default fonts (platform issues) -#client.font = /path/to/font/file.ttf - client.username = username client.handle = handle client.avatar = character2.png @@ -27,8 +24,10 @@ dir.tilesets = rsc/graphics/tilesets/ dir.interface = rsc/graphics/interface/ dir.scripts = rsc/scripts/ dir.maps = rsc/maps/ +dir.fonts = rsc/fonts/ #map system map.savename = servermap #debugging +client.font = rsc/fonts/coolvetica rg.ttf \ No newline at end of file diff --git a/rsc/fonts/coolvetica rg.ttf b/rsc/fonts/coolvetica rg.ttf new file mode 100644 index 0000000..410ca31 Binary files /dev/null and b/rsc/fonts/coolvetica rg.ttf differ