diff --git a/.gitignore b/.gitignore index eace6a53eb..dcb7a52282 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,8 @@ PBProject/Hardware.plist *.exp *.ilk *.map +*.aps +*.res # Windows General Files Thumbs.db diff --git a/CMake/DefineOptions.cmake b/CMake/DefineOptions.cmake index cb433dcdf7..39535b7325 100644 --- a/CMake/DefineOptions.cmake +++ b/CMake/DefineOptions.cmake @@ -43,6 +43,9 @@ if(NOT MSVC) option(WITH_FFMPEG "Build with FFMPEG." ON) # Change this number to utilize a different number of jobs for building FFMPEG. option(WITH_FFMPEG_JOBS "Build FFMPEG with this many jobs." 2) +else() + # Turn this option on to enable using the Texture Font Generator. + option(WITH_TEXTURE_GENERATOR "Build with the Texture Font Generator. Ensure the MFC library is installed." OFF) endif() if(WIN32) diff --git a/Program/Texture Font Generator.exe b/Program/Texture Font Generator.exe deleted file mode 100644 index 0e79fa826d..0000000000 Binary files a/Program/Texture Font Generator.exe and /dev/null differ diff --git a/Program/zlib1.dll b/Program/zlib1.dll deleted file mode 100644 index 02c3c742e3..0000000000 Binary files a/Program/zlib1.dll and /dev/null differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a04477deed..274c1184fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,9 @@ if(MSVC) if (WITH_IRC_POST_HOOK) include("CMakeProject-irc.cmake") endif() + if (WITH_TEXTURE_GENERATOR OR WITH_FULL_RELEASE) + include("CMakeProject-texture.cmake") + endif() endif() # Keep the module path local for easier grabbing. @@ -154,7 +157,6 @@ list(APPEND SM_WINDOWS_PROGRAM_DLLS "${SM_PROGRAM_DIR}/avutil-52.dll" "${SM_PROGRAM_DIR}/parallel_lights_io.dll" "${SM_PROGRAM_DIR}/swscale-2.dll" - "${SM_PROGRAM_DIR}/zlib1.dll" ) if(WIN32) @@ -616,7 +618,6 @@ if(NOT APPLE) install(FILES "${SM_PROGRAM_DIR}/avutil-52.dll" DESTINATION "${SM_FULL_INSTALLATION_PATH}") install(FILES "${SM_PROGRAM_DIR}/parallel_lights_io.dll" DESTINATION "${SM_FULL_INSTALLATION_PATH}") install(FILES "${SM_PROGRAM_DIR}/swscale-2.dll" DESTINATION "${SM_FULL_INSTALLATION_PATH}") - install(FILES "${SM_PROGRAM_DIR}/zlib1.dll" DESTINATION "${SM_FULL_INSTALLATION_PATH}") install(FILES "${SM_PROGRAM_DIR}/StepMania.vdi" DESTINATION "${SM_FULL_INSTALLATION_PATH}") # foreach(SM_WINDOW_DLL "${SM_WINDOWS_PROGRAM_DLLS}") diff --git a/src/CMakeProject-texture.cmake b/src/CMakeProject-texture.cmake new file mode 100644 index 0000000000..b8521d4373 --- /dev/null +++ b/src/CMakeProject-texture.cmake @@ -0,0 +1,71 @@ +if (NOT MSVC) + return() +endif() + +set(TEXTURE_DIR "${SM_SRC_DIR}/Texture Font Generator") + +list(APPEND TEXTURE_SRC + "${TEXTURE_DIR}/stdafx.cpp" + "${TEXTURE_DIR}/Texture Font Generator.cpp" + "${TEXTURE_DIR}/Texture Font GeneratorDlg.cpp" + "${TEXTURE_DIR}/TextureFont.cpp" + "${TEXTURE_DIR}/Utils.cpp" +) + +list(APPEND TEXTURE_HPP + "${TEXTURE_DIR}/Resource.h" + "${TEXTURE_DIR}/stdafx.h" + "${TEXTURE_DIR}/Texture Font Generator.h" + "${TEXTURE_DIR}/Texture Font GeneratorDlg.h" + "${TEXTURE_DIR}/TextureFont.h" + "${TEXTURE_DIR}/Utils.h" +) + +list(APPEND TEXTURE_DAT + "${TEXTURE_DIR}/res/Texture Font Generator.ico" + "${TEXTURE_DIR}/Texture Font Generator.rc" + "${TEXTURE_DIR}/res/Texture Font Generator.rc2" +) + +source_group("Source Files" FILES ${TEXTURE_SRC} ${TEXTURE_HPP}) +source_group("Resource Files" FILES ${TEXTURE_DAT}) +set(CMAKE_MFC_FLAG 2) +add_executable("TextureFontGenerator" WIN32 ${TEXTURE_SRC} ${TEXTURE_HPP} ${TEXTURE_DAT}) +unset(CMAKE_MFC_FLAG) +set_property(TARGET "TextureFontGenerator" PROPERTY FOLDER "Internal Libraries") + +disable_project_warnings("TextureFontGenerator") + +sm_add_compile_definition("TextureFontGenerator" _AFXDLL) + +list(APPEND TEXTURE_LINK_LIB + "zlib" + "png" +) + +target_link_libraries("TextureFontGenerator" ${TEXTURE_LINK_LIB}) + +list(APPEND TEXTURE_INCLUDE_DIRS + "${TEXTURE_DIR}" + "${TEXTURE_DIR}/res" + "${SM_EXTERN_DIR}/zlib" + "${SM_EXTERN_DIR}/libpng/include" +) + +target_include_directories("TextureFontGenerator" PUBLIC ${TEXTURE_INCLUDE_DIRS}) + +set_target_properties("TextureFontGenerator" PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${SM_PROGRAM_DIR}" + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${SM_PROGRAM_DIR}" + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${SM_PROGRAM_DIR}" + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${SM_PROGRAM_DIR}" + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SM_PROGRAM_DIR}" +) + +set_target_properties("TextureFontGenerator" PROPERTIES + OUTPUT_NAME "Texture Font Generator" + RELEASE_OUTPUT_NAME "Texture Font Generator" + DEBUG_OUTPUT_NAME "Texture Font Generator" + MINSIZEREL_OUTPUT_NAME "Texture Font Generator" + RELWITHDEBINFO_OUTPUT_NAME "Texture Font Generator" +) \ No newline at end of file diff --git a/src/Texture Font Generator/Utils.cpp b/src/Texture Font Generator/Utils.cpp index 583ea3571c..d0509b9ed3 100644 --- a/src/Texture Font Generator/Utils.cpp +++ b/src/Texture Font Generator/Utils.cpp @@ -103,7 +103,6 @@ void GetBounds( const Surface *pSurf, RECT *out ) #pragma include_alias( "zlib/zlib.h", "../zlib/zlib.h" ) #include "png.h" #if defined(_MSC_VER) -# pragma comment(lib, "libpng.lib") #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #endif diff --git a/src/Texture Font Generator/stdafx.h b/src/Texture Font Generator/stdafx.h index b9810b596a..088ce07b2d 100644 --- a/src/Texture Font Generator/stdafx.h +++ b/src/Texture Font Generator/stdafx.h @@ -15,11 +15,11 @@ using namespace std; // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -#define WINVER 0x0500 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.