Permalink
Browse files

Some bug fixes, changed the way the OpenGL/SDL headers are handled to…

… make things more consistent. Should build and run on windows.
  • Loading branch information...
1 parent 6f99462 commit e3ef4fb33fcbe2f2c7fe2673f7c00ca3ddd76f9a @sweetkristas sweetkristas committed Mar 10, 2012
Showing with 678 additions and 239 deletions.
  1. +79 −0 CMakeLists.txt
  2. +138 −0 frogatto-installer-win.nsi
  3. BIN images/bbicon.ico
  4. +184 −0 src/CMakeLists.txt
  5. +3 −11 src/IMG_savepng.cpp
  6. +1 −1 src/IMG_savepng.h
  7. +1 −4 src/background.cpp
  8. +1 −1 src/background.hpp
  9. +1 −6 src/blur.cpp
  10. +1 −6 src/border_widget.cpp
  11. +3 −4 src/collision_utils.cpp
  12. +1 −6 src/color_utils.cpp
  13. +1 −6 src/color_utils.hpp
  14. +14 −0 src/compat.hpp
  15. +2 −3 src/controls.cpp
  16. +1 −6 src/controls.hpp
  17. +1 −4 src/custom_object.cpp
  18. +1 −1 src/custom_object.hpp
  19. +6 −4 src/custom_object_type.cpp
  20. +3 −3 src/decimal.hpp
  21. +1 −1 src/dialog.cpp
  22. +2 −10 src/draw_scene.cpp
  23. +1 −10 src/editor.cpp
  24. +1 −1 src/editor_level_properties_dialog.cpp
  25. +1 −1 src/editor_stats_dialog.cpp
  26. +1 −6 src/font.hpp
  27. +1 −1 src/formula_callable.hpp
  28. +3 −1 src/formula_function.cpp
  29. +4 −0 src/formula_profiler.cpp
  30. +24 −0 src/frogatto-resouces.rc
  31. +1 −1 src/geometry.hpp
  32. +45 −0 src/graphics.hpp
  33. +1 −1 src/input.hpp
  34. +1 −1 src/inventory.cpp
  35. +1 −1 src/iphone_controls.cpp
  36. +1 −1 src/iphone_controls.hpp
  37. +1 −1 src/joystick.cpp
  38. +1 −1 src/key.hpp
  39. +1 −1 src/key_button.cpp
  40. +1 −2 src/label.hpp
  41. +2 −0 src/level.cpp
  42. +1 −1 src/level_object.cpp
  43. +1 −1 src/level_runner.cpp
  44. +2 −16 src/main.cpp
  45. +2 −3 src/multiplayer.cpp
  46. +1 −1 src/particle_system.cpp
  47. +87 −4 src/preferences.cpp
  48. +1 −2 src/preferences.hpp
  49. +2 −2 src/preprocessor.cpp
  50. +1 −10 src/raster.cpp
  51. +1 −1 src/raster.hpp
  52. +1 −6 src/raster_distortion.cpp
  53. +1 −6 src/raster_distortion.hpp
  54. +1 −6 src/rectangle_rotator.cpp
  55. +3 −3 src/server.cpp
  56. +1 −1 src/settings_dialog.hpp
  57. +1 −4 src/sound.cpp
  58. +1 −1 src/speech_dialog.hpp
  59. +1 −5 src/stats.cpp
  60. +10 −1 src/string_utils.cpp
  61. +4 −0 src/string_utils.hpp
  62. +1 −1 src/surface.hpp
  63. +1 −1 src/surface_cache.cpp
  64. +1 −4 src/surface_formula.cpp
  65. +1 −6 src/surface_formula.hpp
  66. +1 −1 src/surface_scaling.cpp
  67. +1 −1 src/text_entry_widget.cpp
  68. +1 −9 src/texture.cpp
  69. +1 −6 src/texture.hpp
  70. +1 −6 src/texture_frame_buffer.cpp
  71. +1 −2 src/thread.hpp
  72. +1 −1 src/tooltip.cpp
  73. +1 −1 src/unit_test.cpp
  74. +1 −1 src/utility_object_compiler.cpp
  75. +1 −1 src/variant.hpp
  76. +1 −6 src/water.cpp
  77. +1 −5 src/water_particle_system.hpp
  78. +1 −5 src/weather_particle_system.hpp
  79. +1 −1 src/widget.hpp
View
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 2.8)
+project(Frogatto)
+
+find_package(GLUT)
+find_package(OpenGL)
+find_package(SDL)
+find_package(SDL_mixer)
+find_package(SDL_image)
+find_package(SDL_ttf)
+SET( CMAKE_THREAD_PREFER_PTHREAD 1 )
+find_package(Threads)
+
+set( BOOST_COMPONENTS_NEEDED regex thread system )
+
+# The following verifyies that BOOST_ROOT is set properly.
+if(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
+ FILE( TO_CMAKE_PATH $ENV{BOOST_ROOT} BOOST_ROOT )
+ if( NOT EXISTS ${BOOST_ROOT} )
+ MESSAGE( STATUS ${BOOST_ROOT} " does not exist. Checking if BOOST_ROOT was a quoted string.." )
+ STRING( REPLACE "\"" "" BOOST_ROOT ${BOOST_ROOT} )
+ if( EXISTS ${BOOST_ROOT} )
+ MESSAGE( STATUS "After removing the quotes " ${BOOST_ROOT} " was now found by CMake" )
+ endif( EXISTS ${BOOST_ROOT})
+ endif( NOT EXISTS ${BOOST_ROOT} )
+
+# Save the BOOST_ROOT in the cache
+ if( NOT EXISTS ${BOOST_ROOT} )
+ MESSAGE( WARNING ${BOOST_ROOT} " does not exist." )
+ else(NOT EXISTS ${BOOST_ROOT})
+ SET (BOOST_ROOT ${BOOST_ROOT} CACHE STRING "Set the value of BOOST_ROOT to point to the root folder of your boost install." FORCE)
+ #SET (BOOST_INCLUDEDIR ${BOOST_ROOT})
+ #SET (BOOST_LIBRARYDIR ${BOOST_ROOT}/lib)
+ endif( NOT EXISTS ${BOOST_ROOT} )
+
+endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
+
+if( WIN32 AND NOT BOOST_ROOT )
+ MESSAGE( WARNING "Please set the BOOST_ROOT environment variable." )
+endif( WIN32 AND NOT BOOST_ROOT )
+
+set(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
+set(Boost_DEBUG ON)
+set(Boost_USE_STATIC_LIBS OFF)
+set(Boost_USE_MULTITHREADED ON)
+set(Boost_USE_STATIC_RUNTIME OFF)
+FIND_PACKAGE(Boost 1.47.0 COMPONENTS ${BOOST_COMPONENTS_NEEDED})
+if( Boost_FOUND )
+ include_directories( ${Boost_INCLUDE_DIRS} )
+ link_directories( ${Boost_LIBRARY_DIRS} )
+endif( Boost_FOUND )
+
+if( SDL_FOUND STREQUAL "YES" )
+ MESSAGE( STATUS "SDL FOUND: " ${SDL_INCLUDE_DIR} " : " ${SDL_LIBRARY} )
+ #include_directories( ${SDL_INCLUDE_DIR} )
+ link_directories( ${SDL_LIBRARY} )
+ #add_library( SDL_image.lib SHARED IMPORTED )
+ #add_library( SDL_mixer.lib SHARED IMPORTED )
+ #add_library( SDL_ttf.lib SHARED IMPORTED )
+else( SDL_FOUND STREQUAL "NO" )
+ MESSAGE( STATUS "SDL NOT FOUND: " ${SDL_INCLUDE_DIR} " : " ${SDL_LIBRARY} )
+endif( SDL_FOUND STREQUAL "YES" )
+
+if( OPENGL_FOUND )
+ include_directories( ${OPENGL_INCLUDE_DIR} )
+endif( OPENGL_FOUND )
+
+add_subdirectory( src )
+
+if( WIN32 )
+ set_target_properties( frogatto PROPERTIES
+ COMPILE_DEFINITIONS "_WIN32_WINNT=0x0501;NOMINMAX;DISABLE_FORMULA_PROFILER"
+ COMPILE_FLAGS "/EHsc /GR"
+ LINK_FLAGS "/SUBSYSTEM:WINDOWS" )
+ set_target_properties( server PROPERTIES
+ COMPILE_DEFINITIONS "_WIN32_WINNT=0x0501"
+ COMPILE_FLAGS "/EHsc /GR"
+ LINK_FLAGS "/SUBSYSTEM:CONSOLE" )
+endif( WIN32 )
+
View
@@ -0,0 +1,138 @@
+;Frogatto Windows Installer Script for NSIS
+;Written by Kristina
+
+;--------------------------------
+;Include Modern UI
+
+ !include "MUI2.nsh"
+
+;-------------------------------
+; Test if Visual Studio Redistributables 2005+ SP1 installed
+; Returns -1 if there is no VC redistributables intstalled
+Function CheckVCRedist
+ Push $R0
+ ClearErrors
+ #ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{196BB40D-1578-3D01-B289-BEFC77A11A1E}" "Version"
+ ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed"
+
+ ; if VS 2010 redist not installed, install it
+ IfErrors 0 VSRedistInstalled
+ StrCpy $R0 "-1"
+ File "c:\projects\Frogatto\vcredist_x86.exe"
+ ExecWait '"$INSTDIR\vcredist_x86.exe" /q' $0
+
+VSRedistInstalled:
+ Exch $R0
+FunctionEnd
+
+;--------------------------------
+;General
+
+ ;Name and file
+ Name "Frogatto & Friends" "Frogatto && Friends"
+ OutFile "Frogatto-installer.exe"
+
+ ;Default installation folder
+ InstallDir "$PROGRAMFILES\Frogatto"
+
+ ;Get installation folder from registry if available
+ InstallDirRegKey HKCU "Software\Frogatto" ""
+
+ ;Request application privileges for Windows Vista
+ RequestExecutionLevel user
+
+;--------------------------------
+;Variables
+
+ Var StartMenuFolder
+
+;--------------------------------
+;Interface Settings
+
+ !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+ !insertmacro MUI_PAGE_LICENSE "c:\projects\Frogatto\LICENSE"
+ !insertmacro MUI_PAGE_COMPONENTS
+ !insertmacro MUI_PAGE_DIRECTORY
+
+ ;Start Menu Folder Page Configuration
+ !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Frogatto"
+ !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+
+ !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+
+ !insertmacro MUI_PAGE_INSTFILES
+
+ !insertmacro MUI_UNPAGE_CONFIRM
+ !insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Languages
+
+ !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Frogatto & Friends" SecInstaller
+
+ SetOutPath "$INSTDIR"
+
+ File /a /r "C:\Projects\frogatto-build\src\Release\*.*"
+
+ ;Store installation folder
+ WriteRegStr HKCU "Software\Frogatto" "" $INSTDIR
+
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frogatto" \
+ "DisplayName" "Frogatto & Friends"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frogatto" \
+ "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+ ;Create uninstaller
+ WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ ;Create shortcuts
+ CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Frogatto.lnk" "$INSTDIR\Frogatto.exe"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+ Call CheckVCRedist
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+ ;Language strings
+ ;LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
+
+ ;Assign language strings to sections
+ ;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ ; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
+ ;!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+ ;ADD YOUR OWN FILES HERE...
+
+ Delete "$INSTDIR\Uninstall.exe"
+
+ RMDir /r "$INSTDIR"
+
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
+
+ Delete "$SMPROGRAMS\$StartMenuFolder\Frogatto.lnk"
+ Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
+ RMDir "$SMPROGRAMS\$StartMenuFolder"
+
+ DeleteRegKey /ifempty HKCU "Software\Frogatto"
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Frogatto"
+
+SectionEnd
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit e3ef4fb

Please sign in to comment.