Просмотр исходного кода

Initial import from old repository

Ivan Safrin 15 лет назад
Родитель
Сommit
7cc9015fd0
100 измененных файлов с 13965 добавлено и 0 удалено
  1. 10 0
      .gitignore
  2. 1457 0
      Core/Build/Mac OS X/PolyCore.xcodeproj/ivansafrin.mode1v3
  3. 1713 0
      Core/Build/Mac OS X/PolyCore.xcodeproj/ivansafrin.pbxuser
  4. 1012 0
      Core/Build/Mac OS X/PolyCore.xcodeproj/project.pbxproj
  5. 77 0
      Core/Contents/Include/OSBasics.h
  6. 86 0
      Core/Contents/Include/PolyAGLCore.h
  7. 16 0
      Core/Contents/Include/PolyBasics.h
  8. 68 0
      Core/Contents/Include/PolyBezierCurve.h
  9. 56 0
      Core/Contents/Include/PolyBone.h
  10. 67 0
      Core/Contents/Include/PolyCamera.h
  11. 101 0
      Core/Contents/Include/PolyCocoaCore.h
  12. 57 0
      Core/Contents/Include/PolyColor.h
  13. 55 0
      Core/Contents/Include/PolyConfig.h
  14. 145 0
      Core/Contents/Include/PolyCore.h
  15. 60 0
      Core/Contents/Include/PolyCoreInput.h
  16. 97 0
      Core/Contents/Include/PolyCoreServices.h
  17. 27 0
      Core/Contents/Include/PolyCubemap.h
  18. 188 0
      Core/Contents/Include/PolyEntity.h
  19. 43 0
      Core/Contents/Include/PolyEvent.h
  20. 47 0
      Core/Contents/Include/PolyEventDispatcher.h
  21. 38 0
      Core/Contents/Include/PolyEventHandler.h
  22. 48 0
      Core/Contents/Include/PolyFixedShader.h
  23. 35 0
      Core/Contents/Include/PolyFont.h
  24. 44 0
      Core/Contents/Include/PolyFontManager.h
  25. 47 0
      Core/Contents/Include/PolyGLCubemap.h
  26. 130 0
      Core/Contents/Include/PolyGLES1Renderer.h
  27. 45 0
      Core/Contents/Include/PolyGLES1Texture.h
  28. 201 0
      Core/Contents/Include/PolyGLRenderer.h
  29. 57 0
      Core/Contents/Include/PolyGLTexture.h
  30. 51 0
      Core/Contents/Include/PolyGLVertexBuffer.h
  31. 80 0
      Core/Contents/Include/PolyGenericScene.h
  32. 68 0
      Core/Contents/Include/PolyGlobals.h
  33. 96 0
      Core/Contents/Include/PolyImage.h
  34. 54 0
      Core/Contents/Include/PolyInputEvent.h
  35. 275 0
      Core/Contents/Include/PolyInputKeys.h
  36. 55 0
      Core/Contents/Include/PolyLabel.h
  37. 28 0
      Core/Contents/Include/PolyLogger.h
  38. 29 0
      Core/Contents/Include/PolyLuaEventStuff.h
  39. 52 0
      Core/Contents/Include/PolyMaterial.h
  40. 72 0
      Core/Contents/Include/PolyMaterialManager.h
  41. 192 0
      Core/Contents/Include/PolyMatrix4.h
  42. 138 0
      Core/Contents/Include/PolyMesh.h
  43. 51 0
      Core/Contents/Include/PolyModule.h
  44. 41 0
      Core/Contents/Include/PolyParticle.h
  45. 110 0
      Core/Contents/Include/PolyParticleEmitter.h
  46. 58 0
      Core/Contents/Include/PolyPerlin.h
  47. 70 0
      Core/Contents/Include/PolyPolygon.h
  48. 250 0
      Core/Contents/Include/PolyQuaternion.h
  49. 45 0
      Core/Contents/Include/PolyQuaternionCurve.h
  50. 26 0
      Core/Contents/Include/PolyRectangle.h
  51. 230 0
      Core/Contents/Include/PolyRenderer.h
  52. 47 0
      Core/Contents/Include/PolyResource.h
  53. 56 0
      Core/Contents/Include/PolyResourceManager.h
  54. 54 0
      Core/Contents/Include/PolySDLCore.h
  55. 72 0
      Core/Contents/Include/PolyScene.h
  56. 38 0
      Core/Contents/Include/PolySceneEntity.h
  57. 47 0
      Core/Contents/Include/PolySceneLabel.h
  58. 72 0
      Core/Contents/Include/PolySceneLight.h
  59. 30 0
      Core/Contents/Include/PolySceneLine.h
  60. 46 0
      Core/Contents/Include/PolySceneManager.h
  61. 68 0
      Core/Contents/Include/PolySceneMesh.h
  62. 36 0
      Core/Contents/Include/PolyScenePrimitive.h
  63. 38 0
      Core/Contents/Include/PolySceneRenderTexture.h
  64. 76 0
      Core/Contents/Include/PolyScreen.h
  65. 32 0
      Core/Contents/Include/PolyScreenCurve.h
  66. 123 0
      Core/Contents/Include/PolyScreenEntity.h
  67. 31 0
      Core/Contents/Include/PolyScreenEvent.h
  68. 44 0
      Core/Contents/Include/PolyScreenImage.h
  69. 47 0
      Core/Contents/Include/PolyScreenLabel.h
  70. 47 0
      Core/Contents/Include/PolyScreenLine.h
  71. 47 0
      Core/Contents/Include/PolyScreenManager.h
  72. 44 0
      Core/Contents/Include/PolyScreenMesh.h
  73. 63 0
      Core/Contents/Include/PolyScreenShape.h
  74. 53 0
      Core/Contents/Include/PolyScreenSprite.h
  75. 102 0
      Core/Contents/Include/PolyShader.h
  76. 108 0
      Core/Contents/Include/PolySkeleton.h
  77. 62 0
      Core/Contents/Include/PolySound.h
  78. 33 0
      Core/Contents/Include/PolySoundManager.h
  79. 46 0
      Core/Contents/Include/PolySubstanceView.h
  80. 60 0
      Core/Contents/Include/PolyTexture.h
  81. 29 0
      Core/Contents/Include/PolyThreaded.h
  82. 44 0
      Core/Contents/Include/PolyTimer.h
  83. 36 0
      Core/Contents/Include/PolyTimerManager.h
  84. 111 0
      Core/Contents/Include/PolyTween.h
  85. 32 0
      Core/Contents/Include/PolyTweenManager.h
  86. 31 0
      Core/Contents/Include/PolyUtil.h
  87. 39 0
      Core/Contents/Include/PolyVector2.h
  88. 103 0
      Core/Contents/Include/PolyVector3.h
  89. 65 0
      Core/Contents/Include/PolyVertex.h
  90. 80 0
      Core/Contents/Include/Poly_iPhone.h
  91. 71 0
      Core/Contents/Include/Polycode.h
  92. 75 0
      Core/Contents/Include/PolyiPhoneCore.h
  93. 319 0
      Core/Contents/Include/tinystr.h
  94. 1806 0
      Core/Contents/Include/tinyxml.h
  95. 290 0
      Core/Contents/Source/OSBasics.cpp
  96. 239 0
      Core/Contents/Source/PolyAGLCore.cpp
  97. 149 0
      Core/Contents/Source/PolyBezierCurve.cpp
  98. 122 0
      Core/Contents/Source/PolyBone.cpp
  99. 308 0
      Core/Contents/Source/PolyCamera.cpp
  100. 296 0
      Core/Contents/Source/PolyCocoaCore.cpp

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+*.dll
+*.exe
+*.o
+*.lo
+*.a
+*.la
+*.dylib
+*.so
+
+Core/Dependencies

+ 1457 - 0
Core/Build/Mac OS X/PolyCore.xcodeproj/ivansafrin.mode1v3

@@ -0,0 +1,1457 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>ActivePerspectiveName</key>
+	<string>Project</string>
+	<key>AllowedModules</key>
+	<array>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXSmartGroupTreeModule</string>
+			<key>Name</key>
+			<string>Groups and Files Outline View</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXNavigatorGroup</string>
+			<key>Name</key>
+			<string>Editor</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>XCTaskListModule</string>
+			<key>Name</key>
+			<string>Task List</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>XCDetailModule</string>
+			<key>Name</key>
+			<string>File and Smart Group Detail Viewer</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>1</string>
+			<key>Module</key>
+			<string>PBXBuildResultsModule</string>
+			<key>Name</key>
+			<string>Detailed Build Results Viewer</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>1</string>
+			<key>Module</key>
+			<string>PBXProjectFindModule</string>
+			<key>Name</key>
+			<string>Project Batch Find Tool</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>XCProjectFormatConflictsModule</string>
+			<key>Name</key>
+			<string>Project Format Conflicts List</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXBookmarksModule</string>
+			<key>Name</key>
+			<string>Bookmarks Tool</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXClassBrowserModule</string>
+			<key>Name</key>
+			<string>Class Browser</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXCVSModule</string>
+			<key>Name</key>
+			<string>Source Code Control Tool</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXDebugBreakpointsModule</string>
+			<key>Name</key>
+			<string>Debug Breakpoints Tool</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>XCDockableInspector</string>
+			<key>Name</key>
+			<string>Inspector</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>PBXOpenQuicklyModule</string>
+			<key>Name</key>
+			<string>Open Quickly Tool</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>1</string>
+			<key>Module</key>
+			<string>PBXDebugSessionModule</string>
+			<key>Name</key>
+			<string>Debugger</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>1</string>
+			<key>Module</key>
+			<string>PBXDebugCLIModule</string>
+			<key>Name</key>
+			<string>Debug Console</string>
+		</dict>
+		<dict>
+			<key>BundleLoadPath</key>
+			<string></string>
+			<key>MaxInstances</key>
+			<string>n</string>
+			<key>Module</key>
+			<string>XCSnapshotModule</string>
+			<key>Name</key>
+			<string>Snapshots Tool</string>
+		</dict>
+	</array>
+	<key>BundlePath</key>
+	<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
+	<key>Description</key>
+	<string>DefaultDescriptionKey</string>
+	<key>DockingSystemVisible</key>
+	<false/>
+	<key>Extension</key>
+	<string>mode1v3</string>
+	<key>FavBarConfig</key>
+	<dict>
+		<key>PBXProjectModuleGUID</key>
+		<string>6DFBF2FC12A3181A00C43A7D</string>
+		<key>XCBarModuleItemNames</key>
+		<dict/>
+		<key>XCBarModuleItems</key>
+		<array/>
+	</dict>
+	<key>FirstTimeWindowDisplayed</key>
+	<false/>
+	<key>Identifier</key>
+	<string>com.apple.perspectives.project.mode1v3</string>
+	<key>MajorVersion</key>
+	<integer>33</integer>
+	<key>MinorVersion</key>
+	<integer>0</integer>
+	<key>Name</key>
+	<string>Default</string>
+	<key>Notifications</key>
+	<array/>
+	<key>OpenEditors</key>
+	<array/>
+	<key>PerspectiveWidths</key>
+	<array>
+		<integer>-1</integer>
+		<integer>-1</integer>
+	</array>
+	<key>Perspectives</key>
+	<array>
+		<dict>
+			<key>ChosenToolbarItems</key>
+			<array>
+				<string>active-combo-popup</string>
+				<string>action</string>
+				<string>NSToolbarFlexibleSpaceItem</string>
+				<string>debugger-enable-breakpoints</string>
+				<string>build-and-go</string>
+				<string>com.apple.ide.PBXToolbarStopButton</string>
+				<string>get-info</string>
+				<string>NSToolbarFlexibleSpaceItem</string>
+				<string>com.apple.pbx.toolbar.searchfield</string>
+			</array>
+			<key>ControllerClassBaseName</key>
+			<string></string>
+			<key>IconName</key>
+			<string>WindowOfProjectWithEditor</string>
+			<key>Identifier</key>
+			<string>perspective.project</string>
+			<key>IsVertical</key>
+			<false/>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>ContentConfiguration</key>
+					<dict>
+						<key>PBXBottomSmartGroupGIDs</key>
+						<array>
+							<string>1C37FBAC04509CD000000102</string>
+							<string>1C37FAAC04509CD000000102</string>
+							<string>1C37FABC05509CD000000102</string>
+							<string>1C37FABC05539CD112110102</string>
+							<string>E2644B35053B69B200211256</string>
+							<string>1C37FABC04509CD000100104</string>
+							<string>1CC0EA4004350EF90044410B</string>
+							<string>1CC0EA4004350EF90041110B</string>
+						</array>
+						<key>PBXProjectModuleGUID</key>
+						<string>1CE0B1FE06471DED0097A5F4</string>
+						<key>PBXProjectModuleLabel</key>
+						<string>Files</string>
+						<key>PBXProjectStructureProvided</key>
+						<string>yes</string>
+						<key>PBXSmartGroupTreeModuleColumnData</key>
+						<dict>
+							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+							<array>
+								<real>292</real>
+							</array>
+							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+							<array>
+								<string>MainColumn</string>
+							</array>
+						</dict>
+						<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+						<dict>
+							<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+							<array>
+								<string>08FB7794FE84155DC02AAC07</string>
+								<string>08FB7795FE84155DC02AAC07</string>
+								<string>6DFBF30A12A3184E00C43A7D</string>
+								<string>6DFBF30B12A3184E00C43A7D</string>
+								<string>6DFBF36612A3184E00C43A7D</string>
+								<string>1C37FBAC04509CD000000102</string>
+								<string>1C37FABC05509CD000000102</string>
+							</array>
+							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+							<array>
+								<array>
+									<integer>160</integer>
+									<integer>95</integer>
+									<integer>3</integer>
+									<integer>2</integer>
+									<integer>0</integer>
+								</array>
+							</array>
+							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+							<string>{{0, 2366}, {292, 782}}</string>
+						</dict>
+						<key>PBXTopSmartGroupGIDs</key>
+						<array/>
+						<key>XCIncludePerspectivesSwitch</key>
+						<true/>
+						<key>XCSharingToken</key>
+						<string>com.apple.Xcode.GFSharingToken</string>
+					</dict>
+					<key>GeometryConfiguration</key>
+					<dict>
+						<key>Frame</key>
+						<string>{{0, 0}, {309, 800}}</string>
+						<key>GroupTreeTableConfiguration</key>
+						<array>
+							<string>MainColumn</string>
+							<real>292</real>
+						</array>
+						<key>RubberWindowFrame</key>
+						<string>330 246 1401 841 0 0 1920 1178 </string>
+					</dict>
+					<key>Module</key>
+					<string>PBXSmartGroupTreeModule</string>
+					<key>Proportion</key>
+					<string>309pt</string>
+				</dict>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>BecomeActive</key>
+							<true/>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CE0B20306471E060097A5F4</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>PolyScreenImage.cpp</string>
+								<key>PBXSplitModuleInNavigatorKey</key>
+								<dict>
+									<key>Split0</key>
+									<dict>
+										<key>PBXProjectModuleGUID</key>
+										<string>1CE0B20406471E060097A5F4</string>
+										<key>PBXProjectModuleLabel</key>
+										<string>PolyScreenImage.cpp</string>
+										<key>_historyCapacity</key>
+										<integer>0</integer>
+										<key>bookmark</key>
+										<string>6D91B3F112AF599700261ED4</string>
+										<key>history</key>
+										<array>
+											<string>6DFBF4E012A35B9200C43A7D</string>
+											<string>6DFBF51D12A35D8600C43A7D</string>
+											<string>6DFBF52112A35D8600C43A7D</string>
+											<string>6DFBF54712A35E6B00C43A7D</string>
+											<string>6DFBF58F12A3655900C43A7D</string>
+											<string>6DFBF78D12A383F200C43A7D</string>
+											<string>6DFBF78E12A383F200C43A7D</string>
+											<string>6DFBF78F12A383F200C43A7D</string>
+											<string>6DFBF79012A383F200C43A7D</string>
+											<string>6DFBF79112A383F200C43A7D</string>
+											<string>6DFBF8E512A3F87400C43A7D</string>
+											<string>6DFBF8E612A3F87400C43A7D</string>
+											<string>6DFBF97512A3FDF700C43A7D</string>
+											<string>6DFBFB7D12A4962C00C43A7D</string>
+											<string>6DFBFBFA12A49E4C00C43A7D</string>
+											<string>6DFB006C12A70DB400C43A7D</string>
+											<string>6DFB018A12A73FDA00C43A7D</string>
+											<string>6DFB018B12A73FDA00C43A7D</string>
+											<string>6DFB018F12A73FDA00C43A7D</string>
+											<string>6DFB019612A73FDA00C43A7D</string>
+											<string>6DFB025A12A75F1900C43A7D</string>
+											<string>6DFB025C12A75F1900C43A7D</string>
+											<string>6DFB028312A7603600C43A7D</string>
+											<string>6DFB02EB12A7680600C43A7D</string>
+											<string>6DFB03B312A76E0900C43A7D</string>
+											<string>6DFB03B412A76E0900C43A7D</string>
+											<string>6DFB03B512A76E0900C43A7D</string>
+											<string>6DFB03D112A76E8800C43A7D</string>
+											<string>6DFB09CE12A81B4500C43A7D</string>
+											<string>6DFB09CF12A81B4500C43A7D</string>
+											<string>6DFB09D012A81B4500C43A7D</string>
+											<string>6DFB09D112A81B4500C43A7D</string>
+											<string>6DFB09D212A81B4500C43A7D</string>
+											<string>6DFB09D412A81B4500C43A7D</string>
+											<string>6DFB09D512A81B4500C43A7D</string>
+											<string>6DFB09D612A81B4500C43A7D</string>
+											<string>6DFB0BED12A830FE00C43A7D</string>
+											<string>6DFB0DE512A8456C00C43A7D</string>
+											<string>6DFB0DEA12A8456C00C43A7D</string>
+											<string>6DFB0E4B12A84AC700C43A7D</string>
+											<string>6DFB0E4C12A84AC700C43A7D</string>
+											<string>6DFB0E4E12A84AC700C43A7D</string>
+											<string>6DFB0E5212A84AC700C43A7D</string>
+											<string>6DFB0E5312A84AC700C43A7D</string>
+											<string>6DFB108712A9544B00C43A7D</string>
+											<string>6DFB108812A9544B00C43A7D</string>
+											<string>6D80E89B12AB4B0C0037A708</string>
+											<string>6D80E89C12AB4B0C0037A708</string>
+											<string>6D80E89D12AB4B0C0037A708</string>
+											<string>6D80E8D412AB4BE10037A708</string>
+											<string>6D80E8D512AB4BE10037A708</string>
+											<string>6D80E8D612AB4BE10037A708</string>
+											<string>6D80EA9812AB79560037A708</string>
+											<string>6D80EAE012AB7B200037A708</string>
+											<string>6D80EAE112AB7B200037A708</string>
+											<string>6D80EAE212AB7B200037A708</string>
+											<string>6D80EAF012AB7B6F0037A708</string>
+											<string>6D80F04B12AC30F10037A708</string>
+											<string>6D80F04E12AC30F10037A708</string>
+											<string>6D80F05112AC30F10037A708</string>
+											<string>6D80F05512AC30F10037A708</string>
+											<string>6DA4F59F12AD53AC00324D9A</string>
+											<string>6DCE871312AEA05000566FAE</string>
+											<string>6DCE871412AEA05000566FAE</string>
+											<string>6DCE871512AEA05000566FAE</string>
+											<string>6DCE871612AEA05000566FAE</string>
+											<string>6DCE871712AEA05000566FAE</string>
+											<string>6DCE871812AEA05000566FAE</string>
+											<string>6D91B2CA12AF06F400261ED4</string>
+											<string>6D91B2CB12AF06F400261ED4</string>
+											<string>6D91B2CC12AF06F400261ED4</string>
+											<string>6D91B3E112AF599700261ED4</string>
+											<string>6D91B3E212AF599700261ED4</string>
+											<string>6D91B3E312AF599700261ED4</string>
+											<string>6D91B3E412AF599700261ED4</string>
+											<string>6D91B3E512AF599700261ED4</string>
+											<string>6D91B3E612AF599700261ED4</string>
+											<string>6D91B3E712AF599700261ED4</string>
+											<string>6D91B3E812AF599700261ED4</string>
+											<string>6D91B3E912AF599700261ED4</string>
+											<string>6D91B3EA12AF599700261ED4</string>
+											<string>6D91B3EB12AF599700261ED4</string>
+											<string>6D91B3EC12AF599700261ED4</string>
+											<string>6D91B3ED12AF599700261ED4</string>
+											<string>6D91B3EE12AF599700261ED4</string>
+											<string>6D91B3EF12AF599700261ED4</string>
+											<string>6D91B3F012AF599700261ED4</string>
+										</array>
+									</dict>
+									<key>SplitCount</key>
+									<string>1</string>
+								</dict>
+								<key>StatusBarVisibility</key>
+								<true/>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {1087, 795}}</string>
+								<key>RubberWindowFrame</key>
+								<string>330 246 1401 841 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>795pt</string>
+						</dict>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CE0B20506471E060097A5F4</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Detail</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 800}, {1087, 0}}</string>
+								<key>RubberWindowFrame</key>
+								<string>330 246 1401 841 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>XCDetailModule</string>
+							<key>Proportion</key>
+							<string>0pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>1087pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Project</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>XCModuleDock</string>
+				<string>PBXSmartGroupTreeModule</string>
+				<string>XCModuleDock</string>
+				<string>PBXNavigatorGroup</string>
+				<string>XCDetailModule</string>
+			</array>
+			<key>TableOfContents</key>
+			<array>
+				<string>6D91B3F212AF599700261ED4</string>
+				<string>1CE0B1FE06471DED0097A5F4</string>
+				<string>6D91B3F312AF599700261ED4</string>
+				<string>1CE0B20306471E060097A5F4</string>
+				<string>1CE0B20506471E060097A5F4</string>
+			</array>
+			<key>ToolbarConfigUserDefaultsMinorVersion</key>
+			<string>2</string>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.defaultV3</string>
+		</dict>
+		<dict>
+			<key>ControllerClassBaseName</key>
+			<string></string>
+			<key>IconName</key>
+			<string>WindowOfProject</string>
+			<key>Identifier</key>
+			<string>perspective.morph</string>
+			<key>IsVertical</key>
+			<integer>0</integer>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>BecomeActive</key>
+					<integer>1</integer>
+					<key>ContentConfiguration</key>
+					<dict>
+						<key>PBXBottomSmartGroupGIDs</key>
+						<array>
+							<string>1C37FBAC04509CD000000102</string>
+							<string>1C37FAAC04509CD000000102</string>
+							<string>1C08E77C0454961000C914BD</string>
+							<string>1C37FABC05509CD000000102</string>
+							<string>1C37FABC05539CD112110102</string>
+							<string>E2644B35053B69B200211256</string>
+							<string>1C37FABC04509CD000100104</string>
+							<string>1CC0EA4004350EF90044410B</string>
+							<string>1CC0EA4004350EF90041110B</string>
+						</array>
+						<key>PBXProjectModuleGUID</key>
+						<string>11E0B1FE06471DED0097A5F4</string>
+						<key>PBXProjectModuleLabel</key>
+						<string>Files</string>
+						<key>PBXProjectStructureProvided</key>
+						<string>yes</string>
+						<key>PBXSmartGroupTreeModuleColumnData</key>
+						<dict>
+							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+							<array>
+								<real>186</real>
+							</array>
+							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+							<array>
+								<string>MainColumn</string>
+							</array>
+						</dict>
+						<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+						<dict>
+							<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+							<array>
+								<string>29B97314FDCFA39411CA2CEA</string>
+								<string>1C37FABC05509CD000000102</string>
+							</array>
+							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+							<array>
+								<array>
+									<integer>0</integer>
+								</array>
+							</array>
+							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+							<string>{{0, 0}, {186, 337}}</string>
+						</dict>
+						<key>PBXTopSmartGroupGIDs</key>
+						<array/>
+						<key>XCIncludePerspectivesSwitch</key>
+						<integer>1</integer>
+						<key>XCSharingToken</key>
+						<string>com.apple.Xcode.GFSharingToken</string>
+					</dict>
+					<key>GeometryConfiguration</key>
+					<dict>
+						<key>Frame</key>
+						<string>{{0, 0}, {203, 355}}</string>
+						<key>GroupTreeTableConfiguration</key>
+						<array>
+							<string>MainColumn</string>
+							<real>186</real>
+						</array>
+						<key>RubberWindowFrame</key>
+						<string>373 269 690 397 0 0 1440 878 </string>
+					</dict>
+					<key>Module</key>
+					<string>PBXSmartGroupTreeModule</string>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Morph</string>
+			<key>PreferredWidth</key>
+			<integer>300</integer>
+			<key>ServiceClasses</key>
+			<array>
+				<string>XCModuleDock</string>
+				<string>PBXSmartGroupTreeModule</string>
+			</array>
+			<key>TableOfContents</key>
+			<array>
+				<string>11E0B1FE06471DED0097A5F4</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.default.shortV3</string>
+		</dict>
+	</array>
+	<key>PerspectivesBarVisible</key>
+	<false/>
+	<key>ShelfIsVisible</key>
+	<false/>
+	<key>SourceDescription</key>
+	<string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
+	<key>StatusbarIsVisible</key>
+	<true/>
+	<key>TimeStamp</key>
+	<real>0.0</real>
+	<key>ToolbarConfigUserDefaultsMinorVersion</key>
+	<string>2</string>
+	<key>ToolbarDisplayMode</key>
+	<integer>1</integer>
+	<key>ToolbarIsVisible</key>
+	<true/>
+	<key>ToolbarSizeMode</key>
+	<integer>1</integer>
+	<key>Type</key>
+	<string>Perspectives</string>
+	<key>UpdateMessage</key>
+	<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature).  You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature.  Do you wish to update to the latest Workspace defaults for project '%@'?</string>
+	<key>WindowJustification</key>
+	<integer>5</integer>
+	<key>WindowOrderList</key>
+	<array>
+		<string>1C530D57069F1CE1000CFCEE</string>
+		<string>6DFBF2FD12A3181A00C43A7D</string>
+		<string>/Users/ivansafrin/Desktop/Workshop/Polycode/Core/Build/Mac OS X/PolyCore.xcodeproj</string>
+	</array>
+	<key>WindowString</key>
+	<string>330 246 1401 841 0 0 1920 1178 </string>
+	<key>WindowToolsV3</key>
+	<array>
+		<dict>
+			<key>FirstTimeWindowDisplayed</key>
+			<false/>
+			<key>Identifier</key>
+			<string>windowTool.build</string>
+			<key>IsVertical</key>
+			<true/>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CD0528F0623707200166675</string>
+								<key>PBXProjectModuleLabel</key>
+								<string></string>
+								<key>StatusBarVisibility</key>
+								<true/>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {1100, 471}}</string>
+								<key>RubberWindowFrame</key>
+								<string>587 266 1100 753 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>471pt</string>
+						</dict>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>XCMainBuildResultsModuleGUID</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Build Results</string>
+								<key>XCBuildResultsTrigger_Collapse</key>
+								<integer>1021</integer>
+								<key>XCBuildResultsTrigger_Open</key>
+								<integer>1011</integer>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 476}, {1100, 236}}</string>
+								<key>RubberWindowFrame</key>
+								<string>587 266 1100 753 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXBuildResultsModule</string>
+							<key>Proportion</key>
+							<string>236pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>712pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Build Results</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXBuildResultsModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<true/>
+			<key>TableOfContents</key>
+			<array>
+				<string>6DFBF2FD12A3181A00C43A7D</string>
+				<string>6D91B30812AF0C2B00261ED4</string>
+				<string>1CD0528F0623707200166675</string>
+				<string>XCMainBuildResultsModuleGUID</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.buildV3</string>
+			<key>WindowContentMinSize</key>
+			<string>486 300</string>
+			<key>WindowString</key>
+			<string>587 266 1100 753 0 0 1920 1178 </string>
+			<key>WindowToolGUID</key>
+			<string>6DFBF2FD12A3181A00C43A7D</string>
+			<key>WindowToolIsVisible</key>
+			<false/>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.debugger</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>Debugger</key>
+								<dict>
+									<key>HorizontalSplitView</key>
+									<dict>
+										<key>_collapsingFrameDimension</key>
+										<real>0.0</real>
+										<key>_indexOfCollapsedView</key>
+										<integer>0</integer>
+										<key>_percentageOfCollapsedView</key>
+										<real>0.0</real>
+										<key>isCollapsed</key>
+										<string>yes</string>
+										<key>sizes</key>
+										<array>
+											<string>{{0, 0}, {317, 164}}</string>
+											<string>{{317, 0}, {377, 164}}</string>
+										</array>
+									</dict>
+									<key>VerticalSplitView</key>
+									<dict>
+										<key>_collapsingFrameDimension</key>
+										<real>0.0</real>
+										<key>_indexOfCollapsedView</key>
+										<integer>0</integer>
+										<key>_percentageOfCollapsedView</key>
+										<real>0.0</real>
+										<key>isCollapsed</key>
+										<string>yes</string>
+										<key>sizes</key>
+										<array>
+											<string>{{0, 0}, {694, 164}}</string>
+											<string>{{0, 164}, {694, 216}}</string>
+										</array>
+									</dict>
+								</dict>
+								<key>LauncherConfigVersion</key>
+								<string>8</string>
+								<key>PBXProjectModuleGUID</key>
+								<string>1C162984064C10D400B95A72</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Debug - GLUTExamples (Underwater)</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>DebugConsoleDrawerSize</key>
+								<string>{100, 120}</string>
+								<key>DebugConsoleVisible</key>
+								<string>None</string>
+								<key>DebugConsoleWindowFrame</key>
+								<string>{{200, 200}, {500, 300}}</string>
+								<key>DebugSTDIOWindowFrame</key>
+								<string>{{200, 200}, {500, 300}}</string>
+								<key>Frame</key>
+								<string>{{0, 0}, {694, 380}}</string>
+								<key>RubberWindowFrame</key>
+								<string>321 238 694 422 0 0 1440 878 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXDebugSessionModule</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Debugger</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXDebugSessionModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>1</integer>
+			<key>TableOfContents</key>
+			<array>
+				<string>1CD10A99069EF8BA00B06720</string>
+				<string>1C0AD2AB069F1E9B00FABCE6</string>
+				<string>1C162984064C10D400B95A72</string>
+				<string>1C0AD2AC069F1E9B00FABCE6</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.debugV3</string>
+			<key>WindowString</key>
+			<string>321 238 694 422 0 0 1440 878 </string>
+			<key>WindowToolGUID</key>
+			<string>1CD10A99069EF8BA00B06720</string>
+			<key>WindowToolIsVisible</key>
+			<integer>0</integer>
+		</dict>
+		<dict>
+			<key>FirstTimeWindowDisplayed</key>
+			<false/>
+			<key>Identifier</key>
+			<string>windowTool.find</string>
+			<key>IsVertical</key>
+			<true/>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>Dock</key>
+							<array>
+								<dict>
+									<key>BecomeActive</key>
+									<true/>
+									<key>ContentConfiguration</key>
+									<dict>
+										<key>PBXProjectModuleGUID</key>
+										<string>1CDD528C0622207200134675</string>
+										<key>PBXProjectModuleLabel</key>
+										<string>PolyGLRenderer.cpp</string>
+										<key>StatusBarVisibility</key>
+										<true/>
+									</dict>
+									<key>GeometryConfiguration</key>
+									<dict>
+										<key>Frame</key>
+										<string>{{0, 0}, {1021, 401}}</string>
+										<key>RubberWindowFrame</key>
+										<string>555 365 1021 741 0 0 1920 1178 </string>
+									</dict>
+									<key>Module</key>
+									<string>PBXNavigatorGroup</string>
+									<key>Proportion</key>
+									<string>1021pt</string>
+								</dict>
+							</array>
+							<key>Proportion</key>
+							<string>401pt</string>
+						</dict>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CD0528E0623707200166675</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Project Find</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 406}, {1021, 294}}</string>
+								<key>RubberWindowFrame</key>
+								<string>555 365 1021 741 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXProjectFindModule</string>
+							<key>Proportion</key>
+							<string>294pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>700pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Project Find</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXProjectFindModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<true/>
+			<key>TableOfContents</key>
+			<array>
+				<string>1C530D57069F1CE1000CFCEE</string>
+				<string>6D91B30D12AF0C2B00261ED4</string>
+				<string>6D91B30E12AF0C2B00261ED4</string>
+				<string>1CDD528C0622207200134675</string>
+				<string>1CD0528E0623707200166675</string>
+			</array>
+			<key>WindowString</key>
+			<string>555 365 1021 741 0 0 1920 1178 </string>
+			<key>WindowToolGUID</key>
+			<string>1C530D57069F1CE1000CFCEE</string>
+			<key>WindowToolIsVisible</key>
+			<false/>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>MENUSEPARATOR</string>
+		</dict>
+		<dict>
+			<key>FirstTimeWindowDisplayed</key>
+			<false/>
+			<key>Identifier</key>
+			<string>windowTool.debuggerConsole</string>
+			<key>IsVertical</key>
+			<true/>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>BecomeActive</key>
+							<true/>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1C78EAAC065D492600B07095</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Debugger Console</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {650, 209}}</string>
+								<key>RubberWindowFrame</key>
+								<string>468 836 650 250 0 0 1920 1178 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXDebugCLIModule</string>
+							<key>Proportion</key>
+							<string>209pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>209pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Debugger Console</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXDebugCLIModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<true/>
+			<key>TableOfContents</key>
+			<array>
+				<string>1C78EAAD065D492600B07095</string>
+				<string>6DFBFA1912A4110F00C43A7D</string>
+				<string>1C78EAAC065D492600B07095</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.consoleV3</string>
+			<key>WindowString</key>
+			<string>468 836 650 250 0 0 1920 1178 </string>
+			<key>WindowToolGUID</key>
+			<string>1C78EAAD065D492600B07095</string>
+			<key>WindowToolIsVisible</key>
+			<false/>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.snapshots</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>Module</key>
+							<string>XCSnapshotModule</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Snapshots</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>XCSnapshotModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<string>Yes</string>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.snapshots</string>
+			<key>WindowString</key>
+			<string>315 824 300 550 0 0 1440 878 </string>
+			<key>WindowToolIsVisible</key>
+			<string>Yes</string>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.scm</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1C78EAB2065D492600B07095</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>&lt;No Editor&gt;</string>
+								<key>PBXSplitModuleInNavigatorKey</key>
+								<dict>
+									<key>Split0</key>
+									<dict>
+										<key>PBXProjectModuleGUID</key>
+										<string>1C78EAB3065D492600B07095</string>
+									</dict>
+									<key>SplitCount</key>
+									<string>1</string>
+								</dict>
+								<key>StatusBarVisibility</key>
+								<integer>1</integer>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {452, 0}}</string>
+								<key>RubberWindowFrame</key>
+								<string>743 379 452 308 0 0 1280 1002 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>0pt</string>
+						</dict>
+						<dict>
+							<key>BecomeActive</key>
+							<integer>1</integer>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CD052920623707200166675</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>SCM</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>ConsoleFrame</key>
+								<string>{{0, 259}, {452, 0}}</string>
+								<key>Frame</key>
+								<string>{{0, 7}, {452, 259}}</string>
+								<key>RubberWindowFrame</key>
+								<string>743 379 452 308 0 0 1280 1002 </string>
+								<key>TableConfiguration</key>
+								<array>
+									<string>Status</string>
+									<real>30</real>
+									<string>FileName</string>
+									<real>199</real>
+									<string>Path</string>
+									<real>197.0950012207031</real>
+								</array>
+								<key>TableFrame</key>
+								<string>{{0, 0}, {452, 250}}</string>
+							</dict>
+							<key>Module</key>
+							<string>PBXCVSModule</string>
+							<key>Proportion</key>
+							<string>262pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>266pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>SCM</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXCVSModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>1</integer>
+			<key>TableOfContents</key>
+			<array>
+				<string>1C78EAB4065D492600B07095</string>
+				<string>1C78EAB5065D492600B07095</string>
+				<string>1C78EAB2065D492600B07095</string>
+				<string>1CD052920623707200166675</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.scm</string>
+			<key>WindowString</key>
+			<string>743 379 452 308 0 0 1280 1002 </string>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.breakpoints</string>
+			<key>IsVertical</key>
+			<integer>0</integer>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>BecomeActive</key>
+							<integer>1</integer>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXBottomSmartGroupGIDs</key>
+								<array>
+									<string>1C77FABC04509CD000000102</string>
+								</array>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CE0B1FE06471DED0097A5F4</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Files</string>
+								<key>PBXProjectStructureProvided</key>
+								<string>no</string>
+								<key>PBXSmartGroupTreeModuleColumnData</key>
+								<dict>
+									<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+									<array>
+										<real>168</real>
+									</array>
+									<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+									<array>
+										<string>MainColumn</string>
+									</array>
+								</dict>
+								<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+								<dict>
+									<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+									<array>
+										<string>1C77FABC04509CD000000102</string>
+									</array>
+									<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+									<array>
+										<array>
+											<integer>0</integer>
+										</array>
+									</array>
+									<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+									<string>{{0, 0}, {168, 350}}</string>
+								</dict>
+								<key>PBXTopSmartGroupGIDs</key>
+								<array/>
+								<key>XCIncludePerspectivesSwitch</key>
+								<integer>0</integer>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{0, 0}, {185, 368}}</string>
+								<key>GroupTreeTableConfiguration</key>
+								<array>
+									<string>MainColumn</string>
+									<real>168</real>
+								</array>
+								<key>RubberWindowFrame</key>
+								<string>315 424 744 409 0 0 1440 878 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXSmartGroupTreeModule</string>
+							<key>Proportion</key>
+							<string>185pt</string>
+						</dict>
+						<dict>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CA1AED706398EBD00589147</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Detail</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{{190, 0}, {554, 368}}</string>
+								<key>RubberWindowFrame</key>
+								<string>315 424 744 409 0 0 1440 878 </string>
+							</dict>
+							<key>Module</key>
+							<string>XCDetailModule</string>
+							<key>Proportion</key>
+							<string>554pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>368pt</string>
+				</dict>
+			</array>
+			<key>MajorVersion</key>
+			<integer>3</integer>
+			<key>MinorVersion</key>
+			<integer>0</integer>
+			<key>Name</key>
+			<string>Breakpoints</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXSmartGroupTreeModule</string>
+				<string>XCDetailModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>1</integer>
+			<key>TableOfContents</key>
+			<array>
+				<string>1CDDB66807F98D9800BB5817</string>
+				<string>1CDDB66907F98D9800BB5817</string>
+				<string>1CE0B1FE06471DED0097A5F4</string>
+				<string>1CA1AED706398EBD00589147</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.breakpointsV3</string>
+			<key>WindowString</key>
+			<string>315 424 744 409 0 0 1440 878 </string>
+			<key>WindowToolGUID</key>
+			<string>1CDDB66807F98D9800BB5817</string>
+			<key>WindowToolIsVisible</key>
+			<integer>1</integer>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.debugAnimator</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>Module</key>
+							<string>PBXNavigatorGroup</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Debug Visualizer</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXNavigatorGroup</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>1</integer>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.debugAnimatorV3</string>
+			<key>WindowString</key>
+			<string>100 100 700 500 0 0 1280 1002 </string>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.bookmarks</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>Module</key>
+							<string>PBXBookmarksModule</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Bookmarks</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXBookmarksModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>0</integer>
+			<key>WindowString</key>
+			<string>538 42 401 187 0 0 1280 1002 </string>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.projectFormatConflicts</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>Module</key>
+							<string>XCProjectFormatConflictsModule</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Project Format Conflicts</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>XCProjectFormatConflictsModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>0</integer>
+			<key>WindowContentMinSize</key>
+			<string>450 300</string>
+			<key>WindowString</key>
+			<string>50 850 472 307 0 0 1440 877</string>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.classBrowser</string>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>BecomeActive</key>
+							<integer>1</integer>
+							<key>ContentConfiguration</key>
+							<dict>
+								<key>OptionsSetName</key>
+								<string>Hierarchy, all classes</string>
+								<key>PBXProjectModuleGUID</key>
+								<string>1CA6456E063B45B4001379D8</string>
+								<key>PBXProjectModuleLabel</key>
+								<string>Class Browser - NSObject</string>
+							</dict>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>ClassesFrame</key>
+								<string>{{0, 0}, {374, 96}}</string>
+								<key>ClassesTreeTableConfiguration</key>
+								<array>
+									<string>PBXClassNameColumnIdentifier</string>
+									<real>208</real>
+									<string>PBXClassBookColumnIdentifier</string>
+									<real>22</real>
+								</array>
+								<key>Frame</key>
+								<string>{{0, 0}, {630, 331}}</string>
+								<key>MembersFrame</key>
+								<string>{{0, 105}, {374, 395}}</string>
+								<key>MembersTreeTableConfiguration</key>
+								<array>
+									<string>PBXMemberTypeIconColumnIdentifier</string>
+									<real>22</real>
+									<string>PBXMemberNameColumnIdentifier</string>
+									<real>216</real>
+									<string>PBXMemberTypeColumnIdentifier</string>
+									<real>97</real>
+									<string>PBXMemberBookColumnIdentifier</string>
+									<real>22</real>
+								</array>
+								<key>PBXModuleWindowStatusBarHidden2</key>
+								<integer>1</integer>
+								<key>RubberWindowFrame</key>
+								<string>385 179 630 352 0 0 1440 878 </string>
+							</dict>
+							<key>Module</key>
+							<string>PBXClassBrowserModule</string>
+							<key>Proportion</key>
+							<string>332pt</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>332pt</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Class Browser</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>PBXClassBrowserModule</string>
+			</array>
+			<key>StatusbarIsVisible</key>
+			<integer>0</integer>
+			<key>TableOfContents</key>
+			<array>
+				<string>1C0AD2AF069F1E9B00FABCE6</string>
+				<string>1C0AD2B0069F1E9B00FABCE6</string>
+				<string>1CA6456E063B45B4001379D8</string>
+			</array>
+			<key>ToolbarConfiguration</key>
+			<string>xcode.toolbar.config.classbrowser</string>
+			<key>WindowString</key>
+			<string>385 179 630 352 0 0 1440 878 </string>
+			<key>WindowToolGUID</key>
+			<string>1C0AD2AF069F1E9B00FABCE6</string>
+			<key>WindowToolIsVisible</key>
+			<integer>0</integer>
+		</dict>
+		<dict>
+			<key>Identifier</key>
+			<string>windowTool.refactoring</string>
+			<key>IncludeInToolsMenu</key>
+			<integer>0</integer>
+			<key>Layout</key>
+			<array>
+				<dict>
+					<key>Dock</key>
+					<array>
+						<dict>
+							<key>BecomeActive</key>
+							<integer>1</integer>
+							<key>GeometryConfiguration</key>
+							<dict>
+								<key>Frame</key>
+								<string>{0, 0}, {500, 335}</string>
+								<key>RubberWindowFrame</key>
+								<string>{0, 0}, {500, 335}</string>
+							</dict>
+							<key>Module</key>
+							<string>XCRefactoringModule</string>
+							<key>Proportion</key>
+							<string>100%</string>
+						</dict>
+					</array>
+					<key>Proportion</key>
+					<string>100%</string>
+				</dict>
+			</array>
+			<key>Name</key>
+			<string>Refactoring</string>
+			<key>ServiceClasses</key>
+			<array>
+				<string>XCRefactoringModule</string>
+			</array>
+			<key>WindowString</key>
+			<string>200 200 500 356 0 0 1920 1200 </string>
+		</dict>
+	</array>
+</dict>
+</plist>

+ 1713 - 0
Core/Build/Mac OS X/PolyCore.xcodeproj/ivansafrin.pbxuser

@@ -0,0 +1,1713 @@
+// !$*UTF8*$!
+{
+	08FB7793FE84155DC02AAC07 /* Project object */ = {
+		activeArchitecturePreference = x86_64;
+		activeBuildConfigurationName = Debug;
+		activeTarget = D2AAC045055464E500DB518D /* PolyCore */;
+		addToTargets = (
+			D2AAC045055464E500DB518D /* PolyCore */,
+		);
+		breakpoints = (
+		);
+		codeSenseManager = 6DFBF30012A3181A00C43A7D /* Code sense */;
+		perUserDictionary = {
+			PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+				PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+				PBXFileTableDataSourceColumnWidthsKey = (
+					20,
+					848,
+					20,
+					48,
+					43,
+					43,
+					20,
+				);
+				PBXFileTableDataSourceColumnsKey = (
+					PBXFileDataSource_FiletypeID,
+					PBXFileDataSource_Filename_ColumnID,
+					PBXFileDataSource_Built_ColumnID,
+					PBXFileDataSource_ObjectSize_ColumnID,
+					PBXFileDataSource_Errors_ColumnID,
+					PBXFileDataSource_Warnings_ColumnID,
+					PBXFileDataSource_Target_ColumnID,
+				);
+			};
+			PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
+				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+				PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+				PBXFileTableDataSourceColumnWidthsKey = (
+					20,
+					605,
+					60,
+					20,
+					48.16259765625,
+					43,
+					43,
+				);
+				PBXFileTableDataSourceColumnsKey = (
+					PBXFileDataSource_FiletypeID,
+					PBXFileDataSource_Filename_ColumnID,
+					PBXTargetDataSource_PrimaryAttribute,
+					PBXFileDataSource_Built_ColumnID,
+					PBXFileDataSource_ObjectSize_ColumnID,
+					PBXFileDataSource_Errors_ColumnID,
+					PBXFileDataSource_Warnings_ColumnID,
+				);
+			};
+			PBXPerProjectTemplateStateSaveDate = 313461177;
+			PBXWorkspaceStateSaveDate = 313461177;
+		};
+		perUserProjectItems = {
+			6D80E89B12AB4B0C0037A708 /* PBXTextBookmark */ = 6D80E89B12AB4B0C0037A708 /* PBXTextBookmark */;
+			6D80E89C12AB4B0C0037A708 /* PBXTextBookmark */ = 6D80E89C12AB4B0C0037A708 /* PBXTextBookmark */;
+			6D80E89D12AB4B0C0037A708 /* PBXTextBookmark */ = 6D80E89D12AB4B0C0037A708 /* PBXTextBookmark */;
+			6D80E8D412AB4BE10037A708 /* PBXTextBookmark */ = 6D80E8D412AB4BE10037A708 /* PBXTextBookmark */;
+			6D80E8D512AB4BE10037A708 /* PBXTextBookmark */ = 6D80E8D512AB4BE10037A708 /* PBXTextBookmark */;
+			6D80E8D612AB4BE10037A708 /* PBXTextBookmark */ = 6D80E8D612AB4BE10037A708 /* PBXTextBookmark */;
+			6D80EA9812AB79560037A708 /* PBXTextBookmark */ = 6D80EA9812AB79560037A708 /* PBXTextBookmark */;
+			6D80EAE012AB7B200037A708 /* PBXTextBookmark */ = 6D80EAE012AB7B200037A708 /* PBXTextBookmark */;
+			6D80EAE112AB7B200037A708 /* PBXTextBookmark */ = 6D80EAE112AB7B200037A708 /* PBXTextBookmark */;
+			6D80EAE212AB7B200037A708 /* PBXTextBookmark */ = 6D80EAE212AB7B200037A708 /* PBXTextBookmark */;
+			6D80EAF012AB7B6F0037A708 /* PBXTextBookmark */ = 6D80EAF012AB7B6F0037A708 /* PBXTextBookmark */;
+			6D80F04B12AC30F10037A708 /* PBXTextBookmark */ = 6D80F04B12AC30F10037A708 /* PBXTextBookmark */;
+			6D80F04E12AC30F10037A708 /* PBXTextBookmark */ = 6D80F04E12AC30F10037A708 /* PBXTextBookmark */;
+			6D80F05112AC30F10037A708 /* PBXTextBookmark */ = 6D80F05112AC30F10037A708 /* PBXTextBookmark */;
+			6D80F05512AC30F10037A708 /* PBXTextBookmark */ = 6D80F05512AC30F10037A708 /* PBXTextBookmark */;
+			6D91B2CA12AF06F400261ED4 /* PBXTextBookmark */ = 6D91B2CA12AF06F400261ED4 /* PBXTextBookmark */;
+			6D91B2CB12AF06F400261ED4 /* PBXTextBookmark */ = 6D91B2CB12AF06F400261ED4 /* PBXTextBookmark */;
+			6D91B2CC12AF06F400261ED4 /* PBXTextBookmark */ = 6D91B2CC12AF06F400261ED4 /* PBXTextBookmark */;
+			6D91B3E112AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E112AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E212AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E212AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E312AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E312AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E412AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E412AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E512AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E512AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E612AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E612AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E712AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E712AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E812AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E812AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3E912AF599700261ED4 /* PBXTextBookmark */ = 6D91B3E912AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3EA12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3EA12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3EB12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3EB12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3EC12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3EC12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3ED12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3ED12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3EE12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3EE12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3EF12AF599700261ED4 /* PBXTextBookmark */ = 6D91B3EF12AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3F012AF599700261ED4 /* PBXTextBookmark */ = 6D91B3F012AF599700261ED4 /* PBXTextBookmark */;
+			6D91B3F112AF599700261ED4 /* PBXTextBookmark */ = 6D91B3F112AF599700261ED4 /* PBXTextBookmark */;
+			6DA4F59F12AD53AC00324D9A /* PBXTextBookmark */ = 6DA4F59F12AD53AC00324D9A /* PBXTextBookmark */;
+			6DCE871312AEA05000566FAE /* PBXTextBookmark */ = 6DCE871312AEA05000566FAE /* PBXTextBookmark */;
+			6DCE871412AEA05000566FAE /* PBXTextBookmark */ = 6DCE871412AEA05000566FAE /* PBXTextBookmark */;
+			6DCE871512AEA05000566FAE /* PBXTextBookmark */ = 6DCE871512AEA05000566FAE /* PBXTextBookmark */;
+			6DCE871612AEA05000566FAE /* PBXTextBookmark */ = 6DCE871612AEA05000566FAE /* PBXTextBookmark */;
+			6DCE871712AEA05000566FAE /* PBXTextBookmark */ = 6DCE871712AEA05000566FAE /* PBXTextBookmark */;
+			6DCE871812AEA05000566FAE /* PBXTextBookmark */ = 6DCE871812AEA05000566FAE /* PBXTextBookmark */;
+			6DFB006C12A70DB400C43A7D /* PBXTextBookmark */ = 6DFB006C12A70DB400C43A7D /* PBXTextBookmark */;
+			6DFB018A12A73FDA00C43A7D /* PBXTextBookmark */ = 6DFB018A12A73FDA00C43A7D /* PBXTextBookmark */;
+			6DFB018B12A73FDA00C43A7D /* PBXTextBookmark */ = 6DFB018B12A73FDA00C43A7D /* PBXTextBookmark */;
+			6DFB018F12A73FDA00C43A7D /* PBXTextBookmark */ = 6DFB018F12A73FDA00C43A7D /* PBXTextBookmark */;
+			6DFB019612A73FDA00C43A7D /* PBXTextBookmark */ = 6DFB019612A73FDA00C43A7D /* PBXTextBookmark */;
+			6DFB025A12A75F1900C43A7D /* PBXTextBookmark */ = 6DFB025A12A75F1900C43A7D /* PBXTextBookmark */;
+			6DFB025C12A75F1900C43A7D /* PBXTextBookmark */ = 6DFB025C12A75F1900C43A7D /* PBXTextBookmark */;
+			6DFB028312A7603600C43A7D /* PBXTextBookmark */ = 6DFB028312A7603600C43A7D /* PBXTextBookmark */;
+			6DFB02EB12A7680600C43A7D /* PBXTextBookmark */ = 6DFB02EB12A7680600C43A7D /* PBXTextBookmark */;
+			6DFB03B312A76E0900C43A7D /* PBXTextBookmark */ = 6DFB03B312A76E0900C43A7D /* PBXTextBookmark */;
+			6DFB03B412A76E0900C43A7D /* PBXTextBookmark */ = 6DFB03B412A76E0900C43A7D /* PBXTextBookmark */;
+			6DFB03B512A76E0900C43A7D /* PBXTextBookmark */ = 6DFB03B512A76E0900C43A7D /* PBXTextBookmark */;
+			6DFB03D112A76E8800C43A7D /* PBXTextBookmark */ = 6DFB03D112A76E8800C43A7D /* PBXTextBookmark */;
+			6DFB09CE12A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09CE12A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09CF12A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09CF12A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D012A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D012A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D112A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D112A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D212A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D212A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D412A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D412A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D512A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D512A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB09D612A81B4500C43A7D /* PBXTextBookmark */ = 6DFB09D612A81B4500C43A7D /* PBXTextBookmark */;
+			6DFB0BED12A830FE00C43A7D /* PBXTextBookmark */ = 6DFB0BED12A830FE00C43A7D /* PBXTextBookmark */;
+			6DFB0DE512A8456C00C43A7D /* PBXTextBookmark */ = 6DFB0DE512A8456C00C43A7D /* PBXTextBookmark */;
+			6DFB0DEA12A8456C00C43A7D /* PBXTextBookmark */ = 6DFB0DEA12A8456C00C43A7D /* PBXTextBookmark */;
+			6DFB0E4B12A84AC700C43A7D /* PBXTextBookmark */ = 6DFB0E4B12A84AC700C43A7D /* PBXTextBookmark */;
+			6DFB0E4C12A84AC700C43A7D /* PBXTextBookmark */ = 6DFB0E4C12A84AC700C43A7D /* PBXTextBookmark */;
+			6DFB0E4E12A84AC700C43A7D /* PBXTextBookmark */ = 6DFB0E4E12A84AC700C43A7D /* PBXTextBookmark */;
+			6DFB0E5212A84AC700C43A7D /* PBXTextBookmark */ = 6DFB0E5212A84AC700C43A7D /* PBXTextBookmark */;
+			6DFB0E5312A84AC700C43A7D /* PBXTextBookmark */ = 6DFB0E5312A84AC700C43A7D /* PBXTextBookmark */;
+			6DFB108712A9544B00C43A7D /* PBXTextBookmark */ = 6DFB108712A9544B00C43A7D /* PBXTextBookmark */;
+			6DFB108812A9544B00C43A7D /* PBXTextBookmark */ = 6DFB108812A9544B00C43A7D /* PBXTextBookmark */;
+			6DFBF4E012A35B9200C43A7D /* PBXTextBookmark */ = 6DFBF4E012A35B9200C43A7D /* PBXTextBookmark */;
+			6DFBF51D12A35D8600C43A7D /* PBXTextBookmark */ = 6DFBF51D12A35D8600C43A7D /* PBXTextBookmark */;
+			6DFBF52112A35D8600C43A7D /* PBXTextBookmark */ = 6DFBF52112A35D8600C43A7D /* PBXTextBookmark */;
+			6DFBF54712A35E6B00C43A7D /* PBXTextBookmark */ = 6DFBF54712A35E6B00C43A7D /* PBXTextBookmark */;
+			6DFBF58F12A3655900C43A7D /* PBXTextBookmark */ = 6DFBF58F12A3655900C43A7D /* PBXTextBookmark */;
+			6DFBF78D12A383F200C43A7D /* PBXTextBookmark */ = 6DFBF78D12A383F200C43A7D /* PBXTextBookmark */;
+			6DFBF78E12A383F200C43A7D /* PBXTextBookmark */ = 6DFBF78E12A383F200C43A7D /* PBXTextBookmark */;
+			6DFBF78F12A383F200C43A7D /* PBXTextBookmark */ = 6DFBF78F12A383F200C43A7D /* PBXTextBookmark */;
+			6DFBF79012A383F200C43A7D /* PBXTextBookmark */ = 6DFBF79012A383F200C43A7D /* PBXTextBookmark */;
+			6DFBF79112A383F200C43A7D /* PBXTextBookmark */ = 6DFBF79112A383F200C43A7D /* PBXTextBookmark */;
+			6DFBF8E512A3F87400C43A7D /* PBXTextBookmark */ = 6DFBF8E512A3F87400C43A7D /* PBXTextBookmark */;
+			6DFBF8E612A3F87400C43A7D /* PBXTextBookmark */ = 6DFBF8E612A3F87400C43A7D /* PBXTextBookmark */;
+			6DFBF97512A3FDF700C43A7D /* PBXTextBookmark */ = 6DFBF97512A3FDF700C43A7D /* PBXTextBookmark */;
+			6DFBFB7D12A4962C00C43A7D /* PBXTextBookmark */ = 6DFBFB7D12A4962C00C43A7D /* PBXTextBookmark */;
+			6DFBFBFA12A49E4C00C43A7D /* PBXTextBookmark */ = 6DFBFBFA12A49E4C00C43A7D /* PBXTextBookmark */;
+		};
+		sourceControlManager = 6DFBF2FF12A3181A00C43A7D /* Source Control */;
+		userBuildSettings = {
+		};
+	};
+	6D80E89B12AB4B0C0037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF38812A3184E00C43A7D /* PolyMaterialManager.cpp */;
+		name = "PolyMaterialManager.cpp: 103";
+		rLen = 13;
+		rLoc = 2802;
+		rType = 0;
+		vrLen = 1785;
+		vrLoc = 1537;
+	};
+	6D80E89C12AB4B0C0037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32B12A3184E00C43A7D /* PolyImage.h */;
+		name = "PolyImage.h: 43";
+		rLen = 8;
+		rLoc = 930;
+		rType = 0;
+		vrLen = 1374;
+		vrLoc = 742;
+	};
+	6D80E89D12AB4B0C0037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32F12A3184E00C43A7D /* PolyLabel.h */;
+		name = "PolyLabel.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 992;
+		vrLoc = 0;
+	};
+	6D80E8D412AB4BE10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37D12A3184E00C43A7D /* PolyGLES1Texture.cpp */;
+		name = "PolyGLES1Texture.cpp: 10";
+		rLen = 0;
+		rLoc = 168;
+		rType = 0;
+		vrLen = 1930;
+		vrLoc = 0;
+	};
+	6D80E8D512AB4BE10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37E12A3184E00C43A7D /* PolyGLRenderer.cpp */;
+		name = "PolyGLRenderer.cpp: 544";
+		rLen = 13;
+		rLoc = 18477;
+		rType = 0;
+		vrLen = 1821;
+		vrLoc = 17247;
+	};
+	6D80E8D612AB4BE10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32912A3184E00C43A7D /* PolyGLTexture.h */;
+		name = "PolyGLTexture.h: 50";
+		rLen = 15;
+		rLoc = 990;
+		rType = 0;
+		vrLen = 1106;
+		vrLoc = 0;
+	};
+	6D80EA9812AB79560037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF38412A3184E00C43A7D /* PolyLabel.cpp */;
+		name = "PolyLabel.cpp: 174";
+		rLen = 0;
+		rLoc = 4213;
+		rType = 0;
+		vrLen = 1845;
+		vrLoc = 2982;
+	};
+	6D80EAE012AB7B200037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34212A3184E00C43A7D /* PolySceneLabel.h */;
+		name = "PolySceneLabel.h: 33";
+		rLen = 0;
+		rLoc = 624;
+		rType = 0;
+		vrLen = 832;
+		vrLoc = 0;
+	};
+	6D80EAE112AB7B200037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF39712A3184E00C43A7D /* PolySceneLabel.cpp */;
+		name = "PolySceneLabel.cpp: 20";
+		rLen = 0;
+		rLoc = 530;
+		rType = 0;
+		vrLen = 1408;
+		vrLoc = 0;
+	};
+	6D80EAE212AB7B200037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34E12A3184E00C43A7D /* PolyScreenLabel.h */;
+		name = "PolyScreenLabel.h: 19";
+		rLen = 0;
+		rLoc = 333;
+		rType = 0;
+		vrLen = 882;
+		vrLoc = 0;
+	};
+	6D80EAF012AB7B6F0037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A312A3184E00C43A7D /* PolyScreenLabel.cpp */;
+		name = "PolyScreenLabel.cpp: 21";
+		rLen = 0;
+		rLoc = 593;
+		rType = 0;
+		vrLen = 1590;
+		vrLoc = 38;
+	};
+	6D80F04B12AC30F10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3B112A3184E00C43A7D /* PolyTween.cpp */;
+		name = "PolyTween.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1252;
+		vrLoc = 0;
+	};
+	6D80F04E12AC30F10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6D80F04F12AC30F10037A708 /* SubstanceCocoaApplication.cpp */;
+		name = "SubstanceCocoaApplication.cpp: 56";
+		rLen = 163;
+		rLoc = 1745;
+		rType = 0;
+		vrLen = 1911;
+		vrLoc = 0;
+	};
+	6D80F04F12AC30F10037A708 /* SubstanceCocoaApplication.cpp */ = {
+		isa = PBXFileReference;
+		lastKnownFileType = sourcecode.cpp.cpp;
+		name = SubstanceCocoaApplication.cpp;
+		path = /Users/ivansafrin/Desktop/Workshop/Substance/IDE2/Substance/SubstanceCocoaApplication.cpp;
+		sourceTree = "<absolute>";
+	};
+	6D80F05112AC30F10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36712A3184E00C43A7D /* OSBasics.cpp */;
+		name = "OSBasics.cpp: 201";
+		rLen = 11;
+		rLoc = 4816;
+		rType = 0;
+		vrLen = 1459;
+		vrLoc = 4012;
+	};
+	6D80F05512AC30F10037A708 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3B312A3184E00C43A7D /* PolyUtil.cpp */;
+		name = "PolyUtil.cpp: 15";
+		rLen = 90;
+		rLoc = 189;
+		rType = 0;
+		vrLen = 1302;
+		vrLoc = 0;
+	};
+	6D91B2CA12AF06F400261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36C12A3184E00C43A7D /* PolyCocoaCore.cpp */;
+		name = "PolyCocoaCore.cpp: 254";
+		rLen = 0;
+		rLoc = 7335;
+		rType = 0;
+		vrLen = 2303;
+		vrLoc = 5906;
+	};
+	6D91B2CB12AF06F400261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF39612A3184E00C43A7D /* PolySceneEntity.cpp */;
+		name = "PolySceneEntity.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 295;
+		vrLoc = 0;
+	};
+	6D91B2CC12AF06F400261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34B12A3184E00C43A7D /* PolyScreenEntity.h */;
+		name = "PolyScreenEntity.h: 93";
+		rLen = 12;
+		rLoc = 2256;
+		rType = 0;
+		vrLen = 1384;
+		vrLoc = 963;
+	};
+	6D91B3E112AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A012A3184E00C43A7D /* PolyScreenEntity.cpp */;
+		name = "PolyScreenEntity.cpp: 351";
+		rLen = 0;
+		rLoc = 8503;
+		rType = 0;
+		vrLen = 1506;
+		vrLoc = 7558;
+	};
+	6D91B3E212AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF38A12A3184E00C43A7D /* PolyMesh.cpp */;
+		name = "PolyMesh.cpp: 236";
+		rLen = 0;
+		rLoc = 6705;
+		rType = 0;
+		vrLen = 1919;
+		vrLoc = 6151;
+	};
+	6D91B3E312AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33512A3184E00C43A7D /* PolyMesh.h */;
+		name = "PolyMesh.h: 85";
+		rLen = 10;
+		rLoc = 1426;
+		rType = 0;
+		vrLen = 1395;
+		vrLoc = 1064;
+	};
+	6D91B3E412AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35212A3184E00C43A7D /* PolyScreenShape.h */;
+		name = "PolyScreenShape.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1318;
+		vrLoc = 0;
+	};
+	6D91B3E512AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33D12A3184E00C43A7D /* PolyRenderer.h */;
+		name = "PolyRenderer.h: 51";
+		rLen = 0;
+		rLoc = 1110;
+		rType = 0;
+		vrLen = 1824;
+		vrLoc = 369;
+	};
+	6D91B3E612AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF39212A3184E00C43A7D /* PolyRenderer.cpp */;
+		name = "PolyRenderer.cpp: 184";
+		rLen = 0;
+		rLoc = 4022;
+		rType = 0;
+		vrLen = 1292;
+		vrLoc = 2309;
+	};
+	6D91B3E712AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A612A3184E00C43A7D /* PolyScreenMesh.cpp */;
+		name = "PolyScreenMesh.cpp: 53";
+		rLen = 20;
+		rLoc = 1120;
+		rType = 0;
+		vrLen = 1307;
+		vrLoc = 0;
+	};
+	6D91B3E812AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A812A3184E00C43A7D /* PolyScreenSprite.cpp */;
+		name = "PolyScreenSprite.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1609;
+		vrLoc = 0;
+	};
+	6D91B3E912AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF38212A3184E00C43A7D /* PolyInputEvent.cpp */;
+		name = "PolyInputEvent.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 680;
+		vrLoc = 0;
+	};
+	6D91B3EA12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF38112A3184E00C43A7D /* PolyImage.cpp */;
+		name = "PolyImage.cpp: 33";
+		rLen = 0;
+		rLoc = 675;
+		rType = 0;
+		vrLen = 1182;
+		vrLoc = 0;
+	};
+	6D91B3EB12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34D12A3184E00C43A7D /* PolyScreenImage.h */;
+		name = "PolyScreenImage.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 746;
+		vrLoc = 0;
+	};
+	6D91B3EC12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37F12A3184E00C43A7D /* PolyGLTexture.cpp */;
+		name = "PolyGLTexture.cpp: 27";
+		rLen = 21;
+		rLoc = 587;
+		rType = 0;
+		vrLen = 1769;
+		vrLoc = 143;
+	};
+	6D91B3ED12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3AE12A3184E00C43A7D /* PolyTexture.cpp */;
+		name = "PolyTexture.cpp: 50";
+		rLen = 0;
+		rLoc = 973;
+		rType = 0;
+		vrLen = 1221;
+		vrLoc = 472;
+	};
+	6D91B3EE12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35A12A3184E00C43A7D /* PolyTexture.h */;
+		name = "PolyTexture.h: 46";
+		rLen = 0;
+		rLoc = 939;
+		rType = 0;
+		vrLen = 1131;
+		vrLoc = 3;
+	};
+	6D91B3EF12AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A712A3184E00C43A7D /* PolyScreenShape.cpp */;
+		name = "PolyScreenShape.cpp: 104";
+		rLen = 113;
+		rLoc = 2552;
+		rType = 0;
+		vrLen = 1571;
+		vrLoc = 1696;
+	};
+	6D91B3F012AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */;
+		name = "PolyScreenImage.cpp: 76";
+		rLen = 0;
+		rLoc = 1886;
+		rType = 0;
+		vrLen = 1497;
+		vrLoc = 514;
+	};
+	6D91B3F112AF599700261ED4 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */;
+		name = "PolyScreenImage.cpp: 79";
+		rLen = 0;
+		rLoc = 2010;
+		rType = 0;
+		vrLen = 1560;
+		vrLoc = 514;
+	};
+	6DA4F59F12AD53AC00324D9A /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF30D12A3184E00C43A7D /* OSBasics.h */;
+		name = "OSBasics.h: 33";
+		rLen = 0;
+		rLoc = 469;
+		rType = 0;
+		vrLen = 1364;
+		vrLoc = 241;
+	};
+	6DCE871312AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31D12A3184E00C43A7D /* PolyEvent.h */;
+		name = "PolyEvent.h: 23";
+		rLen = 0;
+		rLoc = 349;
+		rType = 0;
+		vrLen = 755;
+		vrLoc = 0;
+	};
+	6DCE871412AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37412A3184E00C43A7D /* PolyEvent.cpp */;
+		name = "PolyEvent.cpp: 19";
+		rLen = 0;
+		rLoc = 266;
+		rType = 0;
+		vrLen = 702;
+		vrLoc = 0;
+	};
+	6DCE871512AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31E12A3184E00C43A7D /* PolyEventDispatcher.h */;
+		name = "PolyEventDispatcher.h: 21";
+		rLen = 0;
+		rLoc = 341;
+		rType = 0;
+		vrLen = 986;
+		vrLoc = 0;
+	};
+	6DCE871612AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37512A3184E00C43A7D /* PolyEventDispatcher.cpp */;
+		name = "PolyEventDispatcher.cpp: 55";
+		rLen = 59;
+		rLoc = 1404;
+		rType = 0;
+		vrLen = 1632;
+		vrLoc = 261;
+	};
+	6DCE871712AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31812A3184E00C43A7D /* PolyCore.h */;
+		name = "PolyCore.h: 94";
+		rLen = 102;
+		rLoc = 2088;
+		rType = 0;
+		vrLen = 1752;
+		vrLoc = 821;
+	};
+	6DCE871812AEA05000566FAE /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31412A3184E00C43A7D /* PolyCocoaCore.h */;
+		name = "PolyCocoaCore.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1021;
+		vrLoc = 0;
+	};
+	6DFB006C12A70DB400C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37A12A3184E00C43A7D /* PolyGenericScene.cpp */;
+		name = "PolyGenericScene.cpp: 270";
+		rLen = 15;
+		rLoc = 7352;
+		rType = 0;
+		vrLen = 2022;
+		vrLoc = 6461;
+	};
+	6DFB016E12A73BC200C43A7D /* PolyModule.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{602, 0}";
+			sepNavVisRange = "{0, 1284}";
+			sepNavWindowFrame = "{{130, 257}, {1055, 811}}";
+		};
+	};
+	6DFB017012A73BCF00C43A7D /* PolyModule.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{436, 0}";
+			sepNavVisRange = "{0, 436}";
+		};
+	};
+	6DFB018A12A73FDA00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37212A3184E00C43A7D /* PolyCubemap.cpp */;
+		name = "PolyCubemap.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 360;
+		vrLoc = 0;
+	};
+	6DFB018B12A73FDA00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31B12A3184E00C43A7D /* PolyCubemap.h */;
+		name = "PolyCubemap.h: 12";
+		rLen = 159;
+		rLoc = 161;
+		rType = 0;
+		vrLen = 463;
+		vrLoc = 0;
+	};
+	6DFB018F12A73FDA00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31A12A3184E00C43A7D /* PolyCoreServices.h */;
+		name = "PolyCoreServices.h: 59";
+		rLen = 46;
+		rLoc = 1183;
+		rType = 0;
+		vrLen = 1378;
+		vrLoc = 713;
+	};
+	6DFB019612A73FDA00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3AA12A3184E00C43A7D /* PolyShader.cpp */;
+		name = "PolyShader.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1262;
+		vrLoc = 0;
+	};
+	6DFB025A12A75F1900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36512A3184E00C43A7D /* tinyxml.h */;
+		name = "tinyxml.h: 51";
+		rLen = 0;
+		rLoc = 1422;
+		rType = 0;
+		vrLen = 1647;
+		vrLoc = 0;
+	};
+	6DFB025C12A75F1900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33412A3184E00C43A7D /* PolyMatrix4.h */;
+		name = "PolyMatrix4.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1158;
+		vrLoc = 0;
+	};
+	6DFB028312A7603600C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35512A3184E00C43A7D /* PolyShader.h */;
+		name = "PolyShader.h: 28";
+		rLen = 0;
+		rLoc = 491;
+		rType = 0;
+		vrLen = 967;
+		vrLoc = 130;
+	};
+	6DFB02EB12A7680600C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFB017012A73BCF00C43A7D /* PolyModule.cpp */;
+		name = "PolyModule.cpp: 30";
+		rLen = 0;
+		rLoc = 436;
+		rType = 0;
+		vrLen = 436;
+		vrLoc = 0;
+	};
+	6DFB03B312A76E0900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33F12A3184E00C43A7D /* PolyResourceManager.h */;
+		name = "PolyResourceManager.h: 54";
+		rLen = 48;
+		rLoc = 1237;
+		rType = 0;
+		vrLen = 1291;
+		vrLoc = 0;
+	};
+	6DFB03B412A76E0900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32712A3184E00C43A7D /* PolyGlobals.h */;
+		name = "PolyGlobals.h: 8";
+		rLen = 0;
+		rLoc = 119;
+		rType = 0;
+		vrLen = 1109;
+		vrLoc = 0;
+	};
+	6DFB03B512A76E0900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33E12A3184E00C43A7D /* PolyResource.h */;
+		name = "PolyResource.h: 35";
+		rLen = 16;
+		rLoc = 702;
+		rType = 0;
+		vrLen = 896;
+		vrLoc = 0;
+	};
+	6DFB03D112A76E8800C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF39412A3184E00C43A7D /* PolyResourceManager.cpp */;
+		name = "PolyResourceManager.cpp: 45";
+		rLen = 23;
+		rLoc = 1330;
+		rType = 0;
+		vrLen = 2082;
+		vrLoc = 269;
+	};
+	6DFB09CE12A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37112A3184E00C43A7D /* PolyCoreServices.cpp */;
+		name = "PolyCoreServices.cpp: 62";
+		rLen = 0;
+		rLoc = 1540;
+		rType = 0;
+		vrLen = 1849;
+		vrLoc = 932;
+	};
+	6DFB09CF12A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34312A3184E00C43A7D /* PolySceneLight.h */;
+		name = "PolySceneLight.h: 45";
+		rLen = 0;
+		rLoc = 854;
+		rType = 0;
+		vrLen = 1250;
+		vrLoc = 36;
+	};
+	6DFB09D012A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34112A3184E00C43A7D /* PolySceneEntity.h */;
+		name = "PolySceneEntity.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 704;
+		vrLoc = 0;
+	};
+	6DFB09D112A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF34612A3184E00C43A7D /* PolySceneMesh.h */;
+		name = "PolySceneMesh.h: 45";
+		rLen = 83;
+		rLoc = 868;
+		rType = 0;
+		vrLen = 1228;
+		vrLoc = 3;
+	};
+	6DFB09D212A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF39B12A3184E00C43A7D /* PolySceneMesh.cpp */;
+		name = "PolySceneMesh.cpp: 34";
+		rLen = 0;
+		rLoc = 757;
+		rType = 0;
+		vrLen = 1552;
+		vrLoc = 909;
+	};
+	6DFB09D412A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36312A3184E00C43A7D /* PolyVertex.h */;
+		name = "PolyVertex.h: 38";
+		rLen = 108;
+		rLoc = 656;
+		rType = 0;
+		vrLen = 1292;
+		vrLoc = 0;
+	};
+	6DFB09D512A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3B612A3184E00C43A7D /* PolyVertex.cpp */;
+		name = "PolyVertex.cpp: 29";
+		rLen = 0;
+		rLoc = 800;
+		rType = 0;
+		vrLen = 1583;
+		vrLoc = 22;
+	};
+	6DFB09D612A81B4500C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33812A3184E00C43A7D /* PolyPerlin.h */;
+		name = "PolyPerlin.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 979;
+		vrLoc = 0;
+	};
+	6DFB0BED12A830FE00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFB016E12A73BC200C43A7D /* PolyModule.h */;
+		name = "PolyModule.h: 34";
+		rLen = 0;
+		rLoc = 602;
+		rType = 0;
+		vrLen = 1284;
+		vrLoc = 0;
+	};
+	6DFB0DE512A8456C00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35B12A3184E00C43A7D /* PolyThreaded.h */;
+		name = "PolyThreaded.h: 24";
+		rLen = 0;
+		rLoc = 460;
+		rType = 0;
+		vrLen = 506;
+		vrLoc = 0;
+	};
+	6DFB0DEA12A8456C00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF33312A3184E00C43A7D /* PolyMaterialManager.h */;
+		name = "PolyMaterialManager.h: 41";
+		rLen = 0;
+		rLoc = 967;
+		rType = 0;
+		vrLen = 1661;
+		vrLoc = 182;
+	};
+	6DFB0E4B12A84AC700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32512A3184E00C43A7D /* PolyGLES1Renderer.h */;
+		name = "PolyGLES1Renderer.h: 39";
+		rLen = 17;
+		rLoc = 900;
+		rType = 0;
+		vrLen = 1528;
+		vrLoc = 0;
+	};
+	6DFB0E4C12A84AC700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37C12A3184E00C43A7D /* PolyGLES1Renderer.cpp */;
+		name = "PolyGLES1Renderer.cpp: 465";
+		rLen = 0;
+		rLoc = 13892;
+		rType = 0;
+		vrLen = 1886;
+		vrLoc = 12963;
+	};
+	6DFB0E4E12A84AC700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32812A3184E00C43A7D /* PolyGLRenderer.h */;
+		name = "PolyGLRenderer.h: 102";
+		rLen = 0;
+		rLoc = 3738;
+		rType = 0;
+		vrLen = 2549;
+		vrLoc = 2268;
+	};
+	6DFB0E5212A84AC700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3AF12A3184E00C43A7D /* PolyTimer.cpp */;
+		name = "PolyTimer.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 972;
+		vrLoc = 0;
+	};
+	6DFB0E5312A84AC700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35C12A3184E00C43A7D /* PolyTimer.h */;
+		name = "PolyTimer.h: 22";
+		rLen = 11;
+		rLoc = 383;
+		rType = 0;
+		vrLen = 775;
+		vrLoc = 0;
+	};
+	6DFB108712A9544B00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31612A3184E00C43A7D /* PolyColor.h */;
+		name = "PolyColor.h: 25";
+		rLen = 0;
+		rLoc = 448;
+		rType = 0;
+		vrLen = 1096;
+		vrLoc = 0;
+	};
+	6DFB108812A9544B00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36D12A3184E00C43A7D /* PolyColor.cpp */;
+		name = "PolyColor.cpp: 54";
+		rLen = 0;
+		rLoc = 942;
+		rType = 0;
+		vrLen = 1090;
+		vrLoc = 0;
+	};
+	6DFBF2FF12A3181A00C43A7D /* Source Control */ = {
+		isa = PBXSourceControlManager;
+		fallbackIsa = XCSourceControlManager;
+		isSCMEnabled = 0;
+		scmConfiguration = {
+			repositoryNamesForRoots = {
+				"" = "";
+			};
+		};
+	};
+	6DFBF30012A3181A00C43A7D /* Code sense */ = {
+		isa = PBXCodeSenseManager;
+		indexTemplatePath = "";
+	};
+	6DFBF30D12A3184E00C43A7D /* OSBasics.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1001}}";
+			sepNavSelRange = "{469, 0}";
+			sepNavVisRange = "{241, 1364}";
+		};
+	};
+	6DFBF30F12A3184E00C43A7D /* PolyAGLCore.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 1053}}";
+			sepNavSelRange = "{852, 0}";
+			sepNavVisRange = "{553, 824}";
+		};
+	};
+	6DFBF31412A3184E00C43A7D /* PolyCocoaCore.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1300}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1021}";
+		};
+	};
+	6DFBF31512A3184E00C43A7D /* Polycode.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 936}}";
+			sepNavSelRange = "{1725, 0}";
+			sepNavVisRange = "{877, 902}";
+		};
+	};
+	6DFBF31612A3184E00C43A7D /* PolyColor.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 754}}";
+			sepNavSelRange = "{448, 0}";
+			sepNavVisRange = "{0, 658}";
+		};
+	};
+	6DFBF31812A3184E00C43A7D /* PolyCore.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1729}}";
+			sepNavSelRange = "{2088, 102}";
+			sepNavVisRange = "{821, 1752}";
+		};
+	};
+	6DFBF31A12A3184E00C43A7D /* PolyCoreServices.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 1261}}";
+			sepNavSelRange = "{1183, 46}";
+			sepNavVisRange = "{713, 1378}";
+		};
+	};
+	6DFBF31B12A3184E00C43A7D /* PolyCubemap.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 765}}";
+			sepNavSelRange = "{161, 159}";
+			sepNavVisRange = "{0, 463}";
+		};
+	};
+	6DFBF31D12A3184E00C43A7D /* PolyEvent.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{349, 0}";
+			sepNavVisRange = "{0, 755}";
+		};
+	};
+	6DFBF31E12A3184E00C43A7D /* PolyEventDispatcher.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{341, 0}";
+			sepNavVisRange = "{0, 986}";
+		};
+	};
+	6DFBF32112A3184E00C43A7D /* PolyFont.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 765}}";
+			sepNavSelRange = "{506, 0}";
+			sepNavVisRange = "{0, 546}";
+		};
+	};
+	6DFBF32312A3184E00C43A7D /* PolyGenericScene.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 1040}}";
+			sepNavSelRange = "{1812, 0}";
+			sepNavVisRange = "{1051, 955}";
+		};
+	};
+	6DFBF32512A3184E00C43A7D /* PolyGLES1Renderer.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1768}}";
+			sepNavSelRange = "{900, 17}";
+			sepNavVisRange = "{0, 1528}";
+		};
+	};
+	6DFBF32612A3184E00C43A7D /* PolyGLES1Texture.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {824, 585}}";
+			sepNavSelRange = "{255, 0}";
+			sepNavVisRange = "{0, 645}";
+		};
+	};
+	6DFBF32712A3184E00C43A7D /* PolyGlobals.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 923}}";
+			sepNavSelRange = "{119, 0}";
+			sepNavVisRange = "{0, 1109}";
+		};
+	};
+	6DFBF32812A3184E00C43A7D /* PolyGLRenderer.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2457}}";
+			sepNavSelRange = "{3738, 0}";
+			sepNavVisRange = "{2268, 2549}";
+		};
+	};
+	6DFBF32912A3184E00C43A7D /* PolyGLTexture.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{990, 15}";
+			sepNavVisRange = "{0, 1106}";
+		};
+	};
+	6DFBF32B12A3184E00C43A7D /* PolyImage.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {960, 1248}}";
+			sepNavSelRange = "{688, 11}";
+			sepNavVisRange = "{589, 365}";
+		};
+	};
+	6DFBF32F12A3184E00C43A7D /* PolyLabel.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 992}";
+		};
+	};
+	6DFBF33312A3184E00C43A7D /* PolyMaterialManager.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 936}}";
+			sepNavSelRange = "{967, 0}";
+			sepNavVisRange = "{182, 1661}";
+		};
+	};
+	6DFBF33412A3184E00C43A7D /* PolyMatrix4.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2834}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1158}";
+		};
+	};
+	6DFBF33512A3184E00C43A7D /* PolyMesh.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1742}}";
+			sepNavSelRange = "{1426, 10}";
+			sepNavVisRange = "{1064, 1395}";
+		};
+	};
+	6DFBF33812A3184E00C43A7D /* PolyPerlin.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 979}";
+		};
+	};
+	6DFBF33D12A3184E00C43A7D /* PolyRenderer.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 3055}}";
+			sepNavSelRange = "{1110, 0}";
+			sepNavVisRange = "{369, 1824}";
+		};
+	};
+	6DFBF33E12A3184E00C43A7D /* PolyResource.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{702, 16}";
+			sepNavVisRange = "{0, 896}";
+		};
+	};
+	6DFBF33F12A3184E00C43A7D /* PolyResourceManager.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{1237, 48}";
+			sepNavVisRange = "{0, 1291}";
+		};
+	};
+	6DFBF34112A3184E00C43A7D /* PolySceneEntity.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 704}";
+		};
+	};
+	6DFBF34212A3184E00C43A7D /* PolySceneLabel.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{624, 0}";
+			sepNavVisRange = "{0, 832}";
+		};
+	};
+	6DFBF34312A3184E00C43A7D /* PolySceneLight.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 923}}";
+			sepNavSelRange = "{854, 0}";
+			sepNavVisRange = "{36, 1250}";
+		};
+	};
+	6DFBF34612A3184E00C43A7D /* PolySceneMesh.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 884}}";
+			sepNavSelRange = "{868, 83}";
+			sepNavVisRange = "{3, 1228}";
+		};
+	};
+	6DFBF34B12A3184E00C43A7D /* PolyScreenEntity.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1508}}";
+			sepNavSelRange = "{2256, 12}";
+			sepNavVisRange = "{963, 1384}";
+		};
+	};
+	6DFBF34D12A3184E00C43A7D /* PolyScreenImage.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 738}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 746}";
+		};
+	};
+	6DFBF34E12A3184E00C43A7D /* PolyScreenLabel.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{333, 0}";
+			sepNavVisRange = "{0, 882}";
+		};
+	};
+	6DFBF35212A3184E00C43A7D /* PolyScreenShape.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 806}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1318}";
+		};
+	};
+	6DFBF35512A3184E00C43A7D /* PolyShader.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1521}}";
+			sepNavSelRange = "{491, 0}";
+			sepNavVisRange = "{130, 967}";
+		};
+	};
+	6DFBF35712A3184E00C43A7D /* PolySound.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 767}}";
+			sepNavSelRange = "{168, 0}";
+			sepNavVisRange = "{0, 942}";
+		};
+	};
+	6DFBF35812A3184E00C43A7D /* PolySoundManager.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 765}}";
+			sepNavSelRange = "{419, 0}";
+			sepNavVisRange = "{0, 471}";
+		};
+	};
+	6DFBF35912A3184E00C43A7D /* PolySubstanceView.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 740}}";
+			sepNavSelRange = "{321, 0}";
+			sepNavVisRange = "{0, 802}";
+		};
+	};
+	6DFBF35A12A3184E00C43A7D /* PolyTexture.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 780}}";
+			sepNavSelRange = "{939, 0}";
+			sepNavVisRange = "{3, 1131}";
+		};
+	};
+	6DFBF35B12A3184E00C43A7D /* PolyThreaded.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{460, 0}";
+			sepNavVisRange = "{0, 506}";
+		};
+	};
+	6DFBF35C12A3184E00C43A7D /* PolyTimer.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{383, 11}";
+			sepNavVisRange = "{0, 775}";
+		};
+	};
+	6DFBF36312A3184E00C43A7D /* PolyVertex.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 819}}";
+			sepNavSelRange = "{656, 108}";
+			sepNavVisRange = "{0, 1292}";
+		};
+	};
+	6DFBF36512A3184E00C43A7D /* tinyxml.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 23517}}";
+			sepNavSelRange = "{1422, 0}";
+			sepNavVisRange = "{0, 1647}";
+		};
+	};
+	6DFBF36712A3184E00C43A7D /* OSBasics.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 3874}}";
+			sepNavSelRange = "{4816, 11}";
+			sepNavVisRange = "{4012, 1459}";
+		};
+	};
+	6DFBF36812A3184E00C43A7D /* PolyAGLCore.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1307, 3211}}";
+			sepNavSelRange = "{310, 0}";
+			sepNavVisRange = "{0, 822}";
+		};
+	};
+	6DFBF36C12A3184E00C43A7D /* PolyCocoaCore.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1300, 3692}}";
+			sepNavSelRange = "{7335, 0}";
+			sepNavVisRange = "{5906, 2303}";
+		};
+	};
+	6DFBF36D12A3184E00C43A7D /* PolyColor.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1599}}";
+			sepNavSelRange = "{942, 0}";
+			sepNavVisRange = "{0, 1090}";
+		};
+	};
+	6DFBF36E12A3184E00C43A7D /* PolyConfig.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {936, 1352}}";
+			sepNavSelRange = "{1042, 10}";
+			sepNavVisRange = "{34, 1499}";
+		};
+	};
+	6DFBF36F12A3184E00C43A7D /* PolyCore.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 1456}}";
+			sepNavSelRange = "{900, 0}";
+			sepNavVisRange = "{740, 1101}";
+		};
+	};
+	6DFBF37012A3184E00C43A7D /* PolyCoreInput.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 1144}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1474}";
+		};
+	};
+	6DFBF37112A3184E00C43A7D /* PolyCoreServices.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2093}}";
+			sepNavSelRange = "{1540, 0}";
+			sepNavVisRange = "{932, 1849}";
+		};
+	};
+	6DFBF37212A3184E00C43A7D /* PolyCubemap.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {957, 765}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 360}";
+		};
+	};
+	6DFBF37412A3184E00C43A7D /* PolyEvent.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{266, 0}";
+			sepNavVisRange = "{0, 702}";
+		};
+	};
+	6DFBF37512A3184E00C43A7D /* PolyEventDispatcher.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 949}}";
+			sepNavSelRange = "{1404, 59}";
+			sepNavVisRange = "{261, 1632}";
+		};
+	};
+	6DFBF37A12A3184E00C43A7D /* PolyGenericScene.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1076, 7384}}";
+			sepNavSelRange = "{7352, 15}";
+			sepNavVisRange = "{6461, 2022}";
+		};
+	};
+	6DFBF37C12A3184E00C43A7D /* PolyGLES1Renderer.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 8723}}";
+			sepNavSelRange = "{13892, 0}";
+			sepNavVisRange = "{12963, 1886}";
+		};
+	};
+	6DFBF37D12A3184E00C43A7D /* PolyGLES1Texture.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1209, 897}}";
+			sepNavSelRange = "{168, 0}";
+			sepNavVisRange = "{0, 1930}";
+		};
+	};
+	6DFBF37E12A3184E00C43A7D /* PolyGLRenderer.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {992, 11908}}";
+			sepNavSelRange = "{22188, 0}";
+			sepNavVisRange = "{24501, 799}";
+		};
+	};
+	6DFBF37F12A3184E00C43A7D /* PolyGLTexture.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1279, 1066}}";
+			sepNavSelRange = "{587, 21}";
+			sepNavVisRange = "{143, 1769}";
+		};
+	};
+	6DFBF38112A3184E00C43A7D /* PolyImage.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 7384}}";
+			sepNavSelRange = "{675, 0}";
+			sepNavVisRange = "{0, 1182}";
+		};
+	};
+	6DFBF38212A3184E00C43A7D /* PolyInputEvent.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 680}";
+		};
+	};
+	6DFBF38412A3184E00C43A7D /* PolyLabel.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2912}}";
+			sepNavSelRange = "{4213, 0}";
+			sepNavVisRange = "{2982, 1845}";
+		};
+	};
+	6DFBF38812A3184E00C43A7D /* PolyMaterialManager.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 4745}}";
+			sepNavSelRange = "{2802, 13}";
+			sepNavVisRange = "{1537, 1785}";
+		};
+	};
+	6DFBF38A12A3184E00C43A7D /* PolyMesh.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 5330}}";
+			sepNavSelRange = "{6705, 0}";
+			sepNavVisRange = "{6151, 1919}";
+		};
+	};
+	6DFBF39212A3184E00C43A7D /* PolyRenderer.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1097, 2821}}";
+			sepNavSelRange = "{4022, 0}";
+			sepNavVisRange = "{2309, 1292}";
+			sepNavWindowFrame = "{{84, 299}, {1055, 811}}";
+		};
+	};
+	6DFBF39412A3184E00C43A7D /* PolyResourceManager.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {960, 2691}}";
+			sepNavSelRange = "{6233, 9}";
+			sepNavVisRange = "{6080, 384}";
+			sepNavWindowFrame = "{{107, 278}, {1055, 811}}";
+		};
+	};
+	6DFBF39612A3184E00C43A7D /* PolySceneEntity.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 295}";
+		};
+	};
+	6DFBF39712A3184E00C43A7D /* PolySceneLabel.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1209}}";
+			sepNavSelRange = "{530, 0}";
+			sepNavVisRange = "{0, 1408}";
+		};
+	};
+	6DFBF39B12A3184E00C43A7D /* PolySceneMesh.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2899}}";
+			sepNavSelRange = "{757, 0}";
+			sepNavVisRange = "{909, 1552}";
+		};
+	};
+	6DFBF3A012A3184E00C43A7D /* PolyScreenEntity.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 4940}}";
+			sepNavSelRange = "{8503, 0}";
+			sepNavVisRange = "{7558, 1506}";
+		};
+	};
+	6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1170}}";
+			sepNavSelRange = "{2010, 0}";
+			sepNavVisRange = "{514, 1560}";
+		};
+	};
+	6DFBF3A312A3184E00C43A7D /* PolyScreenLabel.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 832}}";
+			sepNavSelRange = "{593, 0}";
+			sepNavVisRange = "{38, 1590}";
+		};
+	};
+	6DFBF3A612A3184E00C43A7D /* PolyScreenMesh.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{1120, 20}";
+			sepNavVisRange = "{0, 1307}";
+		};
+	};
+	6DFBF3A712A3184E00C43A7D /* PolyScreenShape.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 2327}}";
+			sepNavSelRange = "{2552, 113}";
+			sepNavVisRange = "{1696, 1571}";
+		};
+	};
+	6DFBF3A812A3184E00C43A7D /* PolyScreenSprite.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1062, 1339}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1609}";
+		};
+	};
+	6DFBF3A912A3184E00C43A7D /* PolySDLCore.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 2197}}";
+			sepNavSelRange = "{70, 0}";
+			sepNavVisRange = "{0, 1508}";
+		};
+	};
+	6DFBF3AA12A3184E00C43A7D /* PolyShader.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 1118}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1262}";
+		};
+	};
+	6DFBF3AE12A3184E00C43A7D /* PolyTexture.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1183}}";
+			sepNavSelRange = "{973, 0}";
+			sepNavVisRange = "{472, 1221}";
+		};
+	};
+	6DFBF3AF12A3184E00C43A7D /* PolyTimer.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1001}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 972}";
+		};
+	};
+	6DFBF3B112A3184E00C43A7D /* PolyTween.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 3159}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1252}";
+		};
+	};
+	6DFBF3B312A3184E00C43A7D /* PolyUtil.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 763}}";
+			sepNavSelRange = "{189, 90}";
+			sepNavVisRange = "{0, 1302}";
+		};
+	};
+	6DFBF3B612A3184E00C43A7D /* PolyVertex.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 1235}}";
+			sepNavSelRange = "{800, 0}";
+			sepNavVisRange = "{22, 1583}";
+		};
+	};
+	6DFBF3B712A3184E00C43A7D /* PolySubstanceView.m */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1026, 6175}}";
+			sepNavSelRange = "{10112, 0}";
+			sepNavVisRange = "{8599, 1659}";
+		};
+	};
+	6DFBF3BC12A3184E00C43A7D /* xmltest.cpp */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 16952}}";
+			sepNavSelRange = "{373, 0}";
+			sepNavVisRange = "{3, 588}";
+		};
+	};
+	6DFBF4E012A35B9200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF32112A3184E00C43A7D /* PolyFont.h */;
+		name = "PolyFont.h: 31";
+		rLen = 0;
+		rLoc = 506;
+		rType = 0;
+		vrLen = 546;
+		vrLoc = 0;
+	};
+	6DFBF51D12A35D8600C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF35812A3184E00C43A7D /* PolySoundManager.h */;
+		name = "PolySoundManager.h: 29";
+		rLen = 0;
+		rLoc = 419;
+		rType = 0;
+		vrLen = 471;
+		vrLoc = 0;
+	};
+	6DFBF52112A35D8600C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36812A3184E00C43A7D /* PolyAGLCore.cpp */;
+		name = "PolyAGLCore.cpp: 19";
+		rLen = 0;
+		rLoc = 310;
+		rType = 0;
+		vrLen = 822;
+		vrLoc = 0;
+	};
+	6DFBF54712A35E6B00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF3A912A3184E00C43A7D /* PolySDLCore.cpp */;
+		name = "PolySDLCore.cpp: 5";
+		rLen = 0;
+		rLoc = 70;
+		rType = 0;
+		vrLen = 1508;
+		vrLoc = 0;
+	};
+	6DFBF58F12A3655900C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF31512A3184E00C43A7D /* Polycode.h */;
+		name = "Polycode.h: 38";
+		rLen = 0;
+		rLoc = 847;
+		rType = 0;
+		vrLen = 1458;
+		vrLoc = 0;
+	};
+	6DFBF76D12A383AF00C43A7D /* physfs_byteorder.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 4134}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1471}";
+		};
+	};
+	6DFBF76F12A383AF00C43A7D /* physfs_internal.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 19773}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1856}";
+		};
+	};
+	6DFBF77012A383AF00C43A7D /* physfs_platforms.h */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 765}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1576}";
+		};
+	};
+	6DFBF77112A383AF00C43A7D /* physfs_unicode.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 5967}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRange = "{0, 1931}";
+		};
+	};
+	6DFBF77212A383AF00C43A7D /* physfs.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {1039, 28899}}";
+			sepNavSelRange = "{301, 0}";
+			sepNavVisRange = "{0, 1008}";
+		};
+	};
+	6DFBF78512A383DF00C43A7D /* macosx.c */ = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {823, 5304}}";
+			sepNavSelRange = "{418, 0}";
+			sepNavVisRange = "{0, 1395}";
+		};
+	};
+	6DFBF78D12A383F200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF77212A383AF00C43A7D /* physfs.c */;
+		name = "physfs.c: 14";
+		rLen = 0;
+		rLoc = 301;
+		rType = 0;
+		vrLen = 2003;
+		vrLoc = 0;
+	};
+	6DFBF78E12A383F200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF77112A383AF00C43A7D /* physfs_unicode.c */;
+		name = "physfs_unicode.c: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1931;
+		vrLoc = 0;
+	};
+	6DFBF78F12A383F200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF77012A383AF00C43A7D /* physfs_platforms.h */;
+		name = "physfs_platforms.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1576;
+		vrLoc = 0;
+	};
+	6DFBF79012A383F200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF76F12A383AF00C43A7D /* physfs_internal.h */;
+		name = "physfs_internal.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1856;
+		vrLoc = 0;
+	};
+	6DFBF79112A383F200C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF76D12A383AF00C43A7D /* physfs_byteorder.c */;
+		name = "physfs_byteorder.c: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1471;
+		vrLoc = 0;
+	};
+	6DFBF8E512A3F87400C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF78512A383DF00C43A7D /* macosx.c */;
+		name = "macosx.c: 18";
+		rLen = 0;
+		rLoc = 418;
+		rType = 0;
+		vrLen = 1395;
+		vrLoc = 0;
+	};
+	6DFBF8E612A3F87400C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF37012A3184E00C43A7D /* PolyCoreInput.cpp */;
+		name = "PolyCoreInput.cpp: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1474;
+		vrLoc = 0;
+	};
+	6DFBF97512A3FDF700C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36F12A3184E00C43A7D /* PolyCore.cpp */;
+		name = "PolyCore.cpp: 52";
+		rLen = 0;
+		rLoc = 900;
+		rType = 0;
+		vrLen = 1101;
+		vrLoc = 740;
+	};
+	6DFBFA2012A4111300C43A7D /* BasicApplication.cpp */ = {
+		isa = PBXFileReference;
+		lastKnownFileType = sourcecode.cpp.cpp;
+		name = BasicApplication.cpp;
+		path = /Users/ivansafrin/Desktop/Workshop/Substance/Substance/OSX/BasicApplication/BasicApplication.cpp;
+		sourceTree = "<absolute>";
+	};
+	6DFBFB7D12A4962C00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBFA2012A4111300C43A7D /* BasicApplication.cpp */;
+		name = "BasicApplication.cpp: 52";
+		rLen = 0;
+		rLoc = 3119;
+		rType = 0;
+		vrLen = 4649;
+		vrLoc = 1411;
+	};
+	6DFBFBFA12A49E4C00C43A7D /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 6DFBF36E12A3184E00C43A7D /* PolyConfig.cpp */;
+		name = "PolyConfig.cpp: 48";
+		rLen = 10;
+		rLoc = 1042;
+		rType = 0;
+		vrLen = 1499;
+		vrLoc = 34;
+	};
+	D2AAC045055464E500DB518D /* PolyCore */ = {
+		activeExec = 0;
+	};
+}

+ 1012 - 0
Core/Build/Mac OS X/PolyCore.xcodeproj/project.pbxproj

@@ -0,0 +1,1012 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 45;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		6DFB016F12A73BC200C43A7D /* PolyModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFB016E12A73BC200C43A7D /* PolyModule.h */; };
+		6DFB017112A73BCF00C43A7D /* PolyModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFB017012A73BCF00C43A7D /* PolyModule.cpp */; };
+		6DFBF3BD12A3184E00C43A7D /* OSBasics.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF30D12A3184E00C43A7D /* OSBasics.h */; };
+		6DFBF3BE12A3184E00C43A7D /* Poly_iPhone.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF30E12A3184E00C43A7D /* Poly_iPhone.h */; };
+		6DFBF3BF12A3184E00C43A7D /* PolyAGLCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF30F12A3184E00C43A7D /* PolyAGLCore.h */; };
+		6DFBF3C012A3184E00C43A7D /* PolyBasics.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31012A3184E00C43A7D /* PolyBasics.h */; };
+		6DFBF3C112A3184E00C43A7D /* PolyBezierCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31112A3184E00C43A7D /* PolyBezierCurve.h */; };
+		6DFBF3C212A3184E00C43A7D /* PolyBone.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31212A3184E00C43A7D /* PolyBone.h */; };
+		6DFBF3C312A3184E00C43A7D /* PolyCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31312A3184E00C43A7D /* PolyCamera.h */; };
+		6DFBF3C412A3184E00C43A7D /* PolyCocoaCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31412A3184E00C43A7D /* PolyCocoaCore.h */; };
+		6DFBF3C512A3184E00C43A7D /* Polycode.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31512A3184E00C43A7D /* Polycode.h */; };
+		6DFBF3C612A3184E00C43A7D /* PolyColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31612A3184E00C43A7D /* PolyColor.h */; };
+		6DFBF3C712A3184E00C43A7D /* PolyConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31712A3184E00C43A7D /* PolyConfig.h */; };
+		6DFBF3C812A3184E00C43A7D /* PolyCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31812A3184E00C43A7D /* PolyCore.h */; };
+		6DFBF3C912A3184E00C43A7D /* PolyCoreInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31912A3184E00C43A7D /* PolyCoreInput.h */; };
+		6DFBF3CA12A3184E00C43A7D /* PolyCoreServices.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31A12A3184E00C43A7D /* PolyCoreServices.h */; };
+		6DFBF3CB12A3184E00C43A7D /* PolyCubemap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31B12A3184E00C43A7D /* PolyCubemap.h */; };
+		6DFBF3CC12A3184E00C43A7D /* PolyEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31C12A3184E00C43A7D /* PolyEntity.h */; };
+		6DFBF3CD12A3184E00C43A7D /* PolyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31D12A3184E00C43A7D /* PolyEvent.h */; };
+		6DFBF3CE12A3184E00C43A7D /* PolyEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31E12A3184E00C43A7D /* PolyEventDispatcher.h */; };
+		6DFBF3CF12A3184E00C43A7D /* PolyEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF31F12A3184E00C43A7D /* PolyEventHandler.h */; };
+		6DFBF3D012A3184E00C43A7D /* PolyFixedShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32012A3184E00C43A7D /* PolyFixedShader.h */; };
+		6DFBF3D112A3184E00C43A7D /* PolyFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32112A3184E00C43A7D /* PolyFont.h */; };
+		6DFBF3D212A3184E00C43A7D /* PolyFontManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32212A3184E00C43A7D /* PolyFontManager.h */; };
+		6DFBF3D312A3184E00C43A7D /* PolyGenericScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32312A3184E00C43A7D /* PolyGenericScene.h */; };
+		6DFBF3D412A3184E00C43A7D /* PolyGLCubemap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32412A3184E00C43A7D /* PolyGLCubemap.h */; };
+		6DFBF3D512A3184E00C43A7D /* PolyGLES1Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32512A3184E00C43A7D /* PolyGLES1Renderer.h */; };
+		6DFBF3D612A3184E00C43A7D /* PolyGLES1Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32612A3184E00C43A7D /* PolyGLES1Texture.h */; };
+		6DFBF3D712A3184E00C43A7D /* PolyGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32712A3184E00C43A7D /* PolyGlobals.h */; };
+		6DFBF3D812A3184E00C43A7D /* PolyGLRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32812A3184E00C43A7D /* PolyGLRenderer.h */; };
+		6DFBF3D912A3184E00C43A7D /* PolyGLTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32912A3184E00C43A7D /* PolyGLTexture.h */; };
+		6DFBF3DA12A3184E00C43A7D /* PolyGLVertexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32A12A3184E00C43A7D /* PolyGLVertexBuffer.h */; };
+		6DFBF3DB12A3184E00C43A7D /* PolyImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32B12A3184E00C43A7D /* PolyImage.h */; };
+		6DFBF3DC12A3184E00C43A7D /* PolyInputEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32C12A3184E00C43A7D /* PolyInputEvent.h */; };
+		6DFBF3DD12A3184E00C43A7D /* PolyInputKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32D12A3184E00C43A7D /* PolyInputKeys.h */; };
+		6DFBF3DE12A3184E00C43A7D /* PolyiPhoneCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32E12A3184E00C43A7D /* PolyiPhoneCore.h */; };
+		6DFBF3DF12A3184E00C43A7D /* PolyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF32F12A3184E00C43A7D /* PolyLabel.h */; };
+		6DFBF3E012A3184E00C43A7D /* PolyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33012A3184E00C43A7D /* PolyLogger.h */; };
+		6DFBF3E112A3184E00C43A7D /* PolyLuaEventStuff.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33112A3184E00C43A7D /* PolyLuaEventStuff.h */; };
+		6DFBF3E212A3184E00C43A7D /* PolyMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33212A3184E00C43A7D /* PolyMaterial.h */; };
+		6DFBF3E312A3184E00C43A7D /* PolyMaterialManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33312A3184E00C43A7D /* PolyMaterialManager.h */; };
+		6DFBF3E412A3184E00C43A7D /* PolyMatrix4.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33412A3184E00C43A7D /* PolyMatrix4.h */; };
+		6DFBF3E512A3184E00C43A7D /* PolyMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33512A3184E00C43A7D /* PolyMesh.h */; };
+		6DFBF3E612A3184E00C43A7D /* PolyParticle.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33612A3184E00C43A7D /* PolyParticle.h */; };
+		6DFBF3E712A3184E00C43A7D /* PolyParticleEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33712A3184E00C43A7D /* PolyParticleEmitter.h */; };
+		6DFBF3E812A3184E00C43A7D /* PolyPerlin.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33812A3184E00C43A7D /* PolyPerlin.h */; };
+		6DFBF3E912A3184E00C43A7D /* PolyPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33912A3184E00C43A7D /* PolyPolygon.h */; };
+		6DFBF3EA12A3184E00C43A7D /* PolyQuaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33A12A3184E00C43A7D /* PolyQuaternion.h */; };
+		6DFBF3EB12A3184E00C43A7D /* PolyQuaternionCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33B12A3184E00C43A7D /* PolyQuaternionCurve.h */; };
+		6DFBF3EC12A3184E00C43A7D /* PolyRectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33C12A3184E00C43A7D /* PolyRectangle.h */; };
+		6DFBF3ED12A3184E00C43A7D /* PolyRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33D12A3184E00C43A7D /* PolyRenderer.h */; };
+		6DFBF3EE12A3184E00C43A7D /* PolyResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33E12A3184E00C43A7D /* PolyResource.h */; };
+		6DFBF3EF12A3184E00C43A7D /* PolyResourceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF33F12A3184E00C43A7D /* PolyResourceManager.h */; };
+		6DFBF3F012A3184E00C43A7D /* PolyScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34012A3184E00C43A7D /* PolyScene.h */; };
+		6DFBF3F112A3184E00C43A7D /* PolySceneEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34112A3184E00C43A7D /* PolySceneEntity.h */; };
+		6DFBF3F212A3184E00C43A7D /* PolySceneLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34212A3184E00C43A7D /* PolySceneLabel.h */; };
+		6DFBF3F312A3184E00C43A7D /* PolySceneLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34312A3184E00C43A7D /* PolySceneLight.h */; };
+		6DFBF3F412A3184E00C43A7D /* PolySceneLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34412A3184E00C43A7D /* PolySceneLine.h */; };
+		6DFBF3F512A3184E00C43A7D /* PolySceneManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34512A3184E00C43A7D /* PolySceneManager.h */; };
+		6DFBF3F612A3184E00C43A7D /* PolySceneMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34612A3184E00C43A7D /* PolySceneMesh.h */; };
+		6DFBF3F712A3184E00C43A7D /* PolyScenePrimitive.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34712A3184E00C43A7D /* PolyScenePrimitive.h */; };
+		6DFBF3F812A3184E00C43A7D /* PolySceneRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34812A3184E00C43A7D /* PolySceneRenderTexture.h */; };
+		6DFBF3F912A3184E00C43A7D /* PolyScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34912A3184E00C43A7D /* PolyScreen.h */; };
+		6DFBF3FA12A3184E00C43A7D /* PolyScreenCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34A12A3184E00C43A7D /* PolyScreenCurve.h */; };
+		6DFBF3FB12A3184E00C43A7D /* PolyScreenEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34B12A3184E00C43A7D /* PolyScreenEntity.h */; };
+		6DFBF3FC12A3184E00C43A7D /* PolyScreenEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34C12A3184E00C43A7D /* PolyScreenEvent.h */; };
+		6DFBF3FD12A3184E00C43A7D /* PolyScreenImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34D12A3184E00C43A7D /* PolyScreenImage.h */; };
+		6DFBF3FE12A3184E00C43A7D /* PolyScreenLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34E12A3184E00C43A7D /* PolyScreenLabel.h */; };
+		6DFBF3FF12A3184E00C43A7D /* PolyScreenLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF34F12A3184E00C43A7D /* PolyScreenLine.h */; };
+		6DFBF40012A3184E00C43A7D /* PolyScreenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35012A3184E00C43A7D /* PolyScreenManager.h */; };
+		6DFBF40112A3184E00C43A7D /* PolyScreenMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35112A3184E00C43A7D /* PolyScreenMesh.h */; };
+		6DFBF40212A3184E00C43A7D /* PolyScreenShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35212A3184E00C43A7D /* PolyScreenShape.h */; };
+		6DFBF40312A3184E00C43A7D /* PolyScreenSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35312A3184E00C43A7D /* PolyScreenSprite.h */; };
+		6DFBF40412A3184E00C43A7D /* PolySDLCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35412A3184E00C43A7D /* PolySDLCore.h */; };
+		6DFBF40512A3184E00C43A7D /* PolyShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35512A3184E00C43A7D /* PolyShader.h */; };
+		6DFBF40612A3184E00C43A7D /* PolySkeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35612A3184E00C43A7D /* PolySkeleton.h */; };
+		6DFBF40712A3184E00C43A7D /* PolySound.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35712A3184E00C43A7D /* PolySound.h */; };
+		6DFBF40812A3184E00C43A7D /* PolySoundManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35812A3184E00C43A7D /* PolySoundManager.h */; };
+		6DFBF40912A3184E00C43A7D /* PolySubstanceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35912A3184E00C43A7D /* PolySubstanceView.h */; };
+		6DFBF40A12A3184E00C43A7D /* PolyTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35A12A3184E00C43A7D /* PolyTexture.h */; };
+		6DFBF40B12A3184E00C43A7D /* PolyThreaded.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35B12A3184E00C43A7D /* PolyThreaded.h */; };
+		6DFBF40C12A3184E00C43A7D /* PolyTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35C12A3184E00C43A7D /* PolyTimer.h */; };
+		6DFBF40D12A3184E00C43A7D /* PolyTimerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35D12A3184E00C43A7D /* PolyTimerManager.h */; };
+		6DFBF40E12A3184E00C43A7D /* PolyTween.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35E12A3184E00C43A7D /* PolyTween.h */; };
+		6DFBF40F12A3184E00C43A7D /* PolyTweenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF35F12A3184E00C43A7D /* PolyTweenManager.h */; };
+		6DFBF41012A3184E00C43A7D /* PolyUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36012A3184E00C43A7D /* PolyUtil.h */; };
+		6DFBF41112A3184E00C43A7D /* PolyVector2.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36112A3184E00C43A7D /* PolyVector2.h */; };
+		6DFBF41212A3184E00C43A7D /* PolyVector3.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36212A3184E00C43A7D /* PolyVector3.h */; };
+		6DFBF41312A3184E00C43A7D /* PolyVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36312A3184E00C43A7D /* PolyVertex.h */; };
+		6DFBF41412A3184E00C43A7D /* tinystr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36412A3184E00C43A7D /* tinystr.h */; };
+		6DFBF41512A3184E00C43A7D /* tinyxml.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF36512A3184E00C43A7D /* tinyxml.h */; };
+		6DFBF41612A3184E00C43A7D /* OSBasics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36712A3184E00C43A7D /* OSBasics.cpp */; };
+		6DFBF41812A3184E00C43A7D /* PolyBezierCurve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36912A3184E00C43A7D /* PolyBezierCurve.cpp */; };
+		6DFBF41912A3184E00C43A7D /* PolyBone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36A12A3184E00C43A7D /* PolyBone.cpp */; };
+		6DFBF41A12A3184E00C43A7D /* PolyCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36B12A3184E00C43A7D /* PolyCamera.cpp */; };
+		6DFBF41B12A3184E00C43A7D /* PolyCocoaCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36C12A3184E00C43A7D /* PolyCocoaCore.cpp */; };
+		6DFBF41C12A3184E00C43A7D /* PolyColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36D12A3184E00C43A7D /* PolyColor.cpp */; };
+		6DFBF41D12A3184E00C43A7D /* PolyConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36E12A3184E00C43A7D /* PolyConfig.cpp */; };
+		6DFBF41E12A3184E00C43A7D /* PolyCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF36F12A3184E00C43A7D /* PolyCore.cpp */; };
+		6DFBF41F12A3184E00C43A7D /* PolyCoreInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37012A3184E00C43A7D /* PolyCoreInput.cpp */; };
+		6DFBF42012A3184E00C43A7D /* PolyCoreServices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37112A3184E00C43A7D /* PolyCoreServices.cpp */; };
+		6DFBF42112A3184E00C43A7D /* PolyCubemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37212A3184E00C43A7D /* PolyCubemap.cpp */; };
+		6DFBF42212A3184E00C43A7D /* PolyEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37312A3184E00C43A7D /* PolyEntity.cpp */; };
+		6DFBF42312A3184E00C43A7D /* PolyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37412A3184E00C43A7D /* PolyEvent.cpp */; };
+		6DFBF42412A3184E00C43A7D /* PolyEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37512A3184E00C43A7D /* PolyEventDispatcher.cpp */; };
+		6DFBF42512A3184E00C43A7D /* PolyEventHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37612A3184E00C43A7D /* PolyEventHandler.cpp */; };
+		6DFBF42612A3184E00C43A7D /* PolyFixedShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37712A3184E00C43A7D /* PolyFixedShader.cpp */; };
+		6DFBF42712A3184E00C43A7D /* PolyFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37812A3184E00C43A7D /* PolyFont.cpp */; };
+		6DFBF42812A3184E00C43A7D /* PolyFontManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37912A3184E00C43A7D /* PolyFontManager.cpp */; };
+		6DFBF42912A3184E00C43A7D /* PolyGenericScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37A12A3184E00C43A7D /* PolyGenericScene.cpp */; };
+		6DFBF42A12A3184E00C43A7D /* PolyGLCubemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37B12A3184E00C43A7D /* PolyGLCubemap.cpp */; };
+		6DFBF42D12A3184E00C43A7D /* PolyGLRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37E12A3184E00C43A7D /* PolyGLRenderer.cpp */; };
+		6DFBF42E12A3184E00C43A7D /* PolyGLTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF37F12A3184E00C43A7D /* PolyGLTexture.cpp */; };
+		6DFBF42F12A3184E00C43A7D /* PolyGLVertexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38012A3184E00C43A7D /* PolyGLVertexBuffer.cpp */; };
+		6DFBF43012A3184E00C43A7D /* PolyImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38112A3184E00C43A7D /* PolyImage.cpp */; };
+		6DFBF43112A3184E00C43A7D /* PolyInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38212A3184E00C43A7D /* PolyInputEvent.cpp */; };
+		6DFBF43212A3184E00C43A7D /* PolyiPhoneCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38312A3184E00C43A7D /* PolyiPhoneCore.cpp */; };
+		6DFBF43312A3184E00C43A7D /* PolyLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38412A3184E00C43A7D /* PolyLabel.cpp */; };
+		6DFBF43412A3184E00C43A7D /* PolyLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38512A3184E00C43A7D /* PolyLogger.cpp */; };
+		6DFBF43512A3184E00C43A7D /* PolyLuaEventStuff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38612A3184E00C43A7D /* PolyLuaEventStuff.cpp */; };
+		6DFBF43612A3184E00C43A7D /* PolyMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38712A3184E00C43A7D /* PolyMaterial.cpp */; };
+		6DFBF43712A3184E00C43A7D /* PolyMaterialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38812A3184E00C43A7D /* PolyMaterialManager.cpp */; };
+		6DFBF43812A3184E00C43A7D /* PolyMatrix4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38912A3184E00C43A7D /* PolyMatrix4.cpp */; };
+		6DFBF43912A3184E00C43A7D /* PolyMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38A12A3184E00C43A7D /* PolyMesh.cpp */; };
+		6DFBF43A12A3184E00C43A7D /* PolyParticle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38B12A3184E00C43A7D /* PolyParticle.cpp */; };
+		6DFBF43B12A3184E00C43A7D /* PolyParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38C12A3184E00C43A7D /* PolyParticleEmitter.cpp */; };
+		6DFBF43C12A3184E00C43A7D /* PolyPerlin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38D12A3184E00C43A7D /* PolyPerlin.cpp */; };
+		6DFBF43D12A3184E00C43A7D /* PolyPolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38E12A3184E00C43A7D /* PolyPolygon.cpp */; };
+		6DFBF43E12A3184E00C43A7D /* PolyQuaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF38F12A3184E00C43A7D /* PolyQuaternion.cpp */; };
+		6DFBF43F12A3184E00C43A7D /* PolyQuaternionCurve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39012A3184E00C43A7D /* PolyQuaternionCurve.cpp */; };
+		6DFBF44012A3184E00C43A7D /* PolyRectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39112A3184E00C43A7D /* PolyRectangle.cpp */; };
+		6DFBF44112A3184E00C43A7D /* PolyRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39212A3184E00C43A7D /* PolyRenderer.cpp */; };
+		6DFBF44212A3184E00C43A7D /* PolyResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39312A3184E00C43A7D /* PolyResource.cpp */; };
+		6DFBF44312A3184E00C43A7D /* PolyResourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39412A3184E00C43A7D /* PolyResourceManager.cpp */; };
+		6DFBF44412A3184E00C43A7D /* PolyScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39512A3184E00C43A7D /* PolyScene.cpp */; };
+		6DFBF44512A3184E00C43A7D /* PolySceneEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39612A3184E00C43A7D /* PolySceneEntity.cpp */; };
+		6DFBF44612A3184E00C43A7D /* PolySceneLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39712A3184E00C43A7D /* PolySceneLabel.cpp */; };
+		6DFBF44712A3184E00C43A7D /* PolySceneLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39812A3184E00C43A7D /* PolySceneLight.cpp */; };
+		6DFBF44812A3184E00C43A7D /* PolySceneLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39912A3184E00C43A7D /* PolySceneLine.cpp */; };
+		6DFBF44912A3184E00C43A7D /* PolySceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39A12A3184E00C43A7D /* PolySceneManager.cpp */; };
+		6DFBF44A12A3184E00C43A7D /* PolySceneMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39B12A3184E00C43A7D /* PolySceneMesh.cpp */; };
+		6DFBF44B12A3184E00C43A7D /* PolyScenePrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39C12A3184E00C43A7D /* PolyScenePrimitive.cpp */; };
+		6DFBF44C12A3184E00C43A7D /* PolySceneRenderTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39D12A3184E00C43A7D /* PolySceneRenderTexture.cpp */; };
+		6DFBF44D12A3184E00C43A7D /* PolyScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39E12A3184E00C43A7D /* PolyScreen.cpp */; };
+		6DFBF44E12A3184E00C43A7D /* PolyScreenCurve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF39F12A3184E00C43A7D /* PolyScreenCurve.cpp */; };
+		6DFBF44F12A3184E00C43A7D /* PolyScreenEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A012A3184E00C43A7D /* PolyScreenEntity.cpp */; };
+		6DFBF45012A3184E00C43A7D /* PolyScreenEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A112A3184E00C43A7D /* PolyScreenEvent.cpp */; };
+		6DFBF45112A3184E00C43A7D /* PolyScreenImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */; };
+		6DFBF45212A3184E00C43A7D /* PolyScreenLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A312A3184E00C43A7D /* PolyScreenLabel.cpp */; };
+		6DFBF45312A3184E00C43A7D /* PolyScreenLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A412A3184E00C43A7D /* PolyScreenLine.cpp */; };
+		6DFBF45412A3184E00C43A7D /* PolyScreenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A512A3184E00C43A7D /* PolyScreenManager.cpp */; };
+		6DFBF45512A3184E00C43A7D /* PolyScreenMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A612A3184E00C43A7D /* PolyScreenMesh.cpp */; };
+		6DFBF45612A3184E00C43A7D /* PolyScreenShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A712A3184E00C43A7D /* PolyScreenShape.cpp */; };
+		6DFBF45712A3184E00C43A7D /* PolyScreenSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3A812A3184E00C43A7D /* PolyScreenSprite.cpp */; };
+		6DFBF45912A3184E00C43A7D /* PolyShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AA12A3184E00C43A7D /* PolyShader.cpp */; };
+		6DFBF45A12A3184E00C43A7D /* PolySkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AB12A3184E00C43A7D /* PolySkeleton.cpp */; };
+		6DFBF45B12A3184E00C43A7D /* PolySound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AC12A3184E00C43A7D /* PolySound.cpp */; };
+		6DFBF45C12A3184E00C43A7D /* PolySoundManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AD12A3184E00C43A7D /* PolySoundManager.cpp */; };
+		6DFBF45D12A3184E00C43A7D /* PolyTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AE12A3184E00C43A7D /* PolyTexture.cpp */; };
+		6DFBF45E12A3184E00C43A7D /* PolyTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3AF12A3184E00C43A7D /* PolyTimer.cpp */; };
+		6DFBF45F12A3184E00C43A7D /* PolyTimerManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B012A3184E00C43A7D /* PolyTimerManager.cpp */; };
+		6DFBF46012A3184E00C43A7D /* PolyTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B112A3184E00C43A7D /* PolyTween.cpp */; };
+		6DFBF46112A3184E00C43A7D /* PolyTweenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B212A3184E00C43A7D /* PolyTweenManager.cpp */; };
+		6DFBF46212A3184E00C43A7D /* PolyUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B312A3184E00C43A7D /* PolyUtil.cpp */; };
+		6DFBF46312A3184E00C43A7D /* PolyVector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B412A3184E00C43A7D /* PolyVector2.cpp */; };
+		6DFBF46412A3184E00C43A7D /* PolyVector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B512A3184E00C43A7D /* PolyVector3.cpp */; };
+		6DFBF46512A3184E00C43A7D /* PolyVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B612A3184E00C43A7D /* PolyVertex.cpp */; };
+		6DFBF46612A3184E00C43A7D /* PolySubstanceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B712A3184E00C43A7D /* PolySubstanceView.m */; };
+		6DFBF46712A3184E00C43A7D /* tinystr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B812A3184E00C43A7D /* tinystr.cpp */; };
+		6DFBF46812A3184E00C43A7D /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3B912A3184E00C43A7D /* tinyxml.cpp */; };
+		6DFBF46912A3184E00C43A7D /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3BA12A3184E00C43A7D /* tinyxmlerror.cpp */; };
+		6DFBF46A12A3184E00C43A7D /* tinyxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3BB12A3184E00C43A7D /* tinyxmlparser.cpp */; };
+		6DFBF46B12A3184E00C43A7D /* xmltest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF3BC12A3184E00C43A7D /* xmltest.cpp */; };
+		6DFBF77412A383AF00C43A7D /* physfs_byteorder.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF76D12A383AF00C43A7D /* physfs_byteorder.c */; };
+		6DFBF77512A383AF00C43A7D /* physfs_casefolding.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF76E12A383AF00C43A7D /* physfs_casefolding.h */; };
+		6DFBF77612A383AF00C43A7D /* physfs_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF76F12A383AF00C43A7D /* physfs_internal.h */; };
+		6DFBF77712A383AF00C43A7D /* physfs_platforms.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF77012A383AF00C43A7D /* physfs_platforms.h */; };
+		6DFBF77812A383AF00C43A7D /* physfs_unicode.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF77112A383AF00C43A7D /* physfs_unicode.c */; };
+		6DFBF77912A383AF00C43A7D /* physfs.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF77212A383AF00C43A7D /* physfs.c */; };
+		6DFBF77A12A383AF00C43A7D /* physfs.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DFBF77312A383AF00C43A7D /* physfs.h */; };
+		6DFBF78612A383DF00C43A7D /* macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF78512A383DF00C43A7D /* macosx.c */; };
+		6DFBF79D12A3840F00C43A7D /* dir.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79512A3840F00C43A7D /* dir.c */; };
+		6DFBF79E12A3840F00C43A7D /* grp.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79612A3840F00C43A7D /* grp.c */; };
+		6DFBF79F12A3840F00C43A7D /* hog.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79712A3840F00C43A7D /* hog.c */; };
+		6DFBF7A012A3840F00C43A7D /* lzma.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79812A3840F00C43A7D /* lzma.c */; };
+		6DFBF7A112A3840F00C43A7D /* mvl.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79912A3840F00C43A7D /* mvl.c */; };
+		6DFBF7A212A3840F00C43A7D /* qpak.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79A12A3840F00C43A7D /* qpak.c */; };
+		6DFBF7A312A3840F00C43A7D /* wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79B12A3840F00C43A7D /* wad.c */; };
+		6DFBF7A412A3840F00C43A7D /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF79C12A3840F00C43A7D /* zip.c */; };
+		6DFBF7B712A3846A00C43A7D /* posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF7B512A3846A00C43A7D /* posix.c */; };
+		6DFBF7B812A3846A00C43A7D /* unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 6DFBF7B612A3846A00C43A7D /* unix.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		6DFB016E12A73BC200C43A7D /* PolyModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyModule.h; sourceTree = "<group>"; };
+		6DFB017012A73BCF00C43A7D /* PolyModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyModule.cpp; sourceTree = "<group>"; };
+		6DFBF30D12A3184E00C43A7D /* OSBasics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSBasics.h; sourceTree = "<group>"; };
+		6DFBF30E12A3184E00C43A7D /* Poly_iPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Poly_iPhone.h; sourceTree = "<group>"; };
+		6DFBF30F12A3184E00C43A7D /* PolyAGLCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyAGLCore.h; sourceTree = "<group>"; };
+		6DFBF31012A3184E00C43A7D /* PolyBasics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyBasics.h; sourceTree = "<group>"; };
+		6DFBF31112A3184E00C43A7D /* PolyBezierCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyBezierCurve.h; sourceTree = "<group>"; };
+		6DFBF31212A3184E00C43A7D /* PolyBone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyBone.h; sourceTree = "<group>"; };
+		6DFBF31312A3184E00C43A7D /* PolyCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCamera.h; sourceTree = "<group>"; };
+		6DFBF31412A3184E00C43A7D /* PolyCocoaCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCocoaCore.h; sourceTree = "<group>"; };
+		6DFBF31512A3184E00C43A7D /* Polycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Polycode.h; sourceTree = "<group>"; };
+		6DFBF31612A3184E00C43A7D /* PolyColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyColor.h; sourceTree = "<group>"; };
+		6DFBF31712A3184E00C43A7D /* PolyConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyConfig.h; sourceTree = "<group>"; };
+		6DFBF31812A3184E00C43A7D /* PolyCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCore.h; sourceTree = "<group>"; };
+		6DFBF31912A3184E00C43A7D /* PolyCoreInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCoreInput.h; sourceTree = "<group>"; };
+		6DFBF31A12A3184E00C43A7D /* PolyCoreServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCoreServices.h; sourceTree = "<group>"; };
+		6DFBF31B12A3184E00C43A7D /* PolyCubemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCubemap.h; sourceTree = "<group>"; };
+		6DFBF31C12A3184E00C43A7D /* PolyEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyEntity.h; sourceTree = "<group>"; };
+		6DFBF31D12A3184E00C43A7D /* PolyEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyEvent.h; sourceTree = "<group>"; };
+		6DFBF31E12A3184E00C43A7D /* PolyEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyEventDispatcher.h; sourceTree = "<group>"; };
+		6DFBF31F12A3184E00C43A7D /* PolyEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyEventHandler.h; sourceTree = "<group>"; };
+		6DFBF32012A3184E00C43A7D /* PolyFixedShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyFixedShader.h; sourceTree = "<group>"; };
+		6DFBF32112A3184E00C43A7D /* PolyFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyFont.h; sourceTree = "<group>"; };
+		6DFBF32212A3184E00C43A7D /* PolyFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyFontManager.h; sourceTree = "<group>"; };
+		6DFBF32312A3184E00C43A7D /* PolyGenericScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGenericScene.h; sourceTree = "<group>"; };
+		6DFBF32412A3184E00C43A7D /* PolyGLCubemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLCubemap.h; sourceTree = "<group>"; };
+		6DFBF32512A3184E00C43A7D /* PolyGLES1Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLES1Renderer.h; sourceTree = "<group>"; };
+		6DFBF32612A3184E00C43A7D /* PolyGLES1Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLES1Texture.h; sourceTree = "<group>"; };
+		6DFBF32712A3184E00C43A7D /* PolyGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGlobals.h; sourceTree = "<group>"; };
+		6DFBF32812A3184E00C43A7D /* PolyGLRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLRenderer.h; sourceTree = "<group>"; };
+		6DFBF32912A3184E00C43A7D /* PolyGLTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLTexture.h; sourceTree = "<group>"; };
+		6DFBF32A12A3184E00C43A7D /* PolyGLVertexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyGLVertexBuffer.h; sourceTree = "<group>"; };
+		6DFBF32B12A3184E00C43A7D /* PolyImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyImage.h; sourceTree = "<group>"; };
+		6DFBF32C12A3184E00C43A7D /* PolyInputEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyInputEvent.h; sourceTree = "<group>"; };
+		6DFBF32D12A3184E00C43A7D /* PolyInputKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyInputKeys.h; sourceTree = "<group>"; };
+		6DFBF32E12A3184E00C43A7D /* PolyiPhoneCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyiPhoneCore.h; sourceTree = "<group>"; };
+		6DFBF32F12A3184E00C43A7D /* PolyLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyLabel.h; sourceTree = "<group>"; };
+		6DFBF33012A3184E00C43A7D /* PolyLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyLogger.h; sourceTree = "<group>"; };
+		6DFBF33112A3184E00C43A7D /* PolyLuaEventStuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyLuaEventStuff.h; sourceTree = "<group>"; };
+		6DFBF33212A3184E00C43A7D /* PolyMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyMaterial.h; sourceTree = "<group>"; };
+		6DFBF33312A3184E00C43A7D /* PolyMaterialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyMaterialManager.h; sourceTree = "<group>"; };
+		6DFBF33412A3184E00C43A7D /* PolyMatrix4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyMatrix4.h; sourceTree = "<group>"; };
+		6DFBF33512A3184E00C43A7D /* PolyMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyMesh.h; sourceTree = "<group>"; };
+		6DFBF33612A3184E00C43A7D /* PolyParticle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyParticle.h; sourceTree = "<group>"; };
+		6DFBF33712A3184E00C43A7D /* PolyParticleEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyParticleEmitter.h; sourceTree = "<group>"; };
+		6DFBF33812A3184E00C43A7D /* PolyPerlin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyPerlin.h; sourceTree = "<group>"; };
+		6DFBF33912A3184E00C43A7D /* PolyPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyPolygon.h; sourceTree = "<group>"; };
+		6DFBF33A12A3184E00C43A7D /* PolyQuaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyQuaternion.h; sourceTree = "<group>"; };
+		6DFBF33B12A3184E00C43A7D /* PolyQuaternionCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyQuaternionCurve.h; sourceTree = "<group>"; };
+		6DFBF33C12A3184E00C43A7D /* PolyRectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyRectangle.h; sourceTree = "<group>"; };
+		6DFBF33D12A3184E00C43A7D /* PolyRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyRenderer.h; sourceTree = "<group>"; };
+		6DFBF33E12A3184E00C43A7D /* PolyResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyResource.h; sourceTree = "<group>"; };
+		6DFBF33F12A3184E00C43A7D /* PolyResourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyResourceManager.h; sourceTree = "<group>"; };
+		6DFBF34012A3184E00C43A7D /* PolyScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScene.h; sourceTree = "<group>"; };
+		6DFBF34112A3184E00C43A7D /* PolySceneEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneEntity.h; sourceTree = "<group>"; };
+		6DFBF34212A3184E00C43A7D /* PolySceneLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneLabel.h; sourceTree = "<group>"; };
+		6DFBF34312A3184E00C43A7D /* PolySceneLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneLight.h; sourceTree = "<group>"; };
+		6DFBF34412A3184E00C43A7D /* PolySceneLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneLine.h; sourceTree = "<group>"; };
+		6DFBF34512A3184E00C43A7D /* PolySceneManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneManager.h; sourceTree = "<group>"; };
+		6DFBF34612A3184E00C43A7D /* PolySceneMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneMesh.h; sourceTree = "<group>"; };
+		6DFBF34712A3184E00C43A7D /* PolyScenePrimitive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScenePrimitive.h; sourceTree = "<group>"; };
+		6DFBF34812A3184E00C43A7D /* PolySceneRenderTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySceneRenderTexture.h; sourceTree = "<group>"; };
+		6DFBF34912A3184E00C43A7D /* PolyScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreen.h; sourceTree = "<group>"; };
+		6DFBF34A12A3184E00C43A7D /* PolyScreenCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenCurve.h; sourceTree = "<group>"; };
+		6DFBF34B12A3184E00C43A7D /* PolyScreenEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenEntity.h; sourceTree = "<group>"; };
+		6DFBF34C12A3184E00C43A7D /* PolyScreenEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenEvent.h; sourceTree = "<group>"; };
+		6DFBF34D12A3184E00C43A7D /* PolyScreenImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenImage.h; sourceTree = "<group>"; };
+		6DFBF34E12A3184E00C43A7D /* PolyScreenLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenLabel.h; sourceTree = "<group>"; };
+		6DFBF34F12A3184E00C43A7D /* PolyScreenLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenLine.h; sourceTree = "<group>"; };
+		6DFBF35012A3184E00C43A7D /* PolyScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenManager.h; sourceTree = "<group>"; };
+		6DFBF35112A3184E00C43A7D /* PolyScreenMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenMesh.h; sourceTree = "<group>"; };
+		6DFBF35212A3184E00C43A7D /* PolyScreenShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenShape.h; sourceTree = "<group>"; };
+		6DFBF35312A3184E00C43A7D /* PolyScreenSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyScreenSprite.h; sourceTree = "<group>"; };
+		6DFBF35412A3184E00C43A7D /* PolySDLCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySDLCore.h; sourceTree = "<group>"; };
+		6DFBF35512A3184E00C43A7D /* PolyShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyShader.h; sourceTree = "<group>"; };
+		6DFBF35612A3184E00C43A7D /* PolySkeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySkeleton.h; sourceTree = "<group>"; };
+		6DFBF35712A3184E00C43A7D /* PolySound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySound.h; sourceTree = "<group>"; };
+		6DFBF35812A3184E00C43A7D /* PolySoundManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySoundManager.h; sourceTree = "<group>"; };
+		6DFBF35912A3184E00C43A7D /* PolySubstanceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolySubstanceView.h; sourceTree = "<group>"; };
+		6DFBF35A12A3184E00C43A7D /* PolyTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyTexture.h; sourceTree = "<group>"; };
+		6DFBF35B12A3184E00C43A7D /* PolyThreaded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyThreaded.h; sourceTree = "<group>"; };
+		6DFBF35C12A3184E00C43A7D /* PolyTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyTimer.h; sourceTree = "<group>"; };
+		6DFBF35D12A3184E00C43A7D /* PolyTimerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyTimerManager.h; sourceTree = "<group>"; };
+		6DFBF35E12A3184E00C43A7D /* PolyTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyTween.h; sourceTree = "<group>"; };
+		6DFBF35F12A3184E00C43A7D /* PolyTweenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyTweenManager.h; sourceTree = "<group>"; };
+		6DFBF36012A3184E00C43A7D /* PolyUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyUtil.h; sourceTree = "<group>"; };
+		6DFBF36112A3184E00C43A7D /* PolyVector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyVector2.h; sourceTree = "<group>"; };
+		6DFBF36212A3184E00C43A7D /* PolyVector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyVector3.h; sourceTree = "<group>"; };
+		6DFBF36312A3184E00C43A7D /* PolyVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyVertex.h; sourceTree = "<group>"; };
+		6DFBF36412A3184E00C43A7D /* tinystr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinystr.h; sourceTree = "<group>"; };
+		6DFBF36512A3184E00C43A7D /* tinyxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml.h; sourceTree = "<group>"; };
+		6DFBF36712A3184E00C43A7D /* OSBasics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSBasics.cpp; sourceTree = "<group>"; };
+		6DFBF36812A3184E00C43A7D /* PolyAGLCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyAGLCore.cpp; sourceTree = "<group>"; };
+		6DFBF36912A3184E00C43A7D /* PolyBezierCurve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyBezierCurve.cpp; sourceTree = "<group>"; };
+		6DFBF36A12A3184E00C43A7D /* PolyBone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyBone.cpp; sourceTree = "<group>"; };
+		6DFBF36B12A3184E00C43A7D /* PolyCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyCamera.cpp; sourceTree = "<group>"; };
+		6DFBF36C12A3184E00C43A7D /* PolyCocoaCore.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = PolyCocoaCore.cpp; sourceTree = "<group>"; };
+		6DFBF36D12A3184E00C43A7D /* PolyColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyColor.cpp; sourceTree = "<group>"; };
+		6DFBF36E12A3184E00C43A7D /* PolyConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyConfig.cpp; sourceTree = "<group>"; };
+		6DFBF36F12A3184E00C43A7D /* PolyCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyCore.cpp; sourceTree = "<group>"; };
+		6DFBF37012A3184E00C43A7D /* PolyCoreInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyCoreInput.cpp; sourceTree = "<group>"; };
+		6DFBF37112A3184E00C43A7D /* PolyCoreServices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyCoreServices.cpp; sourceTree = "<group>"; };
+		6DFBF37212A3184E00C43A7D /* PolyCubemap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyCubemap.cpp; sourceTree = "<group>"; };
+		6DFBF37312A3184E00C43A7D /* PolyEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyEntity.cpp; sourceTree = "<group>"; };
+		6DFBF37412A3184E00C43A7D /* PolyEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyEvent.cpp; sourceTree = "<group>"; };
+		6DFBF37512A3184E00C43A7D /* PolyEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyEventDispatcher.cpp; sourceTree = "<group>"; };
+		6DFBF37612A3184E00C43A7D /* PolyEventHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyEventHandler.cpp; sourceTree = "<group>"; };
+		6DFBF37712A3184E00C43A7D /* PolyFixedShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyFixedShader.cpp; sourceTree = "<group>"; };
+		6DFBF37812A3184E00C43A7D /* PolyFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyFont.cpp; sourceTree = "<group>"; };
+		6DFBF37912A3184E00C43A7D /* PolyFontManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyFontManager.cpp; sourceTree = "<group>"; };
+		6DFBF37A12A3184E00C43A7D /* PolyGenericScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGenericScene.cpp; sourceTree = "<group>"; };
+		6DFBF37B12A3184E00C43A7D /* PolyGLCubemap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLCubemap.cpp; sourceTree = "<group>"; };
+		6DFBF37C12A3184E00C43A7D /* PolyGLES1Renderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLES1Renderer.cpp; sourceTree = "<group>"; };
+		6DFBF37D12A3184E00C43A7D /* PolyGLES1Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLES1Texture.cpp; sourceTree = "<group>"; };
+		6DFBF37E12A3184E00C43A7D /* PolyGLRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLRenderer.cpp; sourceTree = "<group>"; };
+		6DFBF37F12A3184E00C43A7D /* PolyGLTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLTexture.cpp; sourceTree = "<group>"; };
+		6DFBF38012A3184E00C43A7D /* PolyGLVertexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyGLVertexBuffer.cpp; sourceTree = "<group>"; };
+		6DFBF38112A3184E00C43A7D /* PolyImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyImage.cpp; sourceTree = "<group>"; };
+		6DFBF38212A3184E00C43A7D /* PolyInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyInputEvent.cpp; sourceTree = "<group>"; };
+		6DFBF38312A3184E00C43A7D /* PolyiPhoneCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyiPhoneCore.cpp; sourceTree = "<group>"; };
+		6DFBF38412A3184E00C43A7D /* PolyLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyLabel.cpp; sourceTree = "<group>"; };
+		6DFBF38512A3184E00C43A7D /* PolyLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyLogger.cpp; sourceTree = "<group>"; };
+		6DFBF38612A3184E00C43A7D /* PolyLuaEventStuff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyLuaEventStuff.cpp; sourceTree = "<group>"; };
+		6DFBF38712A3184E00C43A7D /* PolyMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyMaterial.cpp; sourceTree = "<group>"; };
+		6DFBF38812A3184E00C43A7D /* PolyMaterialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyMaterialManager.cpp; sourceTree = "<group>"; };
+		6DFBF38912A3184E00C43A7D /* PolyMatrix4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyMatrix4.cpp; sourceTree = "<group>"; };
+		6DFBF38A12A3184E00C43A7D /* PolyMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyMesh.cpp; sourceTree = "<group>"; };
+		6DFBF38B12A3184E00C43A7D /* PolyParticle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyParticle.cpp; sourceTree = "<group>"; };
+		6DFBF38C12A3184E00C43A7D /* PolyParticleEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyParticleEmitter.cpp; sourceTree = "<group>"; };
+		6DFBF38D12A3184E00C43A7D /* PolyPerlin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyPerlin.cpp; sourceTree = "<group>"; };
+		6DFBF38E12A3184E00C43A7D /* PolyPolygon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyPolygon.cpp; sourceTree = "<group>"; };
+		6DFBF38F12A3184E00C43A7D /* PolyQuaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyQuaternion.cpp; sourceTree = "<group>"; };
+		6DFBF39012A3184E00C43A7D /* PolyQuaternionCurve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyQuaternionCurve.cpp; sourceTree = "<group>"; };
+		6DFBF39112A3184E00C43A7D /* PolyRectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyRectangle.cpp; sourceTree = "<group>"; };
+		6DFBF39212A3184E00C43A7D /* PolyRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyRenderer.cpp; sourceTree = "<group>"; };
+		6DFBF39312A3184E00C43A7D /* PolyResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyResource.cpp; sourceTree = "<group>"; };
+		6DFBF39412A3184E00C43A7D /* PolyResourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyResourceManager.cpp; sourceTree = "<group>"; };
+		6DFBF39512A3184E00C43A7D /* PolyScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScene.cpp; sourceTree = "<group>"; };
+		6DFBF39612A3184E00C43A7D /* PolySceneEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneEntity.cpp; sourceTree = "<group>"; };
+		6DFBF39712A3184E00C43A7D /* PolySceneLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneLabel.cpp; sourceTree = "<group>"; };
+		6DFBF39812A3184E00C43A7D /* PolySceneLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneLight.cpp; sourceTree = "<group>"; };
+		6DFBF39912A3184E00C43A7D /* PolySceneLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneLine.cpp; sourceTree = "<group>"; };
+		6DFBF39A12A3184E00C43A7D /* PolySceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneManager.cpp; sourceTree = "<group>"; };
+		6DFBF39B12A3184E00C43A7D /* PolySceneMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneMesh.cpp; sourceTree = "<group>"; };
+		6DFBF39C12A3184E00C43A7D /* PolyScenePrimitive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScenePrimitive.cpp; sourceTree = "<group>"; };
+		6DFBF39D12A3184E00C43A7D /* PolySceneRenderTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySceneRenderTexture.cpp; sourceTree = "<group>"; };
+		6DFBF39E12A3184E00C43A7D /* PolyScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreen.cpp; sourceTree = "<group>"; };
+		6DFBF39F12A3184E00C43A7D /* PolyScreenCurve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenCurve.cpp; sourceTree = "<group>"; };
+		6DFBF3A012A3184E00C43A7D /* PolyScreenEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenEntity.cpp; sourceTree = "<group>"; };
+		6DFBF3A112A3184E00C43A7D /* PolyScreenEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenEvent.cpp; sourceTree = "<group>"; };
+		6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenImage.cpp; sourceTree = "<group>"; };
+		6DFBF3A312A3184E00C43A7D /* PolyScreenLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenLabel.cpp; sourceTree = "<group>"; };
+		6DFBF3A412A3184E00C43A7D /* PolyScreenLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenLine.cpp; sourceTree = "<group>"; };
+		6DFBF3A512A3184E00C43A7D /* PolyScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenManager.cpp; sourceTree = "<group>"; };
+		6DFBF3A612A3184E00C43A7D /* PolyScreenMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenMesh.cpp; sourceTree = "<group>"; };
+		6DFBF3A712A3184E00C43A7D /* PolyScreenShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenShape.cpp; sourceTree = "<group>"; };
+		6DFBF3A812A3184E00C43A7D /* PolyScreenSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyScreenSprite.cpp; sourceTree = "<group>"; };
+		6DFBF3A912A3184E00C43A7D /* PolySDLCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySDLCore.cpp; sourceTree = "<group>"; };
+		6DFBF3AA12A3184E00C43A7D /* PolyShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyShader.cpp; sourceTree = "<group>"; };
+		6DFBF3AB12A3184E00C43A7D /* PolySkeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySkeleton.cpp; sourceTree = "<group>"; };
+		6DFBF3AC12A3184E00C43A7D /* PolySound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySound.cpp; sourceTree = "<group>"; };
+		6DFBF3AD12A3184E00C43A7D /* PolySoundManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolySoundManager.cpp; sourceTree = "<group>"; };
+		6DFBF3AE12A3184E00C43A7D /* PolyTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyTexture.cpp; sourceTree = "<group>"; };
+		6DFBF3AF12A3184E00C43A7D /* PolyTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyTimer.cpp; sourceTree = "<group>"; };
+		6DFBF3B012A3184E00C43A7D /* PolyTimerManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyTimerManager.cpp; sourceTree = "<group>"; };
+		6DFBF3B112A3184E00C43A7D /* PolyTween.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyTween.cpp; sourceTree = "<group>"; };
+		6DFBF3B212A3184E00C43A7D /* PolyTweenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyTweenManager.cpp; sourceTree = "<group>"; };
+		6DFBF3B312A3184E00C43A7D /* PolyUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyUtil.cpp; sourceTree = "<group>"; };
+		6DFBF3B412A3184E00C43A7D /* PolyVector2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyVector2.cpp; sourceTree = "<group>"; };
+		6DFBF3B512A3184E00C43A7D /* PolyVector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyVector3.cpp; sourceTree = "<group>"; };
+		6DFBF3B612A3184E00C43A7D /* PolyVertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolyVertex.cpp; sourceTree = "<group>"; };
+		6DFBF3B712A3184E00C43A7D /* PolySubstanceView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = PolySubstanceView.m; sourceTree = "<group>"; };
+		6DFBF3B812A3184E00C43A7D /* tinystr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinystr.cpp; sourceTree = "<group>"; };
+		6DFBF3B912A3184E00C43A7D /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml.cpp; sourceTree = "<group>"; };
+		6DFBF3BA12A3184E00C43A7D /* tinyxmlerror.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlerror.cpp; sourceTree = "<group>"; };
+		6DFBF3BB12A3184E00C43A7D /* tinyxmlparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlparser.cpp; sourceTree = "<group>"; };
+		6DFBF3BC12A3184E00C43A7D /* xmltest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xmltest.cpp; sourceTree = "<group>"; };
+		6DFBF76D12A383AF00C43A7D /* physfs_byteorder.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = physfs_byteorder.c; path = ../../Dependencies/physfs/physfs_byteorder.c; sourceTree = SOURCE_ROOT; };
+		6DFBF76E12A383AF00C43A7D /* physfs_casefolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_casefolding.h; path = ../../Dependencies/physfs/physfs_casefolding.h; sourceTree = SOURCE_ROOT; };
+		6DFBF76F12A383AF00C43A7D /* physfs_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_internal.h; path = ../../Dependencies/physfs/physfs_internal.h; sourceTree = SOURCE_ROOT; };
+		6DFBF77012A383AF00C43A7D /* physfs_platforms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_platforms.h; path = ../../Dependencies/physfs/physfs_platforms.h; sourceTree = SOURCE_ROOT; };
+		6DFBF77112A383AF00C43A7D /* physfs_unicode.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = physfs_unicode.c; path = ../../Dependencies/physfs/physfs_unicode.c; sourceTree = SOURCE_ROOT; };
+		6DFBF77212A383AF00C43A7D /* physfs.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = physfs.c; path = ../../Dependencies/physfs/physfs.c; sourceTree = SOURCE_ROOT; };
+		6DFBF77312A383AF00C43A7D /* physfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs.h; path = ../../Dependencies/physfs/physfs.h; sourceTree = SOURCE_ROOT; };
+		6DFBF78512A383DF00C43A7D /* macosx.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = macosx.c; path = ../../Dependencies/physfs/platform/macosx.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79512A3840F00C43A7D /* dir.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dir.c; path = ../../Dependencies/physfs/archivers/dir.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79612A3840F00C43A7D /* grp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = grp.c; path = ../../Dependencies/physfs/archivers/grp.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79712A3840F00C43A7D /* hog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hog.c; path = ../../Dependencies/physfs/archivers/hog.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79812A3840F00C43A7D /* lzma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lzma.c; path = ../../Dependencies/physfs/archivers/lzma.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79912A3840F00C43A7D /* mvl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mvl.c; path = ../../Dependencies/physfs/archivers/mvl.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79A12A3840F00C43A7D /* qpak.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = qpak.c; path = ../../Dependencies/physfs/archivers/qpak.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79B12A3840F00C43A7D /* wad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wad.c; path = ../../Dependencies/physfs/archivers/wad.c; sourceTree = SOURCE_ROOT; };
+		6DFBF79C12A3840F00C43A7D /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = ../../Dependencies/physfs/archivers/zip.c; sourceTree = SOURCE_ROOT; };
+		6DFBF7B512A3846A00C43A7D /* posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = posix.c; path = ../../Dependencies/physfs/platform/posix.c; sourceTree = SOURCE_ROOT; };
+		6DFBF7B612A3846A00C43A7D /* unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unix.c; path = ../../Dependencies/physfs/platform/unix.c; sourceTree = SOURCE_ROOT; };
+		D2AAC046055464E500DB518D /* libPolyCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPolyCore.a; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		D289987405E68DCB004EDB86 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		08FB7794FE84155DC02AAC07 /* PolyCore */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF76C12A3839D00C43A7D /* physfs */,
+				08FB7795FE84155DC02AAC07 /* Source */,
+				C6A0FF2B0290797F04C91782 /* Documentation */,
+				1AB674ADFE9D54B511CA2CBB /* Products */,
+			);
+			name = PolyCore;
+			sourceTree = "<group>";
+		};
+		08FB7795FE84155DC02AAC07 /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF30A12A3184E00C43A7D /* Contents */,
+			);
+			name = Source;
+			sourceTree = "<group>";
+		};
+		1AB674ADFE9D54B511CA2CBB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				D2AAC046055464E500DB518D /* libPolyCore.a */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		6DFBF30A12A3184E00C43A7D /* Contents */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF30B12A3184E00C43A7D /* Include */,
+				6DFBF36612A3184E00C43A7D /* Source */,
+			);
+			name = Contents;
+			path = ../../Contents;
+			sourceTree = SOURCE_ROOT;
+		};
+		6DFBF30B12A3184E00C43A7D /* Include */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF30D12A3184E00C43A7D /* OSBasics.h */,
+				6DFBF30E12A3184E00C43A7D /* Poly_iPhone.h */,
+				6DFBF30F12A3184E00C43A7D /* PolyAGLCore.h */,
+				6DFBF31012A3184E00C43A7D /* PolyBasics.h */,
+				6DFBF31112A3184E00C43A7D /* PolyBezierCurve.h */,
+				6DFBF31212A3184E00C43A7D /* PolyBone.h */,
+				6DFBF31312A3184E00C43A7D /* PolyCamera.h */,
+				6DFBF31412A3184E00C43A7D /* PolyCocoaCore.h */,
+				6DFBF31512A3184E00C43A7D /* Polycode.h */,
+				6DFBF31612A3184E00C43A7D /* PolyColor.h */,
+				6DFBF31712A3184E00C43A7D /* PolyConfig.h */,
+				6DFBF31812A3184E00C43A7D /* PolyCore.h */,
+				6DFBF31912A3184E00C43A7D /* PolyCoreInput.h */,
+				6DFBF31A12A3184E00C43A7D /* PolyCoreServices.h */,
+				6DFBF31B12A3184E00C43A7D /* PolyCubemap.h */,
+				6DFBF31C12A3184E00C43A7D /* PolyEntity.h */,
+				6DFBF31D12A3184E00C43A7D /* PolyEvent.h */,
+				6DFBF31E12A3184E00C43A7D /* PolyEventDispatcher.h */,
+				6DFBF31F12A3184E00C43A7D /* PolyEventHandler.h */,
+				6DFBF32012A3184E00C43A7D /* PolyFixedShader.h */,
+				6DFBF32112A3184E00C43A7D /* PolyFont.h */,
+				6DFBF32212A3184E00C43A7D /* PolyFontManager.h */,
+				6DFBF32312A3184E00C43A7D /* PolyGenericScene.h */,
+				6DFBF32412A3184E00C43A7D /* PolyGLCubemap.h */,
+				6DFBF32512A3184E00C43A7D /* PolyGLES1Renderer.h */,
+				6DFBF32612A3184E00C43A7D /* PolyGLES1Texture.h */,
+				6DFBF32712A3184E00C43A7D /* PolyGlobals.h */,
+				6DFBF32812A3184E00C43A7D /* PolyGLRenderer.h */,
+				6DFBF32912A3184E00C43A7D /* PolyGLTexture.h */,
+				6DFBF32A12A3184E00C43A7D /* PolyGLVertexBuffer.h */,
+				6DFBF32B12A3184E00C43A7D /* PolyImage.h */,
+				6DFBF32C12A3184E00C43A7D /* PolyInputEvent.h */,
+				6DFBF32D12A3184E00C43A7D /* PolyInputKeys.h */,
+				6DFBF32E12A3184E00C43A7D /* PolyiPhoneCore.h */,
+				6DFBF32F12A3184E00C43A7D /* PolyLabel.h */,
+				6DFBF33012A3184E00C43A7D /* PolyLogger.h */,
+				6DFBF33112A3184E00C43A7D /* PolyLuaEventStuff.h */,
+				6DFBF33212A3184E00C43A7D /* PolyMaterial.h */,
+				6DFBF33312A3184E00C43A7D /* PolyMaterialManager.h */,
+				6DFBF33412A3184E00C43A7D /* PolyMatrix4.h */,
+				6DFBF33512A3184E00C43A7D /* PolyMesh.h */,
+				6DFBF33612A3184E00C43A7D /* PolyParticle.h */,
+				6DFBF33712A3184E00C43A7D /* PolyParticleEmitter.h */,
+				6DFBF33812A3184E00C43A7D /* PolyPerlin.h */,
+				6DFBF33912A3184E00C43A7D /* PolyPolygon.h */,
+				6DFBF33A12A3184E00C43A7D /* PolyQuaternion.h */,
+				6DFBF33B12A3184E00C43A7D /* PolyQuaternionCurve.h */,
+				6DFBF33C12A3184E00C43A7D /* PolyRectangle.h */,
+				6DFBF33D12A3184E00C43A7D /* PolyRenderer.h */,
+				6DFBF33E12A3184E00C43A7D /* PolyResource.h */,
+				6DFBF33F12A3184E00C43A7D /* PolyResourceManager.h */,
+				6DFBF34012A3184E00C43A7D /* PolyScene.h */,
+				6DFBF34112A3184E00C43A7D /* PolySceneEntity.h */,
+				6DFBF34212A3184E00C43A7D /* PolySceneLabel.h */,
+				6DFBF34312A3184E00C43A7D /* PolySceneLight.h */,
+				6DFBF34412A3184E00C43A7D /* PolySceneLine.h */,
+				6DFBF34512A3184E00C43A7D /* PolySceneManager.h */,
+				6DFBF34612A3184E00C43A7D /* PolySceneMesh.h */,
+				6DFBF34712A3184E00C43A7D /* PolyScenePrimitive.h */,
+				6DFBF34812A3184E00C43A7D /* PolySceneRenderTexture.h */,
+				6DFBF34912A3184E00C43A7D /* PolyScreen.h */,
+				6DFBF34A12A3184E00C43A7D /* PolyScreenCurve.h */,
+				6DFBF34B12A3184E00C43A7D /* PolyScreenEntity.h */,
+				6DFBF34C12A3184E00C43A7D /* PolyScreenEvent.h */,
+				6DFBF34D12A3184E00C43A7D /* PolyScreenImage.h */,
+				6DFBF34E12A3184E00C43A7D /* PolyScreenLabel.h */,
+				6DFBF34F12A3184E00C43A7D /* PolyScreenLine.h */,
+				6DFBF35012A3184E00C43A7D /* PolyScreenManager.h */,
+				6DFBF35112A3184E00C43A7D /* PolyScreenMesh.h */,
+				6DFBF35212A3184E00C43A7D /* PolyScreenShape.h */,
+				6DFBF35312A3184E00C43A7D /* PolyScreenSprite.h */,
+				6DFBF35412A3184E00C43A7D /* PolySDLCore.h */,
+				6DFBF35512A3184E00C43A7D /* PolyShader.h */,
+				6DFBF35612A3184E00C43A7D /* PolySkeleton.h */,
+				6DFBF35712A3184E00C43A7D /* PolySound.h */,
+				6DFBF35812A3184E00C43A7D /* PolySoundManager.h */,
+				6DFBF35912A3184E00C43A7D /* PolySubstanceView.h */,
+				6DFBF35A12A3184E00C43A7D /* PolyTexture.h */,
+				6DFBF35B12A3184E00C43A7D /* PolyThreaded.h */,
+				6DFBF35C12A3184E00C43A7D /* PolyTimer.h */,
+				6DFBF35D12A3184E00C43A7D /* PolyTimerManager.h */,
+				6DFBF35E12A3184E00C43A7D /* PolyTween.h */,
+				6DFBF35F12A3184E00C43A7D /* PolyTweenManager.h */,
+				6DFBF36012A3184E00C43A7D /* PolyUtil.h */,
+				6DFBF36112A3184E00C43A7D /* PolyVector2.h */,
+				6DFBF36212A3184E00C43A7D /* PolyVector3.h */,
+				6DFBF36312A3184E00C43A7D /* PolyVertex.h */,
+				6DFBF36412A3184E00C43A7D /* tinystr.h */,
+				6DFBF36512A3184E00C43A7D /* tinyxml.h */,
+				6DFB016E12A73BC200C43A7D /* PolyModule.h */,
+			);
+			path = Include;
+			sourceTree = "<group>";
+		};
+		6DFBF36612A3184E00C43A7D /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF36712A3184E00C43A7D /* OSBasics.cpp */,
+				6DFBF36812A3184E00C43A7D /* PolyAGLCore.cpp */,
+				6DFBF36912A3184E00C43A7D /* PolyBezierCurve.cpp */,
+				6DFBF36A12A3184E00C43A7D /* PolyBone.cpp */,
+				6DFBF36B12A3184E00C43A7D /* PolyCamera.cpp */,
+				6DFBF36C12A3184E00C43A7D /* PolyCocoaCore.cpp */,
+				6DFBF36D12A3184E00C43A7D /* PolyColor.cpp */,
+				6DFBF36E12A3184E00C43A7D /* PolyConfig.cpp */,
+				6DFBF36F12A3184E00C43A7D /* PolyCore.cpp */,
+				6DFBF37012A3184E00C43A7D /* PolyCoreInput.cpp */,
+				6DFBF37112A3184E00C43A7D /* PolyCoreServices.cpp */,
+				6DFBF37212A3184E00C43A7D /* PolyCubemap.cpp */,
+				6DFBF37312A3184E00C43A7D /* PolyEntity.cpp */,
+				6DFBF37412A3184E00C43A7D /* PolyEvent.cpp */,
+				6DFBF37512A3184E00C43A7D /* PolyEventDispatcher.cpp */,
+				6DFBF37612A3184E00C43A7D /* PolyEventHandler.cpp */,
+				6DFBF37712A3184E00C43A7D /* PolyFixedShader.cpp */,
+				6DFBF37812A3184E00C43A7D /* PolyFont.cpp */,
+				6DFBF37912A3184E00C43A7D /* PolyFontManager.cpp */,
+				6DFBF37A12A3184E00C43A7D /* PolyGenericScene.cpp */,
+				6DFBF37B12A3184E00C43A7D /* PolyGLCubemap.cpp */,
+				6DFBF37C12A3184E00C43A7D /* PolyGLES1Renderer.cpp */,
+				6DFBF37D12A3184E00C43A7D /* PolyGLES1Texture.cpp */,
+				6DFBF37E12A3184E00C43A7D /* PolyGLRenderer.cpp */,
+				6DFBF37F12A3184E00C43A7D /* PolyGLTexture.cpp */,
+				6DFBF38012A3184E00C43A7D /* PolyGLVertexBuffer.cpp */,
+				6DFBF38112A3184E00C43A7D /* PolyImage.cpp */,
+				6DFBF38212A3184E00C43A7D /* PolyInputEvent.cpp */,
+				6DFBF38312A3184E00C43A7D /* PolyiPhoneCore.cpp */,
+				6DFBF38412A3184E00C43A7D /* PolyLabel.cpp */,
+				6DFBF38512A3184E00C43A7D /* PolyLogger.cpp */,
+				6DFBF38612A3184E00C43A7D /* PolyLuaEventStuff.cpp */,
+				6DFBF38712A3184E00C43A7D /* PolyMaterial.cpp */,
+				6DFBF38812A3184E00C43A7D /* PolyMaterialManager.cpp */,
+				6DFBF38912A3184E00C43A7D /* PolyMatrix4.cpp */,
+				6DFBF38A12A3184E00C43A7D /* PolyMesh.cpp */,
+				6DFBF38B12A3184E00C43A7D /* PolyParticle.cpp */,
+				6DFBF38C12A3184E00C43A7D /* PolyParticleEmitter.cpp */,
+				6DFBF38D12A3184E00C43A7D /* PolyPerlin.cpp */,
+				6DFBF38E12A3184E00C43A7D /* PolyPolygon.cpp */,
+				6DFBF38F12A3184E00C43A7D /* PolyQuaternion.cpp */,
+				6DFBF39012A3184E00C43A7D /* PolyQuaternionCurve.cpp */,
+				6DFBF39112A3184E00C43A7D /* PolyRectangle.cpp */,
+				6DFBF39212A3184E00C43A7D /* PolyRenderer.cpp */,
+				6DFBF39312A3184E00C43A7D /* PolyResource.cpp */,
+				6DFBF39412A3184E00C43A7D /* PolyResourceManager.cpp */,
+				6DFBF39512A3184E00C43A7D /* PolyScene.cpp */,
+				6DFBF39612A3184E00C43A7D /* PolySceneEntity.cpp */,
+				6DFBF39712A3184E00C43A7D /* PolySceneLabel.cpp */,
+				6DFBF39812A3184E00C43A7D /* PolySceneLight.cpp */,
+				6DFBF39912A3184E00C43A7D /* PolySceneLine.cpp */,
+				6DFBF39A12A3184E00C43A7D /* PolySceneManager.cpp */,
+				6DFBF39B12A3184E00C43A7D /* PolySceneMesh.cpp */,
+				6DFBF39C12A3184E00C43A7D /* PolyScenePrimitive.cpp */,
+				6DFBF39D12A3184E00C43A7D /* PolySceneRenderTexture.cpp */,
+				6DFBF39E12A3184E00C43A7D /* PolyScreen.cpp */,
+				6DFBF39F12A3184E00C43A7D /* PolyScreenCurve.cpp */,
+				6DFBF3A012A3184E00C43A7D /* PolyScreenEntity.cpp */,
+				6DFBF3A112A3184E00C43A7D /* PolyScreenEvent.cpp */,
+				6DFBF3A212A3184E00C43A7D /* PolyScreenImage.cpp */,
+				6DFBF3A312A3184E00C43A7D /* PolyScreenLabel.cpp */,
+				6DFBF3A412A3184E00C43A7D /* PolyScreenLine.cpp */,
+				6DFBF3A512A3184E00C43A7D /* PolyScreenManager.cpp */,
+				6DFBF3A612A3184E00C43A7D /* PolyScreenMesh.cpp */,
+				6DFBF3A712A3184E00C43A7D /* PolyScreenShape.cpp */,
+				6DFBF3A812A3184E00C43A7D /* PolyScreenSprite.cpp */,
+				6DFBF3A912A3184E00C43A7D /* PolySDLCore.cpp */,
+				6DFBF3AA12A3184E00C43A7D /* PolyShader.cpp */,
+				6DFBF3AB12A3184E00C43A7D /* PolySkeleton.cpp */,
+				6DFBF3AC12A3184E00C43A7D /* PolySound.cpp */,
+				6DFBF3AD12A3184E00C43A7D /* PolySoundManager.cpp */,
+				6DFBF3AE12A3184E00C43A7D /* PolyTexture.cpp */,
+				6DFBF3AF12A3184E00C43A7D /* PolyTimer.cpp */,
+				6DFBF3B012A3184E00C43A7D /* PolyTimerManager.cpp */,
+				6DFBF3B112A3184E00C43A7D /* PolyTween.cpp */,
+				6DFBF3B212A3184E00C43A7D /* PolyTweenManager.cpp */,
+				6DFBF3B312A3184E00C43A7D /* PolyUtil.cpp */,
+				6DFBF3B412A3184E00C43A7D /* PolyVector2.cpp */,
+				6DFBF3B512A3184E00C43A7D /* PolyVector3.cpp */,
+				6DFBF3B612A3184E00C43A7D /* PolyVertex.cpp */,
+				6DFBF3B712A3184E00C43A7D /* PolySubstanceView.m */,
+				6DFBF3B812A3184E00C43A7D /* tinystr.cpp */,
+				6DFBF3B912A3184E00C43A7D /* tinyxml.cpp */,
+				6DFBF3BA12A3184E00C43A7D /* tinyxmlerror.cpp */,
+				6DFBF3BB12A3184E00C43A7D /* tinyxmlparser.cpp */,
+				6DFBF3BC12A3184E00C43A7D /* xmltest.cpp */,
+				6DFB017012A73BCF00C43A7D /* PolyModule.cpp */,
+			);
+			path = Source;
+			sourceTree = "<group>";
+		};
+		6DFBF76C12A3839D00C43A7D /* physfs */ = {
+			isa = PBXGroup;
+			children = (
+				6DFBF7B512A3846A00C43A7D /* posix.c */,
+				6DFBF7B612A3846A00C43A7D /* unix.c */,
+				6DFBF79512A3840F00C43A7D /* dir.c */,
+				6DFBF79612A3840F00C43A7D /* grp.c */,
+				6DFBF79712A3840F00C43A7D /* hog.c */,
+				6DFBF79812A3840F00C43A7D /* lzma.c */,
+				6DFBF79912A3840F00C43A7D /* mvl.c */,
+				6DFBF79A12A3840F00C43A7D /* qpak.c */,
+				6DFBF79B12A3840F00C43A7D /* wad.c */,
+				6DFBF79C12A3840F00C43A7D /* zip.c */,
+				6DFBF78512A383DF00C43A7D /* macosx.c */,
+				6DFBF76D12A383AF00C43A7D /* physfs_byteorder.c */,
+				6DFBF76E12A383AF00C43A7D /* physfs_casefolding.h */,
+				6DFBF76F12A383AF00C43A7D /* physfs_internal.h */,
+				6DFBF77012A383AF00C43A7D /* physfs_platforms.h */,
+				6DFBF77112A383AF00C43A7D /* physfs_unicode.c */,
+				6DFBF77212A383AF00C43A7D /* physfs.c */,
+				6DFBF77312A383AF00C43A7D /* physfs.h */,
+			);
+			name = physfs;
+			sourceTree = "<group>";
+		};
+		C6A0FF2B0290797F04C91782 /* Documentation */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			name = Documentation;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+		D2AAC043055464E500DB518D /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				6DFBF3BD12A3184E00C43A7D /* OSBasics.h in Headers */,
+				6DFBF3BE12A3184E00C43A7D /* Poly_iPhone.h in Headers */,
+				6DFBF3BF12A3184E00C43A7D /* PolyAGLCore.h in Headers */,
+				6DFBF3C012A3184E00C43A7D /* PolyBasics.h in Headers */,
+				6DFBF3C112A3184E00C43A7D /* PolyBezierCurve.h in Headers */,
+				6DFBF3C212A3184E00C43A7D /* PolyBone.h in Headers */,
+				6DFBF3C312A3184E00C43A7D /* PolyCamera.h in Headers */,
+				6DFBF3C412A3184E00C43A7D /* PolyCocoaCore.h in Headers */,
+				6DFBF3C512A3184E00C43A7D /* Polycode.h in Headers */,
+				6DFBF3C612A3184E00C43A7D /* PolyColor.h in Headers */,
+				6DFBF3C712A3184E00C43A7D /* PolyConfig.h in Headers */,
+				6DFBF3C812A3184E00C43A7D /* PolyCore.h in Headers */,
+				6DFBF3C912A3184E00C43A7D /* PolyCoreInput.h in Headers */,
+				6DFBF3CA12A3184E00C43A7D /* PolyCoreServices.h in Headers */,
+				6DFBF3CB12A3184E00C43A7D /* PolyCubemap.h in Headers */,
+				6DFBF3CC12A3184E00C43A7D /* PolyEntity.h in Headers */,
+				6DFBF3CD12A3184E00C43A7D /* PolyEvent.h in Headers */,
+				6DFBF3CE12A3184E00C43A7D /* PolyEventDispatcher.h in Headers */,
+				6DFBF3CF12A3184E00C43A7D /* PolyEventHandler.h in Headers */,
+				6DFBF3D012A3184E00C43A7D /* PolyFixedShader.h in Headers */,
+				6DFBF3D112A3184E00C43A7D /* PolyFont.h in Headers */,
+				6DFBF3D212A3184E00C43A7D /* PolyFontManager.h in Headers */,
+				6DFBF3D312A3184E00C43A7D /* PolyGenericScene.h in Headers */,
+				6DFBF3D412A3184E00C43A7D /* PolyGLCubemap.h in Headers */,
+				6DFBF3D512A3184E00C43A7D /* PolyGLES1Renderer.h in Headers */,
+				6DFBF3D612A3184E00C43A7D /* PolyGLES1Texture.h in Headers */,
+				6DFBF3D712A3184E00C43A7D /* PolyGlobals.h in Headers */,
+				6DFBF3D812A3184E00C43A7D /* PolyGLRenderer.h in Headers */,
+				6DFBF3D912A3184E00C43A7D /* PolyGLTexture.h in Headers */,
+				6DFBF3DA12A3184E00C43A7D /* PolyGLVertexBuffer.h in Headers */,
+				6DFBF3DB12A3184E00C43A7D /* PolyImage.h in Headers */,
+				6DFBF3DC12A3184E00C43A7D /* PolyInputEvent.h in Headers */,
+				6DFBF3DD12A3184E00C43A7D /* PolyInputKeys.h in Headers */,
+				6DFBF3DE12A3184E00C43A7D /* PolyiPhoneCore.h in Headers */,
+				6DFBF3DF12A3184E00C43A7D /* PolyLabel.h in Headers */,
+				6DFBF3E012A3184E00C43A7D /* PolyLogger.h in Headers */,
+				6DFBF3E112A3184E00C43A7D /* PolyLuaEventStuff.h in Headers */,
+				6DFBF3E212A3184E00C43A7D /* PolyMaterial.h in Headers */,
+				6DFBF3E312A3184E00C43A7D /* PolyMaterialManager.h in Headers */,
+				6DFBF3E412A3184E00C43A7D /* PolyMatrix4.h in Headers */,
+				6DFBF3E512A3184E00C43A7D /* PolyMesh.h in Headers */,
+				6DFBF3E612A3184E00C43A7D /* PolyParticle.h in Headers */,
+				6DFBF3E712A3184E00C43A7D /* PolyParticleEmitter.h in Headers */,
+				6DFBF3E812A3184E00C43A7D /* PolyPerlin.h in Headers */,
+				6DFBF3E912A3184E00C43A7D /* PolyPolygon.h in Headers */,
+				6DFBF3EA12A3184E00C43A7D /* PolyQuaternion.h in Headers */,
+				6DFBF3EB12A3184E00C43A7D /* PolyQuaternionCurve.h in Headers */,
+				6DFBF3EC12A3184E00C43A7D /* PolyRectangle.h in Headers */,
+				6DFBF3ED12A3184E00C43A7D /* PolyRenderer.h in Headers */,
+				6DFBF3EE12A3184E00C43A7D /* PolyResource.h in Headers */,
+				6DFBF3EF12A3184E00C43A7D /* PolyResourceManager.h in Headers */,
+				6DFBF3F012A3184E00C43A7D /* PolyScene.h in Headers */,
+				6DFBF3F112A3184E00C43A7D /* PolySceneEntity.h in Headers */,
+				6DFBF3F212A3184E00C43A7D /* PolySceneLabel.h in Headers */,
+				6DFBF3F312A3184E00C43A7D /* PolySceneLight.h in Headers */,
+				6DFBF3F412A3184E00C43A7D /* PolySceneLine.h in Headers */,
+				6DFBF3F512A3184E00C43A7D /* PolySceneManager.h in Headers */,
+				6DFBF3F612A3184E00C43A7D /* PolySceneMesh.h in Headers */,
+				6DFBF3F712A3184E00C43A7D /* PolyScenePrimitive.h in Headers */,
+				6DFBF3F812A3184E00C43A7D /* PolySceneRenderTexture.h in Headers */,
+				6DFBF3F912A3184E00C43A7D /* PolyScreen.h in Headers */,
+				6DFBF3FA12A3184E00C43A7D /* PolyScreenCurve.h in Headers */,
+				6DFBF3FB12A3184E00C43A7D /* PolyScreenEntity.h in Headers */,
+				6DFBF3FC12A3184E00C43A7D /* PolyScreenEvent.h in Headers */,
+				6DFBF3FD12A3184E00C43A7D /* PolyScreenImage.h in Headers */,
+				6DFBF3FE12A3184E00C43A7D /* PolyScreenLabel.h in Headers */,
+				6DFBF3FF12A3184E00C43A7D /* PolyScreenLine.h in Headers */,
+				6DFBF40012A3184E00C43A7D /* PolyScreenManager.h in Headers */,
+				6DFBF40112A3184E00C43A7D /* PolyScreenMesh.h in Headers */,
+				6DFBF40212A3184E00C43A7D /* PolyScreenShape.h in Headers */,
+				6DFBF40312A3184E00C43A7D /* PolyScreenSprite.h in Headers */,
+				6DFBF40412A3184E00C43A7D /* PolySDLCore.h in Headers */,
+				6DFBF40512A3184E00C43A7D /* PolyShader.h in Headers */,
+				6DFBF40612A3184E00C43A7D /* PolySkeleton.h in Headers */,
+				6DFBF40712A3184E00C43A7D /* PolySound.h in Headers */,
+				6DFBF40812A3184E00C43A7D /* PolySoundManager.h in Headers */,
+				6DFBF40912A3184E00C43A7D /* PolySubstanceView.h in Headers */,
+				6DFBF40A12A3184E00C43A7D /* PolyTexture.h in Headers */,
+				6DFBF40B12A3184E00C43A7D /* PolyThreaded.h in Headers */,
+				6DFBF40C12A3184E00C43A7D /* PolyTimer.h in Headers */,
+				6DFBF40D12A3184E00C43A7D /* PolyTimerManager.h in Headers */,
+				6DFBF40E12A3184E00C43A7D /* PolyTween.h in Headers */,
+				6DFBF40F12A3184E00C43A7D /* PolyTweenManager.h in Headers */,
+				6DFBF41012A3184E00C43A7D /* PolyUtil.h in Headers */,
+				6DFBF41112A3184E00C43A7D /* PolyVector2.h in Headers */,
+				6DFBF41212A3184E00C43A7D /* PolyVector3.h in Headers */,
+				6DFBF41312A3184E00C43A7D /* PolyVertex.h in Headers */,
+				6DFBF41412A3184E00C43A7D /* tinystr.h in Headers */,
+				6DFBF41512A3184E00C43A7D /* tinyxml.h in Headers */,
+				6DFBF77512A383AF00C43A7D /* physfs_casefolding.h in Headers */,
+				6DFBF77612A383AF00C43A7D /* physfs_internal.h in Headers */,
+				6DFBF77712A383AF00C43A7D /* physfs_platforms.h in Headers */,
+				6DFBF77A12A383AF00C43A7D /* physfs.h in Headers */,
+				6DFB016F12A73BC200C43A7D /* PolyModule.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+		D2AAC045055464E500DB518D /* PolyCore */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "PolyCore" */;
+			buildPhases = (
+				D2AAC043055464E500DB518D /* Headers */,
+				D2AAC044055464E500DB518D /* Sources */,
+				D289987405E68DCB004EDB86 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = PolyCore;
+			productName = PolyCore;
+			productReference = D2AAC046055464E500DB518D /* libPolyCore.a */;
+			productType = "com.apple.product-type.library.static";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		08FB7793FE84155DC02AAC07 /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "PolyCore" */;
+			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
+			hasScannedForEncodings = 1;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
+			mainGroup = 08FB7794FE84155DC02AAC07 /* PolyCore */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				D2AAC045055464E500DB518D /* PolyCore */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		D2AAC044055464E500DB518D /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				6DFBF41612A3184E00C43A7D /* OSBasics.cpp in Sources */,
+				6DFBF41812A3184E00C43A7D /* PolyBezierCurve.cpp in Sources */,
+				6DFBF41912A3184E00C43A7D /* PolyBone.cpp in Sources */,
+				6DFBF41A12A3184E00C43A7D /* PolyCamera.cpp in Sources */,
+				6DFBF41B12A3184E00C43A7D /* PolyCocoaCore.cpp in Sources */,
+				6DFBF41C12A3184E00C43A7D /* PolyColor.cpp in Sources */,
+				6DFBF41D12A3184E00C43A7D /* PolyConfig.cpp in Sources */,
+				6DFBF41E12A3184E00C43A7D /* PolyCore.cpp in Sources */,
+				6DFBF41F12A3184E00C43A7D /* PolyCoreInput.cpp in Sources */,
+				6DFBF42012A3184E00C43A7D /* PolyCoreServices.cpp in Sources */,
+				6DFBF42112A3184E00C43A7D /* PolyCubemap.cpp in Sources */,
+				6DFBF42212A3184E00C43A7D /* PolyEntity.cpp in Sources */,
+				6DFBF42312A3184E00C43A7D /* PolyEvent.cpp in Sources */,
+				6DFBF42412A3184E00C43A7D /* PolyEventDispatcher.cpp in Sources */,
+				6DFBF42512A3184E00C43A7D /* PolyEventHandler.cpp in Sources */,
+				6DFBF42612A3184E00C43A7D /* PolyFixedShader.cpp in Sources */,
+				6DFBF42712A3184E00C43A7D /* PolyFont.cpp in Sources */,
+				6DFBF42812A3184E00C43A7D /* PolyFontManager.cpp in Sources */,
+				6DFBF42912A3184E00C43A7D /* PolyGenericScene.cpp in Sources */,
+				6DFBF42A12A3184E00C43A7D /* PolyGLCubemap.cpp in Sources */,
+				6DFBF42D12A3184E00C43A7D /* PolyGLRenderer.cpp in Sources */,
+				6DFBF42E12A3184E00C43A7D /* PolyGLTexture.cpp in Sources */,
+				6DFBF42F12A3184E00C43A7D /* PolyGLVertexBuffer.cpp in Sources */,
+				6DFBF43012A3184E00C43A7D /* PolyImage.cpp in Sources */,
+				6DFBF43112A3184E00C43A7D /* PolyInputEvent.cpp in Sources */,
+				6DFBF43212A3184E00C43A7D /* PolyiPhoneCore.cpp in Sources */,
+				6DFBF43312A3184E00C43A7D /* PolyLabel.cpp in Sources */,
+				6DFBF43412A3184E00C43A7D /* PolyLogger.cpp in Sources */,
+				6DFBF43512A3184E00C43A7D /* PolyLuaEventStuff.cpp in Sources */,
+				6DFBF43612A3184E00C43A7D /* PolyMaterial.cpp in Sources */,
+				6DFBF43712A3184E00C43A7D /* PolyMaterialManager.cpp in Sources */,
+				6DFBF43812A3184E00C43A7D /* PolyMatrix4.cpp in Sources */,
+				6DFBF43912A3184E00C43A7D /* PolyMesh.cpp in Sources */,
+				6DFBF43A12A3184E00C43A7D /* PolyParticle.cpp in Sources */,
+				6DFBF43B12A3184E00C43A7D /* PolyParticleEmitter.cpp in Sources */,
+				6DFBF43C12A3184E00C43A7D /* PolyPerlin.cpp in Sources */,
+				6DFBF43D12A3184E00C43A7D /* PolyPolygon.cpp in Sources */,
+				6DFBF43E12A3184E00C43A7D /* PolyQuaternion.cpp in Sources */,
+				6DFBF43F12A3184E00C43A7D /* PolyQuaternionCurve.cpp in Sources */,
+				6DFBF44012A3184E00C43A7D /* PolyRectangle.cpp in Sources */,
+				6DFBF44112A3184E00C43A7D /* PolyRenderer.cpp in Sources */,
+				6DFBF44212A3184E00C43A7D /* PolyResource.cpp in Sources */,
+				6DFBF44312A3184E00C43A7D /* PolyResourceManager.cpp in Sources */,
+				6DFBF44412A3184E00C43A7D /* PolyScene.cpp in Sources */,
+				6DFBF44512A3184E00C43A7D /* PolySceneEntity.cpp in Sources */,
+				6DFBF44612A3184E00C43A7D /* PolySceneLabel.cpp in Sources */,
+				6DFBF44712A3184E00C43A7D /* PolySceneLight.cpp in Sources */,
+				6DFBF44812A3184E00C43A7D /* PolySceneLine.cpp in Sources */,
+				6DFBF44912A3184E00C43A7D /* PolySceneManager.cpp in Sources */,
+				6DFBF44A12A3184E00C43A7D /* PolySceneMesh.cpp in Sources */,
+				6DFBF44B12A3184E00C43A7D /* PolyScenePrimitive.cpp in Sources */,
+				6DFBF44C12A3184E00C43A7D /* PolySceneRenderTexture.cpp in Sources */,
+				6DFBF44D12A3184E00C43A7D /* PolyScreen.cpp in Sources */,
+				6DFBF44E12A3184E00C43A7D /* PolyScreenCurve.cpp in Sources */,
+				6DFBF44F12A3184E00C43A7D /* PolyScreenEntity.cpp in Sources */,
+				6DFBF45012A3184E00C43A7D /* PolyScreenEvent.cpp in Sources */,
+				6DFBF45112A3184E00C43A7D /* PolyScreenImage.cpp in Sources */,
+				6DFBF45212A3184E00C43A7D /* PolyScreenLabel.cpp in Sources */,
+				6DFBF45312A3184E00C43A7D /* PolyScreenLine.cpp in Sources */,
+				6DFBF45412A3184E00C43A7D /* PolyScreenManager.cpp in Sources */,
+				6DFBF45512A3184E00C43A7D /* PolyScreenMesh.cpp in Sources */,
+				6DFBF45612A3184E00C43A7D /* PolyScreenShape.cpp in Sources */,
+				6DFBF45712A3184E00C43A7D /* PolyScreenSprite.cpp in Sources */,
+				6DFBF45912A3184E00C43A7D /* PolyShader.cpp in Sources */,
+				6DFBF45A12A3184E00C43A7D /* PolySkeleton.cpp in Sources */,
+				6DFBF45B12A3184E00C43A7D /* PolySound.cpp in Sources */,
+				6DFBF45C12A3184E00C43A7D /* PolySoundManager.cpp in Sources */,
+				6DFBF45D12A3184E00C43A7D /* PolyTexture.cpp in Sources */,
+				6DFBF45E12A3184E00C43A7D /* PolyTimer.cpp in Sources */,
+				6DFBF45F12A3184E00C43A7D /* PolyTimerManager.cpp in Sources */,
+				6DFBF46012A3184E00C43A7D /* PolyTween.cpp in Sources */,
+				6DFBF46112A3184E00C43A7D /* PolyTweenManager.cpp in Sources */,
+				6DFBF46212A3184E00C43A7D /* PolyUtil.cpp in Sources */,
+				6DFBF46312A3184E00C43A7D /* PolyVector2.cpp in Sources */,
+				6DFBF46412A3184E00C43A7D /* PolyVector3.cpp in Sources */,
+				6DFBF46512A3184E00C43A7D /* PolyVertex.cpp in Sources */,
+				6DFBF46612A3184E00C43A7D /* PolySubstanceView.m in Sources */,
+				6DFBF46712A3184E00C43A7D /* tinystr.cpp in Sources */,
+				6DFBF46812A3184E00C43A7D /* tinyxml.cpp in Sources */,
+				6DFBF46912A3184E00C43A7D /* tinyxmlerror.cpp in Sources */,
+				6DFBF46A12A3184E00C43A7D /* tinyxmlparser.cpp in Sources */,
+				6DFBF46B12A3184E00C43A7D /* xmltest.cpp in Sources */,
+				6DFBF77412A383AF00C43A7D /* physfs_byteorder.c in Sources */,
+				6DFBF77812A383AF00C43A7D /* physfs_unicode.c in Sources */,
+				6DFBF77912A383AF00C43A7D /* physfs.c in Sources */,
+				6DFBF78612A383DF00C43A7D /* macosx.c in Sources */,
+				6DFBF79D12A3840F00C43A7D /* dir.c in Sources */,
+				6DFBF79E12A3840F00C43A7D /* grp.c in Sources */,
+				6DFBF79F12A3840F00C43A7D /* hog.c in Sources */,
+				6DFBF7A012A3840F00C43A7D /* lzma.c in Sources */,
+				6DFBF7A112A3840F00C43A7D /* mvl.c in Sources */,
+				6DFBF7A212A3840F00C43A7D /* qpak.c in Sources */,
+				6DFBF7A312A3840F00C43A7D /* wad.c in Sources */,
+				6DFBF7A412A3840F00C43A7D /* zip.c in Sources */,
+				6DFBF7B712A3846A00C43A7D /* posix.c in Sources */,
+				6DFBF7B812A3846A00C43A7D /* unix.c in Sources */,
+				6DFB017112A73BCF00C43A7D /* PolyModule.cpp in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		1DEB91EC08733DB70010E9CD /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = /usr/local/lib;
+				PRODUCT_NAME = PolyCore;
+			};
+			name = Debug;
+		};
+		1DEB91ED08733DB70010E9CD /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = /usr/local/lib;
+				PRODUCT_NAME = PolyCore;
+			};
+			name = Release;
+		};
+		1DEB91F008733DB70010E9CD /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				HEADER_SEARCH_PATHS = (
+					../../Dependencies/libvorbis/include,
+					../../Dependencies/libogg/include,
+					/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers,
+					../../Dependencies/freetype/include,
+					../../Dependencies/libpng,
+					../../Dependencies/physfs,
+				);
+				ONLY_ACTIVE_ARCH = YES;
+				PREBINDING = NO;
+				SDKROOT = macosx10.6;
+			};
+			name = Debug;
+		};
+		1DEB91F108733DB70010E9CD /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				PREBINDING = NO;
+				SDKROOT = macosx10.6;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "PolyCore" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				1DEB91EC08733DB70010E9CD /* Debug */,
+				1DEB91ED08733DB70010E9CD /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "PolyCore" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				1DEB91F008733DB70010E9CD /* Debug */,
+				1DEB91F108733DB70010E9CD /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}

+ 77 - 0
Core/Contents/Include/OSBasics.h

@@ -0,0 +1,77 @@
+/*
+ *  OSBasics.h
+ *  PolyStudio
+ *
+ *  Created by Ivan Safrin on 8/4/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package System
+
+#pragma once
+
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+
+#ifdef _WINDOWS
+	#include <windows.h>
+#else
+	#include <dirent.h> 
+	#include <sys/types.h>s
+	#include <sys/stat.h>
+#endif
+
+#include <vector>
+#include <string>
+#include "physfs.h"
+
+using namespace std;
+
+class _PolyExport OSFileEntry {
+	public:
+		OSFileEntry() {};
+		OSFileEntry(string path, string name, int type);
+		
+		string name;
+		string extension;
+		string nameWithoutExtension;
+		string basePath;
+		string fullPath;
+		int type;
+		
+		static const int TYPE_FILE = 0;
+		static const int TYPE_FOLDER = 1;
+};
+
+class _PolyExport OSFILE {
+public:
+	OSFILE(){}
+	
+	void debugDump();
+	
+	int fileType;
+	FILE *file;	
+	PHYSFS_file *physFSFile;
+	static const int TYPE_FILE = 0;
+	static const int TYPE_ARCHIVE_FILE = 1;	
+};
+
+class _PolyExport OSBasics {
+	public:
+	
+		static OSFILE *open(string filename, string opts);
+		static int close(OSFILE *file);
+		static size_t read( void * ptr, size_t size, size_t count, OSFILE * stream );	
+		static size_t write( const void * ptr, size_t size, size_t count, OSFILE * stream );
+		static int seek(OSFILE * stream, long int offset, int origin );
+		static long tell(OSFILE * stream);
+	
+		static vector<OSFileEntry> parsePhysFSFolder(string pathString, bool showHidden);
+		static vector<OSFileEntry> parseFolder(string pathString, bool showHidden);
+		static bool isFolder(string pathString);
+		static void createFolder(string pathString);
+		
+	private:
+	
+};

+ 86 - 0
Core/Contents/Include/PolyAGLCore.h

@@ -0,0 +1,86 @@
+/*
+ *  PolyAGLCore.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Core
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCore.h"
+#include "PolyRectangle.h"
+#include <vector>
+#include <OpenGL/gl.h>
+#include <OpenGL/OpenGL.h>
+#include "PolyGLRenderer.h"
+#include <AGL/agl.h>
+#include <AGL/aglRenderers.h>
+#include <mach/mach_time.h>
+
+using std::vector;
+
+namespace Polycode {
+	
+	class _PolyExport PosixMutex : public CoreMutex {
+	public:
+		pthread_mutex_t pMutex;
+	};
+	
+	class OSXEvent {
+	public:
+		int eventGroup;
+		int eventCode;
+		
+		int mouseX;
+		int mouseY;
+		
+		TAUKey keyCode;
+		wchar_t unicodeChar;
+		
+		char mouseButton;
+		
+		static const int INPUT_EVENT = 0;
+	};
+	
+	class _PolyExport AGLCore : public Core {
+		
+	public:
+		
+		AGLCore(WindowRef window, Polycode::Rectangle *clippingArea, int xRes, int yRes, bool fullScreen, int aaLevel, int frameRate);
+		virtual ~AGLCore();
+		
+		void enableMouse(bool newval);
+		unsigned int getTicks();		
+		bool Update();		
+		void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);		
+		void createThread(Threaded *target);		
+		
+		static pascal OSStatus coreEventHandler (EventHandlerCallRef next, EventRef event, void *data);	
+		
+		void lockMutex(CoreMutex *mutex);
+		void unlockMutex(CoreMutex *mutex);
+		CoreMutex *createMutex();		
+		
+		void checkEvents();
+		
+		vector<Rectangle> getVideoModes();
+		
+		int lastMouseY;
+		int lastMouseX;		
+		
+		CoreMutex *eventMutex;
+		
+		vector<OSXEvent> osxEvents;
+		
+	private:
+		
+		
+		uint64_t initTime;
+		WindowRef mainWindow;
+		AGLContext aglContext;	
+		
+	};
+}

+ 16 - 0
Core/Contents/Include/PolyBasics.h

@@ -0,0 +1,16 @@
+/*
+ *  PolyBasics.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#pragma once
+
+#ifndef NULL
+	#define NULL 0
+#endif
+
+#define PI 3.14159265

+ 68 - 0
Core/Contents/Include/PolyBezierCurve.h

@@ -0,0 +1,68 @@
+/*
+ *  PolyBezierCurve.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/5/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Math
+
+#pragma once 
+
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyVector3.h"
+#include <vector>
+
+using std::vector;
+
+#define BUFFER_CACHE_PRECISION 100
+
+namespace Polycode {
+
+	class _PolyExport BezierPoint {
+		public:
+		BezierPoint(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z);
+		Vector3 p1;
+		Vector3 p2;
+		Vector3 p3;
+	};
+	
+	class _PolyExport BezierCurve {
+		public:
+			BezierCurve();
+			~BezierCurve();
+
+		BezierPoint *getControlPoint(unsigned int index);
+		unsigned int getNumControlPoints();
+			
+		void addControlPoint(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z);
+
+		void addControlPoint3dWithHandles(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z);
+		void addControlPoint3d(float x, float y, float z);		
+		void addControlPoint2dWithHandles(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y);
+		void addControlPoint2d(float x, float y);
+		
+		float getHeightAt(float a);
+		
+		Vector3 getPointAt(float a);
+		inline Vector3 getPointBetween(float a, BezierPoint *bp1, BezierPoint *bp2);
+			
+		void rebuildBuffers();
+		
+		protected:
+		
+			bool buffersDirty;
+		
+			float heightBuffer[BUFFER_CACHE_PRECISION];
+		
+			void recalculateDistances();
+	
+			vector<BezierPoint*> controlPoints;
+			vector<float> distances;
+			
+	};
+
+}

+ 56 - 0
Core/Contents/Include/PolyBone.h

@@ -0,0 +1,56 @@
+/*
+ *  PolyBone.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/5/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolySceneEntity.h"
+#include "PolyMesh.h"
+#include "PolyFont.h"
+#include "PolyCoreServices.h"
+#include "PolySceneLabel.h"
+
+namespace Polycode {
+
+	class _PolyExport Bone : public SceneEntity {
+		public:
+			Bone(string boneName);
+			~Bone();
+			void enableBoneLabel(Font *font, float size, float scale);
+			string getName();
+			void Render();
+
+			void setParentBone(Bone *bone);
+			void addChildBone(Bone *bone);
+			Bone* getParentBone();
+			int getNumChildBones();
+			Bone *getChildBone(unsigned int index);
+
+			Matrix4 getBoneMatrix();
+			void setBoneMatrix(Matrix4 matrix);
+			Matrix4 getRestMatrix();
+			Matrix4 getFullRestMatrix();
+			Matrix4 getParentRestMatrix();
+			Matrix4 getFinalMatrix();
+			void setRestMatrix(Matrix4 matrix);
+
+			int parentBoneId;			
+		
+		protected:
+		
+			Matrix4 boneMatrix;
+			Matrix4 restMatrix;
+			Bone* parentBone;
+			vector<Bone*> childBones;
+			string boneName;
+			Mesh *boneMesh;
+	};
+
+}

+ 67 - 0
Core/Contents/Include/PolyCamera.h

@@ -0,0 +1,67 @@
+/*
+ *  PolyCamera.h
+ *  Polycode
+ *
+ *  Created by Ivan Safrin on 3/26/08.
+ *  Copyright 2008 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Scene
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolySceneEntity.h"
+#include "PolySceneRenderTexture.h"
+
+namespace Polycode {
+
+	class _PolyExport Camera : public SceneEntity {
+		public:
+			
+			Camera(Scene *parentScene);
+			~Camera();
+			
+			void buildFrustrumPlanes();
+			bool isSphereInFrustrum(Vector3 pos, float fRadius);
+		
+			bool canSee(SceneEntity *entity);
+			
+			void setOrthoMode(bool mode);
+			bool getOrthoMode();
+			void setFOV(float fov);
+			float getFOV();
+			void doCameraTransform();
+
+			void setLightDepthTexture(Texture *texture);
+			
+			void setParentScene(Scene *parentScene);
+			bool hasFilterShader();
+			void drawFilter();
+			
+			
+			void setExposureLevel(float level);
+			float getExposureLevel();
+			
+			void createPostFilter(Material *shaderMaterial);
+			void setPostFilter(string shaderName);
+			
+		private:
+		
+			float exposureLevel;
+			bool orthoMode;
+			float fov;
+			float frustumPlanes[6][4];
+			Scene *parentScene;
+		
+			bool fovSet;
+
+			Material *filterShaderMaterial;			
+			Texture *originalSceneTexture;			
+			Texture *zBufferSceneTexture;						
+			vector<ShaderBinding*> localShaderOptions;
+			bool _hasFilterShader;
+	};	
+}

+ 101 - 0
Core/Contents/Include/PolyCocoaCore.h

@@ -0,0 +1,101 @@
+/*
+ *  PolyCocoaCore.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/16/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Core
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCore.h"
+#include "PolyRectangle.h"
+#include <vector>
+#include <OpenGL/gl.h>
+#include <OpenGL/OpenGL.h>
+#include "PolyGLRenderer.h"
+#include <mach/mach_time.h>
+
+#import <Cocoa/Cocoa.h>
+
+using std::vector;
+
+@class SubstanceView;
+
+namespace Polycode {
+	
+	class _PolyExport PosixMutex : public CoreMutex {
+	public:
+		pthread_mutex_t pMutex;
+	};
+	
+	class CocoaEvent {
+	public:
+		int eventGroup;
+		int eventCode;
+		
+		int mouseX;
+		int mouseY;
+		
+		TAUKey keyCode;
+		wchar_t unicodeChar;
+		
+		char mouseButton;
+		
+		static const int INPUT_EVENT = 0;
+	};
+	
+	class _PolyExport CocoaCore : public Core {		
+	public:
+		
+		CocoaCore(SubstanceView *view, int xRes, int yRes, bool fullScreen, int aaLevel, int frameRate);
+		virtual ~CocoaCore();
+		
+		void enableMouse(bool newval);
+		unsigned int getTicks();		
+		bool Update();		
+		void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);		
+		void resizeTo(int xRes, int yRes);
+		void createThread(Threaded *target);		
+		
+		void createFolder(string folderPath);
+		void copyDiskItem(string itemPath, string destItemPath);
+		void moveDiskItem(string itemPath, string destItemPath);		
+		void removeDiskItem(string itemPath);		
+		string openFolderPicker();
+		vector<string> openFilePicker(vector<CoreFileExtension> extensions, bool allowMultiple);
+		
+		void setCursor(int cursorType);
+		
+		void copyStringToClipboard(wstring str);
+		wstring getClipboardString();		
+		
+//		static pascal OSStatus coreEventHandler (EventHandlerCallRef next, EventRef event, void *data);	
+		
+		void lockMutex(CoreMutex *mutex);
+		void unlockMutex(CoreMutex *mutex);
+		CoreMutex *createMutex();		
+		
+		void checkEvents();
+		
+		vector<Rectangle> getVideoModes();
+		
+		int lastMouseY;
+		int lastMouseX;		
+		
+		CoreMutex *eventMutex;
+		
+		vector<CocoaEvent> cocoaEvents;
+		
+		NSOpenGLContext *context;
+		
+	private:	
+		SubstanceView *glView;
+		
+		uint64_t initTime;		
+				
+	};
+}

+ 57 - 0
Core/Contents/Include/PolyColor.h

@@ -0,0 +1,57 @@
+/*
+ *  PolyColor.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/16/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <stdlib.h>
+ 
+namespace Polycode {
+
+	class _PolyExport Color {
+		public:
+
+			Color();
+			Color(int r,int g, int b, int a);		
+			Color(float r,float g, float b, float a);
+			Color(Color *color);
+			Color(unsigned int hex);
+		
+			~Color();
+			
+			inline Color operator * ( const Color& v2)  {
+				float nr = r * v2.r;
+				float ng = g * v2.g;
+				float nb = b * v2.b;
+				float na = a * v2.a;				
+				return Color(nr, ng, nb, na);
+			}			
+			
+			void setColorHex(unsigned int hex);
+			void setColorHSV(float h, float s, float v);
+			void setColorRGBA(int r, int g, int b, int a);
+			void setColorRGB(int r, int g, int b);
+			void setColor(float r, float g, float b, float a);
+			void setColor(Color *color);
+			void Random();
+		
+			float getBrightness();
+			
+			unsigned int getUint();
+			
+			float r;
+			float g;
+			float b;
+			float a;
+		private:
+	
+	};
+
+}

+ 55 - 0
Core/Contents/Include/PolyConfig.h

@@ -0,0 +1,55 @@
+/*
+ *  PolyConfig.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 4/15/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Services
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include <string>
+#include <vector>
+#include "tinyxml.h"
+#include "PolyUtil.h"
+
+using std::string;
+using std::vector;
+
+namespace Polycode {
+
+	class ConfigEntry {
+	public:
+		string key;
+		string configNamespace;
+		float numVal;
+		string stringVal;
+		bool isString;
+	};
+	
+	class _PolyExport Config {
+	public:
+		Config();
+		~Config();		
+
+		void loadConfig(string configNamespace, string fileName);	
+		void saveConfig(string configNamespace, string fileName);
+		
+		ConfigEntry *getEntry(string configNamespace, string key);
+		
+		void setStringValue(string configNamespace, string key, string value);
+		void setNumericValue(string configNamespace, string key, float value);		
+			
+		float getNumericValue(string configNamespace, string key);
+		string getStringValue(string configNamespace, string key);
+		
+	private:
+		
+		vector<ConfigEntry*> entries;
+		
+	};
+}

+ 145 - 0
Core/Contents/Include/PolyCore.h

@@ -0,0 +1,145 @@
+/*
+ *  PolyCore.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Core
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolyThreaded.h"
+#include "PolyCoreInput.h"
+//#include "PolyGLRenderer.h"
+#include "PolyMaterialManager.h"
+#include "PolyCoreServices.h"
+#include "PolyRectangle.h"
+#include <vector>
+#include <string>
+
+#define CURSOR_ARROW 0
+#define CURSOR_TEXT 1
+#define CURSOR_POINTER 2
+#define CURSOR_CROSSHAIR 3
+#define CURSOR_RESIZE_LEFT_RIGHT 4
+#define CURSOR_RESIZE_UP_DOWN 5
+
+using std::vector;
+using std::wstring;
+
+long getThreadID();
+
+namespace Polycode {
+
+	class CoreServices;
+
+	class _PolyExport CoreMutex {
+	public:
+		int mutexID;
+	};
+	
+	class _PolyExport CoreFileExtension {
+	public:
+		string extension;
+		string description;
+	};
+	
+	class _PolyExport Core : public EventDispatcher {
+
+	public:
+		Core(int xRes, int yRes, bool fullScreen, int aaLevel, int frameRate);
+		virtual ~Core();
+		
+		virtual bool Update() = 0;
+		virtual unsigned int getTicks() = 0;
+		virtual void enableMouse(bool newval);
+		
+		virtual void setCursor(int cursorType) = 0;
+		
+		virtual void createThread(Threaded *target) = 0;
+
+		virtual void lockMutex(CoreMutex *mutex) = 0;
+		virtual void unlockMutex(CoreMutex *mutex) = 0;
+		virtual CoreMutex *createMutex() = 0;
+		
+		virtual void copyStringToClipboard(wstring str) = 0;
+		virtual wstring getClipboardString() = 0;
+		
+		CoreServices *getServices();
+		float getFPS();
+		void Shutdown();
+		
+		bool isFullscreen(){ return fullScreen; }
+		int getAALevel() { return aaLevel; }
+				
+		CoreInput *getInput();
+		float getXRes();
+		float getYRes();
+		
+		int getNumVideoModes();
+		virtual vector<Rectangle> getVideoModes() = 0;
+		
+		
+		virtual void createFolder(string folderPath) = 0;
+		virtual void copyDiskItem(string itemPath, string destItemPath) = 0;		
+		virtual void moveDiskItem(string itemPath, string destItemPath) = 0;		
+		virtual void removeDiskItem(string itemPath) = 0;
+
+		virtual string openFolderPicker() = 0;
+		virtual vector<string> openFilePicker(vector<CoreFileExtension> extensions, bool allowMultiple) = 0;
+		
+		void setVideoModeIndex(int index, bool fullScreen, int aaLevel);
+		virtual void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel) = 0;
+		virtual void resizeTo(int xRes, int yRes) = 0;
+		
+		void doSleep();
+		
+		float getElapsed();	
+		float getTicksFloat();
+		
+		void setUserPointer(void *ptr) { userPointer = ptr; }
+		void *getUserPointer() { return userPointer; }
+		
+		static const int EVENT_CORE_RESIZE = 0;		
+		
+	protected:
+		
+		void *userPointer;
+		
+		long refreshInterval;
+		
+		bool fullScreen;
+		int aaLevel;
+	
+		vector<Vector2>	videoModes;
+		void updateCore();
+
+		int numVideoModes;
+		
+		bool running;
+		float fps;
+		unsigned int frameTicks;
+		unsigned int lastFrameTicks;
+		unsigned int lastFPSTicks;
+		unsigned int elapsed;
+		
+		bool mouseEnabled;
+		
+		unsigned int lastSleepFrameTicks;
+		
+		int xRes;
+		int yRes;		
+		
+		int frames;
+		
+		CoreInput *input;
+		Renderer *renderer;
+		CoreServices *services;
+	};
+	
+}

+ 60 - 0
Core/Contents/Include/PolyCoreInput.h

@@ -0,0 +1,60 @@
+/*
+ *  PolyCoreInput.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/27/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Core
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyVector2.h"
+#include "PolyEventDispatcher.h"
+#include "PolyInputEvent.h"
+#include "PolyInputKeys.h"
+
+namespace Polycode {
+	
+	class _PolyExport CoreInput : public EventDispatcher {
+		
+		friend class PolyCore;
+		
+	public:
+		
+		CoreInput();
+		~CoreInput();
+		
+		static const int MOUSE_BUTTON1 = 0;
+		static const int MOUSE_BUTTON2 = 1;
+		static const int MOUSE_BUTTON3 = 2;
+		
+		
+		void mouseWheelUp(int ticks);
+		void mouseWheelDown(int ticks);
+		bool getMouseButtonState(int mouseButton);		
+		void setMouseButtonState(int mouseButton, bool state, int ticks);
+		void setMousePosition(int x, int y, int ticks);
+		Vector2 getMousePosition();
+		void setKeyState(TAUKey keyCode, wchar_t code, bool newState, int ticks);
+
+		bool getKeyState(TAUKey keyCode);
+		
+		Vector2 getMouseDelta();
+		void setDeltaPosition(int x, int y);
+		
+		
+		
+		static InputEvent *createEvent(Event *event){ return (InputEvent*)event; }
+		
+	protected:
+		
+		bool keyboardState[512];
+		bool mouseButtons[3];
+		Vector2 mousePosition;
+		Vector2 deltaMousePosition;
+	};
+	
+}

+ 97 - 0
Core/Contents/Include/PolyCoreServices.h

@@ -0,0 +1,97 @@
+/*
+ *  CoreServices.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Services
+ 
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolyMaterialManager.h"
+#include "PolyScreenManager.h"
+#include "PolySceneManager.h"
+#include "PolyTimerManager.h"
+#include "PolyFontManager.h"
+#include "PolyTweenManager.h"
+#include "PolySoundManager.h"
+#include "PolyResourceManager.h"
+#include "PolyCore.h"
+#include "PolyConfig.h"
+#include "PolyModule.h"
+#include "PolyBasics.h"
+
+#include <map>
+
+namespace Polycode {
+
+	class Renderer;
+	class MaterialManager;
+	class SceneManager;
+	class ScreenManager;
+	class TimerManager;
+	class TweenManager;
+	class ResourceManager;
+	class SoundManager;
+	class Core;
+	class CoreMutex;
+	
+	class _PolyExport CoreServices : public EventDispatcher {
+		public:
+			static CoreServices *getInstance();		
+			static CoreMutex *getRenderMutex();
+			
+			void setRenderer(Renderer *renderer);
+			
+			Renderer *getRenderer();
+			void Update(int elapsed);
+			
+			void setCore(Core *core);
+			Core *getCore();
+			
+			void handleEvent(Event *event);
+		
+			void installModule(PolycodeModule *module);
+			
+			MaterialManager *getMaterialManager();
+			ScreenManager *getScreenManager();
+			SceneManager *getSceneManager();
+			TimerManager *getTimerManager();
+			TweenManager *getTweenManager();
+			ResourceManager *getResourceManager();
+			SoundManager *getSoundManager();
+			FontManager *getFontManager();
+		
+			Config *getConfig();
+		
+			~CoreServices();
+		
+		protected:
+		
+			CoreServices();
+					
+		private:
+		
+			static std::map <long, CoreServices*> instanceMap;
+			static CoreMutex *renderMutex;
+		
+			vector<PolycodeModule*> modules;
+		
+			Core *core;
+			Config *config;
+			MaterialManager *materialManager;
+			ScreenManager *screenManager;		
+			SceneManager *sceneManager;
+			TimerManager *timerManager;
+			TweenManager *tweenManager;
+			ResourceManager *resourceManager;
+			SoundManager *soundManager;
+			FontManager *fontManager;
+			Renderer *renderer;
+	};
+}

+ 27 - 0
Core/Contents/Include/PolyCubemap.h

@@ -0,0 +1,27 @@
+/*
+ *  PolyCubemap.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/9/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Materials
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyResource.h"
+#include "PolyTexture.h"
+
+namespace Polycode {
+	
+	class _PolyExport Cubemap : public Resource {
+		public:
+			Cubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
+			~Cubemap();	
+		
+		protected:		
+		
+	};
+}

+ 188 - 0
Core/Contents/Include/PolyEntity.h

@@ -0,0 +1,188 @@
+/*
+ *  PolyEntity.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 1/18/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package BasicTypes
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyMatrix4.h"
+#include "PolyQuaternion.h"
+#include "PolyColor.h"
+#include "PolyRenderer.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+	
+	
+	class _PolyExport EntityProp {
+	public:
+		string propName;
+		string propValue;		
+	};	
+
+	class _PolyExport Entity {
+		public:
+			Entity();
+			~Entity();
+
+			virtual void Render(){};
+			virtual void Update(){};
+			virtual void transformAndRender();		
+		
+			void setMatrix(Matrix4 matrix);
+			void rebuildTransformMatrix();
+		
+			void addEntity(Entity *newChild);
+			void addChild(Entity *newChild);
+			void removeChild(Entity *entityToRemove);
+		
+			void updateEntityMatrix();
+			void renderChildren();		
+
+			Vector3 *getPosition();
+			void setPosition(float x, float y, float z);
+			
+			void setPositionX(float x);
+			void setPositionY(float y);
+			void setPositionZ(float z);
+
+			void setScaleX(float x);
+			void setScaleY(float y);
+			void setScaleZ(float z);
+		
+		
+			void setPosition(Vector3 posVec);
+		
+			void Translate(float x, float y, float z);
+			void Translate(Vector3 tVec);
+			void Scale(float x, float y, float z);
+			void setScale(float x, float y, float z);
+			Vector3 getScale();		
+		
+			Vector3 getCombinedPosition();
+			float getCombinedPitch();
+			float getCombinedYaw();
+			float getCombinedRoll();
+			void setParentEntity(Entity *entity);
+			Entity *getParentEntity();
+			void rebuildRotation();
+			void dirtyMatrix(bool val);
+		
+			void setPitch(float pitch);
+			void setYaw(float yaw);
+			void setRoll(float roll);
+			void Roll(float roll);
+			void Yaw(float roll);
+			void Pitch(float roll);
+			float getPitch();
+			float getYaw();
+			float getRoll();
+		
+			void setRotationQuat(float w, float x, float y, float z);
+			Quaternion getRotationQuat();
+		
+			Matrix4 getTransformMatrix();
+			Matrix4 getConcatenatedMatrix();		
+			Matrix4 getConcatenatedRollMatrix();		
+		
+			void setTransformByMatrix(Matrix4 matrix);	
+		
+			void setRenderer(Renderer *renderer);
+			
+			Color getCombinedColor();
+			void setColor(float r, float g, float b, float a);
+			void setColorInt(int r, int g, int b, int a);	
+			void setColor(Color color);
+		
+			void recalculateBBox();
+			float getBBoxRadius();
+			float getCompoundBBoxRadius();
+			void setBBoxRadius(float rad);			
+			void setBlendingMode(int newBlendingMode);		
+			Vector3 getChildCenter();
+		
+			void setDepthWrite(bool val);
+		
+			void doUpdates();
+		
+			void lookAt(const Vector3 &loc, const Vector3 &upVector = Vector3(0,1,0));
+			void lookAtEntity(Entity *entity, const Vector3 &upVector = Vector3(0,1,0));		
+			Matrix4 getLookAtMatrix(const Vector3 &loc, const Vector3 &upVector = Vector3(0,1,0));
+		
+			virtual Matrix4 buildPositionMatrix();
+			virtual void adjustMatrixForChildren(){}
+			
+			void setMask(Entity *mask);
+			void clearMask();
+		
+			Vector3 getCompoundScale();
+		
+			string custEntityType;
+			vector <EntityProp> entityProps;				
+		
+			string getEntityProp(string propName);
+		
+			Vector3 bBox;
+			bool billboardMode;			
+			bool billboardRoll;
+			bool alphaTest;
+			bool backfaceCulled;	
+		
+			bool renderWireframe;
+		
+			Color color;
+			bool enabled;
+			bool visible;
+		
+			bool colorAffectsChildren;		
+			bool depthOnly;
+		
+			// deprecated, remove!
+			bool maskByZbuffer;
+		
+			bool isMask;
+		
+		protected:
+			vector<Entity*> children;
+
+			int blendingMode;
+			Vector3 childCenter;
+			float bBoxRadius;		
+		
+			Vector3 position;
+			Vector3 scale;		
+		
+			bool hasMask;
+		
+			bool lockMatrix;
+			bool matrixDirty;
+			Matrix4 transformMatrix;
+		
+			float matrixAdj;
+			float pitch;
+			float yaw;			
+			float roll;
+		
+			Entity *parentEntity;
+		
+			Quaternion qYaw;
+			Quaternion qPitch;
+			Quaternion qRoll;			
+			Quaternion rotationQuat;	
+		
+			Entity *maskEntity;
+		
+			bool depthWrite;		
+		
+			Renderer *renderer;
+	};
+}

+ 43 - 0
Core/Contents/Include/PolyEvent.h

@@ -0,0 +1,43 @@
+/*
+ *  PolyEvent.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/28/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Events
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <string>
+
+using std::string;
+
+namespace Polycode {
+
+	class EventDispatcher;
+	class _PolyExport Event {
+		public:
+			Event();
+			Event(int eventCode);
+			~Event();
+			
+			int getEventCode();
+			void setEventCode(int eventCode);
+			EventDispatcher *getDispatcher();
+			void setDispatcher(EventDispatcher *dispatcher);
+			string getEventType();
+			
+			static const int COMPLETE_EVENT = 0;
+			static const int CHANGE_EVENT = 1;
+						
+		protected:
+			
+			string eventType;
+			EventDispatcher *dispatcher;
+			int eventCode;
+			
+	};
+}

+ 47 - 0
Core/Contents/Include/PolyEventDispatcher.h

@@ -0,0 +1,47 @@
+/*
+ *  PolyEventDispatcher.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/28/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Events
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyEventHandler.h"
+#include "PolyEvent.h"
+#include <vector>
+
+using std::vector;
+
+
+namespace Polycode {
+
+
+typedef struct {
+	EventHandler *handler;
+	int eventCode;
+} EventEntry;
+
+	class _PolyExport EventDispatcher : public EventHandler {
+		public:
+			EventDispatcher();
+			virtual ~EventDispatcher();
+			
+			void removeAllHandlers();
+			void removeAllHandlersForListener(void *listener);
+			void addEventListener(EventHandler *handler, int eventCode);
+			void removeEventListener(EventHandler *handler, int eventCode);
+			void __dispatchEvent(Event *event, int eventCode);		
+			void dispatchEvent(Event *event, int eventCode);
+			void dispatchEventNoDelete(Event *event, int eventCode);
+		
+		protected:
+	
+		vector<EventEntry> handlerEntries;
+	
+	};
+}

+ 38 - 0
Core/Contents/Include/PolyEventHandler.h

@@ -0,0 +1,38 @@
+/*
+ *  PolyEventHandler.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/28/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Events
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyEvent.h"
+
+//#ifdef _COMPILE_LUA
+#include "PolyLuaEventStuff.h"
+//#endif
+
+namespace Polycode {
+
+	class _PolyExport EventHandler {
+		public:
+			EventHandler();
+			~EventHandler();
+
+#ifdef _COMPILE_LUA
+		SWIGLUA_REF onEvent;
+#endif
+
+		void secondaryHandler(Event *event);		
+		virtual void handleEvent(Event *event){}
+			
+		private:
+	
+	};
+}

+ 48 - 0
Core/Contents/Include/PolyFixedShader.h

@@ -0,0 +1,48 @@
+/*
+ *  PolyFixedShader.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/20/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Materials
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyShader.h"
+#include "PolyTexture.h"
+
+namespace Polycode {
+
+	class _PolyExport FixedShader : public Shader {
+		public:
+			FixedShader();
+			~FixedShader();
+			
+			ShaderBinding *createBinding();
+
+		protected:
+			
+	};
+
+	class _PolyExport FixedShaderBinding : public ShaderBinding {
+		public:
+			FixedShaderBinding(FixedShader *shader);
+			~FixedShaderBinding();
+			
+			void addTexture(string name, Texture *texture); 
+			void addCubemap(string name, Cubemap *cubemap);		
+			void addParam(string type, string name, string value);
+			
+			Texture *getDiffuseTexture();
+			
+		protected:
+
+			vector<Texture*> textures;
+			vector<Cubemap*> cubemaps;		
+			FixedShader *fixedShader;
+	};
+
+}

+ 35 - 0
Core/Contents/Include/PolyFont.h

@@ -0,0 +1,35 @@
+/*
+ *  PolyFont.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/16/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <string>
+#include "ft2build.h"
+#include FT_FREETYPE_H
+#include "OSBasics.h"
+
+using namespace std;
+
+namespace Polycode {
+	
+	class _PolyExport Font {
+		public:
+			Font(string fileName);
+			~Font();
+			
+			FT_Face getFace();
+			bool isValid();
+		private:
+			unsigned char *buffer;
+			bool valid;
+			FT_Face ftFace;
+	};
+}

+ 44 - 0
Core/Contents/Include/PolyFontManager.h

@@ -0,0 +1,44 @@
+/*
+ *  PolyFontManager.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/3/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Services
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyFont.h"
+#include <vector>
+#include <string>
+
+using std::vector;
+using std::string;
+
+namespace Polycode {
+
+	class FontEntry {
+	public:
+		string fontName;
+		Font *font;
+	};
+	
+	class _PolyExport FontManager {
+	public:
+		FontManager();
+		~FontManager();
+
+		void registerFont(string fontName, string fontPath);		
+		Font *getFontByName(string fontName);		
+		
+	private:
+		
+		vector <FontEntry> fonts;
+		
+	};
+	
+}

+ 47 - 0
Core/Contents/Include/PolyGLCubemap.h

@@ -0,0 +1,47 @@
+/*
+ *  PolyGLCubemap.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/9/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+
+#pragma once
+
+#ifdef _WINDOWS
+#include <windows.h>
+#endif
+
+#include "PolyGlobals.h"
+#include "PolyTexture.h"
+#include "PolyGLRenderer.h"
+#include "PolyCubemap.h"
+#if defined(__APPLE__) && defined(__MACH__)
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>	
+#else
+#include <GL/gl.h>	
+#include <GL/glu.h>	
+#endif
+
+
+namespace Polycode {
+	
+	class _PolyExport OpenGLCubemap : public Cubemap {
+	public:
+		
+		OpenGLCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
+		virtual ~OpenGLCubemap();
+		
+		GLuint getTextureID();		
+			
+	private:
+		
+		int filteringMode;
+		GLuint textureID;
+	};
+	
+}

+ 130 - 0
Core/Contents/Include/PolyGLES1Renderer.h

@@ -0,0 +1,130 @@
+/*
+ *  PolyGLES1Renderer.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/1/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Renderer
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolyTexture.h"
+#include "PolyGLES1Texture.h"
+#include "PolyCubemap.h"
+#include "PolyFixedShader.h"
+#include "PolyMesh.h"
+
+#include <OpenGLES/ES1/gl.h>
+#include <OpenGLES/ES1/glext.h>
+#include <glu.h>
+
+namespace Polycode {
+	class _PolyExport OpenGLES1Renderer : public Renderer {
+		
+	public:
+		
+		OpenGLES1Renderer();
+		virtual ~OpenGLES1Renderer();
+		
+		void Resize(int xRes, int yRes);
+		void BeginRender();
+		void EndRender();
+		
+		Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
+		Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int type=Image::IMAGE_RGBA);
+		Texture *createFramebufferTexture(unsigned int width, unsigned int height);
+		void createRenderTextures(Texture **colorBuffer, Texture **depthBuffer, int width, int height);
+		
+		void enableAlphaTest(bool val);
+		
+		void createVertexBufferForMesh(Mesh *mesh);
+		void drawVertexBuffer(VertexBuffer *buffer);		
+		
+		void bindFrameBufferTexture(Texture *texture);
+		void unbindFramebuffers();
+		
+		void setOrthoMode();
+		void setPerspectiveMode();
+		
+		void enableBackfaceCulling(bool val);
+		void setViewportSize(int w, int h, float fov=45.0f);
+		
+		void setLineSmooth(bool val);		
+		
+		void loadIdentity();
+		void setClearColor(float r, float g, float b);
+		
+		void setTexture(Texture *texture);		
+		void draw2DPolygon(Polygon *polygon);
+		void draw2DVertex(Vertex *vertex);
+		
+		void renderToTexture(Texture *targetTexture);		
+		void renderZBufferToTexture(Texture *targetTexture);
+		void clearScreen();	
+		
+		void translate2D(float x, float y);
+		void rotate2D(float angle);
+		void scale2D(Vector2 *scale);
+		
+		void setLineSize(float lineSize);
+		
+		void setVertexColor(float r, float g, float b, float a);
+		
+		void setBlendingMode(int blendingMode);
+		
+		void enableLighting(bool enable);	
+		void enableFog(bool enable);
+		void setFogProperties(int fogMode, Color color, float density, float startDepth, float endDepth);		
+		
+		void draw3DPolygon(Polygon *polygon);
+		void draw3DVertex(Vertex *vertex, Vector2 *faceUV);
+		void draw3DVertex2UV(Vertex *vertex, Vector2 *faceUV1, Vector2 *faceUV2);
+		void draw3DLine(Vector3 origin, Vector3 direction, float length, Color color);
+		
+		virtual void setNormal(const Vector3 &normal);
+		
+		void translate3D(Vector3 *position);
+		void translate3D(float x, float y, float z);
+		void scale3D(Vector3 *scale);
+		
+		Matrix4 getProjectionMatrix();
+		Matrix4 getModelviewMatrix();		
+		void setModelviewMatrix(Matrix4 m);	
+		void multModelviewMatrix(Matrix4 m);
+		
+		void enableDepthTest(bool val);		
+		void drawScreenQuad(float qx, float qy);
+		
+		void beginRenderOperation(int meshType);
+		void endRenderOperation();
+		
+		void pushMatrix();
+		void popMatrix();
+		
+		bool test2DCoordinate(float x, float y, Polygon *poly, const Matrix4 &matrix, bool billboardMode);
+		
+		void setFOV(float fov);
+		
+		Vector3 Unproject(float x, float y);
+		
+		void clearShader();
+		void applyMaterial(Material *material,  ShaderBinding *localOptions, unsigned int shaderIndex);
+		
+	private:
+				
+		GLuint defaultFramebuffer, colorRenderbuffer;		
+		
+		float nearPlane;
+		float farPlane;
+		
+		GLfloat sceneProjectionMatrix[16];
+		
+		
+	};
+}
+

+ 45 - 0
Core/Contents/Include/PolyGLES1Texture.h

@@ -0,0 +1,45 @@
+/*
+ *  PolyGLES1Texture.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/1/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Renderer
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyTexture.h"
+#include "PolyGLES1Renderer.h"
+
+#include <OpenGLES/ES1/gl.h>
+#include <OpenGLES/ES1/glext.h>
+
+namespace Polycode {
+	
+	class _PolyExport OpenGLES1Texture : public Texture {
+	public:
+		OpenGLES1Texture(unsigned int width, unsigned int height);
+		OpenGLES1Texture(unsigned int width, unsigned int height, char *textureData, bool clamp, int filteringMode);
+		virtual ~OpenGLES1Texture();
+		
+		void recreateFromImageData();
+		
+		GLuint getTextureID();
+		GLuint getFrameBufferID();
+		
+		void setGLInfo(GLuint textureID, GLuint frameBufferID);
+		
+		void setTextureData(char *data);
+		
+	private:
+		
+		int filteringMode;
+		GLuint textureID;
+		GLuint frameBufferID;
+	};
+	
+}

+ 201 - 0
Core/Contents/Include/PolyGLRenderer.h

@@ -0,0 +1,201 @@
+/*
+ *  PolyGLRenderer.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Renderer
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolyTexture.h"
+#include "PolyGLTexture.h"
+#include "PolyCubemap.h"
+#include "PolyGLCubemap.h"
+#include "PolyGLVertexBuffer.h"
+#include "PolyFixedShader.h"
+#include "PolyMesh.h"
+
+#ifdef _WINDOWS
+	#include <windows.h>
+#endif
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>	
+#else
+#include <GL/gl.h>	
+#include <GL/glu.h>	
+#include <GL/glext.h>
+#endif
+
+#ifdef _WINDOWS 
+
+#define GL_EXT_framebuffer_object           1
+
+#if GL_EXT_framebuffer_object
+#define GL_FRAMEBUFFER_EXT                 0x8D40
+#define GL_RENDERBUFFER_EXT                0x8D41
+#define GL_STENCIL_INDEX1_EXT              0x8D46
+#define GL_STENCIL_INDEX4_EXT              0x8D47
+#define GL_STENCIL_INDEX8_EXT              0x8D48
+#define GL_STENCIL_INDEX16_EXT             0x8D49
+#define GL_RENDERBUFFER_WIDTH_EXT           0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT          0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_EXT        0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT      0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT       0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT      0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT      0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT    0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT           0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT           0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT         0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT    0x8CD4
+#define GL_COLOR_ATTACHMENT0_EXT           0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT           0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT           0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT           0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT           0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT           0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT           0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT           0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT           0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT           0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT          0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT          0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT          0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT          0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT          0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT          0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT            0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT          0x8D20
+#define GL_FRAMEBUFFER_COMPLETE_EXT                        0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT           0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT   0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT           0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT              0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT          0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT          0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT                     0x8CDD
+#define GL_FRAMEBUFFER_BINDING_EXT         0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT        0x8CA7
+#define GL_MAX_COLOR_ATTACHMENTS_EXT       0x8CDF
+#define GL_MAX_RENDERBUFFER_SIZE_EXT       0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#endif
+#endif
+
+namespace Polycode {
+	class _PolyExport OpenGLRenderer : public Renderer {
+		
+	public:
+		
+		OpenGLRenderer();
+		~OpenGLRenderer();
+		
+		void Resize(int xRes, int yRes);
+		void BeginRender();
+		void EndRender();
+		
+		Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
+		Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int type = Image::IMAGE_RGBA);
+		Texture *createFramebufferTexture(unsigned int width, unsigned int height);
+		void createRenderTextures(Texture **colorBuffer, Texture **depthBuffer, int width, int height);
+		
+		void enableAlphaTest(bool val);
+		
+		void createVertexBufferForMesh(Mesh *mesh);
+		void drawVertexBuffer(VertexBuffer *buffer);						
+		void bindFrameBufferTexture(Texture *texture);
+		void unbindFramebuffers();
+		
+		void pushRenderDataArray(RenderDataArray *array);
+		RenderDataArray *createRenderDataArrayForMesh(Mesh *mesh, int arrayType);
+		RenderDataArray *createRenderDataArray(int arrayType);
+		void setRenderArrayData(RenderDataArray *array, float *arrayData);
+		void drawArrays(int drawType);		
+				
+		void setOrthoMode();
+		void setPerspectiveMode();
+		
+		void enableBackfaceCulling(bool val);
+		void setViewportSize(int w, int h, float fov=45.0f);
+		
+		void setLineSmooth(bool val);		
+		
+		void loadIdentity();
+		void setClearColor(float r, float g, float b);
+		
+		void setTexture(Texture *texture);		
+		
+		void renderToTexture(Texture *targetTexture);		
+		void renderZBufferToTexture(Texture *targetTexture);
+		void clearScreen();	
+		
+		void translate2D(float x, float y);
+		void rotate2D(float angle);
+		void scale2D(Vector2 *scale);
+		
+		void setLineSize(float lineSize);
+		
+		void setVertexColor(float r, float g, float b, float a);
+		
+		void setBlendingMode(int blendingMode);
+		
+		void enableLighting(bool enable);	
+		void enableFog(bool enable);
+		void setFogProperties(int fogMode, Color color, float density, float startDepth, float endDepth);		
+				
+		void translate3D(Vector3 *position);
+		void translate3D(float x, float y, float z);
+		void scale3D(Vector3 *scale);
+		
+		Matrix4 getProjectionMatrix();
+		Matrix4 getModelviewMatrix();		
+		void setModelviewMatrix(Matrix4 m);	
+		void multModelviewMatrix(Matrix4 m);
+		
+		void enableDepthTest(bool val);
+				
+		void clearBuffer(bool colorBuffer, bool depthBuffer);	
+		void drawToColorBuffer(bool val);
+		
+		void drawScreenQuad(float qx, float qy);
+				
+		void pushMatrix();
+		void popMatrix();
+		
+		bool test2DCoordinate(float x, float y, Polycode::Polygon *poly, const Matrix4 &matrix, bool billboardMode);
+		
+		void setFOV(float fov);
+		
+		Vector3 Unproject(float x, float y);
+		
+		void setDepthFunction(int depthFunction);
+						
+		void clearShader();
+		void applyMaterial(Material *material,  ShaderBinding *localOptions, unsigned int shaderIndex);
+		
+	protected:
+
+		
+		float nearPlane;
+		float farPlane;
+		
+		int verticesToDraw;
+		
+		GLdouble sceneProjectionMatrix[16];
+	
+		
+	};
+}
+

+ 57 - 0
Core/Contents/Include/PolyGLTexture.h

@@ -0,0 +1,57 @@
+/*
+ *  PolyGLTexture.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/16/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Renderer
+ 
+#pragma once
+
+#ifdef _WINDOWS
+	#include <windows.h>
+#endif
+
+#include "PolyGlobals.h"
+#include "PolyTexture.h"
+#include "PolyGLRenderer.h"
+#if defined(__APPLE__) && defined(__MACH__)
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>	
+#else
+#include <GL/gl.h>	
+#include <GL/glu.h>	
+#endif
+
+
+namespace Polycode {
+
+	class _PolyExport OpenGLTexture : public Texture {
+		public:
+			OpenGLTexture(unsigned int width, unsigned int height);
+			OpenGLTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int filteringMode, int type);
+			virtual ~OpenGLTexture();
+			
+			void recreateFromImageData();
+
+			GLuint getTextureID();
+			GLuint getFrameBufferID();
+			
+			void setGLInfo(GLuint textureID, GLuint frameBufferID);
+			
+			void setTextureData(char *data);
+			
+		private:
+			
+			bool glTextureLoaded;
+			GLuint glTextureType;
+			int filteringMode;
+			GLuint textureID;
+			GLuint frameBufferID;
+	};
+
+}

+ 51 - 0
Core/Contents/Include/PolyGLVertexBuffer.h

@@ -0,0 +1,51 @@
+/*
+ *  GLVertexBuffer.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#pragma once
+
+#ifdef _WINDOWS
+#include <windows.h>
+#endif
+
+#include "PolyGlobals.h"
+#include "PolyMesh.h"
+#include "PolyGLRenderer.h"
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>	
+#else
+#include <GL/gl.h>	
+#include <GL/glu.h>	
+#endif
+
+
+namespace Polycode {
+	
+	class _PolyExport OpenGLVertexBuffer : public VertexBuffer {
+	public:
+		
+		OpenGLVertexBuffer(Mesh *mesh);
+		virtual ~OpenGLVertexBuffer();
+		
+		GLuint getVertexBufferID();		
+		GLuint getTextCoordBufferID();	
+		GLuint getNormalBufferID();
+		GLuint getColorBufferID();
+		
+	private:
+		
+		GLuint vertexBufferID;
+		GLuint texCoordBufferID;
+		GLuint normalBufferID;
+		GLuint colorBufferID;		
+	};
+	
+}

+ 80 - 0
Core/Contents/Include/PolyGenericScene.h

@@ -0,0 +1,80 @@
+/*
+ *  PolyGenericScene.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Scene
+ 
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <vector>
+#include "PolyScene.h"
+#include "PolySceneMesh.h"
+#include "PolyScenePrimitive.h"
+#include "OSBasics.h"
+
+using std::vector;
+
+namespace Polycode {
+	
+	class _PolyExport GenericScene : public Scene {
+		public:
+			GenericScene();
+			GenericScene(bool virtualScene);
+		
+			virtual ~GenericScene();
+			
+			void Render();
+			void RenderDepthOnly(Camera *targetCamera);
+			void addGrid(string gridTexture);
+	
+			static string readString(OSFILE *inFile);
+			void loadScene(string fileName);
+			void generateLightmaps(float lightMapRes, float lightMapQuality, int numRadPasses);
+
+			void addLight(SceneLight *light);
+			SceneLight *getNearestLight(Vector3 pos);
+			
+			void writeEntityMatrix(SceneEntity *entity, OSFILE *outFile);
+			void writeString(string str, OSFILE *outFile);
+			void saveScene(string fileName);
+	
+			int getNumStaticGeometry();
+			SceneMesh *getStaticGeometry(int index);
+			
+			virtual void loadCollisionChild(SceneEntity *entity, bool autoCollide=false, int type=0){}
+			
+			int getNumLights();
+			SceneLight *getLight(int index);
+			
+			SceneEntity *getCustomEntityByType(string type);
+			vector<SceneEntity*> getCustomEntitiesByType(string type);		
+			
+			static const unsigned int ENTITY_MESH = 0;
+			static const unsigned int ENTITY_LIGHT = 1;			
+			static const unsigned int ENTITY_CAMERA = 2;			
+			static const unsigned int ENTITY_ENTITY = 3;
+			static const unsigned int ENTITY_COLLMESH = 4;
+
+			Color clearColor;
+			Color ambientColor;		
+			Color fogColor;				
+		
+		private:
+		
+			bool useClearColor;
+			bool virtualScene;
+			bool hasLightmaps;
+//			LightmapPacker *packer;
+			
+			vector <SceneLight*> lights;				
+			vector <SceneMesh*> staticGeometry;
+			vector <SceneMesh*> collisionGeometry;
+			vector <SceneEntity*> customEntities;
+	};
+
+}

+ 68 - 0
Core/Contents/Include/PolyGlobals.h

@@ -0,0 +1,68 @@
+ 
+#pragma once
+
+// TAU CORE LIBRARY CONFIGURATION SECTION
+
+// Compile support for lua bindings.
+//#define _COMPILE_LUA
+
+
+#define COMPILE_GL_RENDERER
+
+#ifdef MSVC
+	#define WIN32_LEAN_AND_MEAN
+
+	#pragma warning(disable:4251)
+	#pragma warning(disable:4305)
+	#pragma warning(disable:4244)
+	#pragma warning(disable:4018)
+	#pragma warning(disable:4996)
+	#pragma warning(disable:4309)
+
+	#define NULL 0
+#endif
+ 
+#define PI 3.14159265
+#define RADIANS	57.2957795
+
+#define TODEGREES 57.2957795
+#define TORADIANS 0.0174532925
+
+#ifdef _WINDOWS
+	#define _PolyExport __declspec(dllexport)
+#else
+	#define _PolyExport
+#endif
+
+//#define COMPILE_SDL_CORE		1
+
+#define PLATFORM_WINDOWS  1
+#define PLATFORM_MAC      2
+#define PLATFORM_UNIX     3
+
+#ifdef _WINDOWS
+	#define PLATFORM PLATFORM_WINDOWS
+#elif defined(__APPLE__) && defined(__MACH__)
+	#define PLATFORM PLATFORM_MAC
+#else
+	#define PLATFORM PLATFORM_UNIX
+#endif
+
+
+// NETWORK STUFF
+#define MAX_PACKET_SIZE 1400
+
+// if set to 1, will create a thread for each network socket
+#define USE_THREADED_SOCKETS 0
+
+// Socket poll interval time in msecs
+#define SOCKET_POLL_INTERVAL 5
+
+
+
+#define PACKET_TYPE_USERDATA 0
+#define PACKET_TYPE_SETCLIENT_ID 1
+#define PACKET_TYPE_CLIENT_READY 2
+#define PACKET_TYPE_DISONNECT 3
+#define PACKET_TYPE_CLIENT_DATA 4
+

+ 96 - 0
Core/Contents/Include/PolyImage.h

@@ -0,0 +1,96 @@
+/*
+ *  PolyImage.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 Ivan Safrin. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "png.h"
+#include "PolyColor.h"
+#include "PolyPerlin.h"
+#include <string>
+#include <math.h>
+#include "OSBasics.h"
+
+using std::string;
+
+namespace Polycode {
+	class _PolyExport Image {
+		public:
+			Image(string fileName);
+			Image(int width, int height, int type = IMAGE_RGBA);
+			Image(char *data, int width, int height, int type = IMAGE_RGBA);
+			Image(Image *copyImage);		
+			Image();			
+			~Image();
+
+			bool loadImage(string fileName);
+			bool loadPNG(string fileName);
+		
+			
+			void createEmpty(unsigned int width, unsigned int height);
+			void fill(float r, float g, float b, float a);
+			
+			// drawing
+			void setPixel(int x, int y, float r, float g, float b, float a);
+			void setPixel(int x, int y, Color col);
+			Color getPixel(int x, int y);
+						   
+			void setAAPixel(int x, int y, Color col);
+			void swap(int *v1, int *v2);
+			void line(int x0, int y0, int x1, int y1, Color col);
+			void moveTo(int x, int y);
+			void move(int x, int y);
+			void lineTo(int x, int y, Color col);
+			void drawRect(int x, int y, int w, int h, Color col);
+			
+			// effex
+			void perlinNoise(int seed, bool alpha);
+			void fastBlur(int blurSize);
+			void fastBlurVert(int blurSize);
+			void fastBlurHor(int blurSize);
+			void darken(float amt, bool color, bool alpha);
+			void lighten(float amt, bool color, bool alpha);
+			void multiply(float amt, bool color, bool alpha);
+			
+			int getBrushX();
+			int getBrushY();
+		
+			bool isLoaded();
+		
+			int getType() { return imageType; }
+			
+			void writeBMP(string fileName);
+			
+			unsigned int getWidth();
+			unsigned int getHeight();
+			char *getPixels();
+		
+			static const int IMAGE_RGB = 0;
+			static const int IMAGE_RGBA = 1;
+		
+		protected:
+		
+			void setPixelType(int type);		
+		
+		int imageType;
+		int pixelSize;
+		
+		bool loaded;
+		
+		Color strokeColor;
+		int brushPosX;
+		int brushPosY;
+		
+		char *imageData;
+		unsigned int width;
+		unsigned int height;
+	};
+
+}

+ 54 - 0
Core/Contents/Include/PolyInputEvent.h

@@ -0,0 +1,54 @@
+/*
+ *  PolyInputEvent.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/28/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Core
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyEvent.h"
+#include "PolyVector2.h"
+#include "PolyInputKeys.h"
+
+namespace Polycode {
+
+	class _PolyExport InputEvent : public Event {
+		public:
+			InputEvent(Vector2 mousePosition,int timestamp);
+//			InputEvent(TAUKey key, int timestamp);
+			InputEvent(TAUKey key, wchar_t charCode, int timestamp);			
+			~InputEvent();
+		
+		static const int EVENT_MOUSEDOWN = 0;
+		static const int EVENT_MOUSEUP = 1;
+		static const int EVENT_MOUSEMOVE = 2;
+		static const int EVENT_MOUSEOVER = 3;
+		static const int EVENT_MOUSEOUT = 4;
+		static const int EVENT_DOUBLECLICK = 5;
+		static const int EVENT_MOUSEUP_OUTSIDE = 6;
+		static const int EVENT_MOUSEWHEEL_UP = 7;
+		static const int EVENT_MOUSEWHEEL_DOWN = 8;
+		
+		static const int EVENT_KEYDOWN = 13;
+		static const int EVENT_KEYUP = 14;
+		
+		int mouseButton;
+		Vector2 mousePosition;
+		TAUKey key;
+		
+		int keyCode() { return key; }
+		
+		wchar_t charCode;
+		int timestamp;
+		
+		protected:
+		
+			
+	};
+}

+ 275 - 0
Core/Contents/Include/PolyInputKeys.h

@@ -0,0 +1,275 @@
+/*
+ *  PolyInputKeys.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/28/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Core
+
+#pragma once
+
+namespace Polycode {
+
+	// copied from SDL for conveniece :)
+	
+	typedef enum {
+		/* The keyboard syms have been cleverly chosen to map to ASCII */
+		TAUK_UNKNOWN		= 0,
+		TAUK_FIRST		= 0,
+		TAUK_BACKSPACE		= 8,
+		TAUK_TAB		= 9,
+		TAUK_CLEAR		= 12,
+		TAUK_RETURN		= 13,
+		TAUK_PAUSE		= 19,
+		TAUK_ESCAPE		= 27,
+		TAUK_SPACE		= 32,
+		TAUK_EXCLAIM		= 33,
+		TAUK_QUOTEDBL		= 34,
+		TAUK_HASH		= 35,
+		TAUK_DOLLAR		= 36,
+		TAUK_AMPERSAND		= 38,
+		TAUK_QUOTE		= 39,
+		TAUK_LEFTPAREN		= 40,
+		TAUK_RIGHTPAREN		= 41,
+		TAUK_ASTERISK		= 42,
+		TAUK_PLUS		= 43,
+		TAUK_COMMA		= 44,
+		TAUK_MINUS		= 45,
+		TAUK_PERIOD		= 46,
+		TAUK_SLASH		= 47,
+		TAUK_0			= 48,
+		TAUK_1			= 49,
+		TAUK_2			= 50,
+		TAUK_3			= 51,
+		TAUK_4			= 52,
+		TAUK_5			= 53,
+		TAUK_6			= 54,
+		TAUK_7			= 55,
+		TAUK_8			= 56,
+		TAUK_9			= 57,
+		TAUK_COLON		= 58,
+		TAUK_SEMICOLON		= 59,
+		TAUK_LESS		= 60,
+		TAUK_EQUALS		= 61,
+		TAUK_GREATER		= 62,
+		TAUK_QUESTION		= 63,
+		TAUK_AT			= 64,
+		/* 
+		 Skip uppercase letters
+		 */
+		TAUK_LEFTBRACKET	= 91,
+		TAUK_BACKSLASH		= 92,
+		TAUK_RIGHTBRACKET	= 93,
+		TAUK_CARET		= 94,
+		TAUK_UNDERSCORE		= 95,
+		TAUK_BACKQUOTE		= 96,
+		TAUK_a			= 97,
+		TAUK_b			= 98,
+		TAUK_c			= 99,
+		TAUK_d			= 100,
+		TAUK_e			= 101,
+		TAUK_f			= 102,
+		TAUK_g			= 103,
+		TAUK_h			= 104,
+		TAUK_i			= 105,
+		TAUK_j			= 106,
+		TAUK_k			= 107,
+		TAUK_l			= 108,
+		TAUK_m			= 109,
+		TAUK_n			= 110,
+		TAUK_o			= 111,
+		TAUK_p			= 112,
+		TAUK_q			= 113,
+		TAUK_r			= 114,
+		TAUK_s			= 115,
+		TAUK_t			= 116,
+		TAUK_u			= 117,
+		TAUK_v			= 118,
+		TAUK_w			= 119,
+		TAUK_x			= 120,
+		TAUK_y			= 121,
+		TAUK_z			= 122,
+		TAUK_DELETE		= 127,
+		/* End of ASCII mapped keysyms */
+		
+		/* International keyboard syms */
+		TAUK_WORLD_0		= 160,		/* 0xA0 */
+		TAUK_WORLD_1		= 161,
+		TAUK_WORLD_2		= 162,
+		TAUK_WORLD_3		= 163,
+		TAUK_WORLD_4		= 164,
+		TAUK_WORLD_5		= 165,
+		TAUK_WORLD_6		= 166,
+		TAUK_WORLD_7		= 167,
+		TAUK_WORLD_8		= 168,
+		TAUK_WORLD_9		= 169,
+		TAUK_WORLD_10		= 170,
+		TAUK_WORLD_11		= 171,
+		TAUK_WORLD_12		= 172,
+		TAUK_WORLD_13		= 173,
+		TAUK_WORLD_14		= 174,
+		TAUK_WORLD_15		= 175,
+		TAUK_WORLD_16		= 176,
+		TAUK_WORLD_17		= 177,
+		TAUK_WORLD_18		= 178,
+		TAUK_WORLD_19		= 179,
+		TAUK_WORLD_20		= 180,
+		TAUK_WORLD_21		= 181,
+		TAUK_WORLD_22		= 182,
+		TAUK_WORLD_23		= 183,
+		TAUK_WORLD_24		= 184,
+		TAUK_WORLD_25		= 185,
+		TAUK_WORLD_26		= 186,
+		TAUK_WORLD_27		= 187,
+		TAUK_WORLD_28		= 188,
+		TAUK_WORLD_29		= 189,
+		TAUK_WORLD_30		= 190,
+		TAUK_WORLD_31		= 191,
+		TAUK_WORLD_32		= 192,
+		TAUK_WORLD_33		= 193,
+		TAUK_WORLD_34		= 194,
+		TAUK_WORLD_35		= 195,
+		TAUK_WORLD_36		= 196,
+		TAUK_WORLD_37		= 197,
+		TAUK_WORLD_38		= 198,
+		TAUK_WORLD_39		= 199,
+		TAUK_WORLD_40		= 200,
+		TAUK_WORLD_41		= 201,
+		TAUK_WORLD_42		= 202,
+		TAUK_WORLD_43		= 203,
+		TAUK_WORLD_44		= 204,
+		TAUK_WORLD_45		= 205,
+		TAUK_WORLD_46		= 206,
+		TAUK_WORLD_47		= 207,
+		TAUK_WORLD_48		= 208,
+		TAUK_WORLD_49		= 209,
+		TAUK_WORLD_50		= 210,
+		TAUK_WORLD_51		= 211,
+		TAUK_WORLD_52		= 212,
+		TAUK_WORLD_53		= 213,
+		TAUK_WORLD_54		= 214,
+		TAUK_WORLD_55		= 215,
+		TAUK_WORLD_56		= 216,
+		TAUK_WORLD_57		= 217,
+		TAUK_WORLD_58		= 218,
+		TAUK_WORLD_59		= 219,
+		TAUK_WORLD_60		= 220,
+		TAUK_WORLD_61		= 221,
+		TAUK_WORLD_62		= 222,
+		TAUK_WORLD_63		= 223,
+		TAUK_WORLD_64		= 224,
+		TAUK_WORLD_65		= 225,
+		TAUK_WORLD_66		= 226,
+		TAUK_WORLD_67		= 227,
+		TAUK_WORLD_68		= 228,
+		TAUK_WORLD_69		= 229,
+		TAUK_WORLD_70		= 230,
+		TAUK_WORLD_71		= 231,
+		TAUK_WORLD_72		= 232,
+		TAUK_WORLD_73		= 233,
+		TAUK_WORLD_74		= 234,
+		TAUK_WORLD_75		= 235,
+		TAUK_WORLD_76		= 236,
+		TAUK_WORLD_77		= 237,
+		TAUK_WORLD_78		= 238,
+		TAUK_WORLD_79		= 239,
+		TAUK_WORLD_80		= 240,
+		TAUK_WORLD_81		= 241,
+		TAUK_WORLD_82		= 242,
+		TAUK_WORLD_83		= 243,
+		TAUK_WORLD_84		= 244,
+		TAUK_WORLD_85		= 245,
+		TAUK_WORLD_86		= 246,
+		TAUK_WORLD_87		= 247,
+		TAUK_WORLD_88		= 248,
+		TAUK_WORLD_89		= 249,
+		TAUK_WORLD_90		= 250,
+		TAUK_WORLD_91		= 251,
+		TAUK_WORLD_92		= 252,
+		TAUK_WORLD_93		= 253,
+		TAUK_WORLD_94		= 254,
+		TAUK_WORLD_95		= 255,		/* 0xFF */
+		
+		/* Numeric keypad */
+		TAUK_KP0		= 256,
+		TAUK_KP1		= 257,
+		TAUK_KP2		= 258,
+		TAUK_KP3		= 259,
+		TAUK_KP4		= 260,
+		TAUK_KP5		= 261,
+		TAUK_KP6		= 262,
+		TAUK_KP7		= 263,
+		TAUK_KP8		= 264,
+		TAUK_KP9		= 265,
+		TAUK_KP_PERIOD		= 266,
+		TAUK_KP_DIVIDE		= 267,
+		TAUK_KP_MULTIPLY	= 268,
+		TAUK_KP_MINUS		= 269,
+		TAUK_KP_PLUS		= 270,
+		TAUK_KP_ENTER		= 271,
+		TAUK_KP_EQUALS		= 272,
+		
+		/* Arrows + Home/End pad */
+		TAUK_UP			= 273,
+		TAUK_DOWN		= 274,
+		TAUK_RIGHT		= 275,
+		TAUK_LEFT		= 276,
+		TAUK_INSERT		= 277,
+		TAUK_HOME		= 278,
+		TAUK_END		= 279,
+		TAUK_PAGEUP		= 280,
+		TAUK_PAGEDOWN		= 281,
+		
+		/* Function keys */
+		TAUK_F1			= 282,
+		TAUK_F2			= 283,
+		TAUK_F3			= 284,
+		TAUK_F4			= 285,
+		TAUK_F5			= 286,
+		TAUK_F6			= 287,
+		TAUK_F7			= 288,
+		TAUK_F8			= 289,
+		TAUK_F9			= 290,
+		TAUK_F10		= 291,
+		TAUK_F11		= 292,
+		TAUK_F12		= 293,
+		TAUK_F13		= 294,
+		TAUK_F14		= 295,
+		TAUK_F15		= 296,
+		
+		/* Key state modifier keys */
+		TAUK_NUMLOCK		= 300,
+		TAUK_CAPSLOCK		= 301,
+		TAUK_SCROLLOCK		= 302,
+		TAUK_RSHIFT		= 303,
+		TAUK_LSHIFT		= 304,
+		TAUK_RCTRL		= 305,
+		TAUK_LCTRL		= 306,
+		TAUK_RALT		= 307,
+		TAUK_LALT		= 308,
+		TAUK_RMETA		= 309,
+		TAUK_LMETA		= 310,
+		TAUK_LSUPER		= 311,		/* Left "Windows" key */
+		TAUK_RSUPER		= 312,		/* Right "Windows" key */
+		TAUK_MODE		= 313,		/* "Alt Gr" key */
+		TAUK_COMPOSE		= 314,		/* Multi-key compose key */
+		
+		/* Miscellaneous function keys */
+		TAUK_HELP		= 315,
+		TAUK_PRINT		= 316,
+		TAUK_SYSREQ		= 317,
+		TAUK_BREAK		= 318,
+		TAUK_MENU		= 319,
+		TAUK_POWER		= 320,		/* Power Macintosh power key */
+		TAUK_EURO		= 321,		/* Some european keyboards */
+		TAUK_UNDO		= 322,		/* Atari keyboard has Undo */
+		
+		/* Add any other keys here */
+		
+		TAUK_LAST
+	} TAUKey;
+
+};
+	

+ 55 - 0
Core/Contents/Include/PolyLabel.h

@@ -0,0 +1,55 @@
+/*
+ *  PolyLabel.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/16/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+ 
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyFont.h"
+#include "PolyImage.h"
+#include "PolyUtil.h"
+
+#include <string>
+using namespace std;
+
+using std::wstring;
+
+#define TAB_REPLACE "    "
+
+namespace Polycode {
+
+	class _PolyExport Label : public Image {
+		public:
+			
+			Label(Font *font, wstring text, int size, int antiAliasMode);
+			~Label();
+			void setText(wstring text);
+			wstring getText();
+			int getTextWidth(Font *font, wstring text, int size);
+			int getTextHeight(Font *font, wstring text, int size);
+					
+			float getTextWidth();		
+			float getTextHeight();
+		
+			Font *getFont();
+					
+			static const int ANTIALIAS_FULL = 0;
+			static const int ANTIALIAS_NONE = 1;
+			
+		private:
+
+			float currentTextWidth;
+			float currentTextHeight;
+			int antiAliasMode;
+			int size;
+			wstring text;
+			Font *font;
+	};
+
+}

+ 28 - 0
Core/Contents/Include/PolyLogger.h

@@ -0,0 +1,28 @@
+// @package Services
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include <stdio.h>
+#include <stdarg.h>
+#include <string>
+#include <iostream>
+
+#ifdef MSVC
+#include <windows.h>
+#endif
+
+using std::wstring;
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport Logger {
+		public:
+			Logger(){}
+			~Logger(){}
+
+			static void log(const char *format, ...);
+			static void logw(const char *str);
+	};
+}

+ 29 - 0
Core/Contents/Include/PolyLuaEventStuff.h

@@ -0,0 +1,29 @@
+/*
+ *  PolyLuaEventStuff.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 1/27/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#pragma once
+#ifdef _COMPILE_LUA
+
+// Poly compilation config
+
+extern "C"
+{
+#include "lua.h"
+#include "lualib.h"
+
+}
+
+typedef struct{
+	lua_State* L;
+	int ref;
+} SWIGLUA_REF;
+
+extern void handlePolyLuaEvent(SWIGLUA_REF *onEvent, void *event);
+
+#endif

+ 52 - 0
Core/Contents/Include/PolyMaterial.h

@@ -0,0 +1,52 @@
+/*
+ *  PolyMaterial.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/19/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Materials
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include <string>
+#include <vector>
+#include "PolyTexture.h"
+#include "PolyShader.h"
+#include "PolyResource.h"
+
+
+using std::string;
+using std::vector;
+
+namespace Polycode {
+	
+	class _PolyExport Material : public Resource {
+		public:
+			Material(string name);
+			virtual ~Material();
+			
+			void addShader(Shader *shader,ShaderBinding *shaderBinding);
+			unsigned int getNumShaders();
+			
+			void addShaderRenderTarget(ShaderRenderTarget *newTarget);
+			int getNumShaderRenderTargets();
+			ShaderRenderTarget *getShaderRenderTarget(unsigned int index);
+				
+			string getName();
+			Shader *getShader(unsigned int index);
+			ShaderBinding *getShaderBinding(unsigned int index);
+			void loadMaterial(string fileName);
+			
+		protected:
+		
+			vector<Shader*> materialShaders;
+			vector<ShaderBinding*> shaderBindings;
+			vector<ShaderRenderTarget*> renderTargets;
+					
+			string name;
+		
+	};
+}

+ 72 - 0
Core/Contents/Include/PolyMaterialManager.h

@@ -0,0 +1,72 @@
+/*
+ *  PolyMaterialManager.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Services
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyTexture.h"
+#include "PolyCubemap.h"
+#include "PolyMaterial.h"
+#include "PolyShader.h"
+#include "PolyFixedShader.h"
+#include "PolyModule.h"
+#include "PolyImage.h"
+#include "tinyxml.h"
+#include "PolyUtil.h"
+#include <vector>
+
+using namespace std;
+
+namespace Polycode {
+	
+	class Texture;
+	class SceneRenderTexture;
+	class _PolyExport MaterialManager {
+		public:
+			MaterialManager();
+			~MaterialManager();
+			
+			void Update(int elapsed);
+
+			Texture *createFramebufferTexture(int width, int height, int type);
+			Texture *createTexture(int width, int height, char *imageData, bool clamp=true, int type=Image::IMAGE_RGBA);
+			Texture *createNewTexture(int width, int height, bool clamp=true, int type=Image::IMAGE_RGBA);
+			Texture *createTextureFromImage(Image *image, bool clamp=true);
+			Texture *createTextureFromFile(string fileName);
+			void deleteTexture(Texture *texture);
+		
+			void reloadTextures();
+			
+			void reloadProgramsAndTextures();
+			void reloadPrograms();		
+		
+			void addShaderModule(PolycodeShaderModule *module);		
+		
+			//SceneRenderTexture *createRenderTexture(Scene *targetScene, Camera *targetCamera, int renderWidth,int renderHeight);
+			Texture *getTextureByResourcePath(string resourcePath);
+			
+			// cubemaps
+		
+			Cubemap *cubemapFromXMLNode(TiXmlNode *node);
+		
+			// materials
+			void loadMaterialsFromFile(string fileName);
+			Material *materialFromXMLNode(TiXmlNode *node);
+			Shader *setShaderFromXMLNode(TiXmlNode *node);
+			Shader *createShaderFromXMLNode(TiXmlNode *node);
+		
+		private:
+			vector<Texture*> textures;
+			vector<Material*> materials;
+		
+			vector <PolycodeShaderModule*> shaderModules;
+	};
+};

+ 192 - 0
Core/Contents/Include/PolyMatrix4.h

@@ -0,0 +1,192 @@
+/*
+ *  PolyMatrix4.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/26/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Math
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyVector3.h"
+#include <string.h>
+
+namespace Polycode {
+
+	class Vector3;
+	
+	class _PolyExport Matrix4 {
+	
+		public:
+			Matrix4();
+
+
+        inline Matrix4(
+            float m00, float m01, float m02, float m03,
+            float m10, float m11, float m12, float m13,
+            float m20, float m21, float m22, float m23,
+            float m30, float m31, float m32, float m33 )
+        {
+            m[0][0] = m00;
+            m[0][1] = m01;
+            m[0][2] = m02;
+            m[0][3] = m03;
+            m[1][0] = m10;
+            m[1][1] = m11;
+            m[1][2] = m12;
+            m[1][3] = m13;
+            m[2][0] = m20;
+            m[2][1] = m21;
+            m[2][2] = m22;
+            m[2][3] = m23;
+            m[3][0] = m30;
+            m[3][1] = m31;
+            m[3][2] = m32;
+            m[3][3] = m33;
+        }
+
+			
+			Matrix4(float *m);
+			~Matrix4();
+			
+			void init();
+			
+			union {
+				float m[4][4];
+				float ml[16];
+			};
+			
+			inline void identity() {
+				memset(ml, 0, sizeof(float)*16);
+				ml[0] = 1;
+				ml[5] = 1;
+				ml[10] = 1;
+				ml[15] = 1;		
+			}
+		
+			
+			inline Vector3 rotateVector(const Vector3 &v2) {
+				return Vector3(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0],
+								v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1],
+								v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2]);
+			}
+			
+			inline Vector3 getPosition() {
+				Vector3 pos;
+				pos.x = m[3][0];
+				pos.y = m[3][1];
+				pos.z = m[3][2];
+				return pos;
+			}
+			/*
+			void setTransform(Vector3 pos, Vector3 scale, Quaternion rot) {
+			
+			}
+	*/
+			inline Vector3 operator * ( const Vector3 &v2 ) const
+			{
+				return Vector3(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0] + m[3][0],
+								v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1] + m[3][1],
+								v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2] + m[3][2]);
+			}			
+			
+			inline float* operator [] ( int row ) { return m[row];}
+
+			inline void setPosition(float x, float y, float z) {
+				m[3][0] = x;
+				m[3][1] = y;
+				m[3][2] = z;
+			}
+
+			inline void getEulerAngles(float *ax, float *ay, float *az) {
+				float angle_x, angle_y, angle_z,tr_x,tr_y,C;
+				
+				angle_y = asin(m[0][2]);
+				
+				C = cosf(angle_y);
+				angle_y *= TODEGREES;
+				
+				if(fabsf(C) > 0.005) {
+					tr_x      =  m[2][2] / C; // 10 
+					tr_y      = -m[1][2]  / C; // 6
+					angle_x  = atan2f( tr_y, tr_x ) * TODEGREES;
+					tr_x      =  m[0][0] / C; // 0
+					tr_y      = -m[0][1] / C; // 1
+					angle_z  = atan2f( tr_y, tr_x ) * TODEGREES;
+				} else {
+					angle_x  = 0;
+					tr_x      =  m[1][1];
+					tr_y      =  m[1][0];
+					angle_z  = atan2f( tr_y, tr_x ) * TODEGREES;
+				}					
+				
+				if (angle_x < 0) angle_x += 360;
+				if (angle_y < 0) angle_y += 360;
+				if (angle_z < 0) angle_z += 360;
+				
+				*ax = -fabs(angle_x);
+				*ay = fabs(angle_y);
+				*az = fabs(angle_z);
+
+			}
+
+			inline Matrix4 operator + ( const Matrix4 &m2 ) const {
+				Matrix4 r;
+				
+				r.m[0][0] = m[0][0] + m2.m[0][0];
+				r.m[0][1] = m[0][1] + m2.m[0][1];
+				r.m[0][2] = m[0][2] + m2.m[0][2];
+				r.m[0][3] = m[0][3] + m2.m[0][3];
+				
+				r.m[1][0] = m[1][0] + m2.m[1][0];
+				r.m[1][1] = m[1][1] + m2.m[1][1];
+				r.m[1][2] = m[1][2] + m2.m[1][2];
+				r.m[1][3] = m[1][3] + m2.m[1][3];
+
+				r.m[2][0] = m[2][0] + m2.m[2][0];
+				r.m[2][1] = m[2][1] + m2.m[2][1];
+				r.m[2][2] = m[2][2] + m2.m[2][2];
+				r.m[2][3] = m[2][3] + m2.m[2][3];
+				
+				r.m[3][0] = m[3][0] + m2.m[3][0];
+				r.m[3][1] = m[3][1] + m2.m[3][1];
+				r.m[3][2] = m[3][2] + m2.m[3][2];
+				r.m[3][3] = m[3][3] + m2.m[3][3];
+				
+				return r;
+			}
+			
+			Matrix4 inverse();
+			Matrix4 inverseAffine();
+	
+			inline Matrix4 operator * (const Matrix4 &m2) const {
+           Matrix4 r;
+            r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
+            r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
+            r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
+            r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
+
+            r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
+            r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
+            r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
+            r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
+
+            r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
+            r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
+            r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
+            r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
+
+            r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
+            r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
+            r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
+            r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
+
+            return r;
+
+					}
+		protected:
+		
+	};
+}	

+ 138 - 0
Core/Contents/Include/PolyMesh.h

@@ -0,0 +1,138 @@
+/*
+ *  PolyMesh.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package BasicTypes
+ 
+#pragma once
+
+#include <math.h>
+#include "PolyGlobals.h"
+#include "PolyPolygon.h"
+#include "PolyVertex.h"
+#include <string>
+#include <vector>
+#include "OSBasics.h"
+
+using namespace std;
+ 
+namespace Polycode {
+	
+	class _PolyExport VertexBuffer {
+		public:	
+			int getVertexCount() { return vertexCount;}
+		protected:
+		int vertexCount;
+			
+	};
+	
+	class _PolyExport RenderDataArray {
+	public:
+		int arrayType;
+		int stride;
+		int size;
+		void *arrayPtr;
+		void *rendererData;
+		int count;
+		
+		static const int VERTEX_DATA_ARRAY = 0;
+		static const int COLOR_DATA_ARRAY = 1;		
+		static const int NORMAL_DATA_ARRAY = 2;				
+		static const int TEXCOORD_DATA_ARRAY = 3;
+	};
+		
+
+	typedef struct {
+		float x;
+		float y;
+		float z;
+	} Vector3_struct;
+
+	typedef struct {
+		float x;
+		float y;
+	} Vector2_struct;
+	
+	typedef struct {
+		unsigned int v1;
+		unsigned int v2;
+		unsigned int v3;
+		float nx;
+		float ny;
+		float nz;
+		Vector2_struct uvs[3];
+	} Face_struct;
+
+	class _PolyExport Mesh {
+		public:
+			Mesh(string fileName);
+			Mesh(int meshType);
+			~Mesh();
+			
+			void addPolygon(Polygon *newPolygon);
+			
+			void loadMesh(string fileName);
+
+			void loadFromFile(OSFILE *inFile);
+			void saveToFile(OSFILE *outFile);
+			
+			unsigned int getPolygonCount();
+			Polygon *getPolygon(unsigned int index);
+					
+			void createPlane(float w, float h);
+			void createBox(float w, float d, float h);
+			void createSphere(float radius, float numRings, float numSegments);
+		
+			void addVertex(Vertex* vertex);
+			Vertex *getVertex(unsigned int index);
+			unsigned int getNumVertices();
+		
+			void useVertexNormals(bool val);
+			int getVertexIndex(Vertex *vertex);
+			
+			void setVertexBuffer(VertexBuffer *buffer);
+			VertexBuffer *getVertexBuffer();
+		
+			bool usesFaceUV() { return useFaceUV; }
+			float getRadius();
+			
+			void calculateNormals();	
+			
+			int getMeshType();
+			void setMeshType(int newType);
+
+			Vector3 calculateBBox();
+		
+			bool hasVertexBuffer() { return meshHasVertexBuffer; }
+	
+			static const int QUAD_MESH = 0;			
+			static const int TRI_MESH = 1;				
+			static const int TRIFAN_MESH = 2;
+			static const int TRISTRIP_MESH = 3;
+			static const int LINE_MESH = 4;
+
+			unsigned int numUVs;			
+					
+			bool arrayDirtyMap[16];
+			RenderDataArray *renderDataArrays[16];
+		
+		private:
+		
+				
+		VertexBuffer *vertexBuffer;
+		bool meshHasVertexBuffer;
+		
+		
+		int meshType;
+		bool useFaceUV;
+
+		
+		vector <Polygon*> polygons;
+		vector <Vertex*> vertices;
+	};
+}

+ 51 - 0
Core/Contents/Include/PolyModule.h

@@ -0,0 +1,51 @@
+/*
+ *  PolyModule.h
+ *  PolyCore
+ *
+ *  Created by Ivan Safrin on 12/1/10.
+ *  Copyright 2010 Local Projects. All rights reserved.
+ *
+ */
+
+#pragma once
+#include "PolyGlobals.h"
+#include "tinyxml.h"
+#include "PolyShader.h"
+#include "PolyMaterial.h"
+
+namespace Polycode {
+	
+	class Renderer;	
+	
+	class _PolyExport PolycodeModule {
+	public:
+		PolycodeModule();
+		virtual ~PolycodeModule();
+		
+		int getType() { return type; }
+		
+		static const int TYPE_GENERIC = 0;
+		static const int TYPE_SHADER = 0;
+	protected:
+		int type;
+	};
+	
+	class _PolyExport PolycodeShaderModule : public PolycodeModule {
+	public:
+		PolycodeShaderModule();
+		virtual ~PolycodeShaderModule();
+		
+		virtual bool acceptsExtension(string extension) = 0;
+		virtual Resource* createProgramFromFile(string extension, string fullPath) = 0;
+		virtual string getShaderType() = 0;
+		virtual Shader *createShader(TiXmlNode *node) = 0;
+	
+		virtual bool applyShaderMaterial(Renderer *renderer, Material *material, ShaderBinding *localOptions, unsigned int shaderIndex) = 0;
+		bool hasShader(Shader *shader) { for(int i=0; i < shaders.size(); i++) { if(shaders[i] == shader){ return true; } } return false; }	
+		virtual void clearShader() = 0;
+		virtual void reloadPrograms() = 0;
+	protected:
+		vector<Shader*> shaders;
+	};
+	
+}

+ 41 - 0
Core/Contents/Include/PolyParticle.h

@@ -0,0 +1,41 @@
+/*
+ *  PolyParticle.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 7/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolySceneEntity.h"
+#include "PolyScenePrimitive.h"
+#include "PolyCoreServices.h"
+
+
+namespace Polycode {
+
+	class _PolyExport Particle {
+		public:
+			Particle(int particleType, Material *texture, Mesh *particleMesh);
+			~Particle();
+			void Reset();
+			
+			SceneEntity *particleBody;						
+			
+			Vector3 velVector;
+			Vector3 dirVector;	
+			Vector3 deviation;		
+			float life;
+			float lifespan;
+			float brightnessDeviation;
+			float perlinPosX;
+			float perlinPosY;
+			float perlinPosZ;
+			
+			static const int BILLBOARD_PARTICLE = 0;
+			static const int MESH_PARTICLE = 1;
+	};
+}

+ 110 - 0
Core/Contents/Include/PolyParticleEmitter.h

@@ -0,0 +1,110 @@
+/*
+ *  PolyParticleEmitter.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 7/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyEntity.h"
+#include "PolyScenePrimitive.h"
+#include "PolyCoreServices.h"
+#include "PolyParticle.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+	class _PolyExport ParticleEmitter : public SceneEntity {
+		public:
+			ParticleEmitter(string imageFile, Mesh *particleMesh, SceneMesh *emitter, Scene *particleParentScene, int particleType, int emitterType, float lifespan, unsigned int numParticles, Vector3 direction, Vector3 gravity, Vector3 deviation);
+			~ParticleEmitter();
+			void setRotationSpeed(float speed);
+			void setStartingColor(Color c);
+			void setEndingColor(Color c);
+			void setBlendingMode(int mode);
+			void setDepthWrite(bool val);
+			void setAlphaTest(bool val);
+		
+			void enablePerlin(bool val);
+			void setBillboardMode(bool mode);
+			void enableEmitter(bool val);
+			bool emitterEnabled();
+			
+			void setEmitterRadius(float rad);
+			void setStartingScaleModifier(float mod);
+			void setEndingScaleModifier(float mod);
+			void setEmitRotationVector(Vector3 rotVector);
+			void setEmitRotationDeviance(Vector3 rotVector);
+			void setAllAtOnce(bool val);
+			
+			void Trigger();
+			void resetParticle(Particle *particle);
+			
+			void setPerlinModSize(float size);
+			void setParticleCount(int count);
+
+			float particleSpeedMod;
+			float brightnessDeviation;
+			
+			void Update();
+
+			static const int CONTINUOUS_EMITTER = 0;
+			static const int TRIGGERED_EMITTER = 1;
+			static const int CLOUD_EMITTER = 2;
+			
+			Vector3 deviation;
+			Vector3 dirVector;
+			Vector3 gravVector;			
+
+			float lifespan;
+		
+			bool rotationFollowsPath;
+		
+			BezierCurve scaleCurve;
+		
+			BezierCurve colorCurveR;
+			BezierCurve colorCurveG;
+			BezierCurve colorCurveB;
+			BezierCurve colorCurveA;
+		
+		protected:
+		
+			SceneMesh *emitterMesh;
+			Mesh *pMesh;
+		
+			bool allAtOnce;
+			int emitterType;
+			int particleType;
+			Material *particleMaterial;
+		
+			bool isEmitterEnabled;
+		
+			Vector3 emitRotationVector;
+			Vector3 emitRotationDeviance;
+			float emitterRadius;
+			float perlinModSize;
+			Perlin *motionPerlin;
+			bool perlinEnabled;
+			float startingScaleMod;
+			float endingScaleMod;
+			
+			Scene *particleParentScene;			
+			
+			Color startingColor;
+			Color endingColor;
+			
+			float rotationSpeed;
+			float numParticles;
+			vector<Particle*> particles;
+			
+			float emitSpeed;
+			Timer *timer;
+	};
+
+}

+ 58 - 0
Core/Contents/Include/PolyPerlin.h

@@ -0,0 +1,58 @@
+/*
+ *  PolyPerlin.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/9/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Math
+
+#pragma once
+#include "PolyGlobals.h"
+
+#define SAMPLE_SIZE 1024
+
+namespace Polycode {
+
+class _PolyExport Perlin
+{
+public:
+
+  Perlin(int octaves,float freq,float amp,int seed);
+
+
+  float Get(float x,float y)
+  {
+    float vec[2];
+    vec[0] = x;
+    vec[1] = y;
+    return perlin_noise_2D(vec);
+  };
+
+private:
+  void init_perlin(int n,float p);
+  float perlin_noise_2D(float vec[2]);
+
+  float noise1(float arg);
+  float noise2(float vec[2]);
+  float noise3(float vec[3]);
+  void normalize2(float v[2]);
+  void normalize3(float v[3]);
+  void init(void);
+
+  int   mOctaves;
+  float mFrequency;
+  float mAmplitude;
+  int   mSeed;
+
+  int p[SAMPLE_SIZE + SAMPLE_SIZE + 2];
+  float g3[SAMPLE_SIZE + SAMPLE_SIZE + 2][3];
+  float g2[SAMPLE_SIZE + SAMPLE_SIZE + 2][2];
+  float g1[SAMPLE_SIZE + SAMPLE_SIZE + 2];
+  bool  mStart;
+
+};
+
+}

+ 70 - 0
Core/Contents/Include/PolyPolygon.h

@@ -0,0 +1,70 @@
+/*
+ *  PolyPolygon.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/14/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package BasicTypes
+
+#pragma once
+
+#include <math.h>
+#include "PolyGlobals.h"
+#include "PolyVertex.h"
+#include "PolyVector3.h"
+#include "PolyVector2.h"
+#include "PolyRectangle.h"
+#include <vector>
+
+using std::vector;
+
+using std::min;
+using std::max;
+
+namespace Polycode {
+
+	class _PolyExport Polygon {
+	
+		public:
+			Polygon();
+			~Polygon();
+			
+			unsigned int getVertexCount();
+			Vertex *getVertex(unsigned int index);
+			Vertex *addVertex(float x, float y, float z);
+			void addTexCoord(float u, float v);
+			void addTexCoord2(float u, float v);
+			Vector2 *getTexCoord(int index);
+			Vector2 *getTexCoord2(int index);
+			void addVertex(Vertex *vertex);
+			Vertex *addVertex(float x, float y, float z, float u, float v);
+			void calculateNormal();
+			
+			Vector3 getFaceNormal();
+			Rectangle getBounds2D();
+			
+			void setNormal(Vector3 normal);
+											
+			bool useVertexNormals;
+		
+			void flipUVY();
+			
+			void setUseFaceUV(bool val);
+			bool usesFaceUV();
+
+			bool hasSecUVs;
+						
+		private:
+		
+			bool useFaceUV;
+			unsigned int vertexCount;
+			vector<Vertex*> vertices;
+			vector<Vector2*> texCoords;
+			vector<Vector2*> texCoords2;
+			Vector3			*normal;
+	};
+
+}

+ 250 - 0
Core/Contents/Include/PolyQuaternion.h

@@ -0,0 +1,250 @@
+/*
+ *  PolyQuaternion.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/26/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyBasics.h"
+#include "PolyMatrix4.h"
+#include <math.h>
+
+// @package Math
+
+namespace Polycode {
+
+	class _PolyExport Quaternion {
+		public:
+			Quaternion(float w, float x, float y, float z) {
+				set(w,x,y,z);
+			}
+			Quaternion();
+			~Quaternion();
+		
+		inline void setFromMatrix(const Matrix4 &kRot) {
+			float fTrace = kRot.m[0][0]+kRot.m[1][1]+kRot.m[2][2];
+			float fRoot;
+			
+			if ( fTrace > 0.0 )
+			{
+				// |w| > 1/2, may as well choose w > 1/2
+				fRoot = sqrtf(fTrace + 1.0);  // 2w
+				w = 0.5*fRoot;
+				fRoot = 0.5/fRoot;  // 1/(4w)
+				x = (kRot.m[2][1]-kRot.m[1][2])*fRoot;
+				y = (kRot.m[0][2]-kRot.m[2][0])*fRoot;
+				z = (kRot.m[1][0]-kRot.m[0][1])*fRoot;
+			}
+			else
+			{
+				// |w| <= 1/2
+				static size_t s_iNext[3] = { 1, 2, 0 };
+				size_t i = 0;
+				if ( kRot.m[1][1] > kRot.m[0][0] )
+					i = 1;
+				if ( kRot.m[2][2] > kRot.m[i][i] )
+					i = 2;
+				size_t j = s_iNext[i];
+				size_t k = s_iNext[j];
+				
+				fRoot = sqrtf(kRot.m[i][i]-kRot.m[j][j]-kRot.m[k][k] + 1.0);
+				float* apkQuat[3] = { &x, &y, &z };
+				*apkQuat[i] = 0.5*fRoot;
+				fRoot = 0.5/fRoot;
+				w = (kRot.m[k][j]-kRot.m[j][k])*fRoot;
+				*apkQuat[j] = (kRot.m[j][i]+kRot.m[i][j])*fRoot;
+				*apkQuat[k] = (kRot.m[k][i]+kRot.m[i][k])*fRoot;
+			}			
+		}
+			
+			static Quaternion Slerp(float fT, const Quaternion& rkP, const Quaternion& rkQ, bool shortestPath=false);
+			float Dot(const Quaternion& rkQ) const;
+	Quaternion Log () const;
+    Quaternion Exp () const;	
+    float Norm () const;
+    float normalise(void);	
+    Quaternion operator+ (const Quaternion& rkQ) const;
+    Quaternion operator* (const Quaternion& rkQ) const;
+    Quaternion operator* (float fScalar) const;
+		
+		inline void lookAt(const Vector3 &D, const Vector3 &upVector) {
+			/*
+			Vector3 D;
+			Vector3 back = D * -1;
+			back.Normalize();
+			
+			Vector3 right = back.crossProduct(upVector) ;
+			right.Normalize();
+			right = right * -1;
+			
+			Vector3 up = back.crossProduct(right);
+			
+			set( y.z - z.y , z.x - x.z, x.y - y.x, tr + 1.0f ); 
+			 */
+		}
+		
+		void createFromMatrix(Matrix4 matrix) {
+			float  tr, s, q[4];
+			int    i, j, k;
+			
+			static const int nxt[3] = {1, 2, 0};			
+			
+			tr = matrix.m[0][0] + matrix.m[1][1] + matrix.m[2][2];
+			
+			
+			// check the diagonal
+			if (tr > 0.0f)
+			{
+                s = sqrtf(tr + 1.0f);
+                w = s / 2.0f;
+                s = 0.5f / s;
+                x = (matrix.m[1][2] - matrix.m[2][1]) * s;
+                y = (matrix.m[2][0] - matrix.m[0][2]) * s;
+                z = (matrix.m[0][1] - matrix.m[1][0]) * s;
+			}
+			else
+			{
+                // diagonal is negative
+                i = 0;
+                if (matrix.m[1][1] > matrix.m[0][0]) i = 1;
+                if (matrix.m[2][2] > matrix.m[i][i]) i = 2;
+                j = nxt[i];
+                k = nxt[j];
+				
+                s = sqrtf((matrix.m[i][i] - (matrix.m[j][j] + matrix.m[k][k])) + 1.0f);
+				
+                q[i] = s * 0.5f;
+				
+                if (s != 0.0f) s = 0.5f / s;
+				
+                q[3] = (matrix.m[j][k] - matrix.m[k][j]) * s;
+                q[j] = (matrix.m[i][j] + matrix.m[j][i]) * s;
+                q[k] = (matrix.m[i][k] + matrix.m[k][i]) * s;
+				
+                x = q[0];
+                y = q[1];
+                z = q[2];
+                w = q[3];
+			}
+			
+		}
+
+
+	inline bool operator== (const Quaternion& rhs) const
+	{
+			return (rhs.x == x) && (rhs.y == y) &&
+				(rhs.z == z) && (rhs.w == w);
+	}
+
+	inline bool operator!= (const Quaternion& rhs) const
+	{
+			return (rhs.x != x) && (rhs.y != y) &&
+				(rhs.z != z) && (rhs.w != w);
+	}
+
+
+    static Quaternion Squad(float fT, const Quaternion& rkP, const Quaternion& rkA, const Quaternion& rkB, const Quaternion& rkQ, bool shortestPath);
+	Quaternion Inverse () const;
+	
+    Quaternion operator- () const
+    {
+        return Quaternion(-w,-x,-y,-z);
+    }
+			
+			void set(float w, float x, float y, float z) {
+				this->w = w;
+				this->x = x;
+				this->y = y;
+				this->z = z;												
+			}
+			
+			Quaternion inverse() {
+				float fNorm = w*w+x*x+y*y+z*z;
+				float fInvNorm = 1.0/fNorm;
+				return Quaternion(w*fInvNorm,-x*fInvNorm,-y*fInvNorm,-z*fInvNorm);
+
+			}
+			
+	float InvSqrt(float x){
+   float xhalf = 0.5f * x;
+   int i = *(int*)&x; // store floating-point bits in integer
+   i = 0x5f3759d5 - (i >> 1); // initial guess for Newton's method
+   x = *(float*)&i; // convert new bits into float
+   x = x*(1.5f - xhalf*x*x); // One round of Newton's method
+   return x;
+}
+		
+	inline void fromAxes(float az, float ay, float ax) {
+		ax *= TORADIANS;
+		ay *= TORADIANS;
+		az *= TORADIANS;		
+		
+		float c1 = cos(ay / 2.0f);
+		float c2 = cos(ax / 2.0f);
+		float c3 = cos(az / 2.0f);
+		
+		float s1 = sin(ay / 2.0f);
+		float s2 = sin(ax / 2.0f);
+		float s3 = sin(az / 2.0f);
+		
+		w = (c1*c2*c3) - (s1*s2*s3);
+		x = (s1*s2*c3) + (c1*c2*s3);
+		y = (s1*c2*c3) + (c1*s2*s3);
+		z = (c1*s2*c3) - (s1*c2*s3);		
+	}
+			
+			
+    void FromAngleAxis (const float& rfAngle,
+        const Vector3& rkAxis)
+    {
+        float fHalfAngle ( 0.5*rfAngle );
+        float fSin = sin(fHalfAngle);
+        w = cos(fHalfAngle);
+        x = fSin*rkAxis.x;
+        y = fSin*rkAxis.y;
+        z = fSin*rkAxis.z;
+    }
+    //-----------------------------------------------------------------------
+    void ToAngleAxis (float& rfAngle, Vector3& rkAxis) 
+    {
+        // The quaternion representing the rotation is
+        //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+
+        float fSqrLength = x*x+y*y+z*z;
+        if ( fSqrLength > 0.0 )
+        {
+            rfAngle = 2.0*acos(w);
+            float fInvLength = InvSqrt(fSqrLength);
+            rkAxis.x = x*fInvLength;
+            rkAxis.y = y*fInvLength;
+            rkAxis.z = z*fInvLength;
+        }
+        else
+        {
+            // angle is 0 (mod 2*pi), so any axis will do
+            rfAngle = float(0.0);
+            rkAxis.x = 1.0;
+            rkAxis.y = 0.0;
+            rkAxis.z = 0.0;
+        }
+    }			
+			
+			void createFromAxisAngle(float x, float y, float z, float degrees);
+			Matrix4 createMatrix();
+			
+			
+			
+			Quaternion operator *(Quaternion q);
+			
+			float x;
+			float y;
+			float z;
+			float w;
+			
+		protected:
+	};
+}

+ 45 - 0
Core/Contents/Include/PolyQuaternionCurve.h

@@ -0,0 +1,45 @@
+/*
+ *  PolyQuaternionCurve.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/15/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Math
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyBezierCurve.h"
+#include "PolyQuaternion.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class _PolyExport QuatTriple {
+		public:
+		Quaternion q1;
+		Quaternion q2;
+		Quaternion q3;		
+	};	
+
+	class _PolyExport QuaternionCurve {
+		public:
+			QuaternionCurve(BezierCurve *wCurve, BezierCurve *xCurve, BezierCurve *yCurve, BezierCurve *zCurve);
+			~QuaternionCurve();
+		
+			Quaternion interpolate(float t, bool useShortestPath);
+			Quaternion interpolate(unsigned int fromIndex, float t, bool useShortestPath);
+						
+			void generatePointsFromCurves(BezierCurve *wCurve, BezierCurve *xCurve, BezierCurve *yCurve, BezierCurve *zCurve);
+			void recalcTangents(void);
+		
+		private:
+		
+			vector<QuatTriple> tPoints;
+			vector<Quaternion> points;			
+			vector<Quaternion> tangents;
+	};
+}

+ 26 - 0
Core/Contents/Include/PolyRectangle.h

@@ -0,0 +1,26 @@
+/*
+ *  PolyRectangle.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 8/7/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Math
+
+#pragma once
+#include "PolyGlobals.h"
+
+namespace Polycode {
+	class _PolyExport Rectangle {
+		public:
+			Rectangle(){x=0;y=0;w=0;h=0;}
+			Rectangle(float px, float py, float pw, float ph){x=px;y=py;w=pw;h=ph;}
+			void setRect(float x, float y, float w, float h);
+			
+			float x;
+			float y;
+			float w;
+			float h;
+	};
+}

+ 230 - 0
Core/Contents/Include/PolyRenderer.h

@@ -0,0 +1,230 @@
+/*
+ *  PolyRenderer.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Renderer
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyColor.h"
+#include "PolyPolygon.h"
+#include "PolyMesh.h"
+#include "PolyTexture.h"
+#include "PolyCubemap.h"
+#include "PolyMaterial.h"
+#include "PolyModule.h"
+#include "PolyVector3.h"
+#include "PolyQuaternion.h"
+#include "PolyMatrix4.h"
+
+namespace Polycode {
+	
+	class Texture;
+
+	class _PolyExport LightInfo {
+		public:
+			Vector3 position;
+			Vector3 color;
+			Vector3 dir;
+			float distance;
+			float intensity;
+			int type;
+			Matrix4 textureMatrix;
+	};
+
+	class _PolyExport Renderer {
+	public:
+		Renderer();
+		virtual ~Renderer();
+		
+		virtual void Resize(int xRes, int yRes) = 0;
+		
+		virtual void BeginRender() = 0;
+		virtual void EndRender() = 0;
+		
+		virtual Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5) = 0;		
+		virtual Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int type=Image::IMAGE_RGBA) = 0;
+		virtual void createRenderTextures(Texture **colorBuffer, Texture **depthBuffer, int width, int height) = 0;
+		
+		virtual Texture *createFramebufferTexture(unsigned int width, unsigned int height) = 0;
+		virtual void bindFrameBufferTexture(Texture *texture) = 0;
+		virtual void unbindFramebuffers() = 0;
+		
+		virtual void renderToTexture(Texture *targetTexture) = 0;
+		virtual void renderZBufferToTexture(Texture *targetTexture) = 0;
+		virtual void setViewportSize(int w, int h, float fov=45.0f) = 0;
+		
+		virtual void loadIdentity() = 0;		
+		virtual void setOrthoMode() = 0;
+		virtual void setPerspectiveMode() = 0;
+		
+		virtual void setTexture(Texture *texture) = 0;		
+		virtual void enableBackfaceCulling(bool val) = 0;
+		
+		virtual void setClearColor(float r, float g, float b) = 0;
+		virtual void setClearColor(Color color);
+		
+		virtual void setAmbientColor(float r, float g, float b);
+		
+		virtual void clearScreen() = 0;
+		
+		virtual void translate2D(float x, float y) = 0;
+		virtual void rotate2D(float angle) = 0;
+		virtual void scale2D(Vector2 *scale) = 0;
+		
+		virtual void setFOV(float fov) = 0;		
+		
+		virtual void setVertexColor(float r, float g, float b, float a) = 0;
+		
+		void pushDataArrayForMesh(Mesh *mesh, int arrayType);
+		
+		virtual void pushRenderDataArray(RenderDataArray *array) = 0;
+		virtual RenderDataArray *createRenderDataArrayForMesh(Mesh *mesh, int arrayType) = 0;
+		virtual RenderDataArray *createRenderDataArray(int arrayType) = 0;
+		virtual void setRenderArrayData(RenderDataArray *array, float *arrayData) = 0;
+		virtual void drawArrays(int drawType) = 0;
+		
+		virtual void translate3D(Vector3 *position) = 0;
+		virtual void translate3D(float x, float y, float z) = 0;
+		virtual void scale3D(Vector3 *scale) = 0;
+		
+		virtual void pushMatrix() = 0;
+		virtual void popMatrix() = 0;
+		
+		virtual void setLineSmooth(bool val) = 0;
+		virtual void setLineSize(float lineSize) = 0;
+		
+		virtual void enableLighting(bool enable) = 0;
+			
+		virtual void enableFog(bool enable) = 0;
+		virtual void setFogProperties(int fogMode, Color color, float density, float startDepth, float endDepth) = 0;
+				
+		virtual void multModelviewMatrix(Matrix4 m) = 0;
+		virtual void setModelviewMatrix(Matrix4 m) = 0;
+		
+		virtual void setBlendingMode(int blendingMode) = 0;	
+			
+		virtual void applyMaterial(Material *material, ShaderBinding *localOptions, unsigned int shaderIndex) = 0;
+		virtual void clearShader() = 0;
+		
+		virtual void setDepthFunction(int depthFunction) = 0;
+				
+		virtual void createVertexBufferForMesh(Mesh *mesh) = 0;
+		virtual void drawVertexBuffer(VertexBuffer *buffer) = 0;
+		
+		void setRenderMode(int newRenderMode);
+		int getRenderMode();
+		
+		virtual void enableDepthTest(bool val) = 0;
+		
+		void billboardMatrix();
+		void billboardMatrixWithScale(Vector3 scale);
+		
+		void setTextureFilteringMode(int mode);
+		
+		virtual void enableAlphaTest(bool val) = 0;
+		
+		virtual void clearBuffer(bool colorBuffer, bool depthBuffer) = 0;
+		virtual void drawToColorBuffer(bool val) = 0;
+		
+		Matrix4 getCameraMatrix();
+		void setCameraMatrix(Matrix4 matrix);
+		void setCameraPosition(Vector3 pos);
+		
+		virtual void drawScreenQuad(float qx, float qy) = 0;
+		
+		int getXRes();
+		int getYRes();
+		
+		void clearLights();
+		void addLight(Vector3 position, Vector3 direction, int type, Color color, float distance, float intensity, Matrix4 *textureMatrix);
+		
+		void setExposureLevel(float level);
+		
+		bool rayTriangleIntersect(Vector3 ray_origin, Vector3 ray_direction, Vector3 vert0, Vector3 vert1, Vector3 vert2, Vector3 *hitPoint);
+		
+		void enableShaders(bool flag);
+		
+		void addShaderModule(PolycodeShaderModule *module);
+		
+		virtual bool test2DCoordinate(float x, float y, Polygon *poly, const Matrix4 &matrix, bool billboardMode) = 0;
+		
+		virtual Matrix4 getProjectionMatrix() = 0;
+		virtual Matrix4 getModelviewMatrix() = 0;
+		
+		static const int RENDER_MODE_NORMAL = 0;
+		static const int RENDER_MODE_WIREFRAME = 1;
+		
+		static const int BLEND_MODE_NORMAL = 0;
+		static const int BLEND_MODE_LIGHTEN = 1;
+		static const int BLEND_MODE_COLOR = 2;
+		
+		static const int FOG_LINEAR = 0;
+		static const int FOG_EXP = 1;
+		static const int FOG_EXP2 = 2;
+		
+		static const int DEPTH_FUNCTION_GREATER = 0;
+		static const int DEPTH_FUNCTION_LEQUAL = 1;	
+		
+		static const int TEX_FILTERING_NEAREST = 0;
+		static const int TEX_FILTERING_LINEAR = 1;
+		
+		void addShadowMap(Texture *texture);
+		vector<Texture*> getShadowMapTextures(){ return shadowMapTextures; };
+		
+		virtual Vector3 Unproject(float x, float y) = 0;
+		
+		Color	ambientColor;
+		Color	clearColor;		
+		float exposureLevel;		
+		Vector3 cameraPosition;
+		
+		int getNumAreaLights() { return numAreaLights; }
+		int getNumSpotLights() { return numSpotLights; }
+		int getNumLights() { return numLights; }
+		
+		vector<LightInfo> getAreaLights() { return areaLights; }
+		vector<LightInfo> getSpotLights() { return spotLights;	}
+		
+	protected:
+	
+				
+		Texture *currentTexture;
+		Material *currentMaterial;
+		
+		vector<Texture*> shadowMapTextures;
+		
+		Texture *currentFrameBufferTexture;
+		Texture *previousFrameBufferTexture;
+			
+		int textureFilteringMode;
+		int renderMode;
+		
+		Matrix4 cameraMatrix;
+	
+		PolycodeShaderModule* currentShaderModule;
+		vector <PolycodeShaderModule*> shaderModules;
+
+		vector<LightInfo> lights;
+		vector<LightInfo> areaLights;
+		vector<LightInfo> spotLights;		
+		int numLights;
+		int numAreaLights;
+		int numSpotLights;
+		
+		bool shadersEnabled;
+		float fov;
+		
+		bool lightingEnabled;
+		
+		bool orthoMode;
+	
+		int xRes;
+		int yRes;
+	};
+}

+ 47 - 0
Core/Contents/Include/PolyResource.h

@@ -0,0 +1,47 @@
+/*
+ *  PolyResource.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/19/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package BasicTypes
+
+#pragma once
+#include "PolyGlobals.h"
+#include <vector>
+#include <string>
+
+using std::vector;
+using std::string;
+
+namespace Polycode {
+	class _PolyExport Resource {
+		public:
+			Resource(int type);
+			virtual ~Resource();
+			
+			string getResourceName();
+			int getResourceType();
+			void setResourceName(string newName);
+			void setResourcePath(string path);
+			string getResourcePath();		
+
+			static const int RESOURCE_TEXTURE = 0;
+			static const int RESOURCE_MATERIAL = 1;
+			static const int RESOURCE_SHADER = 2;
+			static const int RESOURCE_PROGRAM = 3;
+			static const int RESOURCE_MESH = 5;
+			static const int RESOURCE_CUBEMAP = 6;				
+			
+		protected:
+			
+			int type;
+			string resourcePath;
+			string name;
+	
+					
+	};
+}

+ 56 - 0
Core/Contents/Include/PolyResourceManager.h

@@ -0,0 +1,56 @@
+/*
+ *  PolyResourceManager.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 8/30/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Services
+
+#pragma once
+#include "PolyGlobals.h"
+#include <vector>
+#include <string>
+#include "OSBasics.h"
+#include "PolyTexture.h"
+#include "PolyCubemap.h"
+#include "PolyResource.h"
+#include "PolyCoreServices.h"
+#include "PolyModule.h"
+#include "tinyxml.h"
+#include "physfs.h"
+
+using std::vector;
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ResourceManager {
+		public:
+			ResourceManager();
+			~ResourceManager();
+			
+			void addResource(Resource *resource);
+			
+			void addDirResource(string dirPath, bool recursive);
+			void addArchive(string zipPath);
+		
+			bool readFile(string fileName){ return false;}
+		
+			void parseTextures(string dirPath, bool recursive);
+			void parseMaterials(string dirPath, bool recursive);
+			void parseShaders(string dirPath, bool recursive);
+			void parsePrograms(string dirPath, bool recursive);
+			void parseCubemaps(string dirPath, bool recursive);
+		
+			Resource *getResource(int resourceType, string resourceName);
+		
+			void addShaderModule(PolycodeShaderModule *module);
+		
+		
+		private:
+			vector <Resource*> resources;
+			vector <PolycodeShaderModule*> shaderModules;
+	};
+}

+ 54 - 0
Core/Contents/Include/PolySDLCore.h

@@ -0,0 +1,54 @@
+/*
+ *  PolySDLCore.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Core
+/*
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCore.h"
+#include "PolyRectangle.h"
+#include <vector>
+
+using std::vector;
+
+#if PLATFORM == PLATFORM_WINDOWS
+	#include <winsock2.h>
+#endif
+
+#ifdef COMPILE_SDL_CORE
+
+namespace Polycode {
+	class _PolyExport SDLCore : public Core {
+		
+	public:
+		
+		SDLCore(int xRes, int yRes, bool fullScreen, int aaLevel);
+		~SDLCore();
+
+		void enableMouse(bool newval);
+		unsigned int getTicks();
+		
+		bool Update();
+		
+		void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);
+		
+		void createThread(Threaded *target);
+		
+		vector<Rectangle> getVideoModes();
+		
+	private:
+		
+		
+		
+	};
+}
+
+#endif
+
+*/

+ 72 - 0
Core/Contents/Include/PolyScene.h

@@ -0,0 +1,72 @@
+/*
+ *  PolyScene.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolySceneEntity.h"
+#include "PolyCamera.h"
+#include "PolySceneLight.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+		
+	class Camera;
+	class SceneLight;
+	
+	class _PolyExport Scene : public EventDispatcher {
+	public:
+		
+		Scene();
+		virtual ~Scene();
+		
+		virtual void Render() = 0;
+		virtual void RenderDepthOnly(Camera *targetCamera) = 0;
+		
+		void addEntity(SceneEntity *entity);
+		void removeEntity(SceneEntity *entity);
+		Camera *getDefaultCamera();
+		
+		void enableLighting(bool enable);
+		void enableFog(bool enable);
+		void setFogProperties(int fogMode, Color color, float density, float startDepth, float endDepth);
+
+		virtual void Update();
+		void setVirtual(bool val);
+		bool isVirtual();
+	
+		bool isEnabled();
+		void setEnabled(bool enabled);
+		
+		int getNumEntities() { return entities.size(); }
+		SceneEntity *getEntity(int index) { return entities[index]; }
+		
+		SceneEntity *getEntityAtCursor(float x, float y);
+		
+	protected:
+		
+		bool isSceneVirtual;
+		bool enabled;
+		
+		Camera *defaultCamera;
+		vector <SceneEntity*> entities;
+		
+		bool lightingEnabled;
+		bool fogEnabled;
+		int fogMode;
+		Color fogColor;
+		float fogDensity;
+		float fogStartDepth;
+		float fogEndDepth;
+		
+	};
+}

+ 38 - 0
Core/Contents/Include/PolySceneEntity.h

@@ -0,0 +1,38 @@
+/*
+ *  PolySceneEntity.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Scene
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include "PolyRenderer.h"
+#include "PolyVector3.h"
+#include "PolyMatrix4.h"
+#include "PolyQuaternion.h"
+#include "PolyEntity.h"
+#include "PolyEventHandler.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class _PolyExport SceneEntity : public Entity, public EventHandler {
+		public:
+			SceneEntity();
+			virtual ~SceneEntity();
+		
+			virtual bool testMouseCollision(float x, float y) { return false;}
+
+			void ok() { Logger::log("ok!!1\n"); }
+			
+		protected:
+
+	};
+}

+ 47 - 0
Core/Contents/Include/PolySceneLabel.h

@@ -0,0 +1,47 @@
+/*
+ *  PolySceneLabel.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/31/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyFont.h"
+#include "PolyLabel.h"
+#include "PolyMesh.h"
+#include "PolyTexture.h"
+#include "PolyPolygon.h"
+#include "PolySceneEntity.h"
+
+#include <string>
+using std::string;
+
+namespace Polycode {
+	
+	class _PolyExport SceneLabel : public SceneEntity {
+		public:
+			
+			SceneLabel(string fontName, wstring text, int size, float scale, int amode);
+			~SceneLabel();			
+		
+			bool testMouseCollision(float x, float y);
+		
+			void setText(wstring newText);
+			Label *getLabel();
+			void Render();
+			
+		protected:
+			
+			Mesh *mesh;
+			Texture *texture;		
+		
+			float scale;
+			Label *label;
+	};
+}

+ 72 - 0
Core/Contents/Include/PolySceneLight.h

@@ -0,0 +1,72 @@
+/*
+ *  PolySceneLight.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/21/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolySceneEntity.h"
+#include "PolyCoreServices.h"
+#include "PolyScene.h"
+#include "PolyCamera.h"
+#include "PolyMesh.h"
+
+namespace Polycode {
+
+	class Scene;
+	class Camera;
+	class _PolyExport SceneLight : public SceneEntity {
+		public:
+			SceneLight(int type, float intensity, float distance, Scene *parentScene);
+			virtual ~SceneLight();
+		
+			float getIntensity();
+			float getDistance();
+			int getType();
+			
+			void renderDepthMap(Scene *scene);
+			
+			void Render();
+
+			Matrix4 getLightViewMatrix();
+			
+			static const int AREA_LIGHT = 0;
+			static const int SPOT_LIGHT = 1;
+			
+			Texture *getZBufferTexture();
+			Color lightColor;
+		
+			void setLightColor(float r, float g, float b) { lightColor.r = r; lightColor.g = g; lightColor.b = b; }
+			void enableShadows(bool val, float resolution=256);
+			void setShadowMapFOV(float fov);
+		
+			bool areShadowsEnabled();
+		
+			int getLightType() { return type; }
+		
+		private:
+		
+			int type;
+			float intensity;
+			
+			Camera *spotCamera;
+			Texture *zBufferTexture;
+		
+			Scene *parentScene;
+			
+			Matrix4 lightViewMatrix;
+		
+			float shadowMapRes;
+			float shadowMapFOV;	
+			bool shadowsEnabled;
+		
+			float distance;
+			Mesh *lightMesh;
+	};
+}

+ 30 - 0
Core/Contents/Include/PolySceneLine.h

@@ -0,0 +1,30 @@
+/*
+ *  PolySceneLine.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 10/8/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolySceneEntity.h"
+#include "PolyCoreServices.h"
+
+namespace Polycode {
+	class _PolyExport SceneLine : public SceneEntity {
+		public:
+			SceneLine(Vector3 p1, Vector3 p2);
+			~SceneLine();
+			
+			void Render();
+			
+		private:
+			Vertex v1;
+			Vertex v2;
+	};
+
+}

+ 46 - 0
Core/Contents/Include/PolySceneManager.h

@@ -0,0 +1,46 @@
+/*
+ *  PolySceneManager.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Services
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyScene.h"
+#include "PolySceneRenderTexture.h"
+
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+	
+	class Scene;
+	class SceneRenderTexture;
+	
+	class _PolyExport SceneManager {
+		public:
+		SceneManager();
+		~SceneManager();
+		
+		void addScene(Scene *newScene);
+		void Update();
+		void UpdateVirtual();
+		void removeScene(Scene *scene);	
+		void registerRenderTexture(SceneRenderTexture *renderTexture);
+		
+		private:
+		
+		void updateRenderTextures(Scene *scene);
+		
+		vector <Scene*> scenes;
+		vector <SceneRenderTexture*> renderTextures;
+			
+	};
+
+}

+ 68 - 0
Core/Contents/Include/PolySceneMesh.h

@@ -0,0 +1,68 @@
+/*
+ *  PolySceneMesh.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+ 
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolySceneEntity.h"
+#include "PolyMesh.h"
+#include "PolySkeleton.h"
+#include "PolyMaterial.h"
+#include "PolyImage.h"
+#include <string>
+
+using namespace std;
+
+namespace Polycode {
+
+	class Texture;
+
+	class _PolyExport SceneMesh : public SceneEntity {
+		public:
+			SceneMesh(string fileName);
+			SceneMesh(int meshType);
+			SceneMesh(Mesh *mesh);
+			virtual ~SceneMesh();
+			
+			void Render();
+			
+			ShaderBinding *getLocalShaderOptions();
+			
+			Mesh *getMesh();
+			Texture *getTexture();
+			Material *getMaterial();
+			void loadTexture(string fileName);
+			void loadSkeleton(string fileName);
+			void setTexture(Texture *texture);
+			void setMaterial(Material *material);
+			void setMaterial(string materialName);
+		
+			void setSkeleton(Skeleton *skeleton);
+			Skeleton *getSkeleton();
+		
+			void renderMeshLocally();
+			void cacheToVertexBuffer(bool cache);
+	
+			// for static lightmaps
+			unsigned int lightmapIndex;
+			
+			bool showVertexNormals;
+		
+		protected:
+		
+			bool useVertexBuffer;
+			Mesh *mesh;
+			Texture *texture;
+			Material *material;
+			Skeleton *skeleton;
+			ShaderBinding *localShaderOptions;
+	};
+}

+ 36 - 0
Core/Contents/Include/PolyScenePrimitive.h

@@ -0,0 +1,36 @@
+/*
+ *  PolyScenePrimitive.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 6/15/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolySceneMesh.h"
+#include "PolyCoreServices.h"
+
+#include <string>
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ScenePrimitive : public SceneMesh {
+		public:
+		
+			ScenePrimitive(int type, float v1=1.0f, float v2=1.0f, float v3=1.0f);
+			virtual ~ScenePrimitive();
+
+			static const int TYPE_BOX = 0;		
+			static const int TYPE_PLANE = 1;
+			static const int TYPE_SPHERE = 2;
+		
+		private:
+		
+	};
+	
+}

+ 38 - 0
Core/Contents/Include/PolySceneRenderTexture.h

@@ -0,0 +1,38 @@
+/*
+ *  PolySceneRenderTexture.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 8/6/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Scene
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyScene.h"
+#include "PolyTexture.h"
+
+namespace Polycode {
+	class Scene;
+	class Camera;
+	
+	class _PolyExport SceneRenderTexture {
+		public:
+			SceneRenderTexture(Scene *targetScene, Camera *targetCamera, int renderWidth,int renderHeight);
+			~SceneRenderTexture();
+			
+			void drawScreen();
+			
+			Texture *getTargetTexture();
+			Scene *getTargetScene();
+			Camera *getTargetCamera();	
+				
+		protected:
+		
+			Texture *targetTexture;
+			Scene *targetScene;
+			Camera *targetCamera;
+	};
+}

+ 76 - 0
Core/Contents/Include/PolyScreen.h

@@ -0,0 +1,76 @@
+/*
+ *  PolyScreen.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyScreenEntity.h"
+#include "PolyRenderer.h"
+#include "PolyInputEvent.h"
+#include "PolyCoreServices.h"
+#include <vector>
+#include <algorithm>
+#include "PolyScreenEvent.h"
+
+using namespace std;
+
+namespace Polycode {
+	class _PolyExport Screen : public EventDispatcher {
+	public:
+		
+		Screen();
+		~Screen();
+		ScreenEntity* addChild(ScreenEntity *newEntity);
+		ScreenEntity* removeChild(ScreenEntity *entityToRemove);
+		
+		void setScreenOffset(float x, float y);
+		Vector2 getScreenOffset();
+		
+		virtual void Shutdown();
+		virtual void Update();
+		ScreenEntity *getEntityAt(float x, float y);
+		void Render();
+		void setRenderer(Renderer *renderer);
+		
+		void setScreenShader(string shaderName);
+		
+		void handleEvent(Event *event);
+		int getHighestZIndex();
+		void sortChildren();
+		
+		static bool cmpZindex(const ScreenEntity *left, const ScreenEntity *right);
+		
+		void handleInputEvent(InputEvent *inputEvent);
+		bool hasFilterShader();
+		void drawFilter();
+		
+		bool Lua_EntitiesEqual(ScreenEntity *ent1, ScreenEntity *ent2) { return ent1 == ent2; }
+		
+		ScreenEntity *getRootEntity() { return rootEntity; }
+		
+		bool enabled;
+		
+	protected:
+		
+		ScreenEntity *rootEntity;
+		
+		Vector2 offset;
+		Renderer *renderer;
+		ScreenEntity *focusChild;
+		vector <ScreenEntity*> children;
+		
+		Material *filterShaderMaterial;			
+		Texture *originalSceneTexture;			
+		Texture *zBufferSceneTexture;						
+		vector<ShaderBinding*> localShaderOptions;
+		bool _hasFilterShader;
+	};
+}

+ 32 - 0
Core/Contents/Include/PolyScreenCurve.h

@@ -0,0 +1,32 @@
+/*
+ *  PolyScreenCurve.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/5/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyScreenEntity.h"
+#include "PolyBezierCurve.h"
+#include "PolyPolygon.h"
+#include "PolyScreenShape.h"
+
+namespace Polycode {
+
+	class _PolyExport ScreenCurve : public ScreenShape {
+		public:
+			ScreenCurve(BezierCurve *curve, int numVertices);
+			~ScreenCurve();
+			
+		protected:
+		
+			float numVertices;
+			BezierCurve *curve;
+	};
+}

+ 123 - 0
Core/Contents/Include/PolyScreenEntity.h

@@ -0,0 +1,123 @@
+/*
+ *  PolyScreenEntity.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyVector2.h"
+#include "PolyInputEvent.h"
+#include "PolyEventDispatcher.h"
+#include "PolyRectangle.h"
+#include "PolyEntity.h"
+
+
+namespace Polycode {
+
+	
+class _PolyExport ScreenEntity : public Entity, public EventDispatcher {
+		
+	public:
+		using Entity::setPosition;		
+		using Entity::setScale;		
+	
+		ScreenEntity();
+		~ScreenEntity();
+		
+		void setPosition(float x, float y);
+		void setScale(float x, float y);
+		void setRotation(float roatation);
+		float getRotation();
+			
+		bool _onMouseDown(float x, float y, int timestamp);
+		bool _onMouseUp(float x, float y, int timestamp);
+		void _onMouseMove(float x, float y, int timestamp);
+		void _onMouseWheelUp(float x, float y, int timestamp);
+		void _onMouseWheelDown(float x, float y, int timestamp);
+	
+		virtual void onMouseDown(float x, float y){}
+		virtual void onMouseUp(float x, float y){}
+		virtual	void onMouseMove(float x, float y){}
+		virtual void onMouseWheelUp(float x, float y) {}
+		virtual void onMouseWheelDown(float x, float y) {}
+	
+		void _onKeyDown(TAUKey key, wchar_t charCode);	
+		void _onKeyUp(TAUKey key, wchar_t charCode);	
+		
+		virtual void onKeyDown(TAUKey key, wchar_t charCode){}
+		virtual void onKeyUp(TAUKey key, wchar_t charCode){}
+		
+		bool hitTest(float x, float y);		
+	
+		Matrix4 buildPositionMatrix();
+		void adjustMatrixForChildren();
+
+		float getWidth();
+		float getHeight();
+	
+		void setWidth(float w) { width = w; hitwidth = w; }
+		void setHeight(float h) { height = h; hitheight = h; }
+	
+		virtual void onGainFocus(){}
+		virtual void onLoseFocus(){}		
+		
+		void startDrag(float xOffset, float yOffset);
+		void stopDrag();
+				
+		void setBlendingMode(int newBlendingMode);
+		void setPositionMode(int newPositionMode);
+		
+		void setDragLimits(Rectangle rect);
+		void clearDragLimits();
+		
+		void focusChild(ScreenEntity *child);
+		void focusNextChild();
+	
+		Vector2 getPosition2D();
+		
+		static const int POSITION_TOPLEFT = 0;
+		static const int POSITION_CENTER = 1;
+
+		bool isFocusable();
+		
+		bool hasFocus;
+		bool blockMouseInput;
+		int zindex;	
+	
+		bool snapToPixels;
+
+
+	protected:
+	
+		bool focusable;
+		bool focusChildren;
+		
+		bool isDragged;
+		float dragOffsetX;
+		float dragOffsetY;
+		
+		bool mouseOver;
+		float width;
+		float height;
+
+		float hitwidth;
+		float hitheight;
+		
+		float xmouse;
+		float ymouse;
+		
+		int positionMode;		
+		Rectangle *dragLimits;
+		
+		int lastClickTicks;
+		ScreenEntity *focusedChild;
+
+};
+
+}

+ 31 - 0
Core/Contents/Include/PolyScreenEvent.h

@@ -0,0 +1,31 @@
+/*
+ *  PolyScreenEvent.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 8/27/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyEvent.h"
+
+namespace Polycode {
+
+	class _PolyExport ScreenEvent : public Event {
+		public:
+			ScreenEvent();
+			~ScreenEvent();
+		
+			static const int ENTITY_MOVE_TOP = 0;
+			static const int ENTITY_MOVE_BOTTOM = 1;
+			static const int ENTITY_MOVE_UP = 2;
+			static const int ENTITY_MOVE_DOWN = 3;
+			
+		protected:		
+			
+	};
+}

+ 44 - 0
Core/Contents/Include/PolyScreenImage.h

@@ -0,0 +1,44 @@
+/*
+ *  PolyScreenImage.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include <math.h>
+#include "PolyGlobals.h"
+#include "PolyScreenShape.h"
+#include "PolyCoreServices.h"
+#include "PolyImage.h"
+#include "PolyMesh.h"
+#include "PolyTexture.h"
+
+#include <string>
+
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ScreenImage : public ScreenShape {
+		public:
+		ScreenImage(string fileName);
+		ScreenImage(Image *image);		
+		~ScreenImage();
+		
+		void setImageCoordinates(float x, float y, float width, float height);
+		float getImageWidth();
+		float getImageHeight();
+		
+		private:
+
+		float imageWidth;
+		float imageHeight;
+		
+	};
+
+}

+ 47 - 0
Core/Contents/Include/PolyScreenLabel.h

@@ -0,0 +1,47 @@
+/*
+ *  PolyScreenLabel.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/16/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyScreenShape.h"
+#include "PolyScreenImage.h"
+#include "PolyFont.h"
+#include "PolyLabel.h"
+#include "PolyTexture.h"
+#include "PolyPolygon.h"
+#include "PolyMesh.h"
+
+#include <string>
+using std::string;
+using std::wstring;
+
+namespace Polycode {
+
+	class _PolyExport ScreenLabel : public ScreenShape {
+		public:
+			
+			ScreenLabel(string fontName, wstring text, int size, int amode);
+			~ScreenLabel();		
+		
+			void addDropShadow(Color color, float size, float offsetX, float offsetY);
+			void setText(wstring newText);
+			wstring getText();
+		
+			Label *getLabel();
+			
+		protected:
+			
+			Label *label;
+			ScreenImage *dropShadowImage;
+	};
+}

+ 47 - 0
Core/Contents/Include/PolyScreenLine.h

@@ -0,0 +1,47 @@
+/*
+ *  PolyScreenLine.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/8/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyScreenEntity.h"
+#include "PolyCoreServices.h"
+#include "PolyMesh.h"
+
+#include <string>
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ScreenLine : public ScreenEntity {
+		public:
+			
+			ScreenLine(Vector2* start, Vector2* end);
+			ScreenLine(ScreenEntity* target1, ScreenEntity* target2);
+			~ScreenLine();
+
+			void Update();
+			void Render();
+			void setLineWidth(float width);
+			
+		protected:
+		
+			float lineWidth;
+			
+			Vertex startVertex;
+			Vertex endVertex;
+		
+			RenderDataArray *vertexDataArray;
+
+			ScreenEntity *target1;
+			ScreenEntity *target2;
+			
+	};
+}

+ 47 - 0
Core/Contents/Include/PolyScreenManager.h

@@ -0,0 +1,47 @@
+/*
+ *  ScreenManager.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/15/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Services
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include "PolyScreen.h"
+//#include "PolyPhysicsScreen.h"
+#include "PolyCoreServices.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class Screen;
+
+	class _PolyExport ScreenManager : public EventDispatcher {
+		public:
+		ScreenManager();
+		~ScreenManager();
+		
+//		Screen *createScreen(int screenType);
+		void removeScreen(Screen *screen);
+		void addScreen(Screen* screen);
+		void Update();
+		
+		void handleEvent(Event *event);
+		
+		static const int REGULAR_SCREEN = 1;
+		static const int PHYSICS_SCREEN = 2;
+		
+		private:
+		
+		vector <Screen*> screens;
+			
+	};
+
+}

+ 44 - 0
Core/Contents/Include/PolyScreenMesh.h

@@ -0,0 +1,44 @@
+/*
+ *  PolyScreenMesh.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/6/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyScreenEntity.h"
+#include "PolyMesh.h"
+#include "PolyTexture.h"
+#include "PolyPolygon.h"
+
+#include <string>
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ScreenMesh : public ScreenEntity {
+		public:
+			ScreenMesh(string fileName);
+			ScreenMesh(int meshType);
+			~ScreenMesh();
+			
+			void Render();
+			
+			Mesh *getMesh();
+			Texture *getTexture();
+			void loadTexture(string fileName);
+			void loadTexture(Image *image);	
+			void setTexture(Texture *texture);
+			
+		protected:
+		
+			Mesh *mesh;
+			Texture *texture;
+	};
+}

+ 63 - 0
Core/Contents/Include/PolyScreenShape.h

@@ -0,0 +1,63 @@
+/*
+ *  PolyScreenShape.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/6/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Screen
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyScreenEntity.h"
+#include "PolyScreenMesh.h"
+#include "PolyPolygon.h"
+#include "PolyMesh.h"
+
+#include <string>
+using std::string;
+
+namespace Polycode {
+
+	class _PolyExport ScreenShape : public ScreenMesh {
+		public:
+			
+			ScreenShape(int shapeType, float option1=0, float option2=0, float option3=0, float option4=0);
+			~ScreenShape();
+			void Render();
+					
+			void setStrokeColor(float r, float g, float b, float a);
+			void setStrokeWidth(float width);
+			
+			void setGradient(float r1, float g1, float b1, float a1, float r2, float g2, float b2, float a2);
+			void clearGradient();
+		
+			void setShapeSize(float newWidth, float newHeight);
+		
+			void addShapePoint(float x, float y);
+			
+			static const int SHAPE_RECT = 1;
+			static const int SHAPE_CIRCLE = 2;
+			static const int SHAPE_CIRCLE_OUTLINE = 3;
+			static const int SHAPE_CUSTOM = 4;
+			
+			bool strokeEnabled;
+			Color strokeColor;
+			bool lineSmooth;
+			
+		protected:
+		
+			float option1;
+			float option2;
+			float option3;
+			float option4;
+									
+			Polygon *customShapePoly;
+			float strokeWidth;
+			int shapeType;
+			
+	};
+}

+ 53 - 0
Core/Contents/Include/PolyScreenSprite.h

@@ -0,0 +1,53 @@
+/*
+ *  PolyScreenSprite.cpp
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/13/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "PolyGlobals.h"
+#include "PolyCoreServices.h"
+#include "PolyScreenShape.h"
+#include <vector>
+#include <string>
+
+namespace Polycode {
+
+class SpriteAnimation {
+	public:
+		float speed;
+		string name;
+		int numFrames;
+	
+		vector<Vector2> framesOffsets;
+};
+
+class ScreenSprite : public ScreenShape 
+{
+	public:
+		ScreenSprite(string fileName, float spriteWidth, float spriteHeight);
+		~ScreenSprite();
+		
+		void addAnimation(string name, string frames, float speed);
+		void playAnimation(string name, int startFrame, bool once);
+		void Update();
+		
+	private:
+	
+		float spriteWidth;
+		float spriteHeight;
+			
+		bool playingOnce;
+		float lastTick;
+		
+		float spriteUVWidth;
+		float spriteUVHeight;
+		int currentFrame;
+		SpriteAnimation *currentAnimation;
+		
+		vector<SpriteAnimation*> animations;
+};
+	
+}

+ 102 - 0
Core/Contents/Include/PolyShader.h

@@ -0,0 +1,102 @@
+/*
+ *  PolyShader.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/20/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Materials
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyResource.h"
+#include "PolyTexture.h"
+#include "PolyCubemap.h"
+
+namespace Polycode {
+
+	class ShaderBinding;
+	class _PolyExport Shader : public Resource {
+		public:
+			Shader(int type);
+			virtual ~Shader();
+
+			int getType();
+			void setName(string name);
+			string getName();
+			
+			virtual ShaderBinding *createBinding() = 0;
+
+			static const int FIXED_SHADER = 0;
+			static const int MODULE_SHADER = 1;
+							
+		protected:
+		
+			string name;
+			int type;
+	};
+	
+	class _PolyExport ShaderRenderTarget {
+		public:
+			string id;
+			float width;
+			float height;
+			int sizeMode;
+			bool hasSize;
+			Texture *texture;
+			
+			static const int SIZE_MODE_PIXELS = 0;
+			static const int SIZE_MODE_NORMALIZED = 1;
+	};
+	
+	typedef struct {
+		string name;
+		void *data;		
+	} LocalShaderParam;	
+	
+	typedef struct {
+			string id;
+			string name;
+			int mode;
+			Texture *texture;
+			float width;
+			float height;			
+			static const int MODE_IN= 0;
+			static const int MODE_OUT = 1;
+	} RenderTargetBinding;
+
+	class _PolyExport ShaderBinding {
+		public:
+			ShaderBinding(Shader *shader);
+			virtual ~ShaderBinding();
+			
+			virtual void clearTexture(string name){};
+			virtual void addTexture(string name, Texture *texture)  {};
+			virtual void addParam(string type, string name, string value) {};
+			virtual void addCubemap(string name, Cubemap *cubemap) {};
+		
+			unsigned int getNumLocalParams();
+			LocalShaderParam *getLocalParam(unsigned int index);
+			LocalShaderParam *getLocalParamByName(string name);
+			
+			void addRenderTargetBinding(RenderTargetBinding *binding);
+
+			unsigned int getNumRenderTargetBindings();
+			RenderTargetBinding *getRenderTargetBinding(unsigned int index);
+
+			unsigned int getNumInTargetBindings();
+			RenderTargetBinding *getInTargetBinding(unsigned int index);
+
+			unsigned int getNumOutTargetBindings();
+			RenderTargetBinding *getOutTargetBinding(unsigned int index);
+
+			
+			Shader* shader;
+			vector<LocalShaderParam*> localParams;
+			vector<RenderTargetBinding*> renderTargetBindings;
+			vector<RenderTargetBinding*> inTargetBindings;
+			vector<RenderTargetBinding*> outTargetBindings;
+	};
+
+}

+ 108 - 0
Core/Contents/Include/PolySkeleton.h

@@ -0,0 +1,108 @@
+/*
+ *  PolySkeleton.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/4/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyBone.h"
+#include <string>
+#include <vector>
+
+using std::string;
+using std::vector;
+
+namespace Polycode {
+
+	class _PolyExport BoneTrack {
+		public:
+			BoneTrack(Bone *bone);
+			~BoneTrack();
+			void Play();
+			void Stop();
+			void Update();
+		
+			void setSpeed(float speed);
+			
+			BezierCurve *scaleX;
+			BezierCurve *scaleY;
+			BezierCurve *scaleZ;
+			BezierCurve *QuatW;
+			BezierCurve *QuatX;
+			BezierCurve *QuatY;
+			BezierCurve *QuatZ;
+			BezierCurve *LocX;			
+			BezierCurve *LocY;
+			BezierCurve *LocZ;
+			
+			Vector3 LocXVec;
+			Vector3 LocYVec;
+			Vector3 LocZVec;						
+
+			Quaternion boneQuat;
+			QuaternionTween *quatTween;
+			
+			Vector3 QuatWVec;
+			Vector3 QuatXVec;
+			Vector3 QuatYVec;			
+			Vector3 QuatZVec;		
+			
+		protected:
+			
+			bool initialized;
+		
+			Bone *targetBone;
+			vector <BezierPathTween*> pathTweens;
+		
+	};
+
+	class _PolyExport SkeletonAnimation {
+		public:
+			SkeletonAnimation(string name, float duration);
+			~SkeletonAnimation();			
+			void addBoneTrack(BoneTrack *boneTrack);
+			string getName();
+			void Play();
+			void Stop();
+			void Update();
+		
+			void setSpeed(float speed);
+			
+		private:
+			
+			string name;
+			float duration;
+			vector<BoneTrack*> boneTracks;
+	};
+
+	class _PolyExport Skeleton : public SceneEntity {
+		public:
+			Skeleton(string fileName);
+			void loadSkeleton(string fileName);
+			~Skeleton();
+		
+			void playAnimation(string animName);
+			SkeletonAnimation *getAnimation(string name);
+			void Update();
+			
+			Bone *getBoneByName(string name);
+			void bonesVisible(bool val);
+			void enableBoneLabels(Font *font, float size, float scale);
+					
+			int getNumBones();
+			Bone *getBone(int index);
+		
+			SkeletonAnimation *getCurrentAnimation() { return currentAnimation; }
+		
+		private:
+			SkeletonAnimation *currentAnimation;
+			vector<Bone*> bones;
+			vector<SkeletonAnimation*> animations;
+	};
+
+}

+ 62 - 0
Core/Contents/Include/PolySound.h

@@ -0,0 +1,62 @@
+/*
+ *  PolySound.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/15/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Sound
+
+#pragma once
+#include <vorbis/vorbisfile.h>
+
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <string>
+#include <vector>
+#include "al.h"
+#include "alc.h"
+#include "OSBasics.h"
+
+using std::string;
+using std::vector;
+
+#define ALNoErrorStr "No AL error occurred"
+#define ALInvalidNameStr "AL error: a bad name (ID) was passed to an OpenAL function"
+#define ALInvalidEnumStr "AL error: an invalid enum value was passed to an OpenAL function"
+#define ALInvalidValueStr "AL error: an invalid value was passed to an OpenAL function"
+#define ALInvalidOpStr "AL error: the requested operation is not valid"
+#define ALOutOfMemoryStr "AL error: the requested operation resulted in OpenAL running out of memory"
+#define ALOtherErrorStr "AL error: unknown error"
+
+#define BUFFER_SIZE 32768
+
+namespace Polycode {
+	
+	class _PolyExport Sound {
+	public:
+		Sound(string fileName);
+		~Sound();
+		
+		void Play(bool once);
+		void Stop();
+		
+		ALuint loadWAV(string fileName);
+		ALuint loadOGG(string fileName);
+		
+		ALuint GenSource(ALuint buffer);
+		ALuint GenSource();
+	
+		void checkALError(string operation);
+		void soundError(string err);
+		void soundCheck(bool result, string err);
+		static unsigned long readByte32(const unsigned char buffer[4]);		
+		static unsigned short readByte16(const unsigned char buffer[2]);
+
+	private:
+	
+		ALuint soundSource;
+		
+	};
+}

+ 33 - 0
Core/Contents/Include/PolySoundManager.h

@@ -0,0 +1,33 @@
+/*
+ *  PolySoundManager.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 10/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Sound
+
+#pragma once
+#include "PolyLogger.h"
+#include "PolyGlobals.h"
+#include <stdio.h>
+#include "al.h"
+#include "alc.h"
+
+namespace Polycode {
+	
+	class _PolyExport SoundManager {
+	public:
+		SoundManager();
+		~SoundManager();
+		
+		void initAL();
+		
+		
+	private:
+		
+		ALCdevice* device;
+		ALCcontext* context;		
+	};
+}

+ 46 - 0
Core/Contents/Include/PolySubstanceView.h

@@ -0,0 +1,46 @@
+//
+//  SubstanceView.h
+//  Substance
+//
+//  Created by Ivan Safrin on 2/21/10.
+//  Copyright 2010 Ivan Safrin. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <Cocoa/Cocoa.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/OpenGL.h>
+
+#include "Polycode.h"
+#include "PolyCocoaCore.h"
+
+using namespace Polycode;
+
+@interface SubstanceView : NSOpenGLView {
+	TAUKey keymap[512];
+	char mouseMap[128];
+	
+	char modifierMap[512];
+	
+	CocoaCore *core;
+	
+	NSLock *contextLock;	
+	
+	NSCursor *currentCursor;
+	bool contextReady;
+}
+
+
+- (void) setCurrentCursor: (NSCursor*) newCursor;
+
+- (id)initWithFrame:(NSRect)frameRect pixelFormat:(NSOpenGLPixelFormat *)format;
+
+- (void) lockContext;
+- (void) unlockContext;
+
+- (BOOL) isContextReady;
+
+- (void) setCore: (CocoaCore*) newCore;
+- (void) initKeymap;
+
+@end

+ 60 - 0
Core/Contents/Include/PolyTexture.h

@@ -0,0 +1,60 @@
+/*
+ *  PolyTexture.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/13/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Materials
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyResource.h"
+#include "PolyImage.h"
+
+namespace Polycode {
+
+	class _PolyExport Texture : public Resource {
+		public:
+		Texture(unsigned int width, unsigned int height, char *textureData,bool clamp, int type=Image::IMAGE_RGBA);
+			Texture(Image *image);
+			virtual ~Texture();
+
+			float scrollSpeedX;
+			float scrollSpeedY;
+			
+			virtual void setTextureData(char *data) = 0;
+
+			virtual void recreateFromImageData() = 0;
+
+			float getScrollOffsetX();
+			float getScrollOffsetY();
+			
+			void setImageData(Image *data);
+		
+			void updateScroll(int elapsed);
+			void setResourcePath(string newPath);
+			string getResourcePath();
+		
+			char *getTextureData() { return textureData;}
+			
+			int getWidth();
+			int getHeight();
+		
+			bool clamp;
+		
+		protected:
+
+			int pixelSize;
+			int filteringMode;
+		
+			int width;
+			int height;
+			string resourcePath;
+			char *textureData;
+			float scrollOffsetX;
+			float scrollOffsetY;
+	};
+}

+ 29 - 0
Core/Contents/Include/PolyThreaded.h

@@ -0,0 +1,29 @@
+/*
+ *  PolyThreaded.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/6/09.
+ *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Core
+#pragma once
+
+#include "PolyGlobals.h"
+
+namespace Polycode{
+	
+	class _PolyExport Threaded {
+	public:
+		Threaded(){ threadRunning = true; }
+		~Threaded(){}
+		
+		virtual void killThread() { threadRunning = false; }		
+		virtual void runThread(){while(threadRunning) updateThread(); }
+		
+		virtual void updateThread() = 0;
+		
+		bool threadRunning;
+	};
+	
+}

+ 44 - 0
Core/Contents/Include/PolyTimer.h

@@ -0,0 +1,44 @@
+/*
+ *  PolyTimer.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package BasicTypes
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyEventDispatcher.h"
+#include "PolyCoreServices.h"
+
+using namespace std;
+
+namespace Polycode {
+	
+	class _PolyExport Timer : public EventDispatcher {
+		public:
+			Timer(bool triggerMode, int msecs);
+			~Timer();
+
+		void Pause(bool paused);
+		bool isPaused();
+		unsigned int getTicks();
+		void Update(unsigned int ticks);
+		void Reset();
+		bool hasElapsed();
+		float getElapsedf();		
+
+		static const int EVENT_TRIGGER = 0;
+		
+		private:
+			
+			int elapsed;
+			bool paused;
+			unsigned int msecs;
+			bool triggerMode;
+			unsigned int last;
+			unsigned int ticks;
+	};
+}

+ 36 - 0
Core/Contents/Include/PolyTimerManager.h

@@ -0,0 +1,36 @@
+/*
+ *  PolyTimerManager.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Services
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyTimer.h"
+#include "PolyCoreServices.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class Timer;
+
+	class _PolyExport TimerManager {
+		public:
+		TimerManager();
+		~TimerManager();
+		
+		void removeTimer(Timer *timer);
+		void addTimer(Timer *timer);
+		void Update();
+		
+		private:
+		
+		vector <Timer*> timers;
+	};
+}

+ 111 - 0
Core/Contents/Include/PolyTween.h

@@ -0,0 +1,111 @@
+/*
+ *  PolyTween.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 7/7/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package BasicTypes
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyEventDispatcher.h"
+#include "PolyCoreServices.h"
+#include "PolyBezierCurve.h"
+#include "PolyQuaternionCurve.h"
+
+namespace Polycode {
+	
+	class Timer;
+	
+	class _PolyExport Tween : public EventDispatcher {
+	public:
+		Tween(float *target, int easeType, float startVal, float endVal, float time, bool repeat=false);
+		~Tween();
+		
+		void handleEvent(Event *event);
+		float interpolateTween();
+		virtual void updateCustomTween() {}
+		void doOnComplete();
+		
+		void Pause(bool pauseVal);
+		
+		void Reset();
+		
+		static const int EASE_NONE = 0;
+		static const int EASE_IN_QUAD = 1;
+		static const int EASE_OUT_QUAD = 2;
+		static const int EASE_INOUT_QUAD = 3;
+		static const int EASE_IN_CUBIC= 4;
+		static const int EASE_OUT_CUBIC= 5;
+		static const int EASE_INOUT_CUBIC= 6;
+		static const int EASE_IN_QUART= 7;
+		static const int EASE_OUT_QUART= 8;
+		static const int EASE_INOUT_QUART= 9;
+		static const int EASE_IN_QUINT= 10;
+		static const int EASE_OUT_QUINT= 11;
+		static const int EASE_INOUT_QUINT= 12;
+		static const int EASE_IN_SINE= 13;
+		static const int EASE_OUT_SINE= 14;
+		static const int EASE_INOUT_SINE= 15;
+		static const int EASE_IN_EXPO= 16;
+		static const int EASE_OUT_EXPO= 17;
+		static const int EASE_INOUT_EXPO= 18;
+		static const int EASE_IN_CIRC= 19;
+		static const int EASE_OUT_CIRC= 20;
+		static const int EASE_INOUT_CIRC= 21;
+		static const int EASE_IN_BOUNCE= 22;
+		static const int EASE_OUT_BOUNCE = 23;
+		static const int EASE_INOUT_BOUNCE = 24;	
+		
+		bool isComplete();
+		bool repeat;
+		
+		void setSpeed(float speed);
+		
+
+	protected:
+	
+		
+		int easeType;
+		bool complete;
+		float endVal;
+		float cVal;
+		float startVal;
+		float actEndTime;
+		float endTime;
+		float *targetVal;
+		float localTargetVal;
+		float tweenTime;
+		Timer *tweenTimer;
+	};
+	
+	class _PolyExport BezierPathTween : public Tween {
+		public:
+			BezierPathTween(Vector3 *target, BezierCurve *curve, int easeType, float time, bool repeat=false);
+			~BezierPathTween();
+			void updateCustomTween();
+
+		protected:
+			float pathValue;
+			Tween *pathTween;
+			BezierCurve *curve;
+			Vector3 *target;
+	};
+	
+	class _PolyExport QuaternionTween : public Tween {
+		public:
+			QuaternionTween(Quaternion *target, BezierCurve *wCurve, BezierCurve *xCurve, BezierCurve *yCurve,
+							BezierCurve *zCurve, int easeType, float time, bool repeat=false);
+			~QuaternionTween();
+			void updateCustomTween();
+		private:
+			float pathValue;
+			Tween *pathTween;
+			QuaternionCurve	*quatCurve;
+			Quaternion *target;			
+	};
+	
+}

+ 32 - 0
Core/Contents/Include/PolyTweenManager.h

@@ -0,0 +1,32 @@
+/*
+ *  PolyTimerManager.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 5/18/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Services
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyTween.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class Tween;
+
+	class _PolyExport TweenManager {
+		public:
+			TweenManager();
+			~TweenManager();
+			void addTween(Tween *tween);
+			void Update();
+		
+		private:
+			vector <Tween*> tweens;
+	};
+}

+ 31 - 0
Core/Contents/Include/PolyUtil.h

@@ -0,0 +1,31 @@
+/*
+ *  PolyUtil.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/23/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+// @package Services
+
+#pragma once
+
+#include "PolyGlobals.h"
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <cctype>
+
+using std::string;
+using std::vector;
+
+namespace Polycode {
+
+	class _PolyExport StringUtil {
+		public:
+			static string toLowerCase(const std::string &str);
+			static vector<std::string> split(const std::string &str, const std::string &delims);
+			static string replace(const std::string &str, const std::string &what, const std::string &withWhat);
+			static string floatToString(float value);
+	};
+}

+ 39 - 0
Core/Contents/Include/PolyVector2.h

@@ -0,0 +1,39 @@
+/*
+ *  PolyVector2.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/14/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// @package Math
+ 
+#pragma once
+
+#include "PolyGlobals.h"
+
+namespace Polycode {
+
+	class _PolyExport Vector2 {
+		public:
+		
+			Vector2();
+			Vector2(float x, float y);
+			~Vector2();
+		
+			inline bool operator == ( const Vector2& v2)  {
+				return (v2.x == x && v2.y == y);
+			}		
+
+			inline bool operator != ( const Vector2& v2)  {
+				return (v2.x != x || v2.y != y);
+			}				
+		
+			float x;
+			float y;			
+			
+		private:
+
+	};
+}

+ 103 - 0
Core/Contents/Include/PolyVector3.h

@@ -0,0 +1,103 @@
+/*
+ *  PolyVector3.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/14/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+ 
+// @package Math
+
+#pragma once
+#include "PolyGlobals.h"
+#include <math.h>
+
+//#ifdef _WINDOWS
+	#include <assert.h>
+//#endif 
+
+namespace Polycode {
+
+	class _PolyExport Vector3 {
+		public:
+		
+			Vector3();
+			Vector3(float x,float y,float z);
+			~Vector3();
+
+			void set(float x, float y, float z);
+
+			inline Vector3 operator - ( const Vector3& v2 ) const {
+				return Vector3(x - v2.x, y - v2.y, z - v2.z);
+			}
+
+			inline float distance(const Vector3& rhs) const {
+				return (*this - rhs).length();
+			}
+
+			inline Vector3& operator * (const float val) {
+				x *= val;
+				y *= val;
+				z *= val;
+				return *this;				
+			}
+
+			inline Vector3& operator / (const float val) {
+				assert( val != 0.0 );
+				x /= val;
+				y /= val;
+				z /= val;
+				return *this;				
+			}
+
+			inline Vector3& operator = ( const Vector3& v2)  {
+				x = v2.x;
+				y = v2.y;
+				z = v2.z;
+				return *this;
+			}
+
+			inline Vector3& operator += ( const Vector3& v2)  {
+				x += v2.x;
+				y += v2.y;
+				z += v2.z;
+				return *this;
+			}
+
+			inline Vector3& operator -= ( const Vector3& v2)  {
+				x -= v2.x;
+				y -= v2.y;
+				z -= v2.z;
+				return *this;
+			}
+	
+			inline Vector3 operator + ( const Vector3& v2 ) const {
+				return Vector3(x + v2.x, y + v2.y, z + v2.z);
+			}
+
+			inline float length () const {
+				return sqrtf( x * x + y * y + z * z );
+			}
+			
+			inline float dot(Vector3 &u) {
+				return x * u.x + y * u.y + z * u.z;
+			}
+
+			inline Vector3 crossProduct( const Vector3& rkVector ) const {
+				return Vector3(
+					y * rkVector.z - z * rkVector.y,
+					z * rkVector.x - x * rkVector.z,
+					x * rkVector.y - y * rkVector.x);
+			}			
+
+			void Normalize();
+		
+			float x;
+			float y;
+			float z;			
+			
+		private:
+
+	};
+}

+ 65 - 0
Core/Contents/Include/PolyVertex.h

@@ -0,0 +1,65 @@
+/*
+ *  PolyVertex.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/14/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+ // @package BasicTypes
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyVector3.h"
+#include "PolyVector2.h"
+#include "PolyColor.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+
+	class Bone;
+	class _PolyExport BoneAssignment {
+		public:
+			BoneAssignment(){
+				bone = NULL;
+			}
+			unsigned int boneID;
+			float weight;
+			Bone *bone;
+	};
+
+	class _PolyExport Vertex : public Vector3 {
+		public:
+		
+			Vertex();
+			Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z);
+			Vertex(float pos_x, float pos_y, float pos_z, float nor_x, float nor_y, float nor_z, float u, float v);		
+			Vertex(float x, float y, float z);
+			Vertex(float x, float y, float z, float u, float v);
+			~Vertex();
+			
+			void addBoneAssignment(unsigned int boneID, float boneWeight);
+			int getNumBoneAssignments();
+			BoneAssignment *getBoneAssignment(unsigned int index);
+			
+			void normalizeWeights();
+			
+			Vector2 *getTexCoord();
+			void setTexCoord(float u, float v);
+			void setNormal(float x, float y, float z);
+
+			Vector3 *normal;
+			Vector3 restPosition;
+
+			Color vertexColor;		
+			bool useVertexColor;
+				
+		private:
+		
+			vector <BoneAssignment*> boneAssignments;
+			Vector2 *texCoord;
+		
+	};
+}

+ 80 - 0
Core/Contents/Include/Poly_iPhone.h

@@ -0,0 +1,80 @@
+/*
+ *  Poly_iPhone.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/1/10.
+ *  Copyright 2010 Apple Inc. All rights reserved.
+ *
+ */
+
+#pragma once
+
+#include "PolyLogger.h"
+#include "PolyConfig.h"
+#include "PolyEntity.h"
+#include "PolyPolygon.h"
+#include "PolyUtil.h"
+#include "PolyEvent.h"
+#include "PolyEventDispatcher.h"
+#include "PolyEventHandler.h"
+#include "PolyTimer.h"
+#include "PolyTween.h"
+#include "PolyTweenManager.h"
+#include "PolyResourceManager.h"
+#include "PolyCore.h"
+#include "PolyiPhoneCore.h"
+#include "PolyCoreInput.h"
+#include "PolyInputKeys.h"
+#include "PolyInputEvent.h"
+#include "PolyVector3.h"
+#include "PolyBezierCurve.h"
+#include "PolyQuaternionCurve.h"
+#include "PolyRectangle.h"
+#include "PolyRenderer.h"
+#include "PolyCoreServices.h"
+#include "PolyScreen.h"
+#include "PolyPhysicsScreen.h"
+#include "PolyScreenEntity.h"
+#include "PolyScreenLine.h"
+#include "PolyScreenMesh.h"
+#include "PolyScreenShape.h"
+#include "PolyImage.h"
+#include "PolyFont.h"
+#include "PolyScreenImage.h"
+#include "PolyScreenSprite.h"
+#include "PolyScreenLabel.h"
+#include "PolyScreenCurve.h"
+#include "PolyTexture.h"
+#include "PolyMaterial.h"
+#include "PolyMesh.h"
+#include "PolyShader.h"
+#include "PolyFixedShader.h"
+#include "PolySceneManager.h"
+#include "PolyCoreServices.h"
+#include "PolyCamera.h"
+#include "PolyScene.h"
+#include "PolyGenericScene.h"
+#include "PolyCollisionScene.h"
+#include "PolyCollisionSceneEntity.h"
+#include "PolySceneEntity.h"
+#include "PolySceneMesh.h"
+#include "PolySceneLine.h"
+#include "PolySceneLight.h"
+#include "PolySkeleton.h"
+#include "PolyBone.h"
+#include "PolyScenePrimitive.h"
+#include "PolySceneLabel.h"
+#include "PolyParticleEmitter.h"
+#include "PolyParticle.h"
+#include "PolySceneRenderTexture.h"
+#include "PolyScreenEvent.h"
+#include "PolyResource.h"
+#include "PolyTerrain.h"
+#include "PolySocket.h"
+#include "PolyPeer.h"
+#include "PolyClient.h"
+#include "PolyServer.h"
+#include "PolyThreaded.h"
+#include "PolyServerWorld.h"
+#include "PolySound.h"
+#include "PolySoundManager.h"

+ 71 - 0
Core/Contents/Include/Polycode.h

@@ -0,0 +1,71 @@
+/*
+ *  Polycode.h
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+ 
+#pragma once
+
+#include "PolyLogger.h"
+#include "PolyConfig.h"
+#include "PolyEntity.h"
+#include "PolyPolygon.h"
+#include "PolyUtil.h"
+#include "PolyEvent.h"
+#include "PolyEventDispatcher.h"
+#include "PolyEventHandler.h"
+#include "PolyTimer.h"
+#include "PolyTween.h"
+#include "PolyTweenManager.h"
+#include "PolyResourceManager.h"
+#include "PolyCore.h"
+#include "PolyCoreInput.h"
+#include "PolyInputKeys.h"
+#include "PolyInputEvent.h"
+#include "PolyVector3.h"
+#include "PolyBezierCurve.h"
+#include "PolyQuaternionCurve.h"
+#include "PolyRectangle.h"
+#include "PolyRenderer.h"
+#include "PolyCoreServices.h"
+#include "PolyScreen.h"
+#include "PolyScreenEntity.h"
+#include "PolyScreenLine.h"
+#include "PolyScreenMesh.h"
+#include "PolyScreenShape.h"
+#include "PolyImage.h"
+#include "PolyFont.h"
+#include "PolyFontManager.h"
+#include "PolyScreenImage.h"
+#include "PolyScreenSprite.h"
+#include "PolyScreenLabel.h"
+#include "PolyScreenCurve.h"
+#include "PolyTexture.h"
+#include "PolyMaterial.h"
+#include "PolyMesh.h"
+#include "PolyShader.h"
+#include "PolyFixedShader.h"
+#include "PolySceneManager.h"
+#include "PolyCoreServices.h"
+#include "PolyCamera.h"
+#include "PolyScene.h"
+#include "PolyGenericScene.h"
+#include "PolySceneEntity.h"
+#include "PolySceneMesh.h"
+#include "PolySceneLine.h"
+#include "PolySceneLight.h"
+#include "PolySkeleton.h"
+#include "PolyBone.h"
+#include "PolyScenePrimitive.h"
+#include "PolySceneLabel.h"
+#include "PolyParticleEmitter.h"
+#include "PolyParticle.h"
+#include "PolySceneRenderTexture.h"
+#include "PolyScreenEvent.h"
+#include "PolyResource.h"
+#include "PolyThreaded.h"
+#include "PolySound.h"
+#include "PolySoundManager.h"

+ 75 - 0
Core/Contents/Include/PolyiPhoneCore.h

@@ -0,0 +1,75 @@
+/*
+ *  PolyiPhoneCore.h
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/1/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+// @package Core
+
+#pragma once
+#include "PolyGlobals.h"
+#include "PolyCore.h"
+#include "PolyRectangle.h"
+#include <vector>
+
+using std::vector;
+
+namespace Polycode {
+	
+	class _PolyExport PosixMutex : public CoreMutex {
+	public:
+		pthread_mutex_t pMutex;
+	};
+	
+	class iPhoneEvent {
+	public:
+		int eventGroup;
+		int eventCode;
+		
+		int mouseX;
+		int mouseY;
+		
+		TAUKey keyCode;
+		wchar_t unicodeChar;
+		
+		char mouseButton;
+		
+		static const int INPUT_EVENT = 0;
+	};
+	
+	class _PolyExport IPhoneCore : public Core {
+		
+	public:
+		
+		IPhoneCore(int frameRate);
+		virtual ~IPhoneCore();
+		
+		void enableMouse(bool newval);
+		unsigned int getTicks();		
+		bool Update();		
+		void setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel);		
+		void createThread(Threaded *target);				
+		
+		void lockMutex(CoreMutex *mutex);
+		void unlockMutex(CoreMutex *mutex);
+		CoreMutex *createMutex();		
+		
+		void checkEvents();
+		
+		vector<Rectangle> getVideoModes();
+		
+		int lastMouseY;
+		int lastMouseX;		
+		
+		CoreMutex *eventMutex;
+		
+		vector<iPhoneEvent> osxEvents;
+		
+	private:
+		
+		
+	};
+}

+ 319 - 0
Core/Contents/Include/tinystr.h

@@ -0,0 +1,319 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original file by Yves Berquin.
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+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.
+*/
+
+/*
+ * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
+ *
+ * - completely rewritten. compact, clean, and fast implementation.
+ * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
+ * - fixed reserve() to work as per specification.
+ * - fixed buggy compares operator==(), operator<(), and operator>()
+ * - fixed operator+=() to take a const ref argument, following spec.
+ * - added "copy" constructor with length, and most compare operators.
+ * - added swap(), clear(), size(), capacity(), operator+().
+ */
+
+#ifndef TIXML_USE_STL
+
+#ifndef TIXML_STRING_INCLUDED
+#define TIXML_STRING_INCLUDED
+
+#include <assert.h>
+#include <string.h>
+
+/*	The support for explicit isn't that universal, and it isn't really
+	required - it is used to check that the TiXmlString class isn't incorrectly
+	used. Be nice to old compilers and macro it here:
+*/
+#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
+	// Microsoft visual studio, version 6 and higher.
+	#define TIXML_EXPLICIT explicit
+#elif defined(__GNUC__) && (__GNUC__ >= 3 )
+	// GCC version 3 and higher.s
+	#define TIXML_EXPLICIT explicit
+#else
+	#define TIXML_EXPLICIT
+#endif
+
+
+/*
+   TiXmlString is an emulation of a subset of the std::string template.
+   Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
+   Only the member functions relevant to the TinyXML project have been implemented.
+   The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
+   a string and there's no more room, we allocate a buffer twice as big as we need.
+*/
+class TiXmlString
+{
+  public :
+	// The size type used
+  	typedef size_t size_type;
+
+	// Error value for find primitive
+	static const size_type npos; // = -1;
+
+
+	// TiXmlString empty constructor
+	TiXmlString () : rep_(&nullrep_)
+	{
+	}
+
+	// TiXmlString copy constructor
+	TiXmlString ( const TiXmlString & copy) : rep_(0)
+	{
+		init(copy.length());
+		memcpy(start(), copy.data(), length());
+	}
+
+	// TiXmlString constructor, based on a string
+	TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
+	{
+		init( static_cast<size_type>( strlen(copy) ));
+		memcpy(start(), copy, length());
+	}
+
+	// TiXmlString constructor, based on a string
+	TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
+	{
+		init(len);
+		memcpy(start(), str, len);
+	}
+
+	// TiXmlString destructor
+	~TiXmlString ()
+	{
+		quit();
+	}
+
+	// = operator
+	TiXmlString& operator = (const char * copy)
+	{
+		return assign( copy, (size_type)strlen(copy));
+	}
+
+	// = operator
+	TiXmlString& operator = (const TiXmlString & copy)
+	{
+		return assign(copy.start(), copy.length());
+	}
+
+
+	// += operator. Maps to append
+	TiXmlString& operator += (const char * suffix)
+	{
+		return append(suffix, static_cast<size_type>( strlen(suffix) ));
+	}
+
+	// += operator. Maps to append
+	TiXmlString& operator += (char single)
+	{
+		return append(&single, 1);
+	}
+
+	// += operator. Maps to append
+	TiXmlString& operator += (const TiXmlString & suffix)
+	{
+		return append(suffix.data(), suffix.length());
+	}
+
+
+	// Convert a TiXmlString into a null-terminated char *
+	const char * c_str () const { return rep_->str; }
+
+	// Convert a TiXmlString into a char * (need not be null terminated).
+	const char * data () const { return rep_->str; }
+
+	// Return the length of a TiXmlString
+	size_type length () const { return rep_->size; }
+
+	// Alias for length()
+	size_type size () const { return rep_->size; }
+
+	// Checks if a TiXmlString is empty
+	bool empty () const { return rep_->size == 0; }
+
+	// Return capacity of string
+	size_type capacity () const { return rep_->capacity; }
+
+
+	// single char extraction
+	const char& at (size_type index) const
+	{
+		assert( index < length() );
+		return rep_->str[ index ];
+	}
+
+	// [] operator
+	char& operator [] (size_type index) const
+	{
+		assert( index < length() );
+		return rep_->str[ index ];
+	}
+
+	// find a char in a string. Return TiXmlString::npos if not found
+	size_type find (char lookup) const
+	{
+		return find(lookup, 0);
+	}
+
+	// find a char in a string from an offset. Return TiXmlString::npos if not found
+	size_type find (char tofind, size_type offset) const
+	{
+		if (offset >= length()) return npos;
+
+		for (const char* p = c_str() + offset; *p != '\0'; ++p)
+		{
+		   if (*p == tofind) return static_cast< size_type >( p - c_str() );
+		}
+		return npos;
+	}
+
+	void clear ()
+	{
+		//Lee:
+		//The original was just too strange, though correct:
+		//	TiXmlString().swap(*this);
+		//Instead use the quit & re-init:
+		quit();
+		init(0,0);
+	}
+
+	/*	Function to reserve a big amount of data when we know we'll need it. Be aware that this
+		function DOES NOT clear the content of the TiXmlString if any exists.
+	*/
+	void reserve (size_type cap);
+
+	TiXmlString& assign (const char* str, size_type len);
+
+	TiXmlString& append (const char* str, size_type len);
+
+	void swap (TiXmlString& other)
+	{
+		Rep* r = rep_;
+		rep_ = other.rep_;
+		other.rep_ = r;
+	}
+
+  private:
+
+	void init(size_type sz) { init(sz, sz); }
+	void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
+	char* start() const { return rep_->str; }
+	char* finish() const { return rep_->str + rep_->size; }
+
+	struct Rep
+	{
+		size_type size, capacity;
+		char str[1];
+	};
+
+	void init(size_type sz, size_type cap)
+	{
+		if (cap)
+		{
+			// Lee: the original form:
+			//	rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
+			// doesn't work in some cases of new being overloaded. Switching
+			// to the normal allocation, although use an 'int' for systems
+			// that are overly picky about structure alignment.
+			const size_type bytesNeeded = sizeof(Rep) + cap;
+			const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); 
+			rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
+
+			rep_->str[ rep_->size = sz ] = '\0';
+			rep_->capacity = cap;
+		}
+		else
+		{
+			rep_ = &nullrep_;
+		}
+	}
+
+	void quit()
+	{
+		if (rep_ != &nullrep_)
+		{
+			// The rep_ is really an array of ints. (see the allocator, above).
+			// Cast it back before delete, so the compiler won't incorrectly call destructors.
+			delete [] ( reinterpret_cast<int*>( rep_ ) );
+		}
+	}
+
+	Rep * rep_;
+	static Rep nullrep_;
+
+} ;
+
+
+inline bool operator == (const TiXmlString & a, const TiXmlString & b)
+{
+	return    ( a.length() == b.length() )				// optimization on some platforms
+	       && ( strcmp(a.c_str(), b.c_str()) == 0 );	// actual compare
+}
+inline bool operator < (const TiXmlString & a, const TiXmlString & b)
+{
+	return strcmp(a.c_str(), b.c_str()) < 0;
+}
+
+inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
+inline bool operator >  (const TiXmlString & a, const TiXmlString & b) { return b < a; }
+inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
+inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
+
+inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
+inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
+inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
+inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
+
+TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
+TiXmlString operator + (const TiXmlString & a, const char* b);
+TiXmlString operator + (const char* a, const TiXmlString & b);
+
+
+/*
+   TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
+   Only the operators that we need for TinyXML have been developped.
+*/
+class TiXmlOutStream : public TiXmlString
+{
+public :
+
+	// TiXmlOutStream << operator.
+	TiXmlOutStream & operator << (const TiXmlString & in)
+	{
+		*this += in;
+		return *this;
+	}
+
+	// TiXmlOutStream << operator.
+	TiXmlOutStream & operator << (const char * in)
+	{
+		*this += in;
+		return *this;
+	}
+
+} ;
+
+#endif	// TIXML_STRING_INCLUDED
+#endif	// TIXML_USE_STL

+ 1806 - 0
Core/Contents/Include/tinyxml.h

@@ -0,0 +1,1806 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+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.
+*/
+
+
+#ifndef TINYXML_INCLUDED
+#define TINYXML_INCLUDED
+
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4530 )
+#pragma warning( disable : 4786 )
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+// Help out windows:
+#if defined( _DEBUG ) && !defined( DEBUG )
+#define DEBUG
+#endif
+
+#ifdef TIXML_USE_STL
+	#include <string>
+ 	#include <iostream>
+	#include <sstream>
+	#define TIXML_STRING		std::string
+#else
+	#include "tinystr.h"
+	#define TIXML_STRING		TiXmlString
+#endif
+
+#include "PolyLogger.h"
+
+// Deprecated library function hell. Compilers want to use the
+// new safe versions. This probably doesn't fully address the problem,
+// but it gets closer. There are too many compilers for me to fully
+// test. If you get compilation troubles, undefine TIXML_SAFE
+#define TIXML_SAFE
+
+#ifdef TIXML_SAFE
+	#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
+		// Microsoft visual studio, version 2005 and higher.
+		#define TIXML_SNPRINTF _snprintf_s
+		#define TIXML_SNSCANF  _snscanf_s
+		#define TIXML_SSCANF   sscanf_s
+	#elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
+		// Microsoft visual studio, version 6 and higher.
+		//#pragma message( "Using _sn* functions." )
+		#define TIXML_SNPRINTF _snprintf
+		#define TIXML_SNSCANF  _snscanf
+		#define TIXML_SSCANF   sscanf
+	#elif defined(__GNUC__) && (__GNUC__ >= 3 )
+		// GCC version 3 and higher.s
+		//#warning( "Using sn* functions." )
+		#define TIXML_SNPRINTF snprintf
+		#define TIXML_SNSCANF  snscanf
+		#define TIXML_SSCANF   sscanf
+	#else
+		#define TIXML_SSCANF   sscanf
+	#endif
+#endif	
+
+#include "OSBasics.h"
+
+class TiXmlDocument;
+class TiXmlElement;
+class TiXmlComment;
+class TiXmlUnknown;
+class TiXmlAttribute;
+class TiXmlText;
+class TiXmlDeclaration;
+class TiXmlParsingData;
+
+const int TIXML_MAJOR_VERSION = 2;
+const int TIXML_MINOR_VERSION = 5;
+const int TIXML_PATCH_VERSION = 3;
+
+/*	Internal structure for tracking location of items 
+	in the XML file.
+*/
+struct TiXmlCursor
+{
+	TiXmlCursor()		{ Clear(); }
+	void Clear()		{ row = col = -1; }
+
+	int row;	// 0 based.
+	int col;	// 0 based.
+};
+
+
+/**
+	If you call the Accept() method, it requires being passed a TiXmlVisitor
+	class to handle callbacks. For nodes that contain other nodes (Document, Element)
+	you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves
+	are simple called with Visit().
+
+	If you return 'true' from a Visit method, recursive parsing will continue. If you return
+	false, <b>no children of this node or its sibilings</b> will be Visited.
+
+	All flavors of Visit methods have a default implementation that returns 'true' (continue 
+	visiting). You need to only override methods that are interesting to you.
+
+	Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.
+
+	You should never change the document from a callback.
+
+	@sa TiXmlNode::Accept()
+*/
+class TiXmlVisitor
+{
+public:
+	virtual ~TiXmlVisitor() {}
+
+	/// Visit a document.
+	virtual bool VisitEnter( const TiXmlDocument& /*doc*/ )			{ return true; }
+	/// Visit a document.
+	virtual bool VisitExit( const TiXmlDocument& /*doc*/ )			{ return true; }
+
+	/// Visit an element.
+	virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ )	{ return true; }
+	/// Visit an element.
+	virtual bool VisitExit( const TiXmlElement& /*element*/ )		{ return true; }
+
+	/// Visit a declaration
+	virtual bool Visit( const TiXmlDeclaration& /*declaration*/ )	{ return true; }
+	/// Visit a text node
+	virtual bool Visit( const TiXmlText& /*text*/ )					{ return true; }
+	/// Visit a comment node
+	virtual bool Visit( const TiXmlComment& /*comment*/ )			{ return true; }
+	/// Visit an unknow node
+	virtual bool Visit( const TiXmlUnknown& /*unknown*/ )			{ return true; }
+};
+
+// Only used by Attribute::Query functions
+enum 
+{ 
+	TIXML_SUCCESS,
+	TIXML_NO_ATTRIBUTE,
+	TIXML_WRONG_TYPE
+};
+
+
+// Used by the parsing routines.
+enum TiXmlEncoding
+{
+	TIXML_ENCODING_UNKNOWN,
+	TIXML_ENCODING_UTF8,
+	TIXML_ENCODING_LEGACY
+};
+
+const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
+
+/** TiXmlBase is a base class for every class in TinyXml.
+	It does little except to establish that TinyXml classes
+	can be printed and provide some utility functions.
+
+	In XML, the document and elements can contain
+	other elements and other types of nodes.
+
+	@verbatim
+	A Document can contain:	Element	(container or leaf)
+							Comment (leaf)
+							Unknown (leaf)
+							Declaration( leaf )
+
+	An Element can contain:	Element (container or leaf)
+							Text	(leaf)
+							Attributes (not on tree)
+							Comment (leaf)
+							Unknown (leaf)
+
+	A Decleration contains: Attributes (not on tree)
+	@endverbatim
+*/
+class TiXmlBase
+{
+	friend class TiXmlNode;
+	friend class TiXmlElement;
+	friend class TiXmlDocument;
+
+public:
+	TiXmlBase()	:	userData(0)		{}
+	virtual ~TiXmlBase()			{}
+
+	/**	All TinyXml classes can print themselves to a filestream
+		or the string class (TiXmlString in non-STL mode, std::string
+		in STL mode.) Either or both cfile and str can be null.
+		
+		This is a formatted print, and will insert 
+		tabs and newlines.
+		
+		(For an unformatted stream, use the << operator.)
+	*/
+	virtual void Print( FILE* cfile, int depth ) const = 0;
+
+	/**	The world does not agree on whether white space should be kept or
+		not. In order to make everyone happy, these global, static functions
+		are provided to set whether or not TinyXml will condense all white space
+		into a single space or not. The default is to condense. Note changing this
+		value is not thread safe.
+	*/
+	static void SetCondenseWhiteSpace( bool condense )		{ condenseWhiteSpace = condense; }
+
+	/// Return the current white space setting.
+	static bool IsWhiteSpaceCondensed()						{ return condenseWhiteSpace; }
+
+	/** Return the position, in the original source file, of this node or attribute.
+		The row and column are 1-based. (That is the first row and first column is
+		1,1). If the returns values are 0 or less, then the parser does not have
+		a row and column value.
+
+		Generally, the row and column value will be set when the TiXmlDocument::Load(),
+		TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set
+		when the DOM was created from operator>>.
+
+		The values reflect the initial load. Once the DOM is modified programmatically
+		(by adding or changing nodes and attributes) the new values will NOT update to
+		reflect changes in the document.
+
+		There is a minor performance cost to computing the row and column. Computation
+		can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.
+
+		@sa TiXmlDocument::SetTabSize()
+	*/
+	int Row() const			{ return location.row + 1; }
+	int Column() const		{ return location.col + 1; }	///< See Row()
+
+	void  SetUserData( void* user )			{ userData = user; }	///< Set a pointer to arbitrary user data.
+	void* GetUserData()						{ return userData; }	///< Get a pointer to arbitrary user data.
+	const void* GetUserData() const 		{ return userData; }	///< Get a pointer to arbitrary user data.
+
+	// Table that returs, for a given lead byte, the total number of bytes
+	// in the UTF-8 sequence.
+	static const int utf8ByteTable[256];
+
+	virtual const char* Parse(	const char* p, 
+								TiXmlParsingData* data, 
+								TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
+
+	/** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, 
+		or they will be transformed into entities!
+	*/
+	static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out );
+
+	enum
+	{
+		TIXML_NO_ERROR = 0,
+		TIXML_ERROR,
+		TIXML_ERROR_OPENING_FILE,
+		TIXML_ERROR_OUT_OF_MEMORY,
+		TIXML_ERROR_PARSING_ELEMENT,
+		TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
+		TIXML_ERROR_READING_ELEMENT_VALUE,
+		TIXML_ERROR_READING_ATTRIBUTES,
+		TIXML_ERROR_PARSING_EMPTY,
+		TIXML_ERROR_READING_END_TAG,
+		TIXML_ERROR_PARSING_UNKNOWN,
+		TIXML_ERROR_PARSING_COMMENT,
+		TIXML_ERROR_PARSING_DECLARATION,
+		TIXML_ERROR_DOCUMENT_EMPTY,
+		TIXML_ERROR_EMBEDDED_NULL,
+		TIXML_ERROR_PARSING_CDATA,
+		TIXML_ERROR_DOCUMENT_TOP_ONLY,
+
+		TIXML_ERROR_STRING_COUNT
+	};
+
+protected:
+
+	static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
+	inline static bool IsWhiteSpace( char c )		
+	{ 
+		return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); 
+	}
+	inline static bool IsWhiteSpace( int c )
+	{
+		if ( c < 256 )
+			return IsWhiteSpace( (char) c );
+		return false;	// Again, only truly correct for English/Latin...but usually works.
+	}
+
+	#ifdef TIXML_USE_STL
+	static bool	StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
+	static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag );
+	#endif
+
+	/*	Reads an XML name into the string provided. Returns
+		a pointer just past the last character of the name,
+		or 0 if the function has an error.
+	*/
+	static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
+
+	/*	Reads text. Returns a pointer past the given end tag.
+		Wickedly complex options, but it keeps the (sensitive) code in one place.
+	*/
+	static const char* ReadText(	const char* in,				// where to start
+									TIXML_STRING* text,			// the string read
+									bool ignoreWhiteSpace,		// whether to keep the white space
+									const char* endTag,			// what ends this text
+									bool ignoreCase,			// whether to ignore case in the end tag
+									TiXmlEncoding encoding );	// the current encoding
+
+	// If an entity has been found, transform it into a character.
+	static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding );
+
+	// Get a character, while interpreting entities.
+	// The length can be from 0 to 4 bytes.
+	inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding )
+	{
+		assert( p );
+		if ( encoding == TIXML_ENCODING_UTF8 )
+		{
+			*length = utf8ByteTable[ *((const unsigned char*)p) ];
+			assert( *length >= 0 && *length < 5 );
+		}
+		else
+		{
+			*length = 1;
+		}
+
+		if ( *length == 1 )
+		{
+			if ( *p == '&' )
+				return GetEntity( p, _value, length, encoding );
+			*_value = *p;
+			return p+1;
+		}
+		else if ( *length )
+		{
+			//strncpy( _value, p, *length );	// lots of compilers don't like this function (unsafe),
+												// and the null terminator isn't needed
+			for( int i=0; p[i] && i<*length; ++i ) {
+				_value[i] = p[i];
+			}
+			return p + (*length);
+		}
+		else
+		{
+			// Not valid text.
+			return 0;
+		}
+	}
+
+	// Return true if the next characters in the stream are any of the endTag sequences.
+	// Ignore case only works for english, and should only be relied on when comparing
+	// to English words: StringEqual( p, "version", true ) is fine.
+	static bool StringEqual(	const char* p,
+								const char* endTag,
+								bool ignoreCase,
+								TiXmlEncoding encoding );
+
+	static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
+
+	TiXmlCursor location;
+
+    /// Field containing a generic user pointer
+	void*			userData;
+	
+	// None of these methods are reliable for any language except English.
+	// Good for approximation, not great for accuracy.
+	static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding );
+	static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding );
+	inline static int ToLower( int v, TiXmlEncoding encoding )
+	{
+		if ( encoding == TIXML_ENCODING_UTF8 )
+		{
+			if ( v < 128 ) return tolower( v );
+			return v;
+		}
+		else
+		{
+			return tolower( v );
+		}
+	}
+	static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
+
+private:
+	TiXmlBase( const TiXmlBase& );				// not implemented.
+	void operator=( const TiXmlBase& base );	// not allowed.
+
+	struct Entity
+	{
+		const char*     str;
+		unsigned int	strLength;
+		char		    chr;
+	};
+	enum
+	{
+		NUM_ENTITY = 5,
+		MAX_ENTITY_LENGTH = 6
+
+	};
+	static Entity entity[ NUM_ENTITY ];
+	static bool condenseWhiteSpace;
+};
+
+
+/** The parent class for everything in the Document Object Model.
+	(Except for attributes).
+	Nodes have siblings, a parent, and children. A node can be
+	in a document, or stand on its own. The type of a TiXmlNode
+	can be queried, and it can be cast to its more defined type.
+*/
+class TiXmlNode : public TiXmlBase
+{
+	friend class TiXmlDocument;
+	friend class TiXmlElement;
+
+public:
+	#ifdef TIXML_USE_STL	
+
+	    /** An input stream operator, for every class. Tolerant of newlines and
+		    formatting, but doesn't expect them.
+	    */
+	    friend std::istream& operator >> (std::istream& in, TiXmlNode& base);
+
+	    /** An output stream operator, for every class. Note that this outputs
+		    without any newlines or formatting, as opposed to Print(), which
+		    includes tabs and new lines.
+
+		    The operator<< and operator>> are not completely symmetric. Writing
+		    a node to a stream is very well defined. You'll get a nice stream
+		    of output, without any extra whitespace or newlines.
+		    
+		    But reading is not as well defined. (As it always is.) If you create
+		    a TiXmlElement (for example) and read that from an input stream,
+		    the text needs to define an element or junk will result. This is
+		    true of all input streams, but it's worth keeping in mind.
+
+		    A TiXmlDocument will read nodes until it reads a root element, and
+			all the children of that root element.
+	    */	
+	    friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
+
+		/// Appends the XML node or attribute to a std::string.
+		friend std::string& operator<< (std::string& out, const TiXmlNode& base );
+
+	#endif
+
+	/** The types of XML nodes supported by TinyXml. (All the
+			unsupported types are picked up by UNKNOWN.)
+	*/
+	enum NodeType
+	{
+		DOCUMENT,
+		ELEMENT,
+		COMMENT,
+		UNKNOWN,
+		TEXT,
+		DECLARATION,
+		TYPECOUNT
+	};
+
+	virtual ~TiXmlNode();
+
+	/** The meaning of 'value' changes for the specific type of
+		TiXmlNode.
+		@verbatim
+		Document:	filename of the xml file
+		Element:	name of the element
+		Comment:	the comment text
+		Unknown:	the tag contents
+		Text:		the text string
+		@endverbatim
+
+		The subclasses will wrap this function.
+	*/
+	const char *Value() const { return value.c_str (); }
+
+    #ifdef TIXML_USE_STL
+	/** Return Value() as a std::string. If you only use STL,
+	    this is more efficient than calling Value().
+		Only available in STL mode.
+	*/
+	const std::string& ValueStr() const { return value; }
+	#endif
+
+	const TIXML_STRING& ValueTStr() const { return value; }
+
+	/** Changes the value of the node. Defined as:
+		@verbatim
+		Document:	filename of the xml file
+		Element:	name of the element
+		Comment:	the comment text
+		Unknown:	the tag contents
+		Text:		the text string
+		@endverbatim
+	*/
+	void SetValue(const char * _value) { value = _value;}
+
+    #ifdef TIXML_USE_STL
+	/// STL std::string form.
+	void SetValue( const std::string& _value )	{ value = _value; }
+	#endif
+
+	/// Delete all the children of this node. Does not affect 'this'.
+	void Clear();
+
+	/// One step up the DOM.
+	TiXmlNode* Parent()							{ return parent; }
+	const TiXmlNode* Parent() const				{ return parent; }
+
+	const TiXmlNode* FirstChild()	const		{ return firstChild; }	///< The first child of this node. Will be null if there are no children.
+	TiXmlNode* FirstChild()						{ return firstChild; }
+	const TiXmlNode* FirstChild( const char * value ) const;			///< The first child of this node with the matching 'value'. Will be null if none found.
+	/// The first child of this node with the matching 'value'. Will be null if none found.
+	TiXmlNode* FirstChild( const char * _value ) {
+		// Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)
+		// call the method, cast the return back to non-const.
+		return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value ));
+	}
+	const TiXmlNode* LastChild() const	{ return lastChild; }		/// The last child of this node. Will be null if there are no children.
+	TiXmlNode* LastChild()	{ return lastChild; }
+	
+	const TiXmlNode* LastChild( const char * value ) const;			/// The last child of this node matching 'value'. Will be null if there are no children.
+	TiXmlNode* LastChild( const char * _value ) {
+		return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value ));
+	}
+
+    #ifdef TIXML_USE_STL
+	const TiXmlNode* FirstChild( const std::string& _value ) const	{	return FirstChild (_value.c_str ());	}	///< STL std::string form.
+	TiXmlNode* FirstChild( const std::string& _value )				{	return FirstChild (_value.c_str ());	}	///< STL std::string form.
+	const TiXmlNode* LastChild( const std::string& _value ) const	{	return LastChild (_value.c_str ());	}	///< STL std::string form.
+	TiXmlNode* LastChild( const std::string& _value )				{	return LastChild (_value.c_str ());	}	///< STL std::string form.
+	#endif
+
+	/** An alternate way to walk the children of a node.
+		One way to iterate over nodes is:
+		@verbatim
+			for( child = parent->FirstChild(); child; child = child->NextSibling() )
+		@endverbatim
+
+		IterateChildren does the same thing with the syntax:
+		@verbatim
+			child = 0;
+			while( child = parent->IterateChildren( child ) )
+		@endverbatim
+
+		IterateChildren takes the previous child as input and finds
+		the next one. If the previous child is null, it returns the
+		first. IterateChildren will return null when done.
+	*/
+	const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const;
+	TiXmlNode* IterateChildren( const TiXmlNode* previous ) {
+		return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) );
+	}
+
+	/// This flavor of IterateChildren searches for children with a particular 'value'
+	const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const;
+	TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) {
+		return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) );
+	}
+
+    #ifdef TIXML_USE_STL
+	const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const	{	return IterateChildren (_value.c_str (), previous);	}	///< STL std::string form.
+	TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) {	return IterateChildren (_value.c_str (), previous);	}	///< STL std::string form.
+	#endif
+
+	/** Add a new node related to this. Adds a child past the LastChild.
+		Returns a pointer to the new object or NULL if an error occured.
+	*/
+	TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
+
+
+	/** Add a new node related to this. Adds a child past the LastChild.
+
+		NOTE: the node to be added is passed by pointer, and will be
+		henceforth owned (and deleted) by tinyXml. This method is efficient
+		and avoids an extra copy, but should be used with care as it
+		uses a different memory model than the other insert functions.
+
+		@sa InsertEndChild
+	*/
+	TiXmlNode* LinkEndChild( TiXmlNode* addThis );
+
+	/** Add a new node related to this. Adds a child before the specified child.
+		Returns a pointer to the new object or NULL if an error occured.
+	*/
+	TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
+
+	/** Add a new node related to this. Adds a child after the specified child.
+		Returns a pointer to the new object or NULL if an error occured.
+	*/
+	TiXmlNode* InsertAfterChild(  TiXmlNode* afterThis, const TiXmlNode& addThis );
+
+	/** Replace a child of this node.
+		Returns a pointer to the new object or NULL if an error occured.
+	*/
+	TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
+
+	/// Delete a child of this node.
+	bool RemoveChild( TiXmlNode* removeThis );
+
+	/// Navigate to a sibling node.
+	const TiXmlNode* PreviousSibling() const			{ return prev; }
+	TiXmlNode* PreviousSibling()						{ return prev; }
+
+	/// Navigate to a sibling node.
+	const TiXmlNode* PreviousSibling( const char * ) const;
+	TiXmlNode* PreviousSibling( const char *_prev ) {
+		return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) );
+	}
+
+    #ifdef TIXML_USE_STL
+	const TiXmlNode* PreviousSibling( const std::string& _value ) const	{	return PreviousSibling (_value.c_str ());	}	///< STL std::string form.
+	TiXmlNode* PreviousSibling( const std::string& _value ) 			{	return PreviousSibling (_value.c_str ());	}	///< STL std::string form.
+	const TiXmlNode* NextSibling( const std::string& _value) const		{	return NextSibling (_value.c_str ());	}	///< STL std::string form.
+	TiXmlNode* NextSibling( const std::string& _value) 					{	return NextSibling (_value.c_str ());	}	///< STL std::string form.
+	#endif
+
+	/// Navigate to a sibling node.
+	const TiXmlNode* NextSibling() const				{ return next; }
+	TiXmlNode* NextSibling()							{ return next; }
+
+	/// Navigate to a sibling node with the given 'value'.
+	const TiXmlNode* NextSibling( const char * ) const;
+	TiXmlNode* NextSibling( const char* _next ) {
+		return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) );
+	}
+
+	/** Convenience function to get through elements.
+		Calls NextSibling and ToElement. Will skip all non-Element
+		nodes. Returns 0 if there is not another element.
+	*/
+	const TiXmlElement* NextSiblingElement() const;
+	TiXmlElement* NextSiblingElement() {
+		return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() );
+	}
+
+	/** Convenience function to get through elements.
+		Calls NextSibling and ToElement. Will skip all non-Element
+		nodes. Returns 0 if there is not another element.
+	*/
+	const TiXmlElement* NextSiblingElement( const char * ) const;
+	TiXmlElement* NextSiblingElement( const char *_next ) {
+		return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) );
+	}
+
+    #ifdef TIXML_USE_STL
+	const TiXmlElement* NextSiblingElement( const std::string& _value) const	{	return NextSiblingElement (_value.c_str ());	}	///< STL std::string form.
+	TiXmlElement* NextSiblingElement( const std::string& _value)				{	return NextSiblingElement (_value.c_str ());	}	///< STL std::string form.
+	#endif
+
+	/// Convenience function to get through elements.
+	const TiXmlElement* FirstChildElement()	const;
+	TiXmlElement* FirstChildElement() {
+		return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() );
+	}
+
+	/// Convenience function to get through elements.
+	const TiXmlElement* FirstChildElement( const char * _value ) const;
+	TiXmlElement* FirstChildElement( const char * _value ) {
+		return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) );
+	}
+
+    #ifdef TIXML_USE_STL
+	const TiXmlElement* FirstChildElement( const std::string& _value ) const	{	return FirstChildElement (_value.c_str ());	}	///< STL std::string form.
+	TiXmlElement* FirstChildElement( const std::string& _value )				{	return FirstChildElement (_value.c_str ());	}	///< STL std::string form.
+	#endif
+
+	/** Query the type (as an enumerated value, above) of this node.
+		The possible types are: DOCUMENT, ELEMENT, COMMENT,
+								UNKNOWN, TEXT, and DECLARATION.
+	*/
+	int Type() const	{ return type; }
+
+	/** Return a pointer to the Document this node lives in.
+		Returns null if not in a document.
+	*/
+	const TiXmlDocument* GetDocument() const;
+	TiXmlDocument* GetDocument() {
+		return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() );
+	}
+
+	/// Returns true if this node has no children.
+	bool NoChildren() const						{ return !firstChild; }
+
+	virtual const TiXmlDocument*    ToDocument()    const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlElement*     ToElement()     const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlComment*     ToComment()     const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlUnknown*     ToUnknown()     const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlText*        ToText()        const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+
+	virtual TiXmlDocument*          ToDocument()    { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlElement*           ToElement()	    { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlComment*           ToComment()     { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlUnknown*           ToUnknown()	    { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlText*	            ToText()        { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlDeclaration*       ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+
+	/** Create an exact duplicate of this node and return it. The memory must be deleted
+		by the caller. 
+	*/
+	virtual TiXmlNode* Clone() const = 0;
+
+	/** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the 
+		XML tree will be conditionally visited and the host will be called back
+		via the TiXmlVisitor interface.
+
+		This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse
+		the XML for the callbacks, so the performance of TinyXML is unchanged by using this
+		interface versus any other.)
+
+		The interface has been based on ideas from:
+
+		- http://www.saxproject.org/
+		- http://c2.com/cgi/wiki?HierarchicalVisitorPattern 
+
+		Which are both good references for "visiting".
+
+		An example of using Accept():
+		@verbatim
+		TiXmlPrinter printer;
+		tinyxmlDoc.Accept( &printer );
+		const char* xmlcstr = printer.CStr();
+		@endverbatim
+	*/
+	virtual bool Accept( TiXmlVisitor* visitor ) const = 0;
+
+protected:
+	TiXmlNode( NodeType _type );
+
+	// Copy to the allocated object. Shared functionality between Clone, Copy constructor,
+	// and the assignment operator.
+	void CopyTo( TiXmlNode* target ) const;
+
+	#ifdef TIXML_USE_STL
+	    // The real work of the input operator.
+	virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
+	#endif
+
+	// Figure out what is at *p, and parse it. Returns null if it is not an xml node.
+	TiXmlNode* Identify( const char* start, TiXmlEncoding encoding );
+
+	TiXmlNode*		parent;
+	NodeType		type;
+
+	TiXmlNode*		firstChild;
+	TiXmlNode*		lastChild;
+
+	TIXML_STRING	value;
+
+	TiXmlNode*		prev;
+	TiXmlNode*		next;
+
+private:
+	TiXmlNode( const TiXmlNode& );				// not implemented.
+	void operator=( const TiXmlNode& base );	// not allowed.
+};
+
+
+/** An attribute is a name-value pair. Elements have an arbitrary
+	number of attributes, each with a unique name.
+
+	@note The attributes are not TiXmlNodes, since they are not
+		  part of the tinyXML document object model. There are other
+		  suggested ways to look at this problem.
+*/
+class TiXmlAttribute : public TiXmlBase
+{
+	friend class TiXmlAttributeSet;
+
+public:
+	/// Construct an empty attribute.
+	TiXmlAttribute() : TiXmlBase()
+	{
+		document = 0;
+		prev = next = 0;
+	}
+
+	#ifdef TIXML_USE_STL
+	/// std::string constructor.
+	TiXmlAttribute( const std::string& _name, const std::string& _value )
+	{
+		name = _name;
+		value = _value;
+		document = 0;
+		prev = next = 0;
+	}
+	#endif
+
+	/// Construct an attribute with a name and value.
+	TiXmlAttribute( const char * _name, const char * _value )
+	{
+		name = _name;
+		value = _value;
+		document = 0;
+		prev = next = 0;
+	}
+
+	const char*		Name()  const		{ return name.c_str(); }		///< Return the name of this attribute.
+	const char*		Value() const		{ return value.c_str(); }		///< Return the value of this attribute.
+	#ifdef TIXML_USE_STL
+	const std::string& ValueStr() const	{ return value; }				///< Return the value of this attribute.
+	#endif
+	int				IntValue() const;									///< Return the value of this attribute, converted to an integer.
+	double			DoubleValue() const;								///< Return the value of this attribute, converted to a double.
+
+	// Get the tinyxml string representation
+	const TIXML_STRING& NameTStr() const { return name; }
+
+	/** QueryIntValue examines the value string. It is an alternative to the
+		IntValue() method with richer error checking.
+		If the value is an integer, it is stored in 'value' and 
+		the call returns TIXML_SUCCESS. If it is not
+		an integer, it returns TIXML_WRONG_TYPE.
+
+		A specialized but useful call. Note that for success it returns 0,
+		which is the opposite of almost all other TinyXml calls.
+	*/
+	int QueryIntValue( int* _value ) const;
+	/// QueryDoubleValue examines the value string. See QueryIntValue().
+	int QueryDoubleValue( double* _value ) const;
+
+	void SetName( const char* _name )	{ name = _name; }				///< Set the name of this attribute.
+	void SetValue( const char* _value )	{ value = _value; }				///< Set the value.
+
+	void SetIntValue( int _value );										///< Set the value from an integer.
+	void SetDoubleValue( double _value );								///< Set the value from a double.
+
+    #ifdef TIXML_USE_STL
+	/// STL std::string form.
+	void SetName( const std::string& _name )	{ name = _name; }	
+	/// STL std::string form.	
+	void SetValue( const std::string& _value )	{ value = _value; }
+	#endif
+
+	/// Get the next sibling attribute in the DOM. Returns null at end.
+	const TiXmlAttribute* Next() const;
+	TiXmlAttribute* Next() {
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); 
+	}
+
+	/// Get the previous sibling attribute in the DOM. Returns null at beginning.
+	const TiXmlAttribute* Previous() const;
+	TiXmlAttribute* Previous() {
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); 
+	}
+
+	bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
+	bool operator<( const TiXmlAttribute& rhs )	 const { return name < rhs.name; }
+	bool operator>( const TiXmlAttribute& rhs )  const { return name > rhs.name; }
+
+	/*	Attribute parsing starts: first letter of the name
+						 returns: the next char after the value end quote
+	*/
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	// Prints this Attribute to a FILE stream.
+	virtual void Print( FILE* cfile, int depth ) const {
+		Print( cfile, depth, 0 );
+	}
+	void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
+
+	// [internal use]
+	// Set the document pointer so the attribute can report errors.
+	void SetDocument( TiXmlDocument* doc )	{ document = doc; }
+
+private:
+	TiXmlAttribute( const TiXmlAttribute& );				// not implemented.
+	void operator=( const TiXmlAttribute& base );	// not allowed.
+
+	TiXmlDocument*	document;	// A pointer back to a document, for error reporting.
+	TIXML_STRING name;
+	TIXML_STRING value;
+	TiXmlAttribute*	prev;
+	TiXmlAttribute*	next;
+};
+
+
+/*	A class used to manage a group of attributes.
+	It is only used internally, both by the ELEMENT and the DECLARATION.
+	
+	The set can be changed transparent to the Element and Declaration
+	classes that use it, but NOT transparent to the Attribute
+	which has to implement a next() and previous() method. Which makes
+	it a bit problematic and prevents the use of STL.
+
+	This version is implemented with circular lists because:
+		- I like circular lists
+		- it demonstrates some independence from the (typical) doubly linked list.
+*/
+class TiXmlAttributeSet
+{
+public:
+	TiXmlAttributeSet();
+	~TiXmlAttributeSet();
+
+	void Add( TiXmlAttribute* attribute );
+	void Remove( TiXmlAttribute* attribute );
+
+	const TiXmlAttribute* First()	const	{ return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+	TiXmlAttribute* First()					{ return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+	const TiXmlAttribute* Last() const		{ return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+	TiXmlAttribute* Last()					{ return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+
+	const TiXmlAttribute*	Find( const char* _name ) const;
+	TiXmlAttribute*	Find( const char* _name ) {
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
+	}
+	#ifdef TIXML_USE_STL
+	const TiXmlAttribute*	Find( const std::string& _name ) const;
+	TiXmlAttribute*	Find( const std::string& _name ) {
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
+	}
+
+	#endif
+
+private:
+	//*ME:	Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),
+	//*ME:	this class must be also use a hidden/disabled copy-constructor !!!
+	TiXmlAttributeSet( const TiXmlAttributeSet& );	// not allowed
+	void operator=( const TiXmlAttributeSet& );	// not allowed (as TiXmlAttribute)
+
+	TiXmlAttribute sentinel;
+};
+
+
+/** The element is a container class. It has a value, the element name,
+	and can contain other elements, text, comments, and unknowns.
+	Elements also contain an arbitrary number of attributes.
+*/
+class TiXmlElement : public TiXmlNode
+{
+public:
+	/// Construct an element.
+	TiXmlElement (const char * in_value);
+
+	#ifdef TIXML_USE_STL
+	/// std::string constructor.
+	TiXmlElement( const std::string& _value );
+	#endif
+
+	TiXmlElement( const TiXmlElement& );
+
+	void operator=( const TiXmlElement& base );
+
+	virtual ~TiXmlElement();
+
+	/** Given an attribute name, Attribute() returns the value
+		for the attribute of that name, or null if none exists.
+	*/
+	const char* Attribute( const char* name ) const;
+
+	/** Given an attribute name, Attribute() returns the value
+		for the attribute of that name, or null if none exists.
+		If the attribute exists and can be converted to an integer,
+		the integer value will be put in the return 'i', if 'i'
+		is non-null.
+	*/
+	const char* Attribute( const char* name, int* i ) const;
+
+	/** Given an attribute name, Attribute() returns the value
+		for the attribute of that name, or null if none exists.
+		If the attribute exists and can be converted to an double,
+		the double value will be put in the return 'd', if 'd'
+		is non-null.
+	*/
+	const char* Attribute( const char* name, double* d ) const;
+
+	/** QueryIntAttribute examines the attribute - it is an alternative to the
+		Attribute() method with richer error checking.
+		If the attribute is an integer, it is stored in 'value' and 
+		the call returns TIXML_SUCCESS. If it is not
+		an integer, it returns TIXML_WRONG_TYPE. If the attribute
+		does not exist, then TIXML_NO_ATTRIBUTE is returned.
+	*/	
+	int QueryIntAttribute( const char* name, int* _value ) const;
+	/// QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
+	int QueryDoubleAttribute( const char* name, double* _value ) const;
+	/// QueryFloatAttribute examines the attribute - see QueryIntAttribute().
+	int QueryFloatAttribute( const char* name, float* _value ) const {
+		double d;
+		int result = QueryDoubleAttribute( name, &d );
+		if ( result == TIXML_SUCCESS ) {
+			*_value = (float)d;
+		}
+		return result;
+	}
+
+    #ifdef TIXML_USE_STL
+	/** Template form of the attribute query which will try to read the
+		attribute into the specified type. Very easy, very powerful, but
+		be careful to make sure to call this with the correct type.
+		
+		NOTE: This method doesn't work correctly for 'string' types.
+
+		@return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE
+	*/
+	template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const
+	{
+		const TiXmlAttribute* node = attributeSet.Find( name );
+		if ( !node )
+			return TIXML_NO_ATTRIBUTE;
+
+		std::stringstream sstream( node->ValueStr() );
+		sstream >> *outValue;
+		if ( !sstream.fail() )
+			return TIXML_SUCCESS;
+		return TIXML_WRONG_TYPE;
+	}
+	/*
+	 This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string"
+	 but template specialization is hard to get working cross-compiler. Leaving the bug for now.
+	 
+	// The above will fail for std::string because the space character is used as a seperator.
+	// Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string
+	template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const
+	{
+		const TiXmlAttribute* node = attributeSet.Find( name );
+		if ( !node )
+			return TIXML_NO_ATTRIBUTE;
+		*outValue = node->ValueStr();
+		return TIXML_SUCCESS;
+	}
+	*/
+	#endif
+
+	/** Sets an attribute of name to a given value. The attribute
+		will be created if it does not exist, or changed if it does.
+	*/
+	void SetAttribute( const char* name, const char * _value );
+
+    #ifdef TIXML_USE_STL
+	const std::string* Attribute( const std::string& name ) const;
+	const std::string* Attribute( const std::string& name, int* i ) const;
+	const std::string* Attribute( const std::string& name, double* d ) const;
+	int QueryIntAttribute( const std::string& name, int* _value ) const;
+	int QueryDoubleAttribute( const std::string& name, double* _value ) const;
+
+	/// STL std::string form.
+	void SetAttribute( const std::string& name, const std::string& _value );
+	///< STL std::string form.
+	void SetAttribute( const std::string& name, int _value );
+	#endif
+
+	/** Sets an attribute of name to a given value. The attribute
+		will be created if it does not exist, or changed if it does.
+	*/
+	void SetAttribute( const char * name, int value );
+
+	/** Sets an attribute of name to a given value. The attribute
+		will be created if it does not exist, or changed if it does.
+	*/
+	void SetDoubleAttribute( const char * name, double value );
+
+	/** Deletes an attribute with the given name.
+	*/
+	void RemoveAttribute( const char * name );
+    #ifdef TIXML_USE_STL
+	void RemoveAttribute( const std::string& name )	{	RemoveAttribute (name.c_str ());	}	///< STL std::string form.
+	#endif
+
+	const TiXmlAttribute* FirstAttribute() const	{ return attributeSet.First(); }		///< Access the first attribute in this element.
+	TiXmlAttribute* FirstAttribute() 				{ return attributeSet.First(); }
+	const TiXmlAttribute* LastAttribute()	const 	{ return attributeSet.Last(); }		///< Access the last attribute in this element.
+	TiXmlAttribute* LastAttribute()					{ return attributeSet.Last(); }
+
+	/** Convenience function for easy access to the text inside an element. Although easy
+		and concise, GetText() is limited compared to getting the TiXmlText child
+		and accessing it directly.
+	
+		If the first child of 'this' is a TiXmlText, the GetText()
+		returns the character string of the Text node, else null is returned.
+
+		This is a convenient method for getting the text of simple contained text:
+		@verbatim
+		<foo>This is text</foo>
+		const char* str = fooElement->GetText();
+		@endverbatim
+
+		'str' will be a pointer to "This is text". 
+		
+		Note that this function can be misleading. If the element foo was created from
+		this XML:
+		@verbatim
+		<foo><b>This is text</b></foo> 
+		@endverbatim
+
+		then the value of str would be null. The first child node isn't a text node, it is
+		another element. From this XML:
+		@verbatim
+		<foo>This is <b>text</b></foo> 
+		@endverbatim
+		GetText() will return "This is ".
+
+		WARNING: GetText() accesses a child node - don't become confused with the 
+				 similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are 
+				 safe type casts on the referenced node.
+	*/
+	const char* GetText() const;
+
+	/// Creates a new Element and returns it - the returned element is a copy.
+	virtual TiXmlNode* Clone() const;
+	// Print the Element to a FILE stream.
+	virtual void Print( FILE* cfile, int depth ) const;
+
+	/*	Attribtue parsing starts: next char past '<'
+						 returns: next char past '>'
+	*/
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlElement*     ToElement()     const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlElement*           ToElement()	          { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+
+	void CopyTo( TiXmlElement* target ) const;
+	void ClearThis();	// like clear, but initializes 'this' object as well
+
+	// Used to be public [internal use]
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+	/*	[internal use]
+		Reads the "value" of the element -- another element, or text.
+		This should terminate with the current end tag.
+	*/
+	const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+
+private:
+
+	TiXmlAttributeSet attributeSet;
+};
+
+
+/**	An XML comment.
+*/
+class TiXmlComment : public TiXmlNode
+{
+public:
+	/// Constructs an empty comment.
+	TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
+	/// Construct a comment from text.
+	TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
+		SetValue( _value );
+	}
+	TiXmlComment( const TiXmlComment& );
+	void operator=( const TiXmlComment& base );
+
+	virtual ~TiXmlComment()	{}
+
+	/// Returns a copy of this Comment.
+	virtual TiXmlNode* Clone() const;
+	// Write this Comment to a FILE stream.
+	virtual void Print( FILE* cfile, int depth ) const;
+
+	/*	Attribtue parsing starts: at the ! of the !--
+						 returns: next char past '>'
+	*/
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlComment*  ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlComment*  ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+	void CopyTo( TiXmlComment* target ) const;
+
+	// used to be public
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+//	virtual void StreamOut( TIXML_OSTREAM * out ) const;
+
+private:
+
+};
+
+
+/** XML text. A text node can have 2 ways to output the next. "normal" output 
+	and CDATA. It will default to the mode it was parsed from the XML file and
+	you generally want to leave it alone, but you can change the output mode with 
+	SetCDATA() and query it with CDATA().
+*/
+class TiXmlText : public TiXmlNode
+{
+	friend class TiXmlElement;
+public:
+	/** Constructor for text element. By default, it is treated as 
+		normal, encoded text. If you want it be output as a CDATA text
+		element, set the parameter _cdata to 'true'
+	*/
+	TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
+	{
+		SetValue( initValue );
+		cdata = false;
+	}
+	virtual ~TiXmlText() {}
+
+	#ifdef TIXML_USE_STL
+	/// Constructor.
+	TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
+	{
+		SetValue( initValue );
+		cdata = false;
+	}
+	#endif
+
+	TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT )	{ copy.CopyTo( this ); }
+	void operator=( const TiXmlText& base )							 	{ base.CopyTo( this ); }
+
+	// Write this text object to a FILE stream.
+	virtual void Print( FILE* cfile, int depth ) const;
+
+	/// Queries whether this represents text using a CDATA section.
+	bool CDATA() const				{ return cdata; }
+	/// Turns on or off a CDATA representation of text.
+	void SetCDATA( bool _cdata )	{ cdata = _cdata; }
+
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlText*       ToText()       { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected :
+	///  [internal use] Creates a new Element and returns it.
+	virtual TiXmlNode* Clone() const;
+	void CopyTo( TiXmlText* target ) const;
+
+	bool Blank() const;	// returns true if all white space and new lines
+	// [internal use]
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+
+private:
+	bool cdata;			// true if this should be input and output as a CDATA style text element
+};
+
+
+/** In correct XML the declaration is the first entry in the file.
+	@verbatim
+		<?xml version="1.0" standalone="yes"?>
+	@endverbatim
+
+	TinyXml will happily read or write files without a declaration,
+	however. There are 3 possible attributes to the declaration:
+	version, encoding, and standalone.
+
+	Note: In this version of the code, the attributes are
+	handled as special cases, not generic attributes, simply
+	because there can only be at most 3 and they are always the same.
+*/
+class TiXmlDeclaration : public TiXmlNode
+{
+public:
+	/// Construct an empty declaration.
+	TiXmlDeclaration()   : TiXmlNode( TiXmlNode::DECLARATION ) {}
+
+#ifdef TIXML_USE_STL
+	/// Constructor.
+	TiXmlDeclaration(	const std::string& _version,
+						const std::string& _encoding,
+						const std::string& _standalone );
+#endif
+
+	/// Construct.
+	TiXmlDeclaration(	const char* _version,
+						const char* _encoding,
+						const char* _standalone );
+
+	TiXmlDeclaration( const TiXmlDeclaration& copy );
+	void operator=( const TiXmlDeclaration& copy );
+
+	virtual ~TiXmlDeclaration()	{}
+
+	/// Version. Will return an empty string if none was found.
+	const char *Version() const			{ return version.c_str (); }
+	/// Encoding. Will return an empty string if none was found.
+	const char *Encoding() const		{ return encoding.c_str (); }
+	/// Is this a standalone document?
+	const char *Standalone() const		{ return standalone.c_str (); }
+
+	/// Creates a copy of this Declaration and returns it.
+	virtual TiXmlNode* Clone() const;
+	// Print this declaration to a FILE stream.
+	virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
+	virtual void Print( FILE* cfile, int depth ) const {
+		Print( cfile, depth, 0 );
+	}
+
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlDeclaration*       ToDeclaration()       { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+	void CopyTo( TiXmlDeclaration* target ) const;
+	// used to be public
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+
+private:
+
+	TIXML_STRING version;
+	TIXML_STRING encoding;
+	TIXML_STRING standalone;
+};
+
+
+/** Any tag that tinyXml doesn't recognize is saved as an
+	unknown. It is a tag of text, but should not be modified.
+	It will be written back to the XML, unchanged, when the file
+	is saved.
+
+	DTD tags get thrown into TiXmlUnknowns.
+*/
+class TiXmlUnknown : public TiXmlNode
+{
+public:
+	TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN )	{}
+	virtual ~TiXmlUnknown() {}
+
+	TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN )		{ copy.CopyTo( this ); }
+	void operator=( const TiXmlUnknown& copy )										{ copy.CopyTo( this ); }
+
+	/// Creates a copy of this Unknown and returns it.
+	virtual TiXmlNode* Clone() const;
+	// Print this Unknown to a FILE stream.
+	virtual void Print( FILE* cfile, int depth ) const;
+
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlUnknown*     ToUnknown()     const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlUnknown*           ToUnknown()	    { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected:
+	void CopyTo( TiXmlUnknown* target ) const;
+
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+
+private:
+
+};
+
+
+/** Always the top level node. A document binds together all the
+	XML pieces. It can be saved, loaded, and printed to the screen.
+	The 'value' of a document node is the xml file name.
+*/
+class TiXmlDocument : public TiXmlNode
+{
+public:
+	/// Create an empty document, that has no name.
+	TiXmlDocument();
+	/// Create a document with a name. The name of the document is also the filename of the xml.
+	TiXmlDocument( const char * documentName );
+
+	#ifdef TIXML_USE_STL
+	/// Constructor.
+	TiXmlDocument( const std::string& documentName );
+	#endif
+
+	TiXmlDocument( const TiXmlDocument& copy );
+	void operator=( const TiXmlDocument& copy );
+
+	virtual ~TiXmlDocument() {}
+
+	/** Load a file using the current document value.
+		Returns true if successful. Will delete any existing
+		document data before loading.
+	*/
+	bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+	/// Save a file using the current document value. Returns true if successful.
+	bool SaveFile() const;
+	/// Load a file using the given filename. Returns true if successful.
+	bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+	/// Save a file using the given filename. Returns true if successful.
+	bool SaveFile( const char * filename ) const;
+	/** Load a file using the given FILE*. Returns true if successful. Note that this method
+		doesn't stream - the entire object pointed at by the FILE*
+		will be interpreted as an XML file. TinyXML doesn't stream in XML from the current
+		file location. Streaming may be added in the future.
+	*/
+	bool LoadFile( OSFILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+	/// Save a file using the given FILE*. Returns true if successful.
+	bool SaveFile( FILE* ) const;
+
+	#ifdef TIXML_USE_STL
+	bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )			///< STL std::string version.
+	{
+//		StringToBuffer f( filename );
+//		return ( f.buffer && LoadFile( f.buffer, encoding ));
+		return LoadFile( filename.c_str(), encoding );
+	}
+	bool SaveFile( const std::string& filename ) const		///< STL std::string version.
+	{
+//		StringToBuffer f( filename );
+//		return ( f.buffer && SaveFile( f.buffer ));
+		return SaveFile( filename.c_str() );
+	}
+	#endif
+
+	/** Parse the given null terminated block of xml data. Passing in an encoding to this
+		method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml
+		to use that encoding, regardless of what TinyXml might otherwise try to detect.
+	*/
+	virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+
+	/** Get the root element -- the only top level element -- of the document.
+		In well formed XML, there should only be one. TinyXml is tolerant of
+		multiple elements at the document level.
+	*/
+	const TiXmlElement* RootElement() const		{ return FirstChildElement(); }
+	TiXmlElement* RootElement()					{ return FirstChildElement(); }
+
+	/** If an error occurs, Error will be set to true. Also,
+		- The ErrorId() will contain the integer identifier of the error (not generally useful)
+		- The ErrorDesc() method will return the name of the error. (very useful)
+		- The ErrorRow() and ErrorCol() will return the location of the error (if known)
+	*/	
+	bool Error() const						{ return error; }
+
+	/// Contains a textual (english) description of the error if one occurs.
+	const char * ErrorDesc() const	{ return errorDesc.c_str (); }
+
+	/** Generally, you probably want the error string ( ErrorDesc() ). But if you
+		prefer the ErrorId, this function will fetch it.
+	*/
+	int ErrorId()	const				{ return errorId; }
+
+	/** Returns the location (if known) of the error. The first column is column 1, 
+		and the first row is row 1. A value of 0 means the row and column wasn't applicable
+		(memory errors, for example, have no row/column) or the parser lost the error. (An
+		error in the error reporting, in that case.)
+
+		@sa SetTabSize, Row, Column
+	*/
+	int ErrorRow() const	{ return errorLocation.row+1; }
+	int ErrorCol() const	{ return errorLocation.col+1; }	///< The column where the error occured. See ErrorRow()
+
+	/** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol())
+		to report the correct values for row and column. It does not change the output
+		or input in any way.
+		
+		By calling this method, with a tab size
+		greater than 0, the row and column of each node and attribute is stored
+		when the file is loaded. Very useful for tracking the DOM back in to
+		the source file.
+
+		The tab size is required for calculating the location of nodes. If not
+		set, the default of 4 is used. The tabsize is set per document. Setting
+		the tabsize to 0 disables row/column tracking.
+
+		Note that row and column tracking is not supported when using operator>>.
+
+		The tab size needs to be enabled before the parse or load. Correct usage:
+		@verbatim
+		TiXmlDocument doc;
+		doc.SetTabSize( 8 );
+		doc.Load( "myfile.xml" );
+		@endverbatim
+
+		@sa Row, Column
+	*/
+	void SetTabSize( int _tabsize )		{ tabsize = _tabsize; }
+
+	int TabSize() const	{ return tabsize; }
+
+	/** If you have handled the error, it can be reset with this call. The error
+		state is automatically cleared if you Parse a new XML block.
+	*/
+	void ClearError()						{	error = false; 
+												errorId = 0; 
+												errorDesc = ""; 
+												errorLocation.row = errorLocation.col = 0; 
+												//errorLocation.last = 0; 
+											}
+
+	/** Write the document to standard out using formatted printing ("pretty print"). */
+	void Print() const						{ Print( stdout, 0 ); }
+
+	/* Write the document to a string using formatted printing ("pretty print"). This
+		will allocate a character array (new char[]) and return it as a pointer. The
+		calling code pust call delete[] on the return char* to avoid a memory leak.
+	*/
+	//char* PrintToMemory() const; 
+
+	/// Print this Document to a FILE stream.
+	virtual void Print( FILE* cfile, int depth = 0 ) const;
+	// [internal use]
+	void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+
+	virtual const TiXmlDocument*    ToDocument()    const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlDocument*          ToDocument()          { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children. 
+	*/
+	virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected :
+	// [internal use]
+	virtual TiXmlNode* Clone() const;
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+
+private:
+	void CopyTo( TiXmlDocument* target ) const;
+
+	bool error;
+	int  errorId;
+	TIXML_STRING errorDesc;
+	int tabsize;
+	TiXmlCursor errorLocation;
+	bool useMicrosoftBOM;		// the UTF-8 BOM were found when read. Note this, and try to write.
+};
+
+
+/**
+	A TiXmlHandle is a class that wraps a node pointer with null checks; this is
+	an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml
+	DOM structure. It is a separate utility class.
+
+	Take an example:
+	@verbatim
+	<Document>
+		<Element attributeA = "valueA">
+			<Child attributeB = "value1" />
+			<Child attributeB = "value2" />
+		</Element>
+	<Document>
+	@endverbatim
+
+	Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very 
+	easy to write a *lot* of code that looks like:
+
+	@verbatim
+	TiXmlElement* root = document.FirstChildElement( "Document" );
+	if ( root )
+	{
+		TiXmlElement* element = root->FirstChildElement( "Element" );
+		if ( element )
+		{
+			TiXmlElement* child = element->FirstChildElement( "Child" );
+			if ( child )
+			{
+				TiXmlElement* child2 = child->NextSiblingElement( "Child" );
+				if ( child2 )
+				{
+					// Finally do something useful.
+	@endverbatim
+
+	And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity
+	of such code. A TiXmlHandle checks for null	pointers so it is perfectly safe 
+	and correct to use:
+
+	@verbatim
+	TiXmlHandle docHandle( &document );
+	TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
+	if ( child2 )
+	{
+		// do something useful
+	@endverbatim
+
+	Which is MUCH more concise and useful.
+
+	It is also safe to copy handles - internally they are nothing more than node pointers.
+	@verbatim
+	TiXmlHandle handleCopy = handle;
+	@endverbatim
+
+	What they should not be used for is iteration:
+
+	@verbatim
+	int i=0; 
+	while ( true )
+	{
+		TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
+		if ( !child )
+			break;
+		// do something
+		++i;
+	}
+	@endverbatim
+
+	It seems reasonable, but it is in fact two embedded while loops. The Child method is 
+	a linear walk to find the element, so this code would iterate much more than it needs 
+	to. Instead, prefer:
+
+	@verbatim
+	TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();
+
+	for( child; child; child=child->NextSiblingElement() )
+	{
+		// do something
+	}
+	@endverbatim
+*/
+class TiXmlHandle
+{
+public:
+	/// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
+	TiXmlHandle( TiXmlNode* _node )					{ this->node = _node; }
+	/// Copy constructor
+	TiXmlHandle( const TiXmlHandle& ref )			{ this->node = ref.node; }
+	TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
+
+	/// Return a handle to the first child node.
+	TiXmlHandle FirstChild() const;
+	/// Return a handle to the first child node with the given name.
+	TiXmlHandle FirstChild( const char * value ) const;
+	/// Return a handle to the first child element.
+	TiXmlHandle FirstChildElement() const;
+	/// Return a handle to the first child element with the given name.
+	TiXmlHandle FirstChildElement( const char * value ) const;
+
+	/** Return a handle to the "index" child with the given name. 
+		The first child is 0, the second 1, etc.
+	*/
+	TiXmlHandle Child( const char* value, int index ) const;
+	/** Return a handle to the "index" child. 
+		The first child is 0, the second 1, etc.
+	*/
+	TiXmlHandle Child( int index ) const;
+	/** Return a handle to the "index" child element with the given name. 
+		The first child element is 0, the second 1, etc. Note that only TiXmlElements
+		are indexed: other types are not counted.
+	*/
+	TiXmlHandle ChildElement( const char* value, int index ) const;
+	/** Return a handle to the "index" child element. 
+		The first child element is 0, the second 1, etc. Note that only TiXmlElements
+		are indexed: other types are not counted.
+	*/
+	TiXmlHandle ChildElement( int index ) const;
+
+	#ifdef TIXML_USE_STL
+	TiXmlHandle FirstChild( const std::string& _value ) const				{ return FirstChild( _value.c_str() ); }
+	TiXmlHandle FirstChildElement( const std::string& _value ) const		{ return FirstChildElement( _value.c_str() ); }
+
+	TiXmlHandle Child( const std::string& _value, int index ) const			{ return Child( _value.c_str(), index ); }
+	TiXmlHandle ChildElement( const std::string& _value, int index ) const	{ return ChildElement( _value.c_str(), index ); }
+	#endif
+
+	/** Return the handle as a TiXmlNode. This may return null.
+	*/
+	TiXmlNode* ToNode() const			{ return node; } 
+	/** Return the handle as a TiXmlElement. This may return null.
+	*/
+	TiXmlElement* ToElement() const		{ return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
+	/**	Return the handle as a TiXmlText. This may return null.
+	*/
+	TiXmlText* ToText() const			{ return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
+	/** Return the handle as a TiXmlUnknown. This may return null.
+	*/
+	TiXmlUnknown* ToUnknown() const		{ return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
+
+	/** @deprecated use ToNode. 
+		Return the handle as a TiXmlNode. This may return null.
+	*/
+	TiXmlNode* Node() const			{ return ToNode(); } 
+	/** @deprecated use ToElement. 
+		Return the handle as a TiXmlElement. This may return null.
+	*/
+	TiXmlElement* Element() const	{ return ToElement(); }
+	/**	@deprecated use ToText()
+		Return the handle as a TiXmlText. This may return null.
+	*/
+	TiXmlText* Text() const			{ return ToText(); }
+	/** @deprecated use ToUnknown()
+		Return the handle as a TiXmlUnknown. This may return null.
+	*/
+	TiXmlUnknown* Unknown() const	{ return ToUnknown(); }
+
+private:
+	TiXmlNode* node;
+};
+
+
+/** Print to memory functionality. The TiXmlPrinter is useful when you need to:
+
+	-# Print to memory (especially in non-STL mode)
+	-# Control formatting (line endings, etc.)
+
+	When constructed, the TiXmlPrinter is in its default "pretty printing" mode.
+	Before calling Accept() you can call methods to control the printing
+	of the XML document. After TiXmlNode::Accept() is called, the printed document can
+	be accessed via the CStr(), Str(), and Size() methods.
+
+	TiXmlPrinter uses the Visitor API.
+	@verbatim
+	TiXmlPrinter printer;
+	printer.SetIndent( "\t" );
+
+	doc.Accept( &printer );
+	fprintf( stdout, "%s", printer.CStr() );
+	@endverbatim
+*/
+class TiXmlPrinter : public TiXmlVisitor
+{
+public:
+	TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ),
+					 buffer(), indent( "    " ), lineBreak( "\n" ) {}
+
+	virtual bool VisitEnter( const TiXmlDocument& doc );
+	virtual bool VisitExit( const TiXmlDocument& doc );
+
+	virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
+	virtual bool VisitExit( const TiXmlElement& element );
+
+	virtual bool Visit( const TiXmlDeclaration& declaration );
+	virtual bool Visit( const TiXmlText& text );
+	virtual bool Visit( const TiXmlComment& comment );
+	virtual bool Visit( const TiXmlUnknown& unknown );
+
+	/** Set the indent characters for printing. By default 4 spaces
+		but tab (\t) is also useful, or null/empty string for no indentation.
+	*/
+	void SetIndent( const char* _indent )			{ indent = _indent ? _indent : "" ; }
+	/// Query the indention string.
+	const char* Indent()							{ return indent.c_str(); }
+	/** Set the line breaking string. By default set to newline (\n). 
+		Some operating systems prefer other characters, or can be
+		set to the null/empty string for no indenation.
+	*/
+	void SetLineBreak( const char* _lineBreak )		{ lineBreak = _lineBreak ? _lineBreak : ""; }
+	/// Query the current line breaking string.
+	const char* LineBreak()							{ return lineBreak.c_str(); }
+
+	/** Switch over to "stream printing" which is the most dense formatting without 
+		linebreaks. Common when the XML is needed for network transmission.
+	*/
+	void SetStreamPrinting()						{ indent = "";
+													  lineBreak = "";
+													}	
+	/// Return the result.
+	const char* CStr()								{ return buffer.c_str(); }
+	/// Return the length of the result string.
+	size_t Size()									{ return buffer.size(); }
+
+	#ifdef TIXML_USE_STL
+	/// Return the result.
+	const std::string& Str()						{ return buffer; }
+	#endif
+
+private:
+	void DoIndent()	{
+		for( int i=0; i<depth; ++i )
+			buffer += indent;
+	}
+	void DoLineBreak() {
+		buffer += lineBreak;
+	}
+
+	int depth;
+	bool simpleTextPrint;
+	TIXML_STRING buffer;
+	TIXML_STRING indent;
+	TIXML_STRING lineBreak;
+};
+
+
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
+#endif
+

+ 290 - 0
Core/Contents/Source/OSBasics.cpp

@@ -0,0 +1,290 @@
+/*
+ *  OSBasics.cpp
+ *  PolyStudio
+ *
+ *  Created by Ivan Safrin on 8/4/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "OSBasics.h"
+
+
+#ifdef _WINDOWS
+
+void wtoc(char* Dest, const WCHAR* Source)
+{
+	int i = 0;
+	while(Source[i] != '\0') {
+		Dest[i] = (char)Source[i];
+		++i;
+	}
+}
+void ctow(WCHAR* Dest, const char* Source)
+{
+	int i = 0;
+	while(Source[i] != '\0') {
+		Dest[i] = (WCHAR)Source[i];
+		++i;
+	}
+}
+
+#endif
+
+OSFileEntry::OSFileEntry(string path, string name, int type) {
+	this->basePath = path;
+	this->fullPath = path + "/" + string(name);
+	this->name = name;
+	this->type = type;
+
+	size_t found;
+	found=this->name.rfind(".");
+	if (found!=string::npos) {
+		extension = this->name.substr(found+1);
+		nameWithoutExtension = this->name.substr(0, found);
+	} else {
+		extension = "";
+		nameWithoutExtension = name;
+	}
+}
+
+void OSFILE::debugDump() {
+	long tellval = OSBasics::tell(this);
+	OSBasics::seek(this, 0, SEEK_SET);
+	
+	char buffer;
+	while(OSBasics::read(&buffer, 1, 1, this)) {
+		printf("%c", buffer);
+	}
+	
+	OSBasics::seek(this, tellval, SEEK_SET);
+}
+
+OSFILE *OSBasics::open(string filename, string opts) {
+	OSFILE *retFile = NULL;
+	if(PHYSFS_exists(filename.c_str())) {
+		if(!PHYSFS_isDirectory(filename.c_str())) {
+			retFile = new OSFILE;
+			retFile->fileType = OSFILE::TYPE_ARCHIVE_FILE;
+			if(opts.find("a") !=string::npos) {
+				retFile->physFSFile = PHYSFS_openAppend(filename.c_str());				
+				if(!retFile->physFSFile){
+					printf("Error opening file from archive (%s)\n", filename.c_str());
+					return NULL;		
+				}
+			} else if(opts.find("w") !=string::npos) {
+				retFile->physFSFile = PHYSFS_openWrite(filename.c_str());				
+				if(!retFile->physFSFile){
+					printf("Error opening file from archive (%s)\n", filename.c_str());
+					return NULL;		
+				}
+			} else {
+				retFile->physFSFile = PHYSFS_openRead(filename.c_str());				
+				if(!retFile->physFSFile){
+					printf("Error opening file from archive (%s)\n", filename.c_str());
+					return NULL;		
+				}
+			}
+			return retFile;
+		}
+	}
+	
+	FILE *file = fopen(filename.c_str(), opts.c_str());
+	if(file) {
+		retFile = new OSFILE;
+		retFile->fileType = OSFILE::TYPE_FILE;
+		retFile->file = file;		
+		return retFile;
+	}
+	
+	return NULL;
+}
+
+int OSBasics::close(OSFILE *file) {
+	switch(file->fileType) {
+		case OSFILE::TYPE_FILE:
+			return fclose(file->file);
+			break;
+		case OSFILE::TYPE_ARCHIVE_FILE:
+			return PHYSFS_close(file->physFSFile);
+			break;			
+	}
+	return 0;
+}
+
+long OSBasics::tell(OSFILE * stream) {
+	switch(stream->fileType) {
+		case OSFILE::TYPE_FILE:
+			return ftell(stream->file);
+			break;
+		case OSFILE::TYPE_ARCHIVE_FILE:
+			return PHYSFS_tell(stream->physFSFile);
+			break;			
+	}
+	return 0;
+}
+
+size_t OSBasics::read( void * ptr, size_t size, size_t count, OSFILE * stream ) {
+	switch(stream->fileType) {
+		case OSFILE::TYPE_FILE:
+			return fread(ptr, size, count, stream->file);
+		break;
+		case OSFILE::TYPE_ARCHIVE_FILE:
+			return PHYSFS_read(stream->physFSFile, ptr, size, count);
+		break;			
+	}
+	return 0;
+}
+
+size_t OSBasics::write( const void * ptr, size_t size, size_t count, OSFILE * stream ) {
+	switch(stream->fileType) {
+		case OSFILE::TYPE_FILE:
+			fwrite(ptr, size, count, stream->file);
+			break;
+		case OSFILE::TYPE_ARCHIVE_FILE:
+			PHYSFS_write(stream->physFSFile, ptr, size, count);
+		break;			
+	}
+	return 0;
+}
+
+int OSBasics::seek(OSFILE * stream, long int offset, int origin ) {
+	switch(stream->fileType) {
+		case OSFILE::TYPE_FILE:
+			return fseek(stream->file, offset, origin);
+			break;
+		case OSFILE::TYPE_ARCHIVE_FILE:
+			switch(origin) {
+				case SEEK_SET:
+					return PHYSFS_seek(stream->physFSFile, offset);
+				break;
+				case SEEK_CUR: {
+					PHYSFS_sint64 curoffset = PHYSFS_tell(stream->physFSFile);					
+					return PHYSFS_seek(stream->physFSFile, curoffset+offset);				
+				}
+				break;
+				case SEEK_END: {
+					PHYSFS_sint64 fileLength =  PHYSFS_fileLength(stream->physFSFile);
+					return PHYSFS_seek(stream->physFSFile, fileLength-offset);
+				}
+				break;
+			}
+			break;			
+	}
+	return 0;	
+}
+
+vector<OSFileEntry> OSBasics::parsePhysFSFolder(string pathString, bool showHidden) {
+	vector<OSFileEntry> returnVector;
+	
+	char **rc = PHYSFS_enumerateFiles(pathString.c_str());
+	char **i;
+	
+	string fullPath;
+	string fname;
+	for (i = rc; *i != NULL; i++) {
+		fname = string(*i);
+		fullPath = pathString + "/" + fname;
+		printf("parsing in %s\n", *i);
+		if((fname.c_str()[0] != '.' || (fname.c_str()[0] == '.'  && showHidden)) && fname != "..") {
+			if(PHYSFS_isDirectory(fullPath.c_str())) {
+				returnVector.push_back(OSFileEntry(pathString, fname, OSFileEntry::TYPE_FOLDER));
+			} else { 
+				returnVector.push_back(OSFileEntry(pathString, fname, OSFileEntry::TYPE_FILE));		
+			}
+		}
+	}
+	PHYSFS_freeList(rc);	
+	return returnVector;
+}
+
+vector<OSFileEntry> OSBasics::parseFolder(string pathString, bool showHidden) {
+	vector<OSFileEntry> returnVector;
+	
+	if(pathString.size() < 128) {
+		if(PHYSFS_exists(pathString.c_str())) {
+			if(PHYSFS_isDirectory(pathString.c_str())) {
+				return parsePhysFSFolder(pathString, showHidden);
+			}
+		}
+	}
+	
+	
+#ifdef _WINDOWS
+
+	WIN32_FIND_DATA findFileData;
+
+	WCHAR curDir[4096];
+	GetCurrentDirectory(4096, curDir);
+
+	WCHAR tmp[4096];
+	memset(tmp, 0, sizeof(WCHAR)*4096);
+	ctow(tmp, pathString.c_str());
+	SetCurrentDirectory(tmp);
+
+	HANDLE hFind = FindFirstFile((LPCWSTR)"*", &findFileData);
+	if(hFind  == INVALID_HANDLE_VALUE) {
+		SetCurrentDirectory(curDir);
+		return returnVector;
+	}
+
+	char fileName[260];
+	do {		
+		memset(fileName, 0, 260);
+		wtoc(fileName, findFileData.cFileName);
+		string fname = string(fileName);
+		
+		if((fname.c_str()[0] != '.' || (fname.c_str()[0] == '.'  && showHidden)) && fname != "..") {
+			if( findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
+				returnVector.push_back(OSFileEntry(pathString, fname, OSFileEntry::TYPE_FOLDER));
+			} else {
+				returnVector.push_back(OSFileEntry(pathString, fname, OSFileEntry::TYPE_FILE));
+			}
+		}
+    } while(FindNextFile(hFind, &findFileData));	
+	FindClose(hFind);
+	SetCurrentDirectory(curDir);
+#else
+	DIR           *d;
+	struct dirent *dir;
+	
+	d = opendir(pathString.c_str());
+	if(d) {
+		while ((dir = readdir(d)) != NULL) {
+			if(dir->d_name[0] != '.' || (dir->d_name[0] == '.'  && showHidden)) {
+				if(dir->d_type == DT_DIR) {
+					returnVector.push_back(OSFileEntry(pathString, dir->d_name, OSFileEntry::TYPE_FOLDER));
+				} else {
+					returnVector.push_back(OSFileEntry(pathString, dir->d_name, OSFileEntry::TYPE_FILE));
+				}
+			}
+		}
+		closedir(d);
+	}
+	
+#endif
+		
+	return returnVector;
+}
+
+void OSBasics::createFolder(string pathString) {
+#ifdef _WINDOWS
+#else
+	mkdir(pathString.c_str(),  S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+#endif
+}
+
+bool OSBasics::isFolder(string pathString) {	
+	bool retVal = false;
+#ifdef _WINDOWS
+#else
+	DIR           *d;
+	
+	d = opendir(pathString.c_str());
+	if(d) {
+		retVal = true;
+		closedir(d);
+	}
+#endif
+	return retVal;
+}

+ 239 - 0
Core/Contents/Source/PolyAGLCore.cpp

@@ -0,0 +1,239 @@
+/*
+ *  PolyAGLCore.cpp
+ *  TAU
+ *
+ *  Created by Ivan Safrin on 3/12/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "PolyAGLCore.h"
+#include <iostream>
+
+using namespace Polycode;
+
+long getThreadID() {
+	return (long)pthread_self();
+}
+
+AGLCore::AGLCore(WindowRef window, Polycode::Rectangle *clippingArea, int xRes, int yRes, bool fullScreen,int aaLevel, int frameRate) : Core(xRes, yRes, fullScreen,aaLevel, frameRate) {
+
+	eventMutex = createMutex();
+	
+	mainWindow = window;
+	initTime = mach_absolute_time();	
+	
+	lockMutex(CoreServices::getRenderMutex());
+	
+	int numBuffers = 0;	
+	if(aaLevel > 0) {
+		numBuffers = 1;
+	}
+	
+	AGLPixelFormat pf;
+	
+	printf("AA: %d\n", aaLevel);
+		
+	if(aaLevel > 0) {	
+		GLint attrib[] = { AGL_RGBA,
+		AGL_DEPTH_SIZE, 32,
+		AGL_RED_SIZE, 8,
+		AGL_GREEN_SIZE, 8,
+		AGL_BLUE_SIZE, 8,
+		AGL_ALPHA_SIZE, 8,			
+		AGL_DOUBLEBUFFER,
+		AGL_SAMPLE_BUFFERS_ARB, numBuffers,
+		AGL_SAMPLES_ARB, aaLevel,
+		AGL_SUPERSAMPLE,
+		AGL_NO_RECOVERY,
+		AGL_NONE };		
+		pf = aglChoosePixelFormat (NULL, 0, attrib);
+	} else {
+		GLint attrib[] = { AGL_RGBA,
+			AGL_DEPTH_SIZE, 32,
+			AGL_RED_SIZE, 8,
+			AGL_GREEN_SIZE, 8,
+			AGL_BLUE_SIZE, 8,
+			AGL_ALPHA_SIZE, 8,			
+			AGL_DOUBLEBUFFER,
+			AGL_SAMPLE_BUFFERS_ARB, 0,
+			AGL_SAMPLES_ARB, 0,
+			AGL_SUPERSAMPLE,
+			AGL_NO_RECOVERY,
+		AGL_NONE };		
+		pf = aglChoosePixelFormat (NULL, 0, attrib);		
+	}
+
+	aglContext = NULL;
+	aglContext = aglCreateContext (pf, NULL);
+
+	if (aglContext) {
+		aglSetWindowRef(aglContext,window);
+		aglSetCurrentContext (NULL);		
+		aglSetCurrentContext (aglContext);
+	} else {
+		Logger::log("ERROR CREATING AGL CONTEXT!\n");
+	}
+		
+	aglDestroyPixelFormat (pf);	
+	
+	if(clippingArea) {
+		const GLint bufferRect[4] = {clippingArea->x, clippingArea->y, clippingArea->w, clippingArea->h};	
+		aglSetInteger(aglContext, AGL_BUFFER_RECT, bufferRect);
+		aglEnable(aglContext, AGL_BUFFER_RECT);	
+	}
+	
+	renderer = new OpenGLRenderer();
+
+	if(aaLevel > 0) {
+		glEnable (GL_MULTISAMPLE_ARB);
+		glHint (GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);		
+	}
+	
+	services->setRenderer(renderer);
+	renderer->Resize(xRes, yRes);
+	
+	unlockMutex(CoreServices::getRenderMutex());		
+	
+//	setVideoMode(xRes, yRes, fullScreen, aaLevel);	
+}
+				 
+void AGLCore::setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel) {
+	lockMutex(CoreServices::getRenderMutex());	
+	dispatchEvent(new Event(), EVENT_CORE_RESIZE);
+	
+	aglSetCurrentContext (NULL);		
+	aglSetCurrentContext (aglContext);
+
+	const GLint bufferRect[4] = {0, 0, xRes, yRes};	
+	aglSetInteger(aglContext, AGL_BUFFER_RECT, bufferRect);
+	aglEnable(aglContext, AGL_BUFFER_RECT);		
+
+	if(fullScreen) {
+		aglEnable (aglContext, AGL_FS_CAPTURE_SINGLE);		
+		aglSetFullScreen(aglContext, xRes, yRes, 0, 0);
+	} else {
+		
+	}
+	
+	renderer->Resize(xRes, yRes);
+	
+	if(aaLevel > 0) {
+		glEnable (GL_MULTISAMPLE_ARB);
+		glHint (GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);		
+	}
+	
+	unlockMutex(CoreServices::getRenderMutex());	
+
+	CoreServices::getInstance()->getMaterialManager()->reloadProgramsAndTextures();
+	
+}
+
+vector<Poly::Rectangle> AGLCore::getVideoModes() {
+	vector<Poly::Rectangle> retVector;
+	return retVector;
+}
+
+AGLCore::~AGLCore() {
+	Logger::log("Destroying AGL core...\n");
+	aglDestroyContext(aglContext);
+}
+
+void *AGLThreadFunc(void *data) {
+	Threaded *target = static_cast<Threaded*>(data);
+	target->runThread();
+	return NULL;
+}
+
+void AGLCore::createThread(Threaded *target) {
+	pthread_t thread;
+	pthread_create( &thread, NULL, AGLThreadFunc, (void*)target);
+}
+
+void AGLCore::lockMutex(CoreMutex *mutex) {
+	PosixMutex *m = (PosixMutex*) mutex;
+	pthread_mutex_lock(&m->pMutex);	
+}
+
+void AGLCore::unlockMutex(CoreMutex *mutex) {
+	PosixMutex *m = (PosixMutex*) mutex;
+	pthread_mutex_unlock(&m->pMutex);
+}
+
+CoreMutex *AGLCore::createMutex() {
+	PosixMutex *mutex = new PosixMutex();	
+	pthread_mutex_init(&mutex->pMutex, NULL);
+	return mutex;
+}
+
+unsigned int AGLCore::getTicks() {
+	uint64_t time = mach_absolute_time();	
+	double conversion = 0.0;
+	
+	mach_timebase_info_data_t info;
+	mach_timebase_info( &info );
+	conversion = 1e-9 * (double) info.numer / (double) info.denom;	
+	
+	return (((double)(time - initTime)) * conversion) * 1000.0f;
+}
+
+void AGLCore::enableMouse(bool newval) {
+	Core::enableMouse(newval);
+}
+
+void AGLCore::checkEvents() {
+	lockMutex(eventMutex);
+	OSXEvent event;
+	for(int i=0; i < osxEvents.size(); i++) {
+		event = osxEvents[i];
+		switch(event.eventGroup) {
+			case OSXEvent::INPUT_EVENT:
+				switch(event.eventCode) {
+					case InputEvent::EVENT_MOUSEMOVE:
+						input->setDeltaPosition(lastMouseX - event.mouseX, lastMouseY - event.mouseY);										
+						lastMouseX = event.mouseX;
+						lastMouseY = event.mouseY;
+						input->setMousePosition(event.mouseX, event.mouseY, getTicks());						
+					break;
+					case InputEvent::EVENT_MOUSEDOWN:
+							input->setMouseButtonState(event.mouseButton, true, getTicks());						
+					break;
+					case InputEvent::EVENT_MOUSEUP:
+							input->setMouseButtonState(event.mouseButton, false, getTicks());
+					break;
+					case InputEvent::EVENT_KEYDOWN:
+						input->setKeyState(event.keyCode, (char)event.unicodeChar, true, getTicks());
+					break;
+					case InputEvent::EVENT_KEYUP:
+						input->setKeyState(event.keyCode, (char)event.unicodeChar, false, getTicks());
+					break;						
+				}
+			break;
+		}
+	}
+	osxEvents.clear();	
+	unlockMutex(eventMutex);		
+}
+
+bool AGLCore::Update() {
+	if(!running)
+		return false;
+		
+	lockMutex(CoreServices::getRenderMutex());
+	
+	checkEvents();
+	
+//	aglSetCurrentContext(NULL);
+//	aglSetCurrentContext(aglContext);
+	renderer->BeginRender();
+	updateCore();
+	renderer->EndRender();
+
+	aglSwapBuffers(aglContext);
+//	aglSetCurrentContext(NULL);
+	
+	unlockMutex(CoreServices::getRenderMutex());
+	doSleep();
+	
+	return running;
+}

+ 149 - 0
Core/Contents/Source/PolyBezierCurve.cpp

@@ -0,0 +1,149 @@
+/*
+ *  PolyBezierCurve.cpp
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/5/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+
+#include "PolyBezierCurve.h"
+
+using namespace Polycode;
+
+
+BezierPoint::BezierPoint(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z) {
+	p1.x = p1x;
+	p1.y = p1y;
+	p1.z = p1z;		
+	p2.x = p2x;
+	p2.y = p2y;
+	p2.z = p2z;		
+	p3.x = p3x;
+	p3.y = p3y;
+	p3.z = p3z;	
+}
+
+BezierCurve::BezierCurve(){
+	for(int i=0; i < BUFFER_CACHE_PRECISION; i++) {
+		heightBuffer[i] = 0;
+	}
+	
+	buffersDirty = false;	
+}
+
+BezierCurve::~BezierCurve() {
+
+}
+
+void BezierCurve::addControlPoint(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z) {
+	BezierPoint* newPoint = new BezierPoint(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z);
+	controlPoints.push_back(newPoint);
+	distances.push_back(0);
+	recalculateDistances();
+	buffersDirty = true;	
+}
+
+void BezierCurve::addControlPoint3dWithHandles(float p1x, float p1y, float p1z, float p2x, float p2y, float p2z, float p3x, float p3y, float p3z) {
+	addControlPoint(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z);
+}
+
+void BezierCurve::addControlPoint3d(float x, float y, float z) {
+	addControlPoint(x, y, z, x, y, z, x, y, z);
+}
+
+void BezierCurve::addControlPoint2dWithHandles(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) {
+	addControlPoint(p1x, p1y, 0, p2x, p2y, 0, p3x, p3y, 0);
+}
+
+void BezierCurve::addControlPoint2d(float x, float y) {
+	addControlPoint(x, y, 0, x, y, 0, x, y, 0);
+}
+
+
+void BezierCurve::recalculateDistances() {
+	if(controlPoints.size() < 2)
+		return;
+		
+	float dist, lastDist = 0;
+	distances[0] = 0;
+	float totalDistance = 0;
+		
+	Vector3 point, lastPoint;
+	for(int i=0; i < controlPoints.size()-1; i++) {
+		lastPoint = getPointBetween(0, controlPoints[i], controlPoints[i+1]);
+		dist = 0;
+		for(float a=0.0f; a < 1.0f; a += 0.01) {
+			point = getPointBetween(a, controlPoints[i], controlPoints[i+1]);
+			dist += point.distance(lastPoint);
+			lastPoint = point;
+		}
+		lastDist += dist;
+		distances[i+1] = lastDist;
+		totalDistance += dist;
+	}
+	
+	// normalize distances to total distance
+	for(int i=0; i < controlPoints.size(); i++) {
+		distances[i] = distances[i]/totalDistance;
+	}
+}
+
+Vector3 BezierCurve::getPointBetween(float a, BezierPoint *bp1, BezierPoint *bp2) {
+	Vector3 retVector;
+	float b = 1.0f - a;
+	
+	retVector.x = bp1->p2.x*a*a*a + bp1->p3.x*3*a*a*b + bp2->p1.x*3*a*b*b + bp2->p2.x*b*b*b;
+	retVector.y = bp1->p2.y*a*a*a + bp1->p3.y*3*a*a*b + bp2->p1.y*3*a*b*b + bp2->p2.y*b*b*b;
+	retVector.z = bp1->p2.z*a*a*a + bp1->p3.z*3*a*a*b + bp2->p1.z*3*a*b*b + bp2->p2.z*b*b*b;	
+
+	return retVector;
+}
+
+BezierPoint *BezierCurve::getControlPoint(unsigned int index) {
+	return controlPoints[index];
+} 
+
+unsigned int BezierCurve::getNumControlPoints() {
+	return controlPoints.size();
+}
+
+float BezierCurve::getHeightAt(float a) {
+	if( a< 0) a = 0;
+	if(a > 1) a = 1;
+	
+	if (buffersDirty) 
+		rebuildBuffers();
+	
+	int index = ((float)(BUFFER_CACHE_PRECISION)) * a;	
+	return heightBuffer[index];
+	
+//	return getPointAt(a).y;
+}
+
+void BezierCurve::rebuildBuffers() {
+	for(int i=0; i < BUFFER_CACHE_PRECISION; i++) {
+		heightBuffer[i]	= getPointAt(((float)i)/((float)BUFFER_CACHE_PRECISION)).y;
+	}
+	buffersDirty = false;
+}
+
+Vector3 BezierCurve::getPointAt(float a) {
+	if(a < 0)
+		a = 0;
+	if(a > 1)
+		a = 1;
+		
+		
+	if(controlPoints.size() < 2)
+		return Vector3(0,0,0);
+	
+	Vector3 retVector;
+	for(int i=0; i < controlPoints.size()-1; i++) {
+		if(a >= distances[i] && a <= distances[i+1]) {
+			retVector = getPointBetween(1.0f-((a-distances[i])/(distances[i+1]-distances[i])), controlPoints[i], controlPoints[i+1]);
+		}
+	}
+	return retVector;
+}

+ 122 - 0
Core/Contents/Source/PolyBone.cpp

@@ -0,0 +1,122 @@
+/*
+ *  PolyBone.cpp
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 9/5/08.
+ *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include "PolyBone.h"
+
+using namespace Polycode;
+
+Bone::Bone(string boneName) : SceneEntity() {
+	this->boneName = boneName;
+
+	boneMesh = new Mesh(Mesh::QUAD_MESH);
+	boneMesh->createBox(0.1,0.1,0.1);
+	bBoxRadius = boneMesh->getRadius();
+	bBox = boneMesh->calculateBBox();
+//	color.setColor(1.0f, 0.0f, 0.0f, 1.0f);
+	this->setDepthWrite(false);
+	parentBone = NULL;
+	boneMatrix.init();
+}
+
+
+Bone::~Bone() {
+
+}
+
+void Bone::setParentBone(Bone *bone) {
+	parentBone = bone;
+}
+
+void Bone::addChildBone(Bone *bone) {
+	childBones.push_back(bone);
+}
+
+Bone* Bone::getParentBone() {
+	return parentBone;
+}
+
+int Bone::getNumChildBones() {
+	return childBones.size();
+}
+
+Bone *Bone::getChildBone(unsigned int index) {
+	if(index > childBones.size()-1)
+		index = childBones.size()-1;
+		
+	return childBones[index];
+}
+
+Matrix4 Bone::getBoneMatrix() {
+	if(parentBone)
+		return boneMatrix * parentBone->getBoneMatrix();
+	else {
+		return boneMatrix;
+	}
+}
+
+Matrix4 Bone::getFinalMatrix() {
+	Matrix4 final = boneMatrix * restMatrix;
+
+	if(parentBone) {
+		final = final * parentBone->getFinalMatrix();
+	} 
+	
+	return final;
+}
+
+void Bone::setBoneMatrix(Matrix4 matrix) {
+	boneMatrix = matrix;
+}
+
+Matrix4 Bone::getRestMatrix() {
+	return restMatrix;
+}
+
+Matrix4 Bone::getParentRestMatrix() {
+	if(parentBone)
+		return parentBone->getFullRestMatrix();
+	else {
+		Matrix4 ident;
+		ident.identity();
+		return ident;
+	}
+}
+
+Matrix4 Bone::getFullRestMatrix() {
+	if(parentBone)
+		return restMatrix * parentBone->getFullRestMatrix();
+	else {
+		return restMatrix;
+	}
+}
+
+void Bone::setRestMatrix(Matrix4 matrix) {
+	restMatrix = matrix;
+}
+
+string Bone::getName() {
+	return boneName;
+}
+
+void Bone::enableBoneLabel(Font *font, float size, float scale) {
+//	SceneLabel *label = new SceneLabel("", boneName, size, scale, Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("", L"FIX ME", size, scale, Label::ANTIALIAS_FULL);	
+	label->billboardMode = true;
+	label->setDepthWrite(false);
+	addEntity(label);
+}
+
+void Bone::Render() {
+	CoreServices::getInstance()->getRenderer()->setTexture(NULL);	
+//	renderer->pushDataArrayForMesh(boneMesh, RenderDataArray::COLOR_DATA_ARRAY);
+//	renderer->pushDataArrayForMesh(boneMesh, RenderDataArray::VERTEX_DATA_ARRAY);
+//	renderer->pushDataArrayForMesh(boneMesh, RenderDataArray::TEXCOORD_DATA_ARRAY);	
+//	renderer->pushDataArrayForMesh(boneMesh, RenderDataArray::NORMAL_DATA_ARRAY);		
+//	renderer->drawArrays(boneMesh->getMeshType());	
+}

+ 308 - 0
Core/Contents/Source/PolyCamera.cpp

@@ -0,0 +1,308 @@
+/*
+ *  PolyCamera.cpp
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 3/26/08.
+ *  Copyright 2008 Ivan Safrin. All rights reserved.
+ *
+ */
+
+#include "PolyCamera.h"
+
+using namespace Polycode;
+			
+Camera::Camera(Scene *parentScene) : SceneEntity() {
+	setParentScene(parentScene);
+	orthoMode = false;
+	fov = 45.0f;
+	exposureLevel = 1.0f;
+	_hasFilterShader = false;	
+	fovSet = false;
+}
+
+Camera::~Camera() {
+
+}
+
+void Camera::setExposureLevel(float level) {
+	exposureLevel = level;
+}
+
+float Camera::getExposureLevel() {
+	return exposureLevel;
+}
+
+
+void Camera::setFOV(float fov) {
+	this->fov = fov;
+	fovSet = true;
+}
+
+float Camera::getFOV() {
+	return fov;
+}
+
+
+bool Camera::isSphereInFrustrum(Vector3 pos, float fRadius) {
+    for( int i = 0; i < 6; ++i )
+    {
+        if( frustumPlanes[i][0] * pos.x +
+            frustumPlanes[i][1] * pos.y +
+            frustumPlanes[i][2] * pos.z +
+            frustumPlanes[i][3] <= -fRadius )
+            return false;
+    }
+
+    return true;
+}
+
+void Camera::setOrthoMode(bool mode) {
+	orthoMode = mode;
+}			
+
+bool Camera::getOrthoMode() {
+	return orthoMode;
+}
+
+void Camera::buildFrustrumPlanes() {
+
+	Matrix4 p; 
+	Matrix4 mv;
+	Matrix4 mvp;
+	float t;
+
+	p = CoreServices::getInstance()->getRenderer()->getProjectionMatrix();
+    mv = CoreServices::getInstance()->getRenderer()->getModelviewMatrix();
+
+    //
+    // Concatenate the projection matrix and the model-view matrix to produce 
+    // a combined model-view-projection matrix.
+    //
+
+    mvp.ml[ 0] = mv.ml[ 0] * p.ml[ 0] + mv.ml[ 1] * p.ml[ 4] + mv.ml[ 2] * p.ml[ 8] + mv.ml[ 3] * p.ml[12];
+
+    mvp.ml[ 1] = mv.ml[ 0] * p.ml[ 1] + mv.ml[ 1] * p.ml[ 5] + mv.ml[ 2] * p.ml[ 9] + mv.ml[ 3] * p.ml[13];
+    mvp.ml[ 2] = mv.ml[ 0] * p.ml[ 2] + mv.ml[ 1] * p.ml[ 6] + mv.ml[ 2] * p.ml[10] + mv.ml[ 3] * p.ml[14];
+    mvp.ml[ 3] = mv.ml[ 0] * p.ml[ 3] + mv.ml[ 1] * p.ml[ 7] + mv.ml[ 2] * p.ml[11] + mv.ml[ 3] * p.ml[15];
+
+    mvp.ml[ 4] = mv.ml[ 4] * p.ml[ 0] + mv.ml[ 5] * p.ml[ 4] + mv.ml[ 6] * p.ml[ 8] + mv.ml[ 7] * p.ml[12];
+    mvp.ml[ 5] = mv.ml[ 4] * p.ml[ 1] + mv.ml[ 5] * p.ml[ 5] + mv.ml[ 6] * p.ml[ 9] + mv.ml[ 7] * p.ml[13];
+    mvp.ml[ 6] = mv.ml[ 4] * p.ml[ 2] + mv.ml[ 5] * p.ml[ 6] + mv.ml[ 6] * p.ml[10] + mv.ml[ 7] * p.ml[14];
+    mvp.ml[ 7] = mv.ml[ 4] * p.ml[ 3] + mv.ml[ 5] * p.ml[ 7] + mv.ml[ 6] * p.ml[11] + mv.ml[ 7] * p.ml[15];
+
+    mvp.ml[ 8] = mv.ml[ 8] * p.ml[ 0] + mv.ml[ 9] * p.ml[ 4] + mv.ml[10] * p.ml[ 8] + mv.ml[11] * p.ml[12];
+    mvp.ml[ 9] = mv.ml[ 8] * p.ml[ 1] + mv.ml[ 9] * p.ml[ 5] + mv.ml[10] * p.ml[ 9] + mv.ml[11] * p.ml[13];
+    mvp.ml[10] = mv.ml[ 8] * p.ml[ 2] + mv.ml[ 9] * p.ml[ 6] + mv.ml[10] * p.ml[10] + mv.ml[11] * p.ml[14];
+    mvp.ml[11] = mv.ml[ 8] * p.ml[ 3] + mv.ml[ 9] * p.ml[ 7] + mv.ml[10] * p.ml[11] + mv.ml[11] * p.ml[15];
+
+    mvp.ml[12] = mv.ml[12] * p.ml[ 0] + mv.ml[13] * p.ml[ 4] + mv.ml[14] * p.ml[ 8] + mv.ml[15] * p.ml[12];
+    mvp.ml[13] = mv.ml[12] * p.ml[ 1] + mv.ml[13] * p.ml[ 5] + mv.ml[14] * p.ml[ 9] + mv.ml[15] * p.ml[13];
+    mvp.ml[14] = mv.ml[12] * p.ml[ 2] + mv.ml[13] * p.ml[ 6] + mv.ml[14] * p.ml[10] + mv.ml[15] * p.ml[14];
+    mvp.ml[15] = mv.ml[12] * p.ml[ 3] + mv.ml[13] * p.ml[ 7] + mv.ml[14] * p.ml[11] + mv.ml[15] * p.ml[15];
+
+    //
+    // Extract the frustum's right clipping plane and normalize it.
+    //
+
+    frustumPlanes[0][0] = mvp.ml[ 3] - mvp.ml[ 0];
+    frustumPlanes[0][1] = mvp.ml[ 7] - mvp.ml[ 4];
+    frustumPlanes[0][2] = mvp.ml[11] - mvp.ml[ 8];
+    frustumPlanes[0][3] = mvp.ml[15] - mvp.ml[12];
+
+    t = (float) sqrt( frustumPlanes[0][0] * frustumPlanes[0][0] + 
+                      frustumPlanes[0][1] * frustumPlanes[0][1] + 
+                      frustumPlanes[0][2] * frustumPlanes[0][2] );
+
+    frustumPlanes[0][0] /= t;
+    frustumPlanes[0][1] /= t;
+    frustumPlanes[0][2] /= t;
+    frustumPlanes[0][3] /= t;
+
+    //
+    // Extract the frustum's left clipping plane and normalize it.
+    //
+
+    frustumPlanes[1][0] = mvp.ml[ 3] + mvp.ml[ 0];
+    frustumPlanes[1][1] = mvp.ml[ 7] + mvp.ml[ 4];
+    frustumPlanes[1][2] = mvp.ml[11] + mvp.ml[ 8];
+    frustumPlanes[1][3] = mvp.ml[15] + mvp.ml[12];
+
+    t = (float) sqrt( frustumPlanes[1][0] * frustumPlanes[1][0] + 
+                      frustumPlanes[1][1] * frustumPlanes[1][1] + 
+                      frustumPlanes[1][2] * frustumPlanes[1][2] );
+
+    frustumPlanes[1][0] /= t;
+    frustumPlanes[1][1] /= t;
+    frustumPlanes[1][2] /= t;
+    frustumPlanes[1][3] /= t;
+
+    //
+    // Extract the frustum's bottom clipping plane and normalize it.
+    //
+
+    frustumPlanes[2][0] = mvp.ml[ 3] + mvp.ml[ 1];
+    frustumPlanes[2][1] = mvp.ml[ 7] + mvp.ml[ 5];
+    frustumPlanes[2][2] = mvp.ml[11] + mvp.ml[ 9];
+    frustumPlanes[2][3] = mvp.ml[15] + mvp.ml[13];
+
+    t = (float) sqrt( frustumPlanes[2][0] * frustumPlanes[2][0] + 
+                      frustumPlanes[2][1] * frustumPlanes[2][1] + 
+                      frustumPlanes[2][2] * frustumPlanes[2][2] );
+
+    frustumPlanes[2][0] /= t;
+    frustumPlanes[2][1] /= t;
+    frustumPlanes[2][2] /= t;
+    frustumPlanes[2][3] /= t;
+
+    //
+    // Extract the frustum's top clipping plane and normalize it.
+    //
+
+    frustumPlanes[3][0] = mvp.ml[ 3] - mvp.ml[ 1];
+    frustumPlanes[3][1] = mvp.ml[ 7] - mvp.ml[ 5];
+    frustumPlanes[3][2] = mvp.ml[11] - mvp.ml[ 9];
+    frustumPlanes[3][3] = mvp.ml[15] - mvp.ml[13];
+
+    t = (float) sqrt( frustumPlanes[3][0] * frustumPlanes[3][0] + 
+                      frustumPlanes[3][1] * frustumPlanes[3][1] + 
+                      frustumPlanes[3][2] * frustumPlanes[3][2] );
+
+    frustumPlanes[3][0] /= t;
+    frustumPlanes[3][1] /= t;
+    frustumPlanes[3][2] /= t;
+    frustumPlanes[3][3] /= t;
+
+    //
+    // Extract the frustum's far clipping plane and normalize it.
+    //
+
+    frustumPlanes[4][0] = mvp.ml[ 3] - mvp.ml[ 2];
+    frustumPlanes[4][1] = mvp.ml[ 7] - mvp.ml[ 6];
+    frustumPlanes[4][2] = mvp.ml[11] - mvp.ml[10];
+    frustumPlanes[4][3] = mvp.ml[15] - mvp.ml[14];
+
+    t = (float) sqrt( frustumPlanes[4][0] * frustumPlanes[4][0] +  
+                      frustumPlanes[4][1] * frustumPlanes[4][1] + 
+                      frustumPlanes[4][2] * frustumPlanes[4][2] );
+
+    frustumPlanes[4][0] /= t;
+    frustumPlanes[4][1] /= t;
+    frustumPlanes[4][2] /= t;
+    frustumPlanes[4][3] /= t;
+
+    //
+    // Extract the frustum's near clipping plane and normalize it.
+    //
+
+    frustumPlanes[5][0] = mvp.ml[ 3] + mvp.ml[ 2];
+    frustumPlanes[5][1] = mvp.ml[ 7] + mvp.ml[ 6];
+    frustumPlanes[5][2] = mvp.ml[11] + mvp.ml[10];
+    frustumPlanes[5][3] = mvp.ml[15] + mvp.ml[14];
+
+    t = (float) sqrt( frustumPlanes[5][0] * frustumPlanes[5][0] + 
+                      frustumPlanes[5][1] * frustumPlanes[5][1] + 
+                      frustumPlanes[5][2] * frustumPlanes[5][2] );
+
+    frustumPlanes[5][0] /= t;
+    frustumPlanes[5][1] /= t;
+    frustumPlanes[5][2] /= t;
+    frustumPlanes[5][3] /= t;
+
+}
+
+bool Camera::canSee(SceneEntity *entity) {
+	return isSphereInFrustrum(*entity->getPosition(), entity->getBBoxRadius());
+}
+
+void Camera::setParentScene(Scene *parentScene) {
+	this->parentScene = parentScene;
+}
+
+void Camera::setPostFilter(string shaderName) {
+	Material *shaderMaterial = (Material*) CoreServices::getInstance()->getResourceManager()->getResource(Resource::RESOURCE_MATERIAL, shaderName);
+	if(shaderMaterial)
+		createPostFilter(shaderMaterial);
+}
+
+void Camera::createPostFilter(Material *shaderMaterial) {
+	if(!shaderMaterial)
+		return;
+	if(shaderMaterial->getNumShaders() == 0)
+		return;
+		
+	this->filterShaderMaterial = shaderMaterial;
+	
+	// TODO: make it save the textures to resource manager and check if they there
+//	originalSceneTexture = CoreServices::getInstance()->getMaterialManager()->createNewTexture(CoreServices::getInstance()->getCore()->getXRes(), CoreServices::getInstance()->getCore()->getYRes());
+//	zBufferSceneTexture = CoreServices::getInstance()->getMaterialManager()->createFramebufferTexture(CoreServices::getInstance()->getCore()->getXRes(), CoreServices::getInstance()->getCore()->getYRes(), 0);
+
+	CoreServices::getInstance()->getRenderer()->createRenderTextures(&originalSceneTexture, &zBufferSceneTexture, CoreServices::getInstance()->getCore()->getXRes(), CoreServices::getInstance()->getCore()->getYRes());
+	
+	for(int i=0; i < shaderMaterial->getNumShaders(); i++) {
+		ShaderBinding* binding = shaderMaterial->getShader(i)->createBinding();		
+		binding->addTexture("PolySceneRender", originalSceneTexture);
+		binding->addTexture("PolySceneZBuffer", zBufferSceneTexture);
+		localShaderOptions.push_back(binding);
+	}
+	
+
+	_hasFilterShader = true;
+}
+
+bool Camera::hasFilterShader() {
+	return _hasFilterShader;
+}
+
+void Camera::setLightDepthTexture(Texture *texture) {
+	for(int i=0; i < localShaderOptions.size(); i++) {
+		localShaderOptions[i]->clearTexture("PolyLight0ZBuffer");
+		localShaderOptions[i]->addTexture("PolyLight0ZBuffer", texture);
+	}
+
+}
+
+void Camera::drawFilter() {
+
+	if(!filterShaderMaterial)
+		return;
+
+	CoreServices::getInstance()->getRenderer()->bindFrameBufferTexture(zBufferSceneTexture);
+	parentScene->Render();
+	CoreServices::getInstance()->getRenderer()->unbindFramebuffers();
+
+	ShaderBinding* materialBinding;		
+	for(int i=0; i < filterShaderMaterial->getNumShaders(); i++) {
+		materialBinding = filterShaderMaterial->getShaderBinding(i);
+		CoreServices::getInstance()->getRenderer()->applyMaterial(filterShaderMaterial, localShaderOptions[i], i);		
+		if(i==filterShaderMaterial->getNumShaders()-1) {
+				CoreServices::getInstance()->getRenderer()->clearScreen();
+				CoreServices::getInstance()->getRenderer()->loadIdentity();
+				CoreServices::getInstance()->getRenderer()->drawScreenQuad(CoreServices::getInstance()->getRenderer()->getXRes(), CoreServices::getInstance()->getRenderer()->getYRes());		
+		} else {
+			for(int j=0; j < materialBinding->getNumOutTargetBindings(); j++) {
+				CoreServices::getInstance()->getRenderer()->bindFrameBufferTexture(materialBinding->getOutTargetBinding(j)->texture);
+				CoreServices::getInstance()->getRenderer()->drawScreenQuad(materialBinding->getOutTargetBinding(j)->width, materialBinding->getOutTargetBinding(j)->height);
+				CoreServices::getInstance()->getRenderer()->unbindFramebuffers();
+			}		
+		}
+		CoreServices::getInstance()->getRenderer()->clearShader();
+		CoreServices::getInstance()->getRenderer()->loadIdentity();
+	}
+
+}
+
+void Camera::doCameraTransform() {
+
+	if(fovSet)
+			CoreServices::getInstance()->getRenderer()->setFOV(fov);
+	CoreServices::getInstance()->getRenderer()->setExposureLevel(exposureLevel);
+
+	if(matrixDirty) {
+		rebuildTransformMatrix();
+	}
+
+	Matrix4 camMatrix = getConcatenatedMatrix();
+	CoreServices::getInstance()->getRenderer()->setCameraMatrix(camMatrix);	
+	camMatrix = camMatrix.inverse();
+	CoreServices::getInstance()->getRenderer()->multModelviewMatrix(camMatrix);		
+}

+ 296 - 0
Core/Contents/Source/PolyCocoaCore.cpp

@@ -0,0 +1,296 @@
+/*
+ *  PolyCocoaCore.cpp
+ *  Poly
+ *
+ *  Created by Ivan Safrin on 2/16/10.
+ *  Copyright 2010 Ivan Safrin. All rights reserved.
+ *
+ */
+
+
+#include "PolyCocoaCore.h"
+#include <iostream>
+
+using namespace Polycode;
+
+long getThreadID() {
+	return (long)pthread_self();
+}
+
+CocoaCore::CocoaCore(SubstanceView *view, int xRes, int yRes, bool fullScreen,int aaLevel, int frameRate) : Core(xRes, yRes, fullScreen,aaLevel, frameRate) {	
+	eventMutex = createMutex();
+	
+	NSOpenGLPixelFormatAttribute attrs[] =
+	{
+		NSOpenGLPFADoubleBuffer,
+		NSOpenGLPFADepthSize, 24,
+		0
+	};	
+	
+	[view lockContext];
+	
+	[view setCore:this];	
+	NSOpenGLPixelFormat *format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
+	context = [[NSOpenGLContext alloc] initWithFormat: format shareContext:nil];
+	[view clearGLContext];
+	[view setOpenGLContext:context];	
+	[context setView: view];	
+	
+	glView = view;
+	
+	initTime = mach_absolute_time();					
+	
+	while(![view isContextReady]) {
+		
+	}
+	
+	renderer = new OpenGLRenderer();
+	services->setRenderer(renderer);	
+	[view unlockContext];			
+	setVideoMode(xRes,yRes,fullScreen,aaLevel);
+
+
+}
+
+void CocoaCore::copyStringToClipboard(wstring str) {
+	NSPasteboard *pb = [NSPasteboard generalPasteboard];
+    NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil];
+    [pb declareTypes:types owner:glView];
+	
+	//NSString *nsstr = [NSString stringWithCharacters: (unichar*) str.c_str() length: str.length()];
+	
+	char* data = (char*)str.data();
+	unsigned size = str.size() * sizeof(wchar_t);
+	
+	NSString* nsstr = [[[NSString alloc] initWithBytes:data length:size encoding:NSUTF32LittleEndianStringEncoding] autorelease];
+    [pb setString: nsstr forType:NSStringPboardType];	
+}
+
+wstring CocoaCore::getClipboardString() {
+	
+}
+
+void CocoaCore::setVideoMode(int xRes, int yRes, bool fullScreen, int aaLevel) {
+	this->xRes = xRes;
+	this->yRes = yRes;
+	this->fullScreen = fullScreen;
+	this->aaLevel = aaLevel;
+	
+	renderer->Resize(xRes, yRes);
+//	CoreServices::getInstance()->getMaterialManager()->reloadProgramsAndTextures();	
+	dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
+
+	
+	NSRect visibleFrame = [[NSScreen mainScreen] visibleFrame];	
+	NSRect frame = NSMakeRect([[glView window] frame].origin.x, [[glView window] frame].origin.y, xRes, yRes);
+	
+//	frame.origin.x = (visibleFrame.size.width - frame.size.width) * 0.5;
+//	frame.origin.y = (visibleFrame.size.height - frame.size.height) * (9.0/10.0);
+	
+	[[glView window] setFrame: frame display: YES animate: NO];
+}
+
+void CocoaCore::resizeTo(int xRes, int yRes) {
+	this->xRes = xRes;
+	this->yRes = yRes;
+	renderer->Resize(xRes, yRes);	
+	dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
+}
+
+vector<Polycode::Rectangle> CocoaCore::getVideoModes() {
+	vector<Polycode::Rectangle> retVector;
+	return retVector;
+}
+
+CocoaCore::~CocoaCore() {
+	[glView clearGLContext];	
+	[context release];
+}
+
+void *ManagedThreadFunc(void *data) {
+	Threaded *target = static_cast<Threaded*>(data);
+	target->runThread();
+	return NULL;
+}
+
+void CocoaCore::createThread(Threaded *target) {
+	pthread_t thread;
+	pthread_create( &thread, NULL, ManagedThreadFunc, (void*)target);
+}
+
+void CocoaCore::lockMutex(CoreMutex *mutex) {
+	PosixMutex *m = (PosixMutex*) mutex;
+	pthread_mutex_lock(&m->pMutex);	
+}
+
+void CocoaCore::unlockMutex(CoreMutex *mutex) {
+	PosixMutex *m = (PosixMutex*) mutex;
+	pthread_mutex_unlock(&m->pMutex);
+}
+
+CoreMutex *CocoaCore::createMutex() {
+	PosixMutex *mutex = new PosixMutex();	
+	pthread_mutex_init(&mutex->pMutex, NULL);
+	return mutex;
+}
+
+unsigned int CocoaCore::getTicks() {
+	uint64_t time = mach_absolute_time();	
+	double conversion = 0.0;
+	
+	mach_timebase_info_data_t info;
+	mach_timebase_info( &info );
+	conversion = 1e-9 * (double) info.numer / (double) info.denom;	
+	
+	return (((double)(time - initTime)) * conversion) * 1000.0f;
+}
+
+void CocoaCore::enableMouse(bool newval) {
+	Core::enableMouse(newval);
+}
+
+void CocoaCore::setCursor(int cursorType) {
+	
+	NSCursor *newCursor;
+	
+	switch(cursorType) {
+		case CURSOR_TEXT:
+			newCursor = [NSCursor IBeamCursor];			
+		break;			
+		case CURSOR_POINTER:
+			newCursor = [NSCursor pointingHandCursor];						
+		break;			
+		case CURSOR_CROSSHAIR:
+			newCursor = [NSCursor crosshairCursor];
+		break;			
+		case CURSOR_RESIZE_LEFT_RIGHT:
+			newCursor = [NSCursor resizeLeftRightCursor];
+		break;			
+		case CURSOR_RESIZE_UP_DOWN:
+			newCursor = [NSCursor resizeUpDownCursor];			
+		break;
+		default:
+			newCursor = [NSCursor arrowCursor];			
+		break;
+	}
+	[glView setCurrentCursor:newCursor];
+	[glView resetCursorRects];	
+	[[glView window] invalidateCursorRectsForView: glView];
+}
+
+void CocoaCore::checkEvents() {
+	lockMutex(eventMutex);
+	CocoaEvent event;
+	for(int i=0; i < cocoaEvents.size(); i++) {
+		event = cocoaEvents[i];
+		switch(event.eventGroup) {
+			case CocoaEvent::INPUT_EVENT:
+				switch(event.eventCode) {
+					case InputEvent::EVENT_MOUSEMOVE:
+						input->setDeltaPosition(lastMouseX - event.mouseX, lastMouseY - event.mouseY);										
+						lastMouseX = event.mouseX;
+						lastMouseY = event.mouseY;
+						input->setMousePosition(event.mouseX, event.mouseY, getTicks());						
+						break;
+					case InputEvent::EVENT_MOUSEDOWN:
+						input->setMouseButtonState(event.mouseButton, true, getTicks());						
+						break;
+					case InputEvent::EVENT_MOUSEWHEEL_UP:
+						input->mouseWheelUp(getTicks());
+					break;
+					case InputEvent::EVENT_MOUSEWHEEL_DOWN:
+						input->mouseWheelDown(getTicks());						
+					break;						
+					case InputEvent::EVENT_MOUSEUP:
+						input->setMouseButtonState(event.mouseButton, false, getTicks());
+						break;
+					case InputEvent::EVENT_KEYDOWN:
+						input->setKeyState(event.keyCode, event.unicodeChar, true, getTicks());
+						break;
+					case InputEvent::EVENT_KEYUP:
+						input->setKeyState(event.keyCode, event.unicodeChar, false, getTicks());
+						break;						
+				}
+				break;
+		}
+	}
+	cocoaEvents.clear();	
+	unlockMutex(eventMutex);		
+}
+
+void CocoaCore::createFolder(string folderPath) {
+	[[NSFileManager defaultManager] createDirectoryAtPath:[NSString stringWithUTF8String: folderPath.c_str()] withIntermediateDirectories:YES attributes:nil error:nil];
+}
+
+void CocoaCore::copyDiskItem(string itemPath, string destItemPath) {
+	[[NSFileManager defaultManager] copyItemAtPath: [NSString stringWithUTF8String: itemPath.c_str()] toPath: [NSString stringWithUTF8String: destItemPath.c_str()] error: nil];	
+}
+
+void CocoaCore::moveDiskItem(string itemPath, string destItemPath) {
+	[[NSFileManager defaultManager] moveItemAtPath: [NSString stringWithUTF8String: itemPath.c_str()] toPath: [NSString stringWithUTF8String: destItemPath.c_str()] error: nil];		
+}
+
+void CocoaCore::removeDiskItem(string itemPath) {
+	[[NSFileManager defaultManager] removeItemAtPath: [NSString stringWithUTF8String: itemPath.c_str()] error:nil];
+}
+
+string CocoaCore::openFolderPicker() {
+	NSOpenPanel *attachmentPanel = [NSOpenPanel openPanel];	
+	[attachmentPanel setCanChooseFiles:NO];
+	[attachmentPanel setCanCreateDirectories: YES];
+	[attachmentPanel setCanChooseDirectories:YES];
+	
+	if ( [attachmentPanel runModalForDirectory:nil file:nil] == NSOKButton )
+	{
+		// files and directories selected.
+		NSArray* files = [attachmentPanel filenames];
+		NSString* fileName = [files objectAtIndex:0];
+		return [fileName UTF8String];
+	} else {
+		return [@"" UTF8String];
+	}	
+}
+
+vector<string> CocoaCore::openFilePicker(vector<CoreFileExtension> extensions, bool allowMultiple) {
+	
+	vector<string> retVector;
+	
+	NSOpenPanel *attachmentPanel = [NSOpenPanel openPanel];	
+	[attachmentPanel setCanChooseFiles:YES];
+	[attachmentPanel setCanCreateDirectories: YES];
+	[attachmentPanel setCanChooseDirectories:NO];
+	[attachmentPanel setAllowsMultipleSelection: allowMultiple];
+	
+	NSMutableArray *types = [[NSMutableArray alloc] init];
+	
+	for(int i=0; i < extensions.size(); i++) {	
+		CoreFileExtension extInfo = extensions[i];
+		[types addObject: [NSString stringWithUTF8String: extInfo.extension.c_str()]];
+	}
+	
+	if ( [attachmentPanel runModalForDirectory:nil file:nil types:types] == NSOKButton )
+	{
+		NSArray* files = [attachmentPanel filenames];
+		NSString* fileName = [files objectAtIndex:0];
+		retVector.push_back([fileName UTF8String]);
+	} else {
+		retVector.push_back("");
+	}	
+	
+	return retVector;
+}
+
+bool CocoaCore::Update() {
+	if(!running)
+		return false;
+		
+	lockMutex(CoreServices::getRenderMutex());	
+	checkEvents();
+	renderer->BeginRender();
+	updateCore();
+	renderer->EndRender();
+	[context flushBuffer];
+	unlockMutex(CoreServices::getRenderMutex());	
+	doSleep();	
+	return running;
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов