Permalink
Browse files

Merge mingw compatiblity fork with 4/14 github; back out zlib cmake p…

…atch (1.2.6 incorporates the patch already)
  • Loading branch information...
2 parents dc428e3 + e0e7648 commit e15ae329aff59db87db4f1adc63fcdeb03e67ca4 @mcclure mcclure committed Apr 15, 2012
Showing with 3,359 additions and 505 deletions.
  1. +3 −0 BUILD.md
  2. +3 −0 BUILD.txt
  3. +1 −0 CMake/ExternalAssimp.cmake
  4. +1 −0 CMake/ExternalBox2D.cmake
  5. +1 −0 CMake/ExternalBullet.cmake
  6. +1 −0 CMake/ExternalFreetype.cmake
  7. +1 −0 CMake/ExternalLua51.cmake
  8. +1 −0 CMake/ExternalOggVorbis.cmake
  9. +1 −0 CMake/ExternalOpenAL.cmake
  10. +6 −5 CMake/ExternalPNG.cmake
  11. +1 −0 CMake/ExternalPhysFS.cmake
  12. +0 −201 CMake/zlib.cmake
  13. +33 −0 Core/Contents/Include/PolyColor.h
  14. +27 −0 Core/Contents/Include/PolyEntity.h
  15. +1 −1 Core/Contents/Include/PolyGLRenderer.h
  16. +4 −2 Core/Contents/Include/PolyGLVertexBuffer.h
  17. +9 −1 Core/Contents/Include/PolyGlobals.h
  18. +4 −4 Core/Contents/Include/PolyMaterialManager.h
  19. +1 −1 Core/Contents/Include/PolyMesh.h
  20. +1 −0 Core/Contents/Include/PolyObject.h
  21. +1 −1 Core/Contents/Include/PolyRenderer.h
  22. +2 −2 Core/Contents/Include/PolySceneEntity.h
  23. +3 −0 Core/Contents/Include/PolySceneLine.h
  24. +2 −2 Core/Contents/Include/PolyScreenEntity.h
  25. +1 −1 Core/Contents/Include/PolyScreenMesh.h
  26. +6 −0 Core/Contents/Include/PolySound.h
  27. +13 −1 Core/Contents/Include/PolyVector2.h
  28. +13 −0 Core/Contents/Include/PolyVector3.h
  29. +67 −1 Core/Contents/Include/PolyWinCore.h
  30. +15 −2 Core/Contents/PolycodeView/MSVC/PolycodeView.cpp
  31. +1 −0 Core/Contents/PolycodeView/MSVC/PolycodeView.h
  32. +52 −0 Core/Contents/Source/PolyColor.cpp
  33. +20 −0 Core/Contents/Source/PolyEntity.cpp
  34. +16 −5 Core/Contents/Source/PolyGLRenderer.cpp
  35. +3 −0 Core/Contents/Source/PolyGLSLShaderModule.cpp
  36. +26 −0 Core/Contents/Source/PolyGLVertexBuffer.cpp
  37. +3 −2 Core/Contents/Source/PolyImage.cpp
  38. +5 −6 Core/Contents/Source/PolyMesh.cpp
  39. +8 −0 Core/Contents/Source/PolyObject.cpp
  40. +1 −0 Core/Contents/Source/PolyParticleEmitter.cpp
  41. +1 −1 Core/Contents/Source/PolySceneEntity.cpp
  42. +7 −0 Core/Contents/Source/PolySceneLine.cpp
  43. +1 −1 Core/Contents/Source/PolySceneMesh.cpp
  44. +123 −85 Core/Contents/Source/PolyScreenEntity.cpp
  45. +7 −0 Core/Contents/Source/PolySound.cpp
  46. +236 −8 Core/Contents/Source/PolyWinCore.cpp
  47. +1 −1 Examples/C++/Build/Linux/Makefile
  48. +4 −3 Examples/C++/Contents/2DParticles/HelloPolycodeApp.cpp
  49. +2 −1 Examples/C++/Contents/3DMeshParticles/HelloPolycodeApp.cpp
  50. +2 −1 Examples/C++/Contents/3DParticles/HelloPolycodeApp.cpp
  51. +233 −13 IDE/Build/Mac OS X/English.lproj/MainMenu.xib
  52. +26 −8 IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj
  53. +4 −0 IDE/Build/Mac OS X/PolycodeAppDelegate.h
  54. +16 −0 IDE/Build/Mac OS X/PolycodeAppDelegate.m
  55. +12 −1 IDE/Contents/Include/NewFileWindow.h
  56. +4 −0 IDE/Contents/Include/PolycodeEditor.h
  57. +7 −0 IDE/Contents/Include/PolycodeFrame.h
  58. +7 −0 IDE/Contents/Include/PolycodeIDEApp.h
  59. +7 −1 IDE/Contents/Include/PolycodeProjectBrowser.h
  60. +65 −0 IDE/Contents/Include/PolycodeProjectEditor.h
  61. +11 −1 IDE/Contents/Include/PolycodeProjectManager.h
  62. +67 −0 IDE/Contents/Include/PolycodeScreenEditor.h
  63. +1 −1 IDE/Contents/Include/PolycodeTextEditor.h
  64. +48 −0 IDE/Contents/Include/ToolWindows.h
  65. +12 −0 IDE/Contents/Resources/FileTemplates/2D/Screen Entity.screen
  66. BIN IDE/Contents/Resources/Images/editorGrid.png
  67. BIN IDE/Contents/Resources/Images/screenCenter.png
  68. BIN IDE/Contents/Resources/Images/screenTransform.png
  69. BIN IDE/Contents/Resources/UIThemes/default/checkbox_checked.png
  70. BIN IDE/Contents/Resources/UIThemes/default/checkbox_unchecked.png
  71. BIN IDE/Contents/Resources/UIThemes/default/colorPickerHue.png
  72. BIN IDE/Contents/Resources/UIThemes/default/colorPickerHueSelector.png
  73. BIN IDE/Contents/Resources/UIThemes/default/colorPickerMainBg.png
  74. BIN IDE/Contents/Resources/UIThemes/default/colorPickerMainFrame.png
  75. BIN IDE/Contents/Resources/UIThemes/default/colorPickerTarget.png
  76. BIN IDE/Contents/Resources/UIThemes/default/colorboxBg.png
  77. BIN IDE/Contents/Resources/UIThemes/default/colorboxFrame.png
  78. BIN IDE/Contents/Resources/UIThemes/default/combobox_bg.png
  79. BIN IDE/Contents/Resources/UIThemes/default/combobox_drop.png
  80. BIN IDE/Contents/Resources/UIThemes/default/combobox_items.png
  81. BIN IDE/Contents/Resources/UIThemes/default/combobox_selector.png
  82. BIN IDE/Contents/Resources/UIThemes/default/hsliderBg.png
  83. BIN IDE/Contents/Resources/UIThemes/default/hsliderHandle.png
  84. +60 −15 IDE/Contents/Resources/UIThemes/default/theme.xml
  85. BIN IDE/Contents/Resources/UIThemes/default/windowBg.png
  86. +64 −4 IDE/Contents/Source/NewFileWindow.cpp
  87. +1 −1 IDE/Contents/Source/NewProjectWindow.cpp
  88. +4 −0 IDE/Contents/Source/PolycodeEditor.cpp
  89. +55 −0 IDE/Contents/Source/PolycodeFrame.cpp
  90. +85 −2 IDE/Contents/Source/PolycodeIDEApp.cpp
  91. +64 −13 IDE/Contents/Source/PolycodeProjectBrowser.cpp
  92. +268 −0 IDE/Contents/Source/PolycodeProjectEditor.cpp
  93. +11 −0 IDE/Contents/Source/PolycodeProjectManager.cpp
  94. +190 −0 IDE/Contents/Source/PolycodeScreenEditor.cpp
  95. +0 −1 IDE/Contents/Source/PolycodeTextEditor.cpp
  96. +72 −0 IDE/Contents/Source/ToolWindows.cpp
  97. +30 −0 Modules/Contents/3DPhysics/Include/PolyPhysicsScene.h
  98. +3 −0 Modules/Contents/3DPhysics/Include/PolyPhysicsSceneEntity.h
  99. +10 −2 Modules/Contents/3DPhysics/Source/PolyCollisionSceneEntity.cpp
  100. +73 −1 Modules/Contents/3DPhysics/Source/PolyPhysicsScene.cpp
  101. +25 −3 Modules/Contents/3DPhysics/Source/PolyPhysicsSceneEntity.cpp
  102. +1 −1 Modules/Contents/Networking/Include/PolySocket.h
  103. +4 −0 Modules/Contents/UI/CMakeLists.txt
  104. +6 −4 Modules/Contents/UI/Include/PolyUICheckBox.h
  105. +107 −0 Modules/Contents/UI/Include/PolyUIColorBox.h
  106. +76 −0 Modules/Contents/UI/Include/PolyUIComboBox.h
  107. +1 −1 Modules/Contents/UI/Include/PolyUIEvent.h
  108. +6 −7 Modules/Contents/UI/Include/PolyUIHSlider.h
  109. +4 −0 Modules/Contents/UI/Include/PolyUITextInput.h
  110. +7 −0 Modules/Contents/UI/Include/PolyUITree.h
  111. +1 −0 Modules/Contents/UI/Include/PolyUITreeEvent.h
  112. +2 −0 Modules/Contents/UI/Include/PolycodeUI.h
  113. +43 −18 Modules/Contents/UI/Source/PolyUICheckBox.cpp
  114. +449 −0 Modules/Contents/UI/Source/PolyUIColorBox.cpp
  115. +191 −0 Modules/Contents/UI/Source/PolyUIComboBox.cpp
  116. +54 −27 Modules/Contents/UI/Source/PolyUIHSlider.cpp
  117. +3 −2 Modules/Contents/UI/Source/PolyUIScrollContainer.cpp
  118. +18 −8 Modules/Contents/UI/Source/PolyUITextInput.cpp
  119. +38 −4 Modules/Contents/UI/Source/PolyUITree.cpp
  120. +7 −0 Modules/Contents/UI/Source/PolyUIWindow.cpp
  121. +37 −26 Player/Contents/CMakeLists.txt
  122. +11 −0 Player/Contents/Platform/Windows/Standalone/main.cpp
  123. +15 −0 Player/Contents/Platform/Windows/main.cpp
  124. +1 −1 Player/Contents/Source/PolycodeWindowsPlayer.cpp
View
@@ -15,6 +15,9 @@ When Polycode and its Dependencies are built, they will be available
in the Release/YourArchitecture folder under the main source tree in
a structure that should mimic the main binary release.
+If you wish to build a 32-bit version on a 64-bit machine in OS X, pass
+-DCMAKE_OSX_ARCHITECTURES=i386 as an argument to cmake
+
## Building dependencies ##
Polycode depends on a number of third party packages that are not
View
@@ -15,6 +15,9 @@ When Polycode and its Dependencies are built, they will be available
in the Release/YourArchitecture folder under the main source tree in
a structure that should mimic the main binary release.
+If you wish to build a 32-bit version on a 64-bit machine in OS X, pass
+-DCMAKE_OSX_ARCHITECTURES=i386 as an argument to cmake
+
## Building dependencies ##
Polycode depends on a number of third party packages that are not
@@ -7,6 +7,7 @@ SET(assimp_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=d
-DENABLE_BOOST_WORKAROUND=ON
-DBUILD_ASSIMP_TOOLS=OFF
@@ -11,6 +11,7 @@ SET(box2d_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=_d
-DBOX2D_INSTALL=ON
-DBOX2D_BUILD_EXAMPLES=OFF
@@ -6,6 +6,7 @@ SET(bullet_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=_d
-DINSTALL_LIBS=ON
-DBUILD_DEMOS=OFF
@@ -7,6 +7,7 @@ SET(freetype_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
EXTERNALPROJECT_ADD(freetype
@@ -7,6 +7,7 @@ SET(lua51_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=d
)
@@ -7,6 +7,7 @@ SET(oggvorbis_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
EXTERNALPROJECT_ADD(libogg
@@ -7,6 +7,7 @@ SET(openal_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=d
)
View
@@ -7,6 +7,7 @@ SET(libpng_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DPNG_SHARED=OFF
-DBUILD_SHARED_LIBS=FALSE
-DSKIP_INSTALL_FILES=1
@@ -16,10 +17,10 @@ EXTERNALPROJECT_ADD(zlib
PREFIX ${libpng_PREFIX}
DOWNLOAD_DIR ${POLYCODE_DEPS_DOWNLOAD_DIR}
- URL http://zlib.net/zlib-1.2.5.tar.gz
- URL_MD5 c735eab2d659a96e5a594c9e8541ad63
+ URL http://zlib.net/zlib-1.2.6.tar.gz
+ URL_MD5 618e944d7c7cd6521551e30b32322f4a
- PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PolycodeDependencies_SOURCE_DIR}/../CMake/zlib.cmake <SOURCE_DIR>/CMakeLists.txt && ${CMAKE_COMMAND} -E remove <SOURCE_DIR>/zconf.h
+ PATCH_COMMAND ${CMAKE_COMMAND} -E remove <SOURCE_DIR>/zconf.h
INSTALL_DIR ${POLYCODE_DEPS_CORE_PREFIX}
CMAKE_ARGS ${libpng_CMAKE_ARGS}
@@ -39,8 +40,8 @@ EXTERNALPROJECT_ADD(libpng
PREFIX ${libpng_PREFIX}
DOWNLOAD_DIR ${POLYCODE_DEPS_DOWNLOAD_DIR}
- URL ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.7.tar.gz
- URL_MD5 944b56a84b65d94054cc73d7ff965de8
+ URL ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.10.tar.gz
+ URL_MD5 9e5d864bce8f06751bbd99962ecf4aad
INSTALL_DIR ${POLYCODE_DEPS_CORE_PREFIX}
CMAKE_ARGS ${libpng_CMAKE_ARGS} -DCMAKE_PREFIX_PATH=${install_dir} # to find zlib
@@ -7,6 +7,7 @@ SET(physfs_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=d
-DPHYSFS_BUILD_TEST=FALSE
-DPHYSFS_BUILD_SHARED=FALSE
View
@@ -1,201 +0,0 @@
-# Custom version of cmake file for zlib 1.2.5 for Polycode build, in order that
-# the location of windres.exe can be overriden using CMAKE_RC_COMPILER
-cmake_minimum_required(VERSION 2.4.4)
-set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
-
-project(zlib C)
-
-if(NOT DEFINED BUILD_SHARED_LIBS)
- option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
-endif()
-
-include(CheckTypeSize)
-include(CheckFunctionExists)
-include(CheckIncludeFile)
-include(CheckCSourceCompiles)
-enable_testing()
-
-check_include_file(sys/types.h HAVE_SYS_TYPES_H)
-check_include_file(stdint.h HAVE_STDINT_H)
-check_include_file(stddef.h HAVE_STDDEF_H)
-
-#
-# Check to see if we have large file support
-#
-set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
-# We add these other definitions here because CheckTypeSize.cmake
-# in CMake 2.4.x does not automatically do so and we want
-# compatibility with CMake 2.4.x.
-if(HAVE_SYS_TYPES_H)
- list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
-endif()
-if(HAVE_STDINT_H)
- list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
-endif()
-if(HAVE_STDDEF_H)
- list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
-endif()
-check_type_size(off64_t OFF64_T)
-if(HAVE_OFF64_T)
- add_definitions(-D_LARGEFILE64_SOURCE=1)
-endif()
-set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
-
-#
-# Check for fseeko
-#
-check_function_exists(fseeko HAVE_FSEEKO)
-if(NOT HAVE_FSEEKO)
- add_definitions(-DNO_FSEEKO)
-endif()
-
-#
-# Check for unistd.h
-#
-check_include_file(unistd.h Z_HAVE_UNISTD_H)
-
-if(MSVC)
- set(CMAKE_DEBUG_POSTFIX "d")
- add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
- add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
-endif()
-
-if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
- # If we're doing an out of source build and the user has a zconf.h
- # in their source tree...
- if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
- message(FATAL_ERROR
- "You must remove ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h "
- "from the source tree. This file is included with zlib "
- "but CMake generates this file for you automatically "
- "in the build directory.")
- endif()
-endif()
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
- ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-
-#============================================================================
-# zlib
-#============================================================================
-
-set(ZLIB_PUBLIC_HDRS
- ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
- zlib.h
-)
-set(ZLIB_PRIVATE_HDRS
- crc32.h
- deflate.h
- gzguts.h
- inffast.h
- inffixed.h
- inflate.h
- inftrees.h
- trees.h
- zutil.h
-)
-set(ZLIB_SRCS
- adler32.c
- compress.c
- crc32.c
- deflate.c
- gzclose.c
- gzlib.c
- gzread.c
- gzwrite.c
- inflate.c
- infback.c
- inftrees.c
- inffast.c
- trees.c
- uncompr.c
- zutil.c
-)
-
-IF (NOT MINGW)
- set(ZLIB_SRCS ${ZLIB_SRCS}
- win32/zlib1.rc # If present will override custom build rule below.s
- )
-ENDIF()
-
-# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
-file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
-string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*"
- "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
-
-if(MINGW)
- # This gets us DLL resource information when compiling on MinGW.
- if(NOT CMAKE_RC_COMPILER)
- SET(CMAKE_RC_COMPILER windres.exe)
- endif()
-
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
- COMMAND ${CMAKE_RC_COMPILER}
- -D GCC_WINDRES
- -I ${CMAKE_CURRENT_SOURCE_DIR}
- -I ${CMAKE_CURRENT_BINARY_DIR}
- -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
- -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
- set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
-endif(MINGW)
-
-add_library(zlib ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
-
-set_target_properties(zlib PROPERTIES SOVERSION 1)
-
-if(NOT CYGWIN)
- # This property causes shared libraries on Linux to have the full version
- # encoded into their final filename. We disable this on Cygwin because
- # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
- # seems to be the default.
- #
- # This has no effect with MSVC, on that platform the version info for
- # the DLL comes from the resource file win32/zlib1.rc
- set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
-endif()
-
-if(UNIX)
- # On unix-like platforms the library is almost always called libz
- set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
-elseif(BUILD_SHARED_LIBS AND WIN32)
- # Creates zlib1.dll when building shared library version
- set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
-endif()
-
-if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS zlib
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib )
-endif()
-if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
- install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION include)
-endif()
-if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
- install(FILES zlib.3 DESTINATION share/man/man3)
-endif()
-
-#============================================================================
-# Example binaries
-#============================================================================
-
-add_executable(example example.c)
-target_link_libraries(example zlib)
-add_test(example example)
-
-add_executable(minigzip minigzip.c)
-target_link_libraries(minigzip zlib)
-
-if(HAVE_OFF64_T)
- add_executable(example64 example.c)
- target_link_libraries(example64 zlib)
- set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
- add_test(example64 example64)
-
- add_executable(minigzip64 minigzip.c)
- target_link_libraries(minigzip64 zlib)
- set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
-endif()
@@ -80,6 +80,18 @@ namespace Polycode {
return Color(nr, ng, nb, na);
}
+ /**
+ * Adds the color to another color.
+ */
+ inline Color operator + ( const Color& v2) const {
+ Number nr = r + v2.r;
+ Number ng = g + v2.g;
+ Number nb = b + v2.b;
+ Number na = a + v2.a;
+ return Color(nr, ng, nb, na);
+ }
+
+
bool operator == (const Color& c2) {
return (((int)255.0*r) == ((int)255.0*c2.r) && ((int)255.0*g) == ((int)255.0*c2.g) && ((int)255.0*b) == ((int)255.0*c2.b) && ((int)255.0*a) == ((int)255.0*c2.a));
}
@@ -152,6 +164,27 @@ namespace Polycode {
*/
Number getBrightness() const;
+ static void RGBtoHSV(const Number &r, const Number &g, const Number &b, Number &h, Number &s, Number &v);
+
+ /**
+ * Returns the hue of the color's HSV component.
+ * @return HSV Hue.
+ */
+ Number getHue() const;
+
+ /**
+ * Returns the saturation of the color's HSV component.
+ * @return HSV Saturation
+ */
+ Number getSaturation() const;
+
+ /**
+ * Returns the value of the color's HSV component
+ * @return HSV Value
+ */
+ Number getValue() const;
+
+
/**
* Returns the color as a 32-bit usigned integer.
* @return Color as a single 32-bit unsigned integer.
Oops, something went wrong.

0 comments on commit e15ae32

Please sign in to comment.