diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fd4893..114069d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,11 @@ SET(CPACK_PACKAGE_VERSION_PATCH "8-rc2") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") SET(CPACK_PACKAGE_CONTACT "Martin Felis ") +# Add defines for the version +SET (VERSION_STRING + "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +ADD_DEFINITIONS(-DFYSXASTEROIDS_VERSION=\"${VERSION_STRING}\") + IF(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make # sure there is at least one set of four (4) backlasshes. diff --git a/asteroids/View.cc b/asteroids/View.cc index c5ea193..a946528 100644 --- a/asteroids/View.cc +++ b/asteroids/View.cc @@ -491,10 +491,15 @@ void View::DrawUiMainMenu() { DrawPageTitle ("Asteroids"); SelectFont("console.ttf size=23 color=#444444"); - DrawGLString( screen_right - 272, screen_bottom - 16, "http://www.fysx.org"); + DrawGLString( screen_right - 272, screen_bottom - 6, "http://www.fysx.org"); SelectFont("console.ttf size=23 color=#cccccc"); - DrawGLString( screen_right - 270, screen_bottom - 18, "http://www.fysx.org"); - + DrawGLString( screen_right - 270, screen_bottom - 8, "http://www.fysx.org"); + + SelectFont("console.ttf size=23 color=#444444"); + DrawGLString( 8, screen_bottom - 6, FYSXASTEROIDS_VERSION); + SelectFont("console.ttf size=23 color=#cccccc"); + DrawGLString( 6, screen_bottom - 8, FYSXASTEROIDS_VERSION); + SelectFont("console.ttf size=23"); if (Engine::GUI::Button (1, "New Game", screen_right * 0.5 - 100, 200, button_width, button_height)) { PushViewState(ViewStateEnterPlayername); diff --git a/asteroids/main.cc b/asteroids/main.cc index 40c4a81..40a5661 100644 --- a/asteroids/main.cc +++ b/asteroids/main.cc @@ -116,24 +116,26 @@ int main (int argc, char* argv[]) { SetLogPrintLevel (Engine::LogLevelWarning); + // find the path for game data and user data std::string user_path = ""; std::string game_data_path = ""; + // use the current path as default + boost::filesystem::path cpath = boost::filesystem::initial_path(); + user_path = boost::filesystem::path(cpath.string() + user_path).file_string(); + game_data_path = boost::filesystem::path(cpath.string() + game_data_path).file_string(); + #ifndef WIN32 + // on linux et al we check more thoroughly at the possible directories user_path = create_user_path(); game_data_path = find_game_data_dir(); #endif - boost::filesystem::path cpath = boost::filesystem::initial_path(); - std::cerr << "cwd: " << cpath.string() << std::endl; - // we assume the user path to be local folder std::string log_file_path = user_path; log_file_path += "/game.log"; - user_path = boost::filesystem::path(cpath.string() + user_path).file_string(); - game_data_path = boost::filesystem::path(cpath.string() + game_data_path).file_string(); - log_file_path = boost::filesystem::path (cpath.string() + log_file_path).file_string(); + log_file_path = boost::filesystem::path (log_file_path).file_string(); cout << "User Data Dir = " << user_path << endl; engine.SetUserDataPath (user_path); @@ -157,7 +159,9 @@ int main (int argc, char* argv[]) { else SDL_WM_SetIcon(image,NULL); - SDL_WM_SetCaption("fysxasteroids -RC2-","fysxasteroids -RC2-"); + std::string version_string = "fysxasteroids "; + version_string += FYSXASTEROIDS_VERSION; + SDL_WM_SetCaption(version_string.c_str(), version_string.c_str()); engine.GetView()->SetGridSize (8,8); diff --git a/engine/libraries/oglft/liboglft/OGLFT.cpp b/engine/libraries/oglft/liboglft/OGLFT.cpp index 2ec5ff9..76d7b49 100644 --- a/engine/libraries/oglft/liboglft/OGLFT.cpp +++ b/engine/libraries/oglft/liboglft/OGLFT.cpp @@ -89,11 +89,9 @@ namespace OGLFT { FT_Face ft_face; FT_Error error = FT_New_Face( Library::instance(), filename, 0, &ft_face ); - assert (0); - std::cerr << "FreeType error code: " << error << std::endl; - + if ( error != 0 ) { - std::cerr << "FreeType error code: " << error << std::endl; + std::cerr << "FreeType error code: " << error << std::endl; valid_ = false; return; } @@ -1356,8 +1354,6 @@ namespace OGLFT { { if ( !isValid() ) return; - std::cerr << "Raster is valid!" << std::endl; - init(); } diff --git a/engine/libraries/sha2/sha2.h b/engine/libraries/sha2/sha2.h index d6946ff..b06acf0 100644 --- a/engine/libraries/sha2/sha2.h +++ b/engine/libraries/sha2/sha2.h @@ -71,7 +71,7 @@ extern "C" { * uintXX_t (from inttypes.h), you may need to define things by hand * for your system: */ -#if 1 +#if WIN32 typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */