From 5bfb3692ce55902c654f60e6ae3ba269a2fb5fc3 Mon Sep 17 00:00:00 2001 From: Martin Ballantyne Date: Sun, 24 Dec 2017 20:03:50 +0000 Subject: [PATCH] * Moved blamlib and YeloLib code into source directory in root of workspace * Moved third party code into external_libraries in root of workspace --- .../Halo1/Halo1_BlamLib/Common/Precompile.hpp | 8 +- .../Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj | 668 +-- .../Halo1_BlamLib.vcxproj.filters | 668 +-- OpenSauce/Halo1/Halo1_CE/Common/DebugDump.cpp | 10 +- .../Halo1/Halo1_CE/Common/Precompile.hpp | 8 +- .../Halo1/Halo1_CE/Game/AI.Transform.inl | 6 +- OpenSauce/Halo1/Halo1_CE/Game/AI.cpp | 6 +- OpenSauce/Halo1/Halo1_CE/Game/AI.hpp | 14 +- OpenSauce/Halo1/Halo1_CE/Game/Camera.cpp | 8 +- OpenSauce/Halo1/Halo1_CE/Game/Camera.hpp | 2 +- OpenSauce/Halo1/Halo1_CE/Game/CameraFov.inl | 6 +- OpenSauce/Halo1/Halo1_CE/Game/Console.hpp | 6 +- OpenSauce/Halo1/Halo1_CE/Game/Effects.cpp | 4 +- OpenSauce/Halo1/Halo1_CE/Game/Effects.hpp | 16 +- .../Halo1/Halo1_CE/Game/EngineFunctions.cpp | 28 +- .../Halo1/Halo1_CE/Game/GameBuildNumber.cpp | 2 +- OpenSauce/Halo1/Halo1_CE/Game/GameEngine.cpp | 12 +- OpenSauce/Halo1/Halo1_CE/Game/GameEngine.hpp | 6 +- OpenSauce/Halo1/Halo1_CE/Game/GameState.cpp | 26 +- OpenSauce/Halo1/Halo1_CE/Game/GameState.hpp | 16 +- .../Halo1_CE/Game/GameStateRuntimeData.cpp | 2 +- OpenSauce/Halo1/Halo1_CE/Game/Lights.hpp | 2 +- OpenSauce/Halo1/Halo1_CE/Game/Players.cpp | 14 +- OpenSauce/Halo1/Halo1_CE/Game/Players.hpp | 8 +- .../Halo1/Halo1_CE/Game/ScriptLibrary.cpp | 8 +- .../Halo1/Halo1_CE/Game/ScriptLibrary.hpp | 2 +- OpenSauce/Halo1/Halo1_CE/Game/Scripting.cpp | 10 +- OpenSauce/Halo1/Halo1_CE/Game/Scripting.hpp | 8 +- OpenSauce/Halo1/Halo1_CE/Halo1_CE.rc | 2 +- OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj | 438 +- .../Halo1/Halo1_CE/Halo1_CE.vcxproj.filters | 438 +- .../Halo1/Halo1_CE/Interface/ControlTypes.hpp | 4 +- OpenSauce/Halo1/Halo1_CE/Interface/GameUI.cpp | 32 +- .../Halo1/Halo1_CE/Interface/GameUI_Hud.inl | 4 +- .../Halo1/Halo1_CE/Interface/OpenSauceUI.cpp | 10 +- .../OpenSauceUI/Control/i_canvas.hpp | 2 +- .../Screen/c_screen_definition_reader.hpp | 2 +- .../Halo1/Halo1_CE/Interface/UIWidgets.cpp | 6 +- .../Halo1/Halo1_CE/Interface/UIWidgets.hpp | 2 +- .../Halo1_CE/Networking/HTTP/BanManager.cpp | 4 +- .../Halo1_CE/Networking/HTTP/HTTPServer.cpp | 4 +- .../Networking/HTTP/MapDownloadClient.cpp | 8 +- .../Networking/HTTP/MapDownloadServer.cpp | 6 +- .../Networking/MessageDeltaDefinitions.hpp | 2 +- .../Halo1_CE/Networking/MessageDeltas.cpp | 10 +- .../Halo1_CE/Networking/MessageDeltas.hpp | 2 +- .../Halo1/Halo1_CE/Networking/Networking.cpp | 26 +- .../Halo1/Halo1_CE/Networking/Networking.hpp | 4 +- .../Halo1/Halo1_CE/Networking/Server.hpp | 6 +- .../Halo1_CE/Networking/VersionCheck.cpp | 2 +- .../Networking/VersionCheckClient.cpp | 2 +- .../Halo1_CE/Networking/VersionCheckDedi.cpp | 2 +- .../Halo1/Halo1_CE/Objects/Equipment.cpp | 4 +- .../Objects/ObjectFieldDefinitions.cpp | 6 +- .../Halo1/Halo1_CE/Objects/Objects.Damage.inl | 6 +- .../Halo1_CE/Objects/Objects.Scripting.inl | 2 +- .../Objects/Objects.WeaponSettings.inl | 4 +- OpenSauce/Halo1/Halo1_CE/Objects/Objects.hpp | 18 +- .../Halo1/Halo1_CE/Objects/ObjectsYelo.cpp | 42 +- .../Halo1_CE/Objects/Units.Animations.inl | 4 +- .../Halo1_CE/Objects/Units.GrenadeCounts.inl | 4 +- .../Halo1_CE/Objects/Units.SeatBoarding.inl | 2 +- .../Halo1_CE/Objects/Units.SeatDamage.inl | 2 +- OpenSauce/Halo1/Halo1_CE/Objects/Units.cpp | 28 +- .../Halo1/Halo1_CE/Rasterizer/GBuffer.cpp | 8 +- .../Halo1/Halo1_CE/Rasterizer/GBuffer.hpp | 2 +- .../Halo1/Halo1_CE/Rasterizer/Lightmaps.cpp | 4 +- .../Bloom/c_shader_instance_bloom.cpp | 2 +- .../Bloom/c_shader_instance_bloom.hpp | 2 +- .../PostProcessing/Bloom/c_system_bloom.hpp | 2 +- .../Bloom/s_shader_bloom_definition.hpp | 2 +- .../PostProcessing/FXAA/c_system_fxaa.hpp | 2 +- .../PostProcessing/Fade/c_system_fade.hpp | 2 +- .../Fade/s_shader_fade_definition.hpp | 2 +- .../Generic/External/c_effect_external.hpp | 2 +- .../Generic/External/c_system_external.cpp | 2 +- .../s_effect_postprocess_external.hpp | 2 +- .../Generic/Internal/c_effect_internal.hpp | 2 +- .../Generic/c_effect_generic.hpp | 2 +- .../Generic/c_parameter_instance.cpp | 6 +- .../Generic/c_parameter_instance.hpp | 4 +- .../c_interp_function_pp_anim.hpp | 4 +- .../c_shader_instance_motionblur.cpp | 2 +- .../c_shader_instance_motionblur.hpp | 2 +- .../s_shader_motionblur_definition.hpp | 2 +- .../PostProcessing/PostProcessing.cpp | 2 +- .../PostProcessing/PostProcessing.hpp | 2 +- .../PostProcessingErrorReporting.cpp | 2 +- .../ShaderSources/c_shader_data_external.cpp | 2 +- .../c_shader_data_postprocess_definition.cpp | 2 +- .../c_shader_data_postprocess_definition.hpp | 2 +- .../PostProcessing/c_effect_instance.cpp | 4 +- .../PostProcessing/c_effect_postprocess.cpp | 2 +- .../PostProcessing/c_effect_postprocess.hpp | 4 +- .../PostProcessing/c_post_processing_main.cpp | 2 +- .../PostProcessing/c_post_processing_main.hpp | 4 +- .../PostProcessing/c_quad_manager.hpp | 2 +- .../PostProcessing/c_shader_postprocess.cpp | 2 +- .../PostProcessing/c_shader_postprocess.hpp | 2 +- .../Halo1/Halo1_CE/Rasterizer/Rasterizer.cpp | 8 +- .../Halo1/Halo1_CE/Rasterizer/Rasterizer.hpp | 2 +- .../Halo1/Halo1_CE/Rasterizer/ShaderDraw.cpp | 2 +- .../ShaderExtension/ShaderExtension.cpp | 10 +- .../ShaderExtension/ShaderExtension.hpp | 2 +- OpenSauce/Halo1/Halo1_CE/Rasterizer/Sky.cpp | 6 +- .../Textures/c_packed_texture_loader.cpp | 2 +- .../Halo1/Halo1_CE/Scenario/Scenario.cpp | 6 +- .../Halo1/Halo1_CE/Scenario/Scenario.hpp | 6 +- .../Halo1/Halo1_CE/Scenario/StructureBSP.cpp | 10 +- .../Halo1/Halo1_CE/Settings/Settings.cpp | 4 +- .../Halo1/Halo1_CE/Settings/Settings.hpp | 2 +- .../TagGroups/CacheFiles.DataFiles.inl | 2 +- .../Halo1/Halo1_CE/TagGroups/CacheFiles.cpp | 16 +- .../Halo1/Halo1_CE/TagGroups/CacheFiles.hpp | 6 +- .../Halo1/Halo1_CE/TagGroups/TagGroups.cpp | 10 +- .../Halo1/Halo1_CE/TagGroups/TagGroups.hpp | 4 +- .../Halo1/Halo1_CheApe/Common/DebugDump.cpp | 2 +- .../Halo1/Halo1_CheApe/Common/Precompile.hpp | 4 +- .../Halo1_CheApe/Engine/AI.Transform.inl | 24 +- OpenSauce/Halo1/Halo1_CheApe/Engine/AI.cpp | 6 +- .../Halo1_CheApe/Engine/AnimationUpgrade.cpp | 4 +- .../Halo1_CheApe/Engine/EngineFunctions.cpp | 36 +- .../Halo1_CheApe/Engine/EngineFunctions.hpp | 6 +- .../Halo1/Halo1_CheApe/Engine/GameState.cpp | 6 +- .../Engine/GrenadeTypesUpgrade.cpp | 14 +- .../Halo1/Halo1_CheApe/Engine/Objects.cpp | 8 +- .../Halo1/Halo1_CheApe/Engine/Objects.hpp | 2 +- .../Halo1/Halo1_CheApe/Engine/Scripting.cpp | 6 +- .../Halo1/Halo1_CheApe/Engine/Scripting.hpp | 2 +- .../Halo1_CheApe/Engine/Units.Animations.inl | 2 +- .../Engine/Units.SeatBoarding.inl | 4 +- .../Halo1_CheApe/Engine/Units.SeatDamage.inl | 2 +- OpenSauce/Halo1/Halo1_CheApe/Engine/Units.cpp | 8 +- .../Guerilla/field_dialog_extensions.cpp | 2 +- .../Guerilla/field_dialog_extensions.hpp | 2 +- .../guerilla_application_extensions.hpp | 2 +- .../Guerilla/string_dialog_extensions.cpp | 2 +- .../tag_reference_dialog_extensions.cpp | 4 +- .../Halo1_CheApe/Rasterizer/Rasterizer.cpp | 6 +- .../Halo1_CheApe/Rasterizer/Rasterizer.hpp | 2 +- .../Halo1/Halo1_CheApe/Settings/Settings.cpp | 6 +- .../Halo1/Halo1_CheApe/Settings/Settings.hpp | 2 +- .../TagGroups/TagFieldReplacements/Bitmap.hpp | 6 +- .../TagFieldReplacements/DamageEffect.hpp | 6 +- .../TagFieldReplacements/GBXModel.hpp | 6 +- .../TagGroups/TagFieldReplacements/Object.hpp | 2 +- .../TagFieldReplacements/Scenario.hpp | 10 +- .../TagGroups/TagFieldReplacements/Shader.hpp | 14 +- .../TagGroups/TagFieldReplacements/Shared.hpp | 16 +- .../TagGroups/TagFieldReplacements/Sound.hpp | 6 +- .../TagGroups/TagFieldReplacements/Unit.hpp | 8 +- .../TagGroups/TagFieldSetReplacements.cpp | 2 +- .../Halo1_CheApe/TagGroups/TagGroups.cpp | 12 +- .../Halo1_CheApe/TagGroups/TagGroups.hpp | 4 +- .../TagGroups/yelo_definitions.cpp | 12 +- .../TagGroups/yelo_scenario_definitions.cpp | 8 +- .../Halo1_CheApe/Tool/BuildCacheFile.cpp | 18 +- .../Tool/BuildCacheFile/BuildCacheFileEx.cpp | 4 +- .../BuildCacheFile/BuildCacheFileGlobals.cpp | 6 +- .../BuildCacheFile/BuildCacheFileGlobals.hpp | 4 +- .../BuildCacheFileMemoryUpgrades.cpp | 6 +- .../Tool/BuildCacheFile/CullTags.inl | 4 +- .../BuildCacheFile/PredictedResources.inl | 6 +- .../Tool/BuildCacheFile/TagPreprocess.inl | 14 +- .../TagPreprocess_PostProcessing.inl | 4 +- .../BuildCacheFile/TagPreprocess_Scenario.inl | 4 +- .../TagPreprocess_ShaderExtension.inl | 6 +- .../Halo1_CheApe/Tool/ImportLightmapUV.cpp | 4 +- .../Tool/PackedFile/BuildPackedFiles.cpp | 2 +- .../c_packed_file_processor_archive.hpp | 2 +- .../c_packed_file_processor_shader.hpp | 2 +- .../c_packed_file_processor_texture.hpp | 2 +- .../Processing/i_packed_file_processor.hpp | 2 +- .../Halo1_CheApe/Tool/RemoveOSTagData.cpp | 30 +- .../Halo1_CheApe/Tool/RuntimeCacheView.cpp | 2 +- .../Collection/c_collection_writer.cpp | 2 +- .../Halo1_CheApe/Tool/ShaderPostprocess.cpp | 4 +- .../Halo1_CheApe/Tool/TagMaintenance.cpp | 14 +- .../Halo1/Halo1_CheApe/Tool/ToolMisc.cpp | 2 +- .../Tool/Tool_AnimationFixups.cpp | 4 +- .../Halo1/Halo1_CheApe/Yelo/MemoryFixups.cpp | 6 +- OpenSauce/Halo1/Halo1_CheApe/Yelo/Yelo.cpp | 2 +- .../Halo1/Halo1_CheApe/Yelo/YeloSapien.cpp | 8 +- .../Halo1/Halo1_CheApe/Yelo/YeloTool.cpp | 4 +- .../Halo1/Halo1_YeloLib/Common/Precompile.hpp | 8 +- .../Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj | 574 +- .../Halo1_YeloLib.vcxproj.filters | 576 +- OpenSauce/shared/Include/CrashRpt/CrashRpt.h | 1762 ------ OpenSauce/shared/Include/GWEN/Align.h | 25 - OpenSauce/shared/Include/GWEN/Anim.cpp | 157 - OpenSauce/shared/Include/GWEN/Anim.h | 180 - OpenSauce/shared/Include/GWEN/BaseRender.cpp | 215 - OpenSauce/shared/Include/GWEN/BaseRender.h | 144 - OpenSauce/shared/Include/GWEN/Config.h | 19 - OpenSauce/shared/Include/GWEN/ControlList.cpp | 89 - OpenSauce/shared/Include/GWEN/ControlList.h | 116 - OpenSauce/shared/Include/GWEN/Controls.h | 43 - .../shared/Include/GWEN/Controls/Base.cpp | 1219 ---- OpenSauce/shared/Include/GWEN/Controls/Base.h | 599 -- .../shared/Include/GWEN/Controls/Button.cpp | 237 - .../shared/Include/GWEN/Controls/Button.h | 88 - .../shared/Include/GWEN/Controls/Canvas.cpp | 248 - .../shared/Include/GWEN/Controls/Canvas.h | 109 - .../shared/Include/GWEN/Controls/CheckBox.cpp | 62 - .../shared/Include/GWEN/Controls/CheckBox.h | 81 - .../GWEN/Controls/CollapsibleCategory.cpp | 190 - .../GWEN/Controls/CollapsibleCategory.h | 59 - .../Include/GWEN/Controls/CollapsibleList.h | 113 - .../Include/GWEN/Controls/ColorControls.cpp | 332 -- .../Include/GWEN/Controls/ColorControls.h | 64 - .../Include/GWEN/Controls/ColorPicker.cpp | 211 - .../Include/GWEN/Controls/ColorPicker.h | 91 - .../shared/Include/GWEN/Controls/ComboBox.cpp | 245 - .../shared/Include/GWEN/Controls/ComboBox.h | 72 - .../Include/GWEN/Controls/CrossSplitter.cpp | 185 - .../Include/GWEN/Controls/CrossSplitter.h | 71 - .../shared/Include/GWEN/Controls/DockBase.cpp | 351 -- .../shared/Include/GWEN/Controls/DockBase.h | 80 - .../GWEN/Controls/DockedTabControl.cpp | 94 - .../Include/GWEN/Controls/DockedTabControl.h | 45 - .../shared/Include/GWEN/Controls/Dragger.cpp | 73 - .../shared/Include/GWEN/Controls/Dragger.h | 55 - .../shared/Include/GWEN/Controls/FieldLabel.h | 65 - .../shared/Include/GWEN/Controls/GroupBox.cpp | 41 - .../shared/Include/GWEN/Controls/GroupBox.h | 43 - .../Include/GWEN/Controls/HSVColorPicker.cpp | 164 - .../Include/GWEN/Controls/HSVColorPicker.h | 50 - .../shared/Include/GWEN/Controls/Highlight.h | 38 - .../GWEN/Controls/HorizontalScrollBar.cpp | 133 - .../GWEN/Controls/HorizontalScrollBar.h | 54 - .../GWEN/Controls/HorizontalSlider.cpp | 49 - .../Include/GWEN/Controls/HorizontalSlider.h | 38 - .../Include/GWEN/Controls/ImagePanel.cpp | 12 - .../shared/Include/GWEN/Controls/ImagePanel.h | 112 - .../shared/Include/GWEN/Controls/Label.cpp | 114 - .../shared/Include/GWEN/Controls/Label.h | 90 - .../Include/GWEN/Controls/LabelClickable.cpp | 28 - .../Include/GWEN/Controls/LabelClickable.h | 32 - .../Include/GWEN/Controls/Layout/Table.h | 341 -- .../shared/Include/GWEN/Controls/ListBox.cpp | 264 - .../shared/Include/GWEN/Controls/ListBox.h | 76 - .../shared/Include/GWEN/Controls/Menu.cpp | 181 - OpenSauce/shared/Include/GWEN/Controls/Menu.h | 81 - .../shared/Include/GWEN/Controls/MenuItem.cpp | 193 - .../shared/Include/GWEN/Controls/MenuItem.h | 85 - .../Include/GWEN/Controls/MenuStrip.cpp | 48 - .../shared/Include/GWEN/Controls/MenuStrip.h | 42 - .../shared/Include/GWEN/Controls/Modal.h | 45 - .../Include/GWEN/Controls/NumericUpDown.cpp | 112 - .../Include/GWEN/Controls/NumericUpDown.h | 84 - .../Include/GWEN/Controls/PageControl.cpp | 178 - .../Include/GWEN/Controls/PageControl.h | 74 - .../shared/Include/GWEN/Controls/Pointer.cpp | 28 - .../shared/Include/GWEN/Controls/Pointer.h | 33 - .../Include/GWEN/Controls/ProgressBar.cpp | 98 - .../Include/GWEN/Controls/ProgressBar.h | 54 - .../Include/GWEN/Controls/Properties.cpp | 188 - .../shared/Include/GWEN/Controls/Properties.h | 87 - .../GWEN/Controls/Property/BaseProperty.h | 58 - .../Include/GWEN/Controls/Property/Checkbox.h | 66 - .../GWEN/Controls/Property/ColorSelector.h | 112 - .../Include/GWEN/Controls/Property/ComboBox.h | 74 - .../Include/GWEN/Controls/Property/Text.h | 60 - .../Include/GWEN/Controls/PropertyTree.cpp | 58 - .../Include/GWEN/Controls/PropertyTree.h | 56 - .../Include/GWEN/Controls/RadioButton.cpp | 26 - .../Include/GWEN/Controls/RadioButton.h | 80 - .../GWEN/Controls/RadioButtonController.cpp | 76 - .../GWEN/Controls/RadioButtonController.h | 51 - .../Include/GWEN/Controls/Rectangle.cpp | 26 - .../shared/Include/GWEN/Controls/Rectangle.h | 43 - .../GWEN/Controls/ResizableControl.cpp | 112 - .../Include/GWEN/Controls/ResizableControl.h | 64 - .../shared/Include/GWEN/Controls/Resizer.cpp | 117 - .../shared/Include/GWEN/Controls/Resizer.h | 42 - .../Include/GWEN/Controls/RichLabel.cpp | 210 - .../shared/Include/GWEN/Controls/RichLabel.h | 64 - .../Include/GWEN/Controls/ScrollBar.cpp | 76 - .../shared/Include/GWEN/Controls/ScrollBar.h | 82 - .../Include/GWEN/Controls/ScrollBarBar.cpp | 60 - .../Include/GWEN/Controls/ScrollBarBar.h | 49 - .../Include/GWEN/Controls/ScrollBarButton.cpp | 47 - .../Include/GWEN/Controls/ScrollBarButton.h | 39 - .../Include/GWEN/Controls/ScrollControl.cpp | 271 - .../Include/GWEN/Controls/ScrollControl.h | 74 - .../shared/Include/GWEN/Controls/Slider.cpp | 111 - .../shared/Include/GWEN/Controls/Slider.h | 93 - .../Include/GWEN/Controls/SplitterBar.cpp | 26 - .../Include/GWEN/Controls/SplitterBar.h | 32 - .../shared/Include/GWEN/Controls/Splitters.h | 134 - .../shared/Include/GWEN/Controls/StatusBar.h | 47 - .../Include/GWEN/Controls/TabButton.cpp | 136 - .../shared/Include/GWEN/Controls/TabButton.h | 61 - .../Include/GWEN/Controls/TabControl.cpp | 213 - .../shared/Include/GWEN/Controls/TabControl.h | 73 - .../shared/Include/GWEN/Controls/TabStrip.cpp | 193 - .../shared/Include/GWEN/Controls/TabStrip.h | 54 - .../Include/GWEN/Controls/TabTitleBar.h | 58 - .../shared/Include/GWEN/Controls/Text.cpp | 482 -- OpenSauce/shared/Include/GWEN/Controls/Text.h | 95 - .../shared/Include/GWEN/Controls/TextBox.cpp | 751 --- .../shared/Include/GWEN/Controls/TextBox.h | 157 - .../Include/GWEN/Controls/TextBoxNumeric.cpp | 87 - .../shared/Include/GWEN/Controls/ToolBar.h | 65 - .../Include/GWEN/Controls/TreeControl.cpp | 73 - .../Include/GWEN/Controls/TreeControl.h | 52 - .../shared/Include/GWEN/Controls/TreeNode.cpp | 273 - .../shared/Include/GWEN/Controls/TreeNode.h | 86 - .../GWEN/Controls/VerticalScrollBar.cpp | 137 - .../Include/GWEN/Controls/VerticalScrollBar.h | 50 - .../Include/GWEN/Controls/VerticalSlider.cpp | 52 - .../Include/GWEN/Controls/VerticalSlider.h | 40 - .../Include/GWEN/Controls/WindowButtons.h | 85 - .../Include/GWEN/Controls/WindowControl.cpp | 156 - .../Include/GWEN/Controls/WindowControl.h | 72 - OpenSauce/shared/Include/GWEN/DragAndDrop.cpp | 237 - OpenSauce/shared/Include/GWEN/DragAndDrop.h | 39 - OpenSauce/shared/Include/GWEN/Events.h | 168 - OpenSauce/shared/Include/GWEN/Exports.h | 64 - OpenSauce/shared/Include/GWEN/Font.h | 51 - OpenSauce/shared/Include/GWEN/Gwen.cpp | 57 - OpenSauce/shared/Include/GWEN/Gwen.h | 103 - OpenSauce/shared/Include/GWEN/Hook.cpp | 35 - OpenSauce/shared/Include/GWEN/Hook.h | 85 - OpenSauce/shared/Include/GWEN/InputHandler.h | 85 - OpenSauce/shared/Include/GWEN/Macros.h | 95 - OpenSauce/shared/Include/GWEN/Platform.h | 70 - .../Include/GWEN/Platforms/HaloRuntime.cpp | 158 - OpenSauce/shared/Include/GWEN/Skin.cpp | 123 - OpenSauce/shared/Include/GWEN/Skin.h | 263 - .../shared/Include/GWEN/Skins/TexturedBase.h | 1050 ---- .../shared/Include/GWEN/Skins/Texturing.h | 167 - OpenSauce/shared/Include/GWEN/Structures.h | 246 - OpenSauce/shared/Include/GWEN/TextObject.h | 101 - OpenSauce/shared/Include/GWEN/Texture.h | 64 - OpenSauce/shared/Include/GWEN/ToolTip.cpp | 64 - OpenSauce/shared/Include/GWEN/ToolTip.h | 35 - OpenSauce/shared/Include/GWEN/UserData.h | 116 - OpenSauce/shared/Include/GWEN/Utility.cpp | 203 - OpenSauce/shared/Include/GWEN/Utility.h | 151 - .../shared/Include/GWEN/WindowProvider.h | 25 - OpenSauce/shared/Include/GWEN/events.cpp | 196 - .../shared/Include/GWEN/inputhandler.cpp | 388 -- .../Include/TinyXml/OpenSauce.Readme.txt | 7 - OpenSauce/shared/Include/TinyXml/tinystr.cpp | 112 - OpenSauce/shared/Include/TinyXml/tinystr.hpp | 315 -- OpenSauce/shared/Include/TinyXml/tinyxml.cpp | 1887 ------- OpenSauce/shared/Include/TinyXml/tinyxml.hpp | 1813 ------ .../shared/Include/TinyXml/tinyxmlerror.cpp | 53 - .../shared/Include/TinyXml/tinyxmlparser.cpp | 1639 ------ .../Include/YeloLib/Halo2/hs/hs_yelo.hpp | 17 - .../YeloLib/Halo2/memory/data_yelo.hpp | 63 - .../Halo1/tag_files/tag_group_saving.cpp | 23 - .../blamlib/Halo2/cache/cache_files.hpp | 185 - .../Halo2/cache/predicted_resources.hpp | 31 - .../Include/blamlib/Halo2/cseries/cseries.hpp | 13 - .../Include/blamlib/Halo2/cseries/errors.hpp | 46 - .../Include/blamlib/Halo2/game/players.hpp | 17 - .../shared/Include/blamlib/Halo2/hs/hs.hpp | 171 - .../Halo2/interface/user_interface.hpp | 22 - .../interface/user_interface_controller.hpp | 19 - .../blamlib/Halo2/memory/constant_pool.hpp | 34 - .../Include/blamlib/Halo2/memory/data.hpp | 73 - .../blamlib/Halo2/memory/hashtable.hpp | 29 - .../blamlib/Halo2/memory/lruv_cache.hpp | 49 - .../blamlib/Halo2/memory/memory_pool.hpp | 44 - .../Halo2/memory/resource_database.hpp | 33 - .../networking/session/network_session.hpp | 18 - .../Halo2/shaders/shader_definitions.hpp | 73 - .../blamlib/Halo2/sound/sound_definitions.hpp | 31 - .../Include/blamlib/Halo2/tag_files/files.hpp | 22 - .../blamlib/Halo2/tag_files/tag_groups.hpp | 16 - OpenSauce/shared/Include/mongoose/mongoose.c | 5025 ----------------- OpenSauce/shared/Include/mongoose/mongoose.h | 367 -- OpenSauce/shared/Include/zlib/README | 115 - OpenSauce/shared/Include/zlib/adler32.c | 169 - OpenSauce/shared/Include/zlib/compress.c | 80 - .../contrib/minizip/MiniZip64_Changes.txt | 6 - .../zlib/contrib/minizip/MiniZip64_info.txt | 74 - .../zlib/contrib/minizip/OpenSauce.Readme.txt | 3 - .../Include/zlib/contrib/minizip/crypt.h | 131 - .../Include/zlib/contrib/minizip/ioapi.c | 247 - .../Include/zlib/contrib/minizip/ioapi.h | 208 - .../Include/zlib/contrib/minizip/iowin32.c | 389 -- .../Include/zlib/contrib/minizip/iowin32.h | 28 - .../Include/zlib/contrib/minizip/miniunz.c | 660 --- .../Include/zlib/contrib/minizip/minizip.c | 520 -- .../Include/zlib/contrib/minizip/mztools.c | 291 - .../Include/zlib/contrib/minizip/mztools.h | 37 - .../Include/zlib/contrib/minizip/unzip.c | 2125 ------- .../Include/zlib/contrib/minizip/unzip.h | 437 -- .../shared/Include/zlib/contrib/minizip/zip.c | 2007 ------- .../shared/Include/zlib/contrib/minizip/zip.h | 362 -- OpenSauce/shared/Include/zlib/crc32.c | 442 -- OpenSauce/shared/Include/zlib/crc32.h | 441 -- OpenSauce/shared/Include/zlib/deflate.c | 1834 ------ OpenSauce/shared/Include/zlib/deflate.h | 342 -- OpenSauce/shared/Include/zlib/example.c | 565 -- OpenSauce/shared/Include/zlib/gzclose.c | 25 - OpenSauce/shared/Include/zlib/gzguts.h | 132 - OpenSauce/shared/Include/zlib/gzlib.c | 537 -- OpenSauce/shared/Include/zlib/gzread.c | 653 --- OpenSauce/shared/Include/zlib/gzwrite.c | 531 -- OpenSauce/shared/Include/zlib/infback.c | 632 --- OpenSauce/shared/Include/zlib/inffast.c | 340 -- OpenSauce/shared/Include/zlib/inffast.h | 11 - OpenSauce/shared/Include/zlib/inffixed.h | 94 - OpenSauce/shared/Include/zlib/inflate.c | 1480 ----- OpenSauce/shared/Include/zlib/inflate.h | 122 - OpenSauce/shared/Include/zlib/inftrees.c | 330 -- OpenSauce/shared/Include/zlib/inftrees.h | 62 - OpenSauce/shared/Include/zlib/minigzip.c | 440 -- OpenSauce/shared/Include/zlib/trees.c | 1244 ---- OpenSauce/shared/Include/zlib/trees.h | 128 - OpenSauce/shared/Include/zlib/uncompr.c | 59 - OpenSauce/shared/Include/zlib/zconf.h | 428 -- OpenSauce/shared/Include/zlib/zlib.h | 1613 ------ OpenSauce/shared/Include/zlib/zutil.c | 318 -- OpenSauce/shared/Include/zlib/zutil.h | 274 - OpenSauce/shared/config/msbuild/7zip.props | 52 +- .../config/msbuild/7zip.vcxproj.filters | 58 +- .../shared/config/msbuild/CrashRpt.props | 2 +- .../config/msbuild/CrashRpt.vcxproj.filters | 8 +- .../shared/config/msbuild/GameSpyOpen.props | 124 +- .../msbuild/GameSpyOpen.vcxproj.filters | 124 +- OpenSauce/shared/config/msbuild/TinyXml.props | 14 +- .../config/msbuild/TinyXml.vcxproj.filters | 20 +- OpenSauce/shared/config/msbuild/YeloLib.props | 17 +- .../config/msbuild/YeloLib.vcxproj.filters | 156 +- .../shared/config/msbuild/YeloLib_Halo1.props | 158 +- .../msbuild/YeloLib_Halo1.vcxproj.filters | 136 +- .../YeloLib_Halo1_Editor.vcxproj.filters | 34 +- .../shared/config/msbuild/YeloLib_Halo2.props | 8 - .../msbuild/YeloLib_Halo2.vcxproj.filters | 9 - OpenSauce/shared/config/msbuild/blamlib.props | 28 +- .../config/msbuild/blamlib.vcxproj.filters | 145 +- .../shared/config/msbuild/blamlib_Halo1.props | 498 +- .../msbuild/blamlib_Halo1.vcxproj.filters | 438 +- .../blamlib_Halo1_Editor.vcxproj.filters | 50 +- .../blamlib_Halo1_Game.vcxproj.filters | 10 +- .../shared/config/msbuild/blamlib_Halo2.props | 47 - .../msbuild/blamlib_Halo2.vcxproj.filters | 66 - .../shared/config/msbuild/mongoose.props | 4 +- .../config/msbuild/mongoose.vcxproj.filters | 4 +- OpenSauce/shared/config/msbuild/zlib.props | 66 +- .../config/msbuild/zlib.vcxproj.filters | 78 +- .../OpenSauce_Halo1_CE_BuildInstallers.bat | 0 {bin/_scripts => scripts}/PrereqChecks.bat | 0 shared/config/msbuild/Common.Cpp.props | 2 +- .../msbuild/OpenSauceUserConfigDefaults.props | 4 +- .../Halo1 => source/YeloLib}/ai/ai_yelo.cpp | 14 +- .../Halo1 => source/YeloLib}/ai/ai_yelo.hpp | 0 .../ai/c_actor_variant_transform_manager.cpp | 52 +- .../ai/c_actor_variant_transform_manager.hpp | 4 +- .../cache/cache_file_builder_yelo.cpp | 24 +- .../cache/cache_file_builder_yelo.hpp | 2 +- .../YeloLib}/cache/cache_file_memory.cpp | 8 +- .../YeloLib}/cache/cache_file_memory.hpp | 2 +- .../cache_file_memory_gestalt_definitions.hpp | 2 +- ...e_file_memory_layout_table_definitions.hpp | 2 +- .../cache/cache_files_structures_yelo.hpp | 2 +- .../YeloLib}/cache/cache_files_yelo.cpp | 26 +- .../YeloLib}/cache/cache_files_yelo.hpp | 0 .../YeloLib/cache/cache_files_yelo_base.hpp | 0 .../YeloLib}/cache/data_file_yelo.cpp | 8 +- .../YeloLib}/cache/data_file_yelo.hpp | 2 +- .../cache/shared_cache_file_definitions.hpp | 0 .../YeloLib}/cache/shared_cache_files.cpp | 2 +- .../YeloLib}/cache/shared_cache_files.hpp | 0 .../c_configuration_container.cpp | 0 .../c_configuration_container.hpp | 0 .../c_configuration_container_list.hpp | 0 .../c_configuration_file_factory.cpp | 0 .../c_configuration_file_factory.hpp | 0 .../configuration/c_configuration_list.hpp | 0 .../c_configuration_singleton.hpp | 0 .../configuration/c_configuration_value.hpp | 0 .../c_configuration_value_list.hpp | 0 .../i_configuration_container.hpp | 0 .../configuration/i_configuration_file.hpp | 0 .../configuration/i_configuration_leaf.hpp | 0 .../i_configuration_leaf_iterator.hpp | 0 .../configuration/i_configuration_value.hpp | 0 .../property_tree/c_property_tree_file.cpp | 0 .../property_tree/c_property_tree_file.hpp | 0 .../c_property_tree_file_json.cpp | 0 .../c_property_tree_file_json.hpp | 0 .../c_property_tree_file_xml.cpp | 0 .../c_property_tree_file_xml.hpp | 0 .../property_tree/c_property_tree_leaf.cpp | 0 .../property_tree/c_property_tree_leaf.hpp | 0 .../c_property_tree_leaf_iterator.cpp | 0 .../c_property_tree_leaf_iterator.hpp | 0 .../property_tree/c_property_tree_memory.cpp | 0 .../property_tree/c_property_tree_memory.hpp | 0 .../c_property_tree_memory_json.cpp | 0 .../c_property_tree_memory_json.hpp | 0 .../c_property_tree_memory_xml.cpp | 0 .../c_property_tree_memory_xml.hpp | 0 .../property_tree/property_tree_logging.cpp | 0 .../property_tree/property_tree_logging.hpp | 0 .../type_containers/c_point2d_container.cpp | 0 .../type_containers/c_point2d_container.hpp | 0 .../c_real_bounds_container.cpp | 0 .../c_real_bounds_container.hpp | 0 .../c_real_point2d_container.cpp | 0 .../c_real_point2d_container.hpp | 0 .../c_real_vector3d_container.cpp | 0 .../c_real_vector3d_container.hpp | 0 .../type_containers/c_type_container.hpp | 0 .../YeloLib/cryptography/TEA.cpp | 0 .../YeloLib/cryptography/TEA.hpp | 0 .../YeloLib}/cseries/cseries_yelo.cpp | 2 +- .../YeloLib}/cseries/cseries_yelo.hpp | 0 .../YeloLib/cseries/cseries_yelo_base.cpp | 2 +- .../YeloLib/cseries/cseries_yelo_base.hpp | 0 .../YeloLib/cseries/debug_memory_yelo.cpp | 0 .../YeloLib/cseries/debug_memory_yelo.hpp | 0 .../YeloLib/cseries/enum_wrappers.hpp | 0 .../YeloLib/cseries/errors_yelo.cpp | 4 +- .../YeloLib/cseries/errors_yelo.hpp | 0 .../YeloLib/cseries/handle_abi.hpp | 0 .../YeloLib}/cseries/memory_yelo.hpp | 2 +- .../YeloLib/cseries/non_pod_container.hpp | 0 .../YeloLib/cseries/pc_crashreport.cpp | 2 +- .../YeloLib/cseries/pc_crashreport.hpp | 0 .../YeloLib/cseries/random.cpp | 0 .../YeloLib/cseries/random.hpp | 0 .../YeloLib/cseries/value_conversion.cpp | 0 .../YeloLib/cseries/value_conversion.hpp | 0 .../effects/effects_constants_yelo.hpp | 2 +- .../YeloLib/files/files.cpp | 0 .../YeloLib/files/files.hpp | 0 .../YeloLib}/files/packed_file.cpp | 4 +- .../YeloLib}/files/packed_file.hpp | 0 .../YeloLib}/game/game_engine_yelo.hpp | 0 .../YeloLib}/game/game_results_yelo.hpp | 0 .../YeloLib}/guerilla/mfc_interfaces.cpp | 2 +- .../YeloLib}/guerilla/mfc_interfaces.hpp | 0 .../hs/hs_library_definitions_yelo.cpp | 2 +- .../hs/hs_library_definitions_yelo.hpp | 0 .../Halo1 => source/YeloLib}/hs/hs_yelo.cpp | 6 +- .../Halo1 => source/YeloLib}/hs/hs_yelo.hpp | 2 +- .../equipment_hud_interface_definition.hpp | 0 .../items/equipment_definitions_yelo.hpp | 0 .../items/equipment_structures_yelo.hpp | 6 +- .../YeloLib/main/main_yelo_base.hpp | 0 .../YeloLib/memory/array_yelo.hpp | 0 .../YeloLib/memory/compression/7zip_codec.cpp | 0 .../YeloLib/memory/compression/7zip_codec.hpp | 0 .../YeloLib/memory/compression/zip_codec.cpp | 0 .../YeloLib/memory/compression/zip_codec.hpp | 0 .../YeloLib}/memory/constant_pool.hpp | 0 .../YeloLib}/memory/data_yelo.hpp | 2 +- .../YeloLib/memory/function_interface.cpp | 0 .../YeloLib/memory/function_interface.hpp | 0 .../YeloLib/memory/function_interface.inl | 0 .../memory/function_interface_macros.inl | 0 .../memory/function_interface_test.inl | 0 .../YeloLib/memory/linked_list.cpp | 0 .../YeloLib/memory/linked_list.hpp | 0 .../YeloLib/memory/memory_interface_base.cpp | 0 .../YeloLib/memory/memory_interface_base.hpp | 0 .../YeloLib/memory/naked_func_writer.hpp | 0 .../memory/physical_memory_allocation.cpp | 0 .../memory/physical_memory_allocation.hpp | 0 .../YeloLib/memory/security/xxtea.cpp | 0 .../YeloLib/memory/security/xxtea.hpp | 0 .../model_animation_definitions_yelo.cpp | 2 +- .../model_animation_definitions_yelo.hpp | 4 +- .../objects/object_damage_upgrades.inl | 4 +- .../YeloLib}/objects/objects_yelo.cpp | 10 +- .../YeloLib}/objects/objects_yelo.hpp | 2 +- .../open_sauce/blam_memory_upgrades.hpp | 18 +- .../open_sauce/che_ape/che_ape_api.cpp | 0 .../open_sauce/che_ape/che_ape_api.hpp | 0 .../open_sauce/che_ape/che_ape_api.inl | 0 .../project_yellow_global_definitions.cpp | 10 +- .../project_yellow_global_definitions.hpp | 4 +- .../open_sauce/project_yellow_scenario.cpp | 18 +- .../open_sauce/project_yellow_scenario.hpp | 0 .../project_yellow_scenario_definitions.cpp | 12 +- .../project_yellow_scenario_definitions.hpp | 0 .../open_sauce/settings/c_settings_cheape.cpp | 2 +- .../open_sauce/settings/c_settings_cheape.hpp | 6 +- .../settings/c_settings_manager.cpp | 0 .../settings/c_settings_manager.hpp | 0 .../settings/c_settings_singleton.hpp | 0 .../settings/yelo_settings_definitions.hpp | 2 +- .../settings/yelo_shared_settings.cpp | 6 +- .../settings/yelo_shared_settings.hpp | 2 +- .../settings/yelo_shared_settings_base.cpp | 0 .../settings/yelo_shared_settings_base.hpp | 0 .../YeloLib}/open_sauce/yelo_version.hpp | 0 .../YeloLib}/rasterizer/rasterizer.hpp | 4 +- .../rasterizer/rasterizer_upgrades.inl | 0 .../render/lightmaps/c_lightmap_manager.cpp | 4 +- .../render/lightmaps/c_lightmap_manager.hpp | 4 +- .../YeloLib}/render/render_constants_yelo.hpp | 0 .../render/render_objects_upgrades.inl | 0 .../render/render_particles_upgrades.inl | 0 .../YeloLib}/render/sky/c_sky_manager.cpp | 2 +- .../YeloLib}/render/sky/c_sky_manager.hpp | 2 +- .../YeloLib}/saved_games/game_state_yelo.hpp | 0 ...ect_postprocess_collection_definitions.hpp | 2 +- ...effect_postprocess_generic_definitions.hpp | 2 +- .../shader_postprocess_definitions.cpp | 4 +- .../shader_postprocess_definitions.hpp | 14 +- ...shader_postprocess_generic_definitions.hpp | 4 +- ...shader_postprocess_globals_definitions.hpp | 2 +- .../shaders/shader_postprocess_runtime.inl | 0 .../YeloLib/shell/platform_yelo.hpp | 0 .../shell/shell_windows_command_line.cpp | 10 +- .../shell/shell_windows_command_line.hpp | 2 +- .../shell/shell_windows_command_line.inl | 0 .../string_id_from_tag_string_list.inl | 0 .../YeloLib}/tag_files/string_id_yelo.cpp | 4 +- .../YeloLib}/tag_files/string_id_yelo.hpp | 0 .../tag_files/string_ids.components.inl | 0 .../tag_files/string_ids.game_engine.inl | 0 .../YeloLib}/tag_files/string_ids.global.inl | 0 .../YeloLib}/tag_files/string_ids.gui.inl | 0 .../tag_files/string_ids.gui_alert.inl | 0 .../tag_files/string_ids.gui_dialog.inl | 0 .../tag_files/string_ids.incident.inl | 0 .../tag_files/string_ids.os_setting.inl | 0 .../tag_files/string_ids.properties.inl | 0 .../YeloLib}/tag_files/string_ids_yelo.cpp | 22 +- .../YeloLib}/tag_files/string_ids_yelo.hpp | 20 +- .../tag_files/tag_database_definitions.cpp | 4 +- .../tag_files/tag_database_definitions.hpp | 0 .../tag_fieldset_replacement_builder.cpp | 6 +- .../tag_fieldset_replacement_builder.hpp | 4 +- .../YeloLib}/tag_files/tag_group_memory.cpp | 10 +- .../YeloLib}/tag_files/tag_group_memory.hpp | 0 .../tag_group_memory_allocations.cpp | 8 +- .../tag_files/tag_group_memory_stats.cpp | 8 +- .../tag_files/tag_groups_base_yelo.hpp | 0 .../YeloLib/tag_files/tag_groups_markup.hpp | 0 .../time/interpolation/c_interp_base.hpp | 2 +- .../time/interpolation/c_interp_function.hpp | 4 +- .../time/interpolation/c_interp_linear.hpp | 2 +- .../time/interpolation/i_interpolator.hpp | 0 .../time/interpolation/interpolation.hpp | 0 .../units/c_unit_seat_boarding_manager.cpp | 26 +- .../units/c_unit_seat_boarding_manager.hpp | 0 .../units/c_unit_seat_damage_manager.cpp | 26 +- .../units/c_unit_seat_damage_manager.hpp | 0 .../YeloLib}/units/unit_definitions_yelo.hpp | 2 +- .../units/unit_transform_definition.hpp | 6 +- .../units/units_grenade_count_upgrade.inl | 0 .../YeloLib}/units/units_yelo.cpp | 18 +- .../YeloLib}/units/units_yelo.hpp | 0 .../blamlib}/ai/action_alert.hpp | 0 .../blamlib}/ai/action_avoid.hpp | 0 .../blamlib}/ai/action_charge.hpp | 0 .../blamlib}/ai/action_converse.hpp | 0 .../blamlib}/ai/action_fight.hpp | 0 .../blamlib}/ai/action_flee.hpp | 0 .../blamlib}/ai/action_guard.hpp | 0 .../blamlib}/ai/action_obey.hpp | 0 .../blamlib}/ai/action_search.hpp | 0 .../blamlib}/ai/action_sleep.hpp | 0 .../blamlib}/ai/action_uncover.hpp | 0 .../blamlib}/ai/action_vehicle.hpp | 0 .../blamlib}/ai/action_wait.hpp | 0 .../Halo1 => source/blamlib}/ai/actions.hpp | 0 .../blamlib}/ai/actor_combat.hpp | 0 .../blamlib}/ai/actor_definitions.hpp | 0 .../blamlib}/ai/actor_looking.hpp | 0 .../blamlib}/ai/actor_moving.hpp | 0 .../blamlib}/ai/actor_perception.hpp | 0 .../blamlib}/ai/actor_stimulus.hpp | 0 .../blamlib}/ai/actor_structures.hpp | 10 +- .../blamlib}/ai/actor_types.hpp | 0 .../Halo1 => source/blamlib}/ai/actors.hpp | 2 +- .../Halo1 => source/blamlib}/ai/ai.hpp | 0 .../blamlib}/ai/ai_communication.hpp | 2 +- .../blamlib}/ai/ai_scenario_definitions.hpp | 0 .../Halo1 => source/blamlib}/ai/ai_script.hpp | 2 +- .../blamlib}/ai/ai_structures.hpp | 0 .../blamlib}/ai/encounters.hpp | 4 +- .../Halo1 => source/blamlib}/ai/path.hpp | 0 .../blamlib}/ai/prop_structures.hpp | 6 +- .../Halo1 => source/blamlib}/ai/props.hpp | 0 .../blamlib}/bitmaps/bitmap_definition.hpp | 0 .../bungie_net/common/message_header.hpp | 0 .../bungie_net/network/transport_address.hpp | 0 .../transport_endpoint_set_winsock.hpp | 2 +- .../network/transport_endpoint_winsock.hpp | 4 +- .../blamlib}/cache/cache_constants.hpp | 2 +- .../blamlib}/cache/cache_file_builder.cpp | 34 +- .../blamlib}/cache/cache_file_builder.hpp | 4 +- .../blamlib}/cache/cache_files.cpp | 32 +- .../blamlib}/cache/cache_files.hpp | 2 +- .../blamlib/cache/cache_files_base.hpp | 0 .../blamlib}/cache/cache_files_globals.hpp | 6 +- .../blamlib}/cache/cache_files_structures.hpp | 6 +- .../blamlib}/cache/cache_files_windows.cpp | 14 +- .../blamlib}/cache/data_file.cpp | 12 +- .../blamlib}/cache/data_file.hpp | 0 .../blamlib}/cache/data_file_structures.hpp | 2 +- .../blamlib}/cache/pc_sound_cache.cpp | 8 +- .../blamlib}/cache/pc_sound_cache.hpp | 2 +- .../blamlib}/cache/pc_texture_cache.cpp | 8 +- .../blamlib}/cache/pc_texture_cache.hpp | 2 +- .../blamlib}/cache/physical_memory_map.cpp | 4 +- .../blamlib}/cache/physical_memory_map.hpp | 0 .../cache/physical_memory_map_structures.hpp | 4 +- .../blamlib}/cache/predicted_resources.hpp | 0 .../blamlib}/cache/s_data_file_globals.cpp | 2 +- .../blamlib}/cache/s_data_file_globals.h | 2 +- .../blamlib}/cache/sound_cache.hpp | 0 .../blamlib}/cache/texture_cache.hpp | 0 .../blamlib}/camera/camera_definitions.hpp | 0 .../blamlib}/camera/dead_camera.hpp | 0 .../blamlib}/camera/director.hpp | 0 .../blamlib}/camera/director_structures.hpp | 0 .../blamlib}/camera/first_person_camera.hpp | 0 .../blamlib}/camera/following_camera.hpp | 0 .../blamlib}/camera/observer_structures.hpp | 0 .../blamlib}/cryptography/md5.hpp | 0 .../blamlib}/cseries/cseries.hpp | 2 +- .../blamlib/cseries/cseries_base.hpp | 0 .../blamlib}/cseries/cseries_windows.cpp | 2 +- .../blamlib}/cseries/debug_memory.cpp | 2 +- .../blamlib}/cseries/debug_memory.hpp | 0 .../blamlib/cseries/enum_templates.h | 0 .../blamlib}/cseries/errors.hpp | 0 .../blamlib}/cseries/profile.cpp | 2 +- .../blamlib}/cseries/profile.hpp | 0 .../recorded_animation_definitions.hpp | 4 +- .../cutscene/recorded_animation_playback.hpp | 0 .../recorded_animation_playback_v1.hpp | 0 .../blamlib}/cutscene/recorded_animations.hpp | 2 +- .../recorded_animations_structures.hpp | 6 +- .../blamlib}/devices/device_controls.hpp | 0 .../blamlib}/devices/device_definitions.hpp | 2 +- .../devices/device_light_fixtures.hpp | 0 .../blamlib}/devices/device_machines.hpp | 0 .../blamlib}/devices/device_structures.hpp | 4 +- .../blamlib}/devices/devices.hpp | 2 +- .../blamlib}/effects/contrail_definitions.hpp | 2 +- .../blamlib}/effects/contrails.hpp | 4 +- .../effects/damage_effect_definitions.cpp | 2 +- .../effects/damage_effect_definitions.hpp | 2 +- .../blamlib}/effects/effect_definitions.hpp | 0 .../blamlib}/effects/effects.hpp | 8 +- .../blamlib}/effects/effects_constants.hpp | 0 .../effects/material_effect_definitions.hpp | 0 .../blamlib}/effects/particle_definitions.hpp | 2 +- .../effects/particle_system_definitions.hpp | 2 +- .../blamlib}/effects/particle_systems.hpp | 6 +- .../blamlib}/effects/particles.hpp | 6 +- .../blamlib}/effects/player_effects.hpp | 0 .../weather_particle_system_definitions.hpp | 4 +- .../effects/weather_particle_systems.hpp | 4 +- .../blamlib}/game/action_queue.hpp | 4 +- .../Halo1 => source/blamlib}/game/cheats.hpp | 0 .../Halo1 => source/blamlib}/game/game.hpp | 0 .../blamlib}/game/game_allegiance.hpp | 0 .../game/game_allegiance_structures.hpp | 2 +- .../blamlib}/game/game_configuration.hpp | 0 .../blamlib}/game/game_engine.hpp | 4 +- .../blamlib}/game/game_engine_ctf.hpp | 2 +- .../blamlib}/game/game_engine_king.hpp | 0 .../game/game_engine_multiplayer_sounds.hpp | 0 .../blamlib}/game/game_engine_oddball.hpp | 4 +- .../blamlib}/game/game_engine_race.hpp | 0 .../blamlib}/game/game_engine_slayer.hpp | 0 .../blamlib}/game/game_engine_stub.hpp | 0 .../blamlib}/game/game_globals.hpp | 0 .../game/game_globals_definitions.hpp | 2 +- .../blamlib}/game/game_globals_structures.hpp | 4 +- .../blamlib}/game/game_time.cpp | 4 +- .../blamlib}/game/game_time.hpp | 0 .../blamlib}/game/game_time_structures.hpp | 2 +- .../blamlib}/game/player_action.hpp | 0 .../blamlib}/game/player_control.hpp | 2 +- .../blamlib}/game/player_structures.hpp | 12 +- .../Halo1 => source/blamlib}/game/players.hpp | 4 +- .../blamlib}/game/position_queue.hpp | 2 +- .../blamlib}/game/simple_circular_queue.hpp | 0 .../blamlib}/game/vehicle_update_queue.hpp | 2 +- .../guerilla/field_dialog_structures.hpp | 0 .../blamlib}/guerilla/tags_interface.hpp | 2 +- .../Halo1 => source/blamlib}/hs/hs.cpp | 12 +- .../Halo1 => source/blamlib}/hs/hs.hpp | 10 +- .../blamlib}/hs/hs_compile.cpp | 4 +- .../blamlib}/hs/hs_compile.hpp | 0 .../blamlib}/hs/hs_constants.hpp | 0 .../blamlib}/hs/hs_library_external.hpp | 0 .../blamlib}/hs/hs_library_internal.hpp | 0 .../hs/hs_library_internal_compile.inl | 0 .../hs/hs_library_internal_runtime.inl | 0 .../blamlib}/hs/hs_runtime.cpp | 32 +- .../blamlib}/hs/hs_runtime.hpp | 2 +- .../blamlib}/hs/hs_runtime_structures.hpp | 6 +- .../blamlib}/hs/hs_scenario_definitions.cpp | 2 +- .../blamlib}/hs/hs_scenario_definitions.hpp | 2 +- .../blamlib}/hs/hs_structures.hpp | 2 +- .../blamlib}/hs/hs_threads.cpp | 16 +- .../blamlib}/hs/hs_threads.hpp | 4 +- .../Halo1 => source/blamlib}/hs/hs_types.cpp | 40 +- .../Halo1 => source/blamlib}/hs/hs_types.hpp | 2 +- .../blamlib}/hs/hs_types_compile.inl | 0 .../blamlib}/hs/hs_types_definitions.inl | 0 .../blamlib}/hs/hs_types_runtime.inl | 18 +- .../blamlib}/hs/hs_types_traits.hpp | 4 +- .../blamlib}/hs/object_lists.cpp | 4 +- .../blamlib}/hs/object_lists.hpp | 0 .../blamlib}/hs/object_lists_structures.hpp | 2 +- .../blamlib}/input/input_abstraction.hpp | 0 .../blamlib}/input/input_windows.hpp | 0 .../interface/first_person_weapons.cpp | 2 +- .../interface/first_person_weapons.hpp | 4 +- .../first_person_weapons_structures.hpp | 0 .../blamlib}/interface/hud.hpp | 0 .../blamlib}/interface/hud_chat.hpp | 2 +- .../blamlib}/interface/hud_definitions.hpp | 0 .../blamlib}/interface/hud_draw.hpp | 2 +- .../blamlib}/interface/hud_messaging.hpp | 0 .../interface/hud_messaging_definitions.hpp | 0 .../interface/hud_messaging_structures.hpp | 0 .../blamlib}/interface/hud_nav_points.hpp | 2 +- .../blamlib}/interface/hud_unit.hpp | 2 +- .../interface/hud_unit_structures.hpp | 0 .../blamlib}/interface/hud_weapon.hpp | 4 +- .../interface/hud_weapon_structures.hpp | 0 .../blamlib}/interface/interface.hpp | 0 .../blamlib}/interface/map_list.cpp | 10 +- .../blamlib}/interface/map_list.hpp | 2 +- .../blamlib}/interface/motion_sensor.hpp | 4 +- .../blamlib}/interface/terminal.hpp | 4 +- .../blamlib}/interface/ui_video_screen.hpp | 0 .../blamlib}/interface/ui_widget.hpp | 0 .../ui_widget_event_handler_functions.hpp | 0 .../ui_widget_game_data_input_functions.hpp | 0 .../blamlib}/interface/ui_widget_group.hpp | 6 +- ...dget_text_search_and_replace_functions.hpp | 0 .../unit_hud_interface_definition.hpp | 4 +- .../weapon_hud_interface_definition.hpp | 2 +- .../blamlib}/items/equipment_definitions.hpp | 4 +- .../blamlib}/items/equipment_structures.hpp | 8 +- .../blamlib}/items/garbage_definitions.hpp | 2 +- .../blamlib}/items/item_definitions.hpp | 2 +- .../blamlib}/items/item_structures.hpp | 2 +- .../blamlib}/items/projectile_definitions.hpp | 2 +- .../blamlib}/items/projectiles.hpp | 4 +- .../blamlib}/items/weapon_definitions.hpp | 4 +- .../blamlib}/items/weapon_structures.hpp | 6 +- .../blamlib}/items/weapons.hpp | 2 +- .../Halo1 => source/blamlib}/main/console.hpp | 2 +- .../Halo1 => source/blamlib}/main/editor.hpp | 0 .../Halo1 => source/blamlib}/main/levels.hpp | 0 .../Halo1 => source/blamlib}/main/main.cpp | 6 +- .../Halo1 => source/blamlib}/main/main.hpp | 0 .../blamlib}/main/main_structures.hpp | 2 +- .../blamlib/math/color_math.hpp | 0 .../blamlib/math/integer_math.hpp | 0 .../blamlib/math/matrix_math.hpp | 0 .../blamlib}/math/periodic_functions.hpp | 0 .../blamlib/math/real_math.cpp | 0 .../blamlib/math/real_math.hpp | 0 .../Halo1 => source/blamlib}/memory/array.hpp | 0 .../blamlib}/memory/bitstream.hpp | 0 .../blamlib}/memory/byte_swapping.cpp | 2 +- .../blamlib}/memory/byte_swapping.hpp | 0 .../blamlib/memory/byte_swapping_base.hpp | 0 .../blamlib}/memory/circular_queue.hpp | 0 .../Halo1 => source/blamlib}/memory/data.cpp | 2 +- .../Halo1 => source/blamlib}/memory/data.hpp | 2 +- .../blamlib/memory/data_base.cpp | 0 .../blamlib/memory/data_base.hpp | 0 .../blamlib/memory/datum_index.hpp | 0 .../blamlib}/memory/lruv_cache.hpp | 0 .../blamlib}/memory/memory_pool.hpp | 0 .../models/collision_model_definitions.hpp | 4 +- .../models/model_animation_definitions.hpp | 0 .../blamlib}/models/model_animations.hpp | 0 .../blamlib}/models/model_definitions.hpp | 2 +- .../blamlib}/models/models.hpp | 0 .../networking/message_delta_definitions.hpp | 0 .../message_delta_parameters_protocol.hpp | 2 +- .../networking/network_client_manager.hpp | 0 .../network_client_manager_structures.hpp | 10 +- .../networking/network_client_time.hpp | 0 .../networking/network_connection.hpp | 12 +- .../networking/network_game_globals.hpp | 0 .../networking/network_game_manager.hpp | 4 +- .../network_game_manager_structures.hpp | 6 +- .../blamlib}/networking/network_messages.hpp | 0 .../network_messages_structures.hpp | 12 +- .../networking/network_server_manager.hpp | 0 .../network_server_manager_structures.hpp | 12 +- .../blamlib}/networking/player_update.hpp | 2 +- .../networking/player_update_client.hpp | 8 +- .../networking/player_update_history.hpp | 8 +- .../networking/player_update_server.hpp | 6 +- .../blamlib}/objects/damage.hpp | 4 +- .../blamlib}/objects/index_resolution.hpp | 0 .../blamlib}/objects/object_definitions.hpp | 6 +- .../blamlib}/objects/object_lights.hpp | 0 .../blamlib}/objects/object_structures.cpp | 2 +- .../blamlib}/objects/object_structures.hpp | 6 +- .../blamlib}/objects/object_types.hpp | 0 .../blamlib}/objects/objects.cpp | 10 +- .../blamlib}/objects/objects.hpp | 8 +- .../objects/placeholder_definitions.hpp | 2 +- .../blamlib}/objects/scenery_definitions.hpp | 2 +- .../objects/sound_scenery_definitions.hpp | 2 +- .../blamlib}/objects/vehicle_remapper.hpp | 2 +- .../blamlib}/objects/widgets/widgets.hpp | 0 .../blamlib}/physics/collision_bsp.hpp | 2 +- .../physics/collision_bsp_definitions.hpp | 0 .../blamlib}/physics/collision_features.hpp | 0 .../blamlib}/physics/collision_models.hpp | 4 +- .../blamlib}/physics/collisions.hpp | 4 +- .../blamlib}/physics/physics.hpp | 2 +- .../blamlib}/physics/point_physics.hpp | 0 .../rasterizer/dx9/rasterizer_dx9.hpp | 2 +- .../dx9/rasterizer_dx9_render_targets.cpp | 2 +- .../dx9/rasterizer_dx9_render_targets.hpp | 0 .../blamlib}/rasterizer/rasterizer.hpp | 8 +- .../rasterizer/rasterizer_geometry.hpp | 0 .../blamlib}/render/render.hpp | 2 +- .../blamlib}/render/render_cameras.hpp | 0 .../blamlib}/render/render_constants.hpp | 0 .../blamlib}/render/render_objects.hpp | 8 +- .../blamlib}/saved_games/game_state.hpp | 2 +- .../saved_games/game_state_structures.hpp | 6 +- .../blamlib}/saved_games/game_variant.hpp | 4 +- .../blamlib}/saved_games/player_profile.hpp | 2 +- .../saved_games/saved_game_constants.hpp | 0 .../blamlib}/scenario/scenario.cpp | 24 +- .../blamlib}/scenario/scenario.hpp | 0 .../scenario/scenario_definitions.hpp | 12 +- .../blamlib/scenario/scenario_location.hpp | 0 ...scenario_object_definitions_structures.hpp | 0 .../blamlib}/scenario/scenario_structures.hpp | 4 +- .../blamlib}/scenario/sky_definitions.hpp | 0 .../blamlib}/shaders/shader_definitions.hpp | 4 +- .../Halo1 => source/blamlib}/shell/shell.hpp | 0 .../blamlib}/sound/sound_definitions.hpp | 0 .../sound/sound_environment_definitions.hpp | 0 .../structures/cluster_partitions.hpp | 0 .../structures/structure_bsp_definitions.hpp | 8 +- .../blamlib}/tag_files/files.hpp | 0 .../blamlib}/tag_files/files_windows.cpp | 4 +- .../tag_files/tag_collection_definitions.hpp | 0 .../blamlib}/tag_files/tag_field_scanner.hpp | 2 +- .../blamlib}/tag_files/tag_files.cpp | 12 +- .../blamlib}/tag_files/tag_files.hpp | 0 .../tag_files/tag_files_structures.hpp | 2 +- .../blamlib}/tag_files/tag_group_loading.cpp | 18 +- .../blamlib}/tag_files/tag_group_loading.hpp | 0 source/blamlib/tag_files/tag_group_saving.cpp | 23 + .../blamlib}/tag_files/tag_group_saving.hpp | 0 .../tag_files/tag_group_verification.cpp | 4 +- .../tag_files/tag_group_verification.hpp | 2 +- .../blamlib}/tag_files/tag_groups.cpp | 14 +- .../tag_groups.field_definitions.inl | 0 .../blamlib}/tag_files/tag_groups.hpp | 2 +- .../blamlib/tag_files/tag_groups_base.cpp | 0 .../blamlib/tag_files/tag_groups_base.hpp | 0 .../tag_files/tag_groups_field_scan.cpp | 6 +- .../tag_files/tag_groups_structures.hpp | 0 .../tag_groups_structures_macros.hpp | 0 .../blamlib}/tag_files/tag_groups_system.cpp | 10 +- .../blamlib}/text/draw_string.hpp | 0 .../blamlib}/text/text_group.hpp | 0 .../Halo1 => source/blamlib}/tool/tool.hpp | 0 .../blamlib}/units/biped_definitions.hpp | 2 +- .../blamlib}/units/biped_structures.hpp | 2 +- .../Halo1 => source/blamlib}/units/bipeds.hpp | 0 .../blamlib}/units/dialogue_definitions.hpp | 0 .../blamlib}/units/unit_camera.hpp | 0 .../blamlib}/units/unit_control.hpp | 0 .../blamlib}/units/unit_definitions.hpp | 6 +- .../blamlib}/units/unit_dialogue.hpp | 2 +- .../blamlib}/units/unit_script.hpp | 0 .../blamlib}/units/unit_structures.cpp | 4 +- .../blamlib}/units/unit_structures.hpp | 14 +- .../Halo1 => source/blamlib}/units/units.hpp | 2 +- .../blamlib}/units/vehicle_definitions.hpp | 2 +- .../blamlib}/units/vehicle_structures.hpp | 4 +- .../blamlib}/units/vehicles.hpp | 0 987 files changed, 3980 insertions(+), 59105 deletions(-) delete mode 100644 OpenSauce/shared/Include/CrashRpt/CrashRpt.h delete mode 100644 OpenSauce/shared/Include/GWEN/Align.h delete mode 100644 OpenSauce/shared/Include/GWEN/Anim.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Anim.h delete mode 100644 OpenSauce/shared/Include/GWEN/BaseRender.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/BaseRender.h delete mode 100644 OpenSauce/shared/Include/GWEN/Config.h delete mode 100644 OpenSauce/shared/Include/GWEN/ControlList.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/ControlList.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Base.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Base.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Button.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Button.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Canvas.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Canvas.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CheckBox.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CheckBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CollapsibleList.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ColorControls.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ColorControls.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ColorPicker.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ColorPicker.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ComboBox.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ComboBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/DockBase.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/DockBase.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Dragger.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Dragger.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/FieldLabel.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/GroupBox.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/GroupBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Highlight.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ImagePanel.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ImagePanel.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Label.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Label.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/LabelClickable.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/LabelClickable.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Layout/Table.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ListBox.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ListBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Menu.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Menu.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/MenuItem.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/MenuItem.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/MenuStrip.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/MenuStrip.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Modal.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/PageControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/PageControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Pointer.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Pointer.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ProgressBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ProgressBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Properties.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Properties.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Property/BaseProperty.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Property/Checkbox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Property/ColorSelector.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Property/ComboBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Property/Text.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/PropertyTree.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/PropertyTree.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RadioButton.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RadioButton.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Rectangle.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Rectangle.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ResizableControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ResizableControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Resizer.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Resizer.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RichLabel.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/RichLabel.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ScrollControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Slider.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Slider.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/SplitterBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/SplitterBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Splitters.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/StatusBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabButton.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabButton.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabStrip.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabStrip.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TabTitleBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Text.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/Text.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TextBox.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TextBox.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TextBoxNumeric.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/ToolBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TreeControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TreeControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TreeNode.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/TreeNode.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/WindowButtons.h delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/WindowControl.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Controls/WindowControl.h delete mode 100644 OpenSauce/shared/Include/GWEN/DragAndDrop.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/DragAndDrop.h delete mode 100644 OpenSauce/shared/Include/GWEN/Events.h delete mode 100644 OpenSauce/shared/Include/GWEN/Exports.h delete mode 100644 OpenSauce/shared/Include/GWEN/Font.h delete mode 100644 OpenSauce/shared/Include/GWEN/Gwen.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Gwen.h delete mode 100644 OpenSauce/shared/Include/GWEN/Hook.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Hook.h delete mode 100644 OpenSauce/shared/Include/GWEN/InputHandler.h delete mode 100644 OpenSauce/shared/Include/GWEN/Macros.h delete mode 100644 OpenSauce/shared/Include/GWEN/Platform.h delete mode 100644 OpenSauce/shared/Include/GWEN/Platforms/HaloRuntime.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Skin.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Skin.h delete mode 100644 OpenSauce/shared/Include/GWEN/Skins/TexturedBase.h delete mode 100644 OpenSauce/shared/Include/GWEN/Skins/Texturing.h delete mode 100644 OpenSauce/shared/Include/GWEN/Structures.h delete mode 100644 OpenSauce/shared/Include/GWEN/TextObject.h delete mode 100644 OpenSauce/shared/Include/GWEN/Texture.h delete mode 100644 OpenSauce/shared/Include/GWEN/ToolTip.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/ToolTip.h delete mode 100644 OpenSauce/shared/Include/GWEN/UserData.h delete mode 100644 OpenSauce/shared/Include/GWEN/Utility.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/Utility.h delete mode 100644 OpenSauce/shared/Include/GWEN/WindowProvider.h delete mode 100644 OpenSauce/shared/Include/GWEN/events.cpp delete mode 100644 OpenSauce/shared/Include/GWEN/inputhandler.cpp delete mode 100644 OpenSauce/shared/Include/TinyXml/OpenSauce.Readme.txt delete mode 100644 OpenSauce/shared/Include/TinyXml/tinystr.cpp delete mode 100644 OpenSauce/shared/Include/TinyXml/tinystr.hpp delete mode 100644 OpenSauce/shared/Include/TinyXml/tinyxml.cpp delete mode 100644 OpenSauce/shared/Include/TinyXml/tinyxml.hpp delete mode 100644 OpenSauce/shared/Include/TinyXml/tinyxmlerror.cpp delete mode 100644 OpenSauce/shared/Include/TinyXml/tinyxmlparser.cpp delete mode 100644 OpenSauce/shared/Include/YeloLib/Halo2/hs/hs_yelo.hpp delete mode 100644 OpenSauce/shared/Include/YeloLib/Halo2/memory/data_yelo.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.cpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/cache/cache_files.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/cache/predicted_resources.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/cseries/cseries.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/cseries/errors.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/game/players.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/hs/hs.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface_controller.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/constant_pool.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/data.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/hashtable.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/lruv_cache.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/memory_pool.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/memory/resource_database.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/networking/session/network_session.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/shaders/shader_definitions.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/sound/sound_definitions.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/tag_files/files.hpp delete mode 100644 OpenSauce/shared/Include/blamlib/Halo2/tag_files/tag_groups.hpp delete mode 100644 OpenSauce/shared/Include/mongoose/mongoose.c delete mode 100644 OpenSauce/shared/Include/mongoose/mongoose.h delete mode 100644 OpenSauce/shared/Include/zlib/README delete mode 100644 OpenSauce/shared/Include/zlib/adler32.c delete mode 100644 OpenSauce/shared/Include/zlib/compress.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/MiniZip64_Changes.txt delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/MiniZip64_info.txt delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/OpenSauce.Readme.txt delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/crypt.h delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/ioapi.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/ioapi.h delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/iowin32.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/iowin32.h delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/miniunz.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/minizip.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/mztools.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/mztools.h delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/unzip.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/unzip.h delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/zip.c delete mode 100644 OpenSauce/shared/Include/zlib/contrib/minizip/zip.h delete mode 100644 OpenSauce/shared/Include/zlib/crc32.c delete mode 100644 OpenSauce/shared/Include/zlib/crc32.h delete mode 100644 OpenSauce/shared/Include/zlib/deflate.c delete mode 100644 OpenSauce/shared/Include/zlib/deflate.h delete mode 100644 OpenSauce/shared/Include/zlib/example.c delete mode 100644 OpenSauce/shared/Include/zlib/gzclose.c delete mode 100644 OpenSauce/shared/Include/zlib/gzguts.h delete mode 100644 OpenSauce/shared/Include/zlib/gzlib.c delete mode 100644 OpenSauce/shared/Include/zlib/gzread.c delete mode 100644 OpenSauce/shared/Include/zlib/gzwrite.c delete mode 100644 OpenSauce/shared/Include/zlib/infback.c delete mode 100644 OpenSauce/shared/Include/zlib/inffast.c delete mode 100644 OpenSauce/shared/Include/zlib/inffast.h delete mode 100644 OpenSauce/shared/Include/zlib/inffixed.h delete mode 100644 OpenSauce/shared/Include/zlib/inflate.c delete mode 100644 OpenSauce/shared/Include/zlib/inflate.h delete mode 100644 OpenSauce/shared/Include/zlib/inftrees.c delete mode 100644 OpenSauce/shared/Include/zlib/inftrees.h delete mode 100644 OpenSauce/shared/Include/zlib/minigzip.c delete mode 100644 OpenSauce/shared/Include/zlib/trees.c delete mode 100644 OpenSauce/shared/Include/zlib/trees.h delete mode 100644 OpenSauce/shared/Include/zlib/uncompr.c delete mode 100644 OpenSauce/shared/Include/zlib/zconf.h delete mode 100644 OpenSauce/shared/Include/zlib/zlib.h delete mode 100644 OpenSauce/shared/Include/zlib/zutil.c delete mode 100644 OpenSauce/shared/Include/zlib/zutil.h delete mode 100644 OpenSauce/shared/config/msbuild/YeloLib_Halo2.props delete mode 100644 OpenSauce/shared/config/msbuild/YeloLib_Halo2.vcxproj.filters delete mode 100644 OpenSauce/shared/config/msbuild/blamlib_Halo2.props delete mode 100644 OpenSauce/shared/config/msbuild/blamlib_Halo2.vcxproj.filters rename {bin/_scripts => scripts}/OpenSauce_Halo1_CE_BuildInstallers.bat (100%) rename {bin/_scripts => scripts}/PrereqChecks.bat (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/ai/ai_yelo.cpp (88%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/ai/ai_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/ai/c_actor_variant_transform_manager.cpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/ai/c_actor_variant_transform_manager.hpp (97%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_builder_yelo.cpp (89%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_builder_yelo.hpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_memory.cpp (72%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_memory.hpp (90%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_memory_gestalt_definitions.hpp (91%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_file_memory_layout_table_definitions.hpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_files_structures_yelo.hpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_files_yelo.cpp (92%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/cache_files_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cache/cache_files_yelo_base.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/data_file_yelo.cpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/data_file_yelo.hpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/shared_cache_file_definitions.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/shared_cache_files.cpp (67%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cache/shared_cache_files.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_container.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_container_list.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_file_factory.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_file_factory.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_list.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_singleton.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_value.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/c_configuration_value_list.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/i_configuration_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/i_configuration_file.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/i_configuration_leaf.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/i_configuration_leaf_iterator.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/i_configuration_value.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file_json.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file_json.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file_xml.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_file_xml.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_leaf.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_leaf.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory_json.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory_json.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory_xml.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/c_property_tree_memory_xml.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/property_tree_logging.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/property_tree/property_tree_logging.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_point2d_container.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_point2d_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_bounds_container.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_bounds_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_point2d_container.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_point2d_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_vector3d_container.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_real_vector3d_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/configuration/type_containers/c_type_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cryptography/TEA.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cryptography/TEA.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cseries/cseries_yelo.cpp (82%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cseries/cseries_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/cseries_yelo_base.cpp (95%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/cseries_yelo_base.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/debug_memory_yelo.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/debug_memory_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/enum_wrappers.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/errors_yelo.cpp (90%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/errors_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/handle_abi.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/cseries/memory_yelo.hpp (96%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/non_pod_container.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/pc_crashreport.cpp (97%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/pc_crashreport.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/random.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/random.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/value_conversion.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/cseries/value_conversion.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/effects/effects_constants_yelo.hpp (87%) rename {OpenSauce/shared/Include => source}/YeloLib/files/files.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/files/files.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/files/packed_file.cpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/files/packed_file.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/game/game_engine_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/game/game_results_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/guerilla/mfc_interfaces.cpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/guerilla/mfc_interfaces.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/hs/hs_library_definitions_yelo.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/hs/hs_library_definitions_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/hs/hs_yelo.cpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/hs/hs_yelo.hpp (96%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/interface/equipment_hud_interface_definition.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/items/equipment_definitions_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/items/equipment_structures_yelo.hpp (69%) rename {OpenSauce/shared/Include => source}/YeloLib/main/main_yelo_base.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/array_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/compression/7zip_codec.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/compression/7zip_codec.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/compression/zip_codec.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/compression/zip_codec.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/memory/constant_pool.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/memory/data_yelo.hpp (94%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/function_interface.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/function_interface.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/function_interface.inl (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/function_interface_macros.inl (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/function_interface_test.inl (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/linked_list.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/linked_list.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/memory_interface_base.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/memory_interface_base.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/naked_func_writer.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/physical_memory_allocation.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/physical_memory_allocation.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/security/xxtea.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/memory/security/xxtea.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/models/model_animation_definitions_yelo.cpp (86%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/models/model_animation_definitions_yelo.hpp (86%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/objects/object_damage_upgrades.inl (92%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/objects/objects_yelo.cpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/objects/objects_yelo.hpp (97%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/blam_memory_upgrades.hpp (88%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/che_ape/che_ape_api.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/che_ape/che_ape_api.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/che_ape/che_ape_api.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_global_definitions.cpp (90%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_global_definitions.hpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_scenario.cpp (90%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_scenario.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_scenario_definitions.cpp (88%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/project_yellow_scenario_definitions.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/settings/c_settings_cheape.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/settings/c_settings_cheape.hpp (93%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/settings/c_settings_manager.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/settings/c_settings_manager.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/settings/c_settings_singleton.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/settings/yelo_settings_definitions.hpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/settings/yelo_shared_settings.cpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/settings/yelo_shared_settings.hpp (95%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/settings/yelo_shared_settings_base.cpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/open_sauce/settings/yelo_shared_settings_base.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/open_sauce/yelo_version.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/rasterizer/rasterizer.hpp (61%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/rasterizer/rasterizer_upgrades.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/lightmaps/c_lightmap_manager.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/lightmaps/c_lightmap_manager.hpp (87%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/render_constants_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/render_objects_upgrades.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/render_particles_upgrades.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/sky/c_sky_manager.cpp (96%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/render/sky/c_sky_manager.hpp (90%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/saved_games/game_state_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/effect_postprocess_collection_definitions.hpp (91%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/effect_postprocess_generic_definitions.hpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/shader_postprocess_definitions.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/shader_postprocess_definitions.hpp (91%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/shader_postprocess_generic_definitions.hpp (94%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/shader_postprocess_globals_definitions.hpp (90%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shaders/shader_postprocess_runtime.inl (100%) rename {OpenSauce/shared/Include => source}/YeloLib/shell/platform_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shell/shell_windows_command_line.cpp (84%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shell/shell_windows_command_line.hpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/shell/shell_windows_command_line.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_id_from_tag_string_list.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_id_yelo.cpp (88%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_id_yelo.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.components.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.game_engine.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.global.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.gui.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.gui_alert.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.gui_dialog.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.incident.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.os_setting.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids.properties.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids_yelo.cpp (77%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/string_ids_yelo.hpp (78%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_database_definitions.cpp (92%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_database_definitions.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_fieldset_replacement_builder.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_fieldset_replacement_builder.hpp (97%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_group_memory.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_group_memory.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_group_memory_allocations.cpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/tag_files/tag_group_memory_stats.cpp (94%) rename {OpenSauce/shared/Include => source}/YeloLib/tag_files/tag_groups_base_yelo.hpp (100%) rename {OpenSauce/shared/Include => source}/YeloLib/tag_files/tag_groups_markup.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/time/interpolation/c_interp_base.hpp (86%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/time/interpolation/c_interp_function.hpp (86%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/time/interpolation/c_interp_linear.hpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/time/interpolation/i_interpolator.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/time/interpolation/interpolation.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/c_unit_seat_boarding_manager.cpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/c_unit_seat_boarding_manager.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/c_unit_seat_damage_manager.cpp (92%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/c_unit_seat_damage_manager.hpp (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/unit_definitions_yelo.hpp (96%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/unit_transform_definition.hpp (95%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/units_grenade_count_upgrade.inl (100%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/units_yelo.cpp (93%) rename {OpenSauce/shared/Include/YeloLib/Halo1 => source/YeloLib}/units/units_yelo.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_alert.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_avoid.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_charge.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_converse.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_fight.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_flee.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_guard.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_obey.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_search.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_sleep.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_uncover.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_vehicle.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/action_wait.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_combat.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_looking.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_moving.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_perception.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_stimulus.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_structures.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actor_types.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/actors.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/ai.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/ai_communication.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/ai_scenario_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/ai_script.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/ai_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/encounters.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/path.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/prop_structures.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/ai/props.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/bitmaps/bitmap_definition.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/bungie_net/common/message_header.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/bungie_net/network/transport_address.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/bungie_net/network/transport_endpoint_set_winsock.hpp (81%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/bungie_net/network/transport_endpoint_winsock.hpp (83%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_constants.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_file_builder.cpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_file_builder.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_files.cpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_files.hpp (96%) rename {OpenSauce/shared/Include => source}/blamlib/cache/cache_files_base.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_files_globals.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_files_structures.hpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/cache_files_windows.cpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/data_file.cpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/data_file.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/data_file_structures.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/pc_sound_cache.cpp (84%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/pc_sound_cache.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/pc_texture_cache.cpp (80%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/pc_texture_cache.hpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/physical_memory_map.cpp (82%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/physical_memory_map.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/physical_memory_map_structures.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/predicted_resources.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/s_data_file_globals.cpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/s_data_file_globals.h (87%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/sound_cache.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cache/texture_cache.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/camera_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/dead_camera.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/director.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/director_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/first_person_camera.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/following_camera.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/camera/observer_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cryptography/md5.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/cseries.hpp (95%) rename {OpenSauce/shared/Include => source}/blamlib/cseries/cseries_base.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/cseries_windows.cpp (89%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/debug_memory.cpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/debug_memory.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/cseries/enum_templates.h (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/errors.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/profile.cpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cseries/profile.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cutscene/recorded_animation_definitions.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cutscene/recorded_animation_playback.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cutscene/recorded_animation_playback_v1.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cutscene/recorded_animations.hpp (83%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/cutscene/recorded_animations_structures.hpp (76%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/device_controls.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/device_definitions.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/device_light_fixtures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/device_machines.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/device_structures.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/devices/devices.hpp (81%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/contrail_definitions.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/contrails.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/damage_effect_definitions.cpp (69%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/damage_effect_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/effect_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/effects.hpp (89%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/effects_constants.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/material_effect_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/particle_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/particle_system_definitions.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/particle_systems.hpp (84%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/particles.hpp (75%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/player_effects.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/weather_particle_system_definitions.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/effects/weather_particle_systems.hpp (63%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/action_queue.hpp (82%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/cheats.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_allegiance.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_allegiance_structures.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_configuration.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_ctf.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_king.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_multiplayer_sounds.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_oddball.hpp (84%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_race.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_slayer.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_engine_stub.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_globals.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_globals_definitions.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_globals_structures.hpp (79%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_time.cpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_time.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/game_time_structures.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/player_action.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/player_control.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/player_structures.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/players.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/position_queue.hpp (85%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/simple_circular_queue.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/game/vehicle_update_queue.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/guerilla/field_dialog_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/guerilla/tags_interface.hpp (89%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs.cpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_compile.cpp (62%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_compile.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_constants.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_library_external.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_library_internal.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_library_internal_compile.inl (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_library_internal_runtime.inl (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_runtime.cpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_runtime.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_runtime_structures.hpp (77%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_scenario_definitions.cpp (67%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_scenario_definitions.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_structures.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_threads.cpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_threads.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types.cpp (83%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types.hpp (97%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types_compile.inl (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types_definitions.inl (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types_runtime.inl (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/hs_types_traits.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/object_lists.cpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/object_lists.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/hs/object_lists_structures.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/input/input_abstraction.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/input/input_windows.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/first_person_weapons.cpp (89%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/first_person_weapons.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/first_person_weapons_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_chat.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_draw.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_messaging.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_messaging_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_messaging_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_nav_points.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_unit.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_unit_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_weapon.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/hud_weapon_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/interface.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/map_list.cpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/map_list.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/motion_sensor.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/terminal.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_video_screen.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_widget.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_widget_event_handler_functions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_widget_game_data_input_functions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_widget_group.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/ui_widget_text_search_and_replace_functions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/unit_hud_interface_definition.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/interface/weapon_hud_interface_definition.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/equipment_definitions.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/equipment_structures.hpp (81%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/garbage_definitions.hpp (84%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/item_definitions.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/item_structures.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/projectile_definitions.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/projectiles.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/weapon_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/weapon_structures.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/items/weapons.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/console.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/editor.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/levels.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/main.cpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/main.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/main/main_structures.hpp (93%) rename {OpenSauce/shared/Include => source}/blamlib/math/color_math.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/math/integer_math.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/math/matrix_math.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/math/periodic_functions.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/math/real_math.cpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/math/real_math.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/array.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/bitstream.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/byte_swapping.cpp (73%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/byte_swapping.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/memory/byte_swapping_base.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/circular_queue.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/data.cpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/data.hpp (95%) rename {OpenSauce/shared/Include => source}/blamlib/memory/data_base.cpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/memory/data_base.hpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/memory/datum_index.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/lruv_cache.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/memory/memory_pool.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/models/collision_model_definitions.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/models/model_animation_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/models/model_animations.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/models/model_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/models/models.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/message_delta_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/message_delta_parameters_protocol.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_client_manager.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_client_manager_structures.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_client_time.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_connection.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_game_globals.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_game_manager.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_game_manager_structures.hpp (83%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_messages.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_messages_structures.hpp (80%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_server_manager.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/network_server_manager_structures.hpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/player_update.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/player_update_client.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/player_update_history.hpp (87%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/networking/player_update_server.hpp (88%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/damage.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/index_resolution.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/object_definitions.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/object_lights.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/object_structures.cpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/object_structures.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/object_types.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/objects.cpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/objects.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/placeholder_definitions.hpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/scenery_definitions.hpp (83%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/sound_scenery_definitions.hpp (84%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/vehicle_remapper.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/objects/widgets/widgets.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/collision_bsp.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/collision_bsp_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/collision_features.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/collision_models.hpp (86%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/collisions.hpp (87%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/physics.hpp (91%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/physics/point_physics.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/rasterizer/dx9/rasterizer_dx9.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/rasterizer/dx9/rasterizer_dx9_render_targets.cpp (89%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/rasterizer/dx9/rasterizer_dx9_render_targets.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/rasterizer/rasterizer.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/rasterizer/rasterizer_geometry.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/render/render.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/render/render_cameras.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/render/render_constants.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/render/render_objects.hpp (79%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/saved_games/game_state.hpp (81%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/saved_games/game_state_structures.hpp (82%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/saved_games/game_variant.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/saved_games/player_profile.hpp (87%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/saved_games/saved_game_constants.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/scenario.cpp (87%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/scenario.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/scenario_definitions.hpp (93%) rename {OpenSauce/shared/Include => source}/blamlib/scenario/scenario_location.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/scenario_object_definitions_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/scenario_structures.hpp (85%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/scenario/sky_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/shaders/shader_definitions.hpp (97%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/shell/shell.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/sound/sound_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/sound/sound_environment_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/structures/cluster_partitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/structures/structure_bsp_definitions.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/files.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/files_windows.cpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_collection_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_field_scanner.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_files.cpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_files.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_files_structures.hpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_group_loading.cpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_group_loading.hpp (100%) create mode 100644 source/blamlib/tag_files/tag_group_saving.cpp rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_group_saving.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_group_verification.cpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_group_verification.hpp (90%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups.cpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups.field_definitions.inl (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups.hpp (96%) rename {OpenSauce/shared/Include => source}/blamlib/tag_files/tag_groups_base.cpp (100%) rename {OpenSauce/shared/Include => source}/blamlib/tag_files/tag_groups_base.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups_field_scan.cpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups_structures.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups_structures_macros.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tag_files/tag_groups_system.cpp (94%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/text/draw_string.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/text/text_group.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/tool/tool.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/biped_definitions.hpp (96%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/biped_structures.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/bipeds.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/dialogue_definitions.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_camera.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_control.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_dialogue.hpp (92%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_script.hpp (100%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_structures.cpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/unit_structures.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/units.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/vehicle_definitions.hpp (95%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/vehicle_structures.hpp (93%) rename {OpenSauce/shared/Include/blamlib/Halo1 => source/blamlib}/units/vehicles.hpp (100%) diff --git a/OpenSauce/Halo1/Halo1_BlamLib/Common/Precompile.hpp b/OpenSauce/Halo1/Halo1_BlamLib/Common/Precompile.hpp index b85f5230f..45244202e 100644 --- a/OpenSauce/Halo1/Halo1_BlamLib/Common/Precompile.hpp +++ b/OpenSauce/Halo1/Halo1_BlamLib/Common/Precompile.hpp @@ -77,10 +77,10 @@ #include "Common/Platform.hpp" -#include +#include #include -#include +#include #include -#include -#include +#include +#include diff --git a/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj b/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj index 549e576c1..22ef3722d 100644 --- a/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj +++ b/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj @@ -84,349 +84,349 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + diff --git a/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj.filters b/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj.filters index 86abadd06..3e9a7c405 100644 --- a/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj.filters +++ b/OpenSauce/Halo1/Halo1_BlamLib/Halo1_BlamLib.vcxproj.filters @@ -141,865 +141,865 @@ .Common - + ai - + ai - + ai - + ai - + ai - + ai - + ai - + bungie_net\network - + bungie_net\network - + bungie_net\network - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + camera - + cseries - + cseries - + cseries - + cseries - + cseries - + cutscene - + cutscene - + cutscene - + cutscene - + cutscene - + devices - + devices - + devices - + devices - + devices - + devices - + effects - + effects - + effects - + effects - + effects - + effects - + effects - + effects - + effects - + effects - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + game - + guerilla - + guerilla - + hs - + hs - + hs - + hs - + hs - + hs - + hs - + hs - + hs - + input - + input - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + interface - + items - + items - + items - + items - + items - + items - + items - + items - + items - + main - + main - + main - + main - + math - + math - + math - + math - + math - + memory - + memory - + memory - + memory - + memory - + memory - + memory - + memory - + memory - + memory - + models - + models - + models - + models - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + networking - + objects - + objects - + objects - + objects - + objects - + objects - + objects - + objects - + objects - + objects - + objects - + objects\widgets - + physics - + physics - + physics - + physics - + physics - + physics - + physics - + rasterizer - + rasterizer - + rasterizer\dx9 - + rasterizer\dx9 - + render - + render - + render - + render - + saved_games - + saved_games - + saved_games - + saved_games - + scenario - + scenario - + scenario - + scenario - + scenario - + scenario - + shaders - + sound - + sound - + structures - + structures - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + text - + text - + tool - + units - + units - + units - + units - + units - + units - + units - + units - + units - + units - + units - + units - + camera - + camera - + camera - + camera - + cache - + tag_files - + tag_files - + shell - + ai - + ai - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actions - + ai\actor_types - + ai\actors - + ai\actors - + ai\actors - + ai\actors - + ai\actors - + ai\actors - + ai\actors - + ai\actors - + models - + cache - + cache - + saved_games - + cryptography - + main - + hs - + hs - + hs - + hs - + tag_files - + hs - + cache - + cache - + cache - + effects - + effects - + effects - + effects - + items - + camera - + camera - + units - + units - + tag_files - + cseries - + bitmaps - + bungie_net\common - + cache @@ -1007,149 +1007,149 @@ .Common - + cache - + cache - + cache - + cseries - + cseries - + hs - + hs - + hs - + hs - + interface - + math - + memory - + memory - + memory - + objects - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + units - + effects - + interface - + main - + objects - + rasterizer\dx9 - + tag_files - + cache - + cseries - + game - + hs - + hs - + scenario - + hs - + cache - + cache - + cache - + cache - + networking - + hs - + hs - + hs - + hs - + hs diff --git a/OpenSauce/Halo1/Halo1_CE/Common/DebugDump.cpp b/OpenSauce/Halo1/Halo1_CE/Common/DebugDump.cpp index 7d26ed46e..058eb266b 100644 --- a/OpenSauce/Halo1/Halo1_CE/Common/DebugDump.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Common/DebugDump.cpp @@ -9,15 +9,15 @@ #include #pragma comment (lib, "Faultrep.lib") -#include +#include #include "Memory/MemoryInterface.hpp" #if PLATFORM_IS_USER -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Common/Precompile.hpp b/OpenSauce/Halo1/Halo1_CE/Common/Precompile.hpp index 601f85f8b..8ae0fe85a 100644 --- a/OpenSauce/Halo1/Halo1_CE/Common/Precompile.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Common/Precompile.hpp @@ -131,12 +131,12 @@ #define API_NO_ZIP_CODEC #endif -#include +#include #include -#include +#include #include -#include -#include +#include +#include #include "Settings/Settings.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/AI.Transform.inl b/OpenSauce/Halo1/Halo1_CE/Game/AI.Transform.inl index d2ddca843..efe993964 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/AI.Transform.inl +++ b/OpenSauce/Halo1/Halo1_CE/Game/AI.Transform.inl @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/AI.cpp b/OpenSauce/Halo1/Halo1_CE/Game/AI.cpp index 2e7e7f34e..295d11fed 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/AI.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/AI.cpp @@ -7,10 +7,10 @@ #include "Common/Precompile.hpp" #include "Game/AI.hpp" -#include -#include +#include +#include -#include +#include #include "Memory/MemoryInterface.hpp" #include "Objects/Objects.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/AI.hpp b/OpenSauce/Halo1/Halo1_CE/Game/AI.hpp index 75eab993d..595546a8e 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/AI.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/AI.hpp @@ -6,13 +6,13 @@ */ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Camera.cpp b/OpenSauce/Halo1/Halo1_CE/Game/Camera.cpp index 53d682238..06aa01471 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Camera.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Camera.cpp @@ -9,11 +9,11 @@ #if PLATFORM_IS_USER -#include -#include -#include +#include +#include +#include -#include +#include #include "Settings/Settings.hpp" #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Camera.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Camera.hpp index 496aaa604..b8dd88385 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Camera.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Camera.hpp @@ -7,7 +7,7 @@ #pragma once #if PLATFORM_IS_USER -#include +#include #include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Game/CameraFov.inl b/OpenSauce/Halo1/Halo1_CE/Game/CameraFov.inl index 2b031289d..30cc08dee 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/CameraFov.inl +++ b/OpenSauce/Halo1/Halo1_CE/Game/CameraFov.inl @@ -8,9 +8,9 @@ #include "Game/Players.hpp" #include "TagGroups/CacheFiles.hpp" -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Console.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Console.hpp index 685987d13..5157e896b 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Console.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Console.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Effects.cpp b/OpenSauce/Halo1/Halo1_CE/Game/Effects.cpp index 03d85fdcb..5a9771451 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Effects.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Effects.cpp @@ -7,7 +7,7 @@ #include "Common/Precompile.hpp" #include "Game/Effects.hpp" -#include +#include #include "Game/GameState.hpp" #include "Memory/MemoryInterface.hpp" @@ -36,7 +36,7 @@ namespace Yelo s_decal_vertex_cache_data* DecalVertexCache() DPTR_IMP_GET(decal_vertex_cache); -#include +#include static void InitializePerMapUpgrades() { #if PLATFORM_IS_USER diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Effects.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Effects.hpp index 6451fe26d..9e8012e2d 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Effects.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Effects.hpp @@ -6,14 +6,14 @@ */ #pragma once -#include -#include - -#include -#include -#include -#include -#include +#include +#include + +#include +#include +#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CE/Game/EngineFunctions.cpp b/OpenSauce/Halo1/Halo1_CE/Game/EngineFunctions.cpp index eab8e6ff9..4df777a59 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/EngineFunctions.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/EngineFunctions.cpp @@ -7,20 +7,20 @@ #include "Common/Precompile.hpp" #include "Game/EngineFunctions.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Game/Console.hpp" #include "Game/GameState.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameBuildNumber.cpp b/OpenSauce/Halo1/Halo1_CE/Game/GameBuildNumber.cpp index 62c378ce3..63db9a36f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameBuildNumber.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameBuildNumber.cpp @@ -7,7 +7,7 @@ #include "Common/Precompile.hpp" #include "Game/GameBuildNumber.hpp" -#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.cpp b/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.cpp index 700f880cc..70faf030e 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.cpp @@ -7,12 +7,12 @@ #include "Common/Precompile.hpp" #include "Game/GameEngine.hpp" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Game/GameState.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.hpp b/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.hpp index 79bcbd1a4..51ef8a1bd 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameEngine.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameState.cpp b/OpenSauce/Halo1/Halo1_CE/Game/GameState.cpp index 819884e45..016cc05f1 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameState.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameState.cpp @@ -7,21 +7,21 @@ #include "Common/Precompile.hpp" #include "Game/GameState.hpp" -#include -#include -#include -#include -#include -#include // for data_array_info only -#include -#include -#include +#include +#include +#include +#include +#include +#include // for data_array_info only +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Common/GameSystems.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameState.hpp b/OpenSauce/Halo1/Halo1_CE/Game/GameState.hpp index d656bfd9e..68152bbb0 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameState.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameState.hpp @@ -8,14 +8,14 @@ #include "Memory/MemoryInterface.hpp" // for CRC -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/GameStateRuntimeData.cpp b/OpenSauce/Halo1/Halo1_CE/Game/GameStateRuntimeData.cpp index afd53c054..a70e2d1f7 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/GameStateRuntimeData.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/GameStateRuntimeData.cpp @@ -7,7 +7,7 @@ #include "Common/Precompile.hpp" #include "Game/GameStateRuntimeData.hpp" -#include +#include #include "Game/GameState.hpp" #include "Game/ScriptLibrary.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Lights.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Lights.hpp index 0b889c343..f13c46467 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Lights.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Lights.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Players.cpp b/OpenSauce/Halo1/Halo1_CE/Game/Players.cpp index d170aaea4..f172451c5 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Players.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Players.cpp @@ -7,13 +7,13 @@ #include "Common/Precompile.hpp" #include "Game/Players.hpp" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "Game/EngineFunctions.hpp" #include "Game/GameEngine.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Players.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Players.hpp index 66415ec0b..61def4a76 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Players.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Players.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.cpp b/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.cpp index 12ef6adfd..7f7831c42 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.cpp @@ -7,10 +7,10 @@ #include "Common/Precompile.hpp" #include "Game/ScriptLibrary.hpp" -#include -#include -#include -#include +#include +#include +#include +#include #include "Settings/Settings.hpp" #include "Game/Camera.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.hpp b/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.hpp index eb67bbe22..f6884bbe4 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/ScriptLibrary.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Scripting.cpp b/OpenSauce/Halo1/Halo1_CE/Game/Scripting.cpp index d923547a2..42d619a76 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Scripting.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Scripting.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "Game/Scripting.hpp" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Game/EngineFunctions.hpp" #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Game/Scripting.hpp b/OpenSauce/Halo1/Halo1_CE/Game/Scripting.hpp index d8d2c29b0..cc8857807 100644 --- a/OpenSauce/Halo1/Halo1_CE/Game/Scripting.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Game/Scripting.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.rc b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.rc index 2ce8e6ba3..a385e0467 100644 --- a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.rc +++ b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.rc @@ -1,7 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include "resource.h" -#include "../../shared/Include/YeloLib/Halo1/open_sauce/yelo_version.hpp" +#include "../../../source/YeloLib/open_sauce/yelo_version.hpp" #include #define APSTUDIO_READONLY_SYMBOLS diff --git a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj index 508a7e04a..cbf2c4a7a 100644 --- a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj +++ b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj @@ -81,283 +81,283 @@ - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4090;%(DisableSpecificWarnings) diff --git a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj.filters b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj.filters index 458f57193..134e55f0e 100644 --- a/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj.filters +++ b/OpenSauce/Halo1/Halo1_CE/Halo1_CE.vcxproj.filters @@ -160,274 +160,274 @@ {96b2b90b-f482-472d-9364-2c28e722c4f4} - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls\Layout - + Common\Shared\GWEN\Controls\Property - + Common\Shared\GWEN\Controls\Property - + Common\Shared\GWEN\Controls\Property - + Common\Shared\GWEN\Controls\Property - + Common\Shared\GWEN\Controls\Property - + Common\Shared\GWEN\Skins - + Common\Shared\GWEN\Skins @@ -460,7 +460,7 @@ Interface\OpenSauceUI\Input - + Common\Shared\GWEN\Controls @@ -910,193 +910,193 @@ Settings - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Controls - + Common\Shared\GWEN\Platforms @@ -1123,7 +1123,7 @@ Interface\OpenSauceUI\Definitions - + Common\Shared\GWEN\Controls @@ -1236,196 +1236,196 @@ - + Common\Shared\mongoose - + Common\Shared\mongoose - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/ControlTypes.hpp b/OpenSauce/Halo1/Halo1_CE/Interface/ControlTypes.hpp index 8117474f0..396df5bab 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/ControlTypes.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/ControlTypes.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/GameUI.cpp b/OpenSauce/Halo1/Halo1_CE/Interface/GameUI.cpp index 6147d1b55..f0007c4d6 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/GameUI.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/GameUI.cpp @@ -8,22 +8,22 @@ #include "Interface/GameUI.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Settings/Settings.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/GameUI_Hud.inl b/OpenSauce/Halo1/Halo1_CE/Interface/GameUI_Hud.inl index 25a4fb598..90ec11be7 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/GameUI_Hud.inl +++ b/OpenSauce/Halo1/Halo1_CE/Interface/GameUI_Hud.inl @@ -8,8 +8,8 @@ #include "Game/EngineFunctions.hpp" #include "Memory/FunctionInterface.hpp" -#include -#include +#include +#include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI.cpp b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI.cpp index 0ec96687b..bfe180cd2 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI.cpp @@ -10,11 +10,11 @@ #if !PLATFORM_IS_DEDI #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Game/GameState.hpp" #include "Common/FileIO.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Control/i_canvas.hpp b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Control/i_canvas.hpp index 8f4593633..d5380c092 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Control/i_canvas.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Control/i_canvas.hpp @@ -8,7 +8,7 @@ #if !PLATFORM_IS_DEDI -#include +#include #include "Interface/OpenSauceUI/Input/i_control_input.hpp" #include "Interface/OpenSauceUI/Control/i_control.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Screen/c_screen_definition_reader.hpp b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Screen/c_screen_definition_reader.hpp index e07e0e564..16b463eaf 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Screen/c_screen_definition_reader.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/OpenSauceUI/Screen/c_screen_definition_reader.hpp @@ -8,7 +8,7 @@ #if !PLATFORM_IS_DEDI -#include +#include #include "Interface/OpenSauceUI/Definitions/c_screen_definition.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.cpp b/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.cpp index cfa1da37d..b14a21d1f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.cpp @@ -9,9 +9,9 @@ #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.hpp b/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.hpp index 8145de5b0..04a264d55 100644 --- a/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Interface/UIWidgets.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/BanManager.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/BanManager.cpp index 51284d176..eee1c608f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/BanManager.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/BanManager.cpp @@ -8,9 +8,9 @@ #include "Networking/HTTP/BanManager.hpp" #if PLATFORM_IS_DEDI -#include +#include #include -#include +#include #include "Common/FileIO.hpp" #include "Networking/HTTP/HTTP.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/HTTPServer.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/HTTPServer.cpp index 853ea2b43..6317ed038 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/HTTPServer.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/HTTPServer.cpp @@ -10,8 +10,8 @@ #if PLATFORM_IS_DEDI #include -#include -#include +#include +#include #include "Settings/Settings.hpp" #include "Common/FileIO.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadClient.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadClient.cpp index 3e8bd8e44..938491630 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadClient.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadClient.cpp @@ -8,15 +8,15 @@ #include "Networking/HTTP/MapDownloadClient.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include #include #include #include -#include +#include #include #include "Common/FileIO.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadServer.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadServer.cpp index 6dc2d6366..6b6cefaf2 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadServer.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/HTTP/MapDownloadServer.cpp @@ -9,10 +9,10 @@ #if PLATFORM_IS_DEDI #include -#include -#include +#include +#include #include -#include +#include #include #include "Common/FileIO.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltaDefinitions.hpp b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltaDefinitions.hpp index 83eeaa8e7..66e751360 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltaDefinitions.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltaDefinitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.cpp index bd861ab5b..0544ae0e2 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "Networking/MessageDeltas.hpp" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Game/EngineFunctions.hpp" #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.hpp b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.hpp index 74765d34a..7806580a4 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/MessageDeltas.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include "Networking/Networking.hpp" #include "Networking/MessageDeltaDefinitions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/Networking.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/Networking.cpp index 85936c250..16ab872ea 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/Networking.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/Networking.cpp @@ -7,19 +7,19 @@ #include "Common/Precompile.hpp" #include "Networking/Networking.hpp" -#include // for Enums::transport_rejection_code -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // for Enums::transport_rejection_code +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Networking/GameSpyApi.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/Networking.hpp b/OpenSauce/Halo1/Halo1_CE/Networking/Networking.hpp index 7df304fa6..e5a54f286 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/Networking.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/Networking.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/Server.hpp b/OpenSauce/Halo1/Halo1_CE/Networking/Server.hpp index 158b60560..e341f265c 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/Server.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/Server.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheck.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheck.cpp index 0d7c91268..c464bb6ea 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheck.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheck.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckClient.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckClient.cpp index 5cd4341eb..126022a98 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckClient.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckClient.cpp @@ -8,7 +8,7 @@ #include "Networking/VersionCheckClient.hpp" #if PLATFORM_IS_USER && defined(YELO_VERSION_CHECK_ENABLE) -#include +#include #include "Networking/HTTP/HTTPClient.hpp" #include "Game/GameState.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckDedi.cpp b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckDedi.cpp index 65b0e2c33..54c1ff50f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckDedi.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Networking/VersionCheckDedi.cpp @@ -8,7 +8,7 @@ #include "Networking/VersionCheckDedi.hpp" #if PLATFORM_IS_DEDI && defined(YELO_VERSION_CHECK_ENABLE) -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Equipment.cpp b/OpenSauce/Halo1/Halo1_CE/Objects/Equipment.cpp index f6ac2b619..1c502a35c 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Equipment.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Equipment.cpp @@ -7,8 +7,8 @@ #include "Common/Precompile.hpp" #include "Objects/Equipment.hpp" -#include -#include +#include +#include #include "Objects/Objects.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/ObjectFieldDefinitions.cpp b/OpenSauce/Halo1/Halo1_CE/Objects/ObjectFieldDefinitions.cpp index 1e080b257..b002233de 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/ObjectFieldDefinitions.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Objects/ObjectFieldDefinitions.cpp @@ -7,9 +7,9 @@ #include "Common/Precompile.hpp" #include "Objects/ObjectFieldDefinitions.hpp" -#include -#include -#include +#include +#include +#include #include "Game/EngineFunctions.hpp" #include "Game/Scripting.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Damage.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Damage.inl index 1862de987..511d98977 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Damage.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Damage.inl @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Scripting.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Scripting.inl index 7be80ecf3..d61b0d69b 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Scripting.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.Scripting.inl @@ -9,7 +9,7 @@ #include "Objects/Objects.hpp" #include -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.WeaponSettings.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.WeaponSettings.inl index a8eec3907..36d78ada6 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.WeaponSettings.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.WeaponSettings.inl @@ -4,8 +4,8 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include +#include +#include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.hpp b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.hpp index a854f04e1..a2ecbe942 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Objects.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Objects.hpp @@ -6,15 +6,15 @@ */ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/ObjectsYelo.cpp b/OpenSauce/Halo1/Halo1_CE/Objects/ObjectsYelo.cpp index 0a5bd5cfa..6d0c85f89 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/ObjectsYelo.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Objects/ObjectsYelo.cpp @@ -7,28 +7,28 @@ #include "Common/Precompile.hpp" #include "Objects/Objects.hpp" -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include #include #include -#include +#include #include "Objects/ObjectFieldDefinitions.hpp" #include "Objects/Equipment.hpp" @@ -80,7 +80,7 @@ namespace Yelo }; }; -#include +#include #include "Objects/Objects.Damage.inl" #include "Objects/Objects.Scripting.inl" @@ -117,7 +117,7 @@ namespace Yelo cluster_noncollideable_object_reference_data_t& ClusterNoncollideableObjectReference() DPTR_IMP_GET_BYREF(cluster_noncollideable_object_reference); noncollideable_object_cluster_reference_data_t& NoncollideableObjectClusterReference() DPTR_IMP_GET_BYREF(noncollideable_object_cluster_reference); -#include +#include static void InitializeScripting() { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Units.Animations.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Units.Animations.inl index 626637c96..aa187d873 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Units.Animations.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Units.Animations.inl @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include -#include +#include #include "Memory/MemoryInterface.hpp" #include "Objects/Units.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Units.GrenadeCounts.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Units.GrenadeCounts.inl index d1856a609..022551647 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Units.GrenadeCounts.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Units.GrenadeCounts.inl @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include #include "Memory/MemoryInterface.hpp" #include "Networking/MDP.hpp" @@ -14,7 +14,7 @@ namespace Yelo { namespace Objects { namespace Units { // DEBUG: Before each memory write when we're enabling, we assert we're overwriting the expected value or bytes -#include +#include static void InitializeGrenadeCounts_UnitGrenadeCounts(bool enabled) { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatBoarding.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatBoarding.inl index f2787178b..ca592d98b 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatBoarding.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatBoarding.inl @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatDamage.inl b/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatDamage.inl index 86243a59b..6891a0480 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatDamage.inl +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Units.SeatDamage.inl @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Objects/Units.cpp b/OpenSauce/Halo1/Halo1_CE/Objects/Units.cpp index d4fd93099..938e6d0e7 100644 --- a/OpenSauce/Halo1/Halo1_CE/Objects/Units.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Objects/Units.cpp @@ -7,20 +7,20 @@ #include "Common/Precompile.hpp" #include "Objects/Units.hpp" -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include #include "Game/Camera.hpp" #include "Game/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.cpp index 5006f50e3..0f7267c53 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.cpp @@ -8,15 +8,15 @@ #include "Rasterizer/GBuffer.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include "Settings/Settings.hpp" #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.hpp index 1899b9888..205699170 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/GBuffer.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/Rasterizer.hpp" #include "Rasterizer/DX9/DX9.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Lightmaps.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Lightmaps.cpp index 2520a4530..54069b1bb 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Lightmaps.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Lightmaps.cpp @@ -9,8 +9,8 @@ #if !PLATFORM_IS_DEDI -#include -#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.cpp index 509e1c316..959b7addb 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.hpp" #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.hpp index a3ebd7518..38bc0bfc1 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_shader_instance_bloom.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/c_effect_postprocess.hpp" #include "Rasterizer/PostProcessing/Bloom/s_shader_bloom_definition.hpp" #include "Rasterizer/PostProcessing/Bloom/c_shader_bloom.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_system_bloom.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_system_bloom.hpp index bd070d3e8..a2f0025ef 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_system_bloom.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/c_system_bloom.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingCacheComponent.hpp" #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingUpdatable.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/s_shader_bloom_definition.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/s_shader_bloom_definition.hpp index 18917e14d..6a121244e 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/s_shader_bloom_definition.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Bloom/s_shader_bloom_definition.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/FXAA/c_system_fxaa.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/FXAA/c_system_fxaa.hpp index 36075bbe9..7d1d0e631 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/FXAA/c_system_fxaa.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/FXAA/c_system_fxaa.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingComponent.hpp" #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingRenderable.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/c_system_fade.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/c_system_fade.hpp index 478c5d798..4f717a6c3 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/c_system_fade.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/c_system_fade.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingCacheComponent.hpp" #include "Rasterizer/PostProcessing/PostProcessing.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/s_shader_fade_definition.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/s_shader_fade_definition.hpp index 5d3f2c453..6f15c0bcb 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/s_shader_fade_definition.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Fade/s_shader_fade_definition.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_effect_external.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_effect_external.hpp index 8ea32fc62..ff7797046 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_effect_external.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_effect_external.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Generic/c_effect_generic.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_system_external.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_system_external.cpp index fdd488994..5e1422af4 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_system_external.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/c_system_external.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/Generic/External/c_system_external.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Generic/External/c_settings_external.hpp" #include "Rasterizer/PostProcessing/PostProcessingErrorReporting.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/s_effect_postprocess_external.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/s_effect_postprocess_external.hpp index 69ce59a5f..c873303da 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/s_effect_postprocess_external.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/External/s_effect_postprocess_external.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/Internal/c_effect_internal.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/Internal/c_effect_internal.hpp index 2a464cdbd..9080b9e00 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/Internal/c_effect_internal.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/Internal/c_effect_internal.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/Generic/c_effect_generic.hpp" #include "Rasterizer/PostProcessing/Generic/Internal/c_shader_internal.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_effect_generic.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_effect_generic.hpp index 6c660e74b..26a21eb38 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_effect_generic.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_effect_generic.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/c_effect_postprocess.hpp" #include "Rasterizer/PostProcessing/Generic/c_shader_generic.hpp" #include "Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.cpp index b06c2c80a..b10b2ac34 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.cpp @@ -9,9 +9,9 @@ #include "Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include "Rasterizer/PostProcessing/Interpolation/c_interp_function_pp_anim.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp index 1f4606ec0..d5f4d4e25 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Generic/c_parameter_instance.hpp @@ -7,8 +7,8 @@ #pragma once #if !PLATFORM_IS_DEDI -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Interpolation/c_interp_function_pp_anim.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Interpolation/c_interp_function_pp_anim.hpp index dce98a2ec..2c4310adc 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Interpolation/c_interp_function_pp_anim.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/Interpolation/c_interp_function_pp_anim.hpp @@ -6,11 +6,11 @@ */ #pragma once -#include +#include #include "Rasterizer/Rasterizer.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.cpp index 8f764d9cd..de5dce342 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/c_post_processing_main.hpp" namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.hpp index 7677e6fc0..24de577bc 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/c_shader_instance_motionblur.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/c_effect_postprocess.hpp" #include "Rasterizer/PostProcessing/MotionBlur/c_shader_motionblur.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/s_shader_motionblur_definition.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/s_shader_motionblur_definition.hpp index 14675270d..e53887cce 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/s_shader_motionblur_definition.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/MotionBlur/s_shader_motionblur_definition.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.cpp index 123e199c7..35e8e7753 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/PostProcessing.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Settings/Settings.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.hpp index a582fa054..ec4b34291 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessing.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include //#define EXTERNAL_SUBSYSTEM_SHADERS diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessingErrorReporting.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessingErrorReporting.cpp index ed817336c..63ccf1bcd 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessingErrorReporting.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/PostProcessingErrorReporting.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/PostProcessingErrorReporting.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Settings/Settings.hpp" #include "Game/GameState.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_external.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_external.cpp index be59d82f5..8c1d1610c 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_external.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_external.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_external.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_base.hpp" namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.cpp index 0e262acc8..7392de93d 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_base.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.hpp index d028e1348..ce560b1ae 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/ShaderSources/c_shader_data_postprocess_definition.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_base.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_instance.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_instance.cpp index 1be71fd9f..b8c785d92 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_instance.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_instance.cpp @@ -7,8 +7,8 @@ #include "Common/Precompile.hpp" #include "Rasterizer/PostProcessing/c_effect_instance.hpp" -#include -#include +#include +#include #if !PLATFORM_IS_DEDI diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.cpp index de249e4c3..4aca55bdd 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/c_effect_postprocess.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/c_post_processing_main.hpp" #include "Rasterizer/PostProcessing/Fade/c_system_fade.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.hpp index cdb13c8e5..f84310f9d 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_effect_postprocess.hpp @@ -8,13 +8,13 @@ #if !PLATFORM_IS_DEDI #include -#include +#include #include "Rasterizer/PostProcessing/PostProcessing.hpp" #include "Rasterizer/PostProcessing/c_shader_postprocess.hpp" #include "Rasterizer/PostProcessing/c_shader_instance.hpp" #include "Rasterizer/PostProcessing/c_quad_manager.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.cpp index b6e0da2aa..7f4b97b77 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/c_post_processing_main.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Settings/Settings.hpp" #include "Interface/GameUI.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.hpp index 80e9640b0..f4fafd583 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_post_processing_main.hpp @@ -7,8 +7,8 @@ #pragma once #if !PLATFORM_IS_DEDI -#include -#include +#include +#include #include "Rasterizer/PostProcessing/PostProcessing.hpp" #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingCacheComponent.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_quad_manager.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_quad_manager.hpp index 9f4831502..cb737585f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_quad_manager.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_quad_manager.hpp @@ -8,7 +8,7 @@ #if !PLATFORM_IS_DEDI #include -#include +#include #include "Rasterizer/PostProcessing/Interfaces/IPostProcessingCacheComponent.hpp" #include "Rasterizer/PostProcessing/PostProcessing.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.cpp index 302b34c43..6bc3199d4 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/PostProcessing/c_shader_postprocess.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/PostProcessing.hpp" #include "Rasterizer/PostProcessing/PostProcessingErrorReporting.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.hpp index d5e794ecd..f9eed951a 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/PostProcessing/c_shader_postprocess.hpp @@ -7,7 +7,7 @@ #pragma once #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/PostProcessing/PostProcessing.hpp" #include "Rasterizer/PostProcessing/ShaderSources/c_shader_data_base.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.cpp index 9bf0a0ef8..5b1a2a976 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.cpp @@ -8,9 +8,9 @@ #include "Rasterizer/Rasterizer.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Game/ScriptLibrary.hpp" @@ -29,7 +29,7 @@ namespace Yelo namespace Rasterizer { -#include +#include s_rasterizer_config* RasterizerConfig() PTR_IMP_GET2(rasterizer_config); s_rasterizer_globals* RasterizerGlobals() PTR_IMP_GET2(rasterizer_globals); diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.hpp index 147d09e97..43a15389f 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Rasterizer.hpp @@ -8,7 +8,7 @@ #if !PLATFORM_IS_DEDI -#include +#include #include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderDraw.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderDraw.cpp index aaf8802f5..3f4b6e3fc 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderDraw.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderDraw.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/ShaderDraw.hpp" #if !PLATFORM_IS_DEDI -#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.cpp index 46e816735..01e5664ab 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.cpp @@ -11,11 +11,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.hpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.hpp index ef2d6eeec..58c582224 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/ShaderExtension/ShaderExtension.hpp @@ -21,7 +21,7 @@ #if !PLATFORM_IS_DEDI -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Sky.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Sky.cpp index 03bf12a25..3c2ac8eed 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Sky.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Sky.cpp @@ -9,9 +9,9 @@ #if !PLATFORM_IS_DEDI -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Textures/c_packed_texture_loader.cpp b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Textures/c_packed_texture_loader.cpp index fedd50c41..950862232 100644 --- a/OpenSauce/Halo1/Halo1_CE/Rasterizer/Textures/c_packed_texture_loader.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Rasterizer/Textures/c_packed_texture_loader.cpp @@ -9,7 +9,7 @@ #if !PLATFORM_IS_DEDI -#include +#include #include "Rasterizer/DX9/DX9.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.cpp b/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.cpp index 349d3f121..c34854b71 100644 --- a/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.cpp @@ -7,9 +7,9 @@ #include "Common/Precompile.hpp" #include "Scenario/Scenario.hpp" -#include -#include -#include +#include +#include +#include // There are places which use a bit-vector for the structure-bsps // In the stock code, the bit-vector is a 16-bit word // We can only, reasonably, upgrade the code to a 32-bit word diff --git a/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.hpp b/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.hpp index 564b16623..e4fa5a52a 100644 --- a/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Scenario/Scenario.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Scenario/StructureBSP.cpp b/OpenSauce/Halo1/Halo1_CE/Scenario/StructureBSP.cpp index 09b7ff587..4c76c67b1 100644 --- a/OpenSauce/Halo1/Halo1_CE/Scenario/StructureBSP.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Scenario/StructureBSP.cpp @@ -8,11 +8,11 @@ #include "Scenario/StructureBSP.hpp" #if !PLATFORM_IS_DEDI -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Common/GameSystemDefinitions.hpp" #include "Game/ScriptLibrary.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/Settings/Settings.cpp b/OpenSauce/Halo1/Halo1_CE/Settings/Settings.cpp index 2635294f1..3358c27cf 100644 --- a/OpenSauce/Halo1/Halo1_CE/Settings/Settings.cpp +++ b/OpenSauce/Halo1/Halo1_CE/Settings/Settings.cpp @@ -7,8 +7,8 @@ #include "Common/Precompile.hpp" #include "Settings/Settings.hpp" -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/Settings/Settings.hpp b/OpenSauce/Halo1/Halo1_CE/Settings/Settings.hpp index 93d747de2..a073289a3 100644 --- a/OpenSauce/Halo1/Halo1_CE/Settings/Settings.hpp +++ b/OpenSauce/Halo1/Halo1_CE/Settings/Settings.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.DataFiles.inl b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.DataFiles.inl index c20fb6fef..55f376921 100644 --- a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.DataFiles.inl +++ b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.DataFiles.inl @@ -5,7 +5,7 @@ See license\OpenSauce\OpenSauce for specific license information */ -#include +#include namespace Yelo { namespace DataFiles { diff --git a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.cpp b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.cpp index 26ac76dd4..e6d3f96a5 100644 --- a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.cpp +++ b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.cpp @@ -7,14 +7,14 @@ #include "Common/Precompile.hpp" #include "TagGroups/CacheFiles.hpp" -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include + +#include +#include +#include #include "Memory/MemoryInterface.hpp" #include "Common/FileIO.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.hpp b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.hpp index ac057bcfb..c2de1ec17 100644 --- a/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.hpp +++ b/OpenSauce/Halo1/Halo1_CE/TagGroups/CacheFiles.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include +#include +#include -#include +#include #include #include diff --git a/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.cpp b/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.cpp index e63414c66..f395dd91b 100644 --- a/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.cpp +++ b/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "TagGroups/TagGroups.hpp" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.hpp b/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.hpp index efb637a81..66d216216 100644 --- a/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.hpp +++ b/OpenSauce/Halo1/Halo1_CE/TagGroups/TagGroups.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Common/DebugDump.cpp b/OpenSauce/Halo1/Halo1_CheApe/Common/DebugDump.cpp index cd97414c6..645fcddd9 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Common/DebugDump.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Common/DebugDump.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include "Settings/Settings.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Common/Precompile.hpp b/OpenSauce/Halo1/Halo1_CheApe/Common/Precompile.hpp index f67c5c045..bd8ef6756 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Common/Precompile.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Common/Precompile.hpp @@ -81,10 +81,10 @@ #define PLATFORM_NO_DX9 #endif -#include +#include #include #include -#include +#include #include diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.Transform.inl b/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.Transform.inl index 208dfecfa..d6aa6d869 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.Transform.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.Transform.inl @@ -5,22 +5,22 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include +#include -#include -#include +#include +#include #endif namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.cpp index 9b207d2f2..b434d4993 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/AI.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "Engine/AI.hpp" -#include -#include +#include +#include #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include +#include #endif #include "Engine/AI.Transform.inl" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/AnimationUpgrade.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/AnimationUpgrade.cpp index 0106cf5e6..ec4162985 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/AnimationUpgrade.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/AnimationUpgrade.cpp @@ -9,8 +9,8 @@ #include "TagGroups/TagGroups.hpp" -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.cpp index f92333b7b..720340025 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.cpp @@ -7,26 +7,26 @@ #include "Common/Precompile.hpp" #include "Engine/EngineFunctions.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include "Engine/Objects.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.hpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.hpp index 2bc2db865..7f6031fd1 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/EngineFunctions.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/GameState.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/GameState.cpp index 1675c6a5f..c032228f4 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/GameState.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/GameState.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "Engine/GameState.hpp" -#include -#include +#include +#include #include -#include +#include #include "Engine/Objects.hpp" #include "Engine/Units.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/GrenadeTypesUpgrade.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/GrenadeTypesUpgrade.cpp index 1fa5beb7e..8af88408d 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/GrenadeTypesUpgrade.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/GrenadeTypesUpgrade.cpp @@ -7,12 +7,12 @@ #include "Common/Precompile.hpp" #include "Engine/GrenadeTypesUpgrade.hpp" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "Engine/EngineFunctions.hpp" #include "TagGroups/TagGroups.hpp" @@ -25,7 +25,7 @@ namespace Yelo #define __EL_INCLUDE_FILE_ID __EL_OBJECTS_GRENADE_TYPES_UPGRADE #include "Memory/_EngineLayout.inl" #if PLATFORM_TYPE == PLATFORM_SAPIEN - #include + #include #endif }; diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.cpp index 500e58174..2b61f9bd0 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.cpp @@ -9,11 +9,11 @@ #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include -#include -#include +#include +#include +#include -#include +#include #include "Engine/Units.hpp" #include "Engine/AI.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.hpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.hpp index 12404aeed..2edcbc491 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Objects.hpp @@ -8,7 +8,7 @@ #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.cpp index 83e7998b4..d2b26c240 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.cpp @@ -7,9 +7,9 @@ #include "Common/Precompile.hpp" #include "Engine/Scripting.hpp" -#include -#include -#include +#include +#include +#include #include "CheApeCore.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.hpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.hpp index 506f32467..efdec75ee 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Scripting.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.Animations.inl b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.Animations.inl index be3deeb18..7a80863cf 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.Animations.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.Animations.inl @@ -7,7 +7,7 @@ #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatBoarding.inl b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatBoarding.inl index 61466a919..890587bb6 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatBoarding.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatBoarding.inl @@ -5,11 +5,11 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatDamage.inl b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatDamage.inl index 86243a59b..6891a0480 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatDamage.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.SeatDamage.inl @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.cpp b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.cpp index 43d2c9a30..41d936ae3 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Engine/Units.cpp @@ -9,10 +9,10 @@ #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include -#include -#include -#include +#include +#include +#include +#include #include "Engine/GrenadeTypesUpgrade.hpp" #include "Engine/AI.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.cpp b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.cpp index 040d368b6..491ea5c6b 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.cpp @@ -8,7 +8,7 @@ #include "Guerilla/field_dialog_extensions.hpp" #if PLATFORM_TYPE == PLATFORM_GUERILLA -#include +#include #include "Guerilla/string_dialog_extensions.hpp" #include "Guerilla/tag_reference_dialog_extensions.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.hpp b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.hpp index 24327891c..5d7d3733b 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/field_dialog_extensions.hpp @@ -6,7 +6,7 @@ */ #pragma once #if PLATFORM_TYPE == PLATFORM_GUERILLA -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/guerilla_application_extensions.hpp b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/guerilla_application_extensions.hpp index ad019faa9..474bb16c6 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/guerilla_application_extensions.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/guerilla_application_extensions.hpp @@ -6,7 +6,7 @@ */ #pragma once #if PLATFORM_TYPE == PLATFORM_GUERILLA -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/string_dialog_extensions.cpp b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/string_dialog_extensions.cpp index 28f9b04af..6a3972697 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/string_dialog_extensions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/string_dialog_extensions.cpp @@ -8,7 +8,7 @@ #include "Guerilla/string_dialog_extensions.hpp" #if PLATFORM_TYPE == PLATFORM_GUERILLA -#include +#include #include "Guerilla/tag_reference_dialog_extensions.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/tag_reference_dialog_extensions.cpp b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/tag_reference_dialog_extensions.cpp index 3be4f17c0..d0df935e8 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Guerilla/tag_reference_dialog_extensions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Guerilla/tag_reference_dialog_extensions.cpp @@ -8,8 +8,8 @@ #include "Guerilla/tag_reference_dialog_extensions.hpp" #if PLATFORM_TYPE == PLATFORM_GUERILLA -#include -#include +#include +#include #include "TagGroups/TagGroups.hpp" namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.cpp b/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.cpp index 4e8de7423..041a8e85e 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.cpp @@ -8,7 +8,7 @@ #include "Rasterizer/Rasterizer.hpp" #ifndef PLATFORM_NO_DX9 -#include +#include #include "Settings/Settings.hpp" @@ -21,7 +21,7 @@ namespace Yelo namespace Render { #if PLATFORM_TYPE == PLATFORM_SAPIEN - #include + #include s_render_globals* RenderGlobals() PTR_IMP_GET2(render_globals); #endif @@ -30,7 +30,7 @@ namespace Yelo namespace Rasterizer { #if PLATFORM_TYPE == PLATFORM_SAPIEN - #include + #include s_rasterizer_config* RasterizerConfig() PTR_IMP_GET2(rasterizer_config); s_rasterizer_globals* RasterizerGlobals() PTR_IMP_GET2(rasterizer_globals); diff --git a/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.hpp b/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.hpp index 4e294fe2c..e184e6b1a 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Rasterizer/Rasterizer.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.cpp b/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.cpp index 4aa4b8dbb..78d31a35b 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.cpp @@ -7,15 +7,15 @@ #include "Common/Precompile.hpp" #include "Settings/Settings.hpp" -#include -#include +#include +#include #include #include "Engine/EngineFunctions.hpp" #include "Rasterizer/Rasterizer.hpp" -#include +#include #include "Settings/SettingsSapien.hpp" #include "Settings/SettingsTool.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.hpp b/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.hpp index 0ccb9b1fb..3a46c95bc 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Settings/Settings.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Bitmap.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Bitmap.hpp index 8172f18f0..1ec3e1b95 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Bitmap.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Bitmap.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/DamageEffect.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/DamageEffect.hpp index ef6e369b2..b7edb928b 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/DamageEffect.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/DamageEffect.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/GBXModel.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/GBXModel.hpp index 6c043c3a4..e59ab12c1 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/GBXModel.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/GBXModel.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Object.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Object.hpp index b9bb8542d..f9761ec9f 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Object.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Object.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Scenario.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Scenario.hpp index f25d60412..fde5d939e 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Scenario.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Scenario.hpp @@ -6,12 +6,12 @@ */ #pragma once -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shader.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shader.hpp index 9de334e14..2351b8d35 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shader.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shader.hpp @@ -6,13 +6,13 @@ */ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shared.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shared.hpp index 3327e6910..ccf926374 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shared.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Shared.hpp @@ -6,14 +6,14 @@ */ #pragma once -#include -#include - -#include -#include -#include -#include -#include +#include +#include + +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Sound.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Sound.hpp index 127b559df..848957718 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Sound.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Sound.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Unit.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Unit.hpp index 447d422b5..8e70576fa 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Unit.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldReplacements/Unit.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldSetReplacements.cpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldSetReplacements.cpp index 94b90c08c..fca3fd822 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldSetReplacements.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagFieldSetReplacements.cpp @@ -7,7 +7,7 @@ #include "Common/Precompile.hpp" #include "TagGroups/TagGroups.hpp" -#include +#include #include "TagGroups/TagFieldReplacements/Shared.hpp" #include "TagGroups/TagFieldReplacements/Object.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.cpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.cpp index 720df24b4..ca9cfd966 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.cpp @@ -7,12 +7,12 @@ #include "Common/Precompile.hpp" #include "TagGroups/TagGroups.hpp" -#include -#include -#include -#include -#include // need structs in order to do pointer math on TagFileGlobals -#include +#include +#include +#include +#include +#include // need structs in order to do pointer math on TagFileGlobals +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.hpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.hpp index e52d29d18..aabf8b97c 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/TagGroups.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include +#include #if PLATFORM_TYPE != PLATFORM_TOOL -#include +#include #endif namespace Yelo diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_definitions.cpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_definitions.cpp index 099781f4b..b64924067 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_definitions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_definitions.cpp @@ -7,13 +7,13 @@ #include "Common/Precompile.hpp" #include "TagGroups/yelo_definitions.hpp" -#include -#include -#include +#include +#include +#include -#include -#include -#include +#include +#include +#include #include "Engine/EngineFunctions.hpp" #include "Engine/GrenadeTypesUpgrade.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_scenario_definitions.cpp b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_scenario_definitions.cpp index 07dd7d961..4232ccc25 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_scenario_definitions.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/TagGroups/yelo_scenario_definitions.cpp @@ -7,11 +7,11 @@ #include "Common/Precompile.hpp" #include "TagGroups/yelo_scenario_definitions.hpp" -#include +#include -#include -#include -#include +#include +#include +#include #include "Engine/AI.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile.cpp index cf357c604..8f1cac581 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile.cpp @@ -7,15 +7,15 @@ #include "Common/Precompile.hpp" #include "Tool/BuildCacheFile.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileEx.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileEx.cpp index ae888c33b..d1989e30a 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileEx.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileEx.cpp @@ -10,8 +10,8 @@ #include "Tool/BuildCacheFile.hpp" -#include -#include +#include +#include #include #include "Tool/BuildCacheFile/BuildCacheFileGlobals.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.cpp index e283de22f..3937e7ba2 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.cpp @@ -8,9 +8,9 @@ #include "Tool/BuildCacheFile/BuildCacheFileGlobals.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include +#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.hpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.hpp index 89ad7ec40..445d8c4a6 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileGlobals.hpp @@ -6,8 +6,8 @@ */ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileMemoryUpgrades.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileMemoryUpgrades.cpp index 2eb92c76e..e3fe739d2 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileMemoryUpgrades.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/BuildCacheFileMemoryUpgrades.cpp @@ -8,9 +8,9 @@ #include "Tool/BuildCacheFile/BuildCacheFileMemoryUpgrades.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include +#include +#include +#include #include "Engine/Scripting.hpp" #include "TagGroups/yelo_scenario_definitions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/CullTags.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/CullTags.inl index 56ed1d5d9..a8023ce29 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/CullTags.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/CullTags.inl @@ -5,8 +5,8 @@ See license\OpenSauce\Halo1_CheApe for specific license information */ -#include -#include +#include +#include #include "Memory/MemoryInterface.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/PredictedResources.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/PredictedResources.inl index 005c7bc01..3671f9913 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/PredictedResources.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/PredictedResources.inl @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CheApe for specific license information */ -#include -#include -#include +#include +#include +#include namespace Yelo { namespace Tool { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess.inl index eb6a54476..3c212730e 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess.inl @@ -5,13 +5,13 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "Tool/BuildCacheFile/TagPreprocess_PostProcessing.inl" #include "Tool/BuildCacheFile/TagPreprocess_ShaderExtension.inl" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_PostProcessing.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_PostProcessing.inl index 87493eda5..38bb692a1 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_PostProcessing.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_PostProcessing.inl @@ -5,8 +5,8 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include +#include +#include namespace Yelo { namespace Tool { namespace BuildCacheFileEx { namespace TagPreprocess { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_Scenario.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_Scenario.inl index 049b3286d..434b7344a 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_Scenario.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_Scenario.inl @@ -5,8 +5,8 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include +#include +#include namespace Yelo { namespace Tool { namespace BuildCacheFileEx { namespace TagPreprocess { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_ShaderExtension.inl b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_ShaderExtension.inl index 6d133663e..4aed27788 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_ShaderExtension.inl +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/BuildCacheFile/TagPreprocess_ShaderExtension.inl @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CheApe for specific license information */ -#include -#include -#include +#include +#include +#include namespace Yelo { namespace Tool { namespace BuildCacheFileEx { namespace TagPreprocess { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/ImportLightmapUV.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/ImportLightmapUV.cpp index 260872f4f..45beac308 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/ImportLightmapUV.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/ImportLightmapUV.cpp @@ -8,8 +8,8 @@ #include "Tool/ImportLightmapUV.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include +#include +#include #include "Engine/EngineFunctions.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/BuildPackedFiles.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/BuildPackedFiles.cpp index f221a42d4..05171a4b0 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/BuildPackedFiles.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/BuildPackedFiles.cpp @@ -8,7 +8,7 @@ #include "Tool/PackedFile/BuildPackedFiles.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include #include "Tool/PackedFile/Definition/c_packed_file_definition.hpp" #include "Tool/PackedFile/Processing/i_packed_file_processor.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_archive.hpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_archive.hpp index 2a3613316..78942e717 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_archive.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_archive.hpp @@ -7,7 +7,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include #include "Tool/PackedFile/Processing/i_packed_file_processor.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_shader.hpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_shader.hpp index 7e7823813..81e9bbb9f 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_shader.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_shader.hpp @@ -7,7 +7,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include #include "Tool/PackedFile/Processing/i_packed_file_processor.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_texture.hpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_texture.hpp index 37912bda3..f7cb9f007 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_texture.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/c_packed_file_processor_texture.hpp @@ -7,7 +7,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include #include "Tool/PackedFile/Processing/i_packed_file_processor.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/i_packed_file_processor.hpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/i_packed_file_processor.hpp index 91d09982f..d8430f727 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/i_packed_file_processor.hpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/PackedFile/Processing/i_packed_file_processor.hpp @@ -7,7 +7,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/RemoveOSTagData.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/RemoveOSTagData.cpp index f31e762e1..63ed87f80 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/RemoveOSTagData.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/RemoveOSTagData.cpp @@ -9,25 +9,25 @@ #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include "Tool/Console.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/RuntimeCacheView.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/RuntimeCacheView.cpp index 6788481f0..fd8cb3ef2 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/RuntimeCacheView.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/RuntimeCacheView.cpp @@ -10,7 +10,7 @@ #if PLATFORM_TYPE == PLATFORM_TOOL #include -#include +#include #include "Common/StringEditing.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/Shader/Compiler/Collection/c_collection_writer.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/Shader/Compiler/Collection/c_collection_writer.cpp index e2407fd9c..ba6f7f439 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/Shader/Compiler/Collection/c_collection_writer.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/Shader/Compiler/Collection/c_collection_writer.cpp @@ -10,7 +10,7 @@ #if PLATFORM_TYPE == PLATFORM_TOOL #include #include -#include +#include using namespace boost::filesystem; using namespace Yelo::FileIO; diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/ShaderPostprocess.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/ShaderPostprocess.cpp index 245d5dbec..9aca048b2 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/ShaderPostprocess.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/ShaderPostprocess.cpp @@ -8,8 +8,8 @@ #include "Tool/ShaderPostprocess.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include +#include +#include #include "Settings/Settings.hpp" #include "Common/StringEditing.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/TagMaintenance.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/TagMaintenance.cpp index 0ce0c2ab8..084fa2e6d 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/TagMaintenance.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/TagMaintenance.cpp @@ -8,13 +8,13 @@ #include "Tool/TagMaintenance.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "Common/StringEditing.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/ToolMisc.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/ToolMisc.cpp index bb4576c07..308554cc6 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/ToolMisc.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/ToolMisc.cpp @@ -8,7 +8,7 @@ #if PLATFORM_TYPE == PLATFORM_TOOL #include "Tool/ToolMisc.hpp" -#include +#include #include "Engine/EngineFunctions.hpp" #include "TagGroups/TagGroups.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Tool/Tool_AnimationFixups.cpp b/OpenSauce/Halo1/Halo1_CheApe/Tool/Tool_AnimationFixups.cpp index 3f04bd996..7989e539f 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Tool/Tool_AnimationFixups.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Tool/Tool_AnimationFixups.cpp @@ -8,8 +8,8 @@ #include "Tool/Tool_AnimationFixups.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include +#include +#include #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Yelo/MemoryFixups.cpp b/OpenSauce/Halo1/Halo1_CheApe/Yelo/MemoryFixups.cpp index aad43574c..a993ca5e8 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Yelo/MemoryFixups.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Yelo/MemoryFixups.cpp @@ -7,10 +7,10 @@ #include "Common/Precompile.hpp" #include "Yelo/MemoryFixups.hpp" -#include -#include +#include +#include -#include +#include #include "Settings/Settings.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Yelo/Yelo.cpp b/OpenSauce/Halo1/Halo1_CheApe/Yelo/Yelo.cpp index 46f9f5185..96c4ef65f 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Yelo/Yelo.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Yelo/Yelo.cpp @@ -7,7 +7,7 @@ #include "Common/Precompile.hpp" #include "CheApeInterface.hpp" -#include +#include #include "Common/DebugDump.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloSapien.cpp b/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloSapien.cpp index 17d0f7217..e44ab9a01 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloSapien.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloSapien.cpp @@ -7,9 +7,9 @@ #include "Common/Precompile.hpp" #if PLATFORM_TYPE == PLATFORM_SAPIEN -#include -#include -#include +#include +#include +#include #include "CheApeInterface.hpp" // for Memory functions #include "Settings/Settings.hpp" @@ -33,7 +33,7 @@ namespace Yelo static const uintptr_t OBJECT_DAMAGE_AFTERMATH__UNIT_VALIDATE_INST_ACCEL_HOOK_RETURN_INVALID = 0x64A07E; }; }; -#include +#include namespace Yelo { diff --git a/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloTool.cpp b/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloTool.cpp index bbacd9e35..d15dcccb5 100644 --- a/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloTool.cpp +++ b/OpenSauce/Halo1/Halo1_CheApe/Yelo/YeloTool.cpp @@ -7,9 +7,9 @@ #include "Common/Precompile.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include -#include +#include #include "Settings/Settings.hpp" #include "Engine/EngineFunctions.hpp" diff --git a/OpenSauce/Halo1/Halo1_YeloLib/Common/Precompile.hpp b/OpenSauce/Halo1/Halo1_YeloLib/Common/Precompile.hpp index 62aff5fbc..a4d3e6ea6 100644 --- a/OpenSauce/Halo1/Halo1_YeloLib/Common/Precompile.hpp +++ b/OpenSauce/Halo1/Halo1_YeloLib/Common/Precompile.hpp @@ -94,10 +94,10 @@ #define API_NO_ZIP_CODEC #endif -#include +#include #include -#include +#include #include -#include -#include +#include +#include diff --git a/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj b/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj index a1665fd42..49d896e4e 100644 --- a/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj +++ b/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj @@ -84,413 +84,413 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Document - + Document - + Document - + Document - + Document - - + + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - + Document - - + + - - - - - - - - + + + + + + + + Designer - - - - - - - - - - + + + + + + + + + + diff --git a/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj.filters b/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj.filters index a89fd48d6..7826ee275 100644 --- a/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj.filters +++ b/OpenSauce/Halo1/Halo1_YeloLib/Halo1_YeloLib.vcxproj.filters @@ -144,442 +144,442 @@ .Common - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + cache - + cseries - + cseries - + cseries - + cseries - + cseries - + effects - + files - + files - + game - + game - + guerilla - + hs - + interface - + items - + items - + main - + memory - + memory - + memory - + memory - + memory - + memory - + memory - + memory\compression - + memory\compression - + memory\security - + models - + open_sauce - + open_sauce - + open_sauce - + open_sauce - + open_sauce\che_ape - + open_sauce\settings - + open_sauce\settings - + open_sauce\settings - + rasterizer - + render - + saved_games - + shaders - + shaders - + shaders - + shaders - + shaders - + shell - + shell - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + cseries - + .CrashRpt - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .TinyXml - + .TinyXml - + .zlib\contrib\minizip - + .zlib\contrib\minizip - + .zlib\contrib\minizip - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .Common - + cseries - + memory - + cache - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\type_containers - + configuration\type_containers - + configuration - + render\lightmaps - + render\sky - + cryptography - + cseries - + open_sauce\settings - + configuration\property_tree - + open_sauce\settings - + open_sauce\settings - + hs - + cseries - + units - + units - + open_sauce - + time\interpolation - + time\interpolation - + time\interpolation - + time\interpolation - + time\interpolation - + cseries - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\type_containers - + configuration\type_containers - + configuration\type_containers - + units - + objects - + ai - + units - + units - + ai - + cseries @@ -587,437 +587,437 @@ .Common - + cache - + cache - + cache - + cache - + cache - + cseries - + cseries - + cseries - + cseries - + cseries - + files - + files - + guerilla - + hs - + memory - + memory - + memory - + memory - + memory\compression - + memory\compression - + memory\security - + models - + open_sauce - + open_sauce - + open_sauce\che_ape - + open_sauce\settings - + open_sauce\settings - + shaders - + shell - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + tag_files - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .7zip - + .TinyXml - + .TinyXml - + .TinyXml - + .TinyXml - + .zlib\contrib\minizip - + .zlib\contrib\minizip - + .zlib\contrib\minizip - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + .zlib - + configuration - + configuration - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\type_containers - + render\lightmaps - + render\sky - + cryptography - + open_sauce\settings - + configuration\property_tree - + open_sauce\settings - + hs - + units - + open_sauce - + cseries - + configuration\property_tree - + configuration\property_tree - + configuration\property_tree - + configuration\type_containers - + configuration\type_containers - + configuration\type_containers - + objects - + ai - + units - + units - + ai - + cseries - + memory - + memory - + objects - + open_sauce\che_ape - + rasterizer - + render - + render - + shaders - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + tag_files\string_ids - + units - + shell - + .TinyXml - + .zlib\contrib\minizip - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE - + _Resources\OpenSauceIDE diff --git a/OpenSauce/shared/Include/CrashRpt/CrashRpt.h b/OpenSauce/shared/Include/CrashRpt/CrashRpt.h deleted file mode 100644 index 7d64b9c04..000000000 --- a/OpenSauce/shared/Include/CrashRpt/CrashRpt.h +++ /dev/null @@ -1,1762 +0,0 @@ -/************************************************************************************* -This file is a part of CrashRpt library. -Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved. - -Use of this source code is governed by a BSD-style license -that can be found in the License.txt file in the root of the source -tree. All contributing project authors may -be found in the Authors.txt file in the root of the source tree. -***************************************************************************************/ - -/*! \file CrashRpt.h -* \brief Defines the interface for the CrashRpt.DLL. -* \date 2003 -* \author Michael Carruth -* \author Oleg Krivtsov (zeXspectrum) -*/ - -#ifndef _CRASHRPT_H_ -#define _CRASHRPT_H_ - -#include -#include - -// Define SAL macros to be empty if some old Visual Studio used -#ifndef __reserved -#define __reserved -#endif -#ifndef __in -#define __in -#endif -#ifndef __in_opt -#define __in_opt -#endif -#ifndef __out_ecount_z -#define __out_ecount_z(x) -#endif - -#ifdef __cplusplus -#define CRASHRPT_EXTERNC extern "C" -#else -#define CRASHRPT_EXTERNC -#endif - -#define CRASHRPTAPI(rettype) CRASHRPT_EXTERNC rettype WINAPI - -//! Current CrashRpt version -#define CRASHRPT_VER 1401 - -/*! \defgroup CrashRptAPI CrashRpt Functions */ -/*! \defgroup DeprecatedAPI Obsolete Functions */ -/*! \defgroup CrashRptStructs CrashRpt Structures */ -/*! \defgroup CrashRptWrappers CrashRpt Wrapper Classes */ - -/*! \ingroup DeprecatedAPI -* \brief Client crash callback function prototype -* \param[in] lpvState Must be set to NULL. -* -* \remarks -* -* This function is deprecated, it is recommended to use \ref PFNCRASHCALLBACK() -* instead. -* -* The crash callback function is called when crash occurs. This way client application is -* notified about the crash. -* -* It is generally unsafe to do complex actions (e.g. memory allocation, heap operations) inside of this callback. -* The application state may be unstable. -* -* One reason the application may use this callback for is to close handles to open log files that the -* application plans to include into the error report. Files should be accessible for reading, otherwise -* CrashRpt won't be able to include them into error report. -* -* It is also possible (but not recommended) to add files, properties, desktop screenshots, -* registry keys inside of the crash callback function. -* -* The crash callback function should typically return \c TRUE to allow generate error report. -* Returning \c FALSE will prevent crash report generation. -* -* The following example shows how to use the crash callback function. -* -* \code -* // define the crash callback -* BOOL CALLBACK CrashCallback(LPVOID lpvState) -* { -* // Do something... -* -* return TRUE; -* } -* \endcode -* -* \sa crAddFile2(), PFNCRASHCALLBACK() -*/ -typedef BOOL (CALLBACK *LPGETLOGFILE) (__reserved LPVOID lpvState); - -// Exception types used in CR_EXCEPTION_INFO::exctype structure member. -#define CR_SEH_EXCEPTION 0 //!< SEH exception. -#define CR_CPP_TERMINATE_CALL 1 //!< C++ terminate() call. -#define CR_CPP_UNEXPECTED_CALL 2 //!< C++ unexpected() call. -#define CR_CPP_PURE_CALL 3 //!< C++ pure virtual function call (VS .NET and later). -#define CR_CPP_NEW_OPERATOR_ERROR 4 //!< C++ new operator fault (VS .NET and later). -#define CR_CPP_SECURITY_ERROR 5 //!< Buffer overrun error (VS .NET only). -#define CR_CPP_INVALID_PARAMETER 6 //!< Invalid parameter exception (VS 2005 and later). -#define CR_CPP_SIGABRT 7 //!< C++ SIGABRT signal (abort). -#define CR_CPP_SIGFPE 8 //!< C++ SIGFPE signal (flotating point exception). -#define CR_CPP_SIGILL 9 //!< C++ SIGILL signal (illegal instruction). -#define CR_CPP_SIGINT 10 //!< C++ SIGINT signal (CTRL+C). -#define CR_CPP_SIGSEGV 11 //!< C++ SIGSEGV signal (invalid storage access). -#define CR_CPP_SIGTERM 12 //!< C++ SIGTERM signal (termination request). - - -/*! \ingroup CrashRptStructs -* \brief This structure contains information about the crash. -* -* The information provided by this structure includes the exception type, exception code, -* exception pointers and so on. These are needed to generate crash minidump file and -* provide the developer with other information about the error. This structure is used by -* the crGenerateErrorReport() function. Pointer to this structure is also passed to the -* crash callback function (see the \ref PFNCRASHCALLBACK() function prototype). -* -* Structure members details are provided below: -* -* \b cb [in] -* -* This must contain the size of this structure in bytes. -* -* \b pexcptrs [in, optional] -* -* Should contain the exception pointers. If this parameter is NULL, -* the current CPU state is used to generate exception pointers. -* -* \b exctype [in] -* -* The type of exception. This parameter may be one of the following: -* - \ref CR_SEH_EXCEPTION SEH (Structured Exception Handling) exception -* - \ref CR_CPP_TERMINATE_CALL C++ terminate() function call -* - \ref CR_CPP_UNEXPECTED_CALL C++ unexpected() function call -* - \ref CR_CPP_PURE_CALL Pure virtual method call (Visual Studio .NET 2003 and later) -* - \ref CR_CPP_NEW_OPERATOR_ERROR C++ 'new' operator error (Visual Studio .NET 2003 and later) -* - \ref CR_CPP_SECURITY_ERROR Buffer overrun (Visual Studio .NET 2003 only) -* - \ref CR_CPP_INVALID_PARAMETER Invalid parameter error (Visual Studio 2005 and later) -* - \ref CR_CPP_SIGABRT C++ SIGABRT signal -* - \ref CR_CPP_SIGFPE C++ floating point exception -* - \ref CR_CPP_SIGILL C++ illegal instruction -* - \ref CR_CPP_SIGINT C++ SIGINT signal -* - \ref CR_CPP_SIGSEGV C++ invalid storage access -* - \ref CR_CPP_SIGTERM C++ termination request -* -* \b code [in, optional] -* -* Used if \a exctype is \ref CR_SEH_EXCEPTION and represents the SEH exception code. -* If \a pexptrs is NULL, this value is used when generating exception information for initializing -* \c pexptrs->ExceptionRecord->ExceptionCode member, otherwise it is ignored. -* -* \b fpe_subcode [in, optional] -* -* Used if \a exctype is equal to \ref CR_CPP_SIGFPE. It defines the floating point -* exception subcode (see \c signal() function ducumentation in MSDN). -* -* \b expression, \b function, \b file and \b line [in, optional] -* -* These parameters are used when \a exctype is \ref CR_CPP_INVALID_PARAMETER. -* These members are typically non-zero when using debug version of CRT. -* -* \b bManual [in] -* -* Since v.1.2.4, \a bManual parameter should be equal to TRUE if the report is generated manually. -* The value of \a bManual parameter affects the automatic application restart behavior. If the application -* restart is requested by the \ref CR_INST_APP_RESTART flag of CR_INSTALL_INFO::dwFlags structure member, -* and if \a bManual is FALSE, the application will be -* restarted after error report generation. If \a bManual is TRUE, the application won't be restarted. -* -* \b hSenderProcess [out] -* -* As of v.1.2.8, \a hSenderProcess parameter will contain the handle to the CrashSender.exe process when -* \ref crGenerateErrorReport function returns. The caller may use this handle to wait until CrashSender.exe -* process exits and check the exit code. When the handle is not needed anymore, release it with the \b CloseHandle() function. -*/ - -typedef struct tagCR_EXCEPTION_INFO -{ - WORD cb; //!< Size of this structure in bytes; should be initialized before using. - PEXCEPTION_POINTERS pexcptrs; //!< Exception pointers. - int exctype; //!< Exception type. - DWORD code; //!< Code of SEH exception. - unsigned int fpe_subcode; //!< Floating point exception subcode. - const wchar_t* expression; //!< Assertion expression. - const wchar_t* function; //!< Function in which assertion happened. - const wchar_t* file; //!< File in which assertion happened. - unsigned int line; //!< Line number. - BOOL bManual; //!< Flag telling if the error report is generated manually or not. - HANDLE hSenderProcess; //!< Handle to the CrashSender.exe process. -} -CR_EXCEPTION_INFO; - -typedef CR_EXCEPTION_INFO* PCR_EXCEPTION_INFO; - -// Stages of crash report generation (used by the crash callback function). -#define CR_CB_STAGE_PREPARE 10 //!< Stage after exception pointers've been retrieved. -#define CR_CB_STAGE_FINISH 20 //!< Stage after the launch of CrashSender.exe process. - -/*! \ingroup CrashRptStructs -* \struct CR_CRASH_CALLBACK_INFOW() -* \brief This structure contains information passed to crash callback function PFNCRASHCALLBACK(). -* -* \remarks -* -* The information contained in this structure may be used by the crash callback function -* to determine what type of crash has occurred and perform some action. For example, -* the client application may prefer to continue its execution on some type of crash, and -* terminate itself on another type of crash. -* -* Below, the stucture fields are described: -* -* \b cb [in] -* -* This contains the size of this structure in bytes. -* -* \b nStage [in] -* -* This field specifies the crash report generation stage. The callback function -* can be called once per each stage (depending on callback function's return value). -* Currently, there are two stages: -* - \ref CR_CB_STAGE_PREPARE Stage after exception pointers've been retrieved. -* - \ref CR_CB_STAGE_FINISH Stage after the launch of CrashSender.exe process. -* -* \b pszErrorReportFolder [in] -* -* This field contains the absolute path to the directory containing uncompressed -* crash report files. -* -* \b pExceptionInfo [in] -* -* This field contains a pointer to \ref CR_EXCEPTION_INFO structure. -* -* \b pUserParam [in, optional] -* -* This is a pointer to user-specified data passed to the crSetCrashCallback() function -* as \b pUserParam argument. -* -* \b bContinueExecution [in, out] -* -* This field is set to FALSE by default. The crash callback function may set it -* to true if it wants to continue its execution after crash report generation -* (otherwise the program will be terminated). -* -* -* \ref CR_CRASH_CALLBACK_INFOW and \ref CR_CRASH_CALLBACK_INFOA are -* wide-character and multi-byte character versions of \ref CR_CRASH_CALLBACK_INFO -* structure. In your program, use the \ref CR_CRASH_CALLBACK_INFO typedef which -* is a character-set-independent version of the structure name. -* -* \sa PFNCRASHCALLBACK() -*/ -typedef struct tagCR_CRASH_CALLBACK_INFOW -{ - WORD cb; //!< Size of this structure in bytes. - int nStage; //!< Stage. - LPCWSTR pszErrorReportFolder; //!< Directory where crash report files are located. - CR_EXCEPTION_INFO* pExceptionInfo; //!< Pointer to information about the crash. - LPVOID pUserParam; //!< Pointer to user-defined data. - BOOL bContinueExecution; //!< Whether to terminate the process (the default) or to continue program execution. -} -CR_CRASH_CALLBACK_INFOW; - -/*! \ingroup CrashRptStructs -* \struct CR_CRASH_CALLBACK_INFOA -* \copydoc CR_CRASH_CALLBACK_INFOW -*/ -typedef struct tagCR_CRASH_CALLBACK_INFOA -{ - WORD cb; //!< Size of this structure in bytes. - int nStage; //!< Stage. - LPCSTR pszErrorReportFolder; //!< Directory where crash report files are located. - CR_EXCEPTION_INFO* pExceptionInfo; //!< Pointer to information about the crash. - LPVOID pUserParam; //!< Pointer to user-defined data. - BOOL bContinueExecution; //!< Whether to terminate the process (the default) or to continue program execution. -} -CR_CRASH_CALLBACK_INFOA; - -/*! \brief Character set-independent mapping of CR_CRASH_CALLBACK_INFOW and CR_CRASH_CALLBACK_INFOA structures. -* \ingroup CrashRptStructs -*/ -#ifdef UNICODE -typedef CR_CRASH_CALLBACK_INFOW CR_CRASH_CALLBACK_INFO; -#else -typedef CR_CRASH_CALLBACK_INFOA CR_CRASH_CALLBACK_INFO; -#endif // UNICODE - -// Constants that may be returned by the crash callback function. -#define CR_CB_CANCEL 0 //!< Cancel crash report generation on the current stage. -#define CR_CB_DODEFAULT 1 //!< Proceed to the next stages of crash report generation without calling crash callback function. -#define CR_CB_NOTIFY_NEXT_STAGE 2 //!< Proceed and call the crash callback for the next stage. - -/*! \ingroup CrashRptAPI -* \brief Client crash callback function prototype. -* \param[in] pInfo Points to information about the crash. -* -* \remarks -* -* The crash callback function is called when a crash occurs. This way client application is -* notified about the crash. -* -* Crash information is passed by CrashRpt to the callback function through the \b pInfo parameter as -* a pointer to \ref CR_CRASH_CALLBACK_INFO structure. See below for a code example. -* -* It is generally unsafe to do complex actions (e.g. memory allocation, heap operations) inside of this callback. -* The application state may be unstable. -* -* One reason the application may use this callback for is to close handles to open log files that the -* application plans to include into the error report. Files should be accessible for reading, otherwise -* CrashRpt won't be able to include them into error report. -* -* It is also possible (but not recommended) to add files (see crAddFile2()), -* properties (see crAddProperty()), desktop screenshots (see crAddScreenshot2()) -* and registry keys (see crAddRegKey()) inside of the crash callback function. -* -* By default, CrashRpt terminates the client application after crash report generation and -* launching the CrashSender.exe process. However, it is possible to continue program -* execution after crash report generation by seting \ref CR_CRASH_CALLBACK_INFO::bContinueExecution -* structure field to \a TRUE. -* -* The crash report generation consists of several stages. First, exception pointers are retrieved -* and the callback function is called for the first time. The callback function may check the -* retrieved exception information and decide wheter to proceed with crash report generation or to -* continue client program execution. On the next stage, the \a CrashSender.exe -* process is launched and the crash callback function is (optionally) called for the second time. -* Further crash report data collection and delivery work is performed in \a CrashSender.exe process. -* The crash callback may use the provided handle to \a CrashSender.exe process to wait until it exits. -* -* The crash callback function should typically return \ref CR_CB_DODEFAULT constant to proceed -* with error report generation without being called back on the next stage(s). Returning the -* \ref CR_CB_NOTIFY_NEXT_STAGE constant causes CrashRpt to call the crash callback function on the next -* stage, too. Returning \ref CR_CB_CANCEL constant will prevent further stage(s) of crash report generation. -* -* \ref PFNCRASHCALLBACKW() and \ref PFNCRASHCALLBACKA() are -* wide-character and multi-byte character versions of \ref PFNCRASHCALLBACK() -* function. -* -* The following code example shows the simplest way of using the crash callback function: -* -* \code -* // Define the crash callback -* int CALLBACK CrashCallback(CR_CRASH_CALLBACK_INFO* pInfo) -* { -* -* // Do something... -* -* // Proceed with crash report generation. -* // This return code also makes CrashRpt to not call this callback function for -* // the next crash report generation stage. -* return CR_CB_DODEFAULT; -* } -* \endcode -* -* The following code example shows how to use the crash callback function to be notified -* on every stage of crash report generation: -* -* \code -* // Define the crash callback -* int CALLBACK CrashCallback(CR_CRASH_CALLBACK_INFO* pInfo) -* { -* -* // We want to continue program execution after crash report generation -* pInfo->bContinueExecution = TRUE; -* -* switch(pInfo->nStage) -* { -* case CR_CB_STAGE_PREPARE: -* // do something -* break; -* case CR_CB_STAGE_FINISH: -* // do something -* break; -* } -* -* // Proceed to the next stage. -* return CR_CB_NOTIFY_NEXT_STAGE; -* } -* \endcode -* -* \sa CR_CRASH_CALLBACK_INFO, crSetCrashCallback(), crAddFile2(), crAddProperty(), crAddScreenshot2(), crAddRegKey() -*/ -typedef int (CALLBACK *PFNCRASHCALLBACKW) (CR_CRASH_CALLBACK_INFOW* pInfo); - -/*! \ingroup CrashRptAPI -* \copydoc PFNCRASHCALLBACKW() -*/ -typedef int (CALLBACK *PFNCRASHCALLBACKA) (CR_CRASH_CALLBACK_INFOA* pInfo); - -/*! \brief Character set-independent mapping of \ref PFNCRASHCALLBACKW() and \ref PFNCRASHCALLBACKA() function prototrypes. -* \ingroup CrashRptStructs -*/ -#ifdef UNICODE -typedef PFNCRASHCALLBACKW PFNCRASHCALLBACK; -#else -typedef PFNCRASHCALLBACKA PFNCRASHCALLBACK; -#endif // UNICODE - -/*! \ingroup CrashRptAPI -* \brief Sets the crash callback function. -* -* \return This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* \param[in] pfnCallbackFunc Pointer to the crash callback function. -* \param[in] lpParam User defined parameter. Optional. -* -* \remarks -* -* Use this to set the crash callback function that will be called on crash. This function -* is available since v.1.4.0. -* -* For the crash callback function prototype, see documentation for PFNCRASHCALLBACK(). -* -* Optional \b lpParam parameter can be a pointer to user-defined data. It will be passed to the -* crash callback function as \ref CR_CRASH_CALLBACK_INFO::pUserParam structure member. -* -* \sa -* PFNCRASHCALLBACK() -*/ - -CRASHRPTAPI(int) -crSetCrashCallbackW( - PFNCRASHCALLBACKW pfnCallbackFunc, - LPVOID lpParam - ); - - -/*! \ingroup CrashRptAPI -* \copydoc crSetCrashCallbackW() -*/ -CRASHRPTAPI(int) -crSetCrashCallbackA( - PFNCRASHCALLBACKA pfnCallbackFunc, - LPVOID lpParam - ); - - -/*! \brief Character set-independent mapping of crSetCrashCallbackW() and crSetCrashCallbackA() functions. -* \ingroup CrashRptAPI -*/ -#ifdef UNICODE -#define crSetCrashCallback crSetCrashCallbackW -#else -#define crSetCrashCallback crSetCrashCallbackA -#endif //UNICODE - -// Array indices for CR_INSTALL_INFO::uPriorities. -#define CR_HTTP 0 //!< Send error report via HTTP (or HTTPS) connection. -#define CR_SMTP 1 //!< Send error report via SMTP connection. -#define CR_SMAPI 2 //!< Send error report via simple MAPI (using default mail client). - -//! Special priority constant that allows to skip certain delivery method. -#define CR_NEGATIVE_PRIORITY ((UINT)-1) - -// Flags for CR_INSTALL_INFO::dwFlags -#define CR_INST_STRUCTURED_EXCEPTION_HANDLER 0x1 //!< Install SEH handler (deprecated name, use \ref CR_INST_SEH_EXCEPTION_HANDLER instead). -#define CR_INST_SEH_EXCEPTION_HANDLER 0x1 //!< Install SEH handler. -#define CR_INST_TERMINATE_HANDLER 0x2 //!< Install terminate handler. -#define CR_INST_UNEXPECTED_HANDLER 0x4 //!< Install unexpected handler. -#define CR_INST_PURE_CALL_HANDLER 0x8 //!< Install pure call handler (VS .NET and later). -#define CR_INST_NEW_OPERATOR_ERROR_HANDLER 0x10 //!< Install new operator error handler (VS .NET and later). -#define CR_INST_SECURITY_ERROR_HANDLER 0x20 //!< Install security error handler (VS .NET and later). -#define CR_INST_INVALID_PARAMETER_HANDLER 0x40 //!< Install invalid parameter handler (VS 2005 and later). -#define CR_INST_SIGABRT_HANDLER 0x80 //!< Install SIGABRT signal handler. -#define CR_INST_SIGFPE_HANDLER 0x100 //!< Install SIGFPE signal handler. -#define CR_INST_SIGILL_HANDLER 0x200 //!< Install SIGILL signal handler. -#define CR_INST_SIGINT_HANDLER 0x400 //!< Install SIGINT signal handler. -#define CR_INST_SIGSEGV_HANDLER 0x800 //!< Install SIGSEGV signal handler. -#define CR_INST_SIGTERM_HANDLER 0x1000 //!< Install SIGTERM signal handler. - -#define CR_INST_ALL_POSSIBLE_HANDLERS 0x1FFF //!< Install all possible exception handlers. -#define CR_INST_CRT_EXCEPTION_HANDLERS 0x1FFE //!< Install exception handlers for the linked CRT module. - -#define CR_INST_NO_GUI 0x2000 //!< Do not show GUI, send report silently (use for non-GUI apps only). -#define CR_INST_HTTP_BINARY_ENCODING 0x4000 //!< Deprecated, do not use. -#define CR_INST_DONT_SEND_REPORT 0x8000 //!< Don't send error report immediately, just save it locally. -#define CR_INST_APP_RESTART 0x10000 //!< Restart the application on crash. -#define CR_INST_NO_MINIDUMP 0x20000 //!< Do not include minidump file to crash report. -#define CR_INST_SEND_QUEUED_REPORTS 0x40000 //!< CrashRpt should send error reports that are waiting to be delivered. -#define CR_INST_STORE_ZIP_ARCHIVES 0x80000 //!< CrashRpt should store both uncompressed error report files and ZIP archives. -#define CR_INST_SEND_MANDATORY 0x100000 //!< This flag removes the "Close" and "Other actions" buttons from Error Report dialog, thus making the sending procedure mandatory for user. -#define CR_INST_SHOW_ADDITIONAL_INFO_FIELDS 0x200000 //!< Makes "Your E-mail" and "Describe what you were doing when the problem occurred" fields of Error Report dialog always visible. -#define CR_INST_ALLOW_ATTACH_MORE_FILES 0x400000 //!< Adds an ability for user to attach more files to crash report by clicking "Attach More File(s)" item from context menu of Error Report Details dialog. - -/*! \ingroup CrashRptStructs -* \struct CR_INSTALL_INFOW() -* \brief This structure defines the general information used by crInstallW() function. -* -* \remarks -* -* \ref CR_INSTALL_INFOW and \ref CR_INSTALL_INFOA structures are wide-character and multi-byte character -* versions of \ref CR_INSTALL_INFO. \ref CR_INSTALL_INFO typedef defines character set independent mapping. -* -* Below, structure members are described in details. Required parameters must always be specified, while optional -* ones may be set with 0 (zero) or NULL. Most of parameters are optional. -* -* \b cb [in, required] -* -* This must contain the size of this structure in bytes. -* -* \b pszAppName [in, optional] -* -* This is the friendly name of the client application. The application name is -* displayed in the Error Report dialog. If this parameter is NULL, the name of EXE file -* that was used to start caller process becomes the application name. -* -* \b pszAppVersion [in, optional] -* -* Should be the application version. Example: "1.0.1". -* -* If this equals to NULL, product version is extracted from the executable file which started -* the caller process, and this product version is used as application version. If the executable file -* doesn's have a version info resource, the \ref crInstall() function will fail. -* -* \b pszEmailTo [in, optional] -* -* This is the email address of the recipient of error reports (or several E-mail adresses separated with semicolon), -* for example "name@example.com" or "person1@example.com;person2@someserver.com". If several E-mail addresses are -* specified, error report will be delivered to each of them. If this parameter equals to NULL, -* the crash report won't be sent using E-mail client. -* -* Keep this NULL if you plan to use large error reports (more than several MB in size), because -* large emails may be rejected by the mail server. -* -* \b pszEmailSubject [in, optional] -* -* This is the subject of the email message. If this parameter is NULL, -* the default subject of form '[app_name] [app_version] Error Report' is generated. -* -* \a pszUrl is the URL of a server-side script that would receive crash report data via HTTP or HTTPS -* connection. If this parmeter is NULL, HTTP(S) connection won't be used to send crash reports. For -* example of a server-side script that can receive crash reports, see \ref sending_error_reports. -* -* HTTP(S) transport is the recommended way of sending large error reports (more than several MB in size). -* To define a custom port for HTTP(S) connection, use the following URL format: "http://example.com[:port]/crashrpt.php" or -* "https://example.com[:port]/crashrpt.php", where optional \a port is the placeholder for the port number. -* -* \b pszCrashSenderPath [in, optional] -* -* This is the absolute path to the directory where CrashSender.exe is located. -* The crash sender process is responsible for letting end user know about the crash and -* sending the error report. If this is NULL, it is assumed that CrashSender.exe is located in -* the same directory as CrashRpt.dll. -* -* -* \b uPriorities [in, optional] -* -* This is an array that defines the preferred methods of sending error reports. -* The available methods are: HTTP (or HTTPS) connection, SMTP connection or simple MAPI (default mail client). -* -* A priority is a non-negative integer number or special constant \ref CR_NEGATIVE_PRIORITY. -* The greater positive number defines the greater priority. -* Specify the \ref CR_NEGATIVE_PRIORITY to skip the given delivery method. -* -* The element having index \ref CR_HTTP defines priority for using HTML connection. -* The element having index \ref CR_SMTP defines priority for using SMTP connection. -* The element having index \ref CR_SMAPI defines priority for using the default mail client. -* -* The methods having greater priority will be tried first. If priorities are equal to each other, HTTP (or HTTPS) -* connection will be tried the first, SMTP connection will be tried the second and simple MAPI will be tried -* the last. -* -* \b dwFlags [in, optional] -* -* Since v1.1.2, \a dwFlags can be used to define behavior parameters. This can be a combination of the following values: -* -* -*
Use the combination of the following constants to specify what exception handlers to install: -*
\ref CR_INST_ALL_POSSIBLE_HANDLERS Install all available exception handlers. -*
\ref CR_INST_SEH_EXCEPTION_HANDLER Install SEH exception handler. -*
\ref CR_INST_PURE_CALL_HANDLER Install pure call handler (VS .NET and later). -*
\ref CR_INST_NEW_OPERATOR_ERROR_HANDLER Install new operator error handler (VS .NET and later). -*
\ref CR_INST_SECURITY_ERROR_HANDLER Install security errror handler (VS .NET and later). -*
\ref CR_INST_INVALID_PARAMETER_HANDLER Install invalid parameter handler (VS 2005 and later). -*
\ref CR_INST_SIGABRT_HANDLER Install SIGABRT signal handler. -*
\ref CR_INST_SIGINT_HANDLER Install SIGINT signal handler. -*
\ref CR_INST_SIGTERM_HANDLER Install SIGTERM signal handler. -*
Use the combination of the following constants to define behavior parameters: -*
\ref CR_INST_NO_GUI -* Available since v.1.2.2 Do not show GUI. -* -* It is not recommended to use this flag for regular GUI-based applications. -* Use this only for services that have no GUI. -*
\ref CR_INST_DONT_SEND_REPORT -* Available since v.1.2.2 This parameter means 'do not send error report immediately on crash, just save it locally'. -* Use this if you have direct access to the machine where crash happens and do not need -* to send report over the Internet. You can use this in couple with \ref CR_INST_STORE_ZIP_ARCHIVES flag to store zipped error reports -* along with uncompressed error report files. -*
\ref CR_INST_APP_RESTART -* Available since v.1.2.4 This parameter allows to automatically restart the application on crash. The command line -* for the application is taken from \a pszRestartCmdLine parameter. To avoid cyclic restarts of an application which crashes on startup, -* the application is restarted only if at least 60 seconds elapsed since its start. -*
\ref CR_INST_NO_MINIDUMP -* Available since v.1.2.4 Specify this parameter if you want minidump file not to be included into crash report. The default -* behavior is to include the minidump file. -* -*
\ref CR_INST_SEND_QUEUED_REPORTS -* Available since v.1.2.5 Specify this parameter to send all queued reports. Those -* report files are by default stored in %LOCAL_APPDATA%\\CrashRpt\\UnsentCrashReports\\%AppName%_%AppVersion% folder. -* If this is specified, CrashRpt checks if it's time to remind user about recent errors in the application and offers to send -* all queued error reports. -* -*
\ref CR_INST_STORE_ZIP_ARCHIVES -* Available since v.1.2.7 This parameter can be used in couple with \ref CR_INST_DONT_SEND_REPORT flag to store not only uncompressed -* error report files, but also ZIP archives. By default (if this flag omitted) CrashRpt stores all error report files -* in uncompressed state. -* -*
\ref CR_INST_SEND_MANDATORY -* Available since v.1.3.1 This parameter makes sending procedure mandatory by removing the "Close" button -* and "Other actions..." button from the Error Report dialog. Typically, it is not recommended to use this flag, -* unless you intentionally want users to always send error reports for your application. -*
\ref CR_INST_SHOW_ADDITIONAL_INFO_FIELDS -* Available since v.1.3.1 This parameter makes "Your E-mail" and "Describe what you were doing when the -* problem occurred" fields of Error Report dialog always visible. By default (when this parameter not specified), -* these fields are hidden and user needs to click the "Provide additional info (recommended)" link to show them. -* -*
\ref CR_INST_ALLOW_ATTACH_MORE_FILES -* Available since v.1.3.1 Adds an ability for user to attach more files to crash report by choosing -* "Attach More File(s)" item from context menu of Error Report Details dialog. By default this feature is disabled. -*
-* -* \b pszPrivacyPolicyURL [in, optional] -* -* This parameter defines the URL for the Privacy Policy hyperlink of the -* Error Report dialog. If this parameter is NULL, the link is not displayed. For information on -* the Privacy Policy, see \ref error_report. This parameter is available since v1.1.2. -* -* \b pszDebugHelpDLL [in, optional] -* -* This parameter defines the location of the dbghelp.dll to load. -* If this parameter is NULL, the dbghelp.dll is searched using the default search sequence. -* This parameter is available since v1.2.1. -* -* \b uMiniDumpType [in, optional] -* -* This parameter defines the minidump type. For the list of available minidump -* types, see the documentation for the MiniDumpWriteDump() function in MSDN. -* Parameter is available since v.1.2.1. -* -* It is recommended to set this -* parameter with zero (equivalent of MiniDumpNormal constant). Other values may increase the minidump -* size significantly. -* -* \b pszErrorReportSaveDir [in, optional] -* -* This parameter defines the directory where to save the error reports. -* If this is NULL, the default directory is used (%%LOCAL_APP_DATA%\\CrashRpt\\UnsentCrashReports\\%%AppName%%_%%AppVersion%). -* This parameter is available since v.1.2.2. -* -* \b pszRestartCmdLine [in, optional] -* -* This arameter defines the string that specifies the -* command-line arguments for the application when it is restarted (when using \ref CR_INST_APP_RESTART flag). -* Do not include the name of the executable in the command line; it is added automatically. This parameter -* can be NULL. Available since v.1.2.4. -* -* \b pszLangFilePath [in, optional] -* -* This parameter defines the absolute path (including file name) for language file. -* If this is NULL, the lang file is assumed to be located in the same dir as CrashSender.exe file and have -* the name crashrpt_lang.ini. -* This parameter is available since v.1.2.4. -* -* \b pszEmailText [in, optional] -* -* This parameter defines the custom E-mail text that is used when deliverying error report -* as E-mail. If this is NULL, the default E-mail text is used. It is recommended to set this parameter with NULL. -* This parameter is available since v.1.2.4. -* -* \b pszSmtpProxy [in, optional] -* -* This parameter defines the network address (IP or domain) and, optionally, port formatted as "address[:port]" -* of SMTP server. Examples: "192.168.1.1:2525", "mail.example.com:25". -* If this parameter is NULL, the SMTP server address is resolved using the MX record of recipient's mailbox. -* You should typically set this parameter with NULL, except in the -* case when your software is a server and custom SMTP configuration is required. This parameter is available since v.1.2.4. -* -* \b pszCustomSenderIcon [in, optional] -* -* This parameter can be used to define a custom icon for Error Report dialog. This parameter is -* available since v.1.2.8. -* -* The value of this parameter should be absolute path to the module containing the icon resource, followed -* by resource identifier separated by comma. You can set this parameter with NULL to use the default icon. -* -* The resource identifier is a zero-based index of the icon to retrieve. For example, if this value is 0, -* the first icon in the specified file is used. If the identifier is a negative number not equal to -1, -* the icon in the specified file whose resource identifier is equal to the absolute value of the resource -* identifier is used. -* Example: "D:\MyApp\Resources.dll, -128". -* -* \b pszSmtpLogin [in, optional] -* -* This parameter defines the login name for SMTP authentication. It is typically used together with -* \ref pszSmtpProxy and \ref pszSmtpPassword parameter. -* If this parameter is ommitted (NULL), no SMTP autentication is used. This parameter is available since v.1.3.1. -* -* \b pszSmtpPassword [in, optional] -* -* This parameter defines the password for SMTP authentication. It is used in pair with \ref pszSmtpLogin parameter. -* This parameter is available since v.1.3.1. -*/ - -typedef struct tagCR_INSTALL_INFOW -{ - WORD cb; //!< Size of this structure in bytes; must be initialized before using! - LPCWSTR pszAppName; //!< Name of application. - LPCWSTR pszAppVersion; //!< Application version. - LPCWSTR pszEmailTo; //!< E-mail address of crash reports recipient. - LPCWSTR pszEmailSubject; //!< Subject of crash report e-mail. - LPCWSTR pszUrl; //!< URL of server-side script (used in HTTP connection). - LPCWSTR pszCrashSenderPath; //!< Directory name where CrashSender.exe is located. - LPGETLOGFILE pfnCrashCallback; //!< Deprecated, do not use. - UINT uPriorities[5]; //!< Array of error sending transport priorities. - DWORD dwFlags; //!< Flags. - LPCWSTR pszPrivacyPolicyURL; //!< URL of privacy policy agreement. - LPCWSTR pszDebugHelpDLL; //!< File name or folder of Debug help DLL. - MINIDUMP_TYPE uMiniDumpType; //!< Minidump type. - LPCWSTR pszErrorReportSaveDir; //!< Directory where to save error reports. - LPCWSTR pszRestartCmdLine; //!< Command line for application restart (without executable name). - LPCWSTR pszLangFilePath; //!< Path to the language file (including file name). - LPCWSTR pszEmailText; //!< Custom E-mail text (used when deliverying report as E-mail). - LPCWSTR pszSmtpProxy; //!< Network address and port to be used as SMTP proxy. - LPCWSTR pszCustomSenderIcon; //!< Custom icon used for Error Report dialog. - LPCWSTR pszSmtpLogin; //!< Login name used for SMTP authentication when sending error report as E-mail. - LPCWSTR pszSmtpPassword; //!< Password used for SMTP authentication when sending error report as E-mail. -} -CR_INSTALL_INFOW; - -typedef CR_INSTALL_INFOW* PCR_INSTALL_INFOW; - -/*! \ingroup CrashRptStructs -* \struct CR_INSTALL_INFOA -* \copydoc CR_INSTALL_INFOW -*/ - -typedef struct tagCR_INSTALL_INFOA -{ - WORD cb; //!< Size of this structure in bytes; must be initialized before using! - LPCSTR pszAppName; //!< Name of application. - LPCSTR pszAppVersion; //!< Application version. - LPCSTR pszEmailTo; //!< E-mail address of crash reports recipient. - LPCSTR pszEmailSubject; //!< Subject of crash report e-mail. - LPCSTR pszUrl; //!< URL of server-side script (used in HTTP connection). - LPCSTR pszCrashSenderPath; //!< Directory name where CrashSender.exe is located. - LPGETLOGFILE pfnCrashCallback; //!< Deprecated, do not use. - UINT uPriorities[5]; //!< Array of error sending transport priorities. - DWORD dwFlags; //!< Flags. - LPCSTR pszPrivacyPolicyURL; //!< URL of privacy policy agreement. - LPCSTR pszDebugHelpDLL; //!< File name or folder of Debug help DLL. - MINIDUMP_TYPE uMiniDumpType; //!< Mini dump type. - LPCSTR pszErrorReportSaveDir; //!< Directory where to save error reports. - LPCSTR pszRestartCmdLine; //!< Command line for application restart (without executable name). - LPCSTR pszLangFilePath; //!< Path to the language file (including file name). - LPCSTR pszEmailText; //!< Custom E-mail text (used when deliverying report as E-mail). - LPCSTR pszSmtpProxy; //!< Network address and port to be used as SMTP proxy. - LPCSTR pszCustomSenderIcon; //!< Custom icon used for Error Report dialog. - LPCSTR pszSmtpLogin; //!< Login name used for SMTP authentication when sending error report as E-mail. - LPCSTR pszSmtpPassword; //!< Password used for SMTP authentication when sending error report as E-mail. - PFNCRASHCALLBACKA pfnCrashCallback2; //!< Crash callback function. -} -CR_INSTALL_INFOA; - -typedef CR_INSTALL_INFOA* PCR_INSTALL_INFOA; - -/*! \brief Character set-independent mapping of CR_INSTALL_INFOW and CR_INSTALL_INFOA structures. -* \ingroup CrashRptStructs -*/ -#ifdef UNICODE -typedef CR_INSTALL_INFOW CR_INSTALL_INFO; -typedef PCR_INSTALL_INFOW PCR_INSTALL_INFO; -#else -typedef CR_INSTALL_INFOA CR_INSTALL_INFO; -typedef PCR_INSTALL_INFOA PCR_INSTALL_INFO; -#endif // UNICODE - -/*! \ingroup CrashRptAPI -* \brief Installs exception handlers for the caller process. -* -* \return -* This function returns zero if succeeded. -* -* \param[in] pInfo General congiration information. -* -* \remarks -* -* This function installs unhandled exception filter for the caller process. -* It also installs various CRT exception/error handlers that function for all threads of the caller process. -* For more information, see \ref exception_handling -* -* Below is the list of installed handlers: -* - Top-level SEH exception filter [ \c SetUnhandledExceptionFilter() ] -* - C++ pure virtual call handler (Visual Studio .NET 2003 and later) [ \c _set_purecall_handler() ] -* - C++ invalid parameter handler (Visual Studio .NET 2005 and later) [ \c _set_invalid_parameter_handler() ] -* - C++ new operator error handler (Visual Studio .NET 2003 and later) [ \c _set_new_handler() ] -* - C++ buffer overrun handler (Visual Studio .NET 2003 only) [ \c _set_security_error_handler() ] -* - C++ abort handler [ \c signal(SIGABRT) ] -* - C++ illegal instruction handler [ \c signal(SIGINT) ] -* - C++ termination request [ \c signal(SIGTERM) ] -* -* In a multithreaded program, additionally use crInstallToCurrentThread2() function for each execution -* thread, except the main one. -* -* The \a pInfo parameter contains all required information needed to install CrashRpt. -* -* This function fails when \a pInfo->pszCrashSenderPath doesn't contain valid path to CrashSender.exe -* or when \a pInfo->pszCrashSenderPath is equal to NULL, but \b CrashSender.exe is not located in the -* directory where \b CrashRpt.dll located. -* -* On crash, the crash minidump file is created, which contains CPU information and -* stack trace information. Also XML file is created that contains additional -* information that may be helpful for crash analysis. These files along with several additional -* files added with crAddFile2() are packed to a single ZIP file. -* -* When crash information is collected, another process, CrashSender.exe, is launched -* and the process where crash had occured is terminated. The CrashSender process is -* responsible for letting the user know about the crash and send the error report. -* -* The error report can be sent over E-mail using address and subject passed to the -* function as \ref CR_INSTALL_INFO structure members. Another way of sending error report is an HTTP -* request using \a pszUrl member of \ref CR_INSTALL_INFO. -* -* This function may fail if an appropriate language file (\b crashrpt_lang.ini) is not found -* in the directory where the \b CrashSender.exe file is located. -* -* If this function fails, use crGetLastErrorMsg() to retrieve the error message. -* -* crInstallW() and crInstallA() are wide-character and multi-byte character versions of crInstall() -* function. The \ref crInstall macro defines character set independent mapping for these functions. -* -* For code example, see \ref simple_example. -* -* \sa crInstallW(), crInstallA(), crInstall(), CR_INSTALL_INFOW, -* CR_INSTALL_INFOA, CR_INSTALL_INFO, crUninstall(), -* CrAutoInstallHelper -*/ - -CRASHRPTAPI(int) -crInstallW( - __in PCR_INSTALL_INFOW pInfo - ); - -/*! \ingroup CrashRptAPI -* \copydoc crInstallW() -*/ - -CRASHRPTAPI(int) -crInstallA( - __in PCR_INSTALL_INFOA pInfo - ); - -/*! \brief Character set-independent mapping of crInstallW() and crInstallA() functions. -* \ingroup CrashRptAPI -*/ -#ifdef UNICODE -#define crInstall crInstallW -#else -#define crInstall crInstallA -#endif //UNICODE - -/*! \ingroup CrashRptAPI -* \brief Uninitializes the CrashRpt library and unsinstalls exception handlers previously installed with crInstall(). -* -* \return -* This function returns zero if succeeded. -* -* \remarks -* -* Call this function on application exit to uninitialize the library and uninstall exception -* handlers previously installed with crInstall(). After function call, the exception handlers -* are restored to states they had before calling crInstall(). -* -* This function fails if crInstall() wasn't previously called in context of the -* caller process. -* -* When this function fails, use the crGetLastErrorMsg() function to retrieve the error message. -* -* \sa crInstallW(), crInstallA(), crInstall(), -* CrAutoInstallHelper -*/ - -CRASHRPTAPI(int) -crUninstall(); - -/*! \ingroup CrashRptAPI -* \brief Installs exception handlers to the caller thread. -* \return This function returns zero if succeeded. -* \param[in] dwFlags Flags. -* -* \remarks -* -* This function is available since v.1.1.2. -* -* The function sets exception handlers for the caller thread. If you have -* several execution threads, you ought to call the function for each thread, -* except the main one. -* -* \a dwFlags defines what exception handlers to install. Use zero value -* to install all possible exception handlers. Or use a combination of the following constants: -* -* - \ref CR_INST_TERMINATE_HANDLER Install terminate handler -* - \ref CR_INST_UNEXPECTED_HANDLER Install unexpected handler -* - \ref CR_INST_SIGFPE_HANDLER Install SIGFPE signal handler -* - \ref CR_INST_SIGILL_HANDLER Install SIGILL signal handler -* - \ref CR_INST_SIGSEGV_HANDLER Install SIGSEGV signal handler -* -* Example: -* -* \code -* DWORD WINAPI ThreadProc(LPVOID lpParam) -* { -* // Install exception handlers -* crInstallToCurrentThread2(0); -* -* // Your code... -* -* // Uninstall exception handlers -* crUninstallFromCurrentThread(); -* -* return 0; -* } -* \endcode -* -* \sa -* crInstall() -*/ - -CRASHRPTAPI(int) -crInstallToCurrentThread2(DWORD dwFlags); - -/*! \ingroup CrashRptAPI -* \brief Uninstalls C++ exception handlers from the current thread. -* \return This function returns zero if succeeded. -* -* \remarks -* -* This function unsets exception handlers from the caller thread. If you have -* several execution threads, you ought to call the function for each thread. -* After calling this function, the exception handlers for current thread are -* replaced with the handlers that were before call of crInstallToCurrentThread2(). -* -* This function fails if crInstallToCurrentThread2() wasn't called for current thread. -* -* When this function fails, use crGetLastErrorMsg() to retrieve the error message. -* -* No need to call this function for the main execution thread. The crUninstall() -* will automatically uninstall C++ exception handlers for the main thread. -* -* \sa crInstallToCurrentThread2(), -* crUninstallFromCurrentThread(), CrThreadAutoInstallHelper -*/ - -CRASHRPTAPI(int) -crUninstallFromCurrentThread(); - -// Flags for crAddFile2() function. - -#define CR_AF_TAKE_ORIGINAL_FILE 0 //!< Take the original file (do not copy it to the error report folder). -#define CR_AF_MAKE_FILE_COPY 1 //!< Copy the file to the error report folder. -#define CR_AF_FILE_MUST_EXIST 0 //!< Function will fail if file doesn't exist at the moment of function call. -#define CR_AF_MISSING_FILE_OK 2 //!< Do not fail if file is missing (assume it will be created later). -#define CR_AF_ALLOW_DELETE 4 //!< If this flag is specified, the file will be deletable from context menu of Error Report Details dialog. - -/*! \ingroup CrashRptAPI -* \brief Adds a file to crash report. -* -* \return This function returns zero if succeeded. -* -* \param[in] pszFile Absolute path to the file to add, required. -* \param[in] pszDestFile Destination file name, optional. -* \param[in] pszDesc File description (used in Error Report Details dialog), optional. -* \param[in] dwFlags Flags, optional. -* -* This function can be called anytime after crInstall() to add one or more -* files to the generated crash report. -* -* When this function is called, the file is marked to be added to the error report, -* then the function returns control to the caller. -* When crash occurs, all marked files are added to the report by the \b CrashSender.exe process. -* If a file is locked by someone for exclusive access, the file won't be included. Inside of \ref PFNCRASHCALLBACK() crash callback, -* close open file handles and ensure files to be included are acessible for reading. -* -* \a pszFile should be a valid absolute path of a file to add to crash report. -* -* \a pszDestFile should be the name of destination file. This parameter can be used -* to specify different file name for the file in ZIP archive. If this parameter is NULL, the pszFile -* file name is used as destination file name. -* -* \a pszDesc is a literal description of a file. It can be NULL. -* -* \a dwFlags parameter defines the behavior of the function. This can be a combination of the following flags: -* - \ref CR_AF_TAKE_ORIGINAL_FILE On crash, the \b CrashSender.exe will try to locate the file from its original location. This behavior is the default one. -* - \ref CR_AF_MAKE_FILE_COPY On crash, the \b CrashSender.exe will make a copy of the file and save it to the error report folder. -* -* - \ref CR_AF_FILE_MUST_EXIST The function will fail if file doesn't exist at the moment of function call (the default behavior). -* - \ref CR_AF_MISSING_FILE_OK Do not fail if file is missing (assume it will be created later). -* -* - \ref CR_AF_ALLOW_DELETE If this flag is specified, the user will be able to delete the file from error report using context menu of Error Report Details dialog. -* -* If you do not use error report delivery (\ref CR_INST_DONT_SEND_REPORT flag) or if you use postponed error report delivery -* (if you specify \ref CR_INST_SEND_QUEUED_REPORTS flag) -* you must also specify the \ref CR_AF_MAKE_FILE_COPY as \a dwFlags parameter value. This will -* guarantee that a snapshot of your file at the moment of crash is taken and saved to the error report folder. -* -* This function fails if \a pszFile doesn't exist at the moment of function call, -* unless you specify \ref CR_AF_MISSING_FILE_OK flag. -* -* The crAddFile2W() and crAddFile2A() are wide-character and multibyte-character -* versions of crAddFile2() function. The crAddFile2() macro defines character set -* independent mapping. -* -* -* \sa crAddFile2W(), crAddFile2A(), crAddFile2() -*/ - -CRASHRPTAPI(int) -crAddFile2W( - LPCWSTR pszFile, - LPCWSTR pszDestFile, - LPCWSTR pszDesc, - DWORD dwFlags - ); - -/*! \ingroup CrashRptAPI -* \copydoc crAddFile2W() -*/ - -CRASHRPTAPI(int) -crAddFile2A( - LPCSTR pszFile, - LPCSTR pszDestFile, - LPCSTR pszDesc, - DWORD dwFlags - ); - -/*! \brief Character set-independent mapping of crAddFile2W() and crAddFile2A() functions. -* \ingroup CrashRptAPI -*/ -#ifdef UNICODE -#define crAddFile2 crAddFile2W -#else -#define crAddFile2 crAddFile2A -#endif //UNICODE - - -// Flags for crAddScreenshot function. -#define CR_AS_VIRTUAL_SCREEN 0 //!< Take a screenshot of the virtual screen. -#define CR_AS_MAIN_WINDOW 1 //!< Take a screenshot of application's main window. -#define CR_AS_PROCESS_WINDOWS 2 //!< Take a screenshot of all visible process windows. -#define CR_AS_GRAYSCALE_IMAGE 4 //!< Make a grayscale image instead of a full-color one. -#define CR_AS_USE_JPEG_FORMAT 8 //!< Store screenshots as JPG files. -#define CR_AS_ALLOW_DELETE 16 //!< If this flag is specified, the file will be deletable from context menu of Error Report Details dialog. - -/*! \ingroup DeprecatedAPI -* \brief Adds a screenshot to the crash report. -* -* \return This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* \param[in] dwFlags Flags, optional. -* -* \remarks -* -* As of v.1.3.1, this function is deprecated and may be removed in one of the next releases. Use -* \ref crAddScreenshot2() function instead. -* -* This function can be used to take a screenshot at the moment of crash and add it to the error report. -* Screenshot information may help the developer to better understand the state of the application -* at the moment of crash and reproduce the error. -* -* When this function is called, screenshot flags are saved, -* then the function returns control to the caller. -* When crash occurs, screenshot is made by the \b CrashSender.exe process and added to the report. -* -* \b dwFlags -* -* - \ref CR_AS_ALLOW_DELETE If this flag is specified, the user will be able to delete the file from error report using context menu of Error Report Details dialog. -* -* Use one of the following constants to specify what part of virtual screen to capture: -* - \ref CR_AS_VIRTUAL_SCREEN Use this to take a screenshot of the whole desktop (virtual screen). -* - \ref CR_AS_MAIN_WINDOW Use this to take a screenshot of the application's main window. -* - \ref CR_AS_PROCESS_WINDOWS Use this to take a screenshot of all visible windows that belong to the process. -* -* The main application window is a window that has a caption (\b WS_CAPTION), system menu (\b WS_SYSMENU) and -* the \b WS_EX_APPWINDOW extended style. If CrashRpt doesn't find such window, it considers the first found process window as -* the main window. -* -* Screenshots are added in form of PNG files by default. You can specify the \ref CR_AS_USE_JPEG_FORMAT flag to save -* screenshots as JPEG files instead. -* -* In addition, you can specify the \ref CR_AS_GRAYSCALE_IMAGE flag to make a grayscale screenshot -* (by default color image is made). Grayscale image gives smaller file size. -* -* If you use JPEG image format, you may better use the \ref crAddScreenshot2() function, that allows to -* define JPEG image quality. -* -* When capturing entire desktop consisting of several monitors, -* one screenshot file is added per each monitor. -* -* You should be careful when using this feature, because screenshots may contain user-identifying -* or private information. Always specify purposes you will use collected -* information for in your Privacy Policy. -* -* \sa -* crAddFile2() -*/ - -CRASHRPTAPI(int) -crAddScreenshot( - DWORD dwFlags - ); - -/*! \ingroup CrashRptAPI -* \brief Adds a screenshot to the crash report. -* -* \return This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* \param[in] dwFlags Flags, optional. -* \param[in] nJpegQuality Defines the JPEG image quality, optional. -* -* \remarks -* -* This function can be used to take a screenshot at the moment of crash and add it to the error report. -* Screenshot information may help the developer to better understand state of the application -* at the moment of crash and reproduce the error. -* -* When this function is called, screenshot flags are saved, then the function returns control to the caller. -* When crash occurs, screenshot is made by the \b CrashSender.exe process and added to the report. -* -* \b dwFlags -* -* Use one of the following constants to specify what part of virtual screen to capture: -* - \ref CR_AS_VIRTUAL_SCREEN Use this to take a screenshot of the whole desktop (virtual screen). -* - \ref CR_AS_MAIN_WINDOW Use this to take a screenshot of the main application main window. -* - \ref CR_AS_PROCESS_WINDOWS Use this to take a screenshot of all visible windows that belong to the process. -* -* The main application window is a window that has a caption (\b WS_CAPTION), system menu (\b WS_SYSMENU) and -* the \b WS_EX_APPWINDOW extended style. If CrashRpt doesn't find such window, it considers the first found process window as -* the main window. -* -* Screenshots are added in form of PNG files by default. You can specify the \ref CR_AS_USE_JPEG_FORMAT flag to save -* screenshots as JPEG files instead. -* -* If you use JPEG format, you can use the \a nJpegQuality parameter to define the JPEG image quality. -* This should be the number between 0 and 100, inclusively. The bigger the number, the better the quality and the bigger the JPEG file size. -* If you use PNG file format, this parameter is ignored. -* -* In addition, you can specify the \ref CR_AS_GRAYSCALE_IMAGE flag to make a grayscale screenshot -* (by default color image is made). Grayscale image gives smaller file size. -* -* When capturing entire desktop consisting of several monitors, -* one screenshot file is added per each monitor. -* -* You should be careful when using this feature, because screenshots may contain user-identifying -* or private information. Always specify purposes you will use collected -* information for in your Privacy Policy. -* -* \sa -* crAddFile2() -*/ - -CRASHRPTAPI(int) -crAddScreenshot2( - DWORD dwFlags, - int nJpegQuality - ); - -// Flags for crAddVideo function. -#define CR_AV_VIRTUAL_SCREEN 0 //!< Capture the whole virtual screen. -#define CR_AV_MAIN_WINDOW 1 //!< Capture the area of application's main window. -#define CR_AV_PROCESS_WINDOWS 2 //!< Capture all visible process windows. -#define CR_AV_QUALITY_LOW 0 //!< Low quality video encoding, smaller file size. -#define CR_AV_QUALITY_GOOD 4 //!< Good encoding quality, larger file size. -#define CR_AV_QUALITY_BEST 8 //!< The best encoding quality, the largest file size. -#define CR_AV_NO_GUI 16 //!< Do not display the notification dialog. -#define CR_AV_ALLOW_DELETE 32 //!< If this flag is specified, the file will be deletable from context menu of Error Report Details dialog. - -/*! \ingroup CrashRptAPI -* \brief Allows to record what happened before crash to a video file and include the file to crash report. -* -* \return This function returns zero if succeeded. Use \ref crGetLastErrorMsg() to retrieve the error message on failure. -* -* \param[in] dwFlags Flags, optional. -* \param[in] nDuration Video duration (in milliseconds). Optional. -* \param[in] nFrameInterval Interval between subsequent frames (in milliseconds). Optional. -* \param[in] pDesiredFrameSize Defines the desired video frame size, optional. -* \param[in] hWndParent Window that becomes the parent for GUI displayed by this function. Optional. -* -* \remarks -* -* This function is available as of v.1.4.0. -* -* \b dwFlags can be a combination of the following constants: -* -* - use one of the following constants to specify what part of virtual screen to capture: -* - \ref CR_AV_VIRTUAL_SCREEN Use this to capture the whole desktop (virtual screen). This is the default. -* - \ref CR_AV_MAIN_WINDOW Use this to capture the application's main window. -* - \ref CR_AV_PROCESS_WINDOWS Use this to capture all visible windows that belong to the process. -* -* - use one of the following constants to define the desired video encoding quality: -* - \ref CR_AV_QUALITY_LOW Low-quality video encoding. This is the default. -* - \ref CR_AV_QUALITY_GOOD Good encoding quality, larger file. -* - \ref CR_AV_QUALITY_BEST The best encoding quality, the largest file. -* -* - use the \ref CR_AV_ALLOW_DELETE to allow the user to delete the recorded video file from error report using context menu of Error Report Details dialog. -* -* The main application window is a window that has a caption (\b WS_CAPTION), system menu (\b WS_SYSMENU) and -* the \b WS_EX_APPWINDOW extended style. If CrashRpt doesn't find such a window, it considers the first found process window as -* the main window. -* -* When the function is called, it displays a dialog notifying the user about video recording. -* The displayed dialog's parent window can be specified with the \b hWndParent argument. -* If the \b hWndParent is \a NULL, the currently active process window becomes the parent. -* If you do not want to display the dialog, specify the \ref CR_AV_NO_GUI flag for \b dwFlags argument. -* -* The recorded video will be maximum \b nDuration milliseconds long with \b nFrameInterval -* milliseconds interval between subsequent video frames. If \b nDuration and\or \b nFrameInterval -* are set to zero (0), the default implementation-defined duration and frame interval are used. -* -* The \b pDesiredFrameSize parameter allows to define the desired video frame size. -* Frame width and height must be a multiple of 16 (OGG Theora video codec's requirement). -* If they are not, they are modified automatically to be a multiple of 16. -* -* To preserve correct aspect ratio of the captured area, set \b pDesiredFrameSize->cx or \b pDesiredFrameSize->cy -* to zero. For example, setting \b pDesiredFrameSize->cx=640 and \b pDesiredFrameSize->cy=0 -* results in video frames whose width is 640 pixels and height is calculated to preserve the -* correct aspect ratio of the captured area. If both \b cx and \b cy are specified, the aspect ratio -* of the captured area is not preserved. -* -* Setting the \b pDesiredFrameSize -* parameter to \a NULL makes the function to determine the best video frame size automatically. -* -* This function can be used to record the state of end user's desktop just before the moment -* of crash and add the video file to the error report. The recorded information may help the -* software vendor to better understand the state of the client application at the moment of -* crash and reproduce the error. -* -* When this function is called, CrashRpt launches another process named \b CrashSender.exe. -* The \b CrashSender.exe process then continuously captures the desktop screenshots in background -* mode and stores them to disk as image files. To avoid high CPU load, image files are stored -* in uncompressed state as raw bitmap (BMP) files. When the count of screenshot files exceeds -* the predefined maximum number, the old screenshot files are reused cyclically. -* -* If the client application does not crash and its main code or main window loop exits successfully, -* the captured desktop screenshot files are removed by the \ref crUninstall() function call and -* \b CrashSender.exe process is terminated. -* -* If the client application crashes at some moment of time, the recorded screenshot files are compressed by -* OGG Theora video codec and written into an .OGG file. The -* uncompressed temporary screenshots are then removed, and the resulting -* OGG file is included into crash report archive. -* -* The OGG video format is a widely used -* video container provided by the open-source OGG Project. -* OGG files can be opened in a browser like Google Chrome or Mozilla Firefox or in -* another video player understanding this format, like ffmpeg. -* -* Use this function only when necessary, because it may cause end user's computer performance -* loss. It also requires some amount of free disk space. -* -* The recorded video may contain user-identifying or private information. Always -* specify the purposes you will use collected information for in your Privacy Policy. -* -* Usage example: -* -* \code -* -* // First install CrashRpt with crInstall() function -* -* ... -* -* SIZE FrameSize = {0, 600}; // Frames 600 px in height -* // Frame width is calculated automatically -* -* // Start capturing desktop. Desktop capture video will -* // be added to crash report on crash -* int nResult = crAddVideo( -* CR_AV_VIRTUAL_SCREEN|CR_AV_QUALITY_GOOD, // Capture entire desktop -* // Good encoding quality -* 10000, // 10 seconds long video -* 300, // 300 msec between frames (3.33 FPS) -* &FrameSize, -* NULL -* ); -* -* \endcode -* -* \sa -* crAddFile2(), crAddScreenshot2(), crAddRegKey(), crUninstall(). -*/ - -CRASHRPTAPI(int) -crAddVideo( - DWORD dwFlags, - int nDuration, - int nFrameInterval, - PSIZE pDesiredFrameSize, - HWND hWndParent - ); - -/*! \ingroup CrashRptAPI -* \brief Adds a string property to the crash report. -* -* \return This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* \param[in] pszPropName Name of the property, required. -* \param[in] pszPropValue Value of the property, required. -* -* \remarks -* -* Use this function to add a string property to the crash description XML file. -* User-added properties are listed under \ tag of the XML file. -* In the XML file properties are ordered by names in alphabetic order. -* -* The following example shows how to add information about the amount of free disk space -* to the crash description XML file: -* -* \code -* // It is assumed that you already calculated the amount of free disk space, -* // converted it to text and stored it as szFreeSpace string. -* LPCTSTR szFreeSpace = _T("0 Kb"); -* crAddProperty(_T("FreeDiskSpace"), szFreeSpace); -* -* \endcode -* -* \sa -* crAddFile2(), crAddScreenshot() -*/ - -CRASHRPTAPI(int) -crAddPropertyW( - LPCWSTR pszPropName, - LPCWSTR pszPropValue - ); - -/*! \ingroup CrashRptAPI -* \copydoc crAddPropertyW() -*/ - -CRASHRPTAPI(int) -crAddPropertyA( - LPCSTR pszPropName, - LPCSTR pszPropValue - ); - -/*! \brief Character set-independent mapping of crAddPropertyW() and crAddPropertyA() functions. -* \ingroup CrashRptAPI -*/ -#ifdef UNICODE -#define crAddProperty crAddPropertyW -#else -#define crAddProperty crAddPropertyA -#endif //UNICODE - -// Flags that can be passed to crAddRegKey() function -#define CR_AR_ALLOW_DELETE 0x1 //!< If this flag is specified, the file will be deletable from context menu of Error Report Details dialog. - -/*! \ingroup CrashRptAPI -* \brief Adds a registry key dump to the crash report. -* -* \return This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* \param[in] pszRegKey Registry key to dump, required. -* \param[in] pszDstFileName Name of the destination file, required. -* \param[in] dwFlags Flags, reserved. -* -* \remarks -* -* Use this function to add a dump of a Windows registry key into the crash report. This function -* is available since v.1.2.6. -* -* The \a pszRegKey parameter must be the name of the registry key. The key name should begin with "HKEY_CURRENT_USER" -* or "HKEY_LOCAL_MACHINE". Other root keys are not supported. -* -* The content of the key specified by the \a pszRegKey parameter will be stored in a human-readable XML -* format and included into the error report as \a pszDstFileName destination file. You can dump multiple registry keys -* to the same destination file. -* -* The \a dwFlags parameter can be either set to zero (no flags) or with the following constant: -* -* - \ref CR_AR_ALLOW_DELETE allows the user to delete the file from error report using context menu of Error Report Details dialog. -* -* The following example shows how to dump two registry keys to a single \a regkey.xml file: -* -* \code -* -* crAddRegKey(_T("HKEY_CURRENT_USER\\Software\\MyApp"), _T("regkey.xml"), 0); -* crAddRegKey(_T("HKEY_LOCAL_MACHINE\\Software\\MyApp"), _T("regkey.xml"), 0); -* -* \endcode -* -* \sa -* crAddFile2(), crAddScreenshot(), crAddProperty() -*/ - -CRASHRPTAPI(int) -crAddRegKeyW( - LPCWSTR pszRegKey, - LPCWSTR pszDstFileName, - DWORD dwFlags - ); - -/*! \ingroup CrashRptAPI -* \copydoc crAddRegKeyW() -*/ - -CRASHRPTAPI(int) -crAddRegKeyA( - LPCSTR pszRegKey, - LPCSTR pszDstFileName, - DWORD dwFlags - ); - -/*! \brief Character set-independent mapping of crAddRegKeyW() and crAddRegKeyA() functions. -* \ingroup CrashRptAPI -*/ -#ifdef UNICODE -#define crAddRegKey crAddRegKeyW -#else -#define crAddRegKey crAddRegKeyA -#endif //UNICODE - -/*! \ingroup CrashRptAPI -* \brief Manually generates an error report. -* -* \return This function returns zero if succeeded. When failed, it returns a non-zero value. -* Use crGetLastErrorMsg() function to retrieve the error message. -* -* \param[in] pExceptionInfo Exception information. -* -* \remarks -* -* Call this function to manually generate a crash report. When crash information is collected, -* control is returned to the caller. The crGenerateErrorReport() doesn't terminate the caller process. -* -* The crash report may contain the crash minidump file, crash description file in XML format and -* additional custom files added with a function like crAddFile2(). -* -* The exception information should be passed using \ref CR_EXCEPTION_INFO structure. -* -* The following example shows how to use crGenerateErrorReport() function. -* -* \code -* CR_EXCEPTION_INFO ei; -* memset(&ei, 0, sizeof(CR_EXCEPTION_INFO)); -* ei.cb = sizeof(CR_EXCEPTION_INFO); -* ei.exctype = CR_SEH_EXCEPTION; -* ei.code = 1234; -* ei.pexcptrs = NULL; -* -* int result = crGenerateErrorReport(&ei); -* -* if(result!=0) -* { -* // If goes here, crGenerateErrorReport() has failed -* // Get the last error message -* TCHAR szErrorMsg[256]; -* crGetLastErrorMsg(szErrorMsg, 256); -* } -* -* // Manually terminate program -* ExitProcess(0); -* -* \endcode -*/ - -CRASHRPTAPI(int) -crGenerateErrorReport( - __in_opt CR_EXCEPTION_INFO* pExceptionInfo - ); - -/*! \ingroup CrashRptAPI -* \brief Can be used as a SEH exception filter. -* -* \return This function returns \c EXCEPTION_EXECUTE_HANDLER if succeeds; otherwise \c EXCEPTION_CONTINUE_SEARCH. -* -* \param[in] code Exception code. -* \param[in] ep Exception pointers. -* -* \remarks -* -* This function can be called instead of a SEH exception filter -* inside of __try{}__except(Expression){} construction. The function generates an error report -* and returns control to the exception handler block. -* -* The exception code is usually retrieved with \b GetExceptionCode() intrinsic function -* and the exception pointers are retrieved with \b GetExceptionInformation() intrinsic -* function. -* -* If an error occurs, this function returns \c EXCEPTION_CONTINUE_SEARCH. -* Use crGetLastErrorMsg() to retrieve the error message on fail. -* -* The following example shows how to use crExceptionFilter(). -* -* \code -* int* p = NULL; // pointer to NULL -* __try -* { -* *p = 13; // causes an access violation exception; -* } -* __except(crExceptionFilter(GetExceptionCode(), GetExceptionInformation())) -* { -* // Terminate program -* ExitProcess(1); -* } -* -* \endcode -*/ - -CRASHRPTAPI(int) -crExceptionFilter( - unsigned int code, - __in_opt struct _EXCEPTION_POINTERS* ep); - - -// Flags used by crEmulateCrash() function -#define CR_NONCONTINUABLE_EXCEPTION 32 //!< Non continuable sofware exception. -#define CR_THROW 33 //!< Throw C++ typed exception. -#define CR_STACK_OVERFLOW 34 //!< Stack overflow. - -/*! \ingroup CrashRptAPI -* \brief Emulates a predefined crash situation. -* -* \return This function doesn't return if succeded. If failed, returns non-zero value. Call crGetLastErrorMsg() -* to get the last error message. -* -* \param[in] ExceptionType Type of crash. -* -* \remarks -* -* This function uses some a priori incorrect or vulnerable code or raises a C++ signal or raises an uncontinuable -* software exception to cause crash. -* -* This function can be used to test if CrashRpt handles a crash situation correctly. -* -* CrashRpt will intercept an error or exception if crInstall() and/or crInstallToCurrentThread2() -* were previously called. crInstall() installs exception handlers that function on per-process basis. -* crInstallToCurrentThread2() installs exception handlers that function on per-thread basis. -* -* \a ExceptionType can be one of the following constants: -* - \ref CR_SEH_EXCEPTION This will generate a null pointer exception. -* - \ref CR_CPP_TERMINATE_CALL This results in call of terminate() C++ function. -* - \ref CR_CPP_UNEXPECTED_CALL This results in call of unexpected() C++ function. -* - \ref CR_CPP_PURE_CALL This emulates a call of pure virtual method call of a C++ class instance (Visual Studio .NET 2003 and later). -* - \ref CR_CPP_NEW_OPERATOR_ERROR This emulates C++ new operator failure (Visual Studio .NET 2003 and later). -* - \ref CR_CPP_SECURITY_ERROR This emulates copy of large amount of data to a small buffer (Visual Studio .NET 2003 only). -* - \ref CR_CPP_INVALID_PARAMETER This emulates an invalid parameter C++ exception (Visual Studio 2005 and later). -* - \ref CR_CPP_SIGABRT This raises SIGABRT signal (abnormal program termination). -* - \ref CR_CPP_SIGFPE This causes floating point exception. -* - \ref CR_CPP_SIGILL This raises SIGILL signal (illegal instruction signal). -* - \ref CR_CPP_SIGINT This raises SIGINT signal. -* - \ref CR_CPP_SIGSEGV This raises SIGSEGV signal. -* - \ref CR_CPP_SIGTERM This raises SIGTERM signal (program termination request). -* - \ref CR_NONCONTINUABLE_EXCEPTION This raises a noncontinuable software exception (expected result -* is the same as in \ref CR_SEH_EXCEPTION). -* - \ref CR_THROW This throws a C++ typed exception (expected result is the same as in \ref CR_CPP_TERMINATE_CALL). -* - \ref CR_STACK_OVERFLOW This causes stack overflow. -* -* The \ref CR_SEH_EXCEPTION uses null pointer write operation to cause the access violation. -* -* The \ref CR_NONCONTINUABLE_EXCEPTION has the same effect as \ref CR_SEH_EXCEPTION, but it uses -* \b RaiseException() WinAPI function to raise noncontinuable software exception. -* -* The following example shows how to use crEmulateCrash() function. -* -* \code -* // emulate null pointer exception (access violation) -* crEmulateCrash(CR_SEH_EXCEPTION); -* \endcode -* -*/ - -CRASHRPTAPI(int) -crEmulateCrash( - unsigned ExceptionType) throw (...); - - - -/*! \ingroup CrashRptAPI -* \brief Gets the last CrashRpt error message. -* -* \return This function returns length of error message in characters. If output buffer is invalid, returns a negative number. -* -* \param[out] pszBuffer Pointer to the buffer. -* \param[in] uBuffSize Size of buffer in characters. -* -* \remarks -* -* This function gets the last CrashRpt error message. You can use this function -* to retrieve the text status of the last called CrashRpt function. -* -* If buffer is too small for the error message, the message is truncated. -* -* crGetLastErrorMsgW() and crGetLastErrorMsgA() are wide-character and multi-byte character versions -* of crGetLastErrorMsg(). The crGetLastErrorMsg() macro defines character set independent mapping. -* -* The following example shows how to use crGetLastErrorMsg() function. -* -* \code -* -* // .. call some CrashRpt function -* -* // Get the status message -* TCHAR szErrorMsg[256]; -* crGetLastErrorMsg(szErrorMsg, 256); -* \endcode -* -* \sa crGetLastErrorMsgA(), crGetLastErrorMsgW(), crGetLastErrorMsg() -*/ - -CRASHRPTAPI(int) -crGetLastErrorMsgW( - __out_ecount_z(uBuffSize) LPWSTR pszBuffer, - UINT uBuffSize); - -/*! \ingroup CrashRptAPI -* \copydoc crGetLastErrorMsgW() -* -*/ - -CRASHRPTAPI(int) -crGetLastErrorMsgA( - __out_ecount_z(uBuffSize) LPSTR pszBuffer, - UINT uBuffSize); - -/*! \brief Defines character set-independent mapping for crGetLastErrorMsgW() and crGetLastErrorMsgA(). -* \ingroup CrashRptAPI -*/ - -#ifdef UNICODE -#define crGetLastErrorMsg crGetLastErrorMsgW -#else -#define crGetLastErrorMsg crGetLastErrorMsgA -#endif //UNICODE - - -//// Helper wrapper classes - -#ifndef _CRASHRPT_NO_WRAPPERS - -/*! \class CrAutoInstallHelper -* \ingroup CrashRptWrappers -* \brief Installs exception handlers in constructor and uninstalls in destructor. -* \remarks -* Use this class to easily install/uninstall exception handlers in you \b main() -* or \b WinMain() function. -* -* This wrapper class calls crInstall() in its constructor and calls crUninstall() in -* its destructor. -* -* Use CrAutoInstallHelper::m_nInstallStatus member to check the return status of crInstall(). -* -* Example: -* -* \code -* #include -* -* void main() -* { -* CR_INSTALL_INFO info; -* memset(&info, 0, sizeof(CR_INSTALL_INFO)); -* info.cb = sizeof(CR_INSTALL_INFO); -* info.pszAppName = _T("My App Name"); -* info.pszAppVersion = _T("1.2.3"); -* info.pszEmailSubject = "Error Report from My App v.1.2.3"; -* // The address to send reports by E-mail -* info.pszEmailTo = _T("myname@hotmail.com"); -* // The URL to send reports via HTTP connection -* info.pszUrl = _T("http://myappname.com/utils/crashrpt.php"); -* info.pfnCrashCallback = CrashCallback; -* info.uPriorities[CR_HTTP] = 3; // Try HTTP first -* info.uPriorities[CR_SMTP] = 2; // Try SMTP second -* info.uPriorities[CR_SMAPI] = 1; // Try system email program last -* -* // Install crash reporting -* CrAutoInstallHelper cr_install_helper(&info); -* // Check that installed OK -* assert(cr_install_helper.m_nInstallStatus==0); -* -* // Your code follows here ... -* -* } -* \endcode -*/ - -class CrAutoInstallHelper -{ -public: - - //! Installs exception handlers to the caller process - CrAutoInstallHelper(__in PCR_INSTALL_INFOA pInfo) - { - m_nInstallStatus = crInstallA(pInfo); - } - - //! Installs exception handlers to the caller process - CrAutoInstallHelper(__in PCR_INSTALL_INFOW pInfo) - { - m_nInstallStatus = crInstallW(pInfo); - } - - //! Uninstalls exception handlers from the caller process - ~CrAutoInstallHelper() - { - if(m_nInstallStatus==0) - crUninstall(); - } - - //! Install status - int m_nInstallStatus; -}; - -/*! \class CrThreadAutoInstallHelper -* \ingroup CrashRptWrappers -* \brief Installs (uninstalls) exception handlers for the caller thread in class' constructor (destructor). -* -* \remarks -* -* This wrapper class calls crInstallToCurrentThread2() in its constructor and -* calls crUninstallFromCurrentThread() in its destructor. -* -* Use CrThreadAutoInstallHelper::m_nInstallStatus member to check -* the return status of crInstallToCurrentThread2(). -* -* Example: -* -* \code -* DWORD WINAPI ThreadProc(LPVOID lpParam) -* { -* CrThreadAutoInstallHelper cr_thread_install_helper(); -* assert(cr_thread_install_helper.m_nInstallStatus==0); -* -* // Your code follows here ... -* } -* \endcode -*/ - -class CrThreadAutoInstallHelper -{ -public: - - //! Installs exception handlers to the caller thread - CrThreadAutoInstallHelper(DWORD dwFlags=0) - { - m_nInstallStatus = crInstallToCurrentThread2(dwFlags); - } - - //! Uninstalls exception handlers from the caller thread - ~CrThreadAutoInstallHelper() - { - if (m_nInstallStatus == 0) - crUninstallFromCurrentThread(); - } - - //! Install status - int m_nInstallStatus; -}; - -#endif //!_CRASHRPT_NO_WRAPPERS - -#endif //_CRASHRPT_H_ - - diff --git a/OpenSauce/shared/Include/GWEN/Align.h b/OpenSauce/shared/Include/GWEN/Align.h deleted file mode 100644 index d181adec9..000000000 --- a/OpenSauce/shared/Include/GWEN/Align.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_ALIGN_H -#define GWEN_ALIGN_H -#include "Gwen/Controls/Base.h" - -namespace Gwen -{ - namespace Align - { - inline void PlaceBelow( Controls::Base* ctrl, Controls::Base* below, int iBorder = 0 ) - { - ctrl->SetPos( ctrl->X(), below->Bottom() + iBorder ); - } - } -} -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/Anim.cpp b/OpenSauce/shared/Include/GWEN/Anim.cpp deleted file mode 100644 index 1c5d5fa65..000000000 --- a/OpenSauce/shared/Include/GWEN/Anim.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Anim.h" -#include "Gwen/Utility.h" -#include - -using namespace Gwen; - -#ifndef GWEN_NO_ANIMATION - -static Gwen::Anim::Animation::List g_Animations; -static Gwen::Anim::Animation::ChildList g_AnimationsListed; - -void Gwen::Anim::Add( Gwen::Controls::Base* control, Animation* animation ) -{ - animation->m_Control = control; - g_Animations[control].push_back( animation ); -} - -void Gwen::Anim::Cancel( Gwen::Controls::Base* control ) -{ - /* cannot use std::list iterator with algoryhtmns based on pointers - struct AnimDeletePredicate - { - AnimDeletePredicate( Gwen::Controls::Base* control ) - { - this->control = control; - } - - bool operator() ( Gwen::Anim::Animation* anim ) - { - return anim->m_Control == control; - } - - Gwen::Controls::Base* control; - }; - - std::remove_if ( g_Animations.begin(), g_Animations.end(), AnimDeletePredicate( control ) ); - */ - Gwen::Anim::Animation::List::iterator iAnimations; - - if ( ( iAnimations = g_Animations.find( control ) ) != g_Animations.end() ) - { - Gwen::Anim::Animation::ChildList & ChildAnimationsForControl = iAnimations->second; - Gwen::Anim::Animation::ChildList::iterator iAnimationChild = ChildAnimationsForControl.begin(); - - if ( iAnimationChild != ChildAnimationsForControl.end() ) - { - do - { - delete( *iAnimationChild ); - } - while ( ++iAnimationChild != ChildAnimationsForControl.end() ); - } - - g_Animations.erase( iAnimations ); - } -} - -void Gwen::Anim::Think() -{ - Gwen::Anim::Animation::List::iterator it = g_Animations.begin(); - - if ( it != g_Animations.end() ) - { - Gwen::Anim::Animation::ChildList::iterator itChild; - Gwen::Anim::Animation* anim; - - do - { - if ( ( itChild = it->second.begin() ) != it->second.end() ) - { - do - { - anim = *itChild; - anim->Think(); - - if ( anim->Finished() ) - { - itChild = it->second.erase( itChild ); - delete anim; - } - else - { - ++itChild; - } - } - while ( itChild != it->second.end() ); - } - } - while ( ++it != g_Animations.end() ); - } -} - -Gwen::Anim::TimedAnimation::TimedAnimation( float fLength, float fDelay, float fEase ) -{ - m_fStart = Platform::GetTimeInSeconds() + fDelay; - m_fEnd = m_fStart + fLength; - m_fEase = fEase; - m_bStarted = false; - m_bFinished = false; -} - -float GetEased( float fTime, float fEase ) -{ - // Ease in and Out if ease is < 0 - if ( fEase < 0 ) - { return -fTime / 2 * ( cos( 3.14159f * fTime ) - 1 ); } - - return pow( fTime, fEase ); -} - -void Gwen::Anim::TimedAnimation::Think() -{ - if ( m_bFinished ) { return; } - - float fCurrent = Platform::GetTimeInSeconds(); - float fSecondsIn = fCurrent - m_fStart; - - if ( fSecondsIn < 0.0f ) { return; } - - if ( !m_bStarted ) - { - m_bStarted = true; - OnStart(); - } - - float fDelta = fSecondsIn / ( m_fEnd - m_fStart ); - - if ( fDelta < 0.0f ) { fDelta = 0.0f; } - - if ( fDelta > 1.0f ) { fDelta = 1.0f; } - - float fEased = GetEased( fDelta, m_fEase ); - Run( fEased ); - - if ( fDelta == 1.0f ) - { - m_bFinished = true; - OnFinish(); - } -} - -bool Gwen::Anim::TimedAnimation::Finished() -{ - return m_bFinished; -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Anim.h b/OpenSauce/shared/Include/GWEN/Anim.h deleted file mode 100644 index d16b07a74..000000000 --- a/OpenSauce/shared/Include/GWEN/Anim.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_ANIM_H -#define GWEN_ANIM_H -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Platform.h" - -#ifndef GWEN_NO_ANIMATION - -namespace Gwen -{ - namespace Anim - { - class GWEN_EXPORT Animation - { - public: - - typedef std::list ChildList; - typedef std::map< Gwen::Controls::Base*, ChildList > List; - - virtual void Think() = 0; - virtual bool Finished() { return false; } - - virtual ~Animation() {} - - Gwen::Controls::Base* m_Control; - }; - - GWEN_EXPORT void Add( Gwen::Controls::Base* control, Animation* animation ); - GWEN_EXPORT void Cancel( Gwen::Controls::Base* control ); - GWEN_EXPORT void Think(); - - // - // Timed animation. Provides a useful base for animations. - // - class GWEN_EXPORT TimedAnimation : public Animation - { - public: - - TimedAnimation( float fLength, float fDelay = 0.0f, float fEase = -1.0f ); - - virtual void Think(); - virtual bool Finished(); - - // - // These are the magic functions you should be overriding - // - virtual void OnStart() {} - virtual void Run( float /*delta*/ ) {} - virtual void OnFinish() {} - - protected: - - bool m_bStarted; - bool m_bFinished; - float m_fStart; - float m_fEnd; - float m_fEase; - }; - - namespace Size - { - class GWEN_EXPORT Height : public TimedAnimation - { - public: - - Height( int iStartSize, int iEndSize, float fLength, bool bHide = false, float fDelay = 0.0f, float fEase = -1.0f ) : TimedAnimation( fLength, fDelay, fEase ) - { - m_iStartSize = iStartSize; - m_iDelta = iEndSize - m_iStartSize; - m_bHide = bHide; - } - - virtual void OnStart() { m_Control->SetHeight( m_iStartSize ); } - virtual void Run( float delta ) { m_Control->SetHeight( m_iStartSize + ( ( ( float ) m_iDelta ) * delta ) ); } - virtual void OnFinish() { m_Control->SetHeight( m_iStartSize + m_iDelta ); m_Control->SetHidden( m_bHide ); } - - protected: - - int m_iStartSize; - int m_iDelta; - bool m_bHide; - }; - - class Width : public TimedAnimation - { - public: - - Width( int iStartSize, int iEndSize, float fLength, bool bHide = false, float fDelay = 0.0f, float fEase = -1.0f ) : TimedAnimation( fLength, fDelay, fEase ) - { - m_iStartSize = iStartSize; - m_iDelta = iEndSize - m_iStartSize; - m_bHide = bHide; - } - - virtual void OnStart() { m_Control->SetWidth( m_iStartSize ); } - virtual void Run( float delta ) { m_Control->SetWidth( m_iStartSize + ( ( ( float ) m_iDelta ) * delta ) ); } - virtual void OnFinish() { m_Control->SetWidth( m_iStartSize + m_iDelta ); m_Control->SetHidden( m_bHide ); } - - protected: - - int m_iStartSize; - int m_iDelta; - bool m_bHide; - }; - } - - namespace Pos - { - class GWEN_EXPORT X : public Anim::TimedAnimation - { - public: - - X( int iStartSize, int iEndSize, float fLength, bool bHide = false, float fDelay = 0.0f, float fEase = 1.0f ) : TimedAnimation( fLength, fDelay, fEase ) - { - m_iStartSize = iStartSize; - m_iDelta = iEndSize - m_iStartSize; - m_bHide = bHide; - } - - virtual void OnStart() { m_Control->SetPos( m_iStartSize, m_Control->GetPos().y ); } - virtual void Run( float delta ) { m_Control->SetPos( m_iStartSize + ( ( ( float ) m_iDelta ) * delta ), m_Control->GetPos().y ); } - virtual void OnFinish() { m_Control->SetPos( m_iStartSize + m_iDelta, m_Control->GetPos().y ); m_Control->SetHidden( m_bHide ); } - - protected: - - int m_iStartSize; - int m_iDelta; - bool m_bHide; - }; - - class Y : public Anim::TimedAnimation - { - public: - - Y( int iStartSize, int iEndSize, float fLength, bool bHide = false, float fDelay = 0.0f, float fEase = 1.0f ) : TimedAnimation( fLength, fDelay, fEase ) - { - m_iStartSize = iStartSize; - m_iDelta = iEndSize - m_iStartSize; - m_bHide = bHide; - } - - virtual void OnStart() { m_Control->SetPos( m_Control->GetPos().x, m_iStartSize ); } - virtual void Run( float delta ) { m_Control->SetPos( m_Control->GetPos().x, m_iStartSize + ( ( ( float ) m_iDelta ) * delta ) ); } - virtual void OnFinish() { m_Control->SetPos( m_Control->GetPos().x, m_iStartSize + m_iDelta ); m_Control->SetHidden( m_bHide ); } - - protected: - - int m_iStartSize; - int m_iDelta; - bool m_bHide; - }; - } - - namespace Tools - { - class Remove : public TimedAnimation - { - public: - - Remove( float fDelay = 0.0f ) : TimedAnimation( 0.0f, fDelay ) {} - virtual void OnFinish() { m_Control->DelayedDelete(); } - }; - } - - - } -} - -#endif -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/BaseRender.cpp b/OpenSauce/shared/Include/GWEN/BaseRender.cpp deleted file mode 100644 index 3f67eb7e8..000000000 --- a/OpenSauce/shared/Include/GWEN/BaseRender.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/BaseRender.h" -#include "Gwen/Utility.h" -#include "Gwen/Platform.h" - -#include - -namespace Gwen -{ - namespace Renderer - { - - Base::Base() - { - m_RenderOffset = Gwen::Point( 0, 0 ); - m_fScale = 1.0f; - } - - Base::~Base() - { - if ( GetCTT() ) - { GetCTT()->ShutDown(); } - } - - void Base::RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::String & text ) - { - Gwen::UnicodeString str = Gwen::Utility::StringToUnicode( text ); - RenderText( pFont, pos, str ); - } - - Gwen::Point Base::MeasureText( Gwen::Font* pFont, const Gwen::String & text ) - { - Gwen::UnicodeString str = Gwen::Utility::StringToUnicode( text ); - return MeasureText( pFont, str ); - } - - void Base::DrawLinedRect( Gwen::Rect rect ) - { - DrawFilledRect( Gwen::Rect( rect.x, rect.y, rect.w, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x, rect.y + rect.h - 1, rect.w, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x, rect.y, 1, rect.h ) ); - DrawFilledRect( Gwen::Rect( rect.x + rect.w - 1, rect.y, 1, rect.h ) ); - }; - - void Base::DrawPixel( int x, int y ) - { - DrawFilledRect( Gwen::Rect( x, y, 1, 1 ) ); - } - - void Base::DrawShavedCornerRect( Gwen::Rect rect, bool bSlight ) - { - // Draw INSIDE the w/h. - rect.w -= 1; - rect.h -= 1; - - if ( bSlight ) - { - DrawFilledRect( Gwen::Rect( rect.x + 1, rect.y, rect.w - 1, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x + 1, rect.y + rect.h, rect.w - 1, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x, rect.y + 1, 1, rect.h - 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x + rect.w, rect.y + 1, 1, rect.h - 1 ) ); - return; - } - - DrawPixel( rect.x + 1, rect.y + 1 ); - DrawPixel( rect.x + rect.w - 1, rect.y + 1 ); - DrawPixel( rect.x + 1, rect.y + rect.h - 1 ); - DrawPixel( rect.x + rect.w - 1, rect.y + rect.h - 1 ); - DrawFilledRect( Gwen::Rect( rect.x + 2, rect.y, rect.w - 3, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x + 2, rect.y + rect.h, rect.w - 3, 1 ) ); - DrawFilledRect( Gwen::Rect( rect.x, rect.y + 2, 1, rect.h - 3 ) ); - DrawFilledRect( Gwen::Rect( rect.x + rect.w, rect.y + 2, 1, rect.h - 3 ) ); - } - - void Base::Translate( int & x, int & y ) - { - x += m_RenderOffset.x; - y += m_RenderOffset.y; - x = ceilf( ( ( float ) x ) * m_fScale ); - y = ceilf( ( ( float ) y ) * m_fScale ); - } - - void Base::Translate( Gwen::Rect & rect ) - { - Translate( rect.x, rect.y ); - rect.w = ceilf( ( ( float ) rect.w ) * m_fScale ); - rect.h = ceilf( ( ( float ) rect.h ) * m_fScale ); - } - - void Gwen::Renderer::Base::SetClipRegion( Gwen::Rect rect ) - { - m_rectClipRegion = rect; - } - - void Base::AddClipRegion( Gwen::Rect rect ) - { - rect.x = m_RenderOffset.x; - rect.y = m_RenderOffset.y; - Gwen::Rect out = rect; - - if ( rect.x < m_rectClipRegion.x ) - { - out.w -= ( m_rectClipRegion.x - out.x ); - out.x = m_rectClipRegion.x; - } - - if ( rect.y < m_rectClipRegion.y ) - { - out.h -= ( m_rectClipRegion.y - out.y ); - out.y = m_rectClipRegion.y; - } - - if ( rect.x + rect.w > m_rectClipRegion.x + m_rectClipRegion.w ) - { - out.w = ( m_rectClipRegion.x + m_rectClipRegion.w ) - out.x; - } - - if ( rect.y + rect.h > m_rectClipRegion.y + m_rectClipRegion.h ) - { - out.h = ( m_rectClipRegion.y + m_rectClipRegion.h ) - out.y; - } - - m_rectClipRegion = out; - } - - const Gwen::Rect & Base::ClipRegion() const - { - return m_rectClipRegion; - } - - bool Base::ClipRegionVisible() - { - if ( m_rectClipRegion.w <= 0 || m_rectClipRegion.h <= 0 ) - { return false; } - - return true; - } - - void Base::DrawMissingImage( Gwen::Rect pTargetRect ) - { - SetDrawColor( Colors::Red ); - DrawFilledRect( pTargetRect ); - } - - - /* - If they haven't defined these font functions in their renderer code - we just draw some rects where the letters would be to give them an idea. - */ - - void Base::RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::UnicodeString & text ) - { - float fSize = pFont->size * Scale(); - - for ( float i = 0; i < text.length(); i++ ) - { - wchar_t chr = text[i]; - - if ( chr == ' ' ) { continue; } - - Gwen::Rect r( pos.x + i * fSize * 0.4, pos.y, fSize * 0.4 - 1, fSize ); - - /* - This isn't important, it's just me messing around changing the - shape of the rect based on the letter.. just for fun. - */ - if ( chr == 'l' || chr == 'i' || chr == '!' || chr == 't' ) - { - r.w = 1; - } - else if ( chr >= 'a' && chr <= 'z' ) - { - r.y += fSize * 0.5f; - r.h -= fSize * 0.4f; - } - else if ( chr == '.' || chr == ',' ) - { - r.x += 2; - r.y += r.h - 2; - r.w = 2; - r.h = 2; - } - else if ( chr == '\'' || chr == '`' || chr == '"' ) - { - r.x += 3; - r.w = 2; - r.h = 2; - } - - if ( chr == 'o' || chr == 'O' || chr == '0' ) - { DrawLinedRect( r ); } - else - { DrawFilledRect( r ); } - } - } - - Gwen::Point Base::MeasureText( Gwen::Font* pFont, const Gwen::UnicodeString & text ) - { - Gwen::Point p; - p.x = pFont->size * Scale() * ( float ) text.length() * 0.4; - p.y = pFont->size * Scale(); - return p; - } - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/BaseRender.h b/OpenSauce/shared/Include/GWEN/BaseRender.h deleted file mode 100644 index 693aff3bf..000000000 --- a/OpenSauce/shared/Include/GWEN/BaseRender.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_BASERENDER_H -#define GWEN_BASERENDER_H - -#include "Gwen/Structures.h" - -namespace Gwen -{ - struct Font; - struct Texture; - class WindowProvider; - - namespace Renderer - { - class Base; - - class ICacheToTexture - { - public: - - virtual ~ICacheToTexture() {} - virtual void Initialize() = 0; - virtual void ShutDown() = 0; - virtual void SetupCacheTexture( Gwen::Controls::Base* control ) = 0; - virtual void FinishCacheTexture( Gwen::Controls::Base* control ) = 0; - virtual void DrawCachedControlTexture( Gwen::Controls::Base* control ) = 0; - virtual void CreateControlCacheTexture( Gwen::Controls::Base* control ) = 0; - virtual void UpdateControlCacheTexture( Gwen::Controls::Base* control ) = 0; - virtual void SetRenderer( Gwen::Renderer::Base* renderer ) = 0; - - }; - - class GWEN_EXPORT Base - { - public: - - Base(); - virtual ~Base(); - - virtual void Init() {}; - - virtual void Begin() {}; - virtual void End() {}; - - virtual void SetDrawColor( Color color ) {}; - - virtual void DrawFilledRect( Gwen::Rect rect ) {};; - - virtual void StartClip() {}; - virtual void EndClip() {}; - - virtual void LoadTexture( Gwen::Texture* pTexture ) {}; - virtual void FreeTexture( Gwen::Texture* pTexture ) {}; - virtual void DrawTexturedRect( Gwen::Texture* pTexture, Gwen::Rect pTargetRect, float u1 = 0.0f, float v1 = 0.0f, float u2 = 1.0f, float v2 = 1.0f ) {}; - virtual void DrawMissingImage( Gwen::Rect pTargetRect ); - virtual Gwen::Color PixelColour( Gwen::Texture* pTexture, unsigned int x, unsigned int y, const Gwen::Color & col_default = Gwen::Color( 255, 255, 255, 255 ) ) { return col_default; } - - virtual ICacheToTexture* GetCTT() { return NULL; } - - virtual void LoadFont( Gwen::Font* pFont ) {}; - virtual void FreeFont( Gwen::Font* pFont ) {}; - virtual void RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::UnicodeString & text ); - virtual Gwen::Point MeasureText( Gwen::Font* pFont, const Gwen::UnicodeString & text ); - - // - // No need to implement these functions in your derived class, but if - // you can do them faster than the default implementation it's a good idea to. - // - virtual void DrawLinedRect( Gwen::Rect rect ); - virtual void DrawPixel( int x, int y ); - virtual void DrawShavedCornerRect( Gwen::Rect rect, bool bSlight = false ); - virtual Gwen::Point MeasureText( Gwen::Font* pFont, const Gwen::String & text ); - virtual void RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::String & text ); - - public: - - // - // Translate a panel's local drawing coordinate - // into view space, taking Offset's into account. - // - void Translate( int & x, int & y ); - void Translate( Gwen::Rect & rect ); - - // - // Set the rendering offset. You shouldn't have to - // touch these, ever. - // - void SetRenderOffset( const Gwen::Point & offset ) { m_RenderOffset = offset; } - void AddRenderOffset( const Gwen::Rect & offset ) { m_RenderOffset.x += offset.x; m_RenderOffset.y += offset.y; } - const Gwen::Point & GetRenderOffset() const { return m_RenderOffset; } - - private: - - Gwen::Point m_RenderOffset; - - public: - - void SetClipRegion( Gwen::Rect rect ); - void AddClipRegion( Gwen::Rect rect ); - bool ClipRegionVisible(); - const Gwen::Rect & ClipRegion() const; - - private: - - Gwen::Rect m_rectClipRegion; - ICacheToTexture* m_RTT; - - public: - - void SetScale( float fScale ) { m_fScale = fScale; } - float Scale() const { return m_fScale; } - - float m_fScale; - - - public: - - // - // Self Initialization, shutdown - // - - virtual bool InitializeContext( Gwen::WindowProvider* pWindow ) { return false; } - virtual bool ShutdownContext( Gwen::WindowProvider* pWindow ) { return false; } - virtual bool ResizedContext( Gwen::WindowProvider* pWindow, int w, int h ) { return false; } - - virtual bool BeginContext( Gwen::WindowProvider* pWindow ) { return false; } - virtual bool EndContext( Gwen::WindowProvider* pWindow ) { return false; } - virtual bool PresentContext( Gwen::WindowProvider* pWindow ) { return false; } - - - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Config.h b/OpenSauce/shared/Include/GWEN/Config.h deleted file mode 100644 index 967df673d..000000000 --- a/OpenSauce/shared/Include/GWEN/Config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONFIG_H -#define GWEN_CONFIG_H - -// -// Disables animation functions. -// -//#define GWEN_NO_ANIMATION - -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/ControlList.cpp b/OpenSauce/shared/Include/GWEN/ControlList.cpp deleted file mode 100644 index 902099457..000000000 --- a/OpenSauce/shared/Include/GWEN/ControlList.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/ControlList.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -void ControlList::Enable() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->SetDisabled( false ); - } -} - -void ControlList::Disable() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->SetDisabled( true ); - } -} - -void ControlList::Show() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->Show(); - } -} - -void ControlList::Hide() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->Hide(); - } -} - -Gwen::TextObject ControlList::GetValue() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - return ( *it )->GetValue(); - } - - return ""; -} - -void ControlList::SetValue( const Gwen::TextObject & value ) -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->SetValue( value ); - } -} - -void ControlList::MoveBy( const Gwen::Point & point ) -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->MoveBy( point.x, point.y ); - } -} - -void ControlList::DoAction() -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->DoAction(); - } -} - -void ControlList::SetActionInternal( Gwen::Event::Handler* pObject, void ( Gwen::Event::Handler::*f )( Gwen::Event::Info ), const Gwen::Event::Packet & packet ) -{ - for ( List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - ( *it )->SetAction( pObject, f, packet ); - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/ControlList.h b/OpenSauce/shared/Include/GWEN/ControlList.h deleted file mode 100644 index a0b0d4d14..000000000 --- a/OpenSauce/shared/Include/GWEN/ControlList.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLLIST_H -#define GWEN_CONTROLLIST_H - - -namespace Gwen -{ - struct Point; - class TextObject; - - namespace Controls - { - class Base; - } - - namespace Event - { - class Handler; - struct Information; - struct Packet; - - typedef const Gwen::Event::Information & Info; - } - - template < typename TYPE > - class TEasyList - { - public: - - typedef std::list List; - - void Add( TYPE pControl ) - { - if ( Contains( pControl ) ) { return; } - - list.push_back( pControl ); - } - - void Remove( TYPE pControl ) - { - list.remove( pControl ); - } - - void Add( const List & list ) - { - for ( typename List::const_iterator it = list.begin(); it != list.end(); ++it ) - { - Add( *it ); - } - } - - void Add( const TEasyList & list ) - { - Add( list.list ); - } - - bool Contains( TYPE pControl ) const - { - typename List::const_iterator it = std::find( list.begin(), list.end(), pControl ); - return it != list.end(); - } - - inline void Clear() - { - list.clear(); - } - - List list; - }; - - class ControlList : public TEasyList - { - public: - - void Enable(); - void Disable(); - - void Show(); - void Hide(); - - Gwen::TextObject GetValue(); - void SetValue( const Gwen::TextObject & value ); - - template - void SetAction( Gwen::Event::Handler* ob, - void ( T::*f )( Gwen::Event::Info ), - const Gwen::Event::Packet & packet ) - { - SetActionInternal( ob, - static_cast ( f ), - packet ); - } - - void MoveBy( const Gwen::Point & point ); - - void DoAction(); - - protected: - - void SetActionInternal( Gwen::Event::Handler* pObject, - void ( Gwen::Event::Handler::*f )( Gwen::Event::Info ), - const Gwen::Event::Packet & packet ); - }; - -}; - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls.h b/OpenSauce/shared/Include/GWEN/Controls.h deleted file mode 100644 index 6abe9b89d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_H -#define GWEN_CONTROLS_H - -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/DockBase.h" -#include "Gwen/Controls/FieldLabel.h" -#include "Gwen/Controls/GroupBox.h" -#include "Gwen/Controls/ImagePanel.h" -#include "Gwen/Controls/ListBox.h" -#include "Gwen/Controls/Pointer.h" -#include "Gwen/Controls/PropertyTree.h" -#include "Gwen/Controls/Property/Checkbox.h" -#include "Gwen/Controls/Property/ColorSelector.h" -#include "Gwen/Controls/Property/Text.h" -#include "Gwen/Controls/Property/ComboBox.h" -#include "Gwen/Controls/StatusBar.h" -#include "Gwen/Controls/TabControl.h" -#include "Gwen/Controls/Text.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Controls/MenuStrip.h" -#include "Gwen/Controls/ToolBar.h" -#include "Gwen/Controls/Splitters.h" -#include "Gwen/Controls/PageControl.h" -#include "Gwen/Controls/ProgressBar.h" -#include "Gwen/Controls/LabelClickable.h" -#include "Gwen/Controls/VerticalSlider.h" -#include "Gwen/Controls/HorizontalSlider.h" - -#include "Gwen/Controls/Rectangle.h" - -#include "Gwen/Anim.h" - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Base.cpp b/OpenSauce/shared/Include/GWEN/Controls/Base.cpp deleted file mode 100644 index 107ec1e49..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Base.cpp +++ /dev/null @@ -1,1219 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Gwen.h" -#include "Gwen/BaseRender.h" -#include "Gwen/Skin.h" -#include "Gwen/Platform.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/ToolTip.h" -#include "Gwen/Utility.h" -#include - -#ifndef GWEN_NO_ANIMATION -#include "Gwen/Anim.h" -#endif - -using namespace Gwen; -using namespace Controls; - -Base::Base( Base* pParent, const Gwen::String & Name ) -{ - m_Parent = NULL; - m_ActualParent = NULL; - m_InnerPanel = NULL; - m_Skin = NULL; - SetName( Name ); - SetParent( pParent ); - m_bHidden = false; - m_Bounds = Gwen::Rect( 0, 0, 10, 10 ); - m_Padding = Padding( 0, 0, 0, 0 ); - m_Margin = Margin( 0, 0, 0, 0 ); - m_iDock = 0; - m_DragAndDrop_Package = NULL; - RestrictToParent( false ); - SetMouseInputEnabled( true ); - SetKeyboardInputEnabled( false ); - Invalidate(); - SetCursor( Gwen::CursorType::Normal ); - SetToolTip( NULL ); - SetTabable( false ); - SetShouldDrawBackground( true ); - m_bDisabled = false; - m_bCacheTextureDirty = true; - m_bCacheToTexture = false; - m_bIncludeInSize = true; -} - -Base::~Base() -{ - { - Canvas* canvas = GetCanvas(); - - if ( canvas ) - { canvas->PreDeleteCanvas( this ); } - } - Base::List::iterator iter = Children.begin(); - - while ( iter != Children.end() ) - { - Base* pChild = *iter; - iter = Children.erase( iter ); - delete pChild; - } - - for ( AccelMap::iterator accelIt = m_Accelerators.begin(); accelIt != m_Accelerators.end(); ++accelIt ) - { - delete accelIt->second; - } - - m_Accelerators.clear(); - SetParent( NULL ); - - if ( Gwen::HoveredControl == this ) { Gwen::HoveredControl = NULL; } - - if ( Gwen::KeyboardFocus == this ) { Gwen::KeyboardFocus = NULL; } - - if ( Gwen::MouseFocus == this ) { Gwen::MouseFocus = NULL; } - - DragAndDrop::ControlDeleted( this ); - ToolTip::ControlDeleted( this ); -#ifndef GWEN_NO_ANIMATION - Anim::Cancel( this ); -#endif - - if ( m_DragAndDrop_Package ) - { - delete m_DragAndDrop_Package; - m_DragAndDrop_Package = NULL; - } -} - -void Base::Invalidate() -{ - m_bNeedsLayout = true; - m_bCacheTextureDirty = true; -} - -void Base::DelayedDelete() -{ - Canvas* canvas = GetCanvas(); - canvas->AddDelayedDelete( this ); -} - -Canvas* Base::GetCanvas() -{ - Base* pCanvas = m_Parent; - - if ( !pCanvas ) { return NULL; } - - return pCanvas->GetCanvas(); -} - -void Base::SetParent( Base* pParent ) -{ - if ( m_Parent == pParent ) { return; } - - if ( m_Parent ) - { - m_Parent->RemoveChild( this ); - } - - m_Parent = pParent; - m_ActualParent = NULL; - - if ( m_Parent ) - { - m_Parent->AddChild( this ); - } -} - -void Base::Dock( int iDock ) -{ - if ( m_iDock == iDock ) { return; } - - m_iDock = iDock; - Invalidate(); - InvalidateParent(); -} - -int Base::GetDock() -{ - return m_iDock; -} - -bool Base::Hidden() const -{ - return m_bHidden; -} - -bool Base::Visible() const -{ - if ( Hidden() ) { return false; } - - if ( GetParent() ) - { - return GetParent()->Visible(); - } - - return true; -} - -void Base::InvalidateChildren( bool bRecursive ) -{ - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - ( *it )->Invalidate(); - - if ( bRecursive ) - { ( *it )->InvalidateChildren( bRecursive ); } - } - - if ( m_InnerPanel ) - { - for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it ) - { - ( *it )->Invalidate(); - - if ( bRecursive ) - { ( *it )->InvalidateChildren( bRecursive ); } - } - } -} - -void Base::Position( int pos, int xpadding, int ypadding ) -{ - const Rect & bounds = GetParent()->GetInnerBounds(); - const Margin & margin = GetMargin(); - int x = X(); - int y = Y(); - - if ( pos & Pos::Left ) { x = bounds.x + xpadding + margin.left; } - - if ( pos & Pos::Right ) { x = bounds.x + ( bounds.w - Width() - xpadding - margin.right ); } - - if ( pos & Pos::CenterH ) { x = bounds.x + ( bounds.w - Width() ) * 0.5; } - - if ( pos & Pos::Top ) { y = bounds.y + ypadding; } - - if ( pos & Pos::Bottom ) { y = bounds.y + ( bounds.h - Height() - ypadding ); } - - if ( pos & Pos::CenterV ) { y = bounds.y + ( bounds.h - Height() ) * 0.5; } - - SetPos( x, y ); -} - -void Base::SendToBack() -{ - if ( !m_ActualParent ) { return; } - - if ( m_ActualParent->Children.front() == this ) { return; } - - m_ActualParent->Children.remove( this ); - m_ActualParent->Children.push_front( this ); - InvalidateParent(); -} - -void Base::BringToFront() -{ - if ( !m_ActualParent ) { return; } - - if ( m_ActualParent->Children.back() == this ) { return; } - - m_ActualParent->Children.remove( this ); - m_ActualParent->Children.push_back( this ); - InvalidateParent(); - Redraw(); -} - -Controls::Base* Base::FindChildByName( const Gwen::String & name, bool bRecursive ) -{ - Base::List::iterator iter; - - for ( iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( !pChild->GetName().empty() && pChild->GetName() == name ) - { return pChild; } - - if ( bRecursive ) - { - Controls::Base* pSubChild = pChild->FindChildByName( name, true ); - - if ( pSubChild ) - { return pSubChild; } - } - } - - return NULL; -} - -void Base::BringNextToControl( Controls::Base* pChild, bool bBehind ) -{ - if ( !m_ActualParent ) { return; } - - m_ActualParent->Children.remove( this ); - Base::List::iterator it = std::find( m_ActualParent->Children.begin(), m_ActualParent->Children.end(), pChild ); - - if ( it == m_ActualParent->Children.end() ) - { return BringToFront(); } - - if ( bBehind ) - { - ++it; - - if ( it == m_ActualParent->Children.end() ) - { return BringToFront(); } - } - - m_ActualParent->Children.insert( it, this ); - InvalidateParent(); -} - -void Base::AddChild( Base* pChild ) -{ - if ( m_InnerPanel ) - { - m_InnerPanel->AddChild( pChild ); - return; - } - - Children.push_back( pChild ); - OnChildAdded( pChild ); - pChild->m_ActualParent = this; -} -void Base::RemoveChild( Base* pChild ) -{ - // If we removed our innerpanel - // remove our pointer to it - if ( m_InnerPanel == pChild ) - { - m_InnerPanel = NULL; - } - - if ( m_InnerPanel ) - { - m_InnerPanel->RemoveChild( pChild ); - } - - Children.remove( pChild ); - OnChildRemoved( pChild ); -} - -void Base::RemoveAllChildren() -{ - while ( Children.size() > 0 ) - { - RemoveChild( *Children.begin() ); - } -} - -unsigned int Base::NumChildren() -{ - // Include m_InnerPanel's children here? - return Children.size(); -} - -Controls::Base* Base::GetChild( unsigned int i ) -{ - if ( i >= NumChildren() ) { return NULL; } - - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - if ( i == 0 ) - { return *iter; } - - i--; - } - - // Should never happen. - return NULL; -} - -void Base::OnChildAdded( Base* /*pChild*/ ) -{ - Invalidate(); -} - -void Base::OnChildRemoved( Base* /*pChild*/ ) -{ - Invalidate(); -} - -Skin::Base* Base::GetSkin( void ) -{ - if ( m_Skin ) { return m_Skin; } - - if ( m_Parent ) { return m_Parent->GetSkin(); } - - Debug::AssertCheck( 0, "Base::GetSkin Returning NULL!\n" ); - return NULL; -} - -void Base::MoveBy( int x, int y ) -{ - MoveTo( X() + x, Y() + y ); -} - -void Base::MoveTo( int x, int y ) -{ - if ( m_bRestrictToParent && GetParent() ) - { - Base* pParent = GetParent(); - - if ( x - GetPadding().left < pParent->GetMargin().left ) { x = pParent->GetMargin().left + GetPadding().left; } - - if ( y - GetPadding().top < pParent->GetMargin().top ) { y = pParent->GetMargin().top + GetPadding().top; } - - if ( x + Width() + GetPadding().right > pParent->Width() - pParent->GetMargin().right ) { x = pParent->Width() - pParent->GetMargin().right - Width() - GetPadding().right; } - - if ( y + Height() + GetPadding().bottom > pParent->Height() - pParent->GetMargin().bottom ) { y = pParent->Height() - pParent->GetMargin().bottom - Height() - GetPadding().bottom; } - } - - SetBounds( x, y, Width(), Height() ); -} - -void Base::SetPos( int x, int y ) -{ - SetBounds( x, y, Width(), Height() ); -} - -bool Base::SetSize( int w, int h ) -{ - return SetBounds( X(), Y(), w, h ); -} - -bool Base::SetSize( const Point & p ) -{ - return SetSize( p.x, p.y ); -} - -bool Base::SetBounds( const Gwen::Rect & bounds ) -{ - return SetBounds( bounds.x, bounds.y, bounds.w, bounds.h ); -} - -bool Base::SetBounds( int x, int y, int w, int h ) -{ - if ( m_Bounds.x == x && - m_Bounds.y == y && - m_Bounds.w == w && - m_Bounds.h == h ) - { return false; } - - Gwen::Rect oldBounds = GetBounds(); - m_Bounds.x = x; - m_Bounds.y = y; - m_Bounds.w = w; - m_Bounds.h = h; - OnBoundsChanged( oldBounds ); - return true; -} - -void Base::OnBoundsChanged( Gwen::Rect oldBounds ) -{ - //Anything that needs to update on size changes - //Iterate my children and tell them I've changed - // - if ( GetParent() ) - { GetParent()->OnChildBoundsChanged( oldBounds, this ); } - - if ( m_Bounds.w != oldBounds.w || m_Bounds.h != oldBounds.h ) - { - Invalidate(); - } - - Redraw(); - UpdateRenderBounds(); -} - -void Base::OnScaleChanged() -{ - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - ( *iter )->OnScaleChanged(); - } -} - -void Base::OnChildBoundsChanged( Gwen::Rect /*oldChildBounds*/, Base* /*pChild*/ ) -{ -} - -void Base::Render( Gwen::Skin::Base* /*skin*/ ) -{ -} - -void Base::DoCacheRender( Gwen::Skin::Base* skin, Gwen::Controls::Base* pMaster ) -{ - Gwen::Renderer::Base* render = skin->GetRender(); - Gwen::Renderer::ICacheToTexture* cache = render->GetCTT(); - - if ( !cache ) { return; } - - Gwen::Point pOldRenderOffset = render->GetRenderOffset(); - Gwen::Rect rOldRegion = render->ClipRegion(); - - if ( this != pMaster ) - { - render->AddRenderOffset( GetBounds() ); - render->AddClipRegion( GetBounds() ); - } - else - { - render->SetRenderOffset( Gwen::Point( 0, 0 ) ); - render->SetClipRegion( GetBounds() ); - } - - if ( m_bCacheTextureDirty && render->ClipRegionVisible() ) - { - render->StartClip(); - { - if ( ShouldCacheToTexture() ) - { cache->SetupCacheTexture( this ); } - - //Render myself first - Render( skin ); - - if ( !Children.empty() ) - { - //Now render my kids - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( pChild->Hidden() ) { continue; } - - pChild->DoCacheRender( skin, pMaster ); - } - } - - if ( ShouldCacheToTexture() ) - { - cache->FinishCacheTexture( this ); - m_bCacheTextureDirty = false; - } - } - render->EndClip(); - } - - render->SetClipRegion( rOldRegion ); - render->StartClip(); - { - render->SetRenderOffset( pOldRenderOffset ); - cache->DrawCachedControlTexture( this ); - } - render->EndClip(); -} - -void Base::DoRender( Gwen::Skin::Base* skin ) -{ - // If this control has a different skin, - // then so does its children. - if ( m_Skin ) - { skin = m_Skin; } - - // Do think - Think(); - Gwen::Renderer::Base* render = skin->GetRender(); - - if ( render->GetCTT() && ShouldCacheToTexture() ) - { - DoCacheRender( skin, this ); - return; - } - - RenderRecursive( skin, GetBounds() ); -} - -void Base::RenderRecursive( Gwen::Skin::Base* skin, const Gwen::Rect & cliprect ) -{ - Gwen::Renderer::Base* render = skin->GetRender(); - Gwen::Point pOldRenderOffset = render->GetRenderOffset(); - render->AddRenderOffset( cliprect ); - RenderUnder( skin ); - Gwen::Rect rOldRegion = render->ClipRegion(); - - // - // If this control is clipping, change the clip rect to ourselves - // ( if not then we still clip using our parents clip rect ) - // - if ( ShouldClip() ) - { - render->AddClipRegion( cliprect ); - - if ( !render->ClipRegionVisible() ) - { - render->SetRenderOffset( pOldRenderOffset ); - render->SetClipRegion( rOldRegion ); - return; - } - } - - // - // Render this control and children controls - // - render->StartClip(); - { - Render( skin ); - - if ( !Children.empty() ) - { - //Now render my kids - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( pChild->Hidden() ) { continue; } - - pChild->DoRender( skin ); - } - } - } - render->EndClip(); - // - // Render overlay/focus - // - { - render->SetClipRegion( rOldRegion ); - render->StartClip(); - { - RenderOver( skin ); - RenderFocus( skin ); - } - render->EndClip(); - render->SetRenderOffset( pOldRenderOffset ); - } -} - -void Base::SetSkin( Skin::Base* skin, bool doChildren ) -{ - if ( m_Skin == skin ) { return; } - - m_Skin = skin; - Invalidate(); - Redraw(); - OnSkinChanged( skin ); - - if ( doChildren ) - { - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - ( *it )->SetSkin( skin, true ); - } - } -} - -void Base::OnSkinChanged( Skin::Base* /*skin*/ ) -{ - //Do something -} - -bool Base::OnMouseWheeled( int iDelta ) -{ - if ( m_ActualParent ) - { return m_ActualParent->OnMouseWheeled( iDelta ); } - - return false; -} - -void Base::OnMouseMoved( int /*x*/, int /*y*/, int /*deltaX*/, int /*deltaY*/ ) -{ -} - -void Base::OnMouseEnter() -{ - onHoverEnter.Call( this ); - - if ( GetToolTip() ) - { ToolTip::Enable( this ); } - else if ( GetParent() && GetParent()->GetToolTip() ) - { ToolTip::Enable( GetParent() ); } - - Redraw(); -} - -void Base::OnMouseLeave() -{ - onHoverLeave.Call( this ); - - if ( GetToolTip() ) - { ToolTip::Disable( this ); } - - Redraw(); -} - - -bool Base::IsHovered() -{ - return Gwen::HoveredControl == this; -} - -bool Base::ShouldDrawHover() -{ - return Gwen::MouseFocus == this || Gwen::MouseFocus == NULL; -} - -bool Base::HasFocus() -{ - return Gwen::KeyboardFocus == this; -} - -void Base::Focus() -{ - if ( Gwen::KeyboardFocus == this ) { return; } - - if ( Gwen::KeyboardFocus ) - { Gwen::KeyboardFocus->OnLostKeyboardFocus(); } - - Gwen::KeyboardFocus = this; - OnKeyboardFocus(); - Redraw(); -} - -void Base::Blur() -{ - if ( Gwen::KeyboardFocus != this ) { return; } - - Gwen::KeyboardFocus = NULL; - OnLostKeyboardFocus(); - Redraw(); -} - -bool Base::IsOnTop() -{ - if ( !GetParent() ) - { return false; } - - Base::List::iterator iter = GetParent()->Children.begin(); - Base* pChild = *iter; - - if ( pChild == this ) - { return true; } - - return false; -} - - -void Base::Touch() -{ - if ( GetParent() ) - { GetParent()->OnChildTouched( this ); } -} - -void Base::OnChildTouched( Controls::Base* /*pChild*/ ) -{ - Touch(); -} - -Base* Base::GetControlAt( int x, int y, bool bOnlyIfMouseEnabled ) -{ - if ( Hidden() ) - { return NULL; } - - if ( x < 0 || y < 0 || x >= Width() || y >= Height() ) - { return NULL; } - - Base::List::reverse_iterator iter; - - for ( iter = Children.rbegin(); iter != Children.rend(); ++iter ) - { - Base* pChild = *iter; - Base* pFound = NULL; - pFound = pChild->GetControlAt( x - pChild->X(), y - pChild->Y(), bOnlyIfMouseEnabled ); - - if ( pFound ) { return pFound; } - } - - if ( bOnlyIfMouseEnabled && !GetMouseInputEnabled() ) - { return NULL; } - - return this; -} - - -void Base::Layout( Skin::Base* skin ) -{ - if ( skin->GetRender()->GetCTT() && ShouldCacheToTexture() ) - { skin->GetRender()->GetCTT()->CreateControlCacheTexture( this ); } -} - -void Base::RecurseLayout( Skin::Base* skin ) -{ - if ( m_Skin ) { skin = m_Skin; } - - if ( Hidden() ) { return; } - - if ( NeedsLayout() ) - { - m_bNeedsLayout = false; - Layout( skin ); - } - - Gwen::Rect rBounds = GetRenderBounds(); - // Adjust bounds for padding - rBounds.x += m_Padding.left; - rBounds.w -= m_Padding.left + m_Padding.right; - rBounds.y += m_Padding.top; - rBounds.h -= m_Padding.top + m_Padding.bottom; - - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( pChild->Hidden() ) - { continue; } - - int iDock = pChild->GetDock(); - - if ( iDock & Pos::Fill ) - { continue; } - - if ( iDock & Pos::Top ) - { - const Margin & margin = pChild->GetMargin(); - pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, rBounds.w - margin.left - margin.right, pChild->Height() ); - int iHeight = margin.top + margin.bottom + pChild->Height(); - rBounds.y += iHeight; - rBounds.h -= iHeight; - } - - if ( iDock & Pos::Left ) - { - const Margin & margin = pChild->GetMargin(); - pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, pChild->Width(), rBounds.h - margin.top - margin.bottom ); - int iWidth = margin.left + margin.right + pChild->Width(); - rBounds.x += iWidth; - rBounds.w -= iWidth; - } - - if ( iDock & Pos::Right ) - { - // TODO: THIS MARGIN CODE MIGHT NOT BE FULLY FUNCTIONAL - const Margin & margin = pChild->GetMargin(); - pChild->SetBounds( ( rBounds.x + rBounds.w ) - pChild->Width() - margin.right, rBounds.y + margin.top, pChild->Width(), rBounds.h - margin.top - margin.bottom ); - int iWidth = margin.left + margin.right + pChild->Width(); - rBounds.w -= iWidth; - } - - if ( iDock & Pos::Bottom ) - { - // TODO: THIS MARGIN CODE MIGHT NOT BE FULLY FUNCTIONAL - const Margin & margin = pChild->GetMargin(); - pChild->SetBounds( rBounds.x + margin.left, ( rBounds.y + rBounds.h ) - pChild->Height() - margin.bottom, rBounds.w - margin.left - margin.right, pChild->Height() ); - rBounds.h -= pChild->Height() + margin.bottom + margin.top; - } - - pChild->RecurseLayout( skin ); - } - - m_InnerBounds = rBounds; - - // - // Fill uses the left over space, so do that now. - // - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - int iDock = pChild->GetDock(); - - if ( !( iDock & Pos::Fill ) ) - { continue; } - - const Margin & margin = pChild->GetMargin(); - pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, rBounds.w - margin.left - margin.right, rBounds.h - margin.top - margin.bottom ); - pChild->RecurseLayout( skin ); - } - - PostLayout( skin ); - - if ( IsTabable() && !IsDisabled() ) - { - if ( !GetCanvas()->FirstTab ) { GetCanvas()->FirstTab = this; } - - if ( !GetCanvas()->NextTab ) { GetCanvas()->NextTab = this; } - } - - if ( Gwen::KeyboardFocus == this ) - { - GetCanvas()->NextTab = NULL; - } -} - -bool Base::IsChild( Controls::Base* pChild ) -{ - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - if ( pChild == ( *iter ) ) { return true; } - } - - return false; -} - -Gwen::Point Base::LocalPosToCanvas( const Gwen::Point & pnt ) -{ - if ( m_Parent ) - { - int x = pnt.x + X(); - int y = pnt.y + Y(); - - // If our parent has an innerpanel and we're a child of it - // add its offset onto us. - // - if ( m_Parent->m_InnerPanel && m_Parent->m_InnerPanel->IsChild( this ) ) - { - x += m_Parent->m_InnerPanel->X(); - y += m_Parent->m_InnerPanel->Y(); - } - - return m_Parent->LocalPosToCanvas( Gwen::Point( x, y ) ); - } - - return pnt; -} - -Gwen::Point Base::CanvasPosToLocal( const Gwen::Point & pnt ) -{ - if ( m_Parent ) - { - int x = pnt.x - X(); - int y = pnt.y - Y(); - - // If our parent has an innerpanel and we're a child of it - // add its offset onto us. - // - if ( m_Parent->m_InnerPanel && m_Parent->m_InnerPanel->IsChild( this ) ) - { - x -= m_Parent->m_InnerPanel->X(); - y -= m_Parent->m_InnerPanel->Y(); - } - - return m_Parent->CanvasPosToLocal( Gwen::Point( x, y ) ); - } - - return pnt; -} - -bool Base::IsMenuComponent() -{ - if ( !m_Parent ) { return false; } - - return m_Parent->IsMenuComponent(); -} - -void Base::CloseMenus() -{ - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - ( *it )->CloseMenus(); - } -} - -void Base::UpdateRenderBounds() -{ - m_RenderBounds.x = 0; - m_RenderBounds.y = 0; - m_RenderBounds.w = m_Bounds.w; - m_RenderBounds.h = m_Bounds.h; -} - -void Base::UpdateCursor() -{ - Platform::SetCursor( m_Cursor ); -} - -DragAndDrop::Package* Base::DragAndDrop_GetPackage( int /*x*/, int /*y*/ ) -{ - return m_DragAndDrop_Package; -} - -bool Base::DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) -{ - DragAndDrop::SourceControl->SetParent( this ); - return true; -} - -bool Base::DragAndDrop_Draggable() -{ - if ( !m_DragAndDrop_Package ) { return false; } - - return m_DragAndDrop_Package->draggable; -} - -void Base::DragAndDrop_SetPackage( bool bDraggable, const String & strName, void* pUserData ) -{ - if ( !m_DragAndDrop_Package ) - { - m_DragAndDrop_Package = new Gwen::DragAndDrop::Package(); - } - - m_DragAndDrop_Package->draggable = bDraggable; - m_DragAndDrop_Package->name = strName; - m_DragAndDrop_Package->userdata = pUserData; -} - -void Base::DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* pPackage, int x, int y ) -{ - pPackage->holdoffset = CanvasPosToLocal( Gwen::Point( x, y ) ); - pPackage->drawcontrol = this; -} - -bool Base::SizeToChildren( bool w, bool h ) -{ - Gwen::Point size = ChildrenSize(); - size.y += GetPadding().bottom; - size.x += GetPadding().right; - return SetSize( w ? size.x : Width(), h ? size.y : Height() ); -} - -Gwen::Point Base::ChildrenSize() -{ - Gwen::Point size; - - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( pChild->Hidden() ) { continue; } - - if ( !pChild->ShouldIncludeInSize() ) { continue; } - - size.x = Gwen::Max( size.x, pChild->Right() ); - size.y = Gwen::Max( size.y, pChild->Bottom() ); - } - - return size; -} - -void Base::SetPadding( const Padding & padding ) -{ - if ( m_Padding.left == padding.left && - m_Padding.top == padding.top && - m_Padding.right == padding.right && - m_Padding.bottom == padding.bottom ) - { return; } - - m_Padding = padding; - Invalidate(); - InvalidateParent(); -} - -void Base::SetMargin( const Margin & margin ) -{ - if ( m_Margin.top == margin.top && - m_Margin.left == margin.left && - m_Margin.bottom == margin.bottom && - m_Margin.right == margin.right ) - { return; } - - m_Margin = margin; - Invalidate(); - InvalidateParent(); -} - -bool Base::HandleAccelerator( Gwen::UnicodeString & accelerator ) -{ - if ( Gwen::KeyboardFocus == this || !AccelOnlyFocus() ) - { - AccelMap::iterator iter = m_Accelerators.find( accelerator ); - - if ( iter != m_Accelerators.end() ) - { - iter->second->Call( this ); - return true; - } - } - - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - if ( ( *it )->HandleAccelerator( accelerator ) ) - { return true; } - } - - return false; -} - -bool Base::OnKeyPress( int iKey, bool bPress ) -{ - bool bHandled = false; - - switch ( iKey ) - { - case Key::Tab: - bHandled = OnKeyTab( bPress ); - break; - - case Key::Space: - bHandled = OnKeySpace( bPress ); - break; - - case Key::Home: - bHandled = OnKeyHome( bPress ); - break; - - case Key::End: - bHandled = OnKeyEnd( bPress ); - break; - - case Key::Return: - bHandled = OnKeyReturn( bPress ); - break; - - case Key::Backspace: - bHandled = OnKeyBackspace( bPress ); - break; - - case Key::Delete: - bHandled = OnKeyDelete( bPress ); - break; - - case Key::Right: - bHandled = OnKeyRight( bPress ); - break; - - case Key::Left: - bHandled = OnKeyLeft( bPress ); - break; - - case Key::Up: - bHandled = OnKeyUp( bPress ); - break; - - case Key::Down: - bHandled = OnKeyDown( bPress ); - break; - - case Key::Escape: - bHandled = OnKeyEscape( bPress ); - break; - - default: - break; - } - - if ( !bHandled && GetParent() ) - { GetParent()->OnKeyPress( iKey, bPress ); } - - return bHandled; -} - -bool Base::OnKeyRelease( int iKey ) -{ - return OnKeyPress( iKey, false ); -} - -bool Base::OnKeyTab( bool bDown ) -{ - if ( !bDown ) { return true; } - - if ( GetCanvas()->NextTab ) - { - GetCanvas()->NextTab->Focus(); - Redraw(); - } - - return true; -} - -void Base::RenderFocus( Gwen::Skin::Base* skin ) -{ - if ( Gwen::KeyboardFocus != this ) { return; } - - if ( !IsTabable() ) { return; } - - skin->DrawKeyboardHighlight( this, GetRenderBounds(), 3 ); -} - -void Base::SetToolTip( const TextObject & strText ) -{ - Label* tooltip = new Label( this ); - tooltip->SetText( strText ); - tooltip->SetTextColorOverride( GetSkin()->Colors.TooltipText ); - tooltip->SetPadding( Padding( 5, 3, 5, 3 ) ); - tooltip->SizeToContents(); - SetToolTip( tooltip ); -} - -TextObject Base::GetChildValue( const Gwen::String & strName ) -{ - Base* pChild = FindChildByName( strName, true ); - - if ( !pChild ) { return ""; } - - return pChild->GetValue(); -} - -TextObject Base::GetValue() -{ - // Generic value accessor should be filled in if we have a value to give. - return ""; -} - -void Base::SetValue( const TextObject & strValue ) -{ -} - -int Base::GetNamedChildren( Gwen::ControlList & list, const Gwen::String & strName, bool bDeep ) -{ - int iFound = 0; - Base::List::iterator iter; - - for ( iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( !pChild->GetName().empty() && pChild->GetName() == strName ) - { - list.Add( pChild ); - iFound++; - } - - if ( !bDeep ) { continue; } - - iFound += pChild->GetNamedChildren( list, strName, bDeep ); - } - - return iFound; -} - -Gwen::ControlList Base::GetNamedChildren( const Gwen::String & strName, bool bDeep ) -{ - Gwen::ControlList list; - GetNamedChildren( list, strName, bDeep ); - return list; -} - -#ifndef GWEN_NO_ANIMATION - -void Base::Anim_WidthIn( float fLength, float fDelay, float fEase ) -{ - Gwen::Anim::Add( this, new Gwen::Anim::Size::Width( 0, Width(), fLength, false, fDelay, fEase ) ); - SetWidth( 0 ); -} - -void Base::Anim_HeightIn( float fLength, float fDelay, float fEase ) -{ - Gwen::Anim::Add( this, new Gwen::Anim::Size::Height( 0, Height(), fLength, false, fDelay, fEase ) ); - SetHeight( 0 ); -} - -void Base::Anim_WidthOut( float fLength, bool bHide, float fDelay, float fEase ) -{ - Gwen::Anim::Add( this, new Gwen::Anim::Size::Width( Width(), 0, fLength, bHide, fDelay, fEase ) ); -} - -void Base::Anim_HeightOut( float fLength, bool bHide, float fDelay, float fEase ) -{ - Gwen::Anim::Add( this, new Gwen::Anim::Size::Height( Height(), 0, fLength, bHide, fDelay, fEase ) ); -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Base.h b/OpenSauce/shared/Include/GWEN/Controls/Base.h deleted file mode 100644 index 19b3e5f31..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Base.h +++ /dev/null @@ -1,599 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_BASE_H -#define GWEN_CONTROLS_BASE_H - -#include -#include -#include - -#include "Gwen/Exports.h" -#include "Gwen/Structures.h" -#include "Gwen/BaseRender.h" -#include "Gwen/Events.h" -#include "Gwen/Utility.h" -#include "Gwen/TextObject.h" -#include "Gwen/Skin.h" -#include "Gwen/ControlList.h" -#include "Gwen/UserData.h" - - -namespace Gwen -{ - namespace Pos - { - enum - { - None = 0, - Left = ( 1 << 1 ), - Right = ( 1 << 2 ), - Top = ( 1 << 3 ), - Bottom = ( 1 << 4 ), - CenterV = ( 1 << 5 ), - CenterH = ( 1 << 6 ), - Fill = ( 1 << 7 ), - Center = CenterV | CenterH, - }; - } - - class TextObject; - - namespace Skin - { - class Base; - } - - namespace Controls - { - class Canvas; - - class GWEN_EXPORT Base : public Event::Handler - { - public: - - typedef std::list List; - - typedef std::map AccelMap; - - Base( Base* pParent, const Gwen::String & Name = "" ); - virtual ~Base(); - - virtual const char* GetTypeName() { return "Base"; } - - virtual void DelayedDelete(); - virtual void PreDelete( Gwen::Skin::Base* skin ) {}; - - virtual void SetParent( Controls::Base* pParent ); - virtual Controls::Base* GetParent() const { return m_Parent; } - virtual Controls::Canvas* GetCanvas(); - - virtual Base::List & GetChildren() { if ( m_InnerPanel ) { return m_InnerPanel->GetChildren(); } return Children; } - virtual bool IsChild( Controls::Base* pChild ); - virtual unsigned int NumChildren(); - virtual Controls::Base* GetChild( unsigned int i ); - virtual bool SizeToChildren( bool w = true, bool h = true ); - virtual Gwen::Point ChildrenSize(); - virtual Controls::Base* FindChildByName( const Gwen::String & name, bool bRecursive = false ); - - template T* FindChild( const Gwen::String & name, bool bRecursive = false ); - - virtual void SetName( const Gwen::String & name ) { m_Name = name; } - virtual const Gwen::String & GetName() { return m_Name; } - - virtual void Think() {} - - protected: - - virtual void AddChild( Controls::Base* pChild ); - virtual void RemoveChild( Controls::Base* pParent ); - virtual void OnChildAdded( Controls::Base* pChild ); - virtual void OnChildRemoved( Controls::Base* pChild ); - - public: - - virtual void RemoveAllChildren(); - - virtual void SendToBack( void ); - virtual void BringToFront( void ); - virtual void BringNextToControl( Controls::Base* pChild, bool bBehind ); - - virtual Gwen::Point LocalPosToCanvas( const Gwen::Point & in = Point( 0, 0 ) ); - virtual Gwen::Point CanvasPosToLocal( const Gwen::Point & in ); - - virtual void Dock( int iDock ); - virtual int GetDock(); - - virtual void RestrictToParent( bool restrict ) { m_bRestrictToParent = restrict; } - virtual bool ShouldRestrictToParent() { return m_bRestrictToParent; } - - virtual int X() const { return m_Bounds.x; } - virtual int Y() const { return m_Bounds.y; } - virtual int Width() const { return m_Bounds.w; } - virtual int Height() const { return m_Bounds.h; } - virtual int Bottom() const { return m_Bounds.y + m_Bounds.h + m_Margin.bottom; } - virtual int Right() const { return m_Bounds.x + m_Bounds.w + m_Margin.right; } - - virtual const Margin & GetMargin() const { return m_Margin; } - virtual const Padding & GetPadding() const { return m_Padding; } - - virtual void SetPos( int x, int y ); - virtual void SetPos( const Point & p ) { return SetPos( p.x, p.y ); } - virtual Point GetPos() { return Point( X(), Y() ); } - virtual void SetWidth( int w ) { SetSize( w, Height() ); } - virtual void SetHeight( int h ) { SetSize( Width(), h ); } - virtual bool SetSize( int w, int h ); - virtual bool SetSize( const Point & p ); - virtual Point GetSize() { return Point( Width(), Height() ); } - virtual bool SetBounds( int x, int y, int w, int h ); - virtual bool SetBounds( const Gwen::Rect & bounds ); - - virtual void SetPadding( const Padding & padding ); - virtual void SetMargin( const Margin & margin ); - - // MoveTo is identical to SetPos except it uses ShouldRestrictToParent() - virtual void MoveTo( int x, int y ); - virtual void MoveBy( int x, int y ); - - virtual const Gwen::Rect & GetBounds() const { return m_Bounds; } - - virtual Controls::Base* GetControlAt( int x, int y, bool bOnlyIfMouseEnabled = true ); - - - - protected: - - virtual void OnBoundsChanged( Gwen::Rect oldBounds ); - virtual void OnChildBoundsChanged( Gwen::Rect oldChildBounds, Base* pChild ); - - virtual void OnScaleChanged(); - - public: - - // Innerbounds is the area inside the control that - // doesn't have child controls docked to it. - virtual const Gwen::Rect & GetInnerBounds() const { return m_InnerBounds; } - - protected: - - Gwen::Rect m_InnerBounds; - - public: - - virtual const Gwen::Rect & GetRenderBounds() const { return m_RenderBounds; } - - protected: - - virtual void UpdateRenderBounds(); - - public: - - virtual void DoRender( Gwen::Skin::Base* skin ); - virtual void DoCacheRender( Gwen::Skin::Base* skin, Gwen::Controls::Base* pMaster ); - virtual void RenderRecursive( Gwen::Skin::Base* skin, const Gwen::Rect & cliprect ); - - virtual bool ShouldClip() { return true; } - - protected: - - virtual void Render( Gwen::Skin::Base* skin ); - virtual void RenderUnder( Gwen::Skin::Base* /*skin*/ ) {}; - virtual void RenderOver( Gwen::Skin::Base* /*skin*/ ) {}; - virtual void RenderFocus( Gwen::Skin::Base* /*skin*/ ); - - public: - - virtual void SetHidden( bool hidden ) { if ( m_bHidden == hidden ) { return; } m_bHidden = hidden; Invalidate(); Redraw(); } - virtual bool Hidden() const; // Returns true only if this control is hidden - virtual bool Visible() const; // Returns false if this control or its parents are hidden - virtual void Hide() { SetHidden( true ); } - virtual void Show() { SetHidden( false ); } - - //Skin - virtual void SetSkin( Skin::Base* skin, bool doChildren = false ); - virtual Gwen::Skin::Base* GetSkin( void ); - - // Background drawing - virtual bool ShouldDrawBackground() { return m_bDrawBackground; } - virtual void SetShouldDrawBackground( bool b ) { m_bDrawBackground = b; } - - protected: - - virtual void OnSkinChanged( Gwen::Skin::Base* newSkin ); - - public: - - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual bool OnMouseWheeled( int iDelta ); - virtual void OnMouseClickLeft( int /*x*/, int /*y*/, bool /*bDown*/ ) {}; - virtual void OnMouseClickRight( int /*x*/, int /*y*/, bool /*bDown*/ ) {} - virtual void OnMouseDoubleClickLeft( int x, int y ) { OnMouseClickLeft( x, y, true ); }; - virtual void OnMouseDoubleClickRight( int x, int y ) { OnMouseClickRight( x, y, true ); }; - virtual void OnLostKeyboardFocus() {} - virtual void OnKeyboardFocus() {} - - virtual void SetMouseInputEnabled( bool b ) { m_bMouseInputEnabled = b; } - virtual bool GetMouseInputEnabled() { return m_bMouseInputEnabled; } - - virtual void SetKeyboardInputEnabled( bool b ) { m_bKeyboardInputEnabled = b; } - virtual bool GetKeyboardInputEnabled() const { return m_bKeyboardInputEnabled; } - virtual bool NeedsInputChars() { return false; } - - virtual bool OnChar( Gwen::UnicodeChar /*c*/ ) { return false; } - - virtual bool OnKeyPress( int iKey, bool bPress = true ); - virtual bool OnKeyRelease( int iKey ); - - virtual void OnPaste( Controls::Base* /*pFrom*/ ) {} - virtual void OnCopy( Controls::Base* /*pFrom*/ ) {} - virtual void OnCut( Controls::Base* /*pFrom*/ ) {} - virtual void OnSelectAll( Controls::Base* /*pFrom*/ ) {} - - virtual bool OnKeyTab( bool bDown ); - virtual bool OnKeySpace( bool /*bDown*/ ) { return false; } - virtual bool OnKeyReturn( bool /*bDown*/ ) { return false; } - virtual bool OnKeyBackspace( bool /*bDown*/ ) { return false; } - virtual bool OnKeyDelete( bool /*bDown*/ ) { return false; } - virtual bool OnKeyRight( bool /*bDown*/ ) { return false; } - virtual bool OnKeyLeft( bool /*bDown*/ ) { return false; } - virtual bool OnKeyHome( bool /*bDown*/ ) { return false; } - virtual bool OnKeyEnd( bool /*bDown*/ ) { return false; } - virtual bool OnKeyUp( bool /*bDown*/ ) { return false; } - virtual bool OnKeyDown( bool /*bDown*/ ) { return false; } - virtual bool OnKeyEscape( bool /*bDown*/ ) { return false; } - - virtual void OnMouseEnter(); - virtual void OnMouseLeave(); - virtual bool IsHovered(); - virtual bool ShouldDrawHover(); - - virtual void Touch(); - virtual void OnChildTouched( Controls::Base* pChild ); - - virtual bool IsOnTop(); - - virtual bool HasFocus(); - virtual void Focus(); - virtual void Blur(); - - //Other - virtual void SetDisabled( bool active ) { if ( m_bDisabled == active ) { return; } m_bDisabled = active; Redraw(); } - virtual bool IsDisabled() { return m_bDisabled; } - - virtual void Redraw() { UpdateColours(); m_bCacheTextureDirty = true; if ( m_Parent ) { m_Parent->Redraw(); } } - virtual void UpdateColours() {}; - virtual void SetCacheToTexture() { m_bCacheToTexture = true; } - virtual bool ShouldCacheToTexture() { return m_bCacheToTexture; } - - virtual void SetCursor( unsigned char c ) { m_Cursor = c; } - virtual void UpdateCursor(); - - virtual Gwen::Point GetMinimumSize() { return Gwen::Point( 1, 1 ); } - virtual Gwen::Point GetMaximumSize() { return Gwen::Point( 4096, 4096 ); } - - virtual void SetToolTip( const Gwen::TextObject & strText ); - virtual void SetToolTip( Base* tooltip ) { m_ToolTip = tooltip; if ( m_ToolTip ) { m_ToolTip->SetParent( this ); m_ToolTip->SetHidden( true ); } } - virtual Base* GetToolTip() { return m_ToolTip; } - - virtual bool IsMenuComponent(); - virtual void CloseMenus(); - - virtual bool IsTabable() { return m_Tabable; } - virtual void SetTabable( bool isTabable ) { m_Tabable = isTabable; } - - - - - //Accelerator functionality - void DefaultAccel( Gwen::Controls::Base* /*pCtrl*/ ) { AcceleratePressed(); } - virtual void AcceleratePressed() {}; - virtual bool AccelOnlyFocus() { return false; } - virtual bool HandleAccelerator( Gwen::UnicodeString & accelerator ); - - template - void AddAccelerator( const TextObject & accelerator, T func, Gwen::Event::Handler* handler = NULL ) - { - if ( handler == NULL ) - { handler = this; } - - Gwen::Event::Caller* caller = new Gwen::Event::Caller(); - caller->Add( handler, func ); - Gwen::UnicodeString str = accelerator.GetUnicode(); - Gwen::Utility::Strings::ToUpper( str ); - Gwen::Utility::Strings::Strip( str, L" " ); - m_Accelerators[ str ] = caller; - } - - template - void AddAccelerator( const TextObject & accelerator, void ( T::*func )( Gwen::Event::Info ), Gwen::Event::Handler* handler = NULL, void* data = NULL ) - { - if ( handler == NULL ) - { handler = this; } - - Gwen::Event::Caller* caller = new Gwen::Event::Caller(); - caller->Add( handler, func, data ); - Gwen::UnicodeString str = accelerator.GetUnicode(); - Gwen::Utility::Strings::ToUpper( str ); - Gwen::Utility::Strings::Strip( str, L" " ); - m_Accelerators[ str ] = caller; - } - - void AddAccelerator( const TextObject & accelerator ) - { - AddAccelerator( accelerator, &Base::DefaultAccel, this ); - } - - template - void GlobalAddAccelerator( const TextObject & accelerator, T func, Gwen::Event::Handler* handler = NULL ) - { - if ( handler == NULL ) - { handler = this; } - - Gwen::Event::Caller* caller = new Gwen::Event::Caller(); - caller->GlobalAdd( handler, func ); - Gwen::UnicodeString str = accelerator.GetUnicode(); - Gwen::Utility::Strings::ToUpper( str ); - Gwen::Utility::Strings::Strip( str, L" " ); - m_Accelerators[ str ] = caller; - } - - void GlobalAddAccelerator( const TextObject & accelerator, void ( *func )( Gwen::Event::Info ), Gwen::Event::Handler* handler = NULL, void* data = NULL ) - { - if ( handler == NULL ) - { handler = this; } - - Gwen::Event::Caller* caller = new Gwen::Event::Caller(); - caller->GlobalAdd( handler, func, data ); - Gwen::UnicodeString str = accelerator.GetUnicode(); - Gwen::Utility::Strings::ToUpper( str ); - Gwen::Utility::Strings::Strip( str, L" " ); - m_Accelerators[ str ] = caller; - } - - AccelMap m_Accelerators; - - // Default Events - - Gwen::Event::Caller onHoverEnter; - Gwen::Event::Caller onHoverLeave; - - // Childrens List - - Base::List Children; - - protected: - - // The logical parent - // It's usually what you expect, the control you've parented it to. - Base* m_Parent; - - // If the innerpanel exists our children will automatically - // become children of that instead of us - allowing us to move - // them all around by moving that panel (useful for scrolling etc) - Base* m_InnerPanel; - virtual Base* Inner() { return m_InnerPanel; } - - // This is the panel's actual parent - most likely the logical - // parent's InnerPanel (if it has one). You should rarely need this. - Base* m_ActualParent; - - Base* m_ToolTip; - - Skin::Base* m_Skin; - - Gwen::Rect m_Bounds; - Gwen::Rect m_RenderBounds; - - Padding m_Padding; - Margin m_Margin; - - Gwen::String m_Name; - - - bool m_bRestrictToParent; - bool m_bDisabled; - bool m_bHidden; - bool m_bMouseInputEnabled; - bool m_bKeyboardInputEnabled; - bool m_bDrawBackground; - - int m_iDock; - - unsigned char m_Cursor; - - bool m_Tabable; - - public: - - bool NeedsLayout() { return m_bNeedsLayout; } - void Invalidate(); - void InvalidateParent() { if ( m_Parent ) { m_Parent->Invalidate(); } } - void InvalidateChildren( bool bRecursive = false ); - void Position( int pos, int xpadding = 0, int ypadding = 0 ); - - protected: - - virtual void RecurseLayout( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - virtual void PostLayout( Skin::Base* /*skin*/ ) {}; - - bool m_bNeedsLayout; - bool m_bCacheTextureDirty; - bool m_bCacheToTexture; - - // - // Drag + Drop - public: - - // Giver - - virtual void DragAndDrop_SetPackage( bool bDraggable, const String & strName = "", void* pUserData = NULL ); - virtual bool DragAndDrop_Draggable(); - virtual bool DragAndDrop_ShouldStartDrag() { return true; } - virtual void DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual Gwen::DragAndDrop::Package* DragAndDrop_GetPackage( int x, int y ); - virtual void DragAndDrop_EndDragging( bool /*bSuccess*/, int /*x*/, int /*y*/ ) {}; - - protected: - - DragAndDrop::Package* m_DragAndDrop_Package; - - public: - - // Receiver - virtual void DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) { } - virtual void DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* /*pPackage*/ ) { } - virtual void DragAndDrop_Hover( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) {}; - virtual bool DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual bool DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* /*pPackage*/ ) { return false; } - - - // - // Useful anim shortcuts - // - public: -#ifndef GWEN_NO_ANIMATION - - virtual void Anim_WidthIn( float fLength, float fDelay = 0.0f, float fEase = 1.0f ); - virtual void Anim_HeightIn( float fLength, float fDelay = 0.0f, float fEase = 1.0f ); - virtual void Anim_WidthOut( float fLength, bool bHide = true, float fDelay = 0.0f, float fEase = 1.0f ); - virtual void Anim_HeightOut( float fLength, bool bHide = true, float fDelay = 0.0f, float fEase = 1.0f ); - -#endif - - // - // Dynamic casting, see gwen_cast below - // - public: - - static const char* GetIdentifier() - { - static const char* ident = "Base"; - return ident; - }; - - virtual Gwen::Controls::Base* DynamicCast( const char* Variable ) - { - return NULL; - } - - - public: - - void DoNotIncludeInSize() { m_bIncludeInSize = false; } - bool ShouldIncludeInSize() { return m_bIncludeInSize; } - - protected: - - bool m_bIncludeInSize; - - public: - - virtual TextObject GetChildValue( const Gwen::String & strName ); - virtual TextObject GetValue(); - virtual void SetValue( const TextObject & strValue ); - virtual void DoAction() {}; - virtual void SetAction( Event::Handler* pObject, Handler::FunctionWithInformation pFunction, const Gwen::Event::Packet & packet ) {}; - - virtual int GetNamedChildren( Gwen::ControlList & list, const Gwen::String & strName, bool bDeep = true ); - virtual Gwen::ControlList GetNamedChildren( const Gwen::String & strName, bool bDeep = true ); - - public: - - UserDataStorage UserData; - - }; - - } -} -/* - To avoid using dynamic_cast we have gwen_cast. - - Each class in Gwen includes GWEN_DYNAMIC. You don't have to include this macro anywhere as it's - automatically included in the GWEN_CONTROL macro. - - GWEN_DYNAMIC adds 2 functions: - - GetIdentifier - a static function with a static variable inside, which returns - the address of the static variable. The variable is defined as a - string containing "BASECLASSNAME:CLASSNAME". This string should be - as unique as possible - or the compiler might optimize the variables - together - which means that when this function returns the address it - could be the same on one or more variables. Something to bear in mind. - - DynamicCast - non static, takes an address returned by GetIdentifier. Will return an - address of a control if the control can safely be cast to the class from - which the identifier was taken. - - Really you shouldn't actually have to concenn yourself with that stuff. The only thing you - should use in theory is gwen_cast - which is used just the same as dynamic cast - except for - one difference. We pass in the class name, not a pointer to the class. - - gwen_cast(control) - dynamic_cast(control) - -*/ - -template< class T > -T* gwen_cast( Gwen::Controls::Base* p ) -{ - if ( !p ) { return NULL; } - - Gwen::Controls::Base* pReturn = p->DynamicCast( T::GetIdentifier() ); - - if ( !pReturn ) { return NULL; } - - return static_cast( pReturn ); -} - - -template -T* Gwen::Controls::Base::FindChild( const Gwen::String & name, bool bRecursive ) -{ - return gwen_cast ( FindChildByName( name, bRecursive ) ); -} - -#define GWEN_DYNAMIC( ThisName, BaseName ) \ - \ - static const char* GetIdentifier() \ - { \ - static const char* ident = #BaseName ":" #ThisName; \ - return ident; \ - }; \ - virtual Gwen::Controls::Base* DynamicCast( const char* Variable ) \ - { \ - if ( GetIdentifier() == Variable ) \ - return this; \ - \ - return BaseClass::DynamicCast( Variable); \ - } - -#define GWEN_CLASS( ThisName, BaseName )\ - typedef BaseName BaseClass;\ - typedef ThisName ThisClass;\ - -// To be placed in the controls .h definition. -#define GWEN_CONTROL( ThisName, BaseName )\ - public:\ - GWEN_CLASS( ThisName, BaseName )\ - GWEN_DYNAMIC( ThisName, BaseName )\ - virtual const char* GetTypeName(){ return #ThisName; }\ - virtual const char* GetBaseTypeName(){ return BaseClass::GetTypeName(); }\ - ThisName( Gwen::Controls::Base* pParent, const Gwen::String& pName = "" ) - -#define GWEN_CONTROL_INLINE( ThisName, BaseName )\ - GWEN_CONTROL( ThisName, BaseName ) : BaseClass( pParent, pName ) - -#define GWEN_CONTROL_CONSTRUCTOR( ThisName )\ - ThisName::ThisName( Gwen::Controls::Base* pParent, const Gwen::String& pName ) : BaseClass( pParent, pName ) - - - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Button.cpp b/OpenSauce/shared/Include/GWEN/Controls/Button.cpp deleted file mode 100644 index 740351e06..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Button.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/ImagePanel.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( Button ) -{ - m_Image = NULL; - m_bDepressed = false; - m_bCenterImage = false; - SetSize( 100, 20 ); - SetMouseInputEnabled( true ); - SetIsToggle( false ); - SetAlignment( Gwen::Pos::Center ); - SetTextPadding( Padding( 3, 0, 3, 0 ) ); - m_bToggleStatus = false; - SetKeyboardInputEnabled( false ); - SetTabable( false ); -} - -void Button::Render( Skin::Base* skin ) -{ - if ( !ShouldDrawBackground() ) { return; } - - bool bDrawDepressed = IsDepressed() && IsHovered(); - - if ( IsToggle() ) { bDrawDepressed = bDrawDepressed || GetToggleState(); } - - bool bDrawHovered = IsHovered() && ShouldDrawHover(); - skin->DrawButton( this, bDrawDepressed, bDrawHovered, IsDisabled() ); -} - -void Button::OnMouseClickLeft( int /*x*/, int /*y*/, bool bDown ) -{ - if ( IsDisabled() ) { return; } - - if ( bDown ) - { - SetDepressed( true ); - Gwen::MouseFocus = this; - onDown.Call( this ); - } - else - { - if ( IsHovered() && m_bDepressed ) - { - OnPress(); - } - - SetDepressed( false ); - Gwen::MouseFocus = NULL; - onUp.Call( this ); - } -} - -void Button::OnMouseClickRight( int /*x*/, int /*y*/, bool bDown ) -{ - if ( IsDisabled() ) { return; } - - if ( bDown ) - { - SetDepressed( true ); - Gwen::MouseFocus = this; - onDown.Call( this ); - } - else - { - if ( IsHovered() && m_bDepressed ) - { - OnRightPress(); - } - - SetDepressed( false ); - Gwen::MouseFocus = NULL; - onUp.Call( this ); - } -} - - -void Button::SetDepressed( bool b ) -{ - if ( m_bDepressed == b ) { return; } - - m_bDepressed = b; - Redraw(); -} - -void Button::OnRightPress() -{ - onRightPress.Call( this ); -} - -void Button::OnPress() -{ - if ( IsToggle() ) - { - SetToggleState( !GetToggleState() ); - } - - onPress.Call( this ); -} - - -void Button::SetImage( const TextObject & strName, bool bCenter ) -{ - if ( strName.GetUnicode() == L"" ) - { - if ( m_Image ) - { - delete m_Image; - m_Image = NULL; - } - - return; - } - - if ( !m_Image ) - { - m_Image = new ImagePanel( this ); - } - - m_Image->SetImage( strName ); - m_Image->SizeToContents(); - m_Image->SetMargin( Margin( 2, 0, 2, 0 ) ); - m_bCenterImage = bCenter; - // Ugh. - Padding padding = GetTextPadding(); - padding.left = m_Image->Right() + 2; - SetTextPadding( padding ); -} - -void Button::SetToggleState( bool b ) -{ - if ( m_bToggleStatus == b ) { return; } - - m_bToggleStatus = b; - onToggle.Call( this ); - - if ( m_bToggleStatus ) - { - onToggleOn.Call( this ); - } - else - { - onToggleOff.Call( this ); - } - - Redraw(); -} - -void Button::SizeToContents() -{ - BaseClass::SizeToContents(); - - if ( m_Image ) - { - int height = m_Image->Height() + 4; - - if ( Height() < height ) - { - SetHeight( height ); - } - } -} - -bool Button::OnKeySpace( bool bDown ) -{ - if ( bDown ) - { - OnPress(); - } - - return true; -} - -void Button::AcceleratePressed() -{ - OnPress(); -} - -void Button::UpdateColours() -{ - if ( IsDisabled() ) { return SetTextColor( GetSkin()->Colors.Button.Disabled ); } - - if ( IsDepressed() || GetToggleState() ) { return SetTextColor( GetSkin()->Colors.Button.Down ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Button.Hover ); } - - SetTextColor( GetSkin()->Colors.Button.Normal ); -} - -void Button::PostLayout( Skin::Base* pSkin ) -{ - BaseClass::PostLayout( pSkin ); - - if ( m_Image ) - { - if ( m_bCenterImage ) - { m_Image->Position( Pos::Center ); } - else - { m_Image->Position( Pos::Left | Pos::CenterV ); } - } -} - -void Button::OnMouseDoubleClickLeft( int x, int y ) -{ - if ( IsDisabled() ) { return; } - - OnMouseClickLeft( x, y, true ); - onDoubleClick.Call( this ); -} - -void Button::SetImageAlpha( float f ) -{ - if ( !m_Image ) { return; } - - m_Image->SetDrawColor( Gwen::Color( 255, 255, 255, 255.0f * f ) ); -} - -void Button::SetAction( Event::Handler* pObject, Handler::FunctionWithInformation pFunction, void* data ) -{ - onPress.Add( pObject, pFunction, data ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Button.h b/OpenSauce/shared/Include/GWEN/Controls/Button.h deleted file mode 100644 index c01bcf286..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Button.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_BUTTON_H -#define GWEN_CONTROLS_BUTTON_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" - -namespace Gwen -{ - namespace Controls - { - class ImagePanel; - - class GWEN_EXPORT Button : public Label - { - public: - - GWEN_CONTROL( Button, Label ); - - virtual void Render( Skin::Base* skin ); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - virtual void OnMouseClickRight( int x, int y, bool bDown ); - virtual void OnMouseDoubleClickLeft( int x, int y ); - virtual bool OnKeySpace( bool bDown ); - - virtual void OnPress(); - virtual void OnRightPress(); - - virtual void AcceleratePressed(); - - virtual bool IsDepressed() const { return m_bDepressed; } - virtual void SetDepressed( bool b ); - - // - // Buttons can be toggle type, which means that it is - // toggled on and off. Its toggle status is in IsDepressed. - // - virtual void SetIsToggle( bool b ) { m_bToggle = b; } - virtual bool IsToggle() const { return m_bToggle; } - virtual bool GetToggleState() const { return m_bToggleStatus; } - virtual void SetToggleState( bool b ); - virtual void Toggle() { SetToggleState( !GetToggleState() ); } - - - virtual void SetImage( const TextObject & strName, bool bCenter = false ); - - virtual void SizeToContents(); - virtual void PostLayout( Skin::Base* pSkin ); - virtual void UpdateColours(); - - virtual void SetImageAlpha( float fMultiply ); - - virtual void DoAction() { OnPress(); } - virtual void SetAction( Event::Handler* pObject, Handler::FunctionWithInformation pFunction, void* data ); - - public: - - Gwen::Event::Caller onPress; - Gwen::Event::Caller onRightPress; - Gwen::Event::Caller onDown; - Gwen::Event::Caller onUp; - Gwen::Event::Caller onDoubleClick; - Gwen::Event::Caller onToggle; - Gwen::Event::Caller onToggleOn; - Gwen::Event::Caller onToggleOff; - - protected: - - ImagePanel* m_Image; - - bool m_bDepressed; - bool m_bToggle; - bool m_bToggleStatus; - - bool m_bCenterImage; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Canvas.cpp b/OpenSauce/shared/Include/GWEN/Controls/Canvas.cpp deleted file mode 100644 index 3aa1acb6c..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Canvas.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Canvas.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Menu.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/ToolTip.h" - -#ifndef GWEN_NO_ANIMATION -#include "Gwen/Anim.h" -#endif - -using namespace Gwen::Controls; - - -Canvas::Canvas( Gwen::Skin::Base* pSkin ) : BaseClass( NULL ), m_bAnyDelete( false ) -{ - SetBounds( 0, 0, 10000, 10000 ); - SetScale( 1.0f ); - SetBackgroundColor( Color( 255, 255, 255, 255 ) ); - SetDrawBackground( false ); - - if ( pSkin ) { SetSkin( pSkin ); } -} - -Canvas::~Canvas() -{ - ReleaseChildren(); -} - -void Canvas::RenderCanvas() -{ - DoThink(); - Gwen::Renderer::Base* render = m_Skin->GetRender(); - render->Begin(); - RecurseLayout( m_Skin ); - render->SetClipRegion( GetBounds() ); - render->SetRenderOffset( Gwen::Point( 0, 0 ) ); - render->SetScale( Scale() ); - - if ( m_bDrawBackground ) - { - render->SetDrawColor( m_BackgroundColor ); - render->DrawFilledRect( GetRenderBounds() ); - } - - DoRender( m_Skin ); - DragAndDrop::RenderOverlay( this, m_Skin ); - ToolTip::RenderToolTip( m_Skin ); - render->End(); -} - -void Canvas::Render( Gwen::Skin::Base* /*pRender*/ ) -{ - m_bNeedsRedraw = false; -} - -void Canvas::OnBoundsChanged( Gwen::Rect oldBounds ) -{ - BaseClass::OnBoundsChanged( oldBounds ); - InvalidateChildren( true ); -} - - -void Canvas::DoThink() -{ - ProcessDelayedDeletes(); - - if ( Hidden() ) { return; } - -#ifndef GWEN_NO_ANIMATION - Gwen::Anim::Think(); -#endif - // Reset tabbing - { - NextTab = NULL; - FirstTab = NULL; - } - ProcessDelayedDeletes(); - // Check has focus etc.. - RecurseLayout( m_Skin ); - - // If we didn't have a next tab, cycle to the start. - if ( NextTab == NULL ) - { NextTab = FirstTab; } - - Gwen::Input::OnCanvasThink( this ); -} - -void Canvas::SetScale( float f ) -{ - if ( m_fScale == f ) { return; } - - m_fScale = f; - - if ( m_Skin && m_Skin->GetRender() ) - { m_Skin->GetRender()->SetScale( m_fScale ); } - - OnScaleChanged(); - Redraw(); -} - -void Canvas::AddDelayedDelete( Gwen::Controls::Base* pControl ) -{ - if ( !m_bAnyDelete || m_DeleteSet.find( pControl ) == m_DeleteSet.end() ) - { - m_bAnyDelete = true; - m_DeleteSet.insert( pControl ); - m_DeleteList.push_back( pControl ); - } -} - -void Canvas::PreDeleteCanvas( Controls::Base* pControl ) -{ - if ( m_bAnyDelete ) - { - std::set< Controls::Base* >::iterator itFind; - - if ( ( itFind = m_DeleteSet.find( pControl ) ) != m_DeleteSet.end() ) - { - m_DeleteList.remove( pControl ); - m_DeleteSet.erase( pControl ); - m_bAnyDelete = !m_DeleteSet.empty(); - } - } -} - -void Canvas::ProcessDelayedDeletes() -{ - while ( m_bAnyDelete ) - { - m_bAnyDelete = false; - Controls::Base::List deleteList = m_DeleteList; - m_DeleteList.clear(); - m_DeleteSet.clear(); - - for ( Gwen::Controls::Base::List::iterator it = deleteList.begin(); it != deleteList.end(); ++it ) - { - Gwen::Controls::Base* pControl = *it; - pControl->PreDelete( GetSkin() ); - delete pControl; - Redraw(); - } - } -} - -void Canvas::ReleaseChildren() -{ - Base::List::iterator iter = Children.begin(); - - // If the currently hovered control is on this canvas, and the canvas is being cleared, null the hovered control - if ( Gwen::HoveredControl && (Gwen::HoveredControl->GetCanvas() == this) ) - { - Gwen::HoveredControl = nullptr; - } - - while ( iter != Children.end() ) - { - Base* pChild = *iter; - iter = Children.erase( iter ); - delete pChild; - } -} - -bool Canvas::InputMouseMoved( int x, int y, int deltaX, int deltaY ) -{ - if ( Hidden() ) { return false; } - - if ( ToolTip::TooltipActive() ) - { Redraw(); } - - // Todo: Handle scaling here.. - //float fScale = 1.0f / Scale(); - Gwen::Input::OnMouseMoved( this, x, y, deltaX, deltaY ); - - if ( !Gwen::HoveredControl ) { return false; } - - if ( Gwen::HoveredControl == this ) { return false; } - - if ( Gwen::HoveredControl->GetCanvas() != this ) { return false; } - - Gwen::HoveredControl->OnMouseMoved( x, y, deltaX, deltaY ); - Gwen::HoveredControl->UpdateCursor(); - DragAndDrop::OnMouseMoved( Gwen::HoveredControl, x, y ); - return true; -} - -bool Canvas::InputMouseButton( int iButton, bool bDown ) -{ - if ( Hidden() ) { return false; } - - return Gwen::Input::OnMouseClicked( this, iButton, bDown ); -} - -bool Canvas::InputKey( int iKey, bool bDown ) -{ - if ( Hidden() ) { return false; } - - if ( iKey <= Gwen::Key::Invalid ) { return false; } - - if ( iKey >= Gwen::Key::Count ) { return false; } - - return Gwen::Input::OnKeyEvent( this, iKey, bDown ); -} - -bool Canvas::InputCharacter( Gwen::UnicodeChar chr ) -{ - if ( Hidden() ) { return false; } - - if ( !iswprint( chr ) ) { return false; } - - //Handle Accelerators - if ( Gwen::Input::HandleAccelerator( this, chr ) ) - { return true; } - - //Handle characters - if ( !Gwen::KeyboardFocus ) { return false; } - - if ( Gwen::KeyboardFocus->GetCanvas() != this ) { return false; } - - if ( !Gwen::KeyboardFocus->Visible() ) { return false; } - - if ( Gwen::Input::IsControlDown() ) { return false; } - - return KeyboardFocus->OnChar( chr ); -} - -bool Canvas::InputMouseWheel( int val ) -{ - if ( Hidden() ) { return false; } - - if ( !Gwen::HoveredControl ) { return false; } - - if ( Gwen::HoveredControl == this ) { return false; } - - if ( Gwen::HoveredControl->GetCanvas() != this ) { return false; } - - return Gwen::HoveredControl->OnMouseWheeled( val ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Canvas.h b/OpenSauce/shared/Include/GWEN/Controls/Canvas.h deleted file mode 100644 index 4ea6a86e2..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Canvas.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_CANVAS_H -#define GWEN_CONTROLS_CANVAS_H - -#include -#include "Gwen/Controls/Base.h" -#include "Gwen/InputHandler.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT Canvas : public Base - { - public: - - typedef Controls::Base BaseClass; - - Canvas( Skin::Base* pSkin ); - virtual ~Canvas(); - - // - // For additional initialization - // (which is sometimes not appropriate in the constructor) - // - virtual void Initialize() {}; - - // - // You should call this to render your canvas. - // - virtual void RenderCanvas(); - - // - // Call this whenever you want to process input. This - // is usually once a frame.. - // - virtual void DoThink(); - - // - // In most situations you will be rendering the canvas - // every frame. But in some situations you will only want - // to render when there have been changes. You can do this - // by checking NeedsRedraw(). - // - virtual bool NeedsRedraw() { return m_bNeedsRedraw; } - virtual void Redraw() { m_bNeedsRedraw = true; } - - // Internal. Do not call directly. - virtual void Render( Skin::Base* pRender ); - - // Childpanels call parent->GetCanvas() until they get to - // this top level function. - virtual Controls::Canvas* GetCanvas() { return this; } - - virtual void SetScale( float f ); - virtual float Scale() const { return m_fScale; } - - virtual void OnBoundsChanged( Gwen::Rect oldBounds ); - - // Delete all children (this is done called in the destructor too) - virtual void ReleaseChildren(); - - // Delayed deletes - virtual void AddDelayedDelete( Controls::Base* pControl ); - virtual void ProcessDelayedDeletes(); - - Controls::Base* FirstTab; - Controls::Base* NextTab; - - // Input - virtual bool InputMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual bool InputMouseButton( int iButton, bool bDown ); - virtual bool InputKey( int iKey, bool bDown ); - virtual bool InputCharacter( Gwen::UnicodeChar chr ); - virtual bool InputMouseWheel( int val ); - virtual bool InputQuit() { return true; }; - - // Background - virtual void SetBackgroundColor( const Gwen::Color & color ) { m_BackgroundColor = color; } - virtual void SetDrawBackground( bool bShouldDraw ) { m_bDrawBackground = bShouldDraw; } - - protected: - - bool m_bNeedsRedraw; - bool m_bAnyDelete; - float m_fScale; - - Controls::Base::List m_DeleteList; - std::set< Controls::Base* > m_DeleteSet; - friend class Controls::Base; - void PreDeleteCanvas( Controls::Base* ); - - bool m_bDrawBackground; - Gwen::Color m_BackgroundColor; - - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CheckBox.cpp b/OpenSauce/shared/Include/GWEN/Controls/CheckBox.cpp deleted file mode 100644 index 103e397b3..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CheckBox.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/CheckBox.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - - -GWEN_CONTROL_CONSTRUCTOR( CheckBox ) -{ - SetSize( 15, 15 ); - m_bChecked = true; - Toggle(); -} - - -void CheckBox::Render( Skin::Base* skin ) -{ - skin->DrawCheckBox( this, m_bChecked, IsDepressed() ); -} - -void CheckBox::OnPress() -{ - if ( IsDisabled() ) - { return; } - - if ( IsChecked() && !AllowUncheck() ) - { return; } - - Toggle(); -} - -void CheckBox::OnCheckStatusChanged() -{ - if ( IsChecked() ) - { - onChecked.Call( this ); - } - else - { - onUnChecked.Call( this ); - } - - onCheckChanged.Call( this ); -} - -void CheckBox::SetChecked( bool bChecked ) -{ - if ( m_bChecked == bChecked ) { return; } - - m_bChecked = bChecked; - OnCheckStatusChanged(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CheckBox.h b/OpenSauce/shared/Include/GWEN/Controls/CheckBox.h deleted file mode 100644 index f49967fb3..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CheckBox.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_CHECKBOX_H -#define GWEN_CONTROLS_CHECKBOX_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/LabelClickable.h" - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT CheckBox : public Button - { - public: - - GWEN_CONTROL( CheckBox, Button ); - - virtual void Render( Skin::Base* skin ); - virtual void OnPress(); - - virtual void SetChecked( bool Checked ); - virtual void Toggle() { SetChecked( !IsChecked() ); } - virtual bool IsChecked() { return m_bChecked; } - - Gwen::Event::Caller onChecked; - Gwen::Event::Caller onUnChecked; - Gwen::Event::Caller onCheckChanged; - - private: - - // For derived controls - virtual bool AllowUncheck() { return true; } - - void OnCheckStatusChanged(); - - bool m_bChecked; - }; - - class GWEN_EXPORT CheckBoxWithLabel : public Base - { - public: - - GWEN_CONTROL_INLINE( CheckBoxWithLabel, Base ) - { - SetSize( 200, 19 ); - m_Checkbox = new CheckBox( this ); - m_Checkbox->Dock( Pos::Left ); - m_Checkbox->SetMargin( Margin( 0, 2, 2, 2 ) ); - m_Checkbox->SetTabable( false ); - m_Label = new LabelClickable( this ); - m_Label->Dock( Pos::Fill ); - m_Label->onPress.Add( m_Checkbox, &CheckBox::OnPress ); - m_Label->SetTabable( false ); - SetTabable( false ); - } - - virtual CheckBox* Checkbox() { return m_Checkbox; } - virtual LabelClickable* Label() { return m_Label; } - virtual bool OnKeySpace( bool bDown ) { if ( !bDown ) { m_Checkbox->SetChecked( !m_Checkbox->IsChecked() ); } return true; } - - private: - - CheckBox* m_Checkbox; - LabelClickable* m_Label; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.cpp b/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.cpp deleted file mode 100644 index 667e830b5..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/CollapsibleCategory.h" -#include "Gwen/Controls/CollapsibleList.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class CategoryButton : public Button -{ - GWEN_CONTROL_INLINE( CategoryButton, Button ) - { - SetAlignment( Pos::Left | Pos::CenterV ); - m_bAlt = false; - } - - virtual void Render( Skin::Base* skin ) - { - if ( m_bAlt ) - { - if ( IsDepressed() || GetToggleState() ) { skin->GetRender()->SetDrawColor( skin->Colors.Category.LineAlt.Button_Selected ); } - else if ( IsHovered() ) { skin->GetRender()->SetDrawColor( skin->Colors.Category.LineAlt.Button_Hover ); } - else { skin->GetRender()->SetDrawColor( skin->Colors.Category.LineAlt.Button ); } - } - else - { - if ( IsDepressed() || GetToggleState() ) { skin->GetRender()->SetDrawColor( skin->Colors.Category.Line.Button_Selected ); } - else if ( IsHovered() ) { skin->GetRender()->SetDrawColor( skin->Colors.Category.Line.Button_Hover ); } - else { skin->GetRender()->SetDrawColor( skin->Colors.Category.Line.Button ); } - } - - skin->GetRender()->DrawFilledRect( this->GetRenderBounds() ); - } - - void UpdateColours() - { - if ( m_bAlt ) - { - if ( IsDepressed() || GetToggleState() ) { return SetTextColor( GetSkin()->Colors.Category.LineAlt.Text_Selected ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Category.LineAlt.Text_Hover ); } - - return SetTextColor( GetSkin()->Colors.Category.LineAlt.Text ); - } - - if ( IsDepressed() || GetToggleState() ) { return SetTextColor( GetSkin()->Colors.Category.Line.Text_Selected ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Category.Line.Text_Hover ); } - - return SetTextColor( GetSkin()->Colors.Category.Line.Text ); - } - - bool m_bAlt; -}; - -class CategoryHeaderButton : public Button -{ - GWEN_CONTROL_INLINE( CategoryHeaderButton, Button ) - { - SetShouldDrawBackground( false ); - SetIsToggle( true ); - SetAlignment( Pos::Center ); - } - - void UpdateColours() - { - if ( IsDepressed() || GetToggleState() ) { return SetTextColor( GetSkin()->Colors.Category.Header_Closed ); } - - return SetTextColor( GetSkin()->Colors.Category.Header ); - } - -}; - - -GWEN_CONTROL_CONSTRUCTOR( CollapsibleCategory ) -{ - m_pList = NULL; - m_pButton = new CategoryHeaderButton( this ); - m_pButton->SetText( "Category Title" ); - m_pButton->Dock( Pos::Top ); - m_pButton->SetHeight( 20 ); - SetPadding( Padding( 1, 0, 1, 5 ) ); - SetSize( 512, 512 ); -} - -Button* CollapsibleCategory::Add( const TextObject & name ) -{ - CategoryButton* pButton = new CategoryButton( this ); - pButton->SetText( name ); - pButton->Dock( Pos::Top ); - pButton->SizeToContents(); - pButton->SetSize( pButton->Width() + 4, pButton->Height() + 4 ); - pButton->SetPadding( Padding( 5, 2, 2, 2 ) ); - pButton->onPress.Add( this, &ThisClass::OnSelection ); - return pButton; -} - -void CollapsibleCategory::OnSelection( Controls::Base* control ) -{ - CategoryButton* pChild = gwen_cast ( control ); - - if ( !pChild ) { return; } - - if ( m_pList ) - { - m_pList->UnselectAll(); - } - else - { - UnselectAll(); - } - - pChild->SetToggleState( true ); - onSelection.Call( this ); -} - -void CollapsibleCategory::Render( Skin::Base* skin ) -{ - skin->DrawCategoryInner( this, m_pButton->GetToggleState() ); -} - -void CollapsibleCategory::SetText( const TextObject & text ) -{ - m_pButton->SetText( text ); -} - -void CollapsibleCategory::UnselectAll() -{ - Base::List & children = GetChildren(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - CategoryButton* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - pChild->SetToggleState( false ); - } -} - -void CollapsibleCategory::PostLayout( Skin::Base* /*skin*/ ) -{ - if ( m_pButton->GetToggleState() ) - { - SetHeight( m_pButton->Height() ); - } - else - { - SizeToChildren( false, true ); - } - - Base::List & children = GetChildren(); - bool b = true; - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - CategoryButton* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - pChild->m_bAlt = b; - pChild->UpdateColours(); - b = !b; - } -}; - -Button* CollapsibleCategory::GetSelected() -{ - Base::List & children = GetChildren(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - CategoryButton* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - if ( pChild->GetToggleState() ) - { return pChild; } - } - - return NULL; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.h b/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.h deleted file mode 100644 index c6775542d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleCategory.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_COLLAPSIBLECATEGORY_H -#define GWEN_CONTROLS_COLLAPSIBLECATEGORY_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - class CollapsibleList; - - class GWEN_EXPORT CollapsibleCategory : public Gwen::Controls::Base - { - public: - - GWEN_CONTROL( CollapsibleCategory, Gwen::Controls::Base ); - - virtual void Render( Skin::Base* skin ); - - virtual void SetText( const TextObject & text ); - - virtual Button* Add( const TextObject & name ); - - virtual void PostLayout( Skin::Base* /*skin*/ ); - - virtual void SetList( Controls::CollapsibleList* p ) { m_pList = p; } - - virtual void UnselectAll(); - virtual Button* GetSelected(); - - public: - - Gwen::Event::Caller onSelection; - - protected: - - virtual void OnSelection( Controls::Base* control ); - - Controls::Button* m_pButton; - Controls::CollapsibleList* m_pList; - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleList.h b/OpenSauce/shared/Include/GWEN/Controls/CollapsibleList.h deleted file mode 100644 index 4cdf3442a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CollapsibleList.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_COLLAPSIBLELIST_H -#define GWEN_CONTROLS_COLLAPSIBLELIST_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/ScrollControl.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/CollapsibleCategory.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT CollapsibleList : public Gwen::Controls::ScrollControl - { - public: - - Gwen::Event::Caller onSelection; - - public: - - GWEN_CONTROL_INLINE( CollapsibleList, Gwen::Controls::ScrollControl ) - { - SetScroll( false, true ); - SetAutoHideBars( true ); - } - - virtual void Add( Gwen::Controls::CollapsibleCategory* pCategory ) - { - pCategory->SetParent( this ); - pCategory->Dock( Pos::Top ); - pCategory->SetMargin( Margin( 1, 0, 1, 1 ) ); - pCategory->SetList( this ); - pCategory->onSelection.Add( this, &ThisClass::OnSelectionEvent ); - } - - virtual Gwen::Controls::CollapsibleCategory* Add( const TextObject & name ) - { - Gwen::Controls::CollapsibleCategory* pCategory = new CollapsibleCategory( this ); - pCategory->SetText( name ); - Add( pCategory ); - return pCategory; - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawCategoryHolder( this ); - } - - virtual void UnselectAll() - { - Base::List & children = GetChildren(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - Gwen::Controls::CollapsibleCategory* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - pChild->UnselectAll(); - } - } - - virtual Gwen::Controls::Button* GetSelected() - { - Base::List & children = GetChildren(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - Gwen::Controls::CollapsibleCategory* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - Gwen::Controls::Button* pSelected = pChild->GetSelected(); - - if ( pSelected ) { return pSelected; } - } - - return NULL; - } - - protected: - - virtual void OnSelection( Gwen::Controls::CollapsibleCategory* pControl, Gwen::Controls::Button* pSelected ) - { - onSelection.Call( this ); - } - - void OnSelectionEvent( Controls::Base* pControl ) - { - Gwen::Controls::CollapsibleCategory* pChild = gwen_cast ( pControl ); - - if ( !pChild ) { return; } - - OnSelection( pChild, pChild->GetSelected() ); - } - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ColorControls.cpp b/OpenSauce/shared/Include/GWEN/Controls/ColorControls.cpp deleted file mode 100644 index c6b54b458..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ColorControls.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Utility.h" -#include "Gwen/Controls/ColorControls.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -//Find a place to put these... -Color HSVToColor( float h, float s, float v ) -{ - if ( h < 0.0f ) { h += 360.0f; } - - if ( h > 360.0f ) { h -= 360.0f; } - - s *= 255.0f; - v *= 255.0f; - float r, g, b; - - if ( !h && !s ) - { - r = g = b = v; - } - - double min, max, delta, hue; - max = v; - delta = ( max * s ) / 255.0; - min = max - delta; - hue = h; - - if ( h > 300 || h <= 60 ) - { - r = ( int ) max; - - if ( h > 300 ) - { - g = ( int ) min; - hue = ( hue - 360.0 ) / 60.0; - b = ( int )( ( hue * delta - min ) * -1 ); - } - else - { - b = ( int ) min; - hue = hue / 60.0; - g = ( int )( hue * delta + min ); - } - } - else if ( h > 60 && h < 180 ) - { - g = ( int ) max; - - if ( h < 120 ) - { - b = ( int ) min; - hue = ( hue / 60.0 - 2.0 ) * delta; - r = ( int )( min - hue ); - } - else - { - r = ( int ) min; - hue = ( hue / 60 - 2.0 ) * delta; - b = ( int )( min + hue ); - } - } - else - { - b = ( int ) max; - - if ( h < 240 ) - { - r = ( int ) min; - hue = ( hue / 60.0 - 4.0 ) * delta; - g = ( int )( min - hue ); - } - else - { - g = ( int ) min; - hue = ( hue / 60 - 4.0 ) * delta; - r = ( int )( min + hue ); - } - } - - return Color( r, g, b, 255 ); -} - -HSV RGBtoHSV( int r, int g, int b ) -{ - double min, max, delta, temp; - min = Gwen::Min( r, Gwen::Min( g, b ) ); - max = Gwen::Max( r, Gwen::Max( g, b ) ); - delta = max - min; - HSV hsv; - hsv.v = ( int ) max; - - if ( !delta ) - { - hsv.h = hsv.s = 0; - } - else - { - temp = delta / max; - hsv.s = ( int )( temp * 255 ); - - if ( r == ( int ) max ) - { - temp = ( double )( g - b ) / delta; - } - else if ( g == ( int ) max ) - { - temp = 2.0 + ( ( double )( b - r ) / delta ); - } - else - { - temp = 4.0 + ( ( double )( r - g ) / delta ); - } - - temp *= 60; - - if ( temp < 0 ) - { - temp += 360; - } - - if ( temp == 360 ) - { - temp = 0; - } - - hsv.h = ( int ) temp; - } - - hsv.s /= 255.0f; - hsv.v /= 255.0f; - return hsv; -} - - -GWEN_CONTROL_CONSTRUCTOR( ColorLerpBox ) -{ - SetColor( Gwen::Color( 255, 128, 0, 255 ) ); - SetSize( 128, 128 ); - SetMouseInputEnabled( true ); - m_bDepressed = false; -} - -//Find a place to put this? color member? -Gwen::Color LerpColor( Gwen::Color & toColor, Gwen::Color & fromColor, float amount ) -{ - Gwen::Color colorDelta = toColor - fromColor; - colorDelta.r *= amount; - colorDelta.g *= amount; - colorDelta.b *= amount; - Gwen::Color newColor = fromColor + colorDelta; - return newColor; -} - -Gwen::Color ColorLerpBox::GetSelectedColor() -{ - return GetColorAtPos( cursorPos.x, cursorPos.y ); -} - -void ColorLerpBox::SetColor( Gwen::Color color, bool onlyHue ) -{ - HSV hsv = RGBtoHSV( color.r, color.g, color.b ); - m_Hue = hsv.h; - - if ( !onlyHue ) - { - cursorPos.x = hsv.s * Width(); - cursorPos.y = ( 1 - hsv.v ) * Height(); - } - - onSelectionChanged.Call( this ); -} - -void ColorLerpBox::OnMouseMoved( int x, int y, int /*deltaX*/, int /*deltaY*/ ) -{ - if ( m_bDepressed ) - { - cursorPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - - //Do we have clamp? - if ( cursorPos.x < 0 ) - { cursorPos.x = 0; } - - if ( cursorPos.x > Width() ) - { cursorPos.x = Width(); } - - if ( cursorPos.y < 0 ) - { cursorPos.y = 0; } - - if ( cursorPos.y > Height() ) - { cursorPos.y = Height(); } - - onSelectionChanged.Call( this ); - } -} - -void ColorLerpBox::OnMouseClickLeft( int x, int y, bool bDown ) -{ - m_bDepressed = bDown; - - if ( bDown ) - { Gwen::MouseFocus = this; } - else - { Gwen::MouseFocus = NULL; } - - OnMouseMoved( x, y, 0, 0 ); -} - -Gwen::Color ColorLerpBox::GetColorAtPos( int x, int y ) -{ - float xPercent = ( ( float ) x / ( float ) Width() ); - float yPercent = 1 - ( ( float ) y / ( float ) Height() ); - Gwen::Color result = HSVToColor( m_Hue, xPercent, yPercent ); - result.a = 255; - return result; -} -void ColorLerpBox::Render( Gwen::Skin::Base* skin ) -{ - //Is there any way to move this into skin? Not for now, no idea how we'll "actually" render these - BaseClass::Render( skin ); - - for ( int x = 0; x < Width(); x++ ) - { - for ( int y = 0; y < Height(); y++ ) - { - skin->GetRender()->SetDrawColor( GetColorAtPos( x, y ) ); - skin->GetRender()->DrawPixel( x, y ); - } - } - - skin->GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); - skin->GetRender()->DrawLinedRect( GetRenderBounds() ); - Gwen::Color selected = GetSelectedColor(); - - if ( ( selected.r + selected.g + selected.b ) / 3 < 170 ) - { skin->GetRender()->SetDrawColor( Gwen::Color( 255, 255, 255, 255 ) ); } - else - { skin->GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); } - - Gwen::Rect testRect = Gwen::Rect( cursorPos.x - 3, cursorPos.y - 3, 6, 6 ); - skin->GetRender()->DrawShavedCornerRect( testRect ); -} - - - - - -GWEN_CONTROL_CONSTRUCTOR( ColorSlider ) -{ - SetSize( 32, 128 ); - SetMouseInputEnabled( true ); - m_bDepressed = false; -} - -void ColorSlider::Render( Gwen::Skin::Base* skin ) -{ - //Is there any way to move this into skin? Not for now, no idea how we'll "actually" render these - int y = 0; - - for ( y = 0; y < Height(); y++ ) - { - float yPercent = ( float ) y / ( float ) Height(); - skin->GetRender()->SetDrawColor( HSVToColor( yPercent * 360, 1, 1 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( 5, y, Width() - 10, 1 ) ); - } - - int drawHeight = m_iSelectedDist - 3; - //Draw our selectors - skin->GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( 0, drawHeight + 2, Width(), 1 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( 0, drawHeight, 5, 5 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( Width() - 5, drawHeight, 5, 5 ) ); - skin->GetRender()->SetDrawColor( Gwen::Color( 255, 255, 255, 255 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( 1, drawHeight + 1, 3, 3 ) ); - skin->GetRender()->DrawFilledRect( Gwen::Rect( Width() - 4, drawHeight + 1, 3, 3 ) ); -} - -void ColorSlider::OnMouseClickLeft( int x, int y, bool bDown ) -{ - m_bDepressed = bDown; - - if ( bDown ) - { Gwen::MouseFocus = this; } - else - { Gwen::MouseFocus = NULL; } - - OnMouseMoved( x, y, 0, 0 ); -} - -Gwen::Color ColorSlider::GetColorAtHeight( int y ) -{ - float yPercent = ( float ) y / ( float ) Height(); - return HSVToColor( yPercent * 360, 1, 1 ); -} -void ColorSlider::OnMouseMoved( int x, int y, int /*deltaX*/, int /*deltaY*/ ) -{ - if ( m_bDepressed ) - { - Gwen::Point cursorPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - - if ( cursorPos.y < 0 ) - { cursorPos.y = 0; } - - if ( cursorPos.y > Height() ) - { cursorPos.y = Height(); } - - m_iSelectedDist = cursorPos.y; - onSelectionChanged.Call( this ); - } -} - -void ColorSlider::SetColor( Gwen::Color color ) -{ - HSV hsv = RGBtoHSV( color.r, color.g, color.b ); - m_iSelectedDist = hsv.h / 360 * Height(); - onSelectionChanged.Call( this ); -} - -Gwen::Color ColorSlider::GetSelectedColor() -{ - return GetColorAtHeight( m_iSelectedDist ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ColorControls.h b/OpenSauce/shared/Include/GWEN/Controls/ColorControls.h deleted file mode 100644 index 2510a647b..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ColorControls.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_COLORCONTROLS_H -#define GWEN_CONTROLS_COLORCONTROLS_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT ColorLerpBox : public Controls::Base - { - public: - GWEN_CONTROL( ColorLerpBox, Controls::Base ); - virtual void Render( Gwen::Skin::Base* skin ); - Gwen::Color GetColorAtPos( int x, int y ); - void SetColor( Gwen::Color color, bool onlyHue = true ); - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - Gwen::Color GetSelectedColor(); - - Event::Caller onSelectionChanged; - protected: - Gwen::Point cursorPos; - bool m_bDepressed; - int m_Hue; - - }; - - class GWEN_EXPORT ColorSlider : public Controls::Base - { - public: - GWEN_CONTROL( ColorSlider, Controls::Base ); - virtual void Render( Gwen::Skin::Base* skin ); - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - Gwen::Color GetSelectedColor(); - Gwen::Color GetColorAtHeight( int y ); - void SetColor( Gwen::Color color ); - - Event::Caller onSelectionChanged; - - protected: - int m_iSelectedDist; - bool m_bDepressed; - - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.cpp b/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.cpp deleted file mode 100644 index 5b3667fb3..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ColorPicker.h" -#include "Gwen/Controls/HorizontalSlider.h" -#include "Gwen/Controls/GroupBox.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -GWEN_CONTROL_CONSTRUCTOR( ColorPicker ) -{ - SetMouseInputEnabled( true ); - SetSize( 256, 150 ); - CreateControls(); - SetColor( Gwen::Color( 50, 60, 70, 255 ) ); -} - -void ColorPicker::CreateColorControl( Gwen::String name, int y ) -{ - int colorSize = 12; - GroupBox* colorGroup = new GroupBox( this ); - colorGroup->SetPos( 10, y ); - colorGroup->SetText( name ); - colorGroup->SetSize( 160, 35 ); - colorGroup->SetName( name + "groupbox" ); - ColorDisplay* disp = new ColorDisplay( colorGroup ); - disp->SetName( name ); - disp->SetBounds( 0 , 3, colorSize, colorSize ); - TextBoxNumeric* numeric = new TextBoxNumeric( colorGroup ); - numeric->SetName( name + "Box" ); - numeric->SetPos( 105, 0 ); - numeric->SetSize( 26, 16 ); - numeric->SetSelectAllOnFocus( true ); - numeric->onTextChanged.Add( this, &ColorPicker::NumericTyped ); - HorizontalSlider* slider = new HorizontalSlider( colorGroup ); - slider->SetPos( colorSize + 5 , 1 ); - slider->SetRange( 0, 255 ); - slider->SetSize( 80, Gwen::Utility::Max( colorSize, 15 ) ); - slider->SetName( name + "Slider" ); - slider->onValueChanged.Add( this, &ColorPicker::SlidersMoved ); -} - -void ColorPicker::NumericTyped( Gwen::Controls::Base* control ) -{ - TextBoxNumeric* box = gwen_cast ( control ); - - if ( !box ) - { return; } - - if ( box->GetText() == L"" ) - { return; } - - int textValue = atoi( box->GetText().c_str() ); - - if ( textValue < 0 ) { textValue = 0; } - - if ( textValue > 255 ) { textValue = 255; } - - if ( box->GetName().find( "Red" ) != Gwen::String::npos ) - { SetRed( textValue ); } - - if ( box->GetName().find( "Green" ) != Gwen::String::npos ) - { SetGreen( textValue ); } - - if ( box->GetName().find( "Blue" ) != Gwen::String::npos ) - { SetBlue( textValue ); } - - if ( box->GetName().find( "Alpha" ) != Gwen::String::npos ) - { SetAlpha( textValue ); } - - UpdateControls(); -} - -void ColorPicker::SetColor( Gwen::Color color ) -{ - m_Color = color; - UpdateControls(); -} - -void ColorPicker::CreateControls() -{ - int startY = 5; - int height = 35; - CreateColorControl( "Red", startY ); - CreateColorControl( "Green", startY + height ); - CreateColorControl( "Blue", startY + height * 2 ); - CreateColorControl( "Alpha", startY + height * 3 ); - GroupBox* finalGroup = new GroupBox( this ); - finalGroup->SetPos( 180, 40 ); - finalGroup->SetSize( 60, 60 ); - finalGroup->SetText( "Result" ); - finalGroup->SetName( "ResultGroupBox" ); - ColorDisplay* disp = new ColorDisplay( finalGroup ); - disp->SetName( "Result" ); - disp->SetBounds( 7 , 5, 32, 32 ); - disp->SetDrawCheckers( true ); - //UpdateControls(); -} - -void ColorPicker::UpdateColorControls( Gwen::String name, Gwen::Color col, int sliderVal ) -{ - ColorDisplay* disp = gwen_cast ( FindChildByName( name, true ) ); - disp->SetColor( col ); - HorizontalSlider* slider = gwen_cast ( FindChildByName( name + "Slider", true ) ); - slider->SetFloatValue( sliderVal ); - TextBoxNumeric* box = gwen_cast ( FindChildByName( name + "Box", true ) ); - box->SetText( Gwen::Utility::ToString( sliderVal ) ); -} - -void ColorPicker::UpdateControls() -{ - //This is a little weird, but whatever for now - UpdateColorControls( "Red", Color( GetColor().r, 0, 0, 255 ), GetColor().r ); - UpdateColorControls( "Green", Color( 0, GetColor().g, 0, 255 ), GetColor().g ); - UpdateColorControls( "Blue", Color( 0, 0, GetColor().b, 255 ), GetColor().b ); - UpdateColorControls( "Alpha", Color( 255, 255, 255, GetColor().a ), GetColor().a ); - ColorDisplay* disp = gwen_cast ( FindChildByName( "Result", true ) ); - disp->SetColor( Color( GetColor().r, GetColor().g, GetColor().b, GetColor().a ) ); - onColorChanged.Call( this ); -} -void ColorPicker::SlidersMoved( Gwen::Controls::Base* control ) -{ - /* - HorizontalSlider* redSlider = gwen_cast( FindChildByName( "RedSlider", true ) ); - HorizontalSlider* greenSlider = gwen_cast( FindChildByName( "GreenSlider", true ) ); - HorizontalSlider* blueSlider = gwen_cast( FindChildByName( "BlueSlider", true ) ); - HorizontalSlider* alphaSlider = gwen_cast( FindChildByName( "AlphaSlider", true ) ); - */ - HorizontalSlider* slider = gwen_cast ( control ); - - if ( slider ) - { SetColorByName( GetColorFromName( slider->GetName() ), slider->GetFloatValue() ); } - - UpdateControls(); - //SetColor( Gwen::Color( redSlider->GetValue(), greenSlider->GetValue(), blueSlider->GetValue(), alphaSlider->GetValue() ) ); -} - -void ColorPicker::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - SizeToChildren( false, true ); - SetSize( Width(), Height() + 5 ); - GroupBox* groupBox = gwen_cast ( FindChildByName( "ResultGroupBox", true ) ); - - if ( groupBox ) - { groupBox->SetPos( groupBox->X(), Height() * 0.5f - groupBox->Height() * 0.5f ); } - - UpdateControls(); -} - - -int ColorPicker::GetColorByName( Gwen::String colorName ) -{ - if ( colorName == "Red" ) - { return GetColor().r; } - else if ( colorName == "Green" ) - { return GetColor().g; } - else if ( colorName == "Blue" ) - { return GetColor().b; } - else if ( colorName == "Alpha" ) - { return GetColor().a; } - else - { return 0; } -} - -Gwen::String ColorPicker::GetColorFromName( Gwen::String name ) -{ - if ( name.find( "Red" ) != Gwen::String::npos ) - { return "Red"; } - - if ( name.find( "Green" ) != Gwen::String::npos ) - { return "Green"; } - - if ( name.find( "Blue" ) != Gwen::String::npos ) - { return "Blue"; } - - if ( name.find( "Alpha" ) != Gwen::String::npos ) - { return "Alpha"; } - else - { return ""; } -} - -void ColorPicker::SetColorByName( Gwen::String colorName, int colorValue ) -{ - if ( colorName == "Red" ) - { SetRed( colorValue ); } - else if ( colorName == "Green" ) - { SetGreen( colorValue ); } - else if ( colorName == "Blue" ) - { SetBlue( colorValue ); } - else if ( colorName == "Alpha" ) - { SetAlpha( colorValue ); } -} - -void ColorPicker::SetAlphaVisible( bool visible ) -{ - GroupBox* groupBox = gwen_cast ( FindChildByName( "Alphagroupbox", true ) ); - groupBox->SetHidden( !visible ); - Invalidate(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.h b/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.h deleted file mode 100644 index d633c576d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ColorPicker.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_COLORPICKER_H -#define GWEN_CONTROLS_COLORPICKER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT ColorDisplay : public Controls::Base - { - public: - GWEN_CONTROL_INLINE( ColorDisplay, Controls::Base ) - { - SetSize( 32, 32 ); - m_Color = Color( 255, 0, 0, 255 ); - m_DrawCheckers = true; - } - - virtual void Render( Gwen::Skin::Base* skin ) - { - skin->DrawColorDisplay( this, m_Color ); - } - - virtual void SetColor( Gwen::Color color ) { m_Color = color; } - virtual Gwen::Color GetColor() { return m_Color; } - - virtual void SetRed( int red ) { m_Color.r = red; } - virtual void SetGreen( int green ) { m_Color.g = green;} - virtual void SetBlue( int blue ) { m_Color.b = blue; } - virtual void SetAlpha( int alpha ) { m_Color.a = alpha;} - - virtual void SetDrawCheckers( bool should ) { m_DrawCheckers = should; } - - protected: - Gwen::Color m_Color; - bool m_DrawCheckers; - }; - } - namespace Controls - { - - class GWEN_EXPORT ColorPicker : public Base - { - public: - - GWEN_CONTROL( ColorPicker, Base ); - - virtual void Layout( Skin::Base* skin ); - virtual void CreateControls(); - virtual void SlidersMoved( Gwen::Controls::Base* control ); - virtual void NumericTyped( Gwen::Controls::Base* control ); - virtual void UpdateControls(); - virtual void UpdateColorControls( Gwen::String name, Gwen::Color col, int sliderVal ); - virtual void CreateColorControl( Gwen::String name, int y ); - - virtual void SetColor( Gwen::Color color ); - virtual Gwen::Color GetColor() { return m_Color; } - - int GetColorByName( Gwen::String colorName ); - void SetColorByName( Gwen::String colorName, int colorValue ); - Gwen::String GetColorFromName( Gwen::String name ); - virtual void SetAlphaVisible( bool visible ); - - virtual void SetRed( int red ) { m_Color.r = red; } - virtual void SetGreen( int green ) { m_Color.g = green;} - virtual void SetBlue( int blue ) { m_Color.b = blue; } - virtual void SetAlpha( int alpha ) { m_Color.a = alpha;} - - Event::Caller onColorChanged; - - protected: - Gwen::Color m_Color; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ComboBox.cpp b/OpenSauce/shared/Include/GWEN/Controls/ComboBox.cpp deleted file mode 100644 index cca88a985..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ComboBox.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ComboBox.h" -#include "Gwen/Controls/Menu.h" - - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -class GWEN_EXPORT DownArrow : public Controls::Base -{ - public: - - GWEN_CONTROL_INLINE( DownArrow, Controls::Base ) - { - SetMouseInputEnabled( false ); - SetSize( 15, 15 ); - } - - void Render( Skin::Base* skin ) - { - if ( !m_ComboBox->ShouldDrawBackground() ) - { - return skin->DrawComboDownArrow( this, false, false, false, m_ComboBox->IsDisabled() ); - } - - skin->DrawComboDownArrow( this, m_ComboBox->IsHovered(), m_ComboBox->IsDepressed(), m_ComboBox->IsMenuOpen(), m_ComboBox->IsDisabled() ); - } - - void SetComboBox( ComboBox* p ) { m_ComboBox = p; } - - protected: - - ComboBox* m_ComboBox; -}; - -GWEN_CONTROL_CONSTRUCTOR( ComboBox ) -{ - SetSize( 100, 20 ); - m_Menu = new Menu( this ); - m_Menu->SetHidden( true ); - m_Menu->SetDisableIconMargin( true ); - m_Menu->SetTabable( false ); - DownArrow* pArrow = new DownArrow( this ); - pArrow->SetComboBox( this ); - m_Button = pArrow; - m_SelectedItem = NULL; - SetAlignment( Gwen::Pos::Left | Gwen::Pos::CenterV ); - SetText( L"" ); - SetMargin( Margin( 3, 0, 0, 0 ) ); - SetTabable( true ); - SetKeyboardInputEnabled( true ); -} - -MenuItem* ComboBox::AddItem( const UnicodeString & strLabel, const String & strName ) -{ - MenuItem* pItem = m_Menu->AddItem( strLabel, L"" ); - pItem->SetName( strName ); - pItem->onMenuItemSelected.Add( this, &ComboBox::OnItemSelected ); - - //Default - if ( m_SelectedItem == NULL ) - { OnItemSelected( pItem ); } - - return pItem; -} - -void ComboBox::Render( Skin::Base* skin ) -{ - if ( !ShouldDrawBackground() ) { return; } - - skin->DrawComboBox( this, IsDepressed(), IsMenuOpen() ); -} - -void ComboBox::Layout( Skin::Base* skin ) -{ - m_Button->Position( Pos::Right | Pos::CenterV, 4, 0 ); - BaseClass::Layout( skin ); -} - -void ComboBox::UpdateColours() -{ - if ( !ShouldDrawBackground() ) - { - return SetTextColor( GetSkin()->Colors.Button.Normal ); - } - - BaseClass::UpdateColours(); -} - -void ComboBox::OnPress() -{ - if ( IsMenuOpen() ) - { - return GetCanvas()->CloseMenus(); - } - - bool bWasMenuHidden = m_Menu->Hidden(); - GetCanvas()->CloseMenus(); - - if ( bWasMenuHidden ) - { - OpenList(); - } -} - -void ComboBox::ClearItems() -{ - if ( m_Menu ) - { - m_Menu->ClearItems(); - } -} - -void ComboBox::SelectItem( MenuItem* pItem, bool bFireChangeEvents ) -{ - if ( m_SelectedItem == pItem ) { return; } - - m_SelectedItem = pItem; - SetText( m_SelectedItem->GetText() ); - m_Menu->SetHidden( true ); - Invalidate(); - - if ( bFireChangeEvents ) - { - onSelection.Call( this ); - Focus(); - } -} - -void ComboBox::OnItemSelected( Controls::Base* pControl ) -{ - //Convert selected to a menu item - MenuItem* pItem = gwen_cast ( pControl ); - - if ( !pItem ) { return; } - - SelectItem( pItem ); -} - -void ComboBox::SelectItemByName( const Gwen::String & name, bool bFireChangeEvents ) -{ - Base::List & children = m_Menu->GetChildren(); - Base::List::iterator it = children.begin(); - - while ( it != children.end() ) - { - MenuItem* pChild = gwen_cast ( *it ); - - if ( pChild->GetName() == name ) - { - return SelectItem( pChild, bFireChangeEvents ); - } - - ++it; - } -} - -void ComboBox::OnLostKeyboardFocus() -{ - SetTextColor( Color( 0, 0, 0, 255 ) ); -} - - -void ComboBox::OnKeyboardFocus() -{ - //Until we add the blue highlighting again - SetTextColor( Color( 0, 0, 0, 255 ) ); - //m_SelectedText->SetTextColor( Color( 255, 255, 255, 255 ) ); -} - -Gwen::Controls::Label* ComboBox::GetSelectedItem() -{ - return m_SelectedItem; -} - -bool ComboBox::IsMenuOpen() -{ - return m_Menu && !m_Menu->Hidden(); -} - -void ComboBox::OpenList() -{ - if ( !m_Menu ) { return; } - - m_Menu->SetParent( GetCanvas() ); - m_Menu->SetHidden( false ); - m_Menu->BringToFront(); - Gwen::Point p = LocalPosToCanvas( Gwen::Point( 0, 0 ) ); - m_Menu->SetBounds( Gwen::Rect( p.x, p.y + Height(), Width(), m_Menu->Height() ) ); -} - -void ComboBox::CloseList() -{ - if ( !m_Menu ) { return; } - - m_Menu->Hide(); -} - - -bool ComboBox::OnKeyUp( bool bDown ) -{ - if ( bDown ) - { - Base::List & children = m_Menu->GetChildren(); - Base::List::reverse_iterator it = std::find( children.rbegin(), children.rend(), m_SelectedItem ); - - if ( it != children.rend() && ( ++it != children.rend() ) ) - { - Base* pUpElement = *it; - OnItemSelected( pUpElement ); - } - } - - return true; -} -bool ComboBox::OnKeyDown( bool bDown ) -{ - if ( bDown ) - { - Base::List & children = m_Menu->GetChildren(); - Base::List::iterator it = std::find( children.begin(), children.end(), m_SelectedItem ); - - if ( it != children.end() && ( ++it != children.end() ) ) - { - Base* pDownElement = *it; - OnItemSelected( pDownElement ); - } - } - - return true; -} - -void ComboBox::RenderFocus( Gwen::Skin::Base* /*skin*/ ) -{ -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ComboBox.h b/OpenSauce/shared/Include/GWEN/Controls/ComboBox.h deleted file mode 100644 index 06e1a4082..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ComboBox.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_COMBOBOX_H -#define GWEN_CONTROLS_COMBOBOX_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Controls/Menu.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT ComboBox : public Button - { - public: - - GWEN_CONTROL( ComboBox, Button ); - - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - virtual void UpdateColours(); - - virtual void SelectItem( MenuItem* pItem, bool bFireChangeEvents = true ); - virtual void SelectItemByName( const Gwen::String & name, bool bFireChangeEvents = true ); - virtual Gwen::Controls::Label* GetSelectedItem(); - - virtual void OnPress(); - virtual void OnItemSelected( Controls::Base* pControl ); - virtual void OpenList(); - virtual void CloseList(); - - virtual void ClearItems(); - - virtual MenuItem* AddItem( const UnicodeString & strLabel, const String & strName = "" ); - virtual bool OnKeyUp( bool bDown ); - virtual bool OnKeyDown( bool bDown ); - - virtual void RenderFocus( Gwen::Skin::Base* skin ); - virtual void OnLostKeyboardFocus(); - virtual void OnKeyboardFocus(); - - virtual bool IsMenuOpen(); - - virtual bool IsMenuComponent() { return true; } - - Gwen::Event::Caller onSelection; - - protected: - - Menu* m_Menu; - MenuItem* m_SelectedItem; - - Controls::Base* m_Button; - - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.cpp b/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.cpp deleted file mode 100644 index 11f7d9ffa..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/CrossSplitter.h" -#include "Gwen/Controls/Button.h" - -using namespace Gwen; -using namespace Controls; - -GWEN_CONTROL_CONSTRUCTOR( CrossSplitter ) -{ - m_VSplitter = new SplitterBar( this ); - m_VSplitter->SetPos( 0, 128 ); - m_VSplitter->onDragged.Add( this, &CrossSplitter::OnVerticalMoved ); - m_VSplitter->SetCursor( Gwen::CursorType::SizeNS ); - m_HSplitter = new SplitterBar( this ); - m_HSplitter->SetPos( 128, 0 ); - m_HSplitter->onDragged.Add( this, &CrossSplitter::OnHorizontalMoved ); - m_HSplitter->SetCursor( Gwen::CursorType::SizeWE ); - m_CSplitter = new SplitterBar( this ); - m_CSplitter->SetPos( 128, 128 ); - m_CSplitter->onDragged.Add( this, &CrossSplitter::OnCenterMoved ); - m_CSplitter->SetCursor( Gwen::CursorType::SizeAll ); - m_fHVal = 0.5f; - m_fVVal = 0.5f; - SetPanel( 0, NULL ); - SetPanel( 1, NULL ); - SetPanel( 2, NULL ); - SetPanel( 3, NULL ); - SetSplitterSize( 5 ); - m_iZoomedSection = -1; -} - -void CrossSplitter::UpdateVSplitter() -{ - m_VSplitter->MoveTo( m_VSplitter->X(), ( Height() - m_VSplitter->Height() ) * ( m_fVVal ) ); -} -void CrossSplitter::UpdateHSplitter() -{ - m_HSplitter->MoveTo( ( Width() - m_HSplitter->Width() ) * ( m_fHVal ), m_HSplitter->Y() ); -} - -void CrossSplitter::OnCenterMoved( Controls::Base* /*control*/ ) -{ - //Move the other two bars into position - CalculateValueCenter(); - Invalidate(); -} - -void CrossSplitter::UpdateCSplitter() -{ - m_CSplitter->MoveTo( ( Width() - m_CSplitter->Width() ) * ( m_fHVal ), ( Height() - m_CSplitter->Height() ) * ( m_fVVal ) ); -} - -void CrossSplitter::OnHorizontalMoved( Controls::Base* /*control*/ ) -{ - m_fHVal = CalculateValueHorizontal(); - Invalidate(); -} -void CrossSplitter::OnVerticalMoved( Controls::Base* /*control*/ ) -{ - m_fVVal = CalculateValueVertical(); - Invalidate(); -} - -void CrossSplitter::CalculateValueCenter() -{ - m_fHVal = ( float ) m_CSplitter->X() / ( float )( Width() - m_CSplitter->Width() ); - m_fVVal = ( float ) m_CSplitter->Y() / ( float )( Height() - m_CSplitter->Height() ); -} - -float CrossSplitter::CalculateValueHorizontal() -{ - return ( float ) m_HSplitter->X() / ( float )( Width() - m_HSplitter->Width() ); -} - -float CrossSplitter::CalculateValueVertical() -{ - return ( float ) m_VSplitter->Y() / ( float )( Height() - m_VSplitter->Height() ); -} - -void CrossSplitter::Layout( Skin::Base* /*skin*/ ) -{ - m_VSplitter->SetSize( Width(), m_fBarSize ); - m_HSplitter->SetSize( m_fBarSize, Height() ); - m_CSplitter->SetSize( m_fBarSize, m_fBarSize ); - UpdateVSplitter(); - UpdateHSplitter(); - UpdateCSplitter(); - - if ( m_iZoomedSection == (char)-1 ) - { - if ( m_Sections[0] ) - { m_Sections[0]->SetBounds( 0, 0, m_HSplitter->X(), m_VSplitter->Y() ); } - - if ( m_Sections[1] ) - { m_Sections[1]->SetBounds( m_HSplitter->X() + m_fBarSize, 0, Width() - ( m_HSplitter->X() + m_fBarSize ), m_VSplitter->Y() ); } - - if ( m_Sections[2] ) - { m_Sections[2]->SetBounds( 0, m_VSplitter->Y() + m_fBarSize, m_HSplitter->X(), Height() - ( m_VSplitter->Y() + m_fBarSize ) ); } - - if ( m_Sections[3] ) - { m_Sections[3]->SetBounds( m_HSplitter->X() + m_fBarSize, m_VSplitter->Y() + m_fBarSize, Width() - ( m_HSplitter->X() + m_fBarSize ), Height() - ( m_VSplitter->Y() + m_fBarSize ) ); } - } - else - { - //This should probably use Fill docking instead - m_Sections[m_iZoomedSection]->SetBounds( 0, 0, Width(), Height() ); - } -} - -void CrossSplitter::SetPanel( int index, Controls::Base* pPanel ) -{ - Debug::AssertCheck( index >= 0 && index <= 3, "CrossSplitter::SetPanel out of range" ); - m_Sections[index] = pPanel; - - if ( pPanel ) - { - pPanel->Dock( Pos::None ); - pPanel->SetParent( this ); - } - - Invalidate(); -} - -Controls::Base* CrossSplitter::GetPanel( int i ) -{ - return m_Sections[i]; -} - - -void CrossSplitter::ZoomChanged() -{ - onZoomChange.Call( this ); - - if ( m_iZoomedSection == -1 ) - { - onUnZoomed.Call( this ); - } - else - { - onZoomed.Call( this ); - } -} - -void CrossSplitter::Zoom( int section ) -{ - UnZoom(); - - if ( m_Sections[section] ) - { - for ( int i = 0; i < 4; i++ ) - { - if ( i != section && m_Sections[i] ) - { m_Sections[i]->SetHidden( true ); } - } - - m_iZoomedSection = section; - Invalidate(); - } - - ZoomChanged(); -} - -void CrossSplitter::UnZoom() -{ - m_iZoomedSection = -1; - - for ( int i = 0; i < 4; i++ ) - { - if ( m_Sections[i] ) - { m_Sections[i]->SetHidden( false ); } - } - - Invalidate(); - ZoomChanged(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.h b/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.h deleted file mode 100644 index c2bc8c2fa..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/CrossSplitter.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_CROSSSPLITTER_H -#define GWEN_CONTROLS_CROSSSPLITTER_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/SplitterBar.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT CrossSplitter : public Controls::Base - { - public: - - GWEN_CONTROL( CrossSplitter, Controls::Base ); - - void Layout( Skin::Base* skin ); - - virtual float CalculateValueVertical(); - virtual float CalculateValueHorizontal(); - virtual void CalculateValueCenter(); - virtual void UpdateHSplitter(); - virtual void UpdateVSplitter(); - virtual void UpdateCSplitter(); - virtual void OnVerticalMoved( Controls::Base* control ); - virtual void OnHorizontalMoved( Controls::Base* control ); - virtual void OnCenterMoved( Controls::Base* control ); - - virtual void SetPanel( int i, Controls::Base* pPanel ); - virtual Controls::Base* GetPanel( int i ); - - virtual bool IsZoomed() { return m_iZoomedSection != -1; } - virtual void Zoom( int section ); - virtual void UnZoom(); - virtual void ZoomChanged(); - virtual void CenterPanels() { m_fHVal = 0.5f; m_fVVal = 0.5f; Invalidate(); } - - virtual void SetSplitterSize( int size ) { m_fBarSize = size; } - - private: - - SplitterBar* m_VSplitter; - SplitterBar* m_HSplitter; - SplitterBar* m_CSplitter; - - Controls::Base* m_Sections[4]; - - float m_fHVal; - float m_fVVal; - int m_fBarSize; - - char m_iZoomedSection; - - Gwen::Event::Caller onZoomed; - Gwen::Event::Caller onUnZoomed; - Gwen::Event::Caller onZoomChange; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/DockBase.cpp b/OpenSauce/shared/Include/GWEN/Controls/DockBase.cpp deleted file mode 100644 index e674ab833..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/DockBase.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/DockBase.h" -#include "Gwen/Controls/DockedTabControl.h" -#include "Gwen/Controls/Highlight.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Controls/Resizer.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( DockBase ) -{ - SetPadding( Padding( 1, 1, 1, 1 ) ); - SetSize( 200, 200 ); - m_DockedTabControl = NULL; - m_Left = NULL; - m_Right = NULL; - m_Top = NULL; - m_Bottom = NULL; - m_bDrawHover = false; -} - -TabControl* DockBase::GetTabControl() -{ - return m_DockedTabControl; -} - -void DockBase::SetupChildDock( int iPos ) -{ - if ( !m_DockedTabControl ) - { - m_DockedTabControl = new DockedTabControl( this ); - m_DockedTabControl->onLoseTab.Add( this, &DockBase::OnTabRemoved ); - m_DockedTabControl->SetTabStripPosition( Pos::Bottom ); - m_DockedTabControl->SetShowTitlebar( true ); - } - - Dock( iPos ); - int iSizeDirection = Pos::Left; - - if ( iPos == Pos::Left ) { iSizeDirection = Pos::Right; } - - if ( iPos == Pos::Top ) { iSizeDirection = Pos::Bottom; } - - if ( iPos == Pos::Bottom ) { iSizeDirection = Pos::Top; } - - ControlsInternal::Resizer* sizer = new ControlsInternal::Resizer( this ); - sizer->Dock( iSizeDirection ); - sizer->SetResizeDir( iSizeDirection ); - sizer->SetSize( 2, 2 ); - sizer->SetTarget( this ); -} - -void DockBase::Render( Skin::Base* /*skin*/ ) -{ - //Gwen::Render->SetDrawColor( Colors::Black ); - //Gwen::Render->DrawLinedRect( GetRenderBounds() ); -} - -DockBase** DockBase::GetChildDockPtr( int iPos ) -{ - if ( iPos == Pos::Left ) { return &m_Left; } - - if ( iPos == Pos::Right ) { return &m_Right; } - - if ( iPos == Pos::Top ) { return &m_Top; } - - if ( iPos == Pos::Bottom ) { return &m_Bottom; } - - return NULL; -} - -DockBase* DockBase::GetChildDock( int iPos ) -{ - DockBase** pDock = GetChildDockPtr( iPos ); - - if ( !( *pDock ) ) - { - ( *pDock ) = new DockBase( this ); - ( *pDock )->SetupChildDock( iPos ); - } - else - { - ( *pDock )->SetHidden( false ); - } - - return *pDock; -} - -int DockBase::GetDroppedTabDirection( int x, int y ) -{ - int w = Width(); - int h = Height(); - float top = ( float ) y / ( float ) h; - float left = ( float ) x / ( float ) w; - float right = ( float )( w - x ) / ( float ) w; - float bottom = ( float )( h - y ) / ( float ) h; - float minimum = Gwen::Min( Gwen::Min( Gwen::Min( top, left ), right ), bottom ); - m_bDropFar = ( minimum < 0.2f ); - - if ( minimum > 0.3 ) { return Pos::Fill; } - - if ( top == minimum && ( !m_Top || m_Top->Hidden() ) ) { return Pos::Top; } - - if ( left == minimum && ( !m_Left || m_Left->Hidden() ) ) { return Pos::Left; } - - if ( right == minimum && ( !m_Right || m_Right->Hidden() ) ) { return Pos::Right; } - - if ( bottom == minimum && ( !m_Bottom || m_Bottom->Hidden() ) ) { return Pos::Bottom; } - - return Pos::Fill; -} - -bool DockBase::DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* pPackage ) -{ - // A TAB button dropped - if ( pPackage->name == "TabButtonMove" ) - { return true; } - - // a TAB window dropped - if ( pPackage->name == "TabWindowMove" ) - { return true; } - - return false; -} - -bool DockBase::DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* pPackage, int x, int y ) -{ - Gwen::Point pPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - int dir = GetDroppedTabDirection( pPos.x, pPos.y ); - DockedTabControl* pAddTo = m_DockedTabControl; - - if ( dir == Pos::Fill && pAddTo == NULL ) { return false; } - - if ( dir != Pos::Fill ) - { - DockBase* pDock = GetChildDock( dir ); - pAddTo = pDock->m_DockedTabControl; - - if ( !m_bDropFar ) { pDock->BringToFront(); } - else { pDock->SendToBack(); } - } - - if ( pPackage->name == "TabButtonMove" ) - { - TabButton* pTabButton = gwen_cast ( DragAndDrop::SourceControl ); - - if ( !pTabButton ) { return false; } - - pAddTo->AddPage( pTabButton ); - } - - if ( pPackage->name == "TabWindowMove" ) - { - DockedTabControl* pTabControl = gwen_cast ( DragAndDrop::SourceControl ); - - if ( !pTabControl ) { return false; } - - if ( pTabControl == pAddTo ) { return false; } - - pTabControl->MoveTabsTo( pAddTo ); - } - - Invalidate(); - return true; -} - -bool DockBase::IsEmpty() -{ - if ( m_DockedTabControl && m_DockedTabControl->TabCount() > 0 ) { return false; } - - if ( m_Left && !m_Left->IsEmpty() ) { return false; } - - if ( m_Right && !m_Right->IsEmpty() ) { return false; } - - if ( m_Top && !m_Top->IsEmpty() ) { return false; } - - if ( m_Bottom && !m_Bottom->IsEmpty() ) { return false; } - - return true; -} - -void DockBase::OnTabRemoved( Gwen::Controls::Base* /*pControl*/ ) -{ - DoRedundancyCheck(); - DoConsolidateCheck(); -} - -void DockBase::DoRedundancyCheck() -{ - if ( !IsEmpty() ) { return; } - - DockBase* pDockParent = gwen_cast ( GetParent() ); - - if ( !pDockParent ) { return; } - - pDockParent->OnRedundantChildDock( this ); -} - -void DockBase::DoConsolidateCheck() -{ - if ( IsEmpty() ) { return; } - - if ( !m_DockedTabControl ) { return; } - - if ( m_DockedTabControl->TabCount() > 0 ) { return; } - - if ( m_Bottom && !m_Bottom->IsEmpty() ) - { - m_Bottom->m_DockedTabControl->MoveTabsTo( m_DockedTabControl ); - return; - } - - if ( m_Top && !m_Top->IsEmpty() ) - { - m_Top->m_DockedTabControl->MoveTabsTo( m_DockedTabControl ); - return; - } - - if ( m_Left && !m_Left->IsEmpty() ) - { - m_Left->m_DockedTabControl->MoveTabsTo( m_DockedTabControl ); - return; - } - - if ( m_Right && !m_Right->IsEmpty() ) - { - m_Right->m_DockedTabControl->MoveTabsTo( m_DockedTabControl ); - return; - } -} - -void DockBase::OnRedundantChildDock( DockBase* pDockBase ) -{ - pDockBase->SetHidden( true ); - DoRedundancyCheck(); - DoConsolidateCheck(); -} - -void DockBase::DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) -{ - m_bDrawHover = true; -} - -void DockBase::DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* /*pPackage*/ ) -{ - m_bDrawHover = false; -} - -void DockBase::DragAndDrop_Hover( Gwen::DragAndDrop::Package* /*pPackage*/, int x, int y ) -{ - Gwen::Point pPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - int dir = GetDroppedTabDirection( pPos.x, pPos.y ); - - if ( dir == Pos::Fill ) - { - if ( !m_DockedTabControl ) - { - m_HoverRect = Gwen::Rect( 0, 0, 0, 0 ); - return; - } - - m_HoverRect = GetInnerBounds(); - return; - } - - m_HoverRect = GetRenderBounds(); - int HelpBarWidth = 0; - - if ( dir == Pos::Left ) - { - HelpBarWidth = m_HoverRect.w * 0.25f; - m_HoverRect.w = HelpBarWidth; - } - - if ( dir == Pos::Right ) - { - HelpBarWidth = m_HoverRect.w * 0.25f; - m_HoverRect.x = m_HoverRect.w - HelpBarWidth; - m_HoverRect.w = HelpBarWidth; - } - - if ( dir == Pos::Top ) - { - HelpBarWidth = m_HoverRect.h * 0.25f; - m_HoverRect.h = HelpBarWidth; - } - - if ( dir == Pos::Bottom ) - { - HelpBarWidth = m_HoverRect.h * 0.25f; - m_HoverRect.y = m_HoverRect.h - HelpBarWidth; - m_HoverRect.h = HelpBarWidth; - } - - if ( ( dir == Pos::Top || dir == Pos::Bottom ) && !m_bDropFar ) - { - if ( m_Left && m_Left->Visible() ) - { - m_HoverRect.x += m_Left->Width(); - m_HoverRect.w -= m_Left->Width(); - } - - if ( m_Right && m_Right->Visible() ) - { - m_HoverRect.w -= m_Right->Width(); - } - } - - if ( ( dir == Pos::Left || dir == Pos::Right ) && !m_bDropFar ) - { - if ( m_Top && m_Top->Visible() ) - { - m_HoverRect.y += m_Top->Height(); - m_HoverRect.h -= m_Top->Height(); - } - - if ( m_Bottom && m_Bottom->Visible() ) - { - m_HoverRect.h -= m_Bottom->Height(); - } - } -} - -void DockBase::RenderOver( Skin::Base* skin ) -{ - if ( !m_bDrawHover ) { return; } - - Gwen::Renderer::Base* render = skin->GetRender(); - render->SetDrawColor( Gwen::Color( 255, 100, 255, 20 ) ); - render->DrawFilledRect( GetRenderBounds() ); - - if ( m_HoverRect.w == 0 ) { return; } - - render->SetDrawColor( Gwen::Color( 255, 100, 255, 100 ) ); - render->DrawFilledRect( m_HoverRect ); - render->SetDrawColor( Gwen::Color( 255, 100, 255, 200 ) ); - render->DrawLinedRect( m_HoverRect ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/DockBase.h b/OpenSauce/shared/Include/GWEN/Controls/DockBase.h deleted file mode 100644 index 248b92da7..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/DockBase.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_DOCKBASE_H -#define GWEN_CONTROLS_DOCKBASE_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" - -namespace Gwen -{ - namespace Controls - { - class DockedTabControl; - class TabControl; - - class GWEN_EXPORT DockBase : public Base - { - public: - - GWEN_CONTROL( DockBase, Base ); - - virtual void Render( Skin::Base* skin ); - virtual void RenderOver( Skin::Base* skin ); - virtual bool IsEmpty(); - - virtual TabControl* GetTabControl(); - - virtual DockBase* GetRight() { return GetChildDock( Pos::Right ); } - virtual DockBase* GetLeft() { return GetChildDock( Pos::Left ); } - virtual DockBase* GetTop() { return GetChildDock( Pos::Top ); } - virtual DockBase* GetBottom() { return GetChildDock( Pos::Bottom ); } - - // No action on space (default button action is to press) - virtual bool OnKeySpace( bool /*bDown*/ ) { return false; } - - private: - - // Drag n Drop - virtual bool DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual bool DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* pPackage ); - virtual void DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual void DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* pPackage ); - virtual void DragAndDrop_Hover( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - - virtual void SetupChildDock( int iPos ); - - virtual void DoRedundancyCheck(); - virtual void DoConsolidateCheck(); - virtual void OnRedundantChildDock( DockBase* pDockBase ); - - virtual int GetDroppedTabDirection( int x, int y ); - virtual void OnTabRemoved( Gwen::Controls::Base* pControl ); - - DockBase* GetChildDock( int iPos ); - DockBase** GetChildDockPtr( int iPos ); - - DockBase* m_Left; - DockBase* m_Right; - DockBase* m_Top; - DockBase* m_Bottom; - - // Only CHILD dockpanels have a tabcontrol. - DockedTabControl* m_DockedTabControl; - - bool m_bDrawHover; - bool m_bDropFar; - Gwen::Rect m_HoverRect; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.cpp deleted file mode 100644 index b66e017ed..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/DockedTabControl.h" -#include "Gwen/Controls/Highlight.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Controls/WindowControl.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( DockedTabControl ) -{ - m_WindowControl = NULL; - Dock( Pos::Fill ); - m_pTitleBar = new TabTitleBar( this ); - m_pTitleBar->Dock( Pos::Top ); - m_pTitleBar->SetHidden( true ); - SetAllowReorder( true ); -} - -void DockedTabControl::Layout( Skin::Base* skin ) -{ - GetTabStrip()->SetHidden( TabCount() <= 1 ); - UpdateTitleBar(); - BaseClass::Layout( skin ); -} - -void DockedTabControl::UpdateTitleBar() -{ - if ( !GetCurrentButton() ) { return; } - - m_pTitleBar->UpdateFromTab( GetCurrentButton() ); -} - -void DockedTabControl::DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* pPackage, int x, int y ) -{ - BaseClass::DragAndDrop_StartDragging( pPackage, x, y ); - SetHidden( true ); - // This hiding our parent thing is kind of lousy. - GetParent()->SetHidden( true ); -} - -void DockedTabControl::DragAndDrop_EndDragging( bool bSuccess, int /*x*/, int /*y*/ ) -{ - SetHidden( false ); - - if ( !bSuccess ) - { - GetParent()->SetHidden( false ); - } - - /* - if ( !bSuccess ) - { - // Create our window control - if ( !m_WindowControl ) - { - m_WindowControl = new WindowControl( GetCanvas() ); - m_WindowControl->SetBounds( x, y, Width(), Height() ); - } - - m_WindowControl->SetPosition( x, y ); - SetParent( m_WindowControl ); - SetPosition( 0, 0 ); - Dock( Pos::Fill ); - } - */ -} - -void DockedTabControl::MoveTabsTo( DockedTabControl* pTarget ) -{ - Base::List Children = GetTabStrip()->Children; - - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - TabButton* pButton = gwen_cast ( *iter ); - - if ( !pButton ) { continue; } - - pTarget->AddPage( pButton ); - } - - Invalidate(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.h b/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.h deleted file mode 100644 index 10fd139a8..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/DockedTabControl.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_DOCKEDTABCONTROL_H -#define GWEN_CONTROLS_DOCKEDTABCONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/TabControl.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT DockedTabControl : public TabControl - { - public: - - GWEN_CONTROL( DockedTabControl, TabControl ); - - void SetShowTitlebar( bool bShow ) { m_pTitleBar->SetHidden( !bShow ); } - - void Layout( Skin::Base* skin ); - void UpdateTitleBar(); - - virtual void DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual void DragAndDrop_EndDragging( bool bSuccess, int x, int y ); - - void MoveTabsTo( DockedTabControl* pTarget ); - - private: - - TabTitleBar* m_pTitleBar; - Base* m_WindowControl; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Dragger.cpp b/OpenSauce/shared/Include/GWEN/Controls/Dragger.cpp deleted file mode 100644 index 4ae36e671..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Dragger.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Dragger.h" - -using namespace Gwen; -using namespace Gwen::ControlsInternal; - - - -GWEN_CONTROL_CONSTRUCTOR( Dragger ) -{ - m_pTarget = NULL; - SetMouseInputEnabled( true ); - m_bDepressed = false; - m_bDoMove = true; -} - -void Dragger::OnMouseClickLeft( int x, int y, bool bDown ) -{ - if ( bDown ) - { - m_bDepressed = true; - - if ( m_pTarget ) - { m_HoldPos = m_pTarget->CanvasPosToLocal( Gwen::Point( x, y ) ); } - - Gwen::MouseFocus = this; - onDragStart.Call( this ); - } - else - { - m_bDepressed = false; - Gwen::MouseFocus = NULL; - } -} - -void Dragger::OnMouseMoved( int x, int y, int deltaX, int deltaY ) -{ - if ( !m_bDepressed ) { return; } - - if ( m_bDoMove && m_pTarget ) - { - Gwen::Point p = Gwen::Point( x - m_HoldPos.x, y - m_HoldPos.y ); - - // Translate to parent - if ( m_pTarget->GetParent() ) - { p = m_pTarget->GetParent()->CanvasPosToLocal( p ); } - - m_pTarget->MoveTo( p.x, p.y ); - } - - Gwen::Event::Information info; - info.Point = Gwen::Point( deltaX, deltaY ); - onDragged.Call( this, info ); -} - -void Dragger::Render( Skin::Base* skin ) -{ - //skin->DrawButton(this,false,false, false); -} - -void Dragger::OnMouseDoubleClickLeft( int x, int y ) -{ - onDoubleClickLeft.Call( this ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Dragger.h b/OpenSauce/shared/Include/GWEN/Controls/Dragger.h deleted file mode 100644 index ef07f7ac6..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Dragger.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_DRAGGER_H -#define GWEN_CONTROLS_DRAGGER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT Dragger : public Controls::Base - { - public: - - GWEN_CONTROL( Dragger, Controls::Base ); - - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - virtual void Render( Skin::Base* skin ); - - virtual void SetTarget( Controls::Base* pBase ) { m_pTarget = pBase; } - virtual bool IsDepressed() { return m_bDepressed; } - - virtual void SetDoMove( bool b ) { m_bDoMove = b; } - - virtual void OnMouseDoubleClickLeft( int x, int y ); - - Gwen::Event::Caller onDragged; - Gwen::Event::Caller onDragStart; - - Gwen::Event::Caller onDoubleClickLeft; - - protected: - - bool m_bDepressed; - Gwen::Point m_HoldPos; - Controls::Base* m_pTarget; - bool m_bDoMove; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/FieldLabel.h b/OpenSauce/shared/Include/GWEN/Controls/FieldLabel.h deleted file mode 100644 index 70614819e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/FieldLabel.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_FIELDLABEL_H -#define GWEN_CONTROLS_FIELDLABEL_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Label.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT FieldLabel : public Controls::Label - { - public: - - static inline FieldLabel* Setup( Controls::Base* pControl, const Gwen::TextObject & text ) - { - FieldLabel* plbl = new FieldLabel( pControl->GetParent() ); - plbl->SetText( text ); - plbl->SetSize( pControl->Width(), pControl->Height() ); - plbl->Dock( pControl->GetDock() ); - plbl->SetField( pControl ); - return plbl; - } - - public: - - GWEN_CONTROL_INLINE( FieldLabel, Controls::Label ) - { - m_pField = NULL; - SetMargin( Margin( 0, 1, 0, 1 ) ); - SetAlignment( Pos::CenterV | Pos::Left ); - } - - void SetField( Controls::Base* pField ) - { - pField->SetParent( this ); - pField->Dock( Pos::Right ); - m_pField = pField; - } - - void Layout( Gwen::Skin::Base* pskin ) - { - m_pField->SetWidth( Width() - 70 ); - BaseClass::Layout( pskin ); - } - - protected: - - Controls::Base* m_pField; - - }; - } -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/GroupBox.cpp b/OpenSauce/shared/Include/GWEN/Controls/GroupBox.cpp deleted file mode 100644 index 486a96893..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/GroupBox.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/GroupBox.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( GroupBox ) -{ - // Set to true, because it's likely that our - // children will want mouse input, and they - // can't get it without us.. - SetMouseInputEnabled( true ); - SetTextPadding( Padding( 10, 0, 0, 0 ) ); - SetAlignment( Pos::Top | Pos::Left ); - Invalidate(); - m_InnerPanel = new Base( this ); - m_InnerPanel->Dock( Pos::Fill ); - m_InnerMargin = 6; -} - -void GroupBox::Layout( Skin::Base* skin ) -{ - m_InnerPanel->SetMargin( Margin( m_InnerMargin, (TextHeight()/2) + m_InnerMargin, m_InnerMargin, m_InnerMargin )); - BaseClass::Layout( skin ); -} - - -void GroupBox::Render( Skin::Base* skin ) -{ - skin->DrawGroupBox( this, TextX(), TextHeight(), TextWidth() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/GroupBox.h b/OpenSauce/shared/Include/GWEN/Controls/GroupBox.h deleted file mode 100644 index 5204467ae..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/GroupBox.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_GROUPBOX_H -#define GWEN_CONTROLS_GROUPBOX_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT GroupBox : public Label - { - public: - - GWEN_CONTROL( GroupBox, Label ); - - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - - virtual void SetInnerMargin( int i ) { m_InnerMargin = i; } - - protected: - - int m_InnerMargin; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.cpp b/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.cpp deleted file mode 100644 index e47c96f2f..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/HSVColorPicker.h" -#include "Gwen/Controls/ColorControls.h" -#include "Gwen/Controls/ColorPicker.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( HSVColorPicker ) -{ - SetMouseInputEnabled( true ); - SetSize( 256, 64 ); - SetCacheToTexture(); - m_LerpBox = new Gwen::Controls::ColorLerpBox( this ); - m_LerpBox->onSelectionChanged.Add( this, &HSVColorPicker::ColorBoxChanged ); - m_LerpBox->Dock( Pos::Left ); - m_ColorSlider = new Gwen::Controls::ColorSlider( this ); - m_ColorSlider->SetPos( m_LerpBox->Width() + 15, 5 ); - m_ColorSlider->onSelectionChanged.Add( this, &HSVColorPicker::ColorSliderChanged ); - m_ColorSlider->Dock( Pos::Left ); - m_After = new Gwen::ControlsInternal::ColorDisplay( this ); - m_After->SetSize( 48, 24 ); - m_After->SetPos( m_ColorSlider->X() + m_ColorSlider->Width() + 15, 5 ); - m_Before = new Gwen::ControlsInternal::ColorDisplay( this ); - m_Before->SetSize( 48, 24 ); - m_Before->SetPos( m_After->X(), 28 ); - int x = m_Before->X(); - int y = m_Before->Y() + 30; - { - Label* label = new Label( this ); - label->SetText( L"R:" ); - label->SizeToContents(); - label->SetPos( x, y ); - TextBoxNumeric* numeric = new TextBoxNumeric( this ); - numeric->SetName( "RedBox" ); - numeric->SetPos( x + 15, y - 1 ); - numeric->SetSize( 26, 16 ); - numeric->SetSelectAllOnFocus( true ); - numeric->onTextChanged.Add( this, &HSVColorPicker::NumericTyped ); - } - y += 20; - { - Label* label = new Label( this ); - label->SetText( L"G:" ); - label->SizeToContents(); - label->SetPos( x, y ); - TextBoxNumeric* numeric = new TextBoxNumeric( this ); - numeric->SetName( "GreenBox" ); - numeric->SetPos( x + 15, y - 1 ); - numeric->SetSize( 26, 16 ); - numeric->SetSelectAllOnFocus( true ); - numeric->onTextChanged.Add( this, &HSVColorPicker::NumericTyped ); - } - y += 20; - { - Label* label = new Label( this ); - label->SetText( L"B:" ); - label->SizeToContents(); - label->SetPos( x, y ); - TextBoxNumeric* numeric = new TextBoxNumeric( this ); - numeric->SetName( "BlueBox" ); - numeric->SetPos( x + 15, y - 1 ); - numeric->SetSize( 26, 16 ); - numeric->SetSelectAllOnFocus( true ); - numeric->onTextChanged.Add( this, &HSVColorPicker::NumericTyped ); - } -} - -void HSVColorPicker::NumericTyped( Gwen::Controls::Base* control ) -{ - TextBoxNumeric* box = gwen_cast ( control ); - - if ( !box ) { return; } - - if ( box->GetText() == L"" ) { return; } - - int textValue = atoi( box->GetText().c_str() ); - - if ( textValue < 0 ) { textValue = 0; } - - if ( textValue > 255 ) { textValue = 255; } - - Gwen::Color newColor = GetColor(); - - if ( box->GetName().find( "Red" ) != Gwen::String::npos ) - { - newColor.r = textValue; - } - else if ( box->GetName().find( "Green" ) != Gwen::String::npos ) - { - newColor.g = textValue; - } - else if ( box->GetName().find( "Blue" ) != Gwen::String::npos ) - { - newColor.b = textValue; - } - else if ( box->GetName().find( "Alpha" ) != Gwen::String::npos ) - { - newColor.a = textValue; - } - - SetColor( newColor ); -} - -void HSVColorPicker::UpdateControls( Gwen::Color color ) -{ - // What in the FUCK - TextBoxNumeric* redBox = gwen_cast ( FindChildByName( "RedBox", false ) ); - - if ( redBox ) { redBox->SetText( Gwen::Utility::ToString( ( int ) color.r ), false ); } - - TextBoxNumeric* greenBox = gwen_cast ( FindChildByName( "GreenBox", false ) ); - - if ( greenBox ) { greenBox->SetText( Gwen::Utility::ToString( ( int ) color.g ), false ); } - - TextBoxNumeric* blueBox = gwen_cast ( FindChildByName( "BlueBox", false ) ); - - if ( blueBox ) { blueBox->SetText( Gwen::Utility::ToString( ( int ) color.b ), false ); } - - m_After->SetColor( color ); -} -void HSVColorPicker::SetColor( Gwen::Color color, bool onlyHue, bool reset ) -{ - UpdateControls( color ); - - if ( reset ) - { m_Before->SetColor( color ); } - - m_ColorSlider->SetColor( color ); - m_LerpBox->SetColor( color, onlyHue ); - m_After->SetColor( color ); -} - -Gwen::Color HSVColorPicker::GetColor() -{ - return m_LerpBox->GetSelectedColor(); -} - -void HSVColorPicker::ColorBoxChanged( Gwen::Controls::Base* /*pControl*/ ) -{ - onColorChanged.Call( this ); - UpdateControls( GetColor() ); - Invalidate(); -} -void HSVColorPicker::ColorSliderChanged( Gwen::Controls::Base* /*pControl*/ ) -{ - if ( m_LerpBox ) - { m_LerpBox->SetColor( m_ColorSlider->GetSelectedColor(), true ); } - - Invalidate(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.h b/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.h deleted file mode 100644 index 9c649c169..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HSVColorPicker.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_HSVCOLORPICKER_H -#define GWEN_CONTROLS_HSVCOLORPICKER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/ColorControls.h" -#include "Gwen/Controls/ColorPicker.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT HSVColorPicker : public Controls::Base - { - public: - GWEN_CONTROL( HSVColorPicker, Controls::Base ); - - Gwen::Color GetColor(); - Gwen::Color GetDefaultColor() { return m_Before->GetColor(); } - void SetColor( Gwen::Color color, bool onlyHue = false, bool reset = false ); - - void ColorBoxChanged( Gwen::Controls::Base* pControl ); - void ColorSliderChanged( Gwen::Controls::Base* pControl ); - void NumericTyped( Gwen::Controls::Base* control ); - - void UpdateControls( Gwen::Color newColor ); - - Event::Caller onColorChanged; - - protected: - ColorLerpBox* m_LerpBox; - ColorSlider* m_ColorSlider; - ControlsInternal::ColorDisplay* m_Before; - ControlsInternal::ColorDisplay* m_After; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Highlight.h b/OpenSauce/shared/Include/GWEN/Controls/Highlight.h deleted file mode 100644 index e31811160..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Highlight.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_HIGHLIGHT_H -#define GWEN_CONTROLS_HIGHLIGHT_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT Highlight : public Controls::Base - { - public: - - GWEN_CONTROL_INLINE( Highlight, Controls::Base ) - { - } - - void Render( Skin::Base* skin ) - { - skin->DrawHighlight( this ); - } - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.cpp deleted file mode 100644 index 6eb35ca11..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/HorizontalScrollBar.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( HorizontalScrollBar ) -{ - m_Bar->SetHorizontal(); - m_ScrollButton[SCROLL_BUTTON_LEFT]->SetDirectionLeft(); - m_ScrollButton[SCROLL_BUTTON_LEFT]->onPress.Add( this, &HorizontalScrollBar::NudgeLeft ); - m_ScrollButton[SCROLL_BUTTON_RIGHT]->SetDirectionRight(); - m_ScrollButton[SCROLL_BUTTON_RIGHT]->onPress.Add( this, &HorizontalScrollBar::NudgeRight ); - m_Bar->onDragged.Add( this, &HorizontalScrollBar::OnBarMoved ); -} - -void HorizontalScrollBar::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - m_ScrollButton[SCROLL_BUTTON_LEFT]->SetWidth( Height() ); - m_ScrollButton[SCROLL_BUTTON_LEFT]->Dock( Pos::Left ); - m_ScrollButton[SCROLL_BUTTON_RIGHT]->SetWidth( Height() ); - m_ScrollButton[SCROLL_BUTTON_RIGHT]->Dock( Pos::Right ); - m_Bar->SetHeight( GetButtonSize() ); - m_Bar->SetPadding( Padding( GetButtonSize(), 0, GetButtonSize(), 0 ) ); - float barWidth = ( m_fViewableContentSize / m_fContentSize ) * ( Width() - GetButtonSize() ); - - if ( barWidth < GetButtonSize() * 0.5 ) - { barWidth = GetButtonSize() * 0.5; } - - m_Bar->SetWidth( barWidth ); - m_Bar->SetHidden( Width() - ( GetButtonSize() * 2 ) <= barWidth ); - - //Based on our last scroll amount, produce a position for the bar - if ( !m_Bar->IsDepressed() ) - { - SetScrolledAmount( GetScrolledAmount(), true ); - } -} - -void HorizontalScrollBar::NudgeLeft( Base* /*control*/ ) -{ - if ( !IsDisabled() ) - { SetScrolledAmount( GetScrolledAmount() - GetNudgeAmount(), true ); } -} - -void HorizontalScrollBar::NudgeRight( Base* /*control*/ ) -{ - if ( !IsDisabled() ) - { SetScrolledAmount( GetScrolledAmount() + GetNudgeAmount(), true ); } -} - -void HorizontalScrollBar::ScrollToLeft() -{ - SetScrolledAmount( 0, true ); -} -void HorizontalScrollBar::ScrollToRight() -{ - SetScrolledAmount( 1, true ); -} - -float HorizontalScrollBar::GetNudgeAmount() -{ - if ( m_bDepressed ) - { return m_fViewableContentSize / m_fContentSize; } - else - { return BaseClass::GetNudgeAmount(); } -} - - - -void HorizontalScrollBar::OnMouseClickLeft( int x, int y, bool bDown ) -{ - if ( bDown ) - { - m_bDepressed = true; - Gwen::MouseFocus = this; - } - else - { - Gwen::Point clickPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - - if ( clickPos.x < m_Bar->X() ) - { NudgeLeft( this ); } - else if ( clickPos.x > m_Bar->X() + m_Bar->Width() ) - { NudgeRight( this ); } - - m_bDepressed = false; - Gwen::MouseFocus = NULL; - } -} - -float HorizontalScrollBar::CalculateScrolledAmount() -{ - return ( float )( m_Bar->X() - GetButtonSize() ) / ( float )( Width() - m_Bar->Width() - ( GetButtonSize() * 2 ) ); -} - -bool HorizontalScrollBar::SetScrolledAmount( float amount, bool forceUpdate ) -{ - amount = Gwen::Clamp( amount, 0.f, 1.f ); - - if ( !BaseClass::SetScrolledAmount( amount, forceUpdate ) ) - { return false; } - - if ( forceUpdate ) - { - int newX = GetButtonSize() + ( amount * ( ( Width() - m_Bar->Width() ) - ( GetButtonSize() * 2 ) ) ); - m_Bar->MoveTo( newX, m_Bar->Y() ); - } - - return true; -} - -void HorizontalScrollBar::OnBarMoved( Controls::Base* control ) -{ - if ( m_Bar->IsDepressed() ) - { - SetScrolledAmount( CalculateScrolledAmount(), false ); - BaseClass::OnBarMoved( control ); - } - else - { InvalidateParent(); } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.h b/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.h deleted file mode 100644 index 83986b10d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HorizontalScrollBar.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_HORIZONTALSCROLLBAR_H -#define GWEN_CONTROLS_HORIZONTALSCROLLBAR_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Controls/ScrollBar.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT HorizontalScrollBar : public BaseScrollBar - { - public: - - GWEN_CONTROL( HorizontalScrollBar, BaseScrollBar ); - - virtual void Layout( Skin::Base* skin ); - - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - virtual void OnBarMoved( Controls::Base* control ); - - virtual int GetBarSize() { return m_Bar->Width(); } - virtual int GetBarPos() { return m_Bar->X() - Height(); } - virtual void SetBarSize( int size ) { m_Bar->SetWidth( size ); } - virtual int GetButtonSize() { return Height(); } - - virtual void ScrollToLeft(); - virtual void ScrollToRight(); - virtual void NudgeLeft( Base* control ); - virtual void NudgeRight( Base* control ); - virtual float GetNudgeAmount(); - - virtual float CalculateScrolledAmount(); - virtual bool SetScrolledAmount( float amount, bool forceUpdate ); - - virtual bool IsHorizontal() { return true; } - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.cpp b/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.cpp deleted file mode 100644 index 741d0395e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Slider.h" -#include "Gwen/Controls/HorizontalSlider.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( HorizontalSlider ) -{ - m_SliderBar->SetHorizontal( true ); -} - -float HorizontalSlider::CalculateValue() -{ - return ( float ) m_SliderBar->X() / ( float )( Width() - m_SliderBar->Width() ); -} - -void HorizontalSlider::UpdateBarFromValue() -{ - m_SliderBar->MoveTo( ( Width() - m_SliderBar->Width() ) * ( m_fValue ), m_SliderBar->Y() ); -} - -void HorizontalSlider::OnMouseClickLeft( int x, int y, bool bDown ) -{ - m_SliderBar->MoveTo( CanvasPosToLocal( Gwen::Point( x, y ) ).x - m_SliderBar->Width() * 0.5, m_SliderBar->Y() ); - m_SliderBar->OnMouseClickLeft( x, y, bDown ); - OnMoved( m_SliderBar ); -} - -void HorizontalSlider::Layout( Skin::Base* /*skin*/ ) -{ - m_SliderBar->SetSize( 15, Height() ); -} - -void HorizontalSlider::Render( Skin::Base* skin ) -{ - skin->DrawSlider( this, true, m_bClampToNotches ? m_iNumNotches : 0, m_SliderBar->Width() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.h b/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.h deleted file mode 100644 index 7d8e47b7a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/HorizontalSlider.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_HORIZONTALSLIDER_H -#define GWEN_CONTROLS_HORIZONTALSLIDER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Slider.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT HorizontalSlider : public Slider - { - GWEN_CONTROL( HorizontalSlider, Slider ); - - virtual void Layout( Skin::Base* skin ); - virtual void Render( Skin::Base* skin ); - - virtual float CalculateValue(); - virtual void UpdateBarFromValue(); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.cpp b/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.cpp deleted file mode 100644 index 706161550..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ImagePanel.h" - -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.h b/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.h deleted file mode 100644 index e3dae2127..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ImagePanel.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_IMAGEPANEL_H -#define GWEN_CONTROLS_IMAGEPANEL_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/BaseRender.h" -#include "Gwen/Texture.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT ImagePanel : public Controls::Base - { - public: - - GWEN_CONTROL_INLINE( ImagePanel, Controls::Base ) - { - SetUV( 0, 0, 1, 1 ); - SetMouseInputEnabled( false ); - m_DrawColor = Colors::White; - SetStretch( true ); - } - - virtual ~ImagePanel() - { - m_Texture.Release( GetSkin()->GetRender() ); - } - - virtual void SetUV( float u1, float v1, float u2, float v2 ) - { - m_uv[0] = u1; - m_uv[1] = v1; - m_uv[2] = u2; - m_uv[3] = v2; - } - - virtual void SetImage( const TextObject & imageName ) - { - m_Texture.Load( imageName, GetSkin()->GetRender() ); - } - - virtual TextObject & GetImage() - { - return m_Texture.name; - } - - virtual int TextureWidth() - { - return m_Texture.width; - } - - virtual int TextureHeight() - { - return m_Texture.height; - } - - virtual const TextObject & GetImageName() - { - return m_Texture.name; - } - - virtual void Render( Skin::Base* skin ) - { - skin->GetRender()->SetDrawColor( m_DrawColor ); - - if ( m_bStretch ) - { skin->GetRender()->DrawTexturedRect( &m_Texture, GetRenderBounds(), m_uv[0], m_uv[1], m_uv[2], m_uv[3] ); } - else - { skin->GetRender()->DrawTexturedRect( &m_Texture, Gwen::Rect( 0, 0, m_Texture.width, m_Texture.height ), m_uv[0], m_uv[1], m_uv[2], m_uv[3] ); } - } - - virtual void SizeToContents() - { - SetSize( m_Texture.width, m_Texture.height ); - } - - virtual void SetDrawColor( Gwen::Color color ) - { - m_DrawColor = color; - } - - virtual bool FailedToLoad() - { - return m_Texture.FailedToLoad(); - } - - virtual bool GetStretch() { return m_bStretch; } - virtual void SetStretch( bool b ) { m_bStretch = b; } - - protected: - - Texture m_Texture; - float m_uv[4]; - Gwen::Color m_DrawColor; - - bool m_bStretch; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Label.cpp b/OpenSauce/shared/Include/GWEN/Controls/Label.cpp deleted file mode 100644 index f995575b6..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Label.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( Label ) -{ - m_CreatedFont = NULL; - m_Text = new ControlsInternal::Text( this ); - m_Text->SetFont( GetSkin()->GetDefaultFont() ); - SetMouseInputEnabled( false ); - SetBounds( 0, 0, 100, 10 ); - SetAlignment( Gwen::Pos::Left | Gwen::Pos::Top ); -} - -void Label::PreDelete( Gwen::Skin::Base* skin ) -{ - if ( m_CreatedFont ) - { - skin->ReleaseFont( m_CreatedFont ); - delete m_CreatedFont; - m_CreatedFont = NULL; - SetFont( NULL ); - } -} - -void Label::PostLayout( Skin::Base* /*skin*/ ) -{ - m_Text->Position( m_iAlign ); -} - -void Label::SetAlignment( int iAlign ) -{ - if ( m_iAlign == iAlign ) { return; } - - m_iAlign = iAlign; - - m_Text->SetAlignment(iAlign); - - Invalidate(); -} - -int Label::GetAlignment() -{ - return m_iAlign; -} - -void Label::SetText( const TextObject & str, bool bDoEvents ) -{ - if ( m_Text->GetText() == str.GetUnicode() ) { return; } - - m_Text->SetString( str ); - Redraw(); - - if ( bDoEvents ) - { OnTextChanged(); } -} - -void Label::SizeToContents() -{ - m_Text->SetPos( m_Padding.left, m_Padding.top ); - m_Text->RefreshSize(); - SetSize( m_Text->Width() + m_Padding.left + m_Padding.right, m_Text->Height() + m_Padding.top + m_Padding.bottom ); -} - -Gwen::Rect Label::GetCharacterPosition( int iChar ) -{ - Gwen::Rect p = m_Text->GetCharacterPosition( iChar ); - p.x += m_Text->X(); - p.y += m_Text->Y(); - return p; -} - -void Label::OnBoundsChanged( Gwen::Rect oldChildBounds ) -{ - BaseClass::OnBoundsChanged( oldChildBounds ); - - if ( m_Text->Wrap() ) - { - m_Text->RefreshSize(); - Invalidate(); - } -} - -void Label::SetFont( Gwen::UnicodeString strFacename, int iSize, bool bBold ) -{ - if ( m_CreatedFont ) - { - GetSkin()->ReleaseFont( m_CreatedFont ); - delete m_CreatedFont; - m_CreatedFont = NULL; - SetFont( NULL ); - } - - m_CreatedFont = new Gwen::Font(); - Debug::AssertCheck( m_CreatedFont != NULL, "Couldn't Create Font!" ); - m_CreatedFont->bold = bBold; - m_CreatedFont->facename = strFacename; - m_CreatedFont->size = iSize; - SetFont( m_CreatedFont ); - m_Text->RefreshSize(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Label.h b/OpenSauce/shared/Include/GWEN/Controls/Label.h deleted file mode 100644 index 0192ad22a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Label.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_LABEL_H -#define GWEN_CONTROLS_LABEL_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Text.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT Label : public Controls::Base - { - public: - - GWEN_CONTROL( Label, Controls::Base ); - virtual void PreDelete( Gwen::Skin::Base* skin ); - - virtual void SetText( const TextObject & str, bool bDoEvents = true ); - - virtual const TextObject & GetText() const { return m_Text->GetText(); } - - virtual void Render( Skin::Base* /*skin*/ ) {} - - virtual void PostLayout( Skin::Base* skin ); - - virtual void SizeToContents(); - - virtual void SetAlignment( int iAlign ); - virtual int GetAlignment(); - - - virtual void SetFont( Gwen::UnicodeString strFacename, int iSize, bool bBold ); - - virtual void SetFont( Gwen::Font* pFont ) { m_Text->SetFont( pFont ); } - virtual Gwen::Font* GetFont() { return m_Text->GetFont(); } - virtual void SetTextColor( const Gwen::Color & col ) { m_Text->SetTextColor( col ); } - virtual void SetTextColorOverride( const Gwen::Color & col ) { m_Text->SetTextColorOverride( col ); } - inline const Gwen::Color & TextColor() const { return m_Text->TextColor(); } - - virtual int TextWidth() { return m_Text->Width(); } - virtual int TextRight() { return m_Text->Right(); } - virtual int TextHeight() { return m_Text->Height(); } - virtual int TextX() { return m_Text->X(); } - virtual int TextY() { return m_Text->Y(); } - virtual int TextLength() { return m_Text->Length(); } - - Gwen::Rect GetCharacterPosition( int iChar ); - - virtual void SetTextPadding( const Padding & padding ) { m_Text->SetPadding( padding ); Invalidate(); InvalidateParent(); } - virtual const Padding & GetTextPadding() { return m_Text->GetPadding(); } - - inline int Alignment() const { return m_iAlign; } - - virtual void MakeColorNormal() { SetTextColor( GetSkin()->Colors.Label.Default ); } - virtual void MakeColorBright() { SetTextColor( GetSkin()->Colors.Label.Bright ); } - virtual void MakeColorDark() { SetTextColor( GetSkin()->Colors.Label.Dark ); } - virtual void MakeColorHighlight() { SetTextColor( GetSkin()->Colors.Label.Highlight ); } - - virtual TextObject GetValue() { return GetText(); } - virtual void SetValue( const TextObject & strValue ) { return SetText( strValue ); } - - virtual bool Wrap() { return m_Text->Wrap(); } - virtual void SetWrap( bool b ) { m_Text->SetWrap( b ); } - - virtual void OnBoundsChanged( Gwen::Rect oldChildBounds ); - - protected: - - virtual void OnTextChanged() {}; - - Gwen::Font* m_CreatedFont; - ControlsInternal::Text* m_Text; - int m_iAlign; - - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.cpp b/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.cpp deleted file mode 100644 index eaf85402d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/LabelClickable.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( LabelClickable ) -{ - SetIsToggle( false ); - SetCursor( Gwen::CursorType::Finger ); - SetAlignment( Gwen::Pos::Left | Gwen::Pos::CenterV ); -} - -void LabelClickable::Render( Skin::Base* /*skin*/ ) -{ - //skin->DrawButton( this, IsDepressed(), IsToggle() && GetToggleState() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.h b/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.h deleted file mode 100644 index ff78872c2..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/LabelClickable.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_LABELCLICKABLE_H -#define GWEN_CONTROLS_LABELCLICKABLE_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT LabelClickable : public Button - { - public: - - GWEN_CONTROL( LabelClickable, Button ); - - virtual void Render( Skin::Base* skin ); - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Layout/Table.h b/OpenSauce/shared/Include/GWEN/Controls/Layout/Table.h deleted file mode 100644 index c39d12e0e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Layout/Table.h +++ /dev/null @@ -1,341 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_LAYOUT_TABLE_H -#define GWEN_CONTROLS_LAYOUT_TABLE_H - -#include "Gwen/Controls/Button.h" -#include "Gwen/Utility.h" - -namespace Gwen -{ - namespace Controls - { - namespace Layout - { - class Table; - - class GWEN_EXPORT TableRow : public Base - { - static const int MaxColumns = 16; - - GWEN_CONTROL_INLINE( TableRow, Base ) - { - SetEven( false ); - - for ( int i = 0; i < MaxColumns; i++ ) - { m_Columns[i] = NULL; } - - m_ColumnCount = 0; - } - - void SetColumnCount( int iCount ) - { - if ( iCount == m_ColumnCount ) { return; } - - if ( iCount >= MaxColumns ) - { m_ColumnCount = MaxColumns; } - - for ( int i = 0; i < MaxColumns; i++ ) - { - if ( i < iCount ) - { - if ( !m_Columns[i] ) - { - m_Columns[i] = new Label( this ); - m_Columns[i]->Dock( Pos::Left ); - m_Columns[i]->SetPadding( Padding( 3, 3, 3, 3 ) ); - } - } - else if ( m_Columns[i] ) - { - m_Columns[i]->DelayedDelete(); - m_Columns[i] = NULL; - } - - m_ColumnCount = iCount; - } - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( !m_Columns[i] ) { return; } - - if ( m_Columns[i]->Width() == iWidth ) { return; } - - m_Columns[i]->SetWidth( iWidth ); - } - - void SetCellText( int i, const TextObject & strString ) - { - if ( !m_Columns[i] ) { return; } - - m_Columns[i]->SetText( strString ); - } - - void SetCellContents( int i, Base* pControl, bool bEnableMouseInput = false ) - { - if ( !m_Columns[i] ) { return; } - - pControl->SetParent( m_Columns[i] ); - m_Columns[i]->SetMouseInputEnabled( bEnableMouseInput ); - } - - Label* GetCellContents( int i ) - { - return m_Columns[i]; - } - - void SizeToContents() - { - int iHeight = 0; - - for ( int i = 0; i < m_ColumnCount; i++ ) - { - if ( !m_Columns[i] ) { continue; } - - // Note, more than 1 child here, because the - // label has a child built in ( The Text ) - if ( m_Columns[i]->NumChildren() > 1 ) - { - m_Columns[i]->SizeToChildren(); - } - else - { - m_Columns[i]->SizeToContents(); - } - - iHeight = Utility::Max( iHeight, m_Columns[i]->Height() ); - } - - SetHeight( iHeight ); - } - - void SetTextColor( const Gwen::Color & color ) - { - for ( int i = 0; i < m_ColumnCount; i++ ) - { - if ( !m_Columns[i] ) { continue; } - - m_Columns[i]->SetTextColor( color ); - } - } - - //You might hate this. Actually I know you will - virtual const TextObject & GetText( int i ) - { - return m_Columns[i]->GetText(); - } - virtual void SetSelected( bool /*b*/ ) {} - - // - // This is sometimes called by derivatives. - // - Gwen::Event::Caller onRowSelected; - - virtual bool GetEven() { return m_bEvenRow; } - virtual void SetEven( bool b ) { m_bEvenRow = b; } - - private: - - bool m_bEvenRow; - int m_ColumnCount; - Label* m_Columns[MaxColumns]; - - friend class Table; - - - }; - - class GWEN_EXPORT Table : public Base - { - public: - - GWEN_CONTROL_INLINE( Table, Base ) - { - m_iColumnCount = 1; - m_iDefaultRowHeight = 22; - - for ( int i = 0; i < TableRow::MaxColumns; i++ ) - { - m_ColumnWidth[i] = 0; - } - - m_bSizeToContents = false; - } - - void SetColumnCount( int i ) - { - if ( m_iColumnCount == i ) { return; } - - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = gwen_cast ( *it ); - - if ( !pRow ) { continue; } - - pRow->SetColumnCount( i ); - } - - m_iColumnCount = i; - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( m_ColumnWidth[i] == iWidth ) { return; } - - m_ColumnWidth[i] = iWidth; - Invalidate(); - } - - TableRow* AddRow() - { - TableRow* row = new TableRow( this ); - AddRow( row ); - return row; - } - - void AddRow( TableRow* pRow ) - { - pRow->SetParent( this ); - pRow->SetColumnCount( m_iColumnCount ); - pRow->SetHeight( m_iDefaultRowHeight ); - pRow->Dock( Pos::Top ); - Invalidate(); - } - - TableRow* GetRow( int i ) - { - return gwen_cast ( GetChild( i ) ); - } - - unsigned int RowCount( int i ) - { - return NumChildren(); - } - - void Remove( TableRow* pRow ) - { - pRow->DelayedDelete(); - } - - void Clear() - { - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = gwen_cast ( *it ); - - if ( !pRow ) { continue; } - - Remove( pRow ); - } - } - - void Layout( Skin::Base* skin ) - { - BaseClass::Layout( skin ); - - if ( m_bSizeToContents ) - { - DoSizeToContents(); - } - - int iSizeRemainder = Width(); - int iAutoSizeColumns = 0; - - for ( int i = 0; i < TableRow::MaxColumns && i < m_iColumnCount; i++ ) - { - iSizeRemainder -= m_ColumnWidth[i]; - - if ( m_ColumnWidth[i] == 0 ) { iAutoSizeColumns++; } - } - - if ( iAutoSizeColumns > 1 ) { iSizeRemainder /= iAutoSizeColumns; } - - bool bEven = false; - - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = gwen_cast ( *it ); - - if ( !pRow ) { continue; } - - pRow->SizeToContents(); - pRow->SetEven( bEven ); - bEven = !bEven; - - for ( int i = 0; i < TableRow::MaxColumns && i < m_iColumnCount; i++ ) - { - if ( m_ColumnWidth[i] == 0 ) - { pRow->SetColumnWidth( i, iSizeRemainder ); } - else - { pRow->SetColumnWidth( i, m_ColumnWidth[i] ); } - } - } - - InvalidateParent(); - } - - void PostLayout( Skin::Base* /*skin*/ ) - { - if ( m_bSizeToContents ) - { - SizeToChildren(); - m_bSizeToContents = false; - } - } - - void SizeToContents() - { - m_bSizeToContents = true; - Invalidate(); - } - - void DoSizeToContents() - { - for ( int i = 0; i < TableRow::MaxColumns; i++ ) - { - m_ColumnWidth[i] = 10; - } - - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = gwen_cast ( *it ); - - if ( !pRow ) { continue; } - - pRow->SizeToContents(); - - for ( int i = 0; i < TableRow::MaxColumns; i++ ) - { - if ( pRow->m_Columns[i] ) - { - m_ColumnWidth[i] = Utility::Max( m_ColumnWidth[i], pRow->m_Columns[i]->Width() ); - } - } - - //iBottom += pRow->Height(); - } - - InvalidateParent(); - } - - private: - - bool m_bSizeToContents; - int m_iColumnCount; - int m_iDefaultRowHeight; - - int m_ColumnWidth[ TableRow::MaxColumns ]; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ListBox.cpp b/OpenSauce/shared/Include/GWEN/Controls/ListBox.cpp deleted file mode 100644 index 9af3b9b99..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ListBox.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ListBox.h" -#include "Gwen/Controls/ScrollControl.h" -#include "Gwen/InputHandler.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class ListBoxRow : public Layout::TableRow -{ - GWEN_CONTROL_INLINE( ListBoxRow, Layout::TableRow ) - { - SetMouseInputEnabled( true ); - SetSelected( false ); - } - - void Render( Skin::Base* skin ) - { - skin->DrawListBoxLine( this, IsSelected(), GetEven() ); - } - - bool IsSelected() const - { - return m_bSelected; - } - - void DoSelect() - { - SetSelected( true ); - onRowSelected.Call( this ); - Redraw(); - } - - void OnMouseClickLeft( int /*x*/, int /*y*/, bool bDown ) - { - if ( bDown ) - { - DoSelect(); - } - } - - void SetSelected( bool b ) - { - m_bSelected = b; - - // TODO: Get these values from the skin. - if ( b ) - { SetTextColor( Gwen::Colors::White ); } - else - { SetTextColor( Gwen::Colors::Black ); } - } - - private: - - bool m_bSelected; - -}; - -GWEN_CONTROL_CONSTRUCTOR( ListBox ) -{ - SetScroll( false, true ); - SetAutoHideBars( true ); - SetMargin( Margin( 1, 1, 1, 1 ) ); - m_InnerPanel->SetPadding( Padding( 2, 2, 2, 2 ) ); - m_Table = new Controls::Layout::Table( this ); - m_Table->SetColumnCount( 1 ); - m_bMultiSelect = false; -} - -Layout::TableRow* ListBox::AddItem( const TextObject & strLabel, const String & strName ) -{ - ListBoxRow* pRow = new ListBoxRow( this ); - m_Table->AddRow( pRow ); - pRow->SetCellText( 0, strLabel ); - pRow->SetName( strName ); - pRow->onRowSelected.Add( this, &ListBox::OnRowSelected ); - return pRow; -} - -void ListBox::RemoveItem( Layout::TableRow* row ) -{ - ListBox::Rows::iterator it = std::find( m_SelectedRows.begin(), m_SelectedRows.end(), row ); - if( it != m_SelectedRows.end() ) { - m_SelectedRows.erase( it ); - } - m_Table->Remove( row ); -} - -void ListBox::Render( Skin::Base* skin ) -{ - skin->DrawListBox( this ); -} - -void ListBox::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - const Gwen::Rect & inner = m_InnerPanel->GetInnerBounds(); - m_Table->SetPos( inner.x, inner.y ); - m_Table->SetWidth( inner.w ); - m_Table->SizeToChildren( false, true ); - BaseClass::Layout( skin ); -} - -void ListBox::UnselectAll() -{ - std::list::iterator it = m_SelectedRows.begin(); - - while ( it != m_SelectedRows.end() ) - { - ListBoxRow* pRow = static_cast( *it ); - it = m_SelectedRows.erase( it ); - pRow->SetSelected( false ); - } -} - -void ListBox::OnRowSelected( Base* pControl ) -{ - bool bClear = !Gwen::Input::IsShiftDown(); - - if ( !AllowMultiSelect() ) { bClear = true; } - - SetSelectedRow( pControl, bClear ); -} - -Layout::TableRow* ListBox::GetSelectedRow() -{ - if ( m_SelectedRows.empty() ) { return NULL; } - - return *m_SelectedRows.begin(); -} - -Gwen::String ListBox::GetSelectedRowName() -{ - Layout::TableRow* row = GetSelectedRow(); - - if ( !row ) { return ""; } - - return row->GetName(); -} - -void ListBox::Clear() -{ - UnselectAll(); - m_Table->Clear(); -} - -void ListBox::SetSelectedRow( Gwen::Controls::Base* pControl, bool bClearOthers ) -{ - if ( bClearOthers ) - { UnselectAll(); } - - ListBoxRow* pRow = gwen_cast ( pControl ); - - if ( !pRow ) { return; } - - // TODO: make sure this is one of our rows! - pRow->SetSelected( true ); - m_SelectedRows.push_back( pRow ); - onRowSelected.Call( this ); -} - - - -void ListBox::SelectByString( const TextObject & strName, bool bClearOthers ) -{ - if ( bClearOthers ) - { UnselectAll(); } - - Base::List & children = m_Table->GetChildren(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - ListBoxRow* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - if ( Utility::Strings::Wildcard( strName, pChild->GetText( 0 ) ) ) - { SetSelectedRow( pChild, false ); } - } -} - -bool ListBox::OnKeyDown( bool bDown ) -{ - if ( bDown ) - { - Base::List & children = m_Table->Children; - Base::List::const_iterator begin = children.begin(); - Base::List::const_iterator end = children.end(); - Controls::Base* sel_row = GetSelectedRow(); - - if ( sel_row == NULL && !children.empty() ) // no user selection yet, so select first element - { sel_row = children.front(); } - - Base::List::const_iterator result = std::find( begin, end, sel_row ); - - if ( result != end ) - { - Base::List::const_iterator next = result; - ++next; - - if ( next != end ) - { result = next; } - - ListBoxRow* pRow = gwen_cast ( *result ); - - if ( pRow ) - { - pRow->DoSelect(); - Controls::VerticalScrollBar* pScroll = gwen_cast ( m_VerticalScrollBar ); - - if ( pScroll ) { pScroll->NudgeDown( this ); } - - Redraw(); - } - } - } - - return true; -} - -bool ListBox::OnKeyUp( bool bDown ) -{ - if ( bDown ) - { - Base::List & children = m_Table->Children; - Base::List::const_iterator begin = children.begin(); - Base::List::const_iterator end = children.end(); - Controls::Base* sel_row = GetSelectedRow(); - - if ( sel_row == NULL && !children.empty() ) // no user selection yet, so select first element - { sel_row = children.front(); } - - Base::List::const_iterator result = std::find( begin, end, sel_row ); - - if ( result != end ) - { - if ( result != begin ) - { --result; } - - ListBoxRow* pRow = gwen_cast ( *result ); - - if ( pRow ) - { - pRow->DoSelect(); - Controls::VerticalScrollBar* pScroll = gwen_cast ( m_VerticalScrollBar ); - - if ( pScroll ) { pScroll->NudgeUp( this ); } - - Redraw(); - } - } - } - - return true; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ListBox.h b/OpenSauce/shared/Include/GWEN/Controls/ListBox.h deleted file mode 100644 index fec7e32e5..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ListBox.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_LISTBOX_H -#define GWEN_CONTROLS_LISTBOX_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Layout/Table.h" -#include "Gwen/Controls/ScrollControl.h" - - -namespace Gwen -{ - namespace Controls - { - class ScrollControl; - - class GWEN_EXPORT ListBox : public ScrollControl - { - public: - - GWEN_CONTROL( ListBox, ScrollControl ); - - typedef std::list Rows; - - Layout::TableRow* AddItem( const TextObject & strLabel, const String & strName = "" ); - - void RemoveItem( Layout::TableRow* row ); - - void Render( Skin::Base* skin ); - void Layout( Skin::Base* skin ); - - void UnselectAll(); - - void SetAllowMultiSelect( bool bMultiSelect ) { m_bMultiSelect = bMultiSelect; } - bool AllowMultiSelect() const { return m_bMultiSelect; } - - const ListBox::Rows & GetSelectedRows() { return m_SelectedRows; } - - virtual Layout::TableRow* GetSelectedRow(); - virtual Gwen::String GetSelectedRowName(); - - virtual void SetSelectedRow( Gwen::Controls::Base* pRow, bool bClearOthers = true ); - virtual void SelectByString( const TextObject & string, bool bClearOthers = true ); - - Gwen::Event::Caller onRowSelected; - - Controls::Layout::Table* GetTable() { return m_Table; } - virtual void Clear(); - - // Pass through, to embedded table - void SetColumnCount( int iCount ) { m_Table->SetColumnCount( iCount ); } - void SetColumnWidth( int iCount, int iSize ) { m_Table->SetColumnWidth( iCount, iSize ); } - - protected: - - - void OnRowSelected( Base* pControl ); - bool OnKeyDown( bool bDown ); - bool OnKeyUp( bool bDown ); - - Controls::Layout::Table* m_Table; - ListBox::Rows m_SelectedRows; - - bool m_bMultiSelect; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Menu.cpp b/OpenSauce/shared/Include/GWEN/Controls/Menu.cpp deleted file mode 100644 index d0da32e1e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Menu.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Menu.h" -#include "Gwen/Skin.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - - - -GWEN_CONTROL_CONSTRUCTOR( Menu ) -{ - SetBounds( 0, 0, 10, 10 ); - SetPadding( Padding( 2, 2, 2, 2 ) ); - SetDisableIconMargin( false ); - SetAutoHideBars( true ); - SetScroll( false, true ); - SetDeleteOnClose( false ); -} - - -void Menu::Render( Skin::Base* skin ) -{ - skin->DrawMenu( this, IconMarginDisabled() ); -} - -void Menu::RenderUnder( Skin::Base* skin ) -{ - BaseClass::RenderUnder( skin ); - skin->DrawShadow( this ); -} - -void Menu::Layout( Skin::Base* skin ) -{ - int childrenHeight = 0; - - for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it ) - { - Base* pChild = ( *it ); - - if ( !pChild ) - { continue; } - - childrenHeight += pChild->Height(); - } - - if ( Y() + childrenHeight > GetCanvas()->Height() ) - { childrenHeight = GetCanvas()->Height() - Y(); } - - SetSize( Width(), childrenHeight ); - BaseClass::Layout( skin ); -} - -MenuItem* Menu::AddItem( const TextObject & strName, const TextObject & strIconName, const TextObject & strAccelerator ) -{ - MenuItem* pItem = new MenuItem( this ); - pItem->SetPadding( Padding( 2, 4, 4, 4 ) ); - pItem->SetText( strName ); - pItem->SetImage( strIconName ); - pItem->SetAccelerator( strAccelerator ); - OnAddItem( pItem ); - return pItem; -} - -void Menu::OnAddItem( MenuItem* item ) -{ - item->SetTextPadding( Padding( IconMarginDisabled() ? 0 : 24, 0, 16, 0 ) ); - item->Dock( Pos::Top ); - item->SizeToContents(); - item->SetAlignment( Pos::CenterV | Pos::Left ); - item->onHoverEnter.Add( this, &Menu::OnHoverItem ); - // Do this here - after Top Docking these values mean nothing in layout - int w = item->Width() + 10 + 32; - - if ( w < Width() ) { w = Width(); } - - SetSize( w, Height() ); -} - -void Menu::ClearItems() -{ - for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it ) - { - Base* pChild = *it; - - if ( !pChild ) { continue; } - - pChild->DelayedDelete(); - } -} - -void Menu::CloseAll() -{ - for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it ) - { - Base* pChild = *it; - MenuItem* pItem = gwen_cast ( pChild ); - - if ( !pItem ) { continue; } - - pItem->CloseMenu(); - } -} - -bool Menu::IsMenuOpen() -{ - for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it ) - { - Base* pChild = *it; - MenuItem* pItem = gwen_cast ( pChild ); - - if ( !pItem ) { continue; } - - if ( pItem->IsMenuOpen() ) - { return true; } - } - - return false; -} - -void Menu::OnHoverItem( Gwen::Controls::Base* pControl ) -{ - if ( !ShouldHoverOpenMenu() ) { return; } - - MenuItem* pItem = gwen_cast ( pControl ); - - if ( !pItem ) { return; } - - if ( pItem->IsMenuOpen() ) { return; } - - CloseAll(); - pItem->OpenMenu(); -} - -void Menu::Open( unsigned int iPos ) -{ - SetHidden( false ); - BringToFront(); - Gwen::Point MousePos = Input::GetMousePosition(); - SetPos( MousePos.x, MousePos.y ); -} - -void Menu::Close() -{ - SetHidden( true ); - - if ( DeleteOnClose() ) - { - DelayedDelete(); - } -} - -void Menu::CloseMenus() -{ - BaseClass::CloseMenus(); - CloseAll(); - Close(); -} - -void Menu::AddDivider() -{ - MenuDivider* divider = new MenuDivider( this ); - divider->Dock( Pos::Top ); - divider->SetMargin( Margin( IconMarginDisabled() ? 0 : 24, 0, 4, 0 ) ); -} - -void MenuDivider::Render( Gwen::Skin::Base* skin ) -{ - skin->DrawMenuDivider( this ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Menu.h b/OpenSauce/shared/Include/GWEN/Controls/Menu.h deleted file mode 100644 index 1e315184e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Menu.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_MENU_H -#define GWEN_CONTROLS_MENU_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/MenuItem.h" -#include "Gwen/Controls/ScrollControl.h" - -namespace Gwen -{ - namespace Controls - { - class MenuItem; - - class GWEN_EXPORT Menu : public ScrollControl - { - public: - - GWEN_CONTROL( Menu, ScrollControl ); - - virtual void Render( Skin::Base* skin ); - virtual void RenderUnder( Skin::Base* skin ); - - virtual void Layout( Skin::Base* skin ); - - virtual MenuItem* AddItem( const TextObject & strName, const TextObject & strIconName = L"", const TextObject & strAccelerator = L"" ); - - virtual void AddDivider(); - - void OnHoverItem( Gwen::Controls::Base* pControl ); - void CloseAll(); - bool IsMenuOpen(); - void ClearItems(); - - virtual void Open( unsigned int iPos ); - virtual void Close(); - - virtual bool IsMenuComponent() { return true; } - virtual void CloseMenus(); - - bool IconMarginDisabled() { return m_bDisableIconMargin; } - void SetDisableIconMargin( bool bDisable ) { m_bDisableIconMargin = bDisable; } - - bool DeleteOnClose() { return m_bDeleteOnClose; } - void SetDeleteOnClose( bool b ) { m_bDeleteOnClose = b; } - - - protected: - - virtual bool ShouldHoverOpenMenu() { return true; } - virtual void OnAddItem( MenuItem* item ); - - bool m_bDisableIconMargin; - bool m_bDeleteOnClose; - }; - - class GWEN_EXPORT MenuDivider : public Base - { - public: - - GWEN_CONTROL_INLINE( MenuDivider, Base ) - { - SetHeight( 1 ); - } - - void Render( Gwen::Skin::Base* skin ); - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/MenuItem.cpp b/OpenSauce/shared/Include/GWEN/Controls/MenuItem.cpp deleted file mode 100644 index f48bbaa7a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/MenuItem.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/MenuItem.h" -#include "Gwen/Skin.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class GWEN_EXPORT RightArrow : public Controls::Base -{ - public: - - GWEN_CONTROL_INLINE( RightArrow, Controls::Base ) - { - SetMouseInputEnabled( false ); - } - - void Render( Skin::Base* skin ) - { - skin->DrawMenuRightArrow( this ); - } -}; - -GWEN_CONTROL_CONSTRUCTOR( MenuItem ) -{ - m_Menu = NULL; - m_bOnStrip = false; - m_SubmenuArrow = NULL; - m_Accelerator = NULL; - SetTabable( false ); - SetCheckable( false ); - SetChecked( false ); -} - -MenuItem::~MenuItem() -{ -} - -void MenuItem::Render( Skin::Base* skin ) -{ - skin->DrawMenuItem( this, IsMenuOpen(), m_bCheckable ? m_bChecked : false ); - - // HACK! - if ( m_Accelerator ) - { - m_Accelerator->SetTextColorOverride( TextColor() ); - } -} - -void MenuItem::Layout( Skin::Base* skin ) -{ - if ( m_SubmenuArrow ) - { - m_SubmenuArrow->Position( Pos::Right | Pos::CenterV, 4, 0 ); - } - - BaseClass::Layout( skin ); -} - - - -Menu* MenuItem::GetMenu() -{ - if ( !m_Menu ) - { - m_Menu = new Menu( GetCanvas() ); - m_Menu->SetHidden( true ); - - if ( !m_bOnStrip ) - { - m_SubmenuArrow = new RightArrow( this ); - m_SubmenuArrow->SetSize( 15, 15 ); - } - - Invalidate(); - } - - return m_Menu; -} - -void MenuItem::SetChecked( bool bCheck ) -{ - if ( bCheck == m_bChecked ) - { return; } - - m_bChecked = bCheck; - onCheckChange.Call( this ); - - if ( bCheck ) - { onChecked.Call( this ); } - else - { onUnChecked.Call( this ); } -} - -void MenuItem::OnPress() -{ - if ( m_Menu ) - { - ToggleMenu(); - } - else if ( !m_bOnStrip ) - { - SetChecked( !GetChecked() ); - onMenuItemSelected.Call( this ); - GetCanvas()->CloseMenus(); - } - - BaseClass::OnPress(); -} - -void MenuItem::ToggleMenu() -{ - if ( IsMenuOpen() ) { CloseMenu(); } - else { OpenMenu(); } -} - -bool MenuItem::IsMenuOpen() -{ - if ( !m_Menu ) { return false; } - - return !m_Menu->Hidden(); -} - -void MenuItem::OpenMenu() -{ - if ( !m_Menu ) { return; } - - m_Menu->SetHidden( false ); - m_Menu->BringToFront(); - Gwen::Point p = LocalPosToCanvas( Gwen::Point( 0, 0 ) ); - - // Strip menus open downwards - if ( m_bOnStrip ) - { - m_Menu->SetPos( p.x, p.y + Height() + 1 ); - } - // Submenus open sidewards - else - { - m_Menu->SetPos( p.x + Width(), p.y ); - } - - // TODO: Option this. - // TODO: Make sure on screen, open the other side of the - // parent if it's better... -} - -void MenuItem::CloseMenu() -{ - if ( !m_Menu ) { return; } - - m_Menu->Close(); - m_Menu->CloseAll(); -} - -void MenuItem::SetAccelerator( const TextObject & strAccelerator ) -{ - if ( m_Accelerator ) - { - m_Accelerator->DelayedDelete(); - m_Accelerator = NULL; - } - - if ( strAccelerator.GetUnicode() == L"" ) - { return; } - - m_Accelerator = new Controls::Label( this ); - m_Accelerator->Dock( Pos::Right ); - m_Accelerator->SetAlignment( Pos::Right | Pos::CenterV ); - m_Accelerator->SetText( strAccelerator ); - m_Accelerator->SetMargin( Margin( 0, 0, 16, 0 ) ); - // TODO. -} - -void MenuItem::SizeToContents() -{ - BaseClass::SizeToContents(); - - if ( m_Accelerator ) - { - m_Accelerator->SizeToContents(); - SetWidth( Width() + m_Accelerator->Width() ); - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/MenuItem.h b/OpenSauce/shared/Include/GWEN/Controls/MenuItem.h deleted file mode 100644 index 69afac670..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/MenuItem.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_MENUITEM_H -#define GWEN_CONTROLS_MENUITEM_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Menu.h" - -namespace Gwen -{ - namespace Controls - { - class Menu; - - class GWEN_EXPORT MenuItem : public Button - { - public: - - GWEN_CONTROL( MenuItem, Button ); - - virtual ~MenuItem(); - - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - - virtual void SizeToContents(); - - virtual void OnPress(); - - Menu* GetMenu(); - - bool IsMenuOpen(); - void OpenMenu(); - void CloseMenu(); - void ToggleMenu(); - - void SetOnStrip( bool b ) { m_bOnStrip = b;} - bool OnStrip() { return m_bOnStrip; } - - virtual void SetCheckable( bool bCheck ) { m_bCheckable = bCheck; } - virtual void SetChecked( bool bCheck ); - virtual bool GetChecked() { return m_bChecked; } - - template - MenuItem* SetAction( Gwen::Event::Handler* pHandler, T fn ) - { - if ( m_Accelerator ) { AddAccelerator( m_Accelerator->GetText(), fn, pHandler ); } - - onMenuItemSelected.Add( pHandler, fn ); - return this; - } - - void SetAccelerator( const TextObject & strAccelerator ); - - Gwen::Event::Caller onMenuItemSelected; - Gwen::Event::Caller onChecked; - Gwen::Event::Caller onUnChecked; - Gwen::Event::Caller onCheckChange; - - private: - - Menu* m_Menu; - bool m_bOnStrip; - bool m_bCheckable; - bool m_bChecked; - - Label* m_Accelerator; - - - Controls::Base* m_SubmenuArrow; - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.cpp b/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.cpp deleted file mode 100644 index c249e6bbe..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/MenuStrip.h" -#include "Gwen/Skin.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( MenuStrip ) -{ - SetBounds( 0, 0, 200, 22 ); - Dock( Pos::Top ); - m_InnerPanel->SetPadding( Padding( 5, 0, 0, 0 ) ); -} - -void MenuStrip::Render( Skin::Base* skin ) -{ - skin->DrawMenuStrip( this ); -} - -void MenuStrip::Layout( Skin::Base* /*skin*/ ) -{ - //TODO: We don't want to do vertical sizing the same as Menu, do nothing for now -} - -void MenuStrip::OnAddItem( MenuItem* item ) -{ - item->Dock( Pos::Left ); - item->SetTextPadding( Padding( 5, 0, 5, 0 ) ); - item->SetPadding( Padding( 10, 0, 10, 0 ) ); - item->SizeToContents(); - item->SetOnStrip( true ); - item->onHoverEnter.Add( this, &Menu::OnHoverItem ); -} - -bool MenuStrip::ShouldHoverOpenMenu() -{ - return IsMenuOpen(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.h b/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.h deleted file mode 100644 index cb1f197a5..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/MenuStrip.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_MENUSTRIP_H -#define GWEN_CONTROLS_MENUSTRIP_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Menu.h" -#include "Gwen/Controls/MenuItem.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT MenuStrip : public Menu - { - GWEN_CONTROL( MenuStrip, Menu ); - - virtual void Render( Skin::Base* skin ); - virtual void RenderUnder( Skin::Base* /*skin*/ ) {} - virtual void Layout( Skin::Base* skin ); - - protected: - - virtual void OnAddItem( MenuItem* item ); - virtual bool ShouldHoverOpenMenu(); - virtual void Close() {} - - - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Modal.h b/OpenSauce/shared/Include/GWEN/Controls/Modal.h deleted file mode 100644 index b467da03c..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Modal.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_MODAL_H -#define GWEN_CONTROLS_MODAL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace ControlsInternal - { - class Modal : public Controls::Base - { - GWEN_CONTROL_INLINE( Modal, Controls::Base ) - { - SetKeyboardInputEnabled( true ); - SetMouseInputEnabled( true ); - SetShouldDrawBackground( true ); - SetBounds( 0, 0, GetParent()->Width(), GetParent()->Height() ); - } - - virtual void Layout( Skin::Base* /*skin*/ ) - { - SetBounds( 0, 0, GetCanvas()->Width(), GetCanvas()->Height() ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawModalControl( this ); - } - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.cpp b/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.cpp deleted file mode 100644 index 8507c1f6e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Utility.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/NumericUpDown.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( NumericUpDown ) -{ - SetSize( 100, 20 ); - Controls::Base* pSplitter = new Controls::Base( this ); - pSplitter->Dock( Pos::Right ); - pSplitter->SetWidth( 13 ); - NumericUpDownButton_Up* pButtonUp = new NumericUpDownButton_Up( pSplitter ); - pButtonUp->onPress.Add( this, &NumericUpDown::OnButtonUp ); - pButtonUp->SetTabable( false ); - pButtonUp->Dock( Pos::Top ); - pButtonUp->SetHeight( 10 ); - NumericUpDownButton_Down* pButtonDown = new NumericUpDownButton_Down( pSplitter ); - pButtonDown->onPress.Add( this, &NumericUpDown::OnButtonDown ); - pButtonDown->SetTabable( false ); - pButtonDown->Dock( Pos::Fill ); - pButtonUp->SetPadding( Padding( 0, 1, 1, 0 ) ); - m_iMax = 100; - m_iMin = 0; - m_iNumber = 0; - SetText( "0" ); -} - -void NumericUpDown::OnButtonUp( Base* /*control*/ ) -{ - SyncNumberFromText(); - SetValue( m_iNumber + 1 ); -} - -void NumericUpDown::OnButtonDown( Base* /*control*/ ) -{ - SyncNumberFromText(); - SetValue( m_iNumber - 1 ); -} - - -void NumericUpDown::SyncTextFromNumber() -{ - SetText( Utility::ToString( m_iNumber ) ); -} - -void NumericUpDown::SyncNumberFromText() -{ - SetValue( ( int ) GetFloatFromText() ); -} - -void NumericUpDown::SetMin( int i ) -{ - m_iMin = i; -} - -void NumericUpDown::SetMax( int i ) -{ - m_iMax = i; -} - -void NumericUpDown::SetValue( int i ) -{ - if ( i > m_iMax ) { i = m_iMax; } - - if ( i < m_iMin ) { i = m_iMin; } - - if ( m_iNumber == i ) - { - return; - } - - m_iNumber = i; - // Don't update the text if we're typing in it.. - // Undone - any reason why not? - //if ( !HasFocus() ) - { - SyncTextFromNumber(); - } - OnChange(); -} - -void NumericUpDown::OnChange() -{ - onChanged.Call( this ); -} - -void NumericUpDown::OnTextChanged() -{ - BaseClass::OnTextChanged(); - SyncNumberFromText(); -} - -void NumericUpDown::OnEnter() -{ - SyncNumberFromText(); - SyncTextFromNumber(); - BaseClass::OnEnter(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.h b/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.h deleted file mode 100644 index b88842097..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/NumericUpDown.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_NUMERICUPDOWN_H -#define GWEN_CONTROLS_NUMERICUPDOWN_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/TextBox.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT NumericUpDownButton_Up : public Button - { - GWEN_CONTROL_INLINE( NumericUpDownButton_Up, Button ) - { - SetSize( 7, 7 ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawNumericUpDownButton( this, IsDepressed(), true ); - } - }; - - class GWEN_EXPORT NumericUpDownButton_Down : public Button - { - GWEN_CONTROL_INLINE( NumericUpDownButton_Down, Button ) - { - SetSize( 7, 7 ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawNumericUpDownButton( this, IsDepressed(), false ); - } - }; - - class GWEN_EXPORT NumericUpDown : public TextBoxNumeric - { - public: - - GWEN_CONTROL( NumericUpDown, TextBoxNumeric ); - - virtual void SetMin( int i ); - virtual void SetMax( int i ); - virtual void SetValue( int i ); - - Event::Caller onChanged; - - private: - - virtual void OnEnter(); - virtual void OnChange(); - virtual void OnTextChanged(); - - virtual void OnButtonUp( Base* control ); - virtual void OnButtonDown( Base* control ); - - virtual bool OnKeyUp( bool bDown ) { if ( bDown ) { OnButtonUp( NULL ); } return true; } - virtual bool OnKeyDown( bool bDown ) { if ( bDown ) { OnButtonDown( NULL ); } return true; } - - virtual void SyncTextFromNumber(); - virtual void SyncNumberFromText(); - - - - int m_iNumber; - int m_iMax; - int m_iMin; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/PageControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/PageControl.cpp deleted file mode 100644 index 11044ee68..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/PageControl.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Utility.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/PageControl.h" -#include "Gwen/Controls.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( PageControl ) -{ - m_iPages = 0; - m_iCurrentPage = 0; - SetUseFinishButton( true ); - - for ( int i = 0; i < MaxPages; i++ ) - { - m_pPages[i] = NULL; - } - - Base* pControls = new Base( this ); - pControls->Dock( Pos::Bottom ); - pControls->SetSize( 24, 24 ); - pControls->SetMargin( Margin( 10, 10, 10, 10 ) ); - m_Finish = new Controls::Button( pControls ); - m_Finish->SetText( "Finish" ); - m_Finish->Dock( Pos::Right ); - m_Finish->onPress.Add( this, &ThisClass::Finish ); - m_Finish->SetSize( 70 ); - m_Finish->SetMargin( Margin( 4, 0, 0, 0 ) ); - m_Finish->Hide(); - m_Next = new Controls::Button( pControls ); - m_Next->SetText( "Next >" ); - m_Next->Dock( Pos::Right ); - m_Next->onPress.Add( this, &ThisClass::NextPage ); - m_Next->SetSize( 70 ); - m_Next->SetMargin( Margin( 4, 0, 0, 0 ) ); - m_Back = new Controls::Button( pControls ); - m_Back->SetText( "< Back" ); - m_Back->Dock( Pos::Right ); - m_Back->onPress.Add( this, &ThisClass::PreviousPage ); - m_Back->SetSize( 70 ); - m_Label = new Controls::Label( pControls ); - m_Label->Dock( Pos::Fill ); - m_Label->SetAlignment( Pos::Left | Pos::CenterV ); - m_Label->SetText( "Page 1 or 2" ); - m_PageFormatString.m_Unicode = L"Page %i of %i"; -} - -void PageControl::SetPageCount( unsigned int iNum ) -{ - if ( iNum >= MaxPages ) { iNum = MaxPages; } - - for ( unsigned int i = 0; i < iNum; i++ ) - { - if ( !m_pPages[i] ) - { - m_pPages[i] = new Controls::Base( this ); - m_pPages[i]->Dock( Pos::Fill ); - } - } - - m_iPages = iNum; - // Setting to -1 to force the page to change - m_iCurrentPage = -1; - HideAll(); - ShowPage( 0 ); -} - -void PageControl::SetPageFormatString( const TextObject & str ) -{ - m_PageFormatString = str; - m_Label->SetText( Utility::Format( m_PageFormatString.GetUnicode().c_str(), m_iCurrentPage + 1, m_iPages ) ); -} - -void PageControl::HideAll() -{ - for ( int i = 0; i < MaxPages; i++ ) - { - if ( !m_pPages[i] ) { continue; } - - m_pPages[i]->Hide(); - } -} - -void PageControl::ShowPage( unsigned int i ) -{ - if ( m_iCurrentPage == i ) { return; } - - if ( m_pPages[i] ) - { - m_pPages[i]->Show(); - m_pPages[i]->Dock( Pos::Fill ); - } - - m_iCurrentPage = i; - m_Back->SetDisabled( m_iCurrentPage == 0 ); - m_Next->SetDisabled( m_iCurrentPage >= m_iPages - 1 ); - m_Label->SetText( Utility::Format( m_PageFormatString.GetUnicode().c_str(), m_iCurrentPage + 1, m_iPages ) ); - - if ( GetUseFinishButton() ) - { - bool bFinished = m_iCurrentPage >= m_iPages - 1; - m_Next->SetHidden( bFinished ); - m_Finish->SetHidden( !bFinished ); - } - - { - Event::Information info; - info.Integer = i; - info.Control = m_pPages[i]; - onPageChanged.Call( this, info ); - } -} - -Controls::Base* PageControl::GetPage( unsigned int i ) -{ - return m_pPages[i]; -} - -Controls::Base* PageControl::GetCurrentPage() -{ - return GetPage( GetPageNumber() ); -} - -void PageControl::NextPage() -{ - if ( m_iCurrentPage >= m_iPages - 1 ) { return; } - - if ( m_pPages[m_iCurrentPage] ) - { - m_pPages[m_iCurrentPage]->Dock( Pos::None ); - Anim::Add( m_pPages[m_iCurrentPage], new Anim::Pos::X( m_pPages[m_iCurrentPage]->X(), Width() * -1, 0.2f, true, 0.0f, -1 ) ); - } - - ShowPage( m_iCurrentPage + 1 ); - - if ( m_pPages[m_iCurrentPage] ) - { - m_pPages[m_iCurrentPage]->Dock( Pos::None ); - Anim::Add( m_pPages[m_iCurrentPage], new Anim::Pos::X( Width(), 0, 0.2f, false, 0.0f, -1 ) ); - } -} - -void PageControl::PreviousPage() -{ - if ( m_iCurrentPage == 0 ) { return; } - - if ( m_pPages[m_iCurrentPage] ) - { - m_pPages[m_iCurrentPage]->Dock( Pos::None ); - Anim::Add( m_pPages[m_iCurrentPage], new Anim::Pos::X( m_pPages[m_iCurrentPage]->X(), Width(), 0.3f, true, 0.0f, -1 ) ); - } - - ShowPage( m_iCurrentPage - 1 ); - - if ( m_pPages[m_iCurrentPage] ) - { - m_pPages[m_iCurrentPage]->Dock( Pos::None ); - Anim::Add( m_pPages[m_iCurrentPage], new Anim::Pos::X( Width() * -1, 0, 0.3f, false, 0.0f, -1 ) ); - } -} - -void PageControl::Finish() -{ - onFinish.Call( this ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/PageControl.h b/OpenSauce/shared/Include/GWEN/Controls/PageControl.h deleted file mode 100644 index be0093096..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/PageControl.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PAGECONTROL_H -#define GWEN_CONTROLS_PAGECONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT PageControl : public Base - { - static const unsigned int MaxPages = 64; - - GWEN_CONTROL( PageControl, Base ); - - virtual void SetPageCount( unsigned int i ); - virtual unsigned int GetPageCount() { return m_iPages; } - - virtual void SetPageFormatString( const TextObject & str ); - virtual const TextObject & GetPageFormatString() { return m_PageFormatString; } - - virtual void ShowPage( unsigned int i ); - virtual unsigned int GetPageNumber() { return m_iCurrentPage; } - virtual Controls::Base* GetPage( unsigned int i ); - virtual Controls::Base* GetCurrentPage(); - - virtual void NextPage(); - virtual void PreviousPage(); - virtual void Finish(); - - Controls::Button* NextButton() { return m_Next; } - Controls::Button* BackButton() { return m_Back; } - Controls::Button* FinishButton() { return m_Finish; } - Controls::Label* Label() { return m_Label; } - - void SetUseFinishButton( bool b ) { m_bFinish = b; } - bool GetUseFinishButton() { return m_bFinish; } - - Event::Caller onPageChanged; - Event::Caller onFinish; - - protected: - - virtual void HideAll(); - - unsigned int m_iCurrentPage; - unsigned int m_iPages; - Controls::Base* m_pPages[MaxPages]; - - Gwen::TextObject m_PageFormatString; - - Controls::Button* m_Next; - Controls::Button* m_Back; - Controls::Button* m_Finish; - Controls::Label* m_Label; - - bool m_bFinish; - - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Pointer.cpp b/OpenSauce/shared/Include/GWEN/Controls/Pointer.cpp deleted file mode 100644 index 17e4d5cf6..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Pointer.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Pointer.h" -#include "Gwen/inputhandler.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - - -GWEN_CONTROL_CONSTRUCTOR( Pointer ) -{ - SetMouseInputEnabled( false ); - SetSize( 30, 30); -} - -void Pointer::Render( Skin::Base* skin ) -{ - skin->DrawPointer(this, Input::IsLeftMouseDown()); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Pointer.h b/OpenSauce/shared/Include/GWEN/Controls/Pointer.h deleted file mode 100644 index 1bf7725a9..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Pointer.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_POINTER_H -#define GWEN_CONTROLS_POINTER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT Pointer : public Controls::Base - { - public: - - GWEN_CONTROL( Pointer, Controls::Base ); - - virtual void Render( Skin::Base* skin ); - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.cpp deleted file mode 100644 index a690c84ef..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollControl.h" -#include "Gwen/Controls/ProgressBar.h" -#include "Gwen/Anim.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class ProgressBarThink : public Gwen::Anim::Animation -{ - public: - - ProgressBarThink() - { - m_fLastFrame = 0.0f; - } - - virtual void Think() - { - float fDiff = Platform::GetTimeInSeconds() - m_fLastFrame; - gwen_cast ( m_Control )->CycleThink( Gwen::Clamp( fDiff, 0.f, 0.3f ) ); - m_fLastFrame = Platform::GetTimeInSeconds(); - } - - - float m_fLastFrame; -}; - - -GWEN_CONTROL_CONSTRUCTOR( ProgressBar ) -{ - SetMouseInputEnabled( true ); - SetBounds( Gwen::Rect( 0, 0, 128, 32 ) ); - SetTextPadding( Padding( 3, 3, 3, 3 ) ); - SetHorizontal(); - SetAlignment( Gwen::Pos::Center ); - m_fProgress = 0.0f; - m_bAutoLabel = true; - m_fCycleSpeed = 0.0f; - Gwen::Anim::Add( this, new ProgressBarThink() ); -} - -void ProgressBar::SetValue( float val ) -{ - if ( val < 0 ) - { val = 0; } - - if ( val > 1 ) - { val = 1; } - - m_fProgress = val; - - if ( m_bAutoLabel ) - { - int displayVal = m_fProgress * 100; - SetText( Utility::ToString( displayVal ) + "%" ); - } -} - -void ProgressBar::CycleThink( float fDelta ) -{ - if ( !Visible() ) { return; } - - if ( m_fCycleSpeed == 0.0f ) { return; } - - m_fProgress += m_fCycleSpeed * fDelta; - - if ( m_fProgress < 0.0f ) { m_fProgress += 1.0f; } - - if ( m_fProgress > 1.0f ) { m_fProgress -= 1.0f; } - - Redraw(); -} - -void ProgressBar::Render( Skin::Base* skin ) -{ - skin->DrawProgressBar( this, m_bHorizontal, m_fProgress ); -} - -float ProgressBar::GetCycleSpeed() -{ - return m_fCycleSpeed; -} - -void ProgressBar::SetCycleSpeed( float f ) -{ - m_fCycleSpeed = f; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.h b/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.h deleted file mode 100644 index 0ccbc4892..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ProgressBar.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROGRESSBAR_H -#define GWEN_CONTROLS_PROGRESSBAR_H -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT ProgressBar : public Label - { - public: - - GWEN_CONTROL( ProgressBar, Label ); - - virtual void Render( Skin::Base* skin ); - - virtual void SetVertical() { m_bHorizontal = false; } - virtual void SetHorizontal() { m_bHorizontal = true; } - - virtual void SetValue( float val ); - virtual float GetValue() const { return m_fProgress; } - - virtual void SetAutoLabel( bool b ) { m_bAutoLabel = b; } - - virtual float GetCycleSpeed(); - virtual void SetCycleSpeed( float f ); - - virtual void CycleThink( float fDelta ); - - protected: - - float m_fProgress; - float m_fCycleSpeed; - - bool m_bHorizontal; - bool m_bAutoLabel; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Properties.cpp b/OpenSauce/shared/Include/GWEN/Controls/Properties.cpp deleted file mode 100644 index 9242c7704..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Properties.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Properties.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( Properties ) -{ - m_SplitterBar = new SplitterBar( this ); - m_SplitterBar->SetPos( 80, 0 ); - m_SplitterBar->SetCursor( Gwen::CursorType::SizeWE ); - m_SplitterBar->onDragged.Add( this, &Properties::OnSplitterMoved ); - m_SplitterBar->SetShouldDrawBackground( false ); - m_SplitterBar->DoNotIncludeInSize(); -} - -void Properties::PostLayout( Gwen::Skin::Base* /*skin*/ ) -{ - if ( SizeToChildren( false, true ) ) - { - InvalidateParent(); - } - - m_SplitterBar->SetSize( 3, Height() ); -} - -void Properties::OnSplitterMoved( Controls::Base* /*control*/ ) -{ - InvalidateChildren(); -} - -int Properties::GetSplitWidth() -{ - return m_SplitterBar->X(); -} - -PropertyRow* Properties::Add( const TextObject & text, const TextObject & value ) -{ - return Add( text, new Property::Text( this ), value ); -} - -PropertyRow* Properties::Add( const TextObject & text, Property::Base* pProp, const TextObject & value ) -{ - PropertyRow* row = new PropertyRow( this ); - row->Dock( Pos::Top ); - row->GetLabel()->SetText( text ); - row->SetProperty( pProp ); - pProp->SetPropertyValue( value, true ); - m_SplitterBar->BringToFront(); - return row; -} - -PropertyRow* Properties::Find( const TextObject & text ) -{ - for ( Base::List::iterator it = GetChildren().begin(); it != GetChildren().end(); ++it ) - { - PropertyRow* row = gwen_cast ( *it ); - - if ( !row ) { continue; } - - if ( row->GetLabel()->GetText() == text ) - { return row; } - } - - return NULL; -} - -void Properties::Clear() -{ - Base::List ChildListCopy = GetChildren(); - - for ( Base::List::iterator it = ChildListCopy.begin(); it != ChildListCopy.end(); ++it ) - { - PropertyRow* row = gwen_cast ( *it ); - - if ( !row ) { continue; } - - row->DelayedDelete(); - } -} - -class PropertyRowLabel : public Label -{ - GWEN_CONTROL_INLINE( PropertyRowLabel, Label ) - { - SetAlignment( Pos::Left | Pos::CenterV ); - m_pPropertyRow = NULL; - } - - void UpdateColours() - { - if ( IsDisabled() ) { return SetTextColor( GetSkin()->Colors.Button.Disabled ); } - - if ( m_pPropertyRow && m_pPropertyRow->IsEditing() ) { return SetTextColor( GetSkin()->Colors.Properties.Label_Selected ); } - - if ( m_pPropertyRow && m_pPropertyRow->IsHovered() ) { return SetTextColor( GetSkin()->Colors.Properties.Label_Hover ); } - - SetTextColor( GetSkin()->Colors.Properties.Label_Normal ); - } - - void SetPropertyRow( PropertyRow* p ) { m_pPropertyRow = p; } - - protected: - - PropertyRow* m_pPropertyRow; -}; - - -GWEN_CONTROL_CONSTRUCTOR( PropertyRow ) -{ - m_Property = NULL; - PropertyRowLabel* pLabel = new PropertyRowLabel( this ); - pLabel->SetPropertyRow( this ); - pLabel->Dock( Pos::Left ); - pLabel->SetAlignment( Pos::Left | Pos::Top ); - pLabel->SetMargin( Margin( 2, 2, 0, 0 ) ); - m_Label = pLabel; -} - -void PropertyRow::Render( Gwen::Skin::Base* skin ) -{ - /* SORRY */ - if ( IsEditing() != m_bLastEditing ) - { - OnEditingChanged(); - m_bLastEditing = IsEditing(); - } - - if ( IsHovered() != m_bLastHover ) - { - OnHoverChanged(); - m_bLastHover = IsHovered(); - } - - /* SORRY */ - skin->DrawPropertyRow( this, m_Label->Right(), IsEditing(), IsHovered() | m_Property->IsHovered() ); -} - -void PropertyRow::Layout( Gwen::Skin::Base* /*skin*/ ) -{ - Properties* pParent = gwen_cast ( GetParent() ); - - if ( !pParent ) { return; } - - m_Label->SetWidth( pParent->GetSplitWidth() ); - - if ( m_Property ) - { - SetHeight( m_Property->Height() ); - } -} - -void PropertyRow::SetProperty( Property::Base* prop ) -{ - m_Property = prop; - m_Property->SetParent( this ); - m_Property->Dock( Pos::Fill ); - m_Property->onChange.Add( this, &ThisClass::OnPropertyValueChanged ); -} - -void PropertyRow::OnPropertyValueChanged( Gwen::Controls::Base* /*control*/ ) -{ - Event::Information info; - info.String = GetProperty()->GetPropertyValue(); - onChange.Call( this, info ); -} - -void PropertyRow::OnEditingChanged() -{ - m_Label->Redraw(); -} - -void PropertyRow::OnHoverChanged() -{ - m_Label->Redraw(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Properties.h b/OpenSauce/shared/Include/GWEN/Controls/Properties.h deleted file mode 100644 index 7fc2b195f..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Properties.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTIES_H -#define GWEN_CONTROLS_PROPERTIES_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Property/BaseProperty.h" -#include "Gwen/Controls/Property/Text.h" -#include "Gwen/Controls/SplitterBar.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - - class PropertyRow; - - class GWEN_EXPORT Properties : public Base - { - public: - - GWEN_CONTROL( Properties, Base ); - - virtual void PostLayout( Gwen::Skin::Base* skin ); - - PropertyRow* Add( const TextObject & text, const TextObject & value = L"" ); - PropertyRow* Add( const TextObject & text, Property::Base* pProp, const TextObject & value = L"" ); - PropertyRow* Find( const TextObject & text ); - - virtual int GetSplitWidth(); - - virtual void Clear(); - - protected: - - virtual void OnSplitterMoved( Controls::Base* control ); - - Controls::SplitterBar* m_SplitterBar; - - }; - - class GWEN_EXPORT PropertyRow : public Base - { - public: - - GWEN_CONTROL( PropertyRow, Base ); - - virtual Label* GetLabel() { return m_Label; } - virtual void SetProperty( Property::Base* prop ); - virtual Property::Base* GetProperty() { return m_Property; } - - virtual void Layout( Gwen::Skin::Base* skin ); - virtual void Render( Gwen::Skin::Base* skin ); - - virtual bool IsEditing() { return m_Property && m_Property->IsEditing(); } - virtual bool IsHovered() { return BaseClass::IsHovered() || ( m_Property && m_Property->IsHovered() ); } - virtual void OnEditingChanged(); - virtual void OnHoverChanged(); - - Event::Caller onChange; - - protected: - - void OnPropertyValueChanged( Gwen::Controls::Base* control ); - - Label* m_Label; - Property::Base* m_Property; - - bool m_bLastEditing; - bool m_bLastHover; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Property/BaseProperty.h b/OpenSauce/shared/Include/GWEN/Controls/Property/BaseProperty.h deleted file mode 100644 index e9295f97d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Property/BaseProperty.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTY_BASEPROPERTY_H -#define GWEN_CONTROLS_PROPERTY_BASEPROPERTY_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Utility.h" - - -namespace Gwen -{ - namespace Controls - { - namespace Property - { - class GWEN_EXPORT Base : public Gwen::Controls::Base - { - public: - - GWEN_CONTROL_INLINE( Base, Gwen::Controls::Base ) - { - SetHeight( 17 ); - } - - virtual TextObject GetPropertyValue() = 0; - - virtual void SetPropertyValue( const TextObject & v, bool bFireChangeEvents = false ) = 0; - - virtual bool IsEditing() = 0; - - virtual void DoChanged() - { - Event::Information info; - info.String = GetPropertyValue(); - onChange.Call( this, info ); - } - - void OnPropertyValueChanged( Gwen::Controls::Base* /*control*/ ) - { - DoChanged(); - } - - Event::Caller onChange; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Property/Checkbox.h b/OpenSauce/shared/Include/GWEN/Controls/Property/Checkbox.h deleted file mode 100644 index 41ed761ea..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Property/Checkbox.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTY_CHECKBOX_H -#define GWEN_CONTROLS_PROPERTY_CHECKBOX_H - -#include "Gwen/Controls/Property/BaseProperty.h" -#include "Gwen/Controls/CheckBox.h" - -namespace Gwen -{ - namespace Controls - { - namespace Property - { - class GWEN_EXPORT Checkbox : public Property::Base - { - public: - - GWEN_CONTROL_INLINE( Checkbox, Property::Base ) - { - m_Checkbox = new Gwen::Controls::CheckBox( this ); - m_Checkbox->SetShouldDrawBackground( false ); - m_Checkbox->onCheckChanged.Add( this, &BaseClass::OnPropertyValueChanged ); - m_Checkbox->SetTabable( true ); - m_Checkbox->SetKeyboardInputEnabled( true ); - m_Checkbox->SetPos( 2, 1 ); - SetHeight( 18 ); - } - - virtual TextObject GetPropertyValue() - { - return m_Checkbox->IsChecked() ? L"1" : L"0"; - } - - virtual void SetPropertyValue( const TextObject & v, bool bFireChangeEvents ) - { - if ( v == L"1" || v == L"true" || v == L"TRUE" || v == L"yes" || v == L"YES" ) - { return m_Checkbox->SetChecked( true ); } - - return m_Checkbox->SetChecked( false ); - } - - virtual bool IsEditing() - { - return m_Checkbox->HasFocus(); - } - - virtual bool IsHovered() - { - return BaseClass::IsHovered() || m_Checkbox->IsHovered(); - } - - Gwen::Controls::CheckBox* m_Checkbox; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Property/ColorSelector.h b/OpenSauce/shared/Include/GWEN/Controls/Property/ColorSelector.h deleted file mode 100644 index c90ae22df..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Property/ColorSelector.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTY_COLORSELECTOR_H -#define GWEN_CONTROLS_PROPERTY_COLORSELECTOR_H - -#include "Gwen/Controls/Properties.h" -#include "Gwen/Controls/Menu.h" -#include "Gwen/Controls/HSVColorPicker.h" - -namespace Gwen -{ - namespace Controls - { - namespace Internal - { - class ColourButton : public Button - { - GWEN_CONTROL_INLINE( ColourButton, Button ) - { - m_Color = Colors::Black; - SetText( "" ); - } - - void Render( Skin::Base* skin ) - { - skin->GetRender()->SetDrawColor( m_Color ); - skin->GetRender()->DrawFilledRect( GetRenderBounds() ); - } - - void SetColor( const Gwen::Color & col ) { m_Color = col; } - - Gwen::Color m_Color; - }; - } - - namespace Property - { - class ColorSelector : public Property::Text - { - GWEN_CONTROL_INLINE( ColorSelector, Property::Text ) - { - m_Button = new Controls::Internal::ColourButton( m_TextBox ); - m_Button->Dock( Pos::Right ); - m_Button->SetWidth( 20 ); - m_Button->onPress.Add( this, &ThisClass::OnButtonPress ); - m_Button->SetMargin( Margin( 1, 1, 1, 2 ) ); - } - - void OnButtonPress( Controls::Base* control ) - { - Gwen::Controls::Menu* pMenu = new Menu( GetCanvas() ); - pMenu->SetSize( 256, 180 ); - pMenu->SetDeleteOnClose( true ); - pMenu->SetDisableIconMargin( true ); - Gwen::Controls::HSVColorPicker* picker = new Gwen::Controls::HSVColorPicker( pMenu ); - picker->Dock( Pos::Fill ); - picker->SetSize( 256, 128 ); - float defaultColor[3]; - Gwen::Utility::Strings::To::Floats( m_TextBox->GetText().Get(), defaultColor, 3 ); - picker->SetColor( Gwen::Color( defaultColor[0], defaultColor[1], defaultColor[2], 255 ), false, true ); - picker->onColorChanged.Add( this, &ThisClass::ColorChanged ); - pMenu->Open( Pos::Right | Pos::Top ); - } - - void ColorChanged( Controls::Base* control ) - { - Gwen::Controls::HSVColorPicker* picker = gwen_cast ( control ); - Gwen::String colorStr; - colorStr += Gwen::Utility::ToString( ( int ) picker->GetColor().r ) + " "; - colorStr += Gwen::Utility::ToString( ( int ) picker->GetColor().g ) + " "; - colorStr += Gwen::Utility::ToString( ( int ) picker->GetColor().b ); - m_TextBox->SetText( colorStr ); - DoChanged(); - } - - virtual TextObject GetPropertyValue() - { - return m_TextBox->GetText(); - } - - virtual void SetPropertyValue( const TextObject & v, bool bFireChangeEvents ) - { - m_TextBox->SetText( v, bFireChangeEvents ); - } - - virtual bool IsEditing() - { - return m_TextBox == Gwen::KeyboardFocus; - } - - virtual void DoChanged() - { - BaseClass::DoChanged(); - float col[3]; - Gwen::Utility::Strings::To::Floats( m_TextBox->GetText().Get(), col, 3 ); - m_Button->SetColor( Gwen::Color( col[0], col[1], col[2] ) ); - } - - Controls::Internal::ColourButton* m_Button; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Property/ComboBox.h b/OpenSauce/shared/Include/GWEN/Controls/Property/ComboBox.h deleted file mode 100644 index 5eb6198ea..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Property/ComboBox.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTY_COMBOBOX_H -#define GWEN_CONTROLS_PROPERTY_COMBOBOX_H - -#include "Gwen/Controls/Property/BaseProperty.h" -#include "Gwen/Controls/ComboBox.h" - -namespace Gwen -{ - namespace Controls - { - namespace Property - { - class GWEN_EXPORT ComboBox : public Property::Base - { - public: - - GWEN_CONTROL_INLINE( ComboBox, Property::Base ) - { - m_ComboBox = new Gwen::Controls::ComboBox( this ); - m_ComboBox->Dock( Pos::Fill ); - m_ComboBox->onSelection.Add( this, &BaseClass::OnPropertyValueChanged ); - m_ComboBox->SetTabable( true ); - m_ComboBox->SetKeyboardInputEnabled( true ); - m_ComboBox->SetShouldDrawBackground( false ); - SetHeight( 18 ); - } - - virtual TextObject GetPropertyValue() - { - Gwen::Controls::Label* pControl = m_ComboBox->GetSelectedItem(); - - if ( !pControl ) { return L""; } - - return pControl->GetName(); - } - - virtual void SetPropertyValue( const TextObject & v, bool bFireChangeEvents ) - { - m_ComboBox->SelectItemByName( v.Get(), bFireChangeEvents ); - } - - virtual bool IsEditing() - { - return m_ComboBox->HasFocus(); - } - - virtual bool IsHovered() - { - return BaseClass::IsHovered() || m_ComboBox->IsHovered(); - } - - Gwen::Controls::ComboBox* GetComboBox() - { - return m_ComboBox; - } - - protected: - - Gwen::Controls::ComboBox* m_ComboBox; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Property/Text.h b/OpenSauce/shared/Include/GWEN/Controls/Property/Text.h deleted file mode 100644 index 7ea2d8407..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Property/Text.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTY_TEXT_H -#define GWEN_CONTROLS_PROPERTY_TEXT_H - -#include "Gwen/Controls/Property/BaseProperty.h" -#include "Gwen/Controls/TextBox.h" - -namespace Gwen -{ - namespace Controls - { - namespace Property - { - class GWEN_EXPORT Text : public Property::Base - { - public: - - GWEN_CONTROL_INLINE( Text, Property::Base ) - { - m_TextBox = new TextBox( this ); - m_TextBox->Dock( Pos::Fill ); - m_TextBox->SetShouldDrawBackground( false ); - m_TextBox->onTextChanged.Add( this, &BaseClass::OnPropertyValueChanged ); - } - - virtual TextObject GetPropertyValue() - { - return m_TextBox->GetText(); - } - - virtual void SetPropertyValue( const TextObject & v, bool bFireChangeEvents ) - { - m_TextBox->SetText( v, bFireChangeEvents ); - } - - virtual bool IsEditing() - { - return m_TextBox->HasFocus(); - } - - virtual bool IsHovered() - { - return BaseClass::IsHovered() || m_TextBox->IsHovered(); - } - - TextBox* m_TextBox; - }; - } - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.cpp b/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.cpp deleted file mode 100644 index 831e37c57..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/PropertyTree.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace Controls - { - - Properties* PropertyTree::Add( const TextObject & text ) - { - TreeNode* node = new PropertyTreeNode( this ); - node->SetText( text ); - node->Dock( Pos::Top ); - Properties* props = new Properties( node ); - props->Dock( Pos::Top ); - return props; - } - - Properties* PropertyTree::Find( const TextObject & text ) - { - Controls::Base::List & children = GetChildNodes(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - PropertyTreeNode* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - if ( pChild->GetText() == text ) - { - Base::List & nodechildren = pChild->GetChildren(); - - for ( Base::List::iterator iter = nodechildren.begin(); iter != nodechildren.end(); ++iter ) - { - Properties* pPropertyChild = gwen_cast ( *iter ); - - if ( !pPropertyChild ) { continue; } - - return pPropertyChild; - } - } - } - - return NULL; - } - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.h b/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.h deleted file mode 100644 index 2780a91df..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/PropertyTree.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_PROPERTYTREE_H -#define GWEN_CONTROLS_PROPERTYTREE_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/TreeControl.h" -#include "Gwen/Controls/Properties.h" - - -namespace Gwen -{ - namespace Controls - { - class PropertyTreeNode : public TreeNode - { - public: - - GWEN_CONTROL_INLINE( PropertyTreeNode, TreeNode ) - { - m_Title->SetTextColorOverride( GetSkin()->Colors.Properties.Title ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawPropertyTreeNode( this, m_InnerPanel->X(), m_InnerPanel->Y() ); - } - - }; - - class PropertyTree : public TreeControl - { - public: - - GWEN_CONTROL_INLINE( PropertyTree, TreeControl ) - { - } - - Properties* Add( const TextObject & text ); - Properties* Find( const TextObject & text ); - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RadioButton.cpp b/OpenSauce/shared/Include/GWEN/Controls/RadioButton.cpp deleted file mode 100644 index 13c54cdcd..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RadioButton.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/RadioButton.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( RadioButton ) -{ - SetSize( 15, 15 ); - SetMouseInputEnabled( true ); - SetTabable( false ); -} - -void RadioButton::Render( Skin::Base* skin ) -{ - skin->DrawRadioButton( this, IsChecked(), IsDepressed() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RadioButton.h b/OpenSauce/shared/Include/GWEN/Controls/RadioButton.h deleted file mode 100644 index 4f45bccdd..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RadioButton.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RADIOBUTTON_H -#define GWEN_CONTROLS_RADIOBUTTON_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/CheckBox.h" -#include "Gwen/Controls/LabelClickable.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT RadioButton : public CheckBox - { - GWEN_CONTROL( RadioButton, CheckBox ); - virtual void Render( Skin::Base* skin ); - - private: - - // From CheckBox - virtual bool AllowUncheck() { return false; } - }; - - class GWEN_EXPORT LabeledRadioButton : public Base - { - public: - - GWEN_CONTROL_INLINE( LabeledRadioButton, Base ) - { - SetSize( 200, 19 ); - m_RadioButton = new RadioButton( this ); - m_RadioButton->Dock( Pos::Left ); - m_RadioButton->SetMargin( Margin( 0, 2, 2, 2 ) ); - m_RadioButton->SetTabable( false ); - m_RadioButton->SetKeyboardInputEnabled( false ); - m_Label = new LabelClickable( this ); - m_Label->SetAlignment( Pos::CenterV | Pos::Left ); - m_Label->SetText( "Radio Button" ); - m_Label->Dock( Pos::Fill ); - m_Label->onPress.Add( m_RadioButton, &CheckBox::OnPress ); - m_Label->SetTabable( false ); - m_Label->SetKeyboardInputEnabled( false ); - } - - void RenderFocus( Gwen::Skin::Base* skin ) - { - if ( Gwen::KeyboardFocus != this ) { return; } - - if ( !IsTabable() ) { return; } - - skin->DrawKeyboardHighlight( this, GetRenderBounds(), 0 ); - } - - virtual RadioButton* GetRadioButton() { return m_RadioButton; } - virtual LabelClickable* GetLabel() { return m_Label; } - virtual bool OnKeySpace( bool bDown ) { if ( bDown ) { m_RadioButton->SetChecked( !m_RadioButton->IsChecked() ); } return true; } - - virtual void Select() { m_RadioButton->SetChecked( true ); } - - private: - - RadioButton* m_RadioButton; - LabelClickable* m_Label; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.cpp b/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.cpp deleted file mode 100644 index ea040e4a0..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/RadioButtonController.h" -#include "Gwen/Controls/RadioButton.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( RadioButtonController ) -{ - m_Selected = NULL; - SetTabable( false ); - SetKeyboardInputEnabled( false ); -} - -void RadioButtonController::OnRadioClicked( Gwen::Controls::Base* pFromPanel ) -{ - RadioButton* pCheckedRadioButton = gwen_cast ( pFromPanel ); - - //Iterate through all other buttons and set them to false; - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - Base* pChild = *iter; - LabeledRadioButton* pLRB = gwen_cast ( pChild ); - - if ( pLRB ) - { - RadioButton* pChildRadioButton = pLRB->GetRadioButton(); - - if ( pChildRadioButton == pCheckedRadioButton ) - { - m_Selected = pLRB; - } - else - { - pLRB->GetRadioButton()->SetChecked( false ); - } - } - } - - OnChange(); -} - -void RadioButtonController::OnChange() -{ - onSelectionChange.Call( this ); -} - -LabeledRadioButton* RadioButtonController::AddOption( const Gwen::String & strText, const Gwen::String & strOptionName ) -{ - return AddOption( Gwen::Utility::StringToUnicode( strText ), strOptionName ); -} - -LabeledRadioButton* RadioButtonController::AddOption( const Gwen::UnicodeString & strText, const Gwen::String & strOptionName ) -{ - LabeledRadioButton* lrb = new LabeledRadioButton( this ); - lrb->SetName( strOptionName ); - lrb->GetLabel()->SetText( strText ); - lrb->GetRadioButton()->onChecked.Add( this, &RadioButtonController::OnRadioClicked ); - lrb->Dock( Pos::Top ); - lrb->SetMargin( Margin( 0, 1, 0, 1 ) ); - lrb->SetKeyboardInputEnabled( false ); - lrb->SetTabable( false ); - Invalidate(); - return lrb; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.h b/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.h deleted file mode 100644 index 5bcd67983..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RadioButtonController.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RADIOBOTTONCONTROLLER_H -#define GWEN_CONTROLS_RADIOBOTTONCONTROLLER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/RadioButton.h" - - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT RadioButtonController : public Base - { - public: - - GWEN_CONTROL( RadioButtonController, Base ); - - virtual void Render( Skin::Base* /*skin*/ ) {}; - virtual void OnRadioClicked( Base* pFromPanel ); - - virtual void OnChange(); - - virtual LabeledRadioButton* AddOption( const Gwen::String & strText, const Gwen::String & strOptionName = "" ); - virtual LabeledRadioButton* AddOption( const Gwen::UnicodeString & strText, const Gwen::String & strOptionName = "" ); - - virtual LabeledRadioButton* GetSelected() { return m_Selected; } - - virtual const Gwen::String & GetSelectedName() { return m_Selected->GetName(); } - virtual const TextObject & GetSelectedLabel() { return m_Selected->GetLabel()->GetText(); } - - Event::Caller onSelectionChange; - - private: - - LabeledRadioButton* m_Selected; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Rectangle.cpp b/OpenSauce/shared/Include/GWEN/Controls/Rectangle.cpp deleted file mode 100644 index aebcaebd0..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Rectangle.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Rectangle.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( Rectangle ) -{ - m_Color = Gwen::Color( 255, 255, 255, 255 ); -} - -void Rectangle::Render( Skin::Base* skin ) -{ - skin->GetRender()->SetDrawColor( m_Color ); - skin->GetRender()->DrawFilledRect( GetRenderBounds() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Rectangle.h b/OpenSauce/shared/Include/GWEN/Controls/Rectangle.h deleted file mode 100644 index 55320cb2d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Rectangle.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RECTANGLE_H -#define GWEN_CONTROLS_RECTANGLE_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT Rectangle : public Controls::Base - { - public: - - GWEN_CONTROL( Rectangle, Controls::Base ); - - virtual void Render( Skin::Base* skin ); - - const Gwen::Color & GetColor() { return m_Color; } - void SetColor( const Gwen::Color & col ) { m_Color = col; } - - protected: - - Gwen::Color m_Color; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.cpp deleted file mode 100644 index 75ea3bb42..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ImagePanel.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/ResizableControl.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -GWEN_CONTROL_CONSTRUCTOR( ResizableControl ) -{ - m_bResizable = true; - m_MinimumSize = Gwen::Point( 5, 5 ); - m_bClampMovement = false; - m_Resizer[5] = NULL; - m_Resizer[0] = NULL; - m_Resizer[2] = new Resizer( this ); - m_Resizer[2]->Dock( Pos::Bottom ); - m_Resizer[2]->SetResizeDir( Pos::Bottom ); - m_Resizer[2]->SetTarget( this ); - m_Resizer[2]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[1] = new Resizer( m_Resizer[2] ); - m_Resizer[1]->Dock( Pos::Left ); - m_Resizer[1]->SetResizeDir( Pos::Bottom | Pos::Left ); - m_Resizer[1]->SetTarget( this ); - m_Resizer[1]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[3] = new Resizer( m_Resizer[2] ); - m_Resizer[3]->Dock( Pos::Right ); - m_Resizer[3]->SetResizeDir( Pos::Bottom | Pos::Right ); - m_Resizer[3]->SetTarget( this ); - m_Resizer[3]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[8] = new Resizer( this ); - m_Resizer[8]->Dock( Pos::Top ); - m_Resizer[8]->SetResizeDir( Pos::Top ); - m_Resizer[8]->SetTarget( this ); - m_Resizer[8]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[7] = new Resizer( m_Resizer[8] ); - m_Resizer[7]->Dock( Pos::Left ); - m_Resizer[7]->SetResizeDir( Pos::Top | Pos::Left ); - m_Resizer[7]->SetTarget( this ); - m_Resizer[7]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[9] = new Resizer( m_Resizer[8] ); - m_Resizer[9]->Dock( Pos::Right ); - m_Resizer[9]->SetResizeDir( Pos::Top | Pos::Right ); - m_Resizer[9]->SetTarget( this ); - m_Resizer[9]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[4] = new Resizer( this ); - m_Resizer[4]->Dock( Pos::Left ); - m_Resizer[4]->SetResizeDir( Pos::Left ); - m_Resizer[4]->SetTarget( this ); - m_Resizer[4]->onResize.Add( this, &ResizableControl::OnResizedInternal ); - m_Resizer[6] = new Resizer( this ); - m_Resizer[6]->Dock( Pos::Right ); - m_Resizer[6]->SetResizeDir( Pos::Right ); - m_Resizer[6]->SetTarget( this ); - m_Resizer[6]->onResize.Add( this, &ResizableControl::OnResizedInternal ); -} - -void ResizableControl::DisableResizing() -{ - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - Resizer* resizer = gwen_cast ( *it ); - - if ( !resizer ) { continue; } - - resizer->SetMouseInputEnabled( false ); - //resizer->SetHidden( false ); - //SetPadding( Padding( resizer->Width(), resizer->Width(), resizer->Width(), resizer->Width() ) ); - } -} - -bool ResizableControl::SetBounds( int x, int y, int w, int h ) -{ - Gwen::Point minSize = GetMinimumSize(); - - // Clamp Minimum Size - if ( w < minSize.x ) { w = minSize.x; } - - if ( h < minSize.y ) { h = minSize.y; } - - // Clamp to parent's window - Base* pParent = GetParent(); - - if ( pParent && m_bClampMovement ) - { - if ( x + w > pParent->Width() ) { x = pParent->Width() - w; } - - if ( x < 0 ) { x = 0; } - - if ( y + h > pParent->Height() ) { y = pParent->Height() - h; } - - if ( y < 0 ) { y = 0; } - } - - return BaseClass::SetBounds( x, y, w, h ); -} - -void ResizableControl::OnResizedInternal( Controls::Base* /*pControl*/ ) -{ - onResize.Call( this ); - OnResized(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.h b/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.h deleted file mode 100644 index ed667de6d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ResizableControl.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RESIZABLECONTROL_H -#define GWEN_CONTROLS_RESIZABLECONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Resizer.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT ResizableControl : public Base - { - public: - - GWEN_CONTROL( ResizableControl, Base ); - - virtual void SetClampMovement( bool shouldClamp ) { m_bClampMovement = shouldClamp; } - virtual bool GetClampMovement() { return m_bClampMovement; } - - virtual void SetMinimumSize( const Gwen::Point & minSize ) { m_MinimumSize = minSize; } - virtual Gwen::Point GetMinimumSize() { return m_MinimumSize; } - - virtual void DisableResizing(); - - virtual bool SetBounds( int x, int y, int w, int h ); - - virtual void OnResized() {}; - - Event::Caller onResize; - - virtual ControlsInternal::Resizer* GetResizer( int iResizer ) { return m_Resizer[iResizer]; } - - protected: - - void OnResizedInternal( Controls::Base* pControl ); - - Gwen::Point m_MinimumSize; - bool m_bClampMovement; - bool m_bResizable; - - ControlsInternal::Resizer* m_Resizer[10]; - - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Resizer.cpp b/OpenSauce/shared/Include/GWEN/Controls/Resizer.cpp deleted file mode 100644 index 4cee79cb9..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Resizer.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Resizer.h" - -using namespace Gwen; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( Resizer ) -{ - m_iResizeDir = Pos::Left; - SetMouseInputEnabled( true ); - SetSize( 6, 6 ); -} - -void Resizer::OnMouseMoved( int x, int y, int /*deltaX*/, int /*deltaY*/ ) -{ - if ( !m_pTarget ) { return; } - - if ( !m_bDepressed ) { return; } - - Gwen::Rect pBounds = m_pTarget->GetBounds(); - Gwen::Point pntMin = m_pTarget->GetMinimumSize(); - Gwen::Point pCursorPos = m_pTarget->CanvasPosToLocal( Gwen::Point( x, y ) ); - Gwen::Point pDelta = m_pTarget->LocalPosToCanvas( m_HoldPos ); - pDelta.x -= x; - pDelta.y -= y; - - if ( m_iResizeDir & Pos::Left ) - { - pBounds.x -= pDelta.x; - pBounds.w += pDelta.x; - - // Conform to minimum size here so we don't - // go all weird when we snap it in the base conrt - - if ( pBounds.w < pntMin.x ) - { - int diff = pntMin.x - pBounds.w; - pBounds.w += diff; - pBounds.x -= diff; - } - } - - if ( m_iResizeDir & Pos::Top ) - { - pBounds.y -= pDelta.y; - pBounds.h += pDelta.y; - - // Conform to minimum size here so we don't - // go all weird when we snap it in the base conrt - - if ( pBounds.h < pntMin.y ) - { - int diff = pntMin.y - pBounds.h; - pBounds.h += diff; - pBounds.y -= diff; - } - } - - if ( m_iResizeDir & Pos::Right ) - { - // This is complicated. - // Basically we want to use the HoldPos, so it doesn't snap to the edge of the control - // But we need to move the HoldPos with the window movement. Yikes. - // I actually think this might be a big hack around the way this control works with regards - // to the holdpos being on the parent panel. - int woff = pBounds.w - m_HoldPos.x; - int diff = pBounds.w; - pBounds.w = pCursorPos.x + woff; - - if ( pBounds.w < pntMin.x ) { pBounds.w = pntMin.x; } - - diff -= pBounds.w; - m_HoldPos.x -= diff; - } - - if ( m_iResizeDir & Pos::Bottom ) - { - int hoff = pBounds.h - m_HoldPos.y; - int diff = pBounds.h; - pBounds.h = pCursorPos.y + hoff; - - if ( pBounds.h < pntMin.y ) { pBounds.h = pntMin.y; } - - diff -= pBounds.h; - m_HoldPos.y -= diff; - } - - m_pTarget->SetBounds( pBounds ); - onResize.Call( this ); -} - -void Resizer::SetResizeDir( int dir ) -{ - m_iResizeDir = dir; - - if ( ( dir & Pos::Left && dir & Pos::Top ) || ( dir & Pos::Right && dir & Pos::Bottom ) ) - { return SetCursor( Gwen::CursorType::SizeNWSE ); } - - if ( ( dir & Pos::Right && dir & Pos::Top ) || ( dir & Pos::Left && dir & Pos::Bottom ) ) - { return SetCursor( Gwen::CursorType::SizeNESW ); } - - if ( dir & Pos::Right || dir & Pos::Left ) - { return SetCursor( Gwen::CursorType::SizeWE ); } - - if ( dir & Pos::Top || dir & Pos::Bottom ) - { return SetCursor( Gwen::CursorType::SizeNS ); } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Resizer.h b/OpenSauce/shared/Include/GWEN/Controls/Resizer.h deleted file mode 100644 index 00a2af20a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Resizer.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RESIZER_H -#define GWEN_CONTROLS_RESIZER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Dragger.h" - - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT Resizer : public Dragger - { - public: - - GWEN_CONTROL( Resizer, Dragger ); - - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual void SetResizeDir( int dir ); - - Event::Caller onResize; - - protected: - - int m_iResizeDir; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RichLabel.cpp b/OpenSauce/shared/Include/GWEN/Controls/RichLabel.cpp deleted file mode 100644 index e7221438f..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RichLabel.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/RichLabel.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -const unsigned char Type_Text = 0; -const unsigned char Type_Newline = 1; - -GWEN_CONTROL_CONSTRUCTOR( RichLabel ) -{ - m_bNeedsRebuild = false; -} - -void RichLabel::AddLineBreak() -{ - DividedText t; - t.type = Type_Newline; - m_TextBlocks.push_back( t ); -} - -void RichLabel::AddText( const Gwen::TextObject & text, Gwen::Color color, Gwen::Font* font ) -{ - if ( text.length() == 0 ) { return; } - - Gwen::Utility::Strings::UnicodeList lst; - Gwen::Utility::Strings::Split( text.GetUnicode(), L"\n", lst, false ); - - for ( size_t i = 0; i < lst.size(); i++ ) - { - if ( i > 0 ) { AddLineBreak(); } - - DividedText t; - t.type = Type_Text; - t.text = lst[i]; - t.color = color; - t.font = font; - m_TextBlocks.push_back( t ); - m_bNeedsRebuild = true; - Invalidate(); - } -} - -bool RichLabel::SizeToChildren( bool w, bool h ) -{ - Rebuild(); - return BaseClass::SizeToChildren( w, h ); -} - -void RichLabel::SplitLabel( const Gwen::UnicodeString & text, Gwen::Font* pFont, const DividedText & txt, int & x, int & y, int & lineheight ) -{ - Gwen::Utility::Strings::UnicodeList lst; - Gwen::Utility::Strings::Split( text, L" ", lst, true ); - - if ( lst.size() == 0 ) { return; } - - int iSpaceLeft = Width() - x; - // Does the whole word fit in? - { - Gwen::Point StringSize = GetSkin()->GetRender()->MeasureText( pFont, text ); - - if ( iSpaceLeft > StringSize.x ) - { - return CreateLabel( text, txt, x, y, lineheight, true ); - } - } - // If the first word is bigger than the line, just give up. - { - Gwen::Point WordSize = GetSkin()->GetRender()->MeasureText( pFont, lst[0] ); - - if ( WordSize.x >= iSpaceLeft ) - { - CreateLabel( lst[0], txt, x, y, lineheight, true ); - - if ( lst[0].size() >= text.size() ) { return; } - - Gwen::UnicodeString LeftOver = text.substr( lst[0].size() + 1 ); - return SplitLabel( LeftOver, pFont, txt, x, y, lineheight ); - } - } - Gwen::UnicodeString strNewString = L""; - - for ( size_t i = 0; i < lst.size(); i++ ) - { - Gwen::Point WordSize = GetSkin()->GetRender()->MeasureText( pFont, strNewString + lst[i] ); - - if ( WordSize.x > iSpaceLeft ) - { - CreateLabel( strNewString, txt, x, y, lineheight, true ); - x = 0; - y += lineheight; - break;; - } - - strNewString += lst[i]; - } - - if ( strNewString.size() >= text.size() ) return; - Gwen::UnicodeString LeftOver = text.substr( strNewString.size() + 1 ); - return SplitLabel( LeftOver, pFont, txt, x, y, lineheight ); -} - -void RichLabel::CreateLabel( const Gwen::UnicodeString & text, const DividedText & txt, int & x, int & y, int & lineheight, bool NoSplit ) -{ - // - // Use default font or is one set? - // - Gwen::Font* pFont = GetSkin()->GetDefaultFont(); - - if ( txt.font ) { pFont = txt.font; } - - // - // This string is too long for us, split it up. - // - Gwen::Point p = GetSkin()->GetRender()->MeasureText( pFont, text ); - - if ( lineheight == -1 ) - { - lineheight = p.y; - } - - if ( !NoSplit ) - { - if ( x + p.x > Width() ) - { - return SplitLabel( text, pFont, txt, x, y, lineheight ); - } - } - - // - // Wrap - // - if ( x + p.x >= Width() ) - { - CreateNewline( x, y, lineheight ); - } - - Gwen::Controls::Label* pLabel = new Gwen::Controls::Label( this ); - pLabel->SetText( x == 0 ? Gwen::Utility::Strings::TrimLeft ( text, L" " ) : text ); - pLabel->SetTextColor( txt.color ); - pLabel->SetFont( pFont ); - pLabel->SizeToContents(); - pLabel->SetPos( x, y ); - //lineheight = (lineheight + pLabel->Height()) / 2; - x += pLabel->Width(); - - if ( x >= Width() ) - { - CreateNewline( x, y, lineheight ); - } -} - -void RichLabel::CreateNewline( int & x, int & y, int & lineheight ) -{ - x = 0; - y += lineheight; -} - -void RichLabel::Rebuild() -{ - RemoveAllChildren(); - int x = 0; - int y = 0; - int lineheight = -1; - - for ( DividedText::List::iterator it = m_TextBlocks.begin(); it != m_TextBlocks.end(); ++it ) - { - if ( it->type == Type_Newline ) - { - CreateNewline( x, y, lineheight ); - continue; - } - - if ( it->type == Type_Text ) - { - CreateLabel( ( *it ).text, *it, x, y, lineheight, false ); - continue; - } - } - - m_bNeedsRebuild = false; -} - -void RichLabel::OnBoundsChanged( Gwen::Rect oldBounds ) -{ - BaseClass::OnBoundsChanged( oldBounds ); - Rebuild(); -} - -void RichLabel::Layout( Gwen::Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - - if ( m_bNeedsRebuild ) - { - Rebuild(); - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/RichLabel.h b/OpenSauce/shared/Include/GWEN/Controls/RichLabel.h deleted file mode 100644 index 864b23dce..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/RichLabel.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_RICHLABEL_H -#define GWEN_CONTROLS_RICHLABEL_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Text.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT RichLabel : public Controls::Base - { - public: - - GWEN_CONTROL( RichLabel, Gwen::Controls::Base ); - - void AddLineBreak(); - void AddText( const Gwen::TextObject & text, Gwen::Color color, Gwen::Font* font = NULL ); - - virtual bool SizeToChildren( bool w = true, bool h = true ); - - protected: - - struct DividedText - { - typedef std::list List; - DividedText() - { - type = 0; - font = NULL; - } - - unsigned char type; - Gwen::UnicodeString text; - Gwen::Color color; - Gwen::Font* font; - }; - - void Layout( Gwen::Skin::Base* skin ); - void SplitLabel( const Gwen::UnicodeString & text, Gwen::Font* pFont, const DividedText & txt, int & x, int & y, int & lineheight ); - void CreateNewline( int & x, int & y, int & lineheight ); - void CreateLabel( const Gwen::UnicodeString & text, const DividedText & txt, int & x, int & y, int & lineheight, bool NoSplit ); - void Rebuild(); - - void OnBoundsChanged( Gwen::Rect oldBounds ); - - DividedText::List m_TextBlocks; - bool m_bNeedsRebuild; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.cpp deleted file mode 100644 index 76938b896..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/ScrollBarButton.h" -#include "Gwen/Controls/ScrollBarBar.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( BaseScrollBar ) -{ - for ( int i = 0; i < 2; i++ ) - { - m_ScrollButton[i] = new ScrollBarButton( this ); - } - - m_Bar = new ScrollBarBar( this ); - SetBounds( 0, 0, 15, 15 ); - m_bDepressed = false; - m_fScrolledAmount = 0; - m_fContentSize = 0; - m_fViewableContentSize = 0; - SetNudgeAmount( 20 ); -} - -void BaseScrollBar::Render( Skin::Base* skin ) -{ - skin->DrawScrollBar( this, IsHorizontal(), m_bDepressed ); -} - -void BaseScrollBar::OnBarMoved( Controls::Base* /*control*/ ) -{ - onBarMoved.Call( this ); -} - -void BaseScrollBar::BarMovedNotification() -{ - OnBarMoved( this ); -} - -void BaseScrollBar::SetContentSize( float size ) -{ - if ( m_fContentSize != size ) - { - Invalidate(); - } - - m_fContentSize = size; -} -void BaseScrollBar::SetViewableContentSize( float size ) -{ - if ( m_fViewableContentSize != size ) - { Invalidate(); } - - m_fViewableContentSize = size; -} - -bool BaseScrollBar::SetScrolledAmount( float amount, bool forceUpdate ) -{ - if ( m_fScrolledAmount == amount && !forceUpdate ) { return false; } - - m_fScrolledAmount = amount; - Invalidate(); - BarMovedNotification(); - return true; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.h b/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.h deleted file mode 100644 index c8c4a32f7..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBar.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SCROLLBAR_H -#define GWEN_CONTROLS_SCROLLBAR_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/ScrollBarBar.h" -#include "Gwen/Controls/ScrollBarButton.h" -#include "Gwen/Gwen.h" - - -#define SCROLL_BUTTON_UP 0 -#define SCROLL_BUTTON_LEFT 0 -#define SCROLL_BUTTON_DOWN 1 -#define SCROLL_BUTTON_RIGHT 1 -#define NUDGE_DIST 10 - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT BaseScrollBar : public Base - { - public: - - GWEN_CONTROL( BaseScrollBar, Base ); - - virtual void Render( Skin::Base* skin ); - - virtual void SetBarSize( int size ) = 0; - virtual int GetBarSize() = 0; - virtual int GetBarPos() = 0; - - virtual void OnBarMoved( Controls::Base* control ); - virtual void OnMouseClickLeft( int /*x*/, int /*y*/, bool /*bDown*/ ) {} - - virtual void ScrollToLeft() {} - virtual void ScrollToRight() {} - virtual void ScrollToTop() {} - virtual void ScrollToBottom() {} - - virtual float GetNudgeAmount() { return m_fNudgeAmount / m_fContentSize; } - virtual void SetNudgeAmount( float nudge ) { m_fNudgeAmount = nudge; } - - virtual void BarMovedNotification(); - - virtual float CalculateScrolledAmount() { return 0; } - virtual int CalculateBarSize() { return 0; } - virtual bool SetScrolledAmount( float amount, bool forceUpdate ); - - virtual void SetContentSize( float size ); - virtual void SetViewableContentSize( float size ); - - virtual int GetButtonSize() { return 0; } - virtual float GetScrolledAmount() { return m_fScrolledAmount; } - - virtual bool IsHorizontal() { return false; } - - Gwen::Event::Caller onBarMoved; - - protected: - - ControlsInternal::ScrollBarButton* m_ScrollButton[2]; - ControlsInternal::ScrollBarBar* m_Bar; - - bool m_bDepressed; - float m_fScrolledAmount; - float m_fContentSize; - float m_fViewableContentSize; - float m_fNudgeAmount; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.cpp deleted file mode 100644 index 6836542c2..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/ScrollBarBar.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -//Actual bar representing height of parent - -GWEN_CONTROL_CONSTRUCTOR( ScrollBarBar ) -{ - RestrictToParent( true ); - SetTarget( this ); -} - -void ScrollBarBar::Render( Skin::Base* skin ) -{ - skin->DrawScrollBarBar( this, m_bDepressed, IsHovered(), m_bHorizontal ); - BaseClass::Render( skin ); -} - -void ScrollBarBar::OnMouseMoved( int x, int y, int deltaX, int deltaY ) -{ - BaseClass::OnMouseMoved( x, y, deltaX, deltaY ); - - if ( !m_bDepressed ) - { return; } - - InvalidateParent(); -} - -void ScrollBarBar::OnMouseClickLeft( int x, int y, bool bDown ) -{ - BaseClass::OnMouseClickLeft( x, y, bDown ); - InvalidateParent(); -} - -void ScrollBarBar::Layout( Skin::Base* /*skin*/ ) -{ - if ( !GetParent() ) - { return; } - - //Move to our current position to force clamping - is this a hack? - MoveTo( X(), Y() ); -} - -void ScrollBarBar::MoveTo( int x, int y ) -{ - BaseClass::MoveTo( x, y ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.h b/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.h deleted file mode 100644 index a34535fa2..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarBar.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SCROLLBARBAR_H -#define GWEN_CONTROLS_SCROLLBARBAR_H - -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT ScrollBarBar : public ControlsInternal::Dragger - { - public: - - GWEN_CONTROL( ScrollBarBar, ControlsInternal::Dragger ); - - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - - virtual void MoveTo( int x, int y ); - - virtual void SetHorizontal() { m_bHorizontal = true; } - virtual void SetVertical() { m_bHorizontal = false; } - virtual bool IsVertical() { return !m_bHorizontal; } - virtual bool IsHorizontal() { return m_bHorizontal; } - virtual bool IsDepressed() { return m_bDepressed; } - - protected: - - bool m_bHorizontal; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.cpp b/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.cpp deleted file mode 100644 index 609437ee5..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/ScrollBarButton.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( ScrollBarButton ) -{ - SetDirectionUp(); -} - -void ScrollBarButton::SetDirectionUp() -{ - m_iDirection = Pos::Top; -} - -void ScrollBarButton::SetDirectionDown() -{ - m_iDirection = Pos::Bottom; -} - -void ScrollBarButton::SetDirectionLeft() -{ - m_iDirection = Pos::Left; -} - -void ScrollBarButton::SetDirectionRight() -{ - m_iDirection = Pos::Right; -} - -void ScrollBarButton::Render( Skin::Base* skin ) -{ - skin->DrawScrollButton( this, m_iDirection, m_bDepressed, IsHovered(), IsDisabled() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.h b/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.h deleted file mode 100644 index 2689e416d..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollBarButton.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SCROLLBARBOTTON_H -#define GWEN_CONTROLS_SCROLLBARBOTTON_H - -#include "Gwen/Controls/Button.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT ScrollBarButton : public Controls::Button - { - public: - - GWEN_CONTROL( ScrollBarButton, Controls::Button ); - - void Render( Skin::Base* skin ); - - void SetDirectionUp(); - void SetDirectionDown(); - void SetDirectionLeft(); - void SetDirectionRight(); - - protected: - - int m_iDirection; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.cpp deleted file mode 100644 index b82f991ba..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollControl.h" -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/VerticalScrollBar.h" -#include "Gwen/Controls/HorizontalScrollBar.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -GWEN_CONTROL_CONSTRUCTOR( ScrollControl ) -{ - SetMouseInputEnabled( false ); - m_VerticalScrollBar = new VerticalScrollBar( this ); - m_VerticalScrollBar->Dock( Pos::Right ); - m_VerticalScrollBar->onBarMoved.Add( this, &ScrollControl::VBarMoved ); - m_VerticalScrollBar->SetNudgeAmount( 30 ); - m_bCanScrollV = true; - m_HorizontalScrollBar = new HorizontalScrollBar( this ); - m_HorizontalScrollBar->Dock( Pos::Bottom ); - m_HorizontalScrollBar->onBarMoved.Add( this, &ScrollControl::HBarMoved ); - m_bCanScrollH = true; - m_HorizontalScrollBar->SetNudgeAmount( 30 ); - m_InnerPanel = new Base( this ); - m_InnerPanel->SetPos( 0, 0 ); - m_InnerPanel->SetMargin( Margin( 5, 5, 5, 5 ) ); - m_InnerPanel->SendToBack(); - m_InnerPanel->SetMouseInputEnabled( true ); - m_bAutoHideBars = true; -} - -void ScrollControl::SetScroll( bool h, bool v ) -{ - m_bCanScrollV = v; - m_bCanScrollH = h; - m_VerticalScrollBar->SetHidden( !m_bCanScrollV ); - m_HorizontalScrollBar->SetHidden( !m_bCanScrollH ); -} - -void ScrollControl::SetInnerSize( int w, int h ) -{ - m_InnerPanel->SetSize( w, h ); -} - -void ScrollControl::VBarMoved( Controls::Base* /*control*/ ) -{ - Invalidate(); -} - -void ScrollControl::HBarMoved( Controls::Base* /*control*/ ) -{ - Invalidate(); -} - -void ScrollControl::OnChildBoundsChanged( Gwen::Rect /*oldChildBounds*/, Base* /*pChild*/ ) -{ - UpdateScrollBars(); - Invalidate(); -} - -void ScrollControl::Layout( Skin::Base* skin ) -{ - UpdateScrollBars(); - BaseClass::Layout( skin ); -} - -bool ScrollControl::OnMouseWheeled( int iDelta ) -{ - if ( CanScrollV() && m_VerticalScrollBar->Visible() ) - { - if ( m_VerticalScrollBar->SetScrolledAmount( m_VerticalScrollBar->GetScrolledAmount() - m_VerticalScrollBar->GetNudgeAmount() * ( ( float ) iDelta / 60.0f ), true ) ) - { return true; } - } - - if ( CanScrollH() && m_HorizontalScrollBar->Visible() ) - { - if ( m_HorizontalScrollBar->SetScrolledAmount( m_HorizontalScrollBar->GetScrolledAmount() - m_HorizontalScrollBar->GetNudgeAmount() * ( ( float ) iDelta / 60.0f ), true ) ) - { return true; } - } - - return false; -} -void ScrollControl::Render( Skin::Base* skin ) -{ -#if 0 - // Debug render - this shouldn't render ANYTHING REALLY - it should be up to the parent! - Gwen::Rect rect = GetRenderBounds(); - Gwen::Renderer::Base* render = skin->GetRender(); - render->SetDrawColor( Gwen::Color( 255, 255, 0, 100 ) ); - render->DrawFilledRect( rect ); - render->SetDrawColor( Gwen::Color( 255, 0, 0, 100 ) ); - render->DrawFilledRect( m_InnerPanel->GetBounds() ); - render->RenderText( skin->GetDefaultFont(), Gwen::Point( 0, 0 ), Utility::Format( L"Offset: %i %i", m_InnerPanel->X(), m_InnerPanel->Y() ) ); -#else //0 - ( void ) skin; -#endif //0 -} - -bool ScrollControl::ContentsAreDocked() -{ - if ( !m_InnerPanel ) - { return false; } - - for ( Base::List::iterator iter = m_InnerPanel->Children.begin(); iter != m_InnerPanel->Children.end(); ++iter ) - { - Base* pChild = *iter; - - if ( pChild->GetDock() == Pos::None ) - { return false; } - } - - return true; -} - -void ScrollControl::UpdateScrollBars() -{ - if ( !m_InnerPanel ) - { return; } - - if ( ContentsAreDocked() ) - { - m_VerticalScrollBar->SetHidden( true ); - m_HorizontalScrollBar->SetHidden( true ); - m_InnerPanel->SetSize( GetSize() ); - m_InnerPanel->SetPos( 0, 0 ); - return; - } - - int childrenWidth = 0; - int childrenHeight = 0; - - //Get the max size of all our children together - for ( Base::List::iterator iter = m_InnerPanel->Children.begin(); iter != m_InnerPanel->Children.end(); ++iter ) - { - Base* pChild = *iter; - childrenWidth = Utility::Max( childrenWidth, pChild->Right() ); - childrenHeight = Utility::Max( childrenHeight, pChild->Bottom() ); - } - - if ( m_bCanScrollH ) - { - m_InnerPanel->SetSize( Utility::Max( Width(), childrenWidth ), Utility::Max( Height(), childrenHeight ) ); - } - else - { - m_InnerPanel->SetSize( Width() - ( m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width() - 1 ), Utility::Max( Height(), childrenHeight ) ); - } - - float wPercent = ( float ) Width() / ( float )( childrenWidth + ( m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width() ) ); - float hPercent = ( float ) Height() / ( float )( childrenHeight + ( m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height() ) ); - - if ( m_bCanScrollV ) - { SetVScrollRequired( hPercent >= 1 ); } - else - { m_VerticalScrollBar->SetHidden( true ); } - - if ( m_bCanScrollH ) - { SetHScrollRequired( wPercent >= 1 ); } - else - { m_HorizontalScrollBar->SetHidden( true ); } - - m_VerticalScrollBar->SetContentSize( m_InnerPanel->Height() ); - m_VerticalScrollBar->SetViewableContentSize( Height() - ( m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height() ) ); - m_HorizontalScrollBar->SetContentSize( m_InnerPanel->Width() ); - m_HorizontalScrollBar->SetViewableContentSize( Width() - ( m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width() ) ); - int newInnerPanelPosX = 0; - int newInnerPanelPosY = 0; - - if ( CanScrollV() && !m_VerticalScrollBar->Hidden() ) - { - newInnerPanelPosY = - ( ( m_InnerPanel->Height() ) - Height() + ( m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height() ) ) * m_VerticalScrollBar->GetScrolledAmount(); - } - - if ( CanScrollH() && !m_HorizontalScrollBar->Hidden() ) - { - newInnerPanelPosX = - ( ( m_InnerPanel->Width() ) - Width() + ( m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width() ) ) * m_HorizontalScrollBar->GetScrolledAmount(); - } - - m_InnerPanel->SetPos( newInnerPanelPosX , newInnerPanelPosY ); -} - -void ScrollControl::SetVScrollRequired( bool req ) -{ - if ( req ) - { - m_VerticalScrollBar->SetScrolledAmount( 0, true ); - m_VerticalScrollBar->SetDisabled( true ); - - if ( m_bAutoHideBars ) - { m_VerticalScrollBar->SetHidden( true ); } - else - { m_VerticalScrollBar->SetHidden( false ); } - } - else - { - m_VerticalScrollBar->SetHidden( false ); - m_VerticalScrollBar->SetDisabled( false ); - - if ( !m_bAutoHideBars ) - { m_VerticalScrollBar->SetHidden( false ); } - } -} - -void ScrollControl::SetHScrollRequired( bool req ) -{ - if ( req ) - { - m_HorizontalScrollBar->SetScrolledAmount( 0, true ); - m_HorizontalScrollBar->SetDisabled( true ); - - if ( m_bAutoHideBars ) - { m_HorizontalScrollBar->SetHidden( true ); } - else - { m_HorizontalScrollBar->SetHidden( false ); } - } - else - { - m_HorizontalScrollBar->SetHidden( false ); - m_HorizontalScrollBar->SetDisabled( true ); - - if ( !m_bAutoHideBars ) - { m_HorizontalScrollBar->SetHidden( false ); } - } -} - -void ScrollControl::ScrollToBottom() -{ - if ( !CanScrollV() ) { return; } - - UpdateScrollBars(); - m_VerticalScrollBar->ScrollToBottom(); -} -void ScrollControl::ScrollToTop() -{ - if ( CanScrollV() ) - { - UpdateScrollBars(); - m_VerticalScrollBar->ScrollToTop(); - } -} -void ScrollControl::ScrollToLeft() -{ - if ( CanScrollH() ) - { - UpdateScrollBars(); - m_HorizontalScrollBar->ScrollToLeft(); - } -} -void ScrollControl::ScrollToRight() -{ - if ( CanScrollH() ) - { - UpdateScrollBars(); - m_HorizontalScrollBar->ScrollToRight(); - } -} - -void ScrollControl::Clear() -{ - m_InnerPanel->RemoveAllChildren(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.h b/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.h deleted file mode 100644 index b38f5bd92..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ScrollControl.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SCROLLCONTROL_H -#define GWEN_CONTROLS_SCROLLCONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/VerticalScrollBar.h" -#include "Gwen/Controls/HorizontalScrollBar.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT ScrollControl : public Base - { - public: - - GWEN_CONTROL( ScrollControl, Base ); - - virtual void Layout( Skin::Base* skin ); - virtual void Render( Skin::Base* skin ); - - virtual void SetScroll( bool h, bool v ); - virtual void SetAutoHideBars( bool should ) { m_bAutoHideBars = should; } - virtual bool CanScrollH() { return m_bCanScrollH; } - virtual bool CanScrollV() { return m_bCanScrollV; } - virtual void OnChildBoundsChanged( Gwen::Rect oldChildBounds, Base* pChild ); - virtual void UpdateScrollBars(); - - virtual void SetVScrollRequired( bool req ); - virtual void SetHScrollRequired( bool req ); - - virtual void SetInnerSize( int w, int h ); - - virtual void VBarMoved( Controls::Base* control ); - virtual void HBarMoved( Controls::Base* control ); - - virtual bool OnMouseWheeled( int iDelta ); - - virtual void ScrollToBottom(); - virtual void ScrollToTop(); - virtual void ScrollToLeft(); - virtual void ScrollToRight(); - - virtual void Clear(); - - protected: - - virtual bool ContentsAreDocked(); - - bool m_bCanScrollH; - bool m_bCanScrollV; - - bool m_bAutoHideBars; - - Controls::BaseScrollBar* m_VerticalScrollBar; - Controls::BaseScrollBar* m_HorizontalScrollBar; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Slider.cpp b/OpenSauce/shared/Include/GWEN/Controls/Slider.cpp deleted file mode 100644 index a8589c148..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Slider.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include -#include "Gwen/Controls/Slider.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - -GWEN_CONTROL_CONSTRUCTOR( SliderBar ) -{ - SetTarget( this ); - RestrictToParent( true ); -} - -void SliderBar::Render( Skin::Base* skin ) -{ - skin->DrawSlideButton( this, IsDepressed(), IsHorizontal() ); -} - - -GWEN_CONTROL_CONSTRUCTOR( Slider ) -{ - SetBounds( Gwen::Rect( 0, 0, 32, 128 ) ); - m_SliderBar = new SliderBar( this ); - m_SliderBar->onDragged.Add( this, &Slider::OnMoved ); - m_fMin = 0.0f; - m_fMax = 1.0f; - m_bClampToNotches = false; - m_iNumNotches = 5; - m_fValue = 0.0f; - SetTabable( true ); -} - -void Slider::OnMoved( Controls::Base* /*control*/ ) -{ - SetValueInternal( CalculateValue() ); -} - -void Slider::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); -} - -float Slider::CalculateValue() -{ - return 0; -} - -void Slider::SetFloatValue( float val, bool /*forceUpdate*/ ) -{ - if ( val < m_fMin ) { val = m_fMin; } - - if ( val > m_fMax ) { val = m_fMax; } - - // Normalize Value - val = ( val - m_fMin ) / ( m_fMax - m_fMin ); - SetValueInternal( val ); - Redraw(); -} - -void Slider::SetValueInternal( float val ) -{ - if ( m_bClampToNotches ) - { - val = floorf( ( val * ( float ) m_iNumNotches ) + 0.5f ); - val /= ( float ) m_iNumNotches; - } - - if ( m_fValue != val ) - { - m_fValue = val; - onValueChanged.Call( this ); - } - - UpdateBarFromValue(); -} - -float Slider::GetFloatValue() -{ - return m_fMin + ( m_fValue * ( m_fMax - m_fMin ) ); -} - -void Slider::SetRange( float fMin, float fMax ) -{ - m_fMin = fMin; - m_fMax = fMax; -} - -void Slider::RenderFocus( Gwen::Skin::Base* skin ) -{ - if ( Gwen::KeyboardFocus != this ) { return; } - - if ( !IsTabable() ) { return; } - - skin->DrawKeyboardHighlight( this, GetRenderBounds(), 0 ); -} - -void Slider::OnBoundsChanged(Gwen::Rect oldBounds) -{ - BaseClass::OnBoundsChanged( oldBounds ); - UpdateBarFromValue(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Slider.h b/OpenSauce/shared/Include/GWEN/Controls/Slider.h deleted file mode 100644 index 289e0f9bb..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Slider.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SLIDER_H -#define GWEN_CONTROLS_SLIDER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT SliderBar : public ControlsInternal::Dragger - { - GWEN_CONTROL( SliderBar, ControlsInternal::Dragger ); - - virtual void Render( Skin::Base* skin ); - virtual void SetHorizontal( bool b ) { m_bHorizontal = b; } - virtual bool IsHorizontal() { return m_bHorizontal; } - - protected: - - bool m_bHorizontal; - }; - } - - namespace Controls - { - - class GWEN_EXPORT Slider : public Base - { - GWEN_CONTROL( Slider, Base ); - - virtual void Render( Skin::Base* skin ) = 0; - virtual void Layout( Skin::Base* skin ); - - virtual void SetClampToNotches( bool bClamp ) { m_bClampToNotches = bClamp; } - - virtual void SetNotchCount( int num ) { m_iNumNotches = num; } - virtual int GetNotchCount() { return m_iNumNotches; } - - virtual void SetRange( float fMin, float fMax ); - virtual float GetFloatValue(); - virtual void SetFloatValue( float val, bool forceUpdate = true ); - - virtual float CalculateValue(); - virtual void OnMoved( Controls::Base* control ); - - virtual void OnMouseClickLeft( int /*x*/, int /*y*/, bool /*bDown*/ ) {}; - - virtual bool OnKeyRight( bool bDown ) { if ( bDown ) { SetFloatValue( GetFloatValue() + 1, true ); } return true; } - virtual bool OnKeyLeft( bool bDown ) { if ( bDown ) { SetFloatValue( GetFloatValue() - 1, true ); } return true; } - virtual bool OnKeyUp( bool bDown ) { if ( bDown ) { SetFloatValue( GetFloatValue() + 1, true ); } return true; } - virtual bool OnKeyDown( bool bDown ) { if ( bDown ) { SetFloatValue( GetFloatValue() - 1, true ); } return true; } - - virtual void RenderFocus( Gwen::Skin::Base* skin ); - - Gwen::Event::Caller onValueChanged; - - virtual float GetMin() { return m_fMin; } - virtual float GetMax() { return m_fMax; } - - protected: - - virtual void SetValueInternal( float fVal ); - virtual void UpdateBarFromValue(){}; - - ControlsInternal::SliderBar* m_SliderBar; - void OnBoundsChanged( Gwen::Rect oldBounds ); - bool m_bClampToNotches; - int m_iNumNotches; - float m_fValue; - - float m_fMin; - float m_fMax; - - }; - } - - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.cpp deleted file mode 100644 index 28829c502..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/SplitterBar.h" - -using namespace Gwen; -using namespace Controls; - -GWEN_CONTROL_CONSTRUCTOR( SplitterBar ) -{ - SetTarget( this ); - RestrictToParent( true ); -} - -void SplitterBar::Layout( Skin::Base* /*skin*/ ) -{ - MoveTo( X(), Y() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.h b/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.h deleted file mode 100644 index 36822d309..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/SplitterBar.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SPLITTERBAR_H -#define GWEN_CONTROLS_SPLITTERBAR_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Dragger.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT SplitterBar : public ControlsInternal::Dragger - { - public: - - GWEN_CONTROL( SplitterBar, ControlsInternal::Dragger ); - - void Layout( Skin::Base* skin ); - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Splitters.h b/OpenSauce/shared/Include/GWEN/Controls/Splitters.h deleted file mode 100644 index cc5bf2f4e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Splitters.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_SPLITTERS_H -#define GWEN_CONTROLS_SPLITTERS_H - -#include "Gwen/Controls/Base.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT SplitterVertical : public Controls::Base - { - GWEN_CONTROL_INLINE( SplitterVertical, Controls::Base ) - { - m_Panels[0] = new Controls::Base( this ); - m_Panels[1] = new Controls::Base( this ); - m_pSplitter = new Controls::SplitterBar( this ); - m_SplitterSize = 6; - m_pSplitter->SetPos( 0, 100 ); - m_pSplitter->SetCursor( Gwen::CursorType::SizeNS ); - m_pSplitter->onDragged.Add( this, &ThisClass::OnSplitterMoved ); - SetScaling( false, 100 ); - } - - virtual void PostLayout( Skin::Base* skin ) - { - RefreshContainers(); - } - - void SetPanels( Controls::Base* pA, Controls::Base* pB ) - { - if ( pA ) { pA->SetParent( m_Panels[0] ); } - - if ( pB ) { pB->SetParent( m_Panels[1] ); } - } - - void SetScaling( bool Right, int iSize ) - { - m_RightSided = Right; - m_Size = iSize; - } - - virtual int SplitterPos() - { - return m_pSplitter->Y(); - } - - protected: - - virtual void RefreshContainers() - { - const Gwen::Rect & inner = GetInnerBounds(); - int iOffset = m_Size; - - if ( m_RightSided ) { iOffset = Height() - m_Size; } - - m_pSplitter->SetSize( inner.w, m_SplitterSize ); - m_pSplitter->SetPos( 0, iOffset ); - m_Panels[0]->SetPos( inner.x, inner.y ); - m_Panels[0]->SetSize( inner.w, iOffset ); - m_Panels[1]->SetPos( inner.x, ( iOffset + m_SplitterSize ) ); - m_Panels[1]->SetSize( inner.w, ( inner.y + inner.h ) - ( iOffset + m_SplitterSize ) ); - } - - virtual void OnSplitterMoved() - { - if ( m_RightSided ) - { m_Size = Height() - m_pSplitter->Y(); } - else - { m_Size = m_pSplitter->Y(); } - - RefreshContainers(); - Invalidate(); - } - - Controls::Base* m_Panels[2]; - bool m_RightSided; - int m_Size; - Controls::SplitterBar* m_pSplitter; - unsigned int m_SplitterSize; - }; - - class GWEN_EXPORT SplitterHorizontal : public SplitterVertical - { - GWEN_CONTROL_INLINE( SplitterHorizontal, SplitterVertical ) - { - m_pSplitter->SetCursor( Gwen::CursorType::SizeWE ); - m_pSplitter->SetPos( 100, 0 ); - } - - virtual void RefreshContainers() - { - const Gwen::Rect & inner = GetInnerBounds(); - int iOffset = m_Size; - - if ( m_RightSided ) { iOffset = Width() - m_Size; } - - m_pSplitter->SetSize( m_SplitterSize, inner.h ); - m_pSplitter->SetPos( iOffset, 0 ); - m_Panels[0]->SetPos( inner.x, inner.y ); - m_Panels[0]->SetSize( iOffset, inner.h ); - m_Panels[1]->SetPos( ( iOffset + m_SplitterSize ), inner.y ); - m_Panels[1]->SetSize( ( inner.x + inner.w ) - ( iOffset + m_SplitterSize ), inner.h ); - } - - virtual void OnSplitterMoved() - { - if ( m_RightSided ) - { m_Size = Width() - m_pSplitter->X(); } - else - { m_Size = m_pSplitter->X(); } - - RefreshContainers(); - Invalidate(); - } - - virtual int SplitterPos() - { - return m_pSplitter->X(); - } - }; - } -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/StatusBar.h b/OpenSauce/shared/Include/GWEN/Controls/StatusBar.h deleted file mode 100644 index 7453aca23..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/StatusBar.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_STATUSBAR_H -#define GWEN_CONTROLS_STATUSBAR_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Label.h" - -namespace Gwen -{ - namespace Controls - { - class StatusBar : public Controls::Label - { - public: - - GWEN_CONTROL_INLINE( StatusBar, Controls::Label ) - { - SetHeight( 22 ); - Dock( Pos::Bottom ); - SetPadding( Padding( 2, 2, 2, 2 ) ); - SetText( "" ); - SetAlignment( Pos::Left | Pos::CenterV ); - } - - virtual void AddControl( Controls::Base* pCtrl, bool bRight ) - { - pCtrl->SetParent( this ); - pCtrl->Dock( bRight ? Pos::Right : Pos::Left ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawStatusBar( this ); - } - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabButton.cpp b/OpenSauce/shared/Include/GWEN/Controls/TabButton.cpp deleted file mode 100644 index 42a2bdcd0..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabButton.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/TabButton.h" -#include "Gwen/Controls/TabControl.h" -#include "Gwen/Controls/Highlight.h" -#include "Gwen/DragAndDrop.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( TabButton ) -{ - m_Page = NULL; - m_Control = NULL; - DragAndDrop_SetPackage( true, "TabButtonMove" ); - SetAlignment( Pos::Top | Pos::Left ); - SetTextPadding( Padding( 2, 2, 2, 2 ) ); -} - -void TabButton::Layout( Skin::Base* skin ) -{ - int iParentDock = m_Control->GetTabStrip()->GetDock(); - - if ( iParentDock == Pos::Bottom ) - { SetPadding( Padding( 3, 1, 5, 4 ) ); } - else if ( iParentDock == Pos::Top ) - { SetPadding( Padding( 3, 3, 5, 2 ) ); } - else - { SetPadding( Padding( 3, 2, 5, 2 ) ); } - - BaseClass::Layout( skin ); -} - -void TabButton::Render( Skin::Base* skin ) -{ - skin->DrawTabButton( this, IsActive(), m_Control->GetTabStrip()->GetDock() ); -} - -void TabButton::SetTabControl( TabControl* ctrl ) -{ - if ( m_Control == ctrl ) { return; } - - if ( m_Control ) - { - m_Control->OnLoseTab( this ); - } - - m_Control = ctrl; -} - -bool TabButton::DragAndDrop_ShouldStartDrag() -{ - return m_Control->DoesAllowDrag(); -} - - -bool TabButton::OnKeyUp( bool bDown ) -{ - OnKeyLeft( bDown ); - return true; -} -bool TabButton::OnKeyDown( bool bDown ) -{ - OnKeyRight( bDown ); - return true; -} - -bool TabButton::OnKeyLeft( bool bDown ) -{ - if ( bDown ) - { - Base::List::reverse_iterator it = std::find( m_Parent->Children.rbegin(), m_Parent->Children.rend(), this ); - - if ( it != m_Parent->Children.rend() && ( ++it != m_Parent->Children.rend() ) ) - { - Base* pNextTab = *it; - GetTabControl()->OnTabPressed( pNextTab ); - Gwen::KeyboardFocus = pNextTab; - } - } - - return true; -} -bool TabButton::OnKeyRight( bool bDown ) -{ - if ( bDown ) - { - Base::List::iterator it = std::find( m_Parent->Children.begin(), m_Parent->Children.end(), this ); - - if ( it != m_Parent->Children.end() && ( ++it != m_Parent->Children.end() ) ) - { - Base* pNextTab = *it; - GetTabControl()->OnTabPressed( pNextTab ); - Gwen::KeyboardFocus = pNextTab; - } - } - - return true; -} - -void TabButton::UpdateColours() -{ - if ( !IsActive() ) - { - SetImageAlpha( 0.5 ); - - if ( IsDisabled() ) { return SetTextColor( GetSkin()->Colors.Tab.Inactive.Disabled ); } - - if ( IsDepressed() ) { return SetTextColor( GetSkin()->Colors.Tab.Inactive.Down ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Tab.Inactive.Hover ); } - - return SetTextColor( GetSkin()->Colors.Tab.Inactive.Normal ); - } - - SetImageAlpha( 1.0 ); - - if ( IsDisabled() ) { return SetTextColor( GetSkin()->Colors.Tab.Active.Disabled ); } - - if ( IsDepressed() ) { return SetTextColor( GetSkin()->Colors.Tab.Active.Down ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Tab.Active.Hover ); } - - SetTextColor( GetSkin()->Colors.Tab.Active.Normal ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabButton.h b/OpenSauce/shared/Include/GWEN/Controls/TabButton.h deleted file mode 100644 index c7ca38f58..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabButton.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TABBUTTON_H -#define GWEN_CONTROLS_TABBUTTON_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" - -namespace Gwen -{ - namespace Controls - { - class TabControl; - - class GWEN_EXPORT TabButton : public Button - { - public: - - GWEN_CONTROL( TabButton, Button ); - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - - void SetPage( Base* page ) { m_Page = page; } - Base* GetPage() { return m_Page; } - - void SetTabControl( TabControl* ctrl ); - TabControl* GetTabControl() { return m_Control; } - - bool IsActive() { return m_Page && m_Page->Visible(); } - - virtual bool DragAndDrop_ShouldStartDrag(); - virtual void DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) { SetHidden( true ); } - virtual void DragAndDrop_EndDragging( bool /*bSuccess*/, int /*x*/, int /*y*/ ) { SetHidden( false ); SetDepressed( false ); } - - virtual bool OnKeyLeft( bool bDown ); - virtual bool OnKeyRight( bool bDown ); - virtual bool OnKeyUp( bool bDown ); - virtual bool OnKeyDown( bool bDown ); - - virtual void UpdateColours(); - - virtual bool ShouldClip() { return false; } - - private: - - Base* m_Page; - TabControl* m_Control; - - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/TabControl.cpp deleted file mode 100644 index af4733a56..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabControl.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/TabControl.h" -#include "Gwen/Controls/Highlight.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Controls/WindowControl.h" -#include "Gwen/Controls/ScrollBarButton.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class TabControlInner : public Base -{ - public: - - GWEN_CONTROL_INLINE( TabControlInner, Base ) - { - } - - void Render( Skin::Base* skin ) - { - skin->DrawTabControl( this ); - } -}; - -GWEN_CONTROL_CONSTRUCTOR( TabControl ) -{ - m_iScrollOffset = 0; - m_pCurrentButton = NULL; - m_TabStrip = new TabStrip( this ); - m_TabStrip->SetTabPosition( Pos::Top ); - // Make this some special control? - m_pScroll[0] = new ControlsInternal::ScrollBarButton( this ); - m_pScroll[0]->SetDirectionLeft(); - m_pScroll[0]->onPress.Add( this, &TabControl::ScrollPressLeft ); - m_pScroll[0]->SetSize( 14, 14 ); - m_pScroll[1] = new ControlsInternal::ScrollBarButton( this ); - m_pScroll[1]->SetDirectionRight(); - m_pScroll[1]->onPress.Add( this, &TabControl::ScrollPressRight ); - m_pScroll[1]->SetSize( 14, 14 ); - m_InnerPanel = new TabControlInner( this ); - m_InnerPanel->Dock( Pos::Fill ); - m_InnerPanel->SendToBack(); - SetTabable( false ); -} - -TabButton* TabControl::AddPage( TextObject strText, Controls::Base* pPage ) -{ - if ( !pPage ) - { - pPage = new Base( this ); - } - else - { - pPage->SetParent( this ); - } - - TabButton* pButton = new TabButton( m_TabStrip ); - pButton->SetText( strText ); - pButton->SetPage( pPage ); - pButton->SetTabable( false ); - AddPage( pButton ); - return pButton; -} - -void TabControl::RemovePage( TabButton* pButton ) -{ - pButton->SetParent( GetCanvas() ); - OnLoseTab( pButton ); -} - -void TabControl::AddPage( TabButton* pButton ) -{ - Base* pPage = pButton->GetPage(); - pPage->SetParent( this ); - pPage->SetHidden( true ); - pPage->SetMargin( Margin( 6, 6, 6, 6 ) ); - pPage->Dock( Pos::Fill ); - pButton->SetParent( m_TabStrip ); - pButton->Dock( Pos::Left ); - pButton->SizeToContents(); - - if ( pButton->GetTabControl() ) { pButton->onPress.RemoveHandler( pButton->GetTabControl() ); } - - pButton->SetTabControl( this ); - pButton->onPress.Add( this, &TabControl::OnTabPressed ); - - if ( !m_pCurrentButton ) - { - pButton->OnPress(); - } - - onAddTab.Call( this ); - Invalidate(); -} - -void TabControl::OnTabPressed( Controls::Base* control ) -{ - TabButton* pButton = gwen_cast ( control ); - - if ( !pButton ) { return; } - - Base* pPage = pButton->GetPage(); - - if ( !pPage ) { return; } - - if ( m_pCurrentButton == pButton ) - { return; } - - if ( m_pCurrentButton ) - { - Base* pPage = m_pCurrentButton->GetPage(); - - if ( pPage ) - { - pPage->SetHidden( true ); - } - - m_pCurrentButton->Redraw(); - m_pCurrentButton = NULL; - } - - m_pCurrentButton = pButton; - pPage->SetHidden( false ); - m_TabStrip->Invalidate(); - Invalidate(); -} - -void TabControl::PostLayout( Skin::Base* skin ) -{ - BaseClass::PostLayout( skin ); - HandleOverflow(); -} - -void TabControl::OnLoseTab( TabButton* pButton ) -{ - if ( m_pCurrentButton == pButton ) - { m_pCurrentButton = NULL; } - - //TODO: Select a tab if any exist. - onLoseTab.Call( this ); - Invalidate(); -} - -int TabControl::TabCount( void ) -{ - return m_TabStrip->NumChildren(); -} - -TabButton* TabControl::GetTab( int iNum ) -{ - return gwen_cast ( m_TabStrip->GetChild( iNum ) ); -} - -void TabControl::SetTabStripPosition( int iDock ) -{ - m_TabStrip->SetTabPosition( iDock ); -} - -bool TabControl::DoesAllowDrag() -{ - return m_TabStrip->AllowsTabReorder(); -} - -void TabControl::HandleOverflow() -{ - Gwen::Point TabsSize = m_TabStrip->ChildrenSize(); - // Only enable the scrollers if the tabs are at the top. - // This is a limitation we should explore. - // Really TabControl should have derivitives for tabs placed elsewhere where we could specialize - // some functions like this for each direction. - bool bNeeded = TabsSize.x > Width() && m_TabStrip->GetDock() == Pos::Top; - m_pScroll[0]->SetHidden( !bNeeded ); - m_pScroll[1]->SetHidden( !bNeeded ); - - if ( !bNeeded ) { return; } - - m_iScrollOffset = Gwen::Clamp( m_iScrollOffset, 0, TabsSize.x - Width() + 32 ); -#if 0 - // - // This isn't frame rate independent. - // Could be better. Get rid of m_iScrollOffset and just use m_TabStrip->GetMargin().left ? - // Then get a margin animation type and do it properly! - // TODO! - // - m_TabStrip->SetMargin( Margin( Gwen::Approach( m_TabStrip->GetMargin().left, m_iScrollOffset * -1, 2 ), 0, 0, 0 ) ); - InvalidateParent(); -#else - m_TabStrip->SetMargin( Margin( m_iScrollOffset * -1, 0, 0, 0 ) ); -#endif - m_pScroll[0]->SetPos( Width() - 30 , 5 ); - m_pScroll[1]->SetPos( m_pScroll[0]->Right(), 5 ); -} - -void TabControl::ScrollPressLeft( Base* pFrom ) -{ - m_iScrollOffset -= 120; -} - -void TabControl::ScrollPressRight( Base* pFrom ) -{ - m_iScrollOffset += 120; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabControl.h b/OpenSauce/shared/Include/GWEN/Controls/TabControl.h deleted file mode 100644 index 1c804243c..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabControl.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TABCONTROL_H -#define GWEN_CONTROLS_TABCONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/TabButton.h" -#include "Gwen/Controls/TabStrip.h" -#include "Gwen/Controls/TabTitleBar.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class ScrollBarButton; - } - - namespace Controls - { - class GWEN_EXPORT TabControl : public Base - { - GWEN_CONTROL( TabControl, Base ); - - virtual TabButton* AddPage( const TextObject strText, Controls::Base* pPage = NULL ); - - virtual void AddPage( TabButton* pButton ); - virtual void RemovePage( TabButton* pButton ); - - virtual void OnTabPressed( Controls::Base* control ); - virtual void OnLoseTab( TabButton* pButton ); - - virtual int TabCount( void ); - virtual TabButton* GetTab( int iNum ); - virtual TabButton* GetCurrentButton() { return m_pCurrentButton; } - virtual TabStrip* GetTabStrip() { return m_TabStrip; } - - virtual void SetTabStripPosition( int iDock ); - - virtual bool DoesAllowDrag(); - - virtual void SetAllowReorder( bool b ) { GetTabStrip()->SetAllowReorder( b ); } - - Gwen::Event::Caller onLoseTab; - Gwen::Event::Caller onAddTab; - - private: - - virtual void PostLayout( Skin::Base* skin ); - void HandleOverflow(); - - void ScrollPressLeft( Base* pFrom ); - void ScrollPressRight( Base* pFrom ); - - TabStrip* m_TabStrip; - TabButton* m_pCurrentButton; - - ControlsInternal::ScrollBarButton* m_pScroll[2]; - int m_iScrollOffset; - - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabStrip.cpp b/OpenSauce/shared/Include/GWEN/Controls/TabStrip.cpp deleted file mode 100644 index aaf05d381..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabStrip.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/TabStrip.h" -#include "Gwen/Controls/TabControl.h" -#include "Gwen/Controls/Highlight.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - - -GWEN_CONTROL_CONSTRUCTOR( TabStrip ) -{ - m_TabDragControl = NULL; - m_bAllowReorder = false; -} - -bool TabStrip::DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* /*pPackage*/, int x, int y ) -{ - Gwen::Point LocalPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - TabButton* pButton = gwen_cast ( DragAndDrop::SourceControl ); - TabControl* pTabControl = gwen_cast ( GetParent() ); - - if ( pTabControl && pButton ) - { - if ( pButton->GetTabControl() != pTabControl ) - { - // We've moved tab controls! - pTabControl->AddPage( pButton ); - } - } - - Base* DroppedOn = GetControlAt( LocalPos.x, LocalPos.y ); - - if ( DroppedOn ) - { - Gwen::Point DropPos = DroppedOn->CanvasPosToLocal( Gwen::Point( x, y ) ); - DragAndDrop::SourceControl->BringNextToControl( DroppedOn, DropPos.x > DroppedOn->Width() / 2 ); - } - else - { - DragAndDrop::SourceControl->BringToFront(); - } - - return true; -} - -bool TabStrip::DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* pPackage ) -{ - if ( !m_bAllowReorder ) - { return false; } - - if ( pPackage->name == "TabButtonMove" ) - { return true; } - - return false; -} - -void TabStrip::Layout( Skin::Base* skin ) -{ - Gwen::Point pLargestTab( 5, 5 ); - int iNum = 0; - - for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter ) - { - TabButton* pButton = gwen_cast ( *iter ); - - if ( !pButton ) { continue; } - - pButton->SizeToContents(); - Margin m; - int iNotFirst = iNum > 0 ? -1 : 0; - - if ( m_iDock == Pos::Top ) - { - m.left = iNotFirst; - pButton->Dock( Pos::Left ); - } - - if ( m_iDock == Pos::Left ) - { - m.top = iNotFirst; - pButton->Dock( Pos::Top ); - } - - if ( m_iDock == Pos::Right ) - { - m.top = iNotFirst; - pButton->Dock( Pos::Top ); - } - - if ( m_iDock == Pos::Bottom ) - { - m.left = iNotFirst; - pButton->Dock( Pos::Left ); - } - - pLargestTab.x = Utility::Max( pLargestTab.x, pButton->Width() ); - pLargestTab.y = Utility::Max( pLargestTab.y, pButton->Height() ); - pButton->SetMargin( m ); - iNum++; - } - - if ( m_iDock == Pos::Top || m_iDock == Pos::Bottom ) - { SetSize( Width(), pLargestTab.y ); } - - if ( m_iDock == Pos::Left || m_iDock == Pos::Right ) - { SetSize( pLargestTab.x, Height() ); } - - BaseClass::Layout( skin ); -} - -void TabStrip::DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ) -{ - if ( m_TabDragControl ) - { - Debug::Msg( "ERROR! TabStrip::DragAndDrop_HoverEnter\n" ); - } - - m_TabDragControl = new ControlsInternal::Highlight( this ); - m_TabDragControl->SetMouseInputEnabled( false ); - m_TabDragControl->SetSize( 3, Height() ); -} - -void TabStrip::DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* /*pPackage*/ ) -{ - delete m_TabDragControl; - m_TabDragControl = NULL; -} - -void TabStrip::DragAndDrop_Hover( Gwen::DragAndDrop::Package* /*pPackage*/, int x, int y ) -{ - Gwen::Point LocalPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - Base* DroppedOn = GetControlAt( LocalPos.x, LocalPos.y ); - - if ( DroppedOn && DroppedOn != this ) - { - Gwen::Point DropPos = DroppedOn->CanvasPosToLocal( Gwen::Point( x, y ) ); - m_TabDragControl->SetBounds( Gwen::Rect( 0, 0, 3, Height() ) ); - m_TabDragControl->BringToFront(); - m_TabDragControl->SetPos( DroppedOn->X() - 1, 0 ); - - if ( DropPos.x > DroppedOn->Width() / 2 ) - { - m_TabDragControl->MoveBy( DroppedOn->Width() - 1, 0 ); - } - - m_TabDragControl->Dock( Pos::None ); - } - else - { - m_TabDragControl->Dock( Pos::Left ); - m_TabDragControl->BringToFront(); - } -} - -void TabStrip::SetTabPosition( int iPos ) -{ - Dock( iPos ); - - if ( m_iDock == Pos::Top ) - { - SetPadding( Padding( 5, 0, 0, 0 ) ); - } - - if ( m_iDock == Pos::Left ) - { - SetPadding( Padding( 0, 5, 0, 0 ) ); - } - - if ( m_iDock == Pos::Right ) - { - SetPadding( Padding( 0, 5, 0, 0 ) ); - } - - if ( m_iDock == Pos::Bottom ) - { - SetPadding( Padding( 5, 0, 0, 0 ) ); - } - - InvalidateChildren( true ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabStrip.h b/OpenSauce/shared/Include/GWEN/Controls/TabStrip.h deleted file mode 100644 index 5163ace6b..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabStrip.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TABSTRIP_H -#define GWEN_CONTROLS_TABSTRIP_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/TabButton.h" - -namespace Gwen -{ - namespace Controls - { - //class TabControl; - - class GWEN_EXPORT TabStrip : public Base - { - public: - - GWEN_CONTROL( TabStrip, Base ); - - virtual void Layout( Skin::Base* skin ); - - virtual bool DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual bool DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* pPackage ); - - virtual void DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - virtual void DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* pPackage ); - virtual void DragAndDrop_Hover( Gwen::DragAndDrop::Package* pPackage, int x, int y ); - - virtual void SetTabPosition( int iPos ); - - virtual void SetAllowReorder( bool b ) { m_bAllowReorder = b; } - virtual bool AllowsTabReorder() { return m_bAllowReorder; } - - virtual bool ShouldClip() { return false; } - - private: - - Base* m_TabDragControl; - bool m_bAllowReorder; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TabTitleBar.h b/OpenSauce/shared/Include/GWEN/Controls/TabTitleBar.h deleted file mode 100644 index 099f9a132..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TabTitleBar.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TABTITLEBAR_H -#define GWEN_CONTROLS_TABTITLEBAR_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/TabButton.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT TabTitleBar : public Label - { - public: - - GWEN_CONTROL_INLINE( TabTitleBar, Label ) - { - SetMouseInputEnabled( true ); - SetTextPadding( Gwen::Padding( 5, 2, 5, 2 ) ); - SetPadding( Gwen::Padding( 1, 2, 1, 2 ) ); - DragAndDrop_SetPackage( true, "TabWindowMove" ); - } - - void Render( Skin::Base* skin ) - { - skin->DrawTabTitleBar( this ); - } - - void DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* pPackage, int x, int y ) - { - DragAndDrop::SourceControl = GetParent(); - DragAndDrop::SourceControl->DragAndDrop_StartDragging( pPackage, x, y ); - } - - void UpdateFromTab( TabButton* pButton ) - { - SetText( pButton->GetText() ); - SizeToContents(); - } - - private: - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Text.cpp b/OpenSauce/shared/Include/GWEN/Controls/Text.cpp deleted file mode 100644 index d4acefd58..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Text.cpp +++ /dev/null @@ -1,482 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Text.h" -#include "Gwen/Skin.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::ControlsInternal; - -GWEN_CONTROL_CONSTRUCTOR( Text ) -{ - m_Font = NULL; - m_ColorOverride = Color( 255, 255, 255, 0 ); - m_Color = GetSkin()->Colors.Label.Default; - SetMouseInputEnabled( false ); - SetWrap( false ); - SetAlignment( Gwen::Pos::Left | Gwen::Pos::Top ); -} - -Text::~Text() -{ - // NOTE: This font doesn't need to be released - // Because it's a pointer to another font somewhere. -} - -void Text::Layout( Skin::Base* skin ) -{ - if ( m_bTextChanged ) - { - RefreshSize(); - m_bTextChanged = false; - } -} - -Gwen::Font* Text::GetFont() -{ - return m_Font; -} - -void Text::SetFont( Gwen::Font* pFont ) -{ - if ( m_Font == pFont ) { return; } - - m_Font = pFont; - m_bTextChanged = true; - // Change the font of multilines too! - { - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - - while ( it != itEnd ) - { - ( *it )->SetFont( m_Font ); - ++it; - } - } - Invalidate(); -} - -void Text::SetString( const TextObject & str ) -{ - if ( m_String == str ) { return; } - - m_String = str.GetUnicode(); - m_bTextChanged = true; - Invalidate(); -} - -void Text::Render( Skin::Base* skin ) -{ - if ( m_bWrap ) { return; } - - if ( Length() == 0 || !GetFont() ) { return; } - - if ( m_ColorOverride.a == 0 ) - { skin->GetRender()->SetDrawColor( m_Color ); } - else - { skin->GetRender()->SetDrawColor( m_ColorOverride ); } - - skin->GetRender()->RenderText( GetFont(), Gwen::Point( GetPadding().left, GetPadding().top ), m_String.GetUnicode() ); -} - -Gwen::Rect Text::GetCharacterPosition( int iChar ) -{ - if ( !m_Lines.empty() ) - { - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - int iChars = 0; - - Text* pLine; - while ( it != itEnd ) - { - pLine = *it; - ++it; - iChars += pLine->Length(); - - if ( iChars <= iChar ) { continue; } - - iChars -= pLine->Length(); - Gwen::Rect rect = pLine->GetCharacterPosition( iChar - iChars ); - rect.x += pLine->X(); - rect.y += pLine->Y(); - return rect; - } - //manage special case of the last character - Gwen::Rect rect = pLine->GetCharacterPosition( pLine->Length() ); - rect.x += pLine->X(); - rect.y += pLine->Y(); - return rect; - } - - if ( Length() == 0 || iChar == 0 ) - { - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), L" " ); - return Gwen::Rect( 0, 0, 0, p.y ); - } - - UnicodeString sub = m_String.GetUnicode().substr( 0, iChar ); - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), sub ); - return Rect( p.x, 0, 0, p.y ); -} - -Gwen::Rect Text::GetLineBox( int i ) -{ - Text* line = GetLine(i); - if(line != NULL) - { - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), line->m_String.GetUnicode()); - return Gwen::Rect(line->X(), line->Y(), Clamp(p.x, 1,p.x), Clamp(p.y, 1,p.y) ); - } - else - { - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), m_String.GetUnicode()); - return Gwen::Rect(0, 0, Clamp(p.x, 1,p.x), Clamp(p.y, 1,p.y) ); - } -} - -void Text::SetAlignment( int iAlign ) -{ - if ( m_iAlign == iAlign ) { return; } - - m_iAlign = iAlign; - Invalidate(); -} - -int Text::GetAlignment() -{ - return m_iAlign; -} - -int Text::GetClosestCharacter( Gwen::Point p ) -{ - if ( !m_Lines.empty() ) - { - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - int iChars = 0; - - Text* pLine; - while ( it != itEnd ) - { - pLine = *it; - ++it; - iChars += pLine->Length(); - - if ( p.y < pLine->Y() ) { continue; } - - if ( p.y > pLine->Bottom() ) { continue; } - - if ( p.y < pLine->Bottom()) break; - } - iChars -= pLine->Length(); - int iLinePos = pLine->GetClosestCharacter( Gwen::Point( p.x - pLine->X(), p.y - pLine->Y() ) ); - return iChars + iLinePos; - } - - int iDistance = 4096; - int iChar = 0; - - for ( size_t i = 0; i < m_String.GetUnicode().length() + 1; i++ ) - { - Gwen::Rect cp = GetCharacterPosition( i ); - int iDist = abs( cp.x - p.x ) + abs( cp.y - p.y ); // this isn't proper - - if ( iDist > iDistance ) { continue; } - - iDistance = iDist; - iChar = i; - } - - return iChar; -} - -void Text::OnScaleChanged() -{ - Invalidate(); -} - -void Text::RefreshSize() -{ - if ( m_bWrap ) - { - return RefreshSizeWrap(); - } - - if ( !GetFont() ) - { - Debug::AssertCheck( 0, "Text::RefreshSize() - No Font!!\n" ); - return; - } - - Gwen::Point p( 1, GetFont()->size ); - - if ( Length() > 0 ) - { - p = GetSkin()->GetRender()->MeasureText( GetFont(), m_String.GetUnicode() ); - } - - p.x += GetPadding().left + GetPadding().right; - p.y += GetPadding().top + GetPadding().bottom; - - if ( p.x == Width() && p.y == Height() ) - { return; } - - if ( p.y < GetFont()->size ) { p.y = GetFont()->size; } - - SetSize( p.x, p.y ); - InvalidateParent(); - Invalidate(); -} - -void Text::SplitWords(const Gwen::UnicodeString &s, std::vector & elems ) -{ - Gwen::UnicodeString str; - - int w = GetParent()->Width() - GetParent()->GetPadding().left-GetParent()->GetPadding().right; - for ( int i=0; i<(int)s.length(); i++ ) - { - if ( s[i] == L'\n' ) - { - if ( !str.empty() ) { elems.push_back( str ); } - - elems.push_back( L"\n" ); - str.clear(); - continue; - } - - if ( s[i] == L' ' ) - { - str += s[i]; - elems.push_back( str ); - str.clear(); - continue; - } - - str += s[i]; - - //if adding character makes the word bigger than the textbox size - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), str ); - if ( p.x > w ) - { - int addSum = GetPadding().left+GetPadding().right; - //split words - str.pop_back(); - elems.push_back( str ); - str.clear(); - --i; - continue; - } - } - - if ( !str.empty() ) { elems.push_back( str ); } -} - -void Text::RefreshSizeWrap() -{ - RemoveAllChildren(); - - for ( TextLines::iterator it = m_Lines.begin(); it != m_Lines.end(); ++it ) - { - delete *it; - } - - m_Lines.clear(); - std::vector words; - SplitWords( GetText().GetUnicode(), words ); - // Adding a bullshit word to the end simplifies the code below - // which is anything but simple. - words.push_back( L"" ); - - if ( !GetFont() ) - { - Debug::AssertCheck( 0, "Text::RefreshSize() - No Font!!\n" ); - return; - } - - Point pFontSize = GetSkin()->GetRender()->MeasureText( GetFont(), L" " ); - int w = GetParent()->Width() - GetParent()->GetPadding().left-GetParent()->GetPadding().right; - int x = 0, y = 0; - Gwen::UnicodeString strLine; - - for ( std::vector::iterator it = words.begin(); it != words.end(); ++it ) - { - bool bFinishLine = false; - bool bWrapped = false; - - // If this word is a newline - make a newline (we still add it to the text) - if ( ( *it ).c_str() [0] == L'\n' ) { bFinishLine = true; } - - // Does adding this word drive us over the width? - { - strLine += ( *it ); - Gwen::Point p = GetSkin()->GetRender()->MeasureText( GetFont(), strLine ); - - if ( p.x > w ) { bFinishLine = true; bWrapped = true; } - } - - // If this is the last word then finish the line - if ( --words.end() == it ) - { - bFinishLine = true; - } - - if ( bFinishLine ) - { - Text* t = new Text( this ); - t->SetFont( GetFont() ); - t->SetTextColor( m_Color ); - if(bWrapped) - { - t->SetString( strLine.substr( 0, strLine.length() - (*it).length() ) ); - // newline should start with the word that was too big - strLine = *it; - } - else - { - t->SetString( strLine.substr( 0, strLine.length()) ); - //new line is empty - strLine.clear(); - } - t->RefreshSize(); - t->SetPos( x, y ); - m_Lines.push_back( t ); - - // newline should start with the word that was too big - // strLine = *it; - - // Position the newline - y += pFontSize.y; - x = 0; - //if ( strLine[0] == L' ' ) x -= pFontSize.x; - } - } - - // Size to children height and parent width - Point childsize = ChildrenSize(); - { - SetSize( w, childsize.y ); - } - - // Align the text within the parent - int y_offset = 0; - for ( TextLines::iterator it = m_Lines.begin(); it != m_Lines.end(); ++it ) - { - Text* text = *it; - const Rect & bounds = GetInnerBounds(); - - int x = 0; - int y = 0; - - if ( m_iAlign & Pos::Left ) { x = bounds.x; } - if ( m_iAlign & Pos::Right ) { x = bounds.x + ( bounds.w - text->Width() ); } - if ( m_iAlign & Pos::CenterH ) { x = bounds.x + ( bounds.w - text->Width() ) * 0.5; } - if ( m_iAlign & Pos::Top ) { y = bounds.y; } - if ( m_iAlign & Pos::Bottom ) { y = bounds.y + ( bounds.h - childsize.y ); } - if ( m_iAlign & Pos::CenterV ) { y = bounds.y + ( bounds.h - childsize.y ) * 0.5; } - - text->SetPos( x, y + y_offset ); - - y_offset += text->Height(); - } - - InvalidateParent(); - Invalidate(); -} - -int Text::NumLines() -{ - return m_Lines.size(); -} - -Text* Text::GetLine( int i ) -{ - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - - while ( it != itEnd ) - { - if ( i == 0 ) { return *it; } - - ++it; - i--; - } - - return NULL; -} - -int Text::GetLineFromChar( int i ) -{ - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - int iChars = 0; - int iLine = 0; - - while ( it != itEnd ) - { - Text* pLine = *it; - ++it; - iChars += pLine->Length(); - - if ( iChars > i ) { return iLine; } - - iLine++; - } - - if(iLine>0) return iLine-1; - return iLine; -} - -int Text::GetStartCharFromLine( int i ) -{ - TextLines::iterator it = m_Lines.begin(); - TextLines::iterator itEnd = m_Lines.end(); - int iChars = 0; - - while ( it != itEnd ) - { - Text* pLine = *it; - ++it; - - if ( i == 0 ) { return Gwen::Clamp( iChars, 0, Length() ); } - - iChars += pLine->Length(); - i--; - } - - return Gwen::Clamp( iChars, 0, Length() ); -} - -int Text::GetEndCharFromLine( int i ) -{ - int iStart = GetStartCharFromLine( i ); - Text* iLine = GetLine( i ); - - if ( iLine ) - { - iStart += iLine->Length(); - } - - return Gwen::Clamp( iStart, 0, Length() ); -} - -int Text::GetCharPosOnLine( int i ) -{ - int iLine = GetLineFromChar( i ); - Text* line = GetLine( iLine ); - - if ( !line ) { return 0; } - - int iStart = GetStartCharFromLine( iLine ); - return i - iStart; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/Text.h b/OpenSauce/shared/Include/GWEN/Controls/Text.h deleted file mode 100644 index 40da709ca..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/Text.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TEXT_H -#define GWEN_CONTROLS_TEXT_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" - -namespace Gwen -{ - namespace ControlsInternal - { - class GWEN_EXPORT Text : public Controls::Base - { - public: - - GWEN_CONTROL( Text, Controls::Base ); - - virtual ~Text(); - Gwen::Font* GetFont(); - - void SetString( const TextObject & str ); - - void Render( Skin::Base* skin ); - void Layout( Skin::Base* skin ); - - void RefreshSize(); - - void SetFont( Gwen::Font* pFont ); - - const TextObject & GetText() const { return m_String; } - - Gwen::Rect GetCharacterPosition( int iChar ); - int GetClosestCharacter( Gwen::Point p ); - - virtual void SetAlignment( int iAlign ); - virtual int GetAlignment(); - - /// return the encapsulating box of the given line - // @remark this function is necessary to implement multiline selection - virtual Gwen::Rect GetLineBox( int i ); - - int Length() const { return ( int ) m_String.GetUnicode().size(); } - - virtual void SetTextColor( const Gwen::Color & col ) { m_Color = col; } - virtual void SetTextColorOverride( const Gwen::Color & col ) { m_ColorOverride = col; } - - virtual void OnScaleChanged(); - - inline const Gwen::Color & TextColor() const { return m_Color; } - - virtual void TextChanged() { m_bTextChanged = true; } - virtual bool Wrap() { return m_bWrap; } - virtual void SetWrap( bool b ) { if ( m_bWrap == b ) { return; } m_bWrap = b; m_bTextChanged = true; Invalidate(); } - - virtual Text* GetLine( int i ); - virtual int GetLineFromChar( int i ); - virtual int GetStartCharFromLine( int i ); - virtual int GetEndCharFromLine( int i ); - virtual int GetCharPosOnLine( int i ); - virtual int NumLines(); - - - protected: - - virtual void SplitWords(const Gwen::UnicodeString &s, std::vector &elems); - - private: - - virtual void RefreshSizeWrap(); - - Gwen::TextObject m_String; - Gwen::Font* m_Font; - Gwen::Color m_Color; - Gwen::Color m_ColorOverride; - - bool m_bWrap; - bool m_bTextChanged; - int m_iAlign; - - typedef std::list TextLines; - TextLines m_Lines; - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TextBox.cpp b/OpenSauce/shared/Include/GWEN/Controls/TextBox.cpp deleted file mode 100644 index 72f06ba1a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TextBox.cpp +++ /dev/null @@ -1,751 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Skin.h" -#include "Gwen/Anim.h" -#include "Gwen/Utility.h" -#include "Gwen/Platform.h" - -#include - -using namespace Gwen; -using namespace Gwen::Controls; - -#ifndef GWEN_NO_ANIMATION -class ChangeCaretColor : public Gwen::Anim::Animation -{ - public: - - virtual void Think() - { - gwen_cast ( m_Control )->UpdateCaretColor(); - } -}; -#endif - - -GWEN_CONTROL_CONSTRUCTOR( TextBox ) -{ - SetSize( 200, 20 ); - SetMouseInputEnabled( true ); - SetKeyboardInputEnabled( true ); - SetAlignment( Pos::Left | Pos::CenterV ); - SetPadding( Padding( 4, 2, 4, 2 ) ); - m_iCursorPos = 0; - m_iCursorEnd = 0; - m_iCursorLine = 0; - m_bEditable = true; - m_bSelectAll = false; - SetTextColor( Gwen::Color( 50, 50, 50, 255 ) ); // TODO: From Skin - SetTabable( true ); - AddAccelerator( L"Ctrl + C", &TextBox::OnCopy ); - AddAccelerator( L"Ctrl + X", &TextBox::OnCut ); - AddAccelerator( L"Ctrl + V", &TextBox::OnPaste ); - AddAccelerator( L"Ctrl + A", &TextBox::OnSelectAll ); - Gwen::Anim::Add( this, new ChangeCaretColor() ); -} - -bool TextBox::OnChar( Gwen::UnicodeChar c ) -{ - if ( c == '\t' ) { return false; } - - Gwen::UnicodeString str; - str += c; - InsertText( str ); - return true; -} - -void TextBox::InsertText( const Gwen::UnicodeString & strInsert ) -{ - if ( !m_bEditable ) return; - - // TODO: Make sure fits (implement maxlength) - if ( HasSelection() ) - { - EraseSelection(); - } - - if ( m_iCursorPos > TextLength() ) { m_iCursorPos = TextLength(); } - - if ( !IsTextAllowed( strInsert, m_iCursorPos ) ) - { return; } - - UnicodeString str = GetText().GetUnicode(); - str.insert( m_iCursorPos, strInsert ); - SetText( str ); - m_iCursorPos += ( int ) strInsert.size(); - m_iCursorEnd = m_iCursorPos; - m_iCursorLine = 0; - RefreshCursorBounds(); -} - -#ifndef GWEN_NO_ANIMATION -void TextBox::UpdateCaretColor() -{ - if ( m_fNextCaretColorChange > Gwen::Platform::GetTimeInSeconds() ) { return; } - - if ( !HasFocus() ) { m_fNextCaretColorChange = Gwen::Platform::GetTimeInSeconds() + 0.5f; return; } - - Gwen::Color targetcolor = Gwen::Color( 230, 230, 230, 255 ); - - if ( m_CaretColor == targetcolor ) - { targetcolor = Gwen::Color( 20, 20, 20, 255 ); } - - m_fNextCaretColorChange = Gwen::Platform::GetTimeInSeconds() + 0.5; - m_CaretColor = targetcolor; - Redraw(); -} -#endif - -void TextBox::Render( Skin::Base* skin ) -{ - if ( ShouldDrawBackground() ) - { skin->DrawTextBox( this ); } - - if ( !HasFocus() ) { return; } - - // Draw selection.. if selected.. - if ( m_iCursorPos != m_iCursorEnd ) - { - skin->GetRender()->SetDrawColor( Gwen::Color( 50, 170, 255, 200 ) ); - skin->GetRender()->DrawFilledRect( m_rectSelectionBounds ); - } - - // Draw caret - skin->GetRender()->SetDrawColor( m_CaretColor ); - skin->GetRender()->DrawFilledRect( m_rectCaretBounds ); -} - -void TextBox::RefreshCursorBounds() -{ - m_fNextCaretColorChange = Gwen::Platform::GetTimeInSeconds() + 1.5f; - m_CaretColor = Gwen::Color( 30, 30, 30, 255 ); - MakeCaratVisible(); - Gwen::Rect pA = GetCharacterPosition( m_iCursorPos ); - Gwen::Rect pB = GetCharacterPosition( m_iCursorEnd ); - m_rectSelectionBounds.x = Utility::Min( pA.x, pB.x ); - m_rectSelectionBounds.y = m_Text->Y() - 1; - m_rectSelectionBounds.w = Utility::Max( pA.x, pB.x ) - m_rectSelectionBounds.x; - m_rectSelectionBounds.h = m_Text->Height() + 2; - m_rectCaretBounds.x = pA.x; - m_rectCaretBounds.y = pA.y; - m_rectCaretBounds.w = 1; - m_rectCaretBounds.h = pA.h; - Redraw(); -} - - -void TextBox::OnPaste( Gwen::Controls::Base* /*pCtrl*/ ) -{ - InsertText( Platform::GetClipboardText() ); -} - -void TextBox::OnCopy( Gwen::Controls::Base* /*pCtrl*/ ) -{ - if ( !HasSelection() ) { return; } - - Platform::SetClipboardText( GetSelection() ); -} - -void TextBox::OnCut( Gwen::Controls::Base* /*pCtrl*/ ) -{ - if ( !HasSelection() ) { return; } - - Platform::SetClipboardText( GetSelection() ); - EraseSelection(); -} - -void TextBox::OnSelectAll( Gwen::Controls::Base* /*pCtrl*/ ) -{ - m_iCursorEnd = 0; - m_iCursorPos = TextLength(); - m_iCursorLine = 0; - RefreshCursorBounds(); -} - -void TextBox::OnMouseDoubleClickLeft( int /*x*/, int /*y*/ ) -{ - OnSelectAll( this ); -} - -UnicodeString TextBox::GetSelection() -{ - if ( !HasSelection() ) { return L""; } - - int iStart = Utility::Min( m_iCursorPos, m_iCursorEnd ); - int iEnd = Utility::Max( m_iCursorPos, m_iCursorEnd ); - const UnicodeString & str = GetText().GetUnicode(); - return str.substr( iStart, iEnd - iStart ); -} - -bool TextBox::OnKeyReturn( bool bDown ) -{ - if ( bDown ) { return true; } - - // Try to move to the next control, as if tab had been pressed - OnKeyTab( true ); - - // If we still have focus, blur it. - if ( HasFocus() ) - { - Blur(); - } - - // This is called AFTER the blurring so you can - // refocus in your onReturnPressed hook. - OnEnter(); - return true; -} - -bool TextBox::OnKeyBackspace( bool bDown ) -{ - if ( !bDown ) { return true; } - - if ( HasSelection() ) - { - EraseSelection(); - return true; - } - - if ( m_iCursorPos == 0 ) { return true; } - - DeleteText( m_iCursorPos - 1, 1 ); - return true; -} - -bool TextBox::OnKeyDelete( bool bDown ) -{ - if ( !bDown ) { return true; } - - if ( HasSelection() ) - { - EraseSelection(); - return true; - } - - if ( m_iCursorPos >= TextLength() ) { return true; } - - DeleteText( m_iCursorPos, 1 ); - return true; -} - -bool TextBox::OnKeyLeft( bool bDown ) -{ - if ( !bDown ) { return true; } - - if ( m_iCursorPos > 0 ) - { m_iCursorPos--; } - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBox::OnKeyRight( bool bDown ) -{ - if ( !bDown ) { return true; } - - if ( m_iCursorPos < TextLength() ) - { m_iCursorPos++; } - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBox::OnKeyHome( bool bDown ) -{ - if ( !bDown ) { return true; } - - m_iCursorPos = 0; - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBox::OnKeyEnd( bool /*bDown*/ ) -{ - m_iCursorPos = TextLength(); - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -void TextBox::SetCursorPos( int i ) -{ - if ( m_iCursorPos == i ) { return; } - - m_iCursorPos = i; - m_iCursorLine = 0; - RefreshCursorBounds(); -} - -void TextBox::SetCursorEnd( int i ) -{ - if ( m_iCursorEnd == i ) { return; } - - m_iCursorEnd = i; - RefreshCursorBounds(); -} - - -void TextBox::DeleteText( int iStartPos, int iLength ) -{ - if ( !m_bEditable ) return; - - UnicodeString str = GetText().GetUnicode(); - str.erase( iStartPos, iLength ); - SetText( str ); - - if ( m_iCursorPos > iStartPos ) - { - SetCursorPos( m_iCursorPos - iLength ); - } - - SetCursorEnd( m_iCursorPos ); -} - -bool TextBox::HasSelection() -{ - return m_iCursorPos != m_iCursorEnd; -} - -void TextBox::EraseSelection() -{ - int iStart = Utility::Min( m_iCursorPos, m_iCursorEnd ); - int iEnd = Utility::Max( m_iCursorPos, m_iCursorEnd ); - DeleteText( iStart, iEnd - iStart ); - // Move the cursor to the start of the selection, - // since the end is probably outside of the string now. - m_iCursorPos = iStart; - m_iCursorEnd = iStart; -} - -void TextBox::OnMouseClickLeft( int x, int y, bool bDown ) -{ - if ( m_bSelectAll ) - { - OnSelectAll( this ); - m_bSelectAll = false; - return; - } - - int iChar = m_Text->GetClosestCharacter( m_Text->CanvasPosToLocal( Gwen::Point( x, y ) ) ); - - if ( bDown ) - { - SetCursorPos( iChar ); - - if ( !Gwen::Input::IsShiftDown() ) - { SetCursorEnd( iChar ); } - - Gwen::MouseFocus = this; - } - else - { - if ( Gwen::MouseFocus == this ) - { - SetCursorPos( iChar ); - Gwen::MouseFocus = NULL; - } - } -} - -void TextBox::OnMouseMoved( int x, int y, int /*deltaX*/, int /*deltaY*/ ) -{ - if ( Gwen::MouseFocus != this ) { return; } - - int iChar = m_Text->GetClosestCharacter( m_Text->CanvasPosToLocal( Gwen::Point( x, y ) ) ); - SetCursorPos( iChar ); -} - -void TextBox::MakeCaratVisible() -{ - if ( m_Text->Width() < Width() ) - { - m_Text->Position( m_iAlign ); - } - else - { - int iCaratPos = m_Text->GetCharacterPosition( m_iCursorPos ).x; - int iRealCaratPos = iCaratPos + m_Text->X(); - int iSlidingZone = m_Text->GetFont()->size + 1; //Width()*0.1f - - // If the carat is already in a semi-good position, leave it. - if ( iRealCaratPos >= iSlidingZone && iRealCaratPos <= Width() - iSlidingZone ) - { return; } - - int x = 0; - - if ( iRealCaratPos > Width() - iSlidingZone ) - { - x = Width() - iCaratPos - iSlidingZone; - } - - if ( iRealCaratPos < iSlidingZone ) - { - x = -iCaratPos + iSlidingZone; - } - - // Don't show too much whitespace to the right - if ( x + m_Text->Width() < Width() - GetPadding().right ) - { x = -m_Text->Width() + ( Width() - GetPadding().right ); } - - // Or the left - if ( x > GetPadding().left ) - { x = GetPadding().left; } - - int y = 0; - - if ( m_iAlign & Pos::Top ) { y = GetPadding().top; } - - if ( m_iAlign & Pos::Bottom ) { y = Height() - m_Text->Height() - GetPadding().bottom ; } - - if ( m_iAlign & Pos::CenterV ) { y = ( Height() - m_Text->Height() ) * 0.5; } - - m_Text->SetPos( x, y ); - } -} - -void TextBox::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - RefreshCursorBounds(); -} - -void TextBox::PostLayout( Skin::Base* skin ) -{ -} - -void TextBox::OnTextChanged() -{ - if ( m_iCursorPos > TextLength() ) { m_iCursorPos = TextLength(); } - - if ( m_iCursorEnd > TextLength() ) { m_iCursorEnd = TextLength(); } - - onTextChanged.Call( this ); -} - -void TextBox::OnEnter() -{ - onReturnPressed.Call( this ); -} - -void TextBox::MoveCaretToEnd() -{ - m_iCursorPos = TextLength(); - m_iCursorEnd = TextLength(); - RefreshCursorBounds(); -} - -void TextBox::MoveCaretToStart() -{ - m_iCursorPos = 0; - m_iCursorEnd = 0; - RefreshCursorBounds(); -} - - -GWEN_CONTROL_CONSTRUCTOR( TextBoxMultiline ) -{ - SetWrap( true ); - SetAlignment( Pos::Left | Pos::Top ); -} - -bool TextBoxMultiline::OnKeyReturn( bool bDown ) -{ - if ( bDown ) - { - InsertText( L"\n" ); - } - - return true; -} - -void TextBoxMultiline::Render( Skin::Base* skin ) -{ - if ( ShouldDrawBackground() ) skin->DrawTextBox( this ); - - if ( !HasFocus() ) return; - - if ( m_iCursorPos != m_iCursorEnd ) - { - int iCursorStartLine = m_Text->GetLineFromChar( m_iCursorPos ); - int iCursorEndLine = m_Text->GetLineFromChar( m_iCursorEnd ); - - if ( iCursorStartLine > m_Text->NumLines()-1 ) iCursorStartLine = m_Text->NumLines()-1; - if ( iCursorEndLine > m_Text->NumLines()-1 ) iCursorEndLine = m_Text->NumLines()-1; - - int iSelectionStartLine = (m_iCursorPos < m_iCursorEnd) ? iCursorStartLine : iCursorEndLine; - int iSelectionEndLine = (m_iCursorPos < m_iCursorEnd) ? iCursorEndLine : iCursorStartLine; - - int iSelectionStartPos = (m_iCursorPos < m_iCursorEnd) ? m_iCursorPos : m_iCursorEnd; - int iSelectionEndPos = (m_iCursorPos < m_iCursorEnd) ? m_iCursorEnd : m_iCursorPos; - - int iFirstChar = 0; - int iLastChar = 0; - skin->GetRender()->SetDrawColor( Gwen::Color( 50, 170, 255, 200 ) ); - m_rectSelectionBounds.h = m_Text->GetFont()->size + 2; - - for(int iLine = iSelectionStartLine; iLine <= iSelectionEndLine; ++iLine) - { - ControlsInternal::Text* line = m_Text->GetLine(iLine); - Gwen::Rect box = m_Text->GetLineBox(iLine); - box.x+=m_Text->X(); - box.y+=m_Text->Y(); - - if (iLine == iSelectionStartLine) - { - Gwen::Rect pos = GetCharacterPosition( iSelectionStartPos ); - m_rectSelectionBounds.x = pos.x; - m_rectSelectionBounds.y = pos.y - 1; - } - else - { - m_rectSelectionBounds.x = box.x; - m_rectSelectionBounds.y = box.y -1; - } - - if (iLine == iSelectionEndLine) - { - Gwen::Rect pos = GetCharacterPosition( iSelectionEndPos ); - m_rectSelectionBounds.w = pos.x - m_rectSelectionBounds.x; - } - else - { - m_rectSelectionBounds.w = box.x + box.w - m_rectSelectionBounds.x; - } - if(m_rectSelectionBounds.w < 1) - { - m_rectSelectionBounds.w=1; - } - - skin->GetRender()->DrawFilledRect( m_rectSelectionBounds ); - } - } - - // Draw selection.. if selected.. - if ( m_iCursorPos != m_iCursorEnd ) - { - //skin->GetRender()->SetDrawColor( Gwen::Color( 50, 170, 255, 200 ) ); - //skin->GetRender()->DrawFilledRect( m_rectSelectionBounds ); - } - - // Draw caret - skin->GetRender()->SetDrawColor( m_CaretColor ); - skin->GetRender()->DrawFilledRect( m_rectCaretBounds ); -} - -void TextBoxMultiline::MakeCaratVisible() -{ - if( m_Text->Height() < Height() ) - { - m_Text->Position( m_iAlign ); - } - else - { - //const Rect& bounds = GetInnerBounds(); - - //if ( pos & Pos::Top ) y = bounds.y + ypadding; - //if ( pos & Pos::Bottom ) y = bounds.y + ( bounds.h - Height() - ypadding ); - //if ( pos & Pos::CenterV ) y = bounds.y + ( bounds.h - Height() ) * 0.5; - - Rect pos = m_Text->GetCharacterPosition( m_iCursorPos ); - int iCaratPos = pos.y;// + pos.h; - int iRealCaratPos = iCaratPos + m_Text->Y(); - //int iSlidingZone = m_Text->GetFont()->size; //Width()*0.1f - - // If the carat is already in a semi-good position, leave it. - int mi = GetPadding().top; - int ma = Height() - pos.h - GetPadding().bottom; - if ( iRealCaratPos >= GetPadding().top && iRealCaratPos <= Height() - pos.h - GetPadding().bottom ) - return; - - int y = 0; - - // bottom of carat too low - if(iRealCaratPos > Height() - pos.h - GetPadding().bottom ) - { - //align bottom - y = Height() - iCaratPos - pos.h - GetPadding().bottom; - } - - // top of carat too low - if(iRealCaratPos < GetPadding().top) - { - y = -iCaratPos + GetPadding().top; - } - - // Don't show too much whitespace to the bottom - if ( y + m_Text->Height() < Height() - GetPadding().bottom ) - y = -m_Text->Height() + (Height() - GetPadding().bottom ); - - // Or the top - if ( y > GetPadding().top ) - y = GetPadding().top; - - int x = 0; - if ( m_iAlign & Pos::Left ) x = GetPadding().left; - if ( m_iAlign & Pos::Right ) x = Width() - m_Text->Width() - GetPadding().right ; - if ( m_iAlign & Pos::CenterH ) x = ( Width() - m_Text->Width() ) * 0.5; - - m_Text->SetPos( x, y); - } -} - -int TextBoxMultiline::GetCurrentLine() -{ - return m_Text->GetLineFromChar( m_iCursorPos ); -} - -bool TextBoxMultiline::OnKeyHome( bool bDown ) -{ - if ( !bDown ) { return true; } - - int iCurrentLine = GetCurrentLine(); - int iChar = m_Text->GetStartCharFromLine( iCurrentLine ); - m_iCursorLine = 0; - m_iCursorPos = iChar; - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBoxMultiline::OnKeyEnd( bool bDown ) -{ - if ( !bDown ) { return true; } - - int iCurrentLine = GetCurrentLine(); - int iChar = m_Text->GetEndCharFromLine( iCurrentLine ); - m_iCursorLine = 0; - m_iCursorPos = iChar; - - int iLastLine = m_Text->NumLines()-1; - - if(iCurrentLine < iLastLine && iChar > 0) - m_iCursorPos = iChar-1; // NAUGHTY - else - m_iCursorPos = m_Text->Length(); - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBoxMultiline::OnKeyUp( bool bDown ) -{ - if ( !bDown ) { return true; } - - //if ( m_iCursorLine == 0 ) - m_iCursorLine = m_Text->GetCharPosOnLine( m_iCursorPos ); - - int iLine = m_Text->GetLineFromChar( m_iCursorPos ); - - if ( iLine == 0 ) { return true; } - - m_iCursorPos = m_Text->GetStartCharFromLine( iLine - 1 ); - m_iCursorPos += Clamp( m_iCursorLine, 0, m_Text->GetLine( iLine - 1 )->Length()-1 ); - m_iCursorPos = Clamp( m_iCursorPos, 0, m_Text->Length() ); - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -bool TextBoxMultiline::OnKeyDown( bool bDown ) -{ - if ( !bDown ) { return true; } - - //if ( m_iCursorLine == 0 ) - m_iCursorLine = m_Text->GetCharPosOnLine( m_iCursorPos ); - - int iLine = m_Text->GetLineFromChar( m_iCursorPos ); - int iLastLine = m_Text->NumLines()-1; - if ( iLine >= iLastLine || iLastLine<1) return true; - - m_iCursorPos = m_Text->GetStartCharFromLine( iLine + 1 ); - if(iLine+1 >=iLastLine) - { - m_iCursorPos += Clamp( m_iCursorLine, 0, m_Text->GetLine( iLine + 1)->Length() ); - } - else - { - m_iCursorPos += Clamp( m_iCursorLine, 0, m_Text->GetLine( iLine + 1)->Length()-1 ); - } - m_iCursorPos = Clamp( m_iCursorPos, 0, m_Text->Length() ); - - if ( !Gwen::Input::IsShiftDown() ) - { - m_iCursorEnd = m_iCursorPos; - } - - RefreshCursorBounds(); - return true; -} - -GWEN_CONTROL_CONSTRUCTOR( PasswordTextBox ) -{ - m_realText = ""; - m_passwordChar = '*'; -} - -void PasswordTextBox::SetText( const TextObject& str, bool bDoEvents ) -{ - if ( m_realText == str.GetUnicode() ) return; - - m_realText = str; - std::string passwordChars; - for (int i = 0; i < m_realText.length(); i ++) - passwordChars += m_passwordChar; - - m_Text->SetString(passwordChars); - Redraw(); - - if ( bDoEvents ) - OnTextChanged(); -} - -void PasswordTextBox::SetPasswordChar(const char c) -{ - m_passwordChar = c; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TextBox.h b/OpenSauce/shared/Include/GWEN/Controls/TextBox.h deleted file mode 100644 index 712208719..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TextBox.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TEXTBOX_H -#define GWEN_CONTROLS_TEXTOBX_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/ScrollControl.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT TextBox : public Label - { - GWEN_CONTROL( TextBox, Label ); - - virtual void Render( Skin::Base* skin ); - virtual void RenderFocus( Gwen::Skin::Base* /*skin*/ ) {}; - virtual void Layout( Skin::Base* skin ); - virtual void PostLayout( Skin::Base* skin ); - -#ifndef GWEN_NO_ANIMATION - virtual void UpdateCaretColor(); -#endif - - virtual bool OnChar( Gwen::UnicodeChar c ); - - virtual void InsertText( const Gwen::UnicodeString & str ); - virtual void DeleteText( int iStartPos, int iLength ); - - virtual void RefreshCursorBounds(); - - virtual bool OnKeyReturn( bool bDown ); - virtual bool OnKeyBackspace( bool bDown ); - virtual bool OnKeyDelete( bool bDown ); - virtual bool OnKeyRight( bool bDown ); - virtual bool OnKeyLeft( bool bDown ); - virtual bool OnKeyHome( bool bDown ); - virtual bool OnKeyEnd( bool bDown ); - - virtual bool AccelOnlyFocus() { return true; } - - virtual void OnPaste( Gwen::Controls::Base* pCtrl ); - virtual void OnCopy( Gwen::Controls::Base* pCtrl ); - virtual void OnCut( Gwen::Controls::Base* pCtrl ); - virtual void OnSelectAll( Gwen::Controls::Base* pCtrl ); - - virtual void OnMouseDoubleClickLeft( int x, int y ); - - virtual void EraseSelection(); - virtual bool HasSelection(); - virtual UnicodeString GetSelection(); - - virtual void SetCursorPos( int i ); - virtual void SetCursorEnd( int i ); - - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); - - virtual void SetEditable( bool b ) { m_bEditable = b; } - - virtual void SetSelectAllOnFocus( bool b ) { m_bSelectAll = b; if ( b ) { OnSelectAll( this ); } } - - virtual void MakeCaratVisible(); - - virtual void OnEnter(); - - virtual bool NeedsInputChars() { return true; } - - virtual void MoveCaretToEnd(); - virtual void MoveCaretToStart(); - - Event::Caller onTextChanged; - Event::Caller onReturnPressed; - - protected: - - virtual void OnTextChanged(); - virtual bool IsTextAllowed( const Gwen::UnicodeString & /*str*/, int /*iPos*/ ) { return true; } - - bool m_bEditable; - bool m_bSelectAll; - - int m_iCursorPos; - int m_iCursorEnd; - int m_iCursorLine; - - Gwen::Rect m_rectSelectionBounds; - Gwen::Rect m_rectCaretBounds; - - float m_fNextCaretColorChange; - Gwen::Color m_CaretColor; - }; - - class GWEN_EXPORT TextBoxNumeric : public TextBox - { - public: - - GWEN_CONTROL( TextBoxNumeric, TextBox ); - - virtual float GetFloatFromText(); - - private: - - virtual bool IsTextAllowed( const Gwen::UnicodeString & str, int iPos ); - - }; - - class GWEN_EXPORT TextBoxMultiline : public TextBox - { - public: - - GWEN_CONTROL( TextBoxMultiline, TextBox ); - - virtual bool OnKeyReturn( bool bDown ); - virtual void Render( Skin::Base* skin ); - virtual void MakeCaratVisible(); - - virtual bool OnKeyHome( bool bDown ); - virtual bool OnKeyEnd( bool bDown ); - virtual bool OnKeyUp( bool bDown ); - virtual bool OnKeyDown( bool bDown ); - - virtual int GetCurrentLine(); - - protected: - - }; - - class GWEN_EXPORT PasswordTextBox : public TextBox - { - public: - - GWEN_CONTROL( PasswordTextBox, TextBox ); - - virtual void SetText( const TextObject& str, bool bDoEvents = true ); - virtual void SetPasswordChar(const char c); - - virtual const TextObject& GetText() const { return m_realText; } - protected: - - char m_passwordChar; - TextObject m_realText; - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TextBoxNumeric.cpp b/OpenSauce/shared/Include/GWEN/Controls/TextBoxNumeric.cpp deleted file mode 100644 index 5b55d32cf..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TextBoxNumeric.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/TextBox.h" -#include "Gwen/Skin.h" -#include "Gwen/Utility.h" -#include "Gwen/Platform.h" - - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( TextBoxNumeric ) -{ - SetText( L"0" ); -} - -bool TextBoxNumeric::IsTextAllowed( const Gwen::UnicodeString & str, int iPos ) -{ - const UnicodeString & strString = GetText().GetUnicode(); - - if ( str.length() == 0 ) - { return true; } - - for ( size_t i = 0; i < str.length(); i++ ) - { - if ( str[i] == L'-' ) - { - // Has to be at the start - if ( i != 0 || iPos != 0 ) - { return false; } - - // Can only be one - if ( std::count( strString.begin(), strString.end(), L'-' ) > 0 ) - { return false; } - - continue; - } - - if ( str[i] == L'0' ) { continue; } - - if ( str[i] == L'1' ) { continue; } - - if ( str[i] == L'2' ) { continue; } - - if ( str[i] == L'3' ) { continue; } - - if ( str[i] == L'4' ) { continue; } - - if ( str[i] == L'5' ) { continue; } - - if ( str[i] == L'6' ) { continue; } - - if ( str[i] == L'7' ) { continue; } - - if ( str[i] == L'8' ) { continue; } - - if ( str[i] == L'9' ) { continue; } - - if ( str[i] == L'.' ) - { - // Already a fullstop - if ( std::count( strString.begin(), strString.end(), L'.' ) > 0 ) - { return false; } - - continue; - } - - return false; - } - - return true; -} - -float TextBoxNumeric::GetFloatFromText() -{ - double temp = Gwen::Utility::Strings::To::Float( GetText().GetUnicode() ); - return temp; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/ToolBar.h b/OpenSauce/shared/Include/GWEN/Controls/ToolBar.h deleted file mode 100644 index 30f1e45bf..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/ToolBar.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - GWEN - Copyright (c) 2011 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TOOLBAR_H -#define GWEN_CONTROLS_TOOLBAR_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace Controls - { - - class ToolBarButton : public Gwen::Controls::Button - { - GWEN_CONTROL_INLINE( ToolBarButton, Gwen::Controls::Button ) - { - SetSize( 20, 20 ); - Dock( Pos::Left ); - } - - virtual bool ShouldDrawBackground() - { - return IsHovered(); - } - - }; - - class ToolBarStrip : public Base - { - GWEN_CONTROL_INLINE( ToolBarStrip, Base ) - { - SetSize( 25, 25 ); - SetPadding( Padding( 2, 2, 2, 2 ) ); - } - - virtual void Render( Skin::Base* skin ) - { - skin->DrawMenuStrip( this ); - } - - virtual ToolBarButton* Add( const TextObject & Text, const TextObject & Icon ) - { - ToolBarButton* pButton = new ToolBarButton( this ); - pButton->SetToolTip( Text ); - pButton->SetImage( Icon ); - return pButton; - } - - }; - - - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TreeControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/TreeControl.cpp deleted file mode 100644 index 34c8e9745..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TreeControl.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/TreeControl.h" -#include "Gwen/Controls/ScrollControl.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( TreeControl ) -{ - m_TreeControl = this; - m_ToggleButton->DelayedDelete(); - m_ToggleButton = NULL; - m_Title->DelayedDelete(); - m_Title = NULL; - m_InnerPanel->DelayedDelete(); - m_InnerPanel = NULL; - m_bAllowMultipleSelection = false; - m_ScrollControl = new ScrollControl( this ); - m_ScrollControl->Dock( Pos::Fill ); - m_ScrollControl->SetScroll( false, true ); - m_ScrollControl->SetAutoHideBars( true ); - m_ScrollControl->SetMargin( Margin( 1, 1, 1, 1 ) ); - m_InnerPanel = m_ScrollControl; - m_ScrollControl->SetInnerSize( 1000, 1000 ); -} - -void TreeControl::Render( Skin::Base* skin ) -{ - if ( ShouldDrawBackground() ) - { skin->DrawTreeControl( this ); } -} - -void TreeControl::OnChildBoundsChanged( Gwen::Rect /*oldChildBounds*/, Base* /*pChild*/ ) -{ - m_ScrollControl->UpdateScrollBars(); - Invalidate(); -} - -void TreeControl::Clear() -{ - m_ScrollControl->Clear(); -} - -void TreeControl::Layout( Skin::Base* skin ) -{ - BaseClass::BaseClass::Layout( skin ); -} - -void TreeControl::PostLayout( Skin::Base* skin ) -{ - BaseClass::BaseClass::PostLayout( skin ); -} - -void TreeControl::OnNodeAdded( TreeNode* pNode ) -{ - pNode->onNamePress.Add( this, &TreeControl::OnNodeSelection ); -} - -void TreeControl::OnNodeSelection( Controls::Base* /*control*/ ) -{ - if ( !m_bAllowMultipleSelection || !Gwen::Input::IsKeyDown( Key::Control ) ) - { DeselectAll(); } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TreeControl.h b/OpenSauce/shared/Include/GWEN/Controls/TreeControl.h deleted file mode 100644 index 827f9e515..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TreeControl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TREECONTROL_H -#define GWEN_CONTROLS_TREECONTROL_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/TreeNode.h" - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT TreeControl : public TreeNode - { - public: - - GWEN_CONTROL( TreeControl, TreeNode ); - - virtual void Render( Skin::Base* skin ); - - virtual void OnChildBoundsChanged( Gwen::Rect oldChildBounds, Base* pChild ); - - ScrollControl* Scroller() { return m_ScrollControl; } - - virtual void Clear(); - - virtual void Layout( Skin::Base* skin ); - virtual void PostLayout( Skin::Base* skin ); - - virtual void AllowMultiSelect( bool b ) { m_bAllowMultipleSelection = b; } - - virtual void OnNodeAdded( TreeNode* pNode ); - - private: - - void OnNodeSelection( Controls::Base* control ); - - ScrollControl* m_ScrollControl; - bool m_bAllowMultipleSelection; - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TreeNode.cpp b/OpenSauce/shared/Include/GWEN/Controls/TreeNode.cpp deleted file mode 100644 index e512d6fef..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TreeNode.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/TreeNode.h" -#include "Gwen/Controls/TreeControl.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -class OpenToggleButton : public Button -{ - GWEN_CONTROL_INLINE( OpenToggleButton, Button ) - { - SetIsToggle( true ); - SetTabable( false ); - } - - virtual void RenderFocus( Skin::Base* /*skin*/ ) {} - - virtual void Render( Skin::Base* skin ) - { - skin->DrawTreeButton( this, GetToggleState() ); - } -}; - -class TreeNodeText : public Button -{ - GWEN_CONTROL_INLINE( TreeNodeText, Button ) - { - SetAlignment( Pos::Left | Pos::CenterV ); - SetShouldDrawBackground( false ); - SetHeight( 16 ); - } - - void UpdateColours() - { - if ( IsDisabled() ) { return SetTextColor( GetSkin()->Colors.Button.Disabled ); } - - if ( IsDepressed() || GetToggleState() ) { return SetTextColor( GetSkin()->Colors.Tree.Selected ); } - - if ( IsHovered() ) { return SetTextColor( GetSkin()->Colors.Tree.Hover ); } - - SetTextColor( GetSkin()->Colors.Tree.Normal ); - } -}; - -const int TreeIndentation = 14; - -GWEN_CONTROL_CONSTRUCTOR( TreeNode ) -{ - m_TreeControl = NULL; - m_ToggleButton = new OpenToggleButton( this ); - m_ToggleButton->SetBounds( 0, 0, 15, 15 ); - m_ToggleButton->onToggle.Add( this, &TreeNode::OnToggleButtonPress ); - m_Title = new TreeNodeText( this ); - m_Title->Dock( Pos::Top ); - m_Title->SetMargin( Margin( 16, 0, 0, 0 ) ); - m_Title->onDoubleClick.Add( this, &TreeNode::OnDoubleClickName ); - m_Title->onDown.Add( this, &TreeNode::OnClickName ); - m_Title->onRightPress.Add( this, &TreeNode::OnRightPress ); - m_InnerPanel = new Base( this ); - m_InnerPanel->Dock( Pos::Top ); - m_InnerPanel->SetHeight( 100 ); - m_InnerPanel->SetMargin( Margin( TreeIndentation, 1, 0, 0 ) ); - m_InnerPanel->Hide(); - m_bRoot = false; - m_bSelected = false; - m_bSelectable = true; -} - -void TreeNode::Render( Skin::Base* skin ) -{ - int iBottom = 0; - - if ( m_InnerPanel->Children.size() > 0 ) - { - iBottom = m_InnerPanel->Children.back()->Y() + m_InnerPanel->Y(); - } - - skin->DrawTreeNode( this, m_InnerPanel->Visible(), IsSelected(), m_Title->Height(), m_Title->TextRight(), m_ToggleButton->Y() + m_ToggleButton->Height() * 0.5, iBottom, GetParent() == m_TreeControl ); -} - -TreeNode* TreeNode::AddNode( const TextObject & strLabel ) -{ - TreeNode* node = new TreeNode( this ); - node->SetText( strLabel ); - node->Dock( Pos::Top ); - node->SetRoot( gwen_cast ( this ) != NULL ); - node->SetTreeControl( m_TreeControl ); - - if ( m_TreeControl ) - { - m_TreeControl->OnNodeAdded( node ); - } - - return node; -} - - - -void TreeNode::Layout( Skin::Base* skin ) -{ - if ( m_ToggleButton ) - { - if ( m_Title ) - { - m_ToggleButton->SetPos( 0, ( m_Title->Height() - m_ToggleButton->Height() ) * 0.5 ); - } - - if ( m_InnerPanel->NumChildren() == 0 ) - { - m_ToggleButton->Hide(); - m_ToggleButton->SetToggleState( false ); - m_InnerPanel->Hide(); - } - else - { - m_ToggleButton->Show(); - m_InnerPanel->SizeToChildren( false, true ); - } - } - - BaseClass::Layout( skin ); -} - -void TreeNode::PostLayout( Skin::Base* /*skin*/ ) -{ - if ( SizeToChildren( false, true ) ) - { - InvalidateParent(); - } -} - -void TreeNode::SetText( const TextObject & text ) -{ - m_Title->SetText( text ); -} - -const TextObject & TreeNode::GetText() -{ - return m_Title->GetText(); -} - -void TreeNode::SetImage( const TextObject & text ) -{ - m_Title->SetImage( text ); -} - -void TreeNode::Open() -{ - m_InnerPanel->Show(); - - if ( m_ToggleButton ) { m_ToggleButton->SetToggleState( true ); } - - Invalidate(); -} - -void TreeNode::Close() -{ - m_InnerPanel->Hide(); - - if ( m_ToggleButton ) { m_ToggleButton->SetToggleState( false ); } - - Invalidate(); -} - -void TreeNode::ExpandAll() -{ - Open(); - Base::List & children = GetChildNodes(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - TreeNode* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - pChild->ExpandAll(); - } -} - -Button* TreeNode::GetButton() { return m_Title; } - - -void TreeNode::OnToggleButtonPress( Base* /*control*/ ) -{ - if ( m_ToggleButton->GetToggleState() ) - { - Open(); - } - else - { - Close(); - } -} - -void TreeNode::OnDoubleClickName( Base* /*control*/ ) -{ - if ( !m_ToggleButton->Visible() ) { return; } - - m_ToggleButton->Toggle(); -} - -void TreeNode::OnClickName( Base* /*control*/ ) -{ - onNamePress.Call( this ); - SetSelected( !IsSelected() ); -} - -void TreeNode::OnRightPress( Base* control ) -{ - onRightPress.Call( this ); -} - -void TreeNode::SetSelected( bool b, bool FireEvents ) -{ - if ( !m_bSelectable ) { return; } - - if ( m_bSelected == b ) { return; } - - m_bSelected = b; - - if ( m_Title ) - { m_Title->SetToggleState( m_bSelected ); } - - if ( FireEvents ) - { - onSelectChange.Call( this ); - - if ( m_bSelected ) - { - onSelect.Call( this ); - } - else - { - onUnselect.Call( this ); - } - } - - Redraw(); -} - -void TreeNode::DeselectAll() -{ - m_bSelected = false; - - if ( m_Title ) - { m_Title->SetToggleState( m_bSelected ); } - - Base::List & children = GetChildNodes(); - - for ( Base::List::iterator iter = children.begin(); iter != children.end(); ++iter ) - { - TreeNode* pChild = gwen_cast ( *iter ); - - if ( !pChild ) { continue; } - - pChild->DeselectAll(); - } -} - -Controls::Base::List & TreeNode::GetChildNodes() -{ - return m_InnerPanel->GetChildren(); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/TreeNode.h b/OpenSauce/shared/Include/GWEN/Controls/TreeNode.h deleted file mode 100644 index 2e09f0b58..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/TreeNode.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - GWEN - Copyright (c) 2011 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_TREENODE_H -#define GWEN_CONTROLS_TREENODE_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/ScrollControl.h" - - -namespace Gwen -{ - namespace Controls - { - class TreeControl; - - class GWEN_EXPORT TreeNode : public Base - { - public: - - GWEN_CONTROL( TreeNode, Base ); - - virtual TreeNode* AddNode( const TextObject & strLabel ); - - virtual void SetText( const TextObject & text ); - virtual const TextObject & GetText(); - virtual void SetImage( const TextObject & text ); - - virtual void Open(); - virtual void Close(); - - virtual void ExpandAll(); - - virtual Button* GetButton(); - - virtual void Render( Skin::Base* skin ); - virtual void Layout( Skin::Base* skin ); - virtual void PostLayout( Skin::Base* skin ); - - virtual void SetRoot( bool b ) { m_bRoot = b; } - virtual void SetTreeControl( TreeControl* pCtrl ) { m_TreeControl = pCtrl; } - - virtual void SetSelectable( bool b ) { m_bSelectable = b; } - virtual bool IsSelected() { return m_bSelected; } - virtual void SetSelected( bool b, bool FireEvents = true ); - - virtual void DeselectAll(); - - virtual Controls::Base::List & GetChildNodes(); - - Event::Caller onNamePress; - Event::Caller onRightPress; - Event::Caller onSelectChange; - Event::Caller onSelect; - Event::Caller onUnselect; - - - /*protected:*/ - - void OnToggleButtonPress( Base* control ); - void OnDoubleClickName( Base* control ); - void OnRightPress( Base* control ); - void OnClickName( Base* control ); - - protected: - - TreeControl* m_TreeControl; - Button* m_ToggleButton; - Button* m_Title; - - bool m_bRoot; - bool m_bSelected; - bool m_bSelectable; - }; - - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.cpp b/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.cpp deleted file mode 100644 index b494e2420..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Controls/VerticalScrollBar.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -GWEN_CONTROL_CONSTRUCTOR( VerticalScrollBar ) -{ - m_Bar->SetVertical(); - m_ScrollButton[SCROLL_BUTTON_UP]->SetDirectionUp(); - m_ScrollButton[SCROLL_BUTTON_UP]->onPress.Add( this, &VerticalScrollBar::NudgeUp ); - m_ScrollButton[SCROLL_BUTTON_DOWN]->SetDirectionDown(); - m_ScrollButton[SCROLL_BUTTON_DOWN]->onPress.Add( this, &VerticalScrollBar::NudgeDown ); - m_Bar->onDragged.Add( this, &VerticalScrollBar::OnBarMoved ); -} - -void VerticalScrollBar::Layout( Skin::Base* skin ) -{ - BaseClass::Layout( skin ); - m_ScrollButton[SCROLL_BUTTON_UP]->Dock( Pos::Top ); - m_ScrollButton[SCROLL_BUTTON_UP]->SetHeight( Width() ); - m_ScrollButton[SCROLL_BUTTON_DOWN]->Dock( Pos::Bottom ); - m_ScrollButton[SCROLL_BUTTON_DOWN]->SetHeight( Width() ); - m_Bar->SetWidth( GetButtonSize() ); - //Add padding - m_Bar->SetPadding( Padding( 0, GetButtonSize(), 0, GetButtonSize() ) ); - //Calculate bar sizes - float barHeight = ( m_fViewableContentSize / m_fContentSize ) * ( Height() - GetButtonSize() ); - - if ( barHeight < GetButtonSize() * 0.5 ) - { barHeight = GetButtonSize() * 0.5; } - - m_Bar->SetHeight( barHeight ); - m_Bar->SetHidden( Height() - ( GetButtonSize() * 2 ) <= barHeight ); - - if ( Hidden() ) - { SetScrolledAmount( 0, true ); } - - //Based on our last scroll amount, produce a position for the bar - if ( !m_Bar->IsDepressed() ) - { - SetScrolledAmount( GetScrolledAmount(), true ); - } -} - -void VerticalScrollBar::ScrollToTop() -{ - SetScrolledAmount( 0, true ); -} -void VerticalScrollBar::ScrollToBottom() -{ - SetScrolledAmount( 1, true ); -} -void VerticalScrollBar::NudgeUp( Base* /*control*/ ) -{ - if ( !IsDisabled() ) - { SetScrolledAmount( GetScrolledAmount() - GetNudgeAmount(), true ); } -} - -void VerticalScrollBar::NudgeDown( Base* /*control*/ ) -{ - if ( !IsDisabled() ) - { SetScrolledAmount( GetScrolledAmount() + GetNudgeAmount(), true ); } -} - -float VerticalScrollBar::GetNudgeAmount() -{ - if ( m_bDepressed ) - { return m_fViewableContentSize / m_fContentSize; } - else - { return BaseClass::GetNudgeAmount(); } -} - -void VerticalScrollBar::OnMouseClickLeft( int x, int y, bool bDown ) -{ - if ( bDown ) - { - m_bDepressed = true; - Gwen::MouseFocus = this; - } - else - { - Gwen::Point clickPos = CanvasPosToLocal( Gwen::Point( x, y ) ); - - if ( clickPos.y < m_Bar->Y() ) - { NudgeUp( this ); } - else if ( clickPos.y > m_Bar->Y() + m_Bar->Height() ) - { NudgeDown( this ); } - - m_bDepressed = false; - Gwen::MouseFocus = NULL; - } -} - -float VerticalScrollBar::CalculateScrolledAmount() -{ - return ( float )( m_Bar->Y() - GetButtonSize() ) / ( float )( Height() - m_Bar->Height() - ( GetButtonSize() * 2 ) ); -} - -bool VerticalScrollBar::SetScrolledAmount( float amount, bool forceUpdate ) -{ - amount = Gwen::Clamp( amount, 0.f, 1.f ); - - if ( !BaseClass::SetScrolledAmount( amount, forceUpdate ) ) - { return false; } - - if ( forceUpdate ) - { - int newY = GetButtonSize() + ( amount * ( ( Height() - m_Bar->Height() ) - ( GetButtonSize() * 2 ) ) ); - m_Bar->MoveTo( m_Bar->X(), newY ); - } - - return true; -} - -void VerticalScrollBar::OnBarMoved( Controls::Base* control ) -{ - if ( m_Bar->IsDepressed() ) - { - SetScrolledAmount( CalculateScrolledAmount(), false ); - BaseClass::OnBarMoved( control ); - } - else - { - InvalidateParent(); - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.h b/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.h deleted file mode 100644 index 7cf5ce5e9..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/VerticalScrollBar.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_VERTICALSCROLLBAR_H -#define GWEN_CONTROLS_VERTICALSCROLLBAR_H -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/ScrollBar.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - -namespace Gwen -{ - namespace Controls - { - - class GWEN_EXPORT VerticalScrollBar : public BaseScrollBar - { - - GWEN_CONTROL( VerticalScrollBar, BaseScrollBar ); - - virtual void Layout( Skin::Base* skin ); - - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - virtual void OnBarMoved( Controls::Base* control ); - - virtual int GetBarSize() { return m_Bar->Height(); } - virtual int GetBarPos() { return m_Bar->Y() - Width(); } - virtual void SetBarSize( int size ) { m_Bar->SetHeight( size ); } - virtual int GetButtonSize() { return Width(); } - - virtual void ScrollToTop(); - virtual void ScrollToBottom(); - virtual void NudgeUp( Base* control ); - virtual void NudgeDown( Base* control ); - virtual float GetNudgeAmount(); - - virtual float CalculateScrolledAmount(); - virtual bool SetScrolledAmount( float amount, bool forceUpdate ); - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.cpp b/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.cpp deleted file mode 100644 index cf00656e8..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/Slider.h" -#include "Gwen/Controls/VerticalSlider.h" - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( VerticalSlider ) -{ - m_SliderBar->SetHorizontal( false ); -} - -float VerticalSlider::CalculateValue() -{ - return 1 - ( float ) m_SliderBar->Y() / ( float )( Height() - m_SliderBar->Height() ); -} - -void VerticalSlider::UpdateBarFromValue() -{ - m_SliderBar->MoveTo( m_SliderBar->X(), ( Height() - m_SliderBar->Height() ) * ( 1 - m_fValue ) ); -} - - -void VerticalSlider::OnMouseClickLeft( int x, int y, bool bDown ) -{ - m_SliderBar->MoveTo( m_SliderBar->X(), CanvasPosToLocal( Gwen::Point( x, y ) ).y - m_SliderBar->Height() * 0.5 ); - m_SliderBar->OnMouseClickLeft( x, y, bDown ); - OnMoved( m_SliderBar ); -} - - -void VerticalSlider::Layout( Skin::Base* /*skin*/ ) -{ - m_SliderBar->SetSize( Width(), 15 ); -} - - -void VerticalSlider::Render( Skin::Base* skin ) -{ - skin->DrawSlider( this, false, m_bClampToNotches ? m_iNumNotches : 0, m_SliderBar->Height() ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.h b/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.h deleted file mode 100644 index ab1ddcf0e..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/VerticalSlider.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_VERTICALSLIDER_H -#define GWEN_CONTROLS_VERTICALSLIDER_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Slider.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT VerticalSlider : public Slider - { - GWEN_CONTROL( VerticalSlider, Slider ); - - virtual void Layout( Skin::Base* skin ); - virtual void Render( Skin::Base* skin ); - - virtual float CalculateValue(); - virtual void UpdateBarFromValue(); - virtual void OnMouseClickLeft( int x, int y, bool bDown ); - - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/WindowButtons.h b/OpenSauce/shared/Include/GWEN/Controls/WindowButtons.h deleted file mode 100644 index 303c634b1..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/WindowButtons.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_WINDOWS_BUTTONS_H -#define GWEN_CONTROLS_WINDOWS_BUTTONS_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - class GWEN_EXPORT WindowCloseButton : public Button - { - GWEN_CONTROL_INLINE( WindowCloseButton, Button ) - { - m_pWindow = NULL; - SetSize( 31, 31 ); - SetText( "" ); - } - - virtual void Render( Skin::Base* skin ) - { - if ( !m_pWindow ) { return; } - - skin->DrawWindowCloseButton( this, IsDepressed() && IsHovered(), IsHovered() && ShouldDrawHover(), IsDisabled() ); - } - - void SetWindow( Gwen::Controls::Base* p ) - { - m_pWindow = p; - } - - protected: - - Controls::Base* m_pWindow; - }; - - class GWEN_EXPORT WindowMaximizeButton : public WindowCloseButton - { - GWEN_CONTROL_INLINE( WindowMaximizeButton, WindowCloseButton ) { m_bMaximized = false; }; - - virtual void Render( Skin::Base* skin ) - { - if ( !m_pWindow ) { return; } - - skin->DrawWindowMaximizeButton( this, IsDepressed() && IsHovered(), IsHovered() && ShouldDrawHover(), IsDisabled(), m_bMaximized ); - } - - virtual void SetMaximized( bool b ) - { - m_bMaximized = b; - } - - protected: - - bool m_bMaximized; - }; - - class GWEN_EXPORT WindowMinimizeButton : public WindowCloseButton - { - GWEN_CONTROL_INLINE( WindowMinimizeButton, WindowCloseButton ) {}; - - virtual void Render( Skin::Base* skin ) - { - if ( !m_pWindow ) { return; } - - skin->DrawWindowMinimizeButton( this, IsDepressed() && IsHovered(), IsHovered() && ShouldDrawHover(), IsDisabled() ); - } - - }; - } -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/WindowControl.cpp b/OpenSauce/shared/Include/GWEN/Controls/WindowControl.cpp deleted file mode 100644 index a7da3ef40..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/WindowControl.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Controls/WindowControl.h" -#include "Gwen/Controls/ImagePanel.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Modal.h" - - -using namespace Gwen; -using namespace Gwen::Controls; -using namespace Gwen::ControlsInternal; - - -GWEN_CONTROL_CONSTRUCTOR( WindowControl ) -{ - m_Modal = NULL; - m_bDeleteOnClose = false; - m_TitleBar = new Dragger( this ); - m_TitleBar->SetHeight( 24 ); - m_TitleBar->SetPadding( Padding( 0, 0, 0, 0 ) ); - m_TitleBar->SetMargin( Margin( 0, 0, 0, 4 ) ); - m_TitleBar->SetTarget( this ); - m_TitleBar->Dock( Pos::Top ); - m_Title = new Label( m_TitleBar ); - m_Title->SetAlignment( Pos::Left | Pos::CenterV ); - m_Title->SetText( "Window" ); - m_Title->Dock( Pos::Fill ); - m_Title->SetPadding( Padding( 8, 0, 0, 0 ) ); - m_Title->SetTextColor( GetSkin()->Colors.Window.TitleInactive ); - m_CloseButton = new Gwen::Controls::WindowCloseButton( m_TitleBar ); - m_CloseButton->SetText( "" ); - m_CloseButton->Dock( Pos::Right ); - m_CloseButton->onPress.Add( this, &WindowControl::CloseButtonPressed ); - m_CloseButton->SetTabable( false ); - m_CloseButton->SetName( "closeButton" ); - m_CloseButton->SetWindow( this ); - //Create a blank content control, dock it to the top - Should this be a ScrollControl? - m_InnerPanel = new Base( this ); - m_InnerPanel->Dock( Pos::Fill ); - GetResizer( 8 )->Hide(); - BringToFront(); - SetTabable( false ); - Focus(); - SetMinimumSize( Gwen::Point( 100, 40 ) ); - SetClampMovement( true ); - SetKeyboardInputEnabled( false ); -} - - -WindowControl::~WindowControl() -{ - DestroyModal(); -} - -void WindowControl::MakeModal( bool bDrawBackground ) -{ - if ( m_Modal ) { return; } - - m_Modal = new ControlsInternal::Modal( GetCanvas() ); - SetParent( m_Modal ); - m_Modal->SetShouldDrawBackground( bDrawBackground ); -} - -void WindowControl::DestroyModal() -{ - if ( !m_Modal ) { return; } - - // Really should be restoring our parent here.. but we don't know who it is. - // Assume it's the canvas. - SetParent( GetCanvas() ); - m_Modal->DelayedDelete(); - m_Modal = NULL; -} - -bool WindowControl::IsOnTop() -{ - for ( Base::List::reverse_iterator iter = GetParent()->Children.rbegin(); iter != GetParent()->Children.rend(); ++iter ) - { - WindowControl* pWindow = gwen_cast ( *iter ); - - if ( !pWindow ) - { continue; } - - if ( pWindow == this ) - { return true; } - - return false; - } - - return false; -} - -void WindowControl::Render( Skin::Base* skin ) -{ - bool bHasFocus = IsOnTop(); - - if ( bHasFocus ) - { m_Title->SetTextColor( GetSkin()->Colors.Window.TitleActive ); } - else - { m_Title->SetTextColor( GetSkin()->Colors.Window.TitleInactive ); } - - skin->DrawWindow( this, m_TitleBar->Bottom(), bHasFocus ); -} - -void WindowControl::RenderUnder( Skin::Base* skin ) -{ - BaseClass::RenderUnder( skin ); - skin->DrawShadow( this ); -} - -void WindowControl::SetTitle( Gwen::UnicodeString title ) -{ - m_Title->SetText( title ); -} - -void WindowControl::SetClosable( bool closeable ) -{ - m_CloseButton->SetHidden( !closeable ); -} - -void WindowControl::SetHidden( bool hidden ) -{ - if ( !hidden ) - { BringToFront(); } - - BaseClass::SetHidden( hidden ); -} - -void WindowControl::Touch() -{ - BaseClass::Touch(); - BringToFront(); -} - -void WindowControl::CloseButtonPressed() -{ - DestroyModal(); - onWindowClosed.Call( this ); - SetHidden( true ); - - if ( m_bDeleteOnClose ) - { DelayedDelete(); } -} - - -void WindowControl::RenderFocus( Gwen::Skin::Base* /*skin*/ ) -{ -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Controls/WindowControl.h b/OpenSauce/shared/Include/GWEN/Controls/WindowControl.h deleted file mode 100644 index 9bcb4e59a..000000000 --- a/OpenSauce/shared/Include/GWEN/Controls/WindowControl.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_CONTROLS_WINDOWCONTROL_H -#define GWEN_CONTROLS_WINDOWCONTROL_H - -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/Dragger.h" -#include "Gwen/Controls/Label.h" -#include "Gwen/Controls/ResizableControl.h" -#include "Gwen/Controls/Modal.h" -#include "Gwen/Controls/WindowButtons.h" -#include "Gwen/Skin.h" - - -namespace Gwen -{ - namespace Controls - { - class CloseButton; - - class GWEN_EXPORT WindowControl : public ResizableControl - { - public: - - GWEN_CONTROL( WindowControl, ResizableControl ); - - virtual ~WindowControl(); - virtual void Render( Skin::Base* skin ); - virtual void RenderUnder( Skin::Base* skin ); - - virtual void SetTitle( Gwen::UnicodeString title ); - virtual void SetTitle( Gwen::String title ) { SetTitle( Gwen::Utility::StringToUnicode( title ) ); } - virtual void SetClosable( bool closeable ); - - virtual void Touch(); - bool IsOnTop(); - - virtual void SetHidden( bool hidden ); - - void CloseButtonPressed(); - void RenderFocus( Gwen::Skin::Base* skin ); - void SetDeleteOnClose( bool b ) { m_bDeleteOnClose = b; } - - void MakeModal( bool bDrawBackground = true ); - void DestroyModal(); - - Gwen::Event::Caller onWindowClosed; - - protected: - - Gwen::ControlsInternal::Dragger* m_TitleBar; - Gwen::Controls::Label* m_Title; - Gwen::Controls::WindowCloseButton* m_CloseButton; - - bool m_bDeleteOnClose; - - ControlsInternal::Modal* m_Modal; - }; - } -} -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/DragAndDrop.cpp b/OpenSauce/shared/Include/GWEN/DragAndDrop.cpp deleted file mode 100644 index 40d9c12bc..000000000 --- a/OpenSauce/shared/Include/GWEN/DragAndDrop.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Utility.h" -#include "Gwen/Platform.h" - -using namespace Gwen; -using namespace Gwen::DragAndDrop; - -DragAndDrop::Package* DragAndDrop::CurrentPackage = NULL; -Gwen::Controls::Base* DragAndDrop::HoveredControl = NULL; -Gwen::Controls::Base* DragAndDrop::SourceControl = NULL; - -static Gwen::Controls::Base* LastPressedControl = NULL; -static Gwen::Controls::Base* NewHoveredControl = NULL; -static Gwen::Point LastPressedPos; - -void DragAndDrop::ControlDeleted( Gwen::Controls::Base* pControl ) -{ - if ( SourceControl == pControl ) - { - SourceControl = NULL; - CurrentPackage = NULL; - HoveredControl = NULL; - LastPressedControl = NULL; - } - - if ( LastPressedControl == pControl ) - { LastPressedControl = NULL; } - - if ( HoveredControl == pControl ) - { HoveredControl = NULL; } - - if ( NewHoveredControl == pControl ) - { NewHoveredControl = NULL; } -} - -static int m_iMouseX = 0; -static int m_iMouseY = 0; - -bool DragAndDrop::Start( Gwen::Controls::Base* pControl, Package* pPackage ) -{ - if ( CurrentPackage ) - { - return false; - } - - CurrentPackage = pPackage; - SourceControl = pControl; - return true; -} - -bool OnDrop( int x, int y ) -{ - bool bSuccess = false; - - if ( DragAndDrop::HoveredControl ) - { - DragAndDrop::HoveredControl->DragAndDrop_HoverLeave( DragAndDrop::CurrentPackage ); - bSuccess = DragAndDrop::HoveredControl->DragAndDrop_HandleDrop( DragAndDrop::CurrentPackage, x, y ); - } - - // Report back to the source control, to tell it if we've been successful. - DragAndDrop::SourceControl->DragAndDrop_EndDragging( bSuccess, x, y ); - DragAndDrop::SourceControl->Redraw(); - DragAndDrop::CurrentPackage = NULL; - DragAndDrop::SourceControl = NULL; - return true; -} - -bool DragAndDrop::OnMouseButton( Gwen::Controls::Base* pHoveredControl, int x, int y, bool bDown ) -{ - if ( !bDown ) - { - LastPressedControl = NULL; - - // Not carrying anything, allow normal actions - if ( !CurrentPackage ) - { return false; } - - // We were carrying something, drop it. - OnDrop( x, y ); - return true; - } - - if ( !pHoveredControl ) { return false; } - - if ( !pHoveredControl->DragAndDrop_Draggable() ) { return false; } - - // Store the last clicked on control. Don't do anything yet, - // we'll check it in OnMouseMoved, and if it moves further than - // x pixels with the mouse down, we'll start to drag. - LastPressedPos = Gwen::Point( x, y ); - LastPressedControl = pHoveredControl; - return false; -} - -bool ShouldStartDraggingControl( int x, int y ) -{ - // We're not holding a control down.. - if ( !LastPressedControl ) { return false; } - - // Not been dragged far enough - int iLength = abs( x - LastPressedPos.x ) + abs( y - LastPressedPos.y ); - - if ( iLength < 5 ) { return false; } - - // Create the dragging package - DragAndDrop::CurrentPackage = LastPressedControl->DragAndDrop_GetPackage( LastPressedPos.x, LastPressedPos.y ); - - // We didn't create a package! - if ( !DragAndDrop::CurrentPackage ) - { - LastPressedControl = NULL; - DragAndDrop::SourceControl = NULL; - return false; - } - - // Now we're dragging something! - DragAndDrop::SourceControl = LastPressedControl; - Gwen::MouseFocus = NULL; - LastPressedControl = NULL; - DragAndDrop::CurrentPackage->drawcontrol = NULL; - - // Some controls will want to decide whether they should be dragged at that moment. - // This function is for them (it defaults to true) - if ( !DragAndDrop::SourceControl->DragAndDrop_ShouldStartDrag() ) - { - DragAndDrop::SourceControl = NULL; - DragAndDrop::CurrentPackage = NULL; - return false; - } - - DragAndDrop::SourceControl->DragAndDrop_StartDragging( DragAndDrop::CurrentPackage, LastPressedPos.x, LastPressedPos.y ); - return true; -} - -void UpdateHoveredControl( Gwen::Controls::Base* pCtrl, int x, int y ) -{ - // - // We use this global variable to represent our hovered control - // That way, if the new hovered control gets deleted in one of the - // Hover callbacks, we won't be left with a hanging pointer. - // This isn't ideal - but it's minimal. - // - NewHoveredControl = pCtrl; - - // Nothing to change.. - if ( DragAndDrop::HoveredControl == NewHoveredControl ) { return; } - - // We changed - tell the old hovered control that it's no longer hovered. - if ( DragAndDrop::HoveredControl && DragAndDrop::HoveredControl != NewHoveredControl ) - { DragAndDrop::HoveredControl->DragAndDrop_HoverLeave( DragAndDrop::CurrentPackage ); } - - // If we're hovering where the control came from, just forget it. - // By changing it to NULL here we're not going to show any error cursors - // it will just do nothing if you drop it. - if ( NewHoveredControl == DragAndDrop::SourceControl ) - { NewHoveredControl = NULL; } - - // Check to see if the new potential control can accept this type of package. - // If not, ignore it and show an error cursor. - while ( NewHoveredControl && !NewHoveredControl->DragAndDrop_CanAcceptPackage( DragAndDrop::CurrentPackage ) ) - { - // We can't drop on this control, so lets try to drop - // onto its parent.. - NewHoveredControl = NewHoveredControl->GetParent(); - - // Its parents are dead. We can't drop it here. - // Show the NO WAY cursor. - if ( !NewHoveredControl ) - { - Platform::SetCursor( CursorType::No ); - } - } - - // Become out new hovered control - DragAndDrop::HoveredControl = NewHoveredControl; - - // If we exist, tell us that we've started hovering. - if ( DragAndDrop::HoveredControl ) - { - DragAndDrop::HoveredControl->DragAndDrop_HoverEnter( DragAndDrop::CurrentPackage, x, y ); - } - - NewHoveredControl = NULL; -} - -void DragAndDrop::OnMouseMoved( Gwen::Controls::Base* pHoveredControl, int x, int y ) -{ - // Always keep these up to date, they're used to draw the dragged control. - m_iMouseX = x; - m_iMouseY = y; - - // If we're not carrying anything, then check to see if we should - // pick up from a control that we're holding down. If not, then forget it. - if ( !CurrentPackage && !ShouldStartDraggingControl( x, y ) ) - { return; } - - // Make sure the canvas redraws when we move - if ( CurrentPackage && CurrentPackage->drawcontrol ) - { CurrentPackage->drawcontrol->Redraw(); } - - // Swap to this new hovered control and notify them of the change. - UpdateHoveredControl( pHoveredControl, x, y ); - - if ( !HoveredControl ) { return; } - - // Update the hovered control every mouse move, so it can show where - // the dropped control will land etc.. - HoveredControl->DragAndDrop_Hover( CurrentPackage, x, y ); - // Override the cursor - since it might have been set my underlying controls - // Ideally this would show the 'being dragged' control. TODO - Platform::SetCursor( CursorType::Normal ); - pHoveredControl->Redraw(); -} - -void DragAndDrop::RenderOverlay( Gwen::Controls::Canvas* /*pCanvas*/, Skin::Base* skin ) -{ - if ( !CurrentPackage ) { return; } - - if ( !CurrentPackage->drawcontrol ) { return; } - - Gwen::Point pntOld = skin->GetRender()->GetRenderOffset(); - skin->GetRender()->AddRenderOffset( Gwen::Rect( m_iMouseX - SourceControl->X() - CurrentPackage->holdoffset.x, m_iMouseY - SourceControl->Y() - CurrentPackage->holdoffset.y, 0, 0 ) ); - CurrentPackage->drawcontrol->DoRender( skin ); - skin->GetRender()->SetRenderOffset( pntOld ); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/DragAndDrop.h b/OpenSauce/shared/Include/GWEN/DragAndDrop.h deleted file mode 100644 index 0ed41e288..000000000 --- a/OpenSauce/shared/Include/GWEN/DragAndDrop.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ - -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_DRAGANDDROP_H -#define GWEN_DRAGANDDROP_H - -#include - -#include "Gwen/Skin.h" -#include "Gwen/Structures.h" - -namespace Gwen -{ - namespace DragAndDrop - { - extern GWEN_EXPORT Package* CurrentPackage; - extern GWEN_EXPORT Gwen::Controls::Base* SourceControl; - extern GWEN_EXPORT Gwen::Controls::Base* HoveredControl; - - bool GWEN_EXPORT Start( Gwen::Controls::Base* pControl, Package* pPackage ); - - bool GWEN_EXPORT OnMouseButton( Gwen::Controls::Base* pHoveredControl, int x, int y, bool bDown ); - void GWEN_EXPORT OnMouseMoved( Gwen::Controls::Base* pHoveredControl, int x, int y ); - - void GWEN_EXPORT RenderOverlay( Gwen::Controls::Canvas* pCanvas, Skin::Base* skin ); - - void GWEN_EXPORT ControlDeleted( Gwen::Controls::Base* pControl ); - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Events.h b/OpenSauce/shared/Include/GWEN/Events.h deleted file mode 100644 index 5ee7ef668..000000000 --- a/OpenSauce/shared/Include/GWEN/Events.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_EVENTS_H -#define GWEN_EVENTS_H - -#include -#include "Gwen/Exports.h" -#include "Gwen/Structures.h" -#include "Gwen/TextObject.h" -#include "Gwen/ControlList.h" - -namespace Gwen -{ - - namespace Controls - { - class Base; - } - - namespace Event - { - /* - - Passed to an event hook - - */ - struct Information - { - Information() { Init(); } - Information( Gwen::Controls::Base* pctrl ) { Init(); Control = pctrl; } - - void Init() - { - ControlCaller = NULL; - Data = NULL; - Control = NULL; - Integer = 0; - } - - // This is set by the event caller, it will always be - // the control which is calling the event. - Gwen::Controls::Base* ControlCaller; - - // This is set by the event hook - void* Data; - - // - // These are set by the event and may or may not be set. - // - Gwen::Controls::Base* Control; - - Gwen::ControlList ControlList; - Gwen::TextObject String; - Gwen::Point Point; - int Integer; - - }; - - typedef const Gwen::Event::Information & Info; - - - class Caller; - - // A class must be derived from this - class GWEN_EXPORT Handler - { - public: - - Handler(); - virtual ~Handler(); - - void RegisterCaller( Caller* ); - void UnRegisterCaller( Caller* ); - - protected: - - void CleanLinks(); - std::list m_Callers; - - public: - - typedef void ( Handler::*Function )( Gwen::Controls::Base* pFromPanel ); - typedef void ( Handler::*FunctionBlank )(); - typedef void ( Handler::*FunctionWithInformation )( Gwen::Event::Info info ); - typedef void ( *GlobalFunction )( Gwen::Controls::Base* pFromPanel ); - typedef void ( *GlobalFunctionBlank )(); - typedef void ( *GlobalFunctionWithInformation )( Gwen::Event::Info info ); - - }; - - - - // - // - // - class GWEN_EXPORT Caller - { - public: - - Caller(); - ~Caller(); - - void Call( Controls::Base* pThis ); - void Call( Controls::Base* pThis, Gwen::Event::Info info ); - - template void Add( Event::Handler* ob, T f ) { AddInternal( ob, static_cast( f ) ); } - template void Add( Event::Handler* ob, void ( T::*f )( Gwen::Event::Info ) ) { AddInternal( ob, static_cast( f ) ); } - template void Add( Event::Handler* ob, void ( T::*f )( Gwen::Event::Info ), void* data ) { AddInternal( ob, static_cast( f ), data ); } - template void Add( Event::Handler* ob, void ( T::*f )() ) { AddInternal( ob, static_cast( f ) ); } - - template void GlobalAdd( Event::Handler* ob, T f ) { AddInternal( ob, static_cast( f ) ); } - void GlobalAdd( Event::Handler* ob, void ( *f )( Gwen::Event::Info ) ) { AddInternal( ob, static_cast( f ) ); } - void GlobalAdd( Event::Handler* ob, void ( *f )( Gwen::Event::Info ), void* data ) { AddInternal( ob, static_cast( f ), data ); } - void GlobalAdd( Event::Handler* ob, void ( *f )() ) { AddInternal( ob, static_cast( f ) ); } - - void RemoveHandler( Event::Handler* pObject ); - - protected: - - void CleanLinks(); - void AddInternal( Event::Handler* pObject, Handler::Function pFunction ); - void AddInternal( Event::Handler* pObject, Handler::FunctionWithInformation pFunction ); - void AddInternal( Event::Handler* pObject, Handler::FunctionWithInformation pFunction, void* data ); - void AddInternal( Event::Handler* pObject, Handler::FunctionBlank pFunction ); - void AddInternal( Event::Handler* pObject, Handler::GlobalFunction pFunction ); - void AddInternal( Event::Handler* pObject, Handler::GlobalFunctionWithInformation pFunction ); - void AddInternal( Event::Handler* pObject, Handler::GlobalFunctionWithInformation pFunction, void* data ); - void AddInternal( Event::Handler* pObject, Handler::GlobalFunctionBlank pFunction ); - - struct handler - { - handler() - { - fnFunction = NULL; - fnFunctionInfo = NULL; - fnFunctionBlank = NULL; - fnGlobalFunction = NULL; - fnGlobalFunctionInfo = NULL; - fnGlobalFunctionBlank = NULL; - pObject = NULL; - } - - Handler::Function fnFunction; - Handler::FunctionWithInformation fnFunctionInfo; - Handler::FunctionBlank fnFunctionBlank; - Handler::GlobalFunction fnGlobalFunction; - Handler::GlobalFunctionWithInformation fnGlobalFunctionInfo; - Handler::GlobalFunctionBlank fnGlobalFunctionBlank; - - Event::Handler* pObject; - void* Data; - }; - - std::list m_Handlers; - }; - - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Exports.h b/OpenSauce/shared/Include/GWEN/Exports.h deleted file mode 100644 index cd9cb8fa4..000000000 --- a/OpenSauce/shared/Include/GWEN/Exports.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_EXPORTS_H -#define GWEN_EXPORTS_H - -// -// GWEN_COMPILE_DLL -// - We're compiling the Gwen.DLL (or .dylib etc) -// -#if defined(GWEN_COMPILE_DLL) - -#ifdef _WIN32 -#if defined(__GNUC__) -#define GWEN_EXPORT __attribute__((dllexport)) -#else -#define GWEN_EXPORT __declspec(dllexport) -#endif -#endif -// -// GWEN_COMPILE_STATIC -// - We're compiling gwen as a static library -// -#elif defined(GWEN_COMPILE_STATIC) - -#define GWEN_EXPORT - -// -// GWEN_DLL -// - We're including gwen using the dll -// -#elif defined( GWEN_DLL ) - -#ifdef _WIN32 -#ifdef __GNUC__ -#define GWEN_EXPORT __attribute__((dllimport)) -#else -#define GWEN_EXPORT __declspec(dllimport) -#endif -#endif - -// -// - We're including gwen using a static library -// -#else - -#define GWEN_EXPORT - -#endif - -#ifndef GWEN_EXPORT -#define GWEN_EXPORT -#endif - - - -#endif // GWEN_EXPORTS_H -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Font.h b/OpenSauce/shared/Include/GWEN/Font.h deleted file mode 100644 index 628806bcc..000000000 --- a/OpenSauce/shared/Include/GWEN/Font.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_FONT_H -#define GWEN_FONT_H - -#include -#include - -#include "Gwen/BaseRender.h" - -namespace Gwen -{ - - struct Font - { - typedef std::list List; - - Font() - { - data = NULL; - facename = L"Arial"; - size = 10; - realsize = 0; - bold = false; - } - - UnicodeString facename; - float size; - bool bold; - - // This should be set by the renderer - // if it tries to use a font where it's - // NULL. - void* data; - - // This is the real font size, after it's - // been scaled by Render->Scale() - float realsize; - - }; - -} //namespace Gwen -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Gwen.cpp b/OpenSauce/shared/Include/GWEN/Gwen.cpp deleted file mode 100644 index 09845fb2b..000000000 --- a/OpenSauce/shared/Include/GWEN/Gwen.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include -#include - - -namespace Gwen -{ - // Globals - GWEN_EXPORT Controls::Base* HoveredControl = NULL; - GWEN_EXPORT Controls::Base* KeyboardFocus = NULL; - GWEN_EXPORT Controls::Base* MouseFocus = NULL; - - namespace Debug - { - void Msg( const char* str, ... ) - { - char strOut[1024]; - va_list s; - va_start( s, str ); - vsnprintf( strOut, sizeof( strOut ), str, s ); - va_end( s ); - GwenUtil_OutputDebugCharString( strOut ); - } -#ifdef UNICODE - void Msg( const wchar_t* str, ... ) - { - wchar_t strOut[1024]; - va_list s; - va_start( s, str ); - vswprintf( strOut, sizeof( strOut ), str, s ); - va_end( s ); - GwenUtil_OutputDebugWideString( strOut ); - } -#endif - void AssertCheck( bool b, const char* strMsg ) - { - if ( b ) { return; } - - Msg( "Assert: %s\n", strMsg ); -#ifdef _WIN32 - MessageBoxA( NULL, strMsg, "Assert", MB_ICONEXCLAMATION | MB_OK ); - __debugbreak(); -#endif - } - } - -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Gwen.h b/OpenSauce/shared/Include/GWEN/Gwen.h deleted file mode 100644 index 4a420d050..000000000 --- a/OpenSauce/shared/Include/GWEN/Gwen.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - GWEN - - Copyright (c) 2010 Facepunch Studios - - MIT License - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_GWEN_H -#define GWEN_GWEN_H - -#include -#include -#include -#include -#include - -#include "Gwen/Macros.h" -#include "Gwen/Config.h" -#include "Gwen/Exports.h" -#include "Gwen/Structures.h" -#include "Gwen/Skin.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Controls/Canvas.h" -#include "Gwen/Align.h" - -// Enable the hook system (se Hook.h) -#define GWEN_HOOKSYSTEM - -namespace Gwen -{ - namespace Controls - { - class Base; - class Canvas; - } - - namespace Renderer - { - class Base; - } - - namespace Debug - { - void GWEN_EXPORT Msg( const wchar_t* str, ... ); - void GWEN_EXPORT Msg( const char* str, ... ); - void GWEN_EXPORT AssertCheck( bool b, const char* strMsg ); - } - - - namespace Colors - { - static const Color Black( 0, 0, 0, 255 ); - static const Color Red( 255, 0, 0, 255 ); - static const Color Yellow( 255, 255, 0, 255 ); - static const Color White( 255, 255, 255, 255 ); - static const Color Blue( 0, 0, 255, 255 ); - static const Color Green( 0, 255, 0, 255 ); - static const Color Grey( 200, 200, 200, 255 ); - static const Color GreyLight( 230, 230, 230, 255 ); - static const Color GwenPink( 255, 65, 199, 255 ); - - - }; - - extern GWEN_EXPORT Controls::Base* HoveredControl; - extern GWEN_EXPORT Controls::Base* KeyboardFocus; - extern GWEN_EXPORT Controls::Base* MouseFocus; - - namespace Input - { - inline void Blur() - { - if ( KeyboardFocus ) - { KeyboardFocus->Blur(); } - } - } - -} //namespace Gwen - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Hook.cpp b/OpenSauce/shared/Include/GWEN/Hook.cpp deleted file mode 100644 index ae35253da..000000000 --- a/OpenSauce/shared/Include/GWEN/Hook.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Hook.h" - -#ifdef GWEN_HOOKSYSTEM - -using namespace Gwen; -using namespace Gwen::Hook; - -std::list g_HookList; - -void Gwen::Hook::AddHook( BaseHook* pHook ) -{ - g_HookList.push_back( pHook ); -} - -void Gwen::Hook::RemoveHook( BaseHook* pHook ) -{ - g_HookList.remove( pHook ); -} - -HookList & Gwen::Hook::GetHookList() -{ - return g_HookList; -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Hook.h b/OpenSauce/shared/Include/GWEN/Hook.h deleted file mode 100644 index 98fc72c33..000000000 --- a/OpenSauce/shared/Include/GWEN/Hook.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_HOOK_H -#define GWEN_HOOK_H - -#include "Gwen/Gwen.h" -#include - -#ifdef GWEN_HOOKSYSTEM - -namespace Gwen -{ - namespace Hook - { - class GWEN_EXPORT BaseHook - { - public: - - virtual bool OnControlClicked( Gwen::Controls::Base*, int /*iMouseX*/, int /*iMouseY*/ ) { return false; }; - }; - - typedef std::list HookList; - - GWEN_EXPORT HookList & GetHookList(); - - GWEN_EXPORT void AddHook( BaseHook* pHook ); - GWEN_EXPORT void RemoveHook( BaseHook* pHook ); - - template< typename fnc > - bool CallHook( fnc f ) - { - for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it ) - { - if ( ( ( *it )->*f )() ) { return true; } - } - - return false; - } - - template< typename fnc, typename AA > - bool CallHook( fnc f, AA a ) - { - for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it ) - { - if ( ( ( *it )->*f )( a ) ) { return true; } - } - - return false; - } - - template< typename fnc, typename AA, typename AB > - bool CallHook( fnc f, AA a, AB b ) - { - for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it ) - { - if ( ( ( *it )->*f )( a, b ) ) { return true; } - } - - return false; - } - - template< typename fnc, typename AA, typename AB, typename AC > - bool CallHook( fnc f, AA a, AB b, AC c ) - { - for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it ) - { - if ( ( ( *it )->*f )( a, b, c ) ) { return true; } - } - - return false; - } - } - -} - -#endif -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/InputHandler.h b/OpenSauce/shared/Include/GWEN/InputHandler.h deleted file mode 100644 index 0274ce80a..000000000 --- a/OpenSauce/shared/Include/GWEN/InputHandler.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_INPUTHANDLER_H -#define GWEN_INPUTHANDLER_H - -#include -#include "Gwen/Gwen.h" - -namespace Gwen -{ - namespace Controls - { - class Base; - } - - namespace Key - { - const unsigned char Invalid = 0; - const unsigned char Return = 1; - const unsigned char Backspace = 2; - const unsigned char Delete = 3; - const unsigned char Left = 4; - const unsigned char Right = 5; - const unsigned char Shift = 6; - const unsigned char Tab = 7; - const unsigned char Space = 8; - const unsigned char Home = 9; - const unsigned char End = 10; - const unsigned char Control = 11; - const unsigned char Up = 12; - const unsigned char Down = 13; - const unsigned char Escape = 14; - const unsigned char Alt = 15; - - const unsigned char Count = 16; - } - - namespace Input - { - namespace Message - { - enum - { - Copy, - Paste, - Cut, - Undo, - Redo, - SelectAll - }; - }; - - - - // For use in panels - bool GWEN_EXPORT IsKeyDown( int iKey ); - bool GWEN_EXPORT IsLeftMouseDown(); - bool GWEN_EXPORT IsRightMouseDown(); - Gwen::Point GWEN_EXPORT GetMousePosition(); - - inline bool IsShiftDown() { return IsKeyDown( Gwen::Key::Shift ); } - inline bool IsControlDown() { return IsKeyDown( Gwen::Key::Control ); } - - // Does copy, paste etc - bool GWEN_EXPORT DoSpecialKeys( Controls::Base* pCanvas, Gwen::UnicodeChar chr ); - bool GWEN_EXPORT HandleAccelerator( Controls::Base* pCanvas, Gwen::UnicodeChar chr ); - - // Send input to canvas for study - void GWEN_EXPORT OnMouseMoved( Controls::Base* pCanvas, int x, int y, int deltaX, int deltaY ); - bool GWEN_EXPORT OnMouseClicked( Controls::Base* pCanvas, int iButton, bool bDown ); - bool GWEN_EXPORT OnKeyEvent( Controls::Base* pCanvas, int iKey, bool bDown ); - void GWEN_EXPORT OnCanvasThink( Controls::Base* pControl ); - - - }; -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Macros.h b/OpenSauce/shared/Include/GWEN/Macros.h deleted file mode 100644 index dfca8ed72..000000000 --- a/OpenSauce/shared/Include/GWEN/Macros.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -// C RunTime Header Files -#ifndef GWEN_MACROS_H -#define GWEN_MACROS_H -#include -#include -#include -#include - -#ifdef _WIN32 - -#ifndef NOMINMAX -#define NOMINMAX -#endif -#include - - -#define GwenUtil_OutputDebugCharString( lpOutputString ) OutputDebugStringA( lpOutputString ) -#define GwenUtil_OutputDebugWideString( lpOutputString ) OutputDebugStringW( lpOutputString ) -//#define GwenUtil_WideStringToFloat( _Str ) _wtof( _Str ) - -#elif defined(__APPLE__) - -#include -#define GwenUtil_OutputDebugCharString( lpOutputString ) //printf( lpOutputString ) -#define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString ) -//#define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL) - -#elif defined(__linux__) - -#define GwenUtil_OutputDebugCharString( lpOutputString ) //printf( lpOutputString ) -#define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString ) -//#define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL) - -#else - -#error MUST_IMPLEMENT_PLATFORM - -#endif - - -namespace Gwen -{ - template - inline T Min( T a, T b ) - { - return a < b ? a : b; - } - - template - inline T Max( T a, T b ) - { - return a > b ? a : b; - } - - template - inline T Clamp( T current, T vmin, T vmax ) - { - if ( current >= vmax ) { return vmax; } - - if ( current <= vmin ) { return vmin; } - - return current; - } - - template - inline T Approach( T fCurrent, T fTarget, T2 fDelta ) - { - if ( fCurrent < fTarget ) - { - fCurrent += fDelta; - - if ( fCurrent > fTarget ) { return fTarget; } - } - else if ( fCurrent > fTarget ) - { - fCurrent -= fDelta; - - if ( fCurrent < fTarget ) { return fTarget; } - } - - return fCurrent; - } -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Platform.h b/OpenSauce/shared/Include/GWEN/Platform.h deleted file mode 100644 index d3e01fd6d..000000000 --- a/OpenSauce/shared/Include/GWEN/Platform.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_PLATFORM_H -#define GWEN_PLATFORM_H - -#include "Gwen/Structures.h" -#include "Gwen/Events.h" - -namespace Gwen -{ - namespace Platform - { - // - // Do nothing for this many milliseconds - // - GWEN_EXPORT void Sleep( unsigned int iMS ); - - // - // Set the system cursor to iCursor - // Cursors are defined in Structures.h - // - GWEN_EXPORT void SetCursor( unsigned char iCursor ); - - // - // - // - GWEN_EXPORT void GetCursorPos( Gwen::Point & p ); - GWEN_EXPORT void GetDesktopSize( int & w, int & h ); - - // - // Used by copy/paste - // - GWEN_EXPORT UnicodeString GetClipboardText(); - GWEN_EXPORT bool SetClipboardText( const UnicodeString & str ); - - // - // Needed for things like double click - // - GWEN_EXPORT float GetTimeInSeconds(); - - // - // System Dialogs ( Can return false if unhandled ) - // - GWEN_EXPORT bool FileOpen( const String & Name, const String & StartPath, const String & Extension, Gwen::Event::Handler* pHandler, Event::Handler::FunctionWithInformation fnCallback ); - GWEN_EXPORT bool FileSave( const String & Name, const String & StartPath, const String & Extension, Gwen::Event::Handler* pHandler, Event::Handler::FunctionWithInformation fnCallback ); - GWEN_EXPORT bool FolderOpen( const String & Name, const String & StartPath, Gwen::Event::Handler* pHandler, Event::Handler::FunctionWithInformation fnCallback ); - - - // - // Window Creation - // - GWEN_EXPORT void* CreatePlatformWindow( int x, int y, int w, int h, const Gwen::String & strWindowTitle ); - GWEN_EXPORT void DestroyPlatformWindow( void* pPtr ); - GWEN_EXPORT void SetBoundsPlatformWindow( void* pPtr, int x, int y, int w, int h ); - GWEN_EXPORT void MessagePump( void* pWindow, Gwen::Controls::Canvas* ptarget ); - GWEN_EXPORT bool HasFocusPlatformWindow( void* pPtr ); - GWEN_EXPORT void SetWindowMaximized( void* pPtr, bool bMaximized, Gwen::Point & pNewPos, Gwen::Point & pNewSize ); - GWEN_EXPORT void SetWindowMinimized( void* pPtr, bool bMinimized ); - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Platforms/HaloRuntime.cpp b/OpenSauce/shared/Include/GWEN/Platforms/HaloRuntime.cpp deleted file mode 100644 index 5d9367e71..000000000 --- a/OpenSauce/shared/Include/GWEN/Platforms/HaloRuntime.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - GWEN - Copyright (c) 2012 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Rasterizer/DX9/DX9.hpp" - -#include "Gwen/Macros.h" -#include "Gwen/Platform.h" - -#include - -void Gwen::Platform::Sleep( unsigned int iMS ) -{ - YELO_ERROR_CRITICAL("Sleep not applicable in Halo runtime"); -} - -void Gwen::Platform::SetCursor( unsigned char iCursor ) -{ - YELO_ERROR_CRITICAL("SetCursor not applicable in Halo runtime"); -} - -Gwen::UnicodeString Gwen::Platform::GetClipboardText() -{ - if ( !OpenClipboard( NULL ) ) { return L""; } - - HANDLE hData = GetClipboardData( CF_UNICODETEXT ); - - if ( hData == NULL ) - { - CloseClipboard(); - return L""; - } - - wchar_t* buffer = ( wchar_t* ) GlobalLock( hData ); - UnicodeString str = buffer; - GlobalUnlock( hData ); - CloseClipboard(); - return str; -} - -bool Gwen::Platform::SetClipboardText( const Gwen::UnicodeString & str ) -{ - if ( !OpenClipboard( NULL ) ) { return false; } - - EmptyClipboard(); - // Create a buffer to hold the string - size_t iDataSize = ( str.length() + 1 ) * sizeof( wchar_t ); - HGLOBAL clipbuffer = GlobalAlloc( GMEM_DDESHARE, iDataSize ); - // Copy the string into the buffer - wchar_t* buffer = ( wchar_t* ) GlobalLock( clipbuffer ); - wcscpy( buffer, str.c_str() ); - GlobalUnlock( clipbuffer ); - // Place it on the clipboard - SetClipboardData( CF_UNICODETEXT, clipbuffer ); - CloseClipboard(); - return true; -} - -double GetPerformanceFrequency() -{ - static double Frequency = 0.0f; - - if ( Frequency == 0.0f ) - { - __int64 perfFreq; - QueryPerformanceFrequency( ( LARGE_INTEGER* ) &perfFreq ); - Frequency = 1.0 / ( double ) perfFreq; - } - - return Frequency; -} - -float Gwen::Platform::GetTimeInSeconds() -{ - static float fCurrentTime = 0.0f; - static __int64 iLastTime = 0; - __int64 thistime; - QueryPerformanceCounter( ( LARGE_INTEGER* ) &thistime ); - float fSecondsDifference = ( double )( thistime - iLastTime ) * GetPerformanceFrequency(); - - if ( fSecondsDifference > 0.1f ) { fSecondsDifference = 0.1f; } - - fCurrentTime += fSecondsDifference; - iLastTime = thistime; - return fCurrentTime; -} - -bool Gwen::Platform::FileOpen( const String & Name, const String & StartPath, const String & Extension, Gwen::Event::Handler* pHandler, Event::Handler::FunctionWithInformation fnCallback ) -{ - YELO_ERROR_CRITICAL("FileOpen not applicable in Halo runtime"); - return false; -} - -bool Gwen::Platform::FileSave( const String & Name, const String & StartPath, const String & Extension, Gwen::Event::Handler* pHandler, Gwen::Event::Handler::FunctionWithInformation fnCallback ) -{ - YELO_ERROR_CRITICAL("FileSave not applicable in Halo runtime"); - return false; -} - -bool Gwen::Platform::FolderOpen( const String & Name, const String & StartPath, Gwen::Event::Handler* pHandler, Event::Handler::FunctionWithInformation fnCallback ) -{ - YELO_ERROR_CRITICAL("FolderOpen not applicable in Halo runtime"); - return false; -} - -void* Gwen::Platform::CreatePlatformWindow( int x, int y, int w, int h, const Gwen::String & strWindowTitle ) -{ - YELO_ERROR_CRITICAL("CreatePlatformWindow not applicable in Halo runtime"); - return nullptr; -} - -void Gwen::Platform::DestroyPlatformWindow( void* pPtr ) -{ - YELO_ERROR_CRITICAL("DestroyPlatformWindow not applicable in Halo runtime"); -} - -void Gwen::Platform::MessagePump( void* pWindow, Gwen::Controls::Canvas* ptarget ) -{ - YELO_ERROR_CRITICAL("MessagePump not applicable in Halo runtime"); -} - -void Gwen::Platform::SetBoundsPlatformWindow( void* pPtr, int x, int y, int w, int h ) -{ - YELO_ERROR_CRITICAL("SetBoundsPlatformWindow not applicable in Halo runtime"); -} - -void Gwen::Platform::SetWindowMaximized( void* pPtr, bool bMax, Gwen::Point & pNewPos, Gwen::Point & pNewSize ) -{ - YELO_ERROR_CRITICAL("SetWindowMaximized not applicable in Halo runtime"); -} - -void Gwen::Platform::SetWindowMinimized( void* pPtr, bool bMinimized ) -{ - YELO_ERROR_CRITICAL("SetWindowMinimized not applicable in Halo runtime"); -} - -bool Gwen::Platform::HasFocusPlatformWindow( void* pPtr ) -{ - YELO_ERROR_CRITICAL("HasFocusPlatformWindow not applicable in Halo runtime"); - return true; -} - -void Gwen::Platform::GetDesktopSize( int & w, int & h ) -{ - w = Yelo::DX9::D3DPresetParams()->BackBufferWidth; - h = Yelo::DX9::D3DPresetParams()->BackBufferHeight; -} - -void Gwen::Platform::GetCursorPos( Gwen::Point & po ) -{ - YELO_ERROR_CRITICAL("GetCursorPos not applicable in Halo runtime"); -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Skin.cpp b/OpenSauce/shared/Include/GWEN/Skin.cpp deleted file mode 100644 index 6cb303f9b..000000000 --- a/OpenSauce/shared/Include/GWEN/Skin.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Gwen.h" -#include - -namespace Gwen -{ - namespace Skin - { - /* - - Here we're drawing a few symbols such as the directional arrows and the checkbox check - - Texture'd skins don't generally use these - but the Simple skin does. We did originally - use the marlett font to draw these.. but since that's a Windows font it wasn't a very - good cross platform solution. - - */ - - void Base::DrawArrowDown( Gwen::Rect rect ) - { - float x = ( rect.w / 5.0f ); - float y = ( rect.h / 5.0f ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 0.0f, rect.y + y * 1.0f, x, y * 1.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 1.0f, x, y * 2.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 2.0f, rect.y + y * 1.0f, x, y * 3.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 3.0f, rect.y + y * 1.0f, x, y * 2.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 4.0f, rect.y + y * 1.0f, x, y * 1.0f ) ); - } - - void Base::DrawArrowUp( Gwen::Rect rect ) - { - float x = ( rect.w / 5.0f ); - float y = ( rect.h / 5.0f ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 0.0f, rect.y + y * 3.0f, x, y * 1.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 2.0f, x, y * 2.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 2.0f, rect.y + y * 1.0f, x, y * 3.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 3.0f, rect.y + y * 2.0f, x, y * 2.0f ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 4.0f, rect.y + y * 3.0f, x, y * 1.0f ) ); - } - - void Base::DrawArrowLeft( Gwen::Rect rect ) - { - float x = ( rect.w / 5.0f ); - float y = ( rect.h / 5.0f ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 3.0f, rect.y + y * 0.0f, x * 1.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 2.0f, rect.y + y * 1.0f, x * 2.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 2.0f, x * 3.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 2.0f, rect.y + y * 3.0f, x * 2.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 3.0f, rect.y + y * 4.0f, x * 1.0f, y ) ); - } - - void Base::DrawArrowRight( Gwen::Rect rect ) - { - float x = ( rect.w / 5.0f ); - float y = ( rect.h / 5.0f ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 0.0f, x * 1.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 1.0f, x * 2.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 2.0f, x * 3.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 3.0f, x * 2.0f, y ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 4.0f, x * 1.0f, y ) ); - } - - void Base::DrawCheck( Gwen::Rect rect ) - { - float x = ( rect.w / 5.0f ); - float y = ( rect.h / 5.0f ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 0.0f, rect.y + y * 3.0f, x * 2, y * 2 ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 1.0f, rect.y + y * 4.0f, x * 2, y * 2 ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 2.0f, rect.y + y * 3.0f, x * 2, y * 2 ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 3.0f, rect.y + y * 1.0f, x * 2, y * 2 ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + x * 4.0f, rect.y + y * 0.0f, x * 2, y * 2 ) ); - } - - void Base::DrawTreeNode( Controls::Base* ctrl, bool bOpen, bool bSelected, int iLabelHeight, int iLabelWidth, int iHalfWay, int iLastBranch, bool bIsRoot ) - { - GetRender()->SetDrawColor( Colors.Tree.Lines ); - - if ( !bIsRoot ) - { GetRender()->DrawFilledRect( Gwen::Rect( 8, iHalfWay, 16 - 9, 1 ) ); } - - if ( !bOpen ) { return; } - - GetRender()->DrawFilledRect( Gwen::Rect( 14 + 7, iLabelHeight + 1, 1, iLastBranch + iHalfWay - iLabelHeight ) ); - } - - void Base::DrawPropertyTreeNode( Controls::Base* control, int BorderLeft, int BorderTop ) - { - Gwen::Rect rect = control->GetRenderBounds(); - m_Render->SetDrawColor( Colors.Properties.Border ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x, rect.y, BorderLeft, rect.h ) ); - m_Render->DrawFilledRect( Gwen::Rect( rect.x + BorderLeft, rect.y, rect.w - BorderLeft, BorderTop ) ); - } - - void Base::DrawPropertyRow( Controls::Base* control, int iWidth, bool bBeingEdited, bool bHovered ) - { - Gwen::Rect rect = control->GetRenderBounds(); - - if ( bBeingEdited ) { m_Render->SetDrawColor( Colors.Properties.Column_Selected ); } - else if ( bHovered ) { m_Render->SetDrawColor( Colors.Properties.Column_Hover ); } - else { m_Render->SetDrawColor( Colors.Properties.Column_Normal ); } - - m_Render->DrawFilledRect( Gwen::Rect( 0, rect.y, iWidth, rect.h ) ); - - if ( bBeingEdited ) { m_Render->SetDrawColor( Colors.Properties.Line_Selected ); } - else if ( bHovered ) { m_Render->SetDrawColor( Colors.Properties.Line_Hover ); } - else { m_Render->SetDrawColor( Colors.Properties.Line_Normal ); } - - m_Render->DrawFilledRect( Gwen::Rect( iWidth, rect.y, 1, rect.h ) ); - rect.y += rect.h - 1; - rect.h = 1; - m_Render->DrawFilledRect( rect ); - } - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Skin.h b/OpenSauce/shared/Include/GWEN/Skin.h deleted file mode 100644 index f2e0017e0..000000000 --- a/OpenSauce/shared/Include/GWEN/Skin.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ - -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_SKIN_H -#define GWEN_SKIN_H - -#include "Gwen/BaseRender.h" -#include "Gwen/Font.h" - -namespace Gwen -{ - namespace Controls - { - class Base; - } - - namespace Skin - { - namespace Symbol - { - static const unsigned char None = 0; - static const unsigned char ArrowRight = 1; - static const unsigned char Check = 2; - static const unsigned char Dot = 3; - } - - class GWEN_EXPORT Base - { - public: - - Base( Gwen::Renderer::Base* renderer = NULL ) - { - m_DefaultFont.facename = L"Arial"; - m_DefaultFont.size = 10.0f; - m_Render = renderer; - } - - virtual ~Base() - { - ReleaseFont( &m_DefaultFont ); - } - - virtual void ReleaseFont( Gwen::Font* fnt ) - { - if ( !fnt ) { return; } - - if ( !m_Render ) { return; } - - m_Render->FreeFont( fnt ); - } - - virtual void DrawGenericPanel( Controls::Base* control ) = 0; - - virtual void DrawButton( Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) = 0; - virtual void DrawTabButton( Controls::Base* control, bool bActive, int dir ) = 0; - virtual void DrawTabControl( Controls::Base* control ) = 0; - virtual void DrawTabTitleBar( Controls::Base* control ) = 0; - - - virtual void DrawMenuItem( Controls::Base* control, bool bSubmenuOpen, bool bChecked ) = 0; - virtual void DrawMenuStrip( Controls::Base* control ) = 0; - virtual void DrawMenu( Controls::Base* control, bool bPaddingDisabled ) = 0; - virtual void DrawMenuRightArrow( Controls::Base* control ) = 0; - - virtual void DrawRadioButton( Controls::Base* control, bool bSelected, bool bDepressed ) = 0; - virtual void DrawCheckBox( Controls::Base* control, bool bSelected, bool bDepressed ) = 0; - virtual void DrawGroupBox( Controls::Base* control, int textStart, int textHeight, int textWidth ) = 0; - virtual void DrawTextBox( Controls::Base* control ) = 0; - - virtual void DrawWindow( Controls::Base* control, int topHeight, bool inFocus ) = 0; - virtual void DrawWindowCloseButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) = 0; - virtual void DrawWindowMaximizeButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled, bool bMaximized ) = 0; - virtual void DrawWindowMinimizeButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) = 0; - - - virtual void DrawHighlight( Controls::Base* control ) = 0; - virtual void DrawStatusBar( Controls::Base* control ) = 0; - - virtual void DrawShadow( Controls::Base* control ) = 0; - virtual void DrawScrollBarBar( Controls::Base* control, bool bDepressed, bool isHovered, bool isHorizontal ) = 0; - virtual void DrawScrollBar( Controls::Base* control, bool isHorizontal, bool bDepressed ) = 0; - virtual void DrawScrollButton( Controls::Base* control, int iDirection, bool bDepressed, bool bHovered, bool bDisabled ) = 0; - virtual void DrawProgressBar( Controls::Base* control, bool isHorizontal, float progress ) = 0; - - virtual void DrawListBox( Controls::Base* control ) = 0; - virtual void DrawListBoxLine( Controls::Base* control, bool bSelected, bool bEven ) = 0; - - virtual void DrawSlider( Controls::Base* control, bool bIsHorizontal, int numNotches, int barSize ) = 0; - virtual void DrawSlideButton( Gwen::Controls::Base* control, bool bDepressed, bool bHorizontal ) = 0; - - virtual void DrawComboBox( Controls::Base* control, bool bIsDown, bool bIsMenuOpen ) = 0; - virtual void DrawComboDownArrow( Gwen::Controls::Base* control, bool bHovered, bool bDown, bool bOpen, bool bDisabled ) = 0; - virtual void DrawKeyboardHighlight( Controls::Base* control, const Gwen::Rect & rect, int offset ) = 0; - virtual void DrawToolTip( Controls::Base* control ) = 0; - - virtual void DrawNumericUpDownButton( Controls::Base* control, bool bDepressed, bool bUp ) = 0; - - virtual void DrawTreeButton( Controls::Base* control, bool bOpen ) = 0; - virtual void DrawTreeControl( Controls::Base* control ) = 0; - virtual void DrawTreeNode( Controls::Base* ctrl, bool bOpen, bool bSelected, int iLabelHeight, int iLabelWidth, int iHalfWay, int iLastBranch, bool bIsRoot ); - - virtual void DrawPropertyRow( Controls::Base* control, int iWidth, bool bBeingEdited, bool bHovered ); - virtual void DrawPropertyTreeNode( Controls::Base* control, int BorderLeft, int BorderTop ); - virtual void DrawColorDisplay( Controls::Base* control, Gwen::Color color ) = 0; - virtual void DrawModalControl( Controls::Base* control ) = 0; - virtual void DrawMenuDivider( Controls::Base* control ) = 0; - - virtual void DrawCategoryHolder( Controls::Base* ctrl ) = 0; - virtual void DrawCategoryInner( Controls::Base* ctrl, bool bCollapsed ) = 0; - - virtual void DrawPointer( Controls::Base* ctrl, bool bDepressed ) = 0; - - virtual void SetRender( Gwen::Renderer::Base* renderer ) - { - m_Render = renderer; - } - virtual Gwen::Renderer::Base* GetRender() - { - return m_Render; - } - - virtual void DrawArrowDown( Gwen::Rect rect ); - virtual void DrawArrowUp( Gwen::Rect rect ); - virtual void DrawArrowLeft( Gwen::Rect rect ); - virtual void DrawArrowRight( Gwen::Rect rect ); - virtual void DrawCheck( Gwen::Rect rect ); - - - struct - { - struct Window_t - { - Gwen::Color TitleActive; - Gwen::Color TitleInactive; - - } Window; - - struct Label_t - { - Gwen::Color Default; - Gwen::Color Bright; - Gwen::Color Dark; - Gwen::Color Highlight; - - } Label; - - struct Tree_t - { - Gwen::Color Lines; - Gwen::Color Normal; - Gwen::Color Hover; - Gwen::Color Selected; - - } Tree; - - struct Properties_t - { - Gwen::Color Line_Normal; - Gwen::Color Line_Selected; - Gwen::Color Line_Hover; - Gwen::Color Column_Normal; - Gwen::Color Column_Selected; - Gwen::Color Column_Hover; - Gwen::Color Label_Normal; - Gwen::Color Label_Selected; - Gwen::Color Label_Hover; - Gwen::Color Border; - Gwen::Color Title; - - } Properties; - - struct Button_t - { - Gwen::Color Normal; - Gwen::Color Hover; - Gwen::Color Down; - Gwen::Color Disabled; - - } Button; - - struct Tab_t - { - struct Active_t - { - Gwen::Color Normal; - Gwen::Color Hover; - Gwen::Color Down; - Gwen::Color Disabled; - } Active; - - struct Inactive_t - { - Gwen::Color Normal; - Gwen::Color Hover; - Gwen::Color Down; - Gwen::Color Disabled; - } Inactive; - - } Tab; - - struct Category_t - { - Gwen::Color Header; - Gwen::Color Header_Closed; - - struct Line_t - { - Gwen::Color Text; - Gwen::Color Text_Hover; - Gwen::Color Text_Selected; - Gwen::Color Button; - Gwen::Color Button_Hover; - Gwen::Color Button_Selected; - } Line; - - struct LineAlt_t - { - Gwen::Color Text; - Gwen::Color Text_Hover; - Gwen::Color Text_Selected; - Gwen::Color Button; - Gwen::Color Button_Hover; - Gwen::Color Button_Selected; - } LineAlt; - - } Category; - - Gwen::Color ModalBackground; - Gwen::Color TooltipText; - - } Colors; - - - public: - - virtual Gwen::Font* GetDefaultFont() - { - return &m_DefaultFont; - } - - virtual void SetDefaultFont( const Gwen::UnicodeString & strFacename, float fSize = 10.0f ) - { - m_DefaultFont.facename = strFacename; - m_DefaultFont.size = fSize; - } - - protected: - - Gwen::Font m_DefaultFont; - Gwen::Renderer::Base* m_Render; - - }; - }; -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Skins/TexturedBase.h b/OpenSauce/shared/Include/GWEN/Skins/TexturedBase.h deleted file mode 100644 index 09237bb8b..000000000 --- a/OpenSauce/shared/Include/GWEN/Skins/TexturedBase.h +++ /dev/null @@ -1,1050 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_SKINS_TEXTUREDBASE_H -#define GWEN_SKINS_TEXTUREDBASE_H - -#include "Gwen/Skin.h" -#include "Gwen/Gwen.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/Texture.h" -#include "Gwen/Skins/Texturing.h" - -namespace Gwen -{ - namespace Skin - { - class TexturedBase : public Gwen::Skin::Base - { - public: - - TexturedBase( Gwen::Renderer::Base* renderer ) : Gwen::Skin::Base( renderer ) - { - } - - ~TexturedBase() - { - m_Texture.Release( m_Render ); - } - - Texture m_Texture; - - struct Textures_t - { - Texturing::Bordered StatusBar; - Texturing::Bordered Selection; - Texturing::Bordered Shadow; - Texturing::Bordered Tooltip; - - struct Panel_t - { - Texturing::Bordered Normal; - Texturing::Bordered Bright; - Texturing::Bordered Dark; - Texturing::Bordered Highlight; - - } Panel; - - struct Window_t - { - Texturing::Bordered Normal; - Texturing::Bordered Inactive; - Texturing::Single Close; - Texturing::Single Close_Hover; - Texturing::Single Close_Down; - Texturing::Single Maxi; - Texturing::Single Maxi_Hover; - Texturing::Single Maxi_Down; - Texturing::Single Mini; - Texturing::Single Mini_Hover; - Texturing::Single Mini_Down; - Texturing::Single Restore; - Texturing::Single Restore_Hover; - Texturing::Single Restore_Down; - - } Window; - - - - struct Checkbox_t - { - struct Active_t - { - Texturing::Single Normal; - Texturing::Single Checked; - - } Active; - - struct Disabled_t - { - Texturing::Single Normal; - Texturing::Single Checked; - - } Disabled; - - } Checkbox; - - struct RadioButton_t - { - struct Active_t - { - Texturing::Single Normal; - Texturing::Single Checked; - - } Active; - - struct Disabled_t - { - Texturing::Single Normal; - Texturing::Single Checked; - - } Disabled; - - } RadioButton; - - struct TextBox_t - { - Texturing::Bordered Normal; - Texturing::Bordered Focus; - Texturing::Bordered Disabled; - - } TextBox; - - struct Tree_t - { - Texturing::Bordered Background; - Texturing::Single Minus; - Texturing::Single Plus; - - } Tree; - - - struct ProgressBar_t - { - Texturing::Bordered Back; - Texturing::Bordered Front; - - } ProgressBar; - - struct Scroller_t - { - Texturing::Bordered TrackV; - Texturing::Bordered ButtonV_Normal; - Texturing::Bordered ButtonV_Hover; - Texturing::Bordered ButtonV_Down; - Texturing::Bordered ButtonV_Disabled; - Texturing::Bordered TrackH; - Texturing::Bordered ButtonH_Normal; - Texturing::Bordered ButtonH_Hover; - Texturing::Bordered ButtonH_Down; - Texturing::Bordered ButtonH_Disabled; - - struct Button_t - { - Texturing::Bordered Normal[4]; - Texturing::Bordered Hover[4]; - Texturing::Bordered Down[4]; - Texturing::Bordered Disabled[4]; - - } Button; - - } Scroller; - - struct Menu_t - { - Texturing::Single RightArrow; - Texturing::Single Check; - - Texturing::Bordered Strip; - Texturing::Bordered Background; - Texturing::Bordered BackgroundWithMargin; - Texturing::Bordered Hover; - - } Menu; - - struct Input_t - { - struct Button_t - { - Texturing::Bordered Normal; - Texturing::Bordered Hovered; - Texturing::Bordered Disabled; - Texturing::Bordered Pressed; - - } Button; - - struct ListBox_t - { - Texturing::Bordered Background; - Texturing::Bordered Hovered; - - Texturing::Bordered EvenLine; - Texturing::Bordered OddLine; - Texturing::Bordered EvenLineSelected; - Texturing::Bordered OddLineSelected; - - } ListBox; - - struct UpDown_t - { - struct Up_t - { - Texturing::Single Normal; - Texturing::Single Hover; - Texturing::Single Down; - Texturing::Single Disabled; - - } Up; - - struct Down_t - { - Texturing::Single Normal; - Texturing::Single Hover; - Texturing::Single Down; - Texturing::Single Disabled; - - } Down; - - } UpDown; - - struct ComboBox_t - { - Texturing::Bordered Normal; - Texturing::Bordered Hover; - Texturing::Bordered Down; - Texturing::Bordered Disabled; - - struct Button_t - { - Texturing::Single Normal; - Texturing::Single Hover; - Texturing::Single Down; - Texturing::Single Disabled; - - } Button; - - } ComboBox; - - struct Slider_t - { - struct H_t - { - Texturing::Single Normal; - Texturing::Single Hover; - Texturing::Single Down; - Texturing::Single Disabled; - } H; - - struct V_t - { - Texturing::Single Normal; - Texturing::Single Hover; - Texturing::Single Down; - Texturing::Single Disabled; - } V; - - } Slider; - - } Input; - - struct Tab_t - { - struct Bottom_t - { - Texturing::Bordered Active; - Texturing::Bordered Inactive; - } Bottom; - - struct Top_t - { - Texturing::Bordered Active; - Texturing::Bordered Inactive; - } Top; - - struct Left_t - { - Texturing::Bordered Active; - Texturing::Bordered Inactive; - } Left; - - struct Right_t - { - Texturing::Bordered Active; - Texturing::Bordered Inactive; - } Right; - - Texturing::Bordered Control; - Texturing::Bordered HeaderBar; - - } Tab; - - struct CategoryList_t - { - Texturing::Bordered Outer; - Texturing::Bordered Inner; - Texturing::Bordered Header; - - } CategoryList; - - struct Pointer_t - { - Texturing::Bordered NotDepressed; - Texturing::Bordered Depressed; - } Pointer; - - Texturing::Bordered GroupBox; - - } Textures; - - - virtual void Init( const TextObject & TextureName ) - { - m_DefaultFont.facename = L"Microsoft Sans Serif"; - m_DefaultFont.size = 11; - m_Texture.Load( TextureName, GetRender() ); - Colors.Window.TitleActive = GetRender()->PixelColour( &m_Texture, 4 + 8 * 0, 508, Color( 255, 0, 0 ) ); - Colors.Window.TitleInactive = GetRender()->PixelColour( &m_Texture, 4 + 8 * 1, 508, Color( 255, 255, 0 ) ); - Colors.Button.Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 2, 508, Color( 255, 255, 0 ) ); - Colors.Button.Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 3, 508, Color( 255, 255, 0 ) ); - Colors.Button.Down = GetRender()->PixelColour( &m_Texture, 4 + 8 * 2, 500, Color( 255, 255, 0 ) ); - Colors.Button.Disabled = GetRender()->PixelColour( &m_Texture, 4 + 8 * 3, 500, Color( 255, 255, 0 ) ); - Colors.Tab.Active.Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 4, 508, Color( 255, 255, 0 ) ); - Colors.Tab.Active.Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 5, 508, Color( 255, 255, 0 ) ); - Colors.Tab.Active.Down = GetRender()->PixelColour( &m_Texture, 4 + 8 * 4, 500, Color( 255, 255, 0 ) ); - Colors.Tab.Active.Disabled = GetRender()->PixelColour( &m_Texture, 4 + 8 * 5, 500, Color( 255, 255, 0 ) ); - Colors.Tab.Inactive.Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 6, 508, Color( 255, 255, 0 ) ); - Colors.Tab.Inactive.Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 7, 508, Color( 255, 255, 0 ) ); - Colors.Tab.Inactive.Down = GetRender()->PixelColour( &m_Texture, 4 + 8 * 6, 500, Color( 255, 255, 0 ) ); - Colors.Tab.Inactive.Disabled = GetRender()->PixelColour( &m_Texture, 4 + 8 * 7, 500, Color( 255, 255, 0 ) ); - Colors.Label.Default = GetRender()->PixelColour( &m_Texture, 4 + 8 * 8, 508, Color( 255, 255, 0 ) ); - Colors.Label.Bright = GetRender()->PixelColour( &m_Texture, 4 + 8 * 9, 508, Color( 255, 255, 0 ) ); - Colors.Label.Dark = GetRender()->PixelColour( &m_Texture, 4 + 8 * 8, 500, Color( 255, 255, 0 ) ); - Colors.Label.Highlight = GetRender()->PixelColour( &m_Texture, 4 + 8 * 9, 500, Color( 255, 255, 0 ) ); - Colors.Tree.Lines = GetRender()->PixelColour( &m_Texture, 4 + 8 * 10, 508, Color( 255, 255, 0 ) ); - Colors.Tree.Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 11, 508, Color( 255, 255, 0 ) ); - Colors.Tree.Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 10, 500, Color( 255, 255, 0 ) ); - Colors.Tree.Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 11, 500, Color( 255, 255, 0 ) ); - Colors.Properties.Line_Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 12, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Line_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 13, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Line_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 12, 500, Color( 255, 255, 0 ) ); - Colors.Properties.Title = GetRender()->PixelColour( &m_Texture, 4 + 8 * 13, 500, Color( 255, 255, 0 ) ); - Colors.Properties.Column_Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 14, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Column_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 15, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Column_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 14, 500, Color( 255, 255, 0 ) ); - Colors.Properties.Border = GetRender()->PixelColour( &m_Texture, 4 + 8 * 15, 500, Color( 255, 255, 0 ) ); - Colors.Properties.Label_Normal = GetRender()->PixelColour( &m_Texture, 4 + 8 * 16, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Label_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 17, 508, Color( 255, 255, 0 ) ); - Colors.Properties.Label_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 16, 500, Color( 255, 255, 0 ) ); - Colors.ModalBackground = GetRender()->PixelColour( &m_Texture, 4 + 8 * 18, 508, Color( 255, 255, 0 ) ); - Colors.TooltipText = GetRender()->PixelColour( &m_Texture, 4 + 8 * 19, 508, Color( 255, 255, 0 ) ); - Colors.Category.Header = GetRender()->PixelColour( &m_Texture, 4 + 8 * 18, 500, Color( 255, 255, 0 ) ); - Colors.Category.Header_Closed = GetRender()->PixelColour( &m_Texture, 4 + 8 * 19, 500, Color( 255, 255, 0 ) ); - Colors.Category.Line.Text = GetRender()->PixelColour( &m_Texture, 4 + 8 * 20, 508, Color( 255, 255, 0 ) ); - Colors.Category.Line.Text_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 21, 508, Color( 255, 255, 0 ) ); - Colors.Category.Line.Text_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 20, 500, Color( 255, 255, 0 ) ); - Colors.Category.Line.Button = GetRender()->PixelColour( &m_Texture, 4 + 8 * 21, 500, Color( 255, 255, 0 ) ); - Colors.Category.Line.Button_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 22, 508, Color( 255, 255, 0 ) ); - Colors.Category.Line.Button_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 23, 508, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Text = GetRender()->PixelColour( &m_Texture, 4 + 8 * 22, 500, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Text_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 23, 500, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Text_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 24, 508, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Button = GetRender()->PixelColour( &m_Texture, 4 + 8 * 25, 508, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Button_Hover = GetRender()->PixelColour( &m_Texture, 4 + 8 * 24, 500, Color( 255, 255, 0 ) ); - Colors.Category.LineAlt.Button_Selected = GetRender()->PixelColour( &m_Texture, 4 + 8 * 25, 500, Color( 255, 255, 0 ) ); - Textures.Shadow.Init( &m_Texture, 448, 0, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Tooltip.Init( &m_Texture, 128, 320, 127, 31, Margin( 8, 8, 8, 8 ) ); - Textures.StatusBar.Init( &m_Texture, 128, 288, 127, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Selection.Init( &m_Texture, 384, 32, 31, 31, Margin( 4, 4, 4, 4 ) ); - Textures.Panel.Normal.Init( &m_Texture, 256, 0, 63, 63, Margin( 16, 16, 16, 16 ) ); - Textures.Panel.Bright.Init( &m_Texture, 256 + 64, 0, 63, 63, Margin( 16, 16, 16, 16 ) ); - Textures.Panel.Dark.Init( &m_Texture, 256, 64, 63, 63, Margin( 16, 16, 16, 16 ) ); - Textures.Panel.Highlight.Init( &m_Texture, 256 + 64, 64, 63, 63, Margin( 16, 16, 16, 16 ) ); - Textures.Window.Normal.Init( &m_Texture, 0, 0, 127, 127, Margin( 8, 32, 8, 8 ) ); - Textures.Window.Inactive.Init( &m_Texture, 128, 0, 127, 127, Margin( 8, 32, 8, 8 ) ); - Textures.Checkbox.Active.Checked.Init( &m_Texture, 448, 32, 15, 15 ); - Textures.Checkbox.Active.Normal.Init( &m_Texture, 464, 32, 15, 15 ); - Textures.Checkbox.Disabled.Checked.Init( &m_Texture, 448, 48, 15, 15 ); - Textures.Checkbox.Disabled.Normal.Init( &m_Texture, 464, 48, 15, 15 ); - Textures.RadioButton.Active.Checked.Init( &m_Texture, 448, 64, 15, 15 ); - Textures.RadioButton.Active.Normal.Init( &m_Texture, 464, 64, 15, 15 ); - Textures.RadioButton.Disabled.Checked.Init( &m_Texture, 448, 80, 15, 15 ); - Textures.RadioButton.Disabled.Normal.Init( &m_Texture, 464, 80, 15, 15 ); - Textures.TextBox.Normal.Init( &m_Texture, 0, 150, 127, 21, Margin( 4, 4, 4, 4 ) ); - Textures.TextBox.Focus.Init( &m_Texture, 0, 172, 127, 21, Margin( 4, 4, 4, 4 ) ); - Textures.TextBox.Disabled.Init( &m_Texture, 0, 193, 127, 21, Margin( 4, 4, 4, 4 ) ); - Textures.Menu.Strip.Init( &m_Texture, 0, 128, 127, 21, Margin( 1, 1, 1, 1 ) ); - Textures.Menu.BackgroundWithMargin.Init( &m_Texture, 128, 128, 127, 63, Margin( 24, 8, 8, 8 ) ); - Textures.Menu.Background.Init( &m_Texture, 128, 192, 127, 63, Margin( 8, 8, 8, 8 ) ); - Textures.Menu.Hover.Init( &m_Texture, 128, 256, 127, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Menu.RightArrow.Init( &m_Texture, 464, 112, 15, 15 ); - Textures.Menu.Check.Init( &m_Texture, 448, 112, 15, 15 ); - Textures.Tab.Control.Init( &m_Texture, 0, 256, 127, 127, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Bottom.Active.Init( &m_Texture, 0, 416, 63, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Bottom.Inactive.Init( &m_Texture, 0 + 128, 416, 63, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Top.Active.Init( &m_Texture, 0, 384, 63, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Top.Inactive.Init( &m_Texture, 0 + 128, 384, 63, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Left.Active.Init( &m_Texture, 64, 384, 31, 63, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Left.Inactive.Init( &m_Texture, 64 + 128, 384, 31, 63, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Right.Active.Init( &m_Texture, 96, 384, 31, 63, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.Right.Inactive.Init( &m_Texture, 96 + 128, 384, 31, 63, Margin( 8, 8, 8, 8 ) ); - Textures.Tab.HeaderBar.Init( &m_Texture, 128, 352, 127, 31, Margin( 4, 4, 4, 4 ) ); - Textures.Window.Close.Init( &m_Texture, 32, 448, 31, 31 ); - Textures.Window.Close_Hover.Init( &m_Texture, 64, 448, 31, 31 ); - Textures.Window.Close_Down.Init( &m_Texture, 96, 448, 31, 31 ); - Textures.Window.Maxi.Init( &m_Texture, 32 + 96 * 2, 448, 31, 31 ); - Textures.Window.Maxi_Hover.Init( &m_Texture, 64 + 96 * 2, 448, 31, 31 ); - Textures.Window.Maxi_Down.Init( &m_Texture, 96 + 96 * 2, 448, 31, 31 ); - Textures.Window.Restore.Init( &m_Texture, 32 + 96 * 2, 448 + 32, 31, 31 ); - Textures.Window.Restore_Hover.Init( &m_Texture, 64 + 96 * 2, 448 + 32, 31, 31 ); - Textures.Window.Restore_Down.Init( &m_Texture, 96 + 96 * 2, 448 + 32, 31, 31 ); - Textures.Window.Mini.Init( &m_Texture, 32 + 96, 448, 31, 31 ); - Textures.Window.Mini_Hover.Init( &m_Texture, 64 + 96, 448, 31, 31 ); - Textures.Window.Mini_Down.Init( &m_Texture, 96 + 96, 448, 31, 31 ); - Textures.Tree.Background.Init( &m_Texture, 256, 128, 127, 127, Margin( 16, 16, 16, 16 ) ); - Textures.Tree.Plus.Init( &m_Texture, 448, 96, 15, 15 ); - Textures.Tree.Minus.Init( &m_Texture, 464, 96, 15, 15 ); - Textures.Input.Button.Normal.Init( &m_Texture, 480, 0, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.Button.Hovered.Init( &m_Texture, 480, 32, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.Button.Disabled.Init( &m_Texture, 480, 64, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.Button.Pressed.Init( &m_Texture, 480, 96, 31, 31, Margin( 8, 8, 8, 8 ) ); - - for ( int i = 0; i < 4; i++ ) - { - Textures.Scroller.Button.Normal[i].Init( &m_Texture, 464 + 0, 208 + i * 16, 15, 15, Margin( 2, 2, 2, 2 ) ); - Textures.Scroller.Button.Hover[i].Init( &m_Texture, 480, 208 + i * 16, 15, 15, Margin( 2, 2, 2, 2 ) ); - Textures.Scroller.Button.Down[i].Init( &m_Texture, 464, 272 + i * 16, 15, 15, Margin( 2, 2, 2, 2 ) ); - Textures.Scroller.Button.Disabled[i].Init( &m_Texture, 480 + 48, 272 + i * 16, 15, 15, Margin( 2, 2, 2, 2 ) ); - } - - Textures.Scroller.TrackV.Init( &m_Texture, 384, 208, 15, 127, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonV_Normal.Init( &m_Texture, 384 + 16, 208, 15, 127, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonV_Hover.Init( &m_Texture, 384 + 32, 208, 15, 127, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonV_Down.Init( &m_Texture, 384 + 48, 208, 15, 127, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonV_Disabled.Init( &m_Texture, 384 + 64, 208, 15, 127, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.TrackH.Init( &m_Texture, 384, 128, 127, 15, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonH_Normal.Init( &m_Texture, 384, 128 + 16, 127, 15, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonH_Hover.Init( &m_Texture, 384, 128 + 32, 127, 15, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonH_Down.Init( &m_Texture, 384, 128 + 48, 127, 15, Margin( 4, 4, 4, 4 ) ); - Textures.Scroller.ButtonH_Disabled.Init( &m_Texture, 384, 128 + 64, 127, 15, Margin( 4, 4, 4, 4 ) ); - Textures.Input.ListBox.Background.Init( &m_Texture, 256, 256, 63, 127, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ListBox.Hovered.Init( &m_Texture, 320, 320, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ListBox.EvenLine.Init( &m_Texture, 352, 256, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ListBox.OddLine.Init( &m_Texture, 352, 288, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ListBox.EvenLineSelected.Init( &m_Texture, 320, 256, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ListBox.OddLineSelected.Init( &m_Texture, 320, 288, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.ComboBox.Normal.Init( &m_Texture, 384, 336, 127, 31, Margin( 8, 8, 32, 8 ) ); - Textures.Input.ComboBox.Hover.Init( &m_Texture, 384, 336 + 32, 127, 31, Margin( 8, 8, 32, 8 ) ); - Textures.Input.ComboBox.Down.Init( &m_Texture, 384, 336 + 64, 127, 31, Margin( 8, 8, 32, 8 ) ); - Textures.Input.ComboBox.Disabled.Init( &m_Texture, 384, 336 + 96, 127, 31, Margin( 8, 8, 32, 8 ) ); - Textures.Input.ComboBox.Button.Normal.Init( &m_Texture, 496, 272, 15, 15 ); - Textures.Input.ComboBox.Button.Hover.Init( &m_Texture, 496, 272 + 16, 15, 15 ); - Textures.Input.ComboBox.Button.Down.Init( &m_Texture, 496, 272 + 32, 15, 15 ); - Textures.Input.ComboBox.Button.Disabled.Init( &m_Texture, 496, 272 + 48, 15, 15 ); - Textures.Input.UpDown.Up.Normal.Init( &m_Texture, 384, 112, 7, 7 ); - Textures.Input.UpDown.Up.Hover.Init( &m_Texture, 384 + 8, 112, 7, 7 ); - Textures.Input.UpDown.Up.Down.Init( &m_Texture, 384 + 16, 112, 7, 7 ); - Textures.Input.UpDown.Up.Disabled.Init( &m_Texture, 384 + 24, 112, 7, 7 ); - Textures.Input.UpDown.Down.Normal.Init( &m_Texture, 384, 120, 7, 7 ); - Textures.Input.UpDown.Down.Hover.Init( &m_Texture, 384 + 8, 120, 7, 7 ); - Textures.Input.UpDown.Down.Down.Init( &m_Texture, 384 + 16, 120, 7, 7 ); - Textures.Input.UpDown.Down.Disabled.Init( &m_Texture, 384 + 24, 120, 7, 7 ); - Textures.ProgressBar.Back.Init( &m_Texture, 384, 0, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.ProgressBar.Front.Init( &m_Texture, 384 + 32, 0, 31, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Input.Slider.H.Normal.Init( &m_Texture, 416, 32, 15, 15 ); - Textures.Input.Slider.H.Hover.Init( &m_Texture, 416, 32 + 16, 15, 15 ); - Textures.Input.Slider.H.Down.Init( &m_Texture, 416, 32 + 32, 15, 15 ); - Textures.Input.Slider.H.Disabled.Init( &m_Texture, 416, 32 + 48, 15, 15 ); - Textures.Input.Slider.V.Normal.Init( &m_Texture, 416 + 16, 32, 15, 15 ); - Textures.Input.Slider.V.Hover.Init( &m_Texture, 416 + 16, 32 + 16, 15, 15 ); - Textures.Input.Slider.V.Down.Init( &m_Texture, 416 + 16, 32 + 32, 15, 15 ); - Textures.Input.Slider.V.Disabled.Init( &m_Texture, 416 + 16, 32 + 48, 15, 15 ); - Textures.CategoryList.Outer.Init( &m_Texture, 256, 384, 63, 63, Margin( 8, 8, 8, 8 ) ); - Textures.CategoryList.Inner.Init( &m_Texture, 256 + 64, 384, 63, 63, Margin( 8, 21, 8, 8 ) ); - Textures.CategoryList.Header.Init( &m_Texture, 320, 352, 63, 31, Margin( 8, 8, 8, 8 ) ); - Textures.Pointer.NotDepressed.Init( &m_Texture, 320, 450, 30, 30, Margin( 0, 0, 0, 0 )); - Textures.Pointer.Depressed.Init( &m_Texture, 320 + 30, 450, 30, 30, Margin( 0, 0, 0, 0 )); - Textures.GroupBox.Init( &m_Texture, 0, 448, 31, 31, Margin( 8, 8, 8, 8 ) ); - } - - - virtual void DrawButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) - { - if ( bDisabled ) { return Textures.Input.Button.Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) { return Textures.Input.Button.Pressed.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bHovered ) { return Textures.Input.Button.Hovered.Draw( GetRender(), control->GetRenderBounds() ); } - - Textures.Input.Button.Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawMenuItem( Gwen::Controls::Base* control, bool bSubmenuOpen, bool bChecked ) - { - const Gwen::Rect & rect = control->GetRenderBounds(); - - if ( bSubmenuOpen || control->IsHovered() ) { Textures.Menu.Hover.Draw( GetRender(), rect ); } - - if ( bChecked ) { Textures.Menu.Check.Draw( GetRender(), Gwen::Rect( rect.x + 4, rect.y + 3, 15, 15 ) ); } - } - - virtual void DrawMenuStrip( Gwen::Controls::Base* control ) - { - Textures.Menu.Strip.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawMenu( Gwen::Controls::Base* control, bool bPaddingDisabled ) - { - if ( !bPaddingDisabled ) - { - return Textures.Menu.BackgroundWithMargin.Draw( GetRender(), control->GetRenderBounds() ); - } - - Textures.Menu.Background.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawMenuRightArrow( Controls::Base* control ) - { - Textures.Menu.RightArrow.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawShadow( Gwen::Controls::Base* control ) - { - Gwen::Rect r = control->GetRenderBounds(); - r.x -= 4; - r.y -= 4; - r.w += 10; - r.h += 10; - Textures.Shadow.Draw( GetRender(), r ); - } - - virtual void DrawRadioButton( Gwen::Controls::Base* control, bool bSelected, bool bDepressed ) - { - if ( bSelected ) - { - if ( control->IsDisabled() ) - { Textures.RadioButton.Disabled.Checked.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.RadioButton.Active.Checked.Draw( GetRender(), control->GetRenderBounds() ); } - } - else - { - if ( control->IsDisabled() ) - { Textures.RadioButton.Disabled.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.RadioButton.Active.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - } - } - - - virtual void DrawCheckBox( Gwen::Controls::Base* control, bool bSelected, bool bDepressed ) - { - if ( bSelected ) - { - if ( control->IsDisabled() ) - { Textures.Checkbox.Disabled.Checked.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.Checkbox.Active.Checked.Draw( GetRender(), control->GetRenderBounds() ); } - } - else - { - if ( control->IsDisabled() ) - { Textures.Checkbox.Disabled.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.Checkbox.Active.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - } - } - - virtual void DrawGroupBox( Gwen::Controls::Base* control, int textStart, int textHeight, int textWidth ) - { - Gwen::Rect rect = control->GetRenderBounds(); - rect.y += textHeight * 0.5f; - rect.h -= textHeight * 0.5f; - Textures.GroupBox.Draw( GetRender(), rect, Gwen::Colors::White, true, false ); - rect.x += textStart + textWidth - 4; - rect.w -= textStart + textWidth - 4; - Textures.GroupBox.Draw( GetRender(), rect, Gwen::Colors::White, false, true, false, false, false, false, false, false, false ); - } - - virtual void DrawTextBox( Gwen::Controls::Base* control ) - { - if ( control->IsDisabled() ) - { return Textures.TextBox.Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( control->HasFocus() ) - { Textures.TextBox.Focus.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.TextBox.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - } - - virtual void DrawActiveTabButton( Gwen::Controls::Base* control, int dir ) - { - if ( dir == Pos::Bottom ) { return Textures.Tab.Bottom.Active.Draw( GetRender(), control->GetRenderBounds() + Rect( 0, -8, 0, 8 ) ); } - - if ( dir == Pos::Top ) { return Textures.Tab.Top.Active.Draw( GetRender(), control->GetRenderBounds() + Rect( 0, 0, 0, 8 ) ); } - - if ( dir == Pos::Left ) { return Textures.Tab.Left.Active.Draw( GetRender(), control->GetRenderBounds() + Rect( 0, 0, 8, 0 ) ); } - - if ( dir == Pos::Right ) { return Textures.Tab.Right.Active.Draw( GetRender(), control->GetRenderBounds() + Rect( -8, 0, 8, 0 ) ); } - } - - virtual void DrawTabButton( Gwen::Controls::Base* control, bool bActive, int dir ) - { - if ( bActive ) - { return DrawActiveTabButton( control, dir ); } - - if ( dir == Pos::Bottom ) { return Textures.Tab.Bottom.Inactive.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( dir == Pos::Top ) { return Textures.Tab.Top.Inactive.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( dir == Pos::Left ) { return Textures.Tab.Left.Inactive.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( dir == Pos::Right ) { return Textures.Tab.Right.Inactive.Draw( GetRender(), control->GetRenderBounds() ); } - } - - virtual void DrawTabControl( Gwen::Controls::Base* control ) - { - Textures.Tab.Control.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawTabTitleBar( Gwen::Controls::Base* control ) - { - Textures.Tab.HeaderBar.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawGenericPanel( Controls::Base* control ) - { - Textures.Panel.Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawWindow( Gwen::Controls::Base* control, int topHeight, bool inFocus ) - { - if ( inFocus ) { Textures.Window.Normal.Draw( GetRender(), control->GetRenderBounds() ); } - else { Textures.Window.Inactive.Draw( GetRender(), control->GetRenderBounds() ); } - } - - virtual void DrawHighlight( Gwen::Controls::Base* control ) - { - Gwen::Rect rect = control->GetRenderBounds(); - GetRender()->SetDrawColor( Gwen::Color( 255, 100, 255, 255 ) ); - GetRender()->DrawFilledRect( rect ); - } - - virtual void DrawScrollBar( Gwen::Controls::Base* control, bool isHorizontal, bool bDepressed ) - { - if ( isHorizontal ) - { Textures.Scroller.TrackH.Draw( GetRender(), control->GetRenderBounds() ); } - else - { Textures.Scroller.TrackV.Draw( GetRender(), control->GetRenderBounds() ); } - } - - virtual void DrawScrollBarBar( Controls::Base* control, bool bDepressed, bool isHovered, bool isHorizontal ) - { - if ( !isHorizontal ) - { - if ( control->IsDisabled() ) - { return Textures.Scroller.ButtonV_Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) - { return Textures.Scroller.ButtonV_Down.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( isHovered ) - { return Textures.Scroller.ButtonV_Hover.Draw( GetRender(), control->GetRenderBounds() ); } - - return Textures.Scroller.ButtonV_Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - if ( control->IsDisabled() ) - { return Textures.Scroller.ButtonH_Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) - { return Textures.Scroller.ButtonH_Down.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( isHovered ) - { return Textures.Scroller.ButtonH_Hover.Draw( GetRender(), control->GetRenderBounds() ); } - - return Textures.Scroller.ButtonH_Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - - virtual void DrawProgressBar( Gwen::Controls::Base* control, bool isHorizontal, float progress ) - { - Gwen::Rect rect = control->GetRenderBounds(); - Gwen::Color FillColour( 0, 211, 40, 255 ); - - if ( isHorizontal ) - { - Textures.ProgressBar.Back.Draw( GetRender(), rect ); - rect.w *= progress; - - if ( rect.w > 0 ) - { Textures.ProgressBar.Front.Draw( GetRender(), rect ); } - } - else - { - Textures.ProgressBar.Back.Draw( GetRender(), rect ); - int inv_progress = rect.h * ( 1 - progress ); - rect.y += inv_progress; - rect.h -= inv_progress; - Textures.ProgressBar.Front.Draw( GetRender(), rect ); - } - } - - virtual void DrawListBox( Gwen::Controls::Base* control ) - { - return Textures.Input.ListBox.Background.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawListBoxLine( Gwen::Controls::Base* control, bool bSelected, bool bEven ) - { - if ( bSelected ) - { - if ( bEven ) - { return Textures.Input.ListBox.EvenLineSelected.Draw( GetRender(), control->GetRenderBounds() ); } - else - { return Textures.Input.ListBox.OddLineSelected.Draw( GetRender(), control->GetRenderBounds() ); } - } - - if ( control->IsHovered() ) - { return Textures.Input.ListBox.Hovered.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bEven ) - { return Textures.Input.ListBox.EvenLine.Draw( GetRender(), control->GetRenderBounds() ); } - - return Textures.Input.ListBox.OddLine.Draw( GetRender(), control->GetRenderBounds() ); - } - - void DrawSliderNotchesH( Gwen::Rect rect, int numNotches, int dist ) - { - if ( numNotches == 0 ) { return; } - - float iSpacing = ( float ) rect.w / ( float ) numNotches; - - for ( int i = 0; i < numNotches + 1; i++ ) - { - GetRender()->DrawFilledRect( Gwen::Rect( rect.x + iSpacing * i, rect.y + dist - 2, 1, 5 ) ); - } - } - - void DrawSliderNotchesV( Gwen::Rect rect, int numNotches, int dist ) - { - if ( numNotches == 0 ) { return; } - - float iSpacing = ( float ) rect.h / ( float ) numNotches; - - for ( int i = 0; i < numNotches + 1; i++ ) - { - GetRender()->DrawFilledRect( Gwen::Rect( rect.x + dist - 1, rect.y + iSpacing * i, 5, 1 ) ); - } - } - - virtual void DrawSlider( Gwen::Controls::Base* control, bool bIsHorizontal, int numNotches, int barSize ) - { - if ( bIsHorizontal ) - { - Gwen::Rect rect = control->GetRenderBounds(); - rect.x += barSize * 0.5; - rect.w -= barSize; - rect.y += rect.h * 0.5 - 1; - rect.h = 1; - GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 100 ) ); - DrawSliderNotchesH( rect, numNotches, barSize * 0.5 ); - return GetRender()->DrawFilledRect( rect ); - } - - Gwen::Rect rect = control->GetRenderBounds(); - rect.y += barSize * 0.5; - rect.h -= barSize; - rect.x += rect.w * 0.5 - 1; - rect.w = 1; - GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 100 ) ); - DrawSliderNotchesV( rect, numNotches, barSize * 0.4 ); - return GetRender()->DrawFilledRect( rect ); - } - - virtual void DrawComboBox( Gwen::Controls::Base* control, bool bDown, bool bMenuOpen ) - { - if ( control->IsDisabled() ) - { return Textures.Input.ComboBox.Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDown || bMenuOpen ) - { return Textures.Input.ComboBox.Down.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( control->IsHovered() ) - { return Textures.Input.ComboBox.Hover.Draw( GetRender(), control->GetRenderBounds() ); } - - Textures.Input.ComboBox.Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawKeyboardHighlight( Gwen::Controls::Base* control, const Gwen::Rect & r, int iOffset ) - { - Gwen::Rect rect = r; - rect.x += iOffset; - rect.y += iOffset; - rect.w -= iOffset * 2; - rect.h -= iOffset * 2; - //draw the top and bottom - bool skip = true; - - for ( int i = 0; i < rect.w * 0.5; i++ ) - { - m_Render->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); - - if ( !skip ) - { - GetRender()->DrawPixel( rect.x + ( i * 2 ), rect.y ); - GetRender()->DrawPixel( rect.x + ( i * 2 ), rect.y + rect.h - 1 ); - } - else - { skip = !skip; } - } - - skip = false; - - for ( int i = 0; i < rect.h * 0.5; i++ ) - { - GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); - - if ( !skip ) - { - GetRender()->DrawPixel( rect.x , rect.y + i * 2 ); - GetRender()->DrawPixel( rect.x + rect.w - 1, rect.y + i * 2 ); - } - else - { skip = !skip; } - } - } - - virtual void DrawToolTip( Gwen::Controls::Base* control ) - { - return Textures.Tooltip.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawScrollButton( Gwen::Controls::Base* control, int iDirection, bool bDepressed, bool bHovered, bool bDisabled ) - { - int i = 0; - - if ( iDirection == Pos::Top ) { i = 1; } - - if ( iDirection == Pos::Right ) { i = 2; } - - if ( iDirection == Pos::Bottom ) { i = 3; } - - if ( bDisabled ) - { return Textures.Scroller.Button.Disabled[i].Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) - { return Textures.Scroller.Button.Down[i].Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bHovered ) - { return Textures.Scroller.Button.Hover[i].Draw( GetRender(), control->GetRenderBounds() ); } - - return Textures.Scroller.Button.Normal[i].Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawComboDownArrow( Gwen::Controls::Base* control, bool bHovered, bool bDown, bool bMenuOpen, bool bDisabled ) - { - if ( bDisabled ) - { return Textures.Input.ComboBox.Button.Disabled.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bDown || bMenuOpen ) - { return Textures.Input.ComboBox.Button.Down.Draw( GetRender(), control->GetRenderBounds() ); } - - if ( bHovered ) - { return Textures.Input.ComboBox.Button.Hover.Draw( GetRender(), control->GetRenderBounds() ); } - - Textures.Input.ComboBox.Button.Normal.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawNumericUpDownButton( Gwen::Controls::Base* control, bool bDepressed, bool bUp ) - { - if ( bUp ) - { - if ( control->IsDisabled() ) { return Textures.Input.UpDown.Up.Disabled.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) { return Textures.Input.UpDown.Up.Down.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( control->IsHovered() ) { return Textures.Input.UpDown.Up.Hover.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - return Textures.Input.UpDown.Up.Normal.DrawCenter( GetRender(), control->GetRenderBounds() ); - } - - if ( control->IsDisabled() ) { return Textures.Input.UpDown.Down.Disabled.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) { return Textures.Input.UpDown.Down.Down.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( control->IsHovered() ) { return Textures.Input.UpDown.Down.Hover.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - return Textures.Input.UpDown.Down.Normal.DrawCenter( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawStatusBar( Controls::Base* control ) - { - Textures.StatusBar.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawTreeButton( Controls::Base* control, bool bOpen ) - { - Gwen::Rect rect = control->GetRenderBounds(); - - if ( bOpen ) - { Textures.Tree.Minus.Draw( GetRender(), rect ); } - else - { Textures.Tree.Plus.Draw( GetRender(), rect ); } - } - - void DrawColorDisplay( Controls::Base* control, Gwen::Color color ) - { - Gwen::Rect rect = control->GetRenderBounds(); - - if ( color.a != 255 ) - { - GetRender()->SetDrawColor( Gwen::Color( 255, 255, 255, 255 ) ); - GetRender()->DrawFilledRect( rect ); - GetRender()->SetDrawColor( Gwen::Color( 128, 128, 128, 128 ) ); - GetRender()->DrawFilledRect( Gwen::Rect( 0, 0, rect.w * 0.5, rect.h * 0.5 ) ); - GetRender()->DrawFilledRect( Gwen::Rect( rect.w * 0.5, rect.h * 0.5, rect.w * 0.5, rect.h * 0.5 ) ); - } - - GetRender()->SetDrawColor( color ); - GetRender()->DrawFilledRect( rect ); - GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 255 ) ); - GetRender()->DrawLinedRect( rect ); - } - - virtual void DrawModalControl( Controls::Base* control ) - { - if ( !control->ShouldDrawBackground() ) { return; } - - Gwen::Rect rect = control->GetRenderBounds(); - GetRender()->SetDrawColor( Colors.ModalBackground ); - GetRender()->DrawFilledRect( rect ); - } - - virtual void DrawMenuDivider( Controls::Base* control ) - { - Gwen::Rect rect = control->GetRenderBounds(); - GetRender()->SetDrawColor( Gwen::Color( 0, 0, 0, 100 ) ); - GetRender()->DrawFilledRect( rect ); - } - - virtual void DrawTreeControl( Controls::Base* control ) - { - Textures.Tree.Background.Draw( GetRender(), control->GetRenderBounds() ); - } - - virtual void DrawWindowCloseButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) - { - Gwen::Rect r = Gwen::Rect( control->GetRenderBounds().x, control->GetRenderBounds().y, 31, 31 ); - - if ( bDisabled ) { return Textures.Window.Close.Draw( GetRender(), r, Gwen::Color( 255, 255, 255, 50 ) ); } - - if ( bDepressed ) { return Textures.Window.Close_Down.Draw( GetRender(), r ); } - - if ( bHovered ) { return Textures.Window.Close_Hover.Draw( GetRender(), r ); } - - Textures.Window.Close.Draw( GetRender(), r ); - } - - virtual void DrawWindowMaximizeButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled, bool bMaximized ) - { - Gwen::Rect r = Gwen::Rect( control->GetRenderBounds().x, control->GetRenderBounds().y, 31, 31 ); - - if ( !bMaximized ) - { - if ( bDisabled ) { return Textures.Window.Maxi.Draw( GetRender(), r, Gwen::Color( 255, 255, 255, 50 ) ); } - - if ( bDepressed ) { return Textures.Window.Maxi_Down.Draw( GetRender(), r ); } - - if ( bHovered ) { return Textures.Window.Maxi_Hover.Draw( GetRender(), r ); } - - return Textures.Window.Maxi.Draw( GetRender(), r ); - } - - if ( bDisabled ) { return Textures.Window.Restore.Draw( GetRender(), r, Gwen::Color( 255, 255, 255, 50 ) ); } - - if ( bDepressed ) { return Textures.Window.Restore_Down.Draw( GetRender(), r ); } - - if ( bHovered ) { return Textures.Window.Restore_Hover.Draw( GetRender(), r ); } - - return Textures.Window.Restore.Draw( GetRender(), r ); - } - - virtual void DrawWindowMinimizeButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ) - { - Gwen::Rect r = Gwen::Rect( control->GetRenderBounds().x, control->GetRenderBounds().y, 31, 31 ); - - if ( bDisabled ) { return Textures.Window.Mini.Draw( GetRender(), r, Gwen::Color( 255, 255, 255, 100 ) ); } - - if ( bDepressed ) { return Textures.Window.Mini_Down.Draw( GetRender(), r ); } - - if ( bHovered ) { return Textures.Window.Mini_Hover.Draw( GetRender(), r ); } - - Textures.Window.Mini.Draw( GetRender(), r ); - } - - - virtual void DrawSlideButton( Gwen::Controls::Base* control, bool bDepressed, bool bHorizontal ) - { - if ( !bHorizontal ) - { - if ( control->IsDisabled() ) { return Textures.Input.Slider.V.Disabled.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) { return Textures.Input.Slider.V.Down.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( control->IsHovered() ) { return Textures.Input.Slider.V.Hover.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - return Textures.Input.Slider.V.Normal.DrawCenter( GetRender(), control->GetRenderBounds() ); - } - - if ( control->IsDisabled() ) { return Textures.Input.Slider.H.Disabled.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( bDepressed ) { return Textures.Input.Slider.H.Down.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - if ( control->IsHovered() ) { return Textures.Input.Slider.H.Hover.DrawCenter( GetRender(), control->GetRenderBounds() ); } - - Textures.Input.Slider.H.Normal.DrawCenter( GetRender(), control->GetRenderBounds() ); - } - - void DrawTreeNode( Controls::Base* ctrl, bool bOpen, bool bSelected, int iLabelHeight, int iLabelWidth, int iHalfWay, int iLastBranch, bool bIsRoot ) - { - if ( bSelected ) - { - Textures.Selection.Draw( GetRender(), Gwen::Rect( 17, 0, iLabelWidth + 2, iLabelHeight - 1 ) ); - } - - Base::DrawTreeNode( ctrl, bOpen, bSelected, iLabelHeight, iLabelWidth, iHalfWay, iLastBranch, bIsRoot ); - } - - void DrawCategoryHolder( Controls::Base* ctrl ) - { - Textures.CategoryList.Outer.Draw( GetRender(), ctrl->GetRenderBounds() ); - } - - void DrawCategoryInner( Controls::Base* ctrl, bool bCollapsed ) - { - if ( bCollapsed ) - { return Textures.CategoryList.Header.Draw( GetRender(), ctrl->GetRenderBounds() ); } - - Textures.CategoryList.Inner.Draw( GetRender(), ctrl->GetRenderBounds() ); - } - - void DrawPointer( Controls::Base* ctrl, bool bDepressed ) - { - Gwen::Rect rect = ctrl->GetRenderBounds(); - - if ( bDepressed ) - { Textures.Pointer.Depressed.Draw( GetRender(), rect ); } - else - { Textures.Pointer.NotDepressed.Draw( GetRender(), rect ); } - } - }; - } -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Skins/Texturing.h b/OpenSauce/shared/Include/GWEN/Skins/Texturing.h deleted file mode 100644 index f03c81678..000000000 --- a/OpenSauce/shared/Include/GWEN/Skins/Texturing.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_SKINS_TEXTURING_H -#define GWEN_SKINS_TEXTURING_H - -#include "Gwen/Gwen.h" -#include "Gwen/Texture.h" - -namespace Gwen -{ - namespace Skin - { - namespace Texturing - { - struct Single - { - Single() - { - texture = NULL; - } - - void Init( Texture* pTexture, float x, float y, float w, float h ) - { - texture = pTexture; - float texw = texture->width; - float texh = texture->height; - uv[0] = x / texw; - uv[1] = y / texh; - uv[2] = ( x + w ) / texw; - uv[3] = ( y + h ) / texh; - this->iWidth = w; - this->iHeight = h; - } - - void Draw( Gwen::Renderer::Base* render, Gwen::Rect r, const Gwen::Color & col = Gwen::Colors::White ) - { - if ( !texture ) { return; } - - render->SetDrawColor( col ); - render->DrawTexturedRect( texture, r, uv[0], uv[1], uv[2], uv[3] ); - } - - void DrawCenter( Gwen::Renderer::Base* render, Gwen::Rect r, const Gwen::Color & col = Gwen::Colors::White ) - { - if ( !texture ) { return; } - - r.x += ( r.w - iWidth ) * 0.5; - r.y += ( r.h - iHeight ) * 0.5; - r.w = iWidth; - r.h = iHeight; - Draw( render, r, col ); - } - - - Texture* texture; - float uv[4]; - int iWidth; - int iHeight; - }; - - struct Bordered - { - Bordered() - { - texture = NULL; - } - - void Init( Texture* pTexture, float x, float y, float w, float h, Margin in_margin, float DrawMarginScale = 1.0f ) - { - texture = pTexture; - margin = in_margin; - SetRect( 0, x, y, margin.left, margin.top ); - SetRect( 1, x + margin.left, y, w - margin.left - margin.right, margin.top ); - SetRect( 2, ( x + w ) - margin.right, y, margin.right, margin.top ); - SetRect( 3, x, y + margin.top, margin.left, h - margin.top - margin.bottom ); - SetRect( 4, x + margin.left, y + margin.top, w - margin.left - margin.right, h - margin.top - margin.bottom ); - SetRect( 5, ( x + w ) - margin.right, y + margin.top, margin.right, h - margin.top - margin.bottom ); - SetRect( 6, x, ( y + h ) - margin.bottom, margin.left, margin.bottom ); - SetRect( 7, x + margin.left, ( y + h ) - margin.bottom, w - margin.left - margin.right, margin.bottom ); - SetRect( 8, ( x + w ) - margin.right, ( y + h ) - margin.bottom, margin.right, margin.bottom ); - margin.left *= DrawMarginScale; - margin.right *= DrawMarginScale; - margin.top *= DrawMarginScale; - margin.bottom *= DrawMarginScale; - width = w - x; - height = h - y; - } - - void SetRect( int iNum, float x, float y, float w, float h ) - { - float texw = texture->width; - float texh = texture->height; - //x -= 1.0f; - //y -= 1.0f; - rects[iNum].uv[0] = x / texw; - rects[iNum].uv[1] = y / texh; - rects[iNum].uv[2] = ( x + w ) / texw; - rects[iNum].uv[3] = ( y + h ) / texh; - // rects[iNum].uv[0] += 1.0f / texture->width; - // rects[iNum].uv[1] += 1.0f / texture->width; - } - - void Draw( Gwen::Renderer::Base* render, Gwen::Rect r, const Gwen::Color & col = Gwen::Colors::White, bool b1 = true, bool b2 = true, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true, bool b8 = true, bool b9 = true ) - { - if ( !texture ) { return; } - - render->SetDrawColor( col ); - - if ( r.w < width && r.h < height ) - { - render->DrawTexturedRect( texture, - r, - rects[0].uv[0], rects[0].uv[1], rects[8].uv[2], rects[8].uv[3] ); - return; - } - - if ( b1 ) { DrawRect( render, 0, r.x, r.y, margin.left, margin.top ); } - - if ( b2 ) { DrawRect( render, 1, r.x + margin.left, r.y, r.w - margin.left - margin.right, margin.top ); } - - if ( b3 ) { DrawRect( render, 2, ( r.x + r.w ) - margin.right, r.y, margin.right, margin.top ); } - - if ( b4 ) { DrawRect( render, 3, r.x, r.y + margin.top, margin.left, r.h - margin.top - margin.bottom ); } - - if ( b5 ) { DrawRect( render, 4, r.x + margin.left, r.y + margin.top, r.w - margin.left - margin.right, r.h - margin.top - margin.bottom ); } - - if ( b6 ) { DrawRect( render, 5, ( r.x + r.w ) - margin.right, r.y + margin.top, margin.right, r.h - margin.top - margin.bottom ); } - - if ( b7 ) { DrawRect( render, 6, r.x, ( r.y + r.h ) - margin.bottom, margin.left, margin.bottom ); } - - if ( b8 ) { DrawRect( render, 7, r.x + margin.left, ( r.y + r.h ) - margin.bottom, r.w - margin.left - margin.right, margin.bottom ); } - - if ( b9 ) { DrawRect( render, 8, ( r.x + r.w ) - margin.right, ( r.y + r.h ) - margin.bottom, margin.right, margin.bottom ); } - } - - void DrawRect( Gwen::Renderer::Base* render, int i, int x, int y, int w, int h ) - { - render->DrawTexturedRect( texture, - Gwen::Rect( x, y, w, h ), - rects[i].uv[0], rects[i].uv[1], rects[i].uv[2], rects[i].uv[3] ); - } - - Texture* texture; - - struct SubRect - { - float uv[4]; - }; - - SubRect rects[9]; - Margin margin; - - float width; - float height; - }; - } - } -} -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/Structures.h b/OpenSauce/shared/Include/GWEN/Structures.h deleted file mode 100644 index 81602c2e4..000000000 --- a/OpenSauce/shared/Include/GWEN/Structures.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifdef _MSC_VER -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4251 ) -#endif -#ifndef GWEN_STRUCTURES_H -#define GWEN_STRUCTURES_H - -#include "Gwen/Exports.h" -#include - -namespace Gwen -{ - namespace Controls - { - class Base; - class Canvas; - } - - namespace CursorType - { - static const unsigned char Normal = 0; - static const unsigned char Beam = 1; - static const unsigned char SizeNS = 2; - static const unsigned char SizeWE = 3; - static const unsigned char SizeNWSE = 4; - static const unsigned char SizeNESW = 5; - static const unsigned char SizeAll = 6; - static const unsigned char No = 7; - static const unsigned char Wait = 8; - static const unsigned char Finger = 9; - - static const unsigned char Count = 10; - } - - typedef std::wstring UnicodeString; - typedef std::string String; - - typedef wchar_t UnicodeChar; // Portability?? - - struct GWEN_EXPORT Margin - { - Margin( int left_ = 0, int top_ = 0, int right_ = 0, int bottom_ = 0 ) - { - this->top = top_; - this->bottom = bottom_; - this->left = left_; - this->right = right_; - } - - Margin operator + ( const Margin & margin ) const - { - Margin m; - m.top = top + margin.top; - m.bottom = bottom + margin.bottom; - m.left = left + margin.left; - m.right = right + margin.right; - return m; - } - - int top, bottom, left, right; - }; - - - typedef Margin Padding; - - - struct GWEN_EXPORT Rect - { - Rect( int x_ = 0, int y_ = 0, int w_ = 0, int h_ = 0 ) - { - this->x = x_; - this->y = y_; - this->w = w_; - this->h = h_; - } - - Rect operator + ( const Rect & rct ) const - { - Rect m; - m.x = x + rct.x; - m.y = y + rct.y; - m.w = w + rct.w; - m.h = h + rct.h; - return m; - } - - int x, y, w, h; - }; - - - struct GWEN_EXPORT Point - { - Point( int x_ = 0, int y_ = 0 ) - { - this->x = x_; - this->y = y_; - } - - void operator += ( const Point & p ) - { - x += p.x; - y += p.y; - } - - Point operator + ( const Point & p ) const - { - return Point( x + p.x, p.y + y ); - } - - void operator -= ( const Point & p ) - { - x -= p.x; - y -= p.y; - } - - Point operator - ( const Point & p ) const - { - return Point( x - p.x, y - p.y ); - } - - int x, y; - }; - - struct GWEN_EXPORT HSV - { - float h; - float s; - float v; - }; - - - struct GWEN_EXPORT Color - { - Color( unsigned char r_ = 255, unsigned char g_ = 255, unsigned char b_ = 255, unsigned char a_ = 255 ) - { - this->r = r_; - this->g = g_; - this->b = b_; - this->a = a_; - } - - void operator = ( Color c ) - { - this->r = c.r; - this->g = c.g; - this->b = c.b; - this->a = c.a; - } - - void operator += ( Color c ) - { - this->r += c.r; - this->g += c.g; - this->b += c.b; - this->a += c.a; - } - - void operator -= ( Color c ) - { - this->r -= c.r; - this->g -= c.g; - this->b -= c.b; - this->a -= c.a; - } - - void operator *= ( float f ) - { - this->r *= f; - this->g *= f; - this->b *= f; - this->a *= f; - } - - Color operator * ( float f ) - { - return Color( - ( float ) this->r * f, - ( float ) this->g * f, - ( float ) this->b * f, - ( float ) this->a * f - ); - } - - Color operator - ( Color c ) - { - return Color( - this->r - c.r, - this->g - c.g, - this->b - c.b, - this->a - c.a - ); - } - - Color operator + ( Color c ) - { - return Color( - this->r + c.r, - this->g + c.g, - this->b + c.b, - this->a + c.a - ); - } - - bool operator == ( const Color & c ) const - { - return c.r == r && c.g == g && c.b == b && c.a == a; - } - - - unsigned char r, g, b, a; - }; - - - namespace DragAndDrop - { - struct GWEN_EXPORT Package - { - Package() - { - userdata = NULL; - draggable = false; - drawcontrol = NULL; - holdoffset = Gwen::Point( 0, 0 ); - } - - String name; - void* userdata; - bool draggable; - - Gwen::Controls::Base* drawcontrol; - Gwen::Point holdoffset; - }; - } - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/TextObject.h b/OpenSauce/shared/Include/GWEN/TextObject.h deleted file mode 100644 index ccec3b285..000000000 --- a/OpenSauce/shared/Include/GWEN/TextObject.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_TEXTOBJECT_H -#define GWEN_TEXTOBJECT_H - -#include "Gwen/Utility.h" - -namespace Gwen -{ - /* - - TextObjects can be either a UnicodeString or a String - - Just makes things easier instead of having a function taking both. - - */ - class TextObject - { - public: - - TextObject() {} - - TextObject( const Gwen::String & text ) - { - m_String = text; - m_Unicode = Gwen::Utility::StringToUnicode( m_String ); - } - - TextObject( const char* text ) - { - m_String = text; - m_Unicode = Gwen::Utility::StringToUnicode( m_String ); - } - - TextObject( const wchar_t* text ) - { - m_Unicode = text; - m_String = Gwen::Utility::UnicodeToString( m_Unicode ); - } - - TextObject( const Gwen::UnicodeString & unicode ) - { - *this = unicode; - } - - operator const Gwen::String & () { return m_String; } - operator const Gwen::UnicodeString & () { return m_Unicode; } - - void operator = ( const char* str ) - { - m_String = str; - m_Unicode = Gwen::Utility::StringToUnicode( m_String ); - } - - void operator = ( const Gwen::String & str ) - { - m_String = str; - m_Unicode = Gwen::Utility::StringToUnicode( m_String ); - } - - void operator = ( const Gwen::UnicodeString & unicodeStr ) - { - m_Unicode = unicodeStr; - m_String = Gwen::Utility::UnicodeToString( m_Unicode ); - } - - bool operator == ( const TextObject & to ) const - { - return m_Unicode == to.m_Unicode; - } - - const Gwen::String & Get() const - { - return m_String; - } - - const char* c_str() const - { - return m_String.c_str(); - } - - const Gwen::UnicodeString & GetUnicode() const - { - return m_Unicode; - } - - int length() const { return m_Unicode.length(); } - - Gwen::UnicodeString m_Unicode; - Gwen::String m_String; - }; -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Texture.h b/OpenSauce/shared/Include/GWEN/Texture.h deleted file mode 100644 index 8a2e47d4d..000000000 --- a/OpenSauce/shared/Include/GWEN/Texture.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_TEXTURE_H -#define GWEN_TEXTURE_H - -#include - -#include "Gwen/BaseRender.h" - -namespace Gwen -{ - // - // Texture - // - struct Texture - { - typedef std::list List; - - TextObject name; - void* data; - bool failed; - int width; - int height; - - Texture() - { - data = NULL; - width = 4; - height = 4; - failed = false; - } - - ~Texture() - { - } - - void Load( const TextObject & str, Gwen::Renderer::Base* render ) - { - name = str; - //Gwen::Debug::AssertCheck( render != NULL, "No renderer!" ); - render->LoadTexture( this ); - } - - void Release( Gwen::Renderer::Base* render ) - { - render->FreeTexture( this ); - } - - bool FailedToLoad() const - { - return failed; - } - }; - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/ToolTip.cpp b/OpenSauce/shared/Include/GWEN/ToolTip.cpp deleted file mode 100644 index 210917471..000000000 --- a/OpenSauce/shared/Include/GWEN/ToolTip.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/ToolTip.h" -#include "Gwen/Utility.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -namespace ToolTip -{ - Base* g_ToolTip = NULL; - - GWEN_EXPORT bool TooltipActive() - { - return g_ToolTip != NULL; - } - - void Enable( Controls::Base* pControl ) - { - if ( !pControl->GetToolTip() ) - { return; } - - g_ToolTip = pControl; - } - - void Disable( Controls::Base* pControl ) - { - if ( g_ToolTip == pControl ) - { - g_ToolTip = NULL; - } - } - - void RenderToolTip( Skin::Base* skin ) - { - if ( !g_ToolTip ) { return; } - - Gwen::Renderer::Base* render = skin->GetRender(); - Gwen::Point pOldRenderOffset = render->GetRenderOffset(); - Gwen::Point MousePos = Input::GetMousePosition(); - Gwen::Rect Bounds = g_ToolTip->GetToolTip()->GetBounds(); - Gwen::Rect rOffset = Gwen::Rect( MousePos.x - Bounds.w * 0.5f, MousePos.y - Bounds.h - 10, Bounds.w, Bounds.h ); - rOffset = Utility::ClampRectToRect( rOffset, g_ToolTip->GetCanvas()->GetBounds() ); - //Calculate offset on screen bounds - render->AddRenderOffset( rOffset ); - render->EndClip(); - skin->DrawToolTip( g_ToolTip->GetToolTip() ); - g_ToolTip->GetToolTip()->DoRender( skin ); - render->SetRenderOffset( pOldRenderOffset ); - } - - void ControlDeleted( Controls::Base* pControl ) - { - Disable( pControl ); - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/ToolTip.h b/OpenSauce/shared/Include/GWEN/ToolTip.h deleted file mode 100644 index 8e2bd0208..000000000 --- a/OpenSauce/shared/Include/GWEN/ToolTip.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ - - -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_TOOLTIP_H -#define GWEN_TOOLTIP_H - -#include "Gwen/Controls/Base.h" -#include "Gwen/Gwen.h" -#include "Gwen/Skin.h" - -using namespace Gwen; -using namespace Gwen::Controls; - -namespace ToolTip -{ - GWEN_EXPORT bool TooltipActive(); - - GWEN_EXPORT void Enable( Controls::Base* pControl ); - GWEN_EXPORT void Disable( Controls::Base* pControl ); - - GWEN_EXPORT void ControlDeleted( Controls::Base* pControl ); - - GWEN_EXPORT void RenderToolTip( Skin::Base* skin ); -} - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/UserData.h b/OpenSauce/shared/Include/GWEN/UserData.h deleted file mode 100644 index 3e443ee1f..000000000 --- a/OpenSauce/shared/Include/GWEN/UserData.h +++ /dev/null @@ -1,116 +0,0 @@ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_USERDATA_H -#define GWEN_USERDATA_H - -namespace Gwen -{ - /* - - Allows you to store multiple and various user data - - // - // Valid - // - UserDataStorage.Set( 100.0f ); - UserDataStorage.Get(); - - // - // Invalid - didn't Add a float type! - // - UserDataStorage.Set( 100 ); - UserDataStorage.Get(); - - // - // You can pass structs as long as they can be copied safely. - // - UserDataStorage.Set( mystruct ); - UserDataStorage.Get(); - - // - // If you pass a pointer then whatever it's pointing to - // should be valid for the duration. And it won't be freed. - // - UserDataStorage.Set( &mystruct ); - UserDataStorage.Get(); - - */ - class UserDataStorage - { - struct ValueBase - { - virtual ~ValueBase() {} - virtual void DeleteThis() = 0; - }; - - template struct Value : public ValueBase - { - T val; - - Value( const T & v ) - { - val = v; - } - - virtual void DeleteThis() - { - delete this; - } - }; - - public: - - UserDataStorage() - { - } - - ~UserDataStorage() - { - std::map< Gwen::String, void*>::iterator it = m_List.begin(); - std::map< Gwen::String, void*>::iterator itEnd = m_List.end(); - - while ( it != itEnd ) - { - ( ( ValueBase* ) it->second )->DeleteThis(); - ++it; - } - } - - template - void Set( const Gwen::String & str, const T & var ) - { - Value* val = NULL; - std::map< Gwen::String, void*>::iterator it = m_List.find( str ); - - if ( it != m_List.end() ) - { - ( ( Value* ) it->second )->val = var; - } - else - { - val = new Value ( var ); - m_List[ str ] = ( void* ) val; - } - }; - - bool Exists( const Gwen::String & str ) - { - return m_List.find( str ) != m_List.end(); - }; - - template - T & Get( const Gwen::String & str ) - { - Value* v = ( Value* ) m_List[ str ]; - return v->val; - } - - std::map< Gwen::String, void*> m_List; - }; - -}; - -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Utility.cpp b/OpenSauce/shared/Include/GWEN/Utility.cpp deleted file mode 100644 index d31e472fa..000000000 --- a/OpenSauce/shared/Include/GWEN/Utility.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/ToolTip.h" -#include "Gwen/Utility.h" - -#include - -using namespace Gwen; - -#ifdef _MSC_VER -#pragma warning(disable:4267)// conversion from 'size_t' to 'int', possible loss of data -#endif - -#ifdef __MINGW32__ -#undef vswprintf -#define vswprintf _vsnwprintf -#endif - -#ifdef _MSC_VER -#define GWEN_FNULL "NUL" -#define va_copy(d,s) ((d) = (s)) -#else -#define GWEN_FNULL "/dev/null" -#endif - -UnicodeString Gwen::Utility::Format( const wchar_t* fmt, ... ) -{ - va_list s; - int len = 0; - - va_start( s, fmt ); - - // Determine the length of the resulting string, this method is much faster - // than looping and reallocating a bigger buffer size. - { - FILE* fnull = fopen( GWEN_FNULL, "wb" ); - va_list c; - va_copy( c, s ); - len = vfwprintf( fnull, fmt, c ); - va_end( c ); - fclose( fnull ); - } - - UnicodeString strOut; - - if (len > 0) - { - strOut.resize( len + 1 ); - va_list c; - va_copy( c, s ); - len = vswprintf( &strOut[0], strOut.size(), fmt, c ); - va_end( c ); - strOut.resize( len ); - } - - va_end( s ); - - return strOut; -} - - - -void Gwen::Utility::Strings::Split( const Gwen::String & str, const Gwen::String & seperator, Strings::List & outbits, bool bLeave ) -{ - int iOffset = 0; - int iLength = str.length(); - int iSepLen = seperator.length(); - size_t i = str.find( seperator, 0 ); - - while ( i != std::string::npos ) - { - outbits.push_back( str.substr( iOffset, i - iOffset ) ); - iOffset = i + iSepLen; - i = str.find( seperator, iOffset ); - - if ( bLeave ) { iOffset -= iSepLen; } - } - - outbits.push_back( str.substr( iOffset, iLength - iOffset ) ); -} - -void Gwen::Utility::Strings::Split( const Gwen::UnicodeString & str, const Gwen::UnicodeString & seperator, Strings::UnicodeList & outbits, bool bLeave ) -{ - int iOffset = 0; - int iLength = str.length(); - int iSepLen = seperator.length(); - size_t i = str.find( seperator, 0 ); - - while ( i != std::wstring::npos ) - { - outbits.push_back( str.substr( iOffset, i - iOffset ) ); - iOffset = i + iSepLen; - i = str.find( seperator, iOffset ); - - if ( bLeave ) { iOffset -= iSepLen; } - } - - outbits.push_back( str.substr( iOffset, iLength - iOffset ) ); -} - -int Gwen::Utility::Strings::To::Int( const Gwen::String & str ) -{ - if ( str == "" ) { return 0; } - - return atoi( str.c_str() ); -} - -float Gwen::Utility::Strings::To::Float( const Gwen::String & str ) -{ - if ( str == "" ) { return 0.0f; } - - return ( float ) atof( str.c_str() ); -} - -float Gwen::Utility::Strings::To::Float( const Gwen::UnicodeString & str ) -{ - return wcstod( str.c_str(), NULL ); -} - -bool Gwen::Utility::Strings::To::Bool( const Gwen::String & str ) -{ - if ( str.size() == 0 ) { return false; } - - if ( str[0] == 'T' || str[0] == 't' || str[0] == 'y' || str[0] == 'Y' ) { return true; } - - if ( str[0] == 'F' || str[0] == 'f' || str[0] == 'n' || str[0] == 'N' ) { return false; } - - if ( str[0] == '0' ) { return false; } - - return true; -} - -bool Gwen::Utility::Strings::To::Floats( const Gwen::String & str, float* f, size_t iCount ) -{ - Strings::List lst; - Strings::Split( str, " ", lst ); - - if ( lst.size() != iCount ) { return false; } - - for ( size_t i = 0; i < iCount; i++ ) - { - f[i] = Strings::To::Float( lst[i] ); - } - - return true; -} - - -bool Gwen::Utility::Strings::Wildcard( const TextObject & strWildcard, const TextObject & strHaystack ) -{ - const UnicodeString & W = strWildcard.GetUnicode(); - const UnicodeString & H = strHaystack.GetUnicode(); - - if ( strWildcard == "*" ) { return true; } - - int iPos = W.find( L"*", 0 ); - - if ( iPos == UnicodeString::npos ) { return strWildcard == strHaystack; } - - // First half matches - if ( iPos > 0 && W.substr( 0, iPos ) != H.substr( 0, iPos ) ) - { return false; } - - // Second half matches - if ( iPos != W.length() - 1 ) - { - UnicodeString strEnd = W.substr( iPos + 1, W.length() ); - - if ( strEnd != H.substr( H.length() - strEnd.length(), H.length() ) ) - { return false; } - } - - return true; -} - - - -void Gwen::Utility::Strings::ToUpper( Gwen::UnicodeString & str ) -{ - transform( str.begin(), str.end(), str.begin(), towupper ); -} - -void Gwen::Utility::Strings::Strip( Gwen::UnicodeString & str, const Gwen::UnicodeString & chars ) -{ - Gwen::UnicodeString Source = str; - str = L""; - - for ( unsigned int i = 0; i < Source.length(); i++ ) - { - if ( chars.find( Source[i] ) != Gwen::UnicodeString::npos ) - { continue; } - - str += Source[i]; - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/Utility.h b/OpenSauce/shared/Include/GWEN/Utility.h deleted file mode 100644 index 761deb6b4..000000000 --- a/OpenSauce/shared/Include/GWEN/Utility.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_UTILITY_H -#define GWEN_UTILITY_H - -#include -#include -#include "Gwen/Structures.h" - -namespace Gwen -{ - class TextObject; - - namespace Utility - { - template - const T & Max( const T & x, const T & y ) - { - if ( y < x ) { return x; } - - return y; - } - - template - const T & Min( const T & x, const T & y ) - { - if ( y > x ) { return x; } - - return y; - } - -#ifdef _MSC_VER -#pragma warning( push ) -#pragma warning( disable : 4996 ) -#endif - - inline String UnicodeToString( const UnicodeString & strIn ) - { - if ( !strIn.length() ) { return ""; } - - String temp( strIn.length(), ( char ) 0 ); - std::use_facet< std::ctype > ( std::locale() ). \ - narrow( &strIn[0], &strIn[0] + strIn.length(), ' ', &temp[0] ); - return temp; - } - - inline UnicodeString StringToUnicode( const String & strIn ) - { - if ( !strIn.length() ) { return L""; } - - UnicodeString temp( strIn.length(), ( wchar_t ) 0 ); - std::use_facet< std::ctype > ( std::locale() ). \ - widen( &strIn[0], &strIn[0] + strIn.length(), &temp[0] ); - return temp; - } - - template void Replace( T & str, const T & strFind, const T & strReplace ) - { - size_t pos = 0; - - while ( ( pos = str.find( strFind, pos ) ) != T::npos ) - { - str.replace( pos, strFind.length(), strReplace ); - pos += strReplace.length(); - } - } - -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - template - String ToString( const T & object ) - { - std::ostringstream os; - os << object; - return os.str(); - } - - inline Gwen::Rect ClampRectToRect( Gwen::Rect inside, Gwen::Rect outside, bool clampSize = false ) - { - if ( inside.x < outside.x ) - { inside.x = outside.x; } - - if ( inside.y < outside.y ) - { inside.y = outside.y; } - - if ( inside.x + inside.w > outside.x + outside.w ) - { - if ( clampSize ) - { inside.w = outside.w; } - else - { inside.x = outside.x + outside.w - inside.w; } - } - - if ( inside.y + inside.h > outside.y + outside.h ) - { - if ( clampSize ) - { inside.h = outside.h; } - else - { inside.y = outside.w + outside.h - inside.h; } - } - - return inside; - } - - GWEN_EXPORT UnicodeString Format( const wchar_t* fmt, ... ); - - namespace Strings - { - typedef std::vector List; - typedef std::vector UnicodeList; - - GWEN_EXPORT void Split( const Gwen::String & str, const Gwen::String & seperator, Strings::List & outbits, bool bLeaveSeperators = false ); - GWEN_EXPORT void Split( const Gwen::UnicodeString & str, const Gwen::UnicodeString & seperator, Strings::UnicodeList & outbits, bool bLeaveSeperators = false ); - GWEN_EXPORT bool Wildcard( const Gwen::TextObject & strWildcard, const Gwen::TextObject & strHaystack ); - - GWEN_EXPORT void ToUpper( Gwen::UnicodeString & str ); - GWEN_EXPORT void Strip( Gwen::UnicodeString & str, const Gwen::UnicodeString & chars ); - - template - T TrimLeft( const T & str, const T & strChars ) - { - T outstr = str; - outstr.erase( 0, outstr.find_first_not_of( strChars ) ); - return outstr; - } - - namespace To - { - GWEN_EXPORT bool Bool( const Gwen::String & str ); - GWEN_EXPORT int Int( const Gwen::String & str ); - GWEN_EXPORT float Float( const Gwen::String & str ); - GWEN_EXPORT float Float( const Gwen::UnicodeString & str ); - GWEN_EXPORT bool Floats( const Gwen::String & str, float* f, size_t iCount ); - } - } - } - - - -} -#endif -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/WindowProvider.h b/OpenSauce/shared/Include/GWEN/WindowProvider.h deleted file mode 100644 index 00898ab0a..000000000 --- a/OpenSauce/shared/Include/GWEN/WindowProvider.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#pragma once - -#if !PLATFORM_IS_DEDI - -#ifndef GWEN_WINDOW_PROVIDER_H -#define GWEN_WINDOW_PROVIDER_H - -namespace Gwen -{ - class WindowProvider - { - public: - - virtual void* GetWindow() = 0; - }; - -} - -#endif -#endif diff --git a/OpenSauce/shared/Include/GWEN/events.cpp b/OpenSauce/shared/Include/GWEN/events.cpp deleted file mode 100644 index 565b5ad58..000000000 --- a/OpenSauce/shared/Include/GWEN/events.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/Events.h" - -using namespace Gwen; -using namespace Gwen::Event; - - -Handler::Handler() -{ -} - -Handler::~Handler() -{ - CleanLinks(); -} - -void Handler::CleanLinks() -{ - // Tell all the callers that we're dead - std::list::iterator iter = m_Callers.begin(); - - while ( iter != m_Callers.end() ) - { - Caller* pCaller = *iter; - UnRegisterCaller( pCaller ); - pCaller->RemoveHandler( this ); - iter = m_Callers.begin(); - } -} - -void Handler::RegisterCaller( Caller* pCaller ) -{ - m_Callers.push_back( pCaller ); -} - -void Handler::UnRegisterCaller( Caller* pCaller ) -{ - m_Callers.remove( pCaller ); -} - - -Caller::Caller() -{ -} - -Caller::~Caller() -{ - CleanLinks(); -} - -void Caller::CleanLinks() -{ - std::list::iterator iter; - - for ( iter = m_Handlers.begin(); iter != m_Handlers.end(); ++iter ) - { - handler & h = *iter; - h.pObject->UnRegisterCaller( this ); - } - - m_Handlers.clear(); -} - -void Caller::Call( Controls::Base* pThis ) -{ - static Gwen::Event::Information info; - info.Control = pThis; - Call( pThis, info ); -} - -void Caller::Call( Controls::Base* pThis, Gwen::Event::Info information ) -{ - Gwen::Event::Information info; - info = information; - info.ControlCaller = pThis; - std::list::iterator iter; - - for ( iter = m_Handlers.begin(); iter != m_Handlers.end(); ++iter ) - { - handler & h = *iter; - info.Data = h.Data; - - if ( h.fnFunction ) - { ( h.pObject->*h.fnFunction )( pThis ); } - - if ( h.fnFunctionInfo ) - { ( h.pObject->*h.fnFunctionInfo )( info ); } - - if ( h.fnFunctionBlank ) - { ( h.pObject->*h.fnFunctionBlank )(); } - - if ( h.fnGlobalFunction ) - { ( *h.fnGlobalFunction )( pThis ); } - - if ( h.fnGlobalFunctionInfo ) - { ( *h.fnGlobalFunctionInfo )( info ); } - - if ( h.fnGlobalFunctionBlank ) - { ( *h.fnGlobalFunctionBlank )(); } - } -} - -void Caller::AddInternal( Event::Handler* pObject, Event::Handler::Function pFunction ) -{ - handler h; - h.fnFunction = pFunction; - h.pObject = pObject; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::FunctionWithInformation pFunction ) -{ - AddInternal( pObject, pFunction, NULL ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::FunctionWithInformation pFunction, void* data ) -{ - handler h; - h.fnFunctionInfo = pFunction; - h.pObject = pObject; - h.Data = data; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::FunctionBlank pFunction ) -{ - handler h; - h.fnFunctionBlank = pFunction; - h.pObject = pObject; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::AddInternal( Event::Handler* pObject, Event::Handler::GlobalFunction pFunction ) -{ - handler h; - h.fnGlobalFunction = pFunction; - h.pObject = pObject; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::GlobalFunctionWithInformation pFunction ) -{ - AddInternal( pObject, pFunction, NULL ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::GlobalFunctionWithInformation pFunction, void* data ) -{ - handler h; - h.fnGlobalFunctionInfo = pFunction; - h.pObject = pObject; - h.Data = data; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::AddInternal( Event::Handler* pObject, Handler::GlobalFunctionBlank pFunction ) -{ - handler h; - h.fnGlobalFunctionBlank = pFunction; - h.pObject = pObject; - m_Handlers.push_back( h ); - pObject->RegisterCaller( this ); -} - -void Caller::RemoveHandler( Event::Handler* pObject ) -{ - pObject->UnRegisterCaller( this ); - std::list::iterator iter = m_Handlers.begin(); - - while ( iter != m_Handlers.end() ) - { - handler & h = *iter; - - if ( h.pObject == pObject ) - { - iter = m_Handlers.erase( iter ); - } - else - { - ++iter; - } - } -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/GWEN/inputhandler.cpp b/OpenSauce/shared/Include/GWEN/inputhandler.cpp deleted file mode 100644 index 5d530662c..000000000 --- a/OpenSauce/shared/Include/GWEN/inputhandler.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ -#include "Common/Precompile.hpp" - -#if !PLATFORM_IS_DEDI - -#include "Gwen/InputHandler.h" -#include "Gwen/Controls/Base.h" -#include "Gwen/DragAndDrop.h" -#include "Gwen/Hook.h" -#include "Gwen/Platform.h" - -#define DOUBLE_CLICK_SPEED 0.5f -#define MAX_MOUSE_BUTTONS 5 - -using namespace Gwen; - - -struct Action -{ - unsigned char type; - - int x, y; - Gwen::UnicodeChar chr; -}; - -static const float KeyRepeatRate = 0.03f; -static const float KeyRepeatDelay = 0.3f; - -struct t_KeyData -{ - t_KeyData() - { - for ( int i = 0; i < Gwen::Key::Count; i++ ) - { - KeyState[i] = false; - NextRepeat[i] = 0; - } - - Target = NULL; - LeftMouseDown = false; - RightMouseDown = false; - } - - bool KeyState[ Gwen::Key::Count ]; - float NextRepeat[ Gwen::Key::Count ]; - Controls::Base* Target; - bool LeftMouseDown; - bool RightMouseDown; - -} KeyData; - -Gwen::Point MousePosition; - -static float g_fLastClickTime[MAX_MOUSE_BUTTONS]; -static Gwen::Point g_pntLastClickPos; - -enum -{ - ACT_MOUSEMOVE, - ACT_MOUSEBUTTON, - ACT_CHAR, - ACT_MOUSEWHEEL, - ACT_KEYPRESS, - ACT_KEYRELEASE, - ACT_MESSAGE -}; - -void UpdateHoveredControl( Controls::Base* pInCanvas ) -{ - Controls::Base* pHovered = pInCanvas->GetControlAt( MousePosition.x, MousePosition.y ); - - if ( pHovered != Gwen::HoveredControl ) - { - if ( Gwen::HoveredControl ) - { - Controls::Base* OldHover = Gwen::HoveredControl; - Gwen::HoveredControl = NULL; - OldHover->OnMouseLeave(); - } - - Gwen::HoveredControl = pHovered; - - if ( Gwen::HoveredControl ) - { - Gwen::HoveredControl->OnMouseEnter(); - } - } - - if ( Gwen::MouseFocus && Gwen::MouseFocus->GetCanvas() == pInCanvas ) - { - if ( Gwen::HoveredControl ) - { - Controls::Base* OldHover = Gwen::HoveredControl; - Gwen::HoveredControl = NULL; - OldHover->Redraw(); - } - - Gwen::HoveredControl = Gwen::MouseFocus; - } -} - -bool FindKeyboardFocus( Controls::Base* pControl ) -{ - if ( !pControl ) { return false; } - - if ( pControl->GetKeyboardInputEnabled() ) - { - //Make sure none of our children have keyboard focus first - todo recursive - for ( Controls::Base::List::iterator iter = pControl->Children.begin(); iter != pControl->Children.end(); ++iter ) - { - Controls::Base* pChild = *iter; - - if ( pChild == Gwen::KeyboardFocus ) - { return false; } - } - - pControl->Focus(); - return true; - } - - return FindKeyboardFocus( pControl->GetParent() ); -} - -Gwen::Point Gwen::Input::GetMousePosition() -{ - return MousePosition; -} - -void Gwen::Input::OnCanvasThink( Controls::Base* pControl ) -{ - if ( Gwen::MouseFocus && !Gwen::MouseFocus->Visible() ) - { Gwen::MouseFocus = NULL; } - - if ( Gwen::KeyboardFocus && ( !Gwen::KeyboardFocus->Visible() || !KeyboardFocus->GetKeyboardInputEnabled() ) ) - { Gwen::KeyboardFocus = NULL; } - - if ( !KeyboardFocus ) { return; } - - if ( KeyboardFocus->GetCanvas() != pControl ) { return; } - - float fTime = Gwen::Platform::GetTimeInSeconds(); - - // - // Simulate Key-Repeats - // - for ( int i = 0; i < Gwen::Key::Count; i++ ) - { - if ( KeyData.KeyState[i] && KeyData.Target != KeyboardFocus ) - { - KeyData.KeyState[i] = false; - continue; - } - - if ( KeyData.KeyState[i] && fTime > KeyData.NextRepeat[i] ) - { - KeyData.NextRepeat[i] = Gwen::Platform::GetTimeInSeconds() + KeyRepeatRate; - - if ( KeyboardFocus ) - { - KeyboardFocus->OnKeyPress( i ); - } - } - } -} - -bool Gwen::Input::IsKeyDown( int iKey ) -{ - return KeyData.KeyState[ iKey ]; -} - -bool Gwen::Input::IsLeftMouseDown() -{ - return KeyData.LeftMouseDown; -} - -bool Gwen::Input::IsRightMouseDown() -{ - return KeyData.RightMouseDown; -} - -void Gwen::Input::OnMouseMoved( Controls::Base* pCanvas, int x, int y, int /*deltaX*/, int /*deltaY*/ ) -{ - MousePosition.x = x; - MousePosition.y = y; - UpdateHoveredControl( pCanvas ); -} - -bool Gwen::Input::OnMouseClicked( Controls::Base* pCanvas, int iMouseButton, bool bDown ) -{ - // If we click on a control that isn't a menu we want to close - // all the open menus. Menus are children of the canvas. - if ( bDown && ( !Gwen::HoveredControl || !Gwen::HoveredControl->IsMenuComponent() ) ) - { - pCanvas->CloseMenus(); - } - - if ( !Gwen::HoveredControl ) { return false; } - - if ( Gwen::HoveredControl->GetCanvas() != pCanvas ) { return false; } - - if ( !Gwen::HoveredControl->Visible() ) { return false; } - - if ( Gwen::HoveredControl == pCanvas ) { return false; } - - if ( iMouseButton >= MAX_MOUSE_BUTTONS ) - { return false; } - - if ( iMouseButton == 0 ) { KeyData.LeftMouseDown = bDown; } - else if ( iMouseButton == 1 ) { KeyData.RightMouseDown = bDown; } - - // Double click. - // Todo: Shouldn't double click if mouse has moved significantly - bool bIsDoubleClick = false; - - if ( bDown && - g_pntLastClickPos.x == MousePosition.x && - g_pntLastClickPos.y == MousePosition.y && - ( Gwen::Platform::GetTimeInSeconds() - g_fLastClickTime[ iMouseButton ] ) < DOUBLE_CLICK_SPEED ) - { - bIsDoubleClick = true; - } - - if ( bDown && !bIsDoubleClick ) - { - g_fLastClickTime[ iMouseButton ] = Gwen::Platform::GetTimeInSeconds(); - g_pntLastClickPos = MousePosition; - } - - if ( bDown ) - { - if ( !FindKeyboardFocus( Gwen::HoveredControl ) ) - { - if ( Gwen::KeyboardFocus ) - { Gwen::KeyboardFocus->Blur(); } - } - } - - Gwen::HoveredControl->UpdateCursor(); - - // This tells the child it has been touched, which - // in turn tells its parents, who tell their parents. - // This is basically so that Windows can pop themselves - // to the top when one of their children have been clicked. - if ( bDown ) - { Gwen::HoveredControl->Touch(); } - -#ifdef GWEN_HOOKSYSTEM - - if ( bDown ) - { - if ( Hook::CallHook( &Hook::BaseHook::OnControlClicked, Gwen::HoveredControl, MousePosition.x, MousePosition.y ) ) - { return true; } - } - -#endif - - switch ( iMouseButton ) - { - case 0: - { - if ( DragAndDrop::OnMouseButton( Gwen::HoveredControl, MousePosition.x, MousePosition.y, bDown ) ) - { return true; } - - if ( bIsDoubleClick ) { Gwen::HoveredControl->OnMouseDoubleClickLeft( MousePosition.x, MousePosition.y ); } - else { Gwen::HoveredControl->OnMouseClickLeft( MousePosition.x, MousePosition.y, bDown ); } - - return true; - } - - case 1: - { - if ( bIsDoubleClick ) { Gwen::HoveredControl->OnMouseDoubleClickRight( MousePosition.x, MousePosition.y ); } - else { Gwen::HoveredControl->OnMouseClickRight( MousePosition.x, MousePosition.y, bDown ); } - - return true; - } - } - - return false; -} - -bool Gwen::Input::HandleAccelerator( Controls::Base* pCanvas, Gwen::UnicodeChar chr ) -{ - //Build the accelerator search string - Gwen::UnicodeString accelString; - - if ( Gwen::Input::IsControlDown() ) - { accelString += L"CTRL+"; } - - if ( Gwen::Input::IsShiftDown() ) - { accelString += L"SHIFT+"; } - - chr = towupper( chr ); - accelString += chr; - - //Debug::Msg("Accelerator string :%S\n", accelString.c_str()); - - if ( Gwen::KeyboardFocus && Gwen::KeyboardFocus->HandleAccelerator( accelString ) ) - { return true; } - - if ( Gwen::MouseFocus && Gwen::MouseFocus->HandleAccelerator( accelString ) ) - { return true; } - - if ( pCanvas->HandleAccelerator( accelString ) ) - { return true; } - - return false; -} - -bool Gwen::Input::DoSpecialKeys( Controls::Base* pCanvas, Gwen::UnicodeChar chr ) -{ - if ( !Gwen::KeyboardFocus ) { return false; } - - if ( Gwen::KeyboardFocus->GetCanvas() != pCanvas ) { return false; } - - if ( !Gwen::KeyboardFocus->Visible() ) { return false; } - - if ( !Gwen::Input::IsControlDown() ) { return false; } - - if ( chr == L'C' || chr == L'c' ) - { - Gwen::KeyboardFocus->OnCopy( NULL ); - return true; - } - - if ( chr == L'V' || chr == L'v' ) - { - Gwen::KeyboardFocus->OnPaste( NULL ); - return true; - } - - if ( chr == L'X' || chr == L'x' ) - { - Gwen::KeyboardFocus->OnCut( NULL ); - return true; - } - - if ( chr == L'A' || chr == L'a' ) - { - Gwen::KeyboardFocus->OnSelectAll( NULL ); - return true; - } - - return false; -} - -bool Gwen::Input::OnKeyEvent( Controls::Base* pCanvas, int iKey, bool bDown ) -{ - Gwen::Controls::Base* pTarget = Gwen::KeyboardFocus; - - if ( pTarget && pTarget->GetCanvas() != pCanvas ) { pTarget = NULL; } - - if ( pTarget && !pTarget->Visible() ) { pTarget = NULL; } - - if ( bDown ) - { - if ( !KeyData.KeyState[ iKey ] ) - { - KeyData.KeyState[ iKey ] = true; - KeyData.NextRepeat[ iKey ] = Gwen::Platform::GetTimeInSeconds() + KeyRepeatDelay; - KeyData.Target = pTarget; - - if ( pTarget ) - { return pTarget->OnKeyPress( iKey ); } - } - } - else - { - if ( KeyData.KeyState[ iKey ] ) - { - KeyData.KeyState[ iKey ] = false; - - // BUG BUG. This causes shift left arrow in textboxes - // to not work. What is disabling it here breaking? - //KeyData.Target = NULL; - - if ( pTarget ) - { return pTarget->OnKeyRelease( iKey ); } - } - } - - return false; -} -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/TinyXml/OpenSauce.Readme.txt b/OpenSauce/shared/Include/TinyXml/OpenSauce.Readme.txt deleted file mode 100644 index 07067a61d..000000000 --- a/OpenSauce/shared/Include/TinyXml/OpenSauce.Readme.txt +++ /dev/null @@ -1,7 +0,0 @@ -This folder contains the source code to the TinyXml++ library. Kornner Studios did not make nor contribute to this code base in any way. - -The ONLY modifications done to these source files were to #include statements so that they use the TinyXml folder path. - -Due to their direct use in OpenSauce they also had to have the Precompile.hpp header included in all .CPP files. - -The header files were also renamed to sport ".hpp" extensions instead of just ".h". \ No newline at end of file diff --git a/OpenSauce/shared/Include/TinyXml/tinystr.cpp b/OpenSauce/shared/Include/TinyXml/tinystr.cpp deleted file mode 100644 index 94cd3c974..000000000 --- a/OpenSauce/shared/Include/TinyXml/tinystr.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "Common/Precompile.hpp" -/* -www.sourceforge.net/projects/tinyxml - -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 TIXML_USE_STL - -#include - -// Error value for find primitive -const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); - - -// Null rep. -TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; - - -void TiXmlString::reserve (size_type cap) -{ - if (cap > capacity()) - { - TiXmlString tmp; - tmp.init(length(), cap); - memcpy(tmp.start(), data(), length()); - swap(tmp); - } -} - - -TiXmlString& TiXmlString::assign(const char* str, size_type len) -{ - size_type cap = capacity(); - if (len > cap || cap > 3*(len + 8)) - { - TiXmlString tmp; - tmp.init(len); - memcpy(tmp.start(), str, len); - swap(tmp); - } - else - { - memmove(start(), str, len); - set_size(len); - } - return *this; -} - - -TiXmlString& TiXmlString::append(const char* str, size_type len) -{ - size_type newsize = length() + len; - if (newsize > capacity()) - { - reserve (newsize + capacity()); - } - memmove(finish(), str, len); - set_size(newsize); - return *this; -} - - -TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) -{ - TiXmlString tmp; - tmp.reserve(a.length() + b.length()); - tmp += a; - tmp += b; - return tmp; -} - -TiXmlString operator + (const TiXmlString & a, const char* b) -{ - TiXmlString tmp; - TiXmlString::size_type b_len = static_cast( strlen(b) ); - tmp.reserve(a.length() + b_len); - tmp += a; - tmp.append(b, b_len); - return tmp; -} - -TiXmlString operator + (const char* a, const TiXmlString & b) -{ - TiXmlString tmp; - TiXmlString::size_type a_len = static_cast( strlen(a) ); - tmp.reserve(a_len + b.length()); - tmp.append(a, a_len); - tmp += b; - return tmp; -} - - -#endif // TIXML_USE_STL diff --git a/OpenSauce/shared/Include/TinyXml/tinystr.hpp b/OpenSauce/shared/Include/TinyXml/tinystr.hpp deleted file mode 100644 index 25eaba486..000000000 --- a/OpenSauce/shared/Include/TinyXml/tinystr.hpp +++ /dev/null @@ -1,315 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml - -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 TIXML_USE_STL - -#ifndef TIXML_STRING_INCLUDED -#define TIXML_STRING_INCLUDED - -#include -#include - -/* 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) - { - if(copy != NULL) - { - init( static_cast( strlen(copy) )); - memcpy(start(), copy, length()); - } - else init(0); // handle null string cases - } - - // 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(); - } - - TiXmlString& operator = (const char * copy) - { - if(copy == NULL) // handle null string cases - { - clear(); - return *this; - } - - return assign( copy, (size_type)strlen(copy)); - } - - 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( 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(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( 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( 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 diff --git a/OpenSauce/shared/Include/TinyXml/tinyxml.cpp b/OpenSauce/shared/Include/TinyXml/tinyxml.cpp deleted file mode 100644 index 3dc3a999d..000000000 --- a/OpenSauce/shared/Include/TinyXml/tinyxml.cpp +++ /dev/null @@ -1,1887 +0,0 @@ -#include "Common/Precompile.hpp" -/* -www.sourceforge.net/projects/tinyxml -Original code by 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. -*/ - -#include - -#ifdef TIXML_USE_STL -#include -#include -#endif - -#include - -FILE* TiXmlFOpen( const char* filename, const char* mode ); - -bool TiXmlBase::condenseWhiteSpace = true; - -// Microsoft compiler security -FILE* TiXmlFOpen( const char* filename, const char* mode ) -{ - #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) - FILE* fp = 0; - errno_t err = fopen_s( &fp, filename, mode ); - if ( !err && fp ) - return fp; - return 0; - #else - return fopen( filename, mode ); - #endif -} - -void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) -{ - int i=0; - - while( i<(int)str.length() ) - { - unsigned char c = (unsigned char) str[i]; - - if ( c == '&' - && i < ( (int)str.length() - 2 ) - && str[i+1] == '#' - && str[i+2] == 'x' ) - { - // Hexadecimal character reference. - // Pass through unchanged. - // © -- copyright symbol, for example. - // - // The -1 is a bug fix from Rob Laveaux. It keeps - // an overflow from happening if there is no ';'. - // There are actually 2 ways to exit this loop - - // while fails (error case) and break (semicolon found). - // However, there is no mechanism (currently) for - // this function to return an error. - while ( i<(int)str.length()-1 ) - { - outString->append( str.c_str() + i, 1 ); - ++i; - if ( str[i] == ';' ) - break; - } - } - else if ( c == '&' ) - { - outString->append( entity[0].str, entity[0].strLength ); - ++i; - } - else if ( c == '<' ) - { - outString->append( entity[1].str, entity[1].strLength ); - ++i; - } - else if ( c == '>' ) - { - outString->append( entity[2].str, entity[2].strLength ); - ++i; - } - else if ( c == '\"' ) - { - outString->append( entity[3].str, entity[3].strLength ); - ++i; - } - else if ( c == '\'' ) - { - outString->append( entity[4].str, entity[4].strLength ); - ++i; - } - else if ( c < 32 ) - { - // Easy pass at non-alpha/numeric/symbol - // Below 32 is symbolic. - char buf[ 32 ]; - - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); - #else - sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); - #endif - - //*ME: warning C4267: convert 'size_t' to 'int' - //*ME: Int-Cast to make compiler happy ... - outString->append( buf, (int)strlen( buf ) ); - ++i; - } - else - { - //char realc = (char) c; - //outString->append( &realc, 1 ); - *outString += (char) c; // somewhat more efficient function call. - ++i; - } - } -} - - -TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() -{ - parent = 0; - type = _type; - firstChild = 0; - lastChild = 0; - prev = 0; - next = 0; -} - - -TiXmlNode::~TiXmlNode() -{ - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } -} - - -void TiXmlNode::CopyTo( TiXmlNode* target ) const -{ - target->SetValue (value.c_str() ); - target->userData = userData; - target->location = location; -} - - -void TiXmlNode::Clear() -{ - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } - - firstChild = 0; - lastChild = 0; -} - - -TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) -{ - assert( node->parent == 0 || node->parent == this ); - assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); - - if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT ) - { - delete node; - if ( GetDocument() ) - GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - node->parent = this; - - node->prev = lastChild; - node->next = 0; - - if ( lastChild ) - lastChild->next = node; - else - firstChild = node; // it was an empty list. - - lastChild = node; - return node; -} - - -TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) -{ - if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) - { - if ( GetDocument() ) - GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - - return LinkEndChild( node ); -} - - -TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) -{ - if ( !beforeThis || beforeThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) - { - if ( GetDocument() ) - GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->next = beforeThis; - node->prev = beforeThis->prev; - if ( beforeThis->prev ) - { - beforeThis->prev->next = node; - } - else - { - assert( firstChild == beforeThis ); - firstChild = node; - } - beforeThis->prev = node; - return node; -} - - -TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) -{ - if ( !afterThis || afterThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) - { - if ( GetDocument() ) - GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->prev = afterThis; - node->next = afterThis->next; - if ( afterThis->next ) - { - afterThis->next->prev = node; - } - else - { - assert( lastChild == afterThis ); - lastChild = node; - } - afterThis->next = node; - return node; -} - - -TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) -{ - if ( !replaceThis ) - return 0; - - if ( replaceThis->parent != this ) - return 0; - - if ( withThis.ToDocument() ) { - // A document can never be a child. Thanks to Noam. - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = withThis.Clone(); - if ( !node ) - return 0; - - node->next = replaceThis->next; - node->prev = replaceThis->prev; - - if ( replaceThis->next ) - replaceThis->next->prev = node; - else - lastChild = node; - - if ( replaceThis->prev ) - replaceThis->prev->next = node; - else - firstChild = node; - - delete replaceThis; - node->parent = this; - return node; -} - - -bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) -{ - if ( !removeThis ) { - return false; - } - - if ( removeThis->parent != this ) - { - assert( 0 ); - return false; - } - - if ( removeThis->next ) - removeThis->next->prev = removeThis->prev; - else - lastChild = removeThis->prev; - - if ( removeThis->prev ) - removeThis->prev->next = removeThis->next; - else - firstChild = removeThis->next; - - delete removeThis; - return true; -} - -const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = firstChild; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = lastChild; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const -{ - if ( !previous ) - { - return FirstChild(); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling(); - } -} - - -const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const -{ - if ( !previous ) - { - return FirstChild( val ); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling( val ); - } -} - - -const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = next; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = prev; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -void TiXmlElement::RemoveAttribute( const char * name ) -{ - #ifdef TIXML_USE_STL - TIXML_STRING str( name ); - TiXmlAttribute* node = attributeSet.Find( str ); - #else - TiXmlAttribute* node = attributeSet.Find( name ); - #endif - if ( node ) - { - attributeSet.Remove( node ); - delete node; - } -} - -const TiXmlElement* TiXmlNode::FirstChildElement() const -{ - const TiXmlNode* node; - - for ( node = FirstChild(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const -{ - const TiXmlNode* node; - - for ( node = FirstChild( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::NextSiblingElement() const -{ - const TiXmlNode* node; - - for ( node = NextSibling(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const -{ - const TiXmlNode* node; - - for ( node = NextSibling( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlDocument* TiXmlNode::GetDocument() const -{ - const TiXmlNode* node; - - for( node = this; node; node = node->parent ) - { - if ( node->ToDocument() ) - return node->ToDocument(); - } - return 0; -} - - -TiXmlElement::TiXmlElement (const char * _value) - : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) -{ - firstChild = lastChild = 0; - value = _value; -} - - -#ifdef TIXML_USE_STL -TiXmlElement::TiXmlElement( const std::string& _value ) - : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) -{ - firstChild = lastChild = 0; - value = _value; -} -#endif - - -TiXmlElement::TiXmlElement( const TiXmlElement& copy) - : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) -{ - firstChild = lastChild = 0; - copy.CopyTo( this ); -} - - -TiXmlElement& TiXmlElement::operator=( const TiXmlElement& base ) -{ - ClearThis(); - base.CopyTo( this ); - return *this; -} - - -TiXmlElement::~TiXmlElement() -{ - ClearThis(); -} - - -void TiXmlElement::ClearThis() -{ - Clear(); - while( attributeSet.First() ) - { - TiXmlAttribute* node = attributeSet.First(); - attributeSet.Remove( node ); - delete node; - } -} - - -const char* TiXmlElement::Attribute( const char* name ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - return node->Value(); - return 0; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - if ( attrib ) - return &attrib->ValueStr(); - return 0; -} -#endif - - -const char* TiXmlElement::Attribute( const char* name, int* i ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - const char* result = 0; - - if ( attrib ) { - result = attrib->Value(); - if ( i ) { - attrib->QueryIntValue( i ); - } - } - return result; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - const std::string* result = 0; - - if ( attrib ) { - result = &attrib->ValueStr(); - if ( i ) { - attrib->QueryIntValue( i ); - } - } - return result; -} -#endif - - -const char* TiXmlElement::Attribute( const char* name, double* d ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - const char* result = 0; - - if ( attrib ) { - result = attrib->Value(); - if ( d ) { - attrib->QueryDoubleValue( d ); - } - } - return result; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - const std::string* result = 0; - - if ( attrib ) { - result = &attrib->ValueStr(); - if ( d ) { - attrib->QueryDoubleValue( d ); - } - } - return result; -} -#endif - - -int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - if ( !attrib ) - return TIXML_NO_ATTRIBUTE; - return attrib->QueryIntValue( ival ); -} - - -int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - - int ival = 0; - int result = node->QueryIntValue( &ival ); - *value = (unsigned)ival; - return result; -} - - -int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - - int result = TIXML_WRONG_TYPE; - if ( StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN ) - || StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN ) - || StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) ) - { - *bval = true; - result = TIXML_SUCCESS; - } - else if ( StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN ) - || StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN ) - || StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) ) - { - *bval = false; - result = TIXML_SUCCESS; - } - return result; -} - - - -#ifdef TIXML_USE_STL -int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - if ( !attrib ) - return TIXML_NO_ATTRIBUTE; - return attrib->QueryIntValue( ival ); -} -#endif - - -int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - if ( !attrib ) - return TIXML_NO_ATTRIBUTE; - return attrib->QueryDoubleValue( dval ); -} - - -#ifdef TIXML_USE_STL -int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const -{ - const TiXmlAttribute* attrib = attributeSet.Find( name ); - if ( !attrib ) - return TIXML_NO_ATTRIBUTE; - return attrib->QueryDoubleValue( dval ); -} -#endif - - -void TiXmlElement::SetAttribute( const char * name, int val ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); - if ( attrib ) { - attrib->SetIntValue( val ); - } -} - - -#ifdef TIXML_USE_STL -void TiXmlElement::SetAttribute( const std::string& name, int val ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); - if ( attrib ) { - attrib->SetIntValue( val ); - } -} -#endif - - -void TiXmlElement::SetDoubleAttribute( const char * name, double val ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); - if ( attrib ) { - attrib->SetDoubleValue( val ); - } -} - - -#ifdef TIXML_USE_STL -void TiXmlElement::SetDoubleAttribute( const std::string& name, double val ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); - if ( attrib ) { - attrib->SetDoubleValue( val ); - } -} -#endif - - -void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( cname ); - if ( attrib ) { - attrib->SetValue( cvalue ); - } -} - - -#ifdef TIXML_USE_STL -void TiXmlElement::SetAttribute( const std::string& _name, const std::string& _value ) -{ - TiXmlAttribute* attrib = attributeSet.FindOrCreate( _name ); - if ( attrib ) { - attrib->SetValue( _value ); - } -} -#endif - - -void TiXmlElement::Print( FILE* cfile, int depth ) const -{ - int i; - assert( cfile ); - for ( i=0; iNext() ) - { - fprintf( cfile, " " ); - attrib->Print( cfile, depth ); - } - - // There are 3 different formatting approaches: - // 1) An element without children is printed as a node - // 2) An element with only a text child is printed as text - // 3) An element with children is printed on multiple lines. - TiXmlNode* node; - if ( !firstChild ) - { - fprintf( cfile, " />" ); - } - else if ( firstChild == lastChild && firstChild->ToText() ) - { - fprintf( cfile, ">" ); - firstChild->Print( cfile, depth + 1 ); - fprintf( cfile, "", value.c_str() ); - } - else - { - fprintf( cfile, ">" ); - - for ( node = firstChild; node; node=node->NextSibling() ) - { - if ( !node->ToText() ) - { - fprintf( cfile, "\n" ); - } - node->Print( cfile, depth+1 ); - } - fprintf( cfile, "\n" ); - for( i=0; i", value.c_str() ); - } -} - - -void TiXmlElement::CopyTo( TiXmlElement* target ) const -{ - // superclass: - TiXmlNode::CopyTo( target ); - - // Element class: - // Clone the attributes, then clone the children. - const TiXmlAttribute* attribute = 0; - for( attribute = attributeSet.First(); - attribute; - attribute = attribute->Next() ) - { - target->SetAttribute( attribute->Name(), attribute->Value() ); - } - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } -} - -bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this, attributeSet.First() ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); -} - - -TiXmlNode* TiXmlElement::Clone() const -{ - TiXmlElement* clone = new(std::nothrow) TiXmlElement(Value()); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -const char* TiXmlElement::GetText() const -{ - const TiXmlNode* child = this->FirstChild(); - if ( child ) { - const TiXmlText* childText = child->ToText(); - if ( childText ) { - return childText->Value(); - } - } - return 0; -} - - -TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - ClearError(); -} - -TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); -} - - -#ifdef TIXML_USE_STL -TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); -} -#endif - - -TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) -{ - copy.CopyTo( this ); -} - - -TiXmlDocument& TiXmlDocument::operator=( const TiXmlDocument& copy ) -{ - Clear(); - copy.CopyTo( this ); - return *this; -} - - -bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) -{ - return LoadFile( Value(), encoding ); -} - - -bool TiXmlDocument::SaveFile() const -{ - return SaveFile( Value() ); -} - -bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) -{ - TIXML_STRING filename( _filename ); - value = filename; - - // reading in binary mode so that tinyxml can normalize the EOL - FILE* file = TiXmlFOpen( value.c_str (), "rb" ); - - if ( file ) - { - bool result = LoadFile( file, encoding ); - fclose( file ); - return result; - } - else - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } -} - -bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) -{ - if ( !file ) - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // Delete the existing data: - Clear(); - location.Clear(); - - // Get the file size, so we can pre-allocate the string. HUGE speed impact. - long length = 0; - fseek( file, 0, SEEK_END ); - length = ftell( file ); - fseek( file, 0, SEEK_SET ); - - // Strange case, but good to handle up front. - if ( length <= 0 ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // Subtle bug here. TinyXml did use fgets. But from the XML spec: - // 2.11 End-of-Line Handling - // - // - // ...the XML processor MUST behave as if it normalized all line breaks in external - // parsed entities (including the document entity) on input, before parsing, by translating - // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to - // a single #xA character. - // - // - // It is not clear fgets does that, and certainly isn't clear it works cross platform. - // Generally, you expect fgets to translate from the convention of the OS to the c/unix - // convention, and not work generally. - - /* - while( fgets( buf, sizeof(buf), file ) ) - { - data += buf; - } - */ - - char* buf = new char[ length+1 ]; - buf[0] = 0; - - if ( fread( buf, length, 1, file ) != 1 ) { - delete [] buf; - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // Process the buffer in place to normalize new lines. (See comment above.) - // Copies from the 'p' to 'q' pointer, where p can advance faster if - // a newline-carriage return is hit. - // - // Wikipedia: - // Systems based on ASCII or a compatible character set use either LF (Line feed, '\n', 0x0A, 10 in decimal) or - // CR (Carriage return, '\r', 0x0D, 13 in decimal) individually, or CR followed by LF (CR+LF, 0x0D 0x0A)... - // * LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others - // * CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS - // * CR: Commodore 8-bit machines, Apple II family, Mac OS up to version 9 and OS-9 - - const char* p = buf; // the read head - char* q = buf; // the write head - const char CR = 0x0d; - const char LF = 0x0a; - - buf[length] = 0; - while( *p ) { - assert( p < (buf+length) ); - assert( q <= (buf+length) ); - assert( q <= p ); - - if ( *p == CR ) { - *q++ = LF; - p++; - if ( *p == LF ) { // check for CR+LF (and skip LF) - p++; - } - } - else { - *q++ = *p++; - } - } - assert( q <= (buf+length) ); - *q = 0; - - Parse( buf, 0, encoding ); - - delete [] buf; - return !Error(); -} - - -bool TiXmlDocument::SaveFile( const char * filename ) const -{ - // The old c stuff lives on... - FILE* fp = TiXmlFOpen( filename, "w" ); - if ( fp ) - { - bool result = SaveFile( fp ); - fclose( fp ); - return result; - } - return false; -} - - -bool TiXmlDocument::SaveFile( FILE* fp ) const -{ - if ( useMicrosoftBOM ) - { - const unsigned char TIXML_UTF_LEAD_0 = 0xefU; - const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; - const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - - fputc( TIXML_UTF_LEAD_0, fp ); - fputc( TIXML_UTF_LEAD_1, fp ); - fputc( TIXML_UTF_LEAD_2, fp ); - } - Print( fp, 0 ); - return (ferror(fp) == 0); -} - - -void TiXmlDocument::CopyTo( TiXmlDocument* target ) const -{ - TiXmlNode::CopyTo( target ); - - target->error = error; - target->errorId = errorId; - target->errorDesc = errorDesc; - target->tabsize = tabsize; - target->errorLocation = errorLocation; - target->useMicrosoftBOM = useMicrosoftBOM; - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } -} - - -TiXmlNode* TiXmlDocument::Clone() const -{ - TiXmlDocument* clone = new(std::nothrow) TiXmlDocument(); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlDocument::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - node->Print( cfile, depth ); - fprintf( cfile, "\n" ); - } -} - - -bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); -} - - -const TiXmlAttribute* TiXmlAttribute::Next() const -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; -} - -/* -TiXmlAttribute* TiXmlAttribute::Next() -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; -} -*/ - -const TiXmlAttribute* TiXmlAttribute::Previous() const -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; -} - -/* -TiXmlAttribute* TiXmlAttribute::Previous() -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; -} -*/ - -void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const -{ - TIXML_STRING n, v; - - EncodeString( name, &n ); - EncodeString( value, &v ); - - if (value.find ('\"') == TIXML_STRING::npos) { - if ( cfile ) { - fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; - } - } - else { - if ( cfile ) { - fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; - } - } -} - - -int TiXmlAttribute::QueryIntValue( int* ival ) const -{ - if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; -} - -int TiXmlAttribute::QueryDoubleValue( double* dval ) const -{ - if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; -} - -void TiXmlAttribute::SetIntValue( int _value ) -{ - char buf [64]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); - #else - sprintf (buf, "%d", _value); - #endif - SetValue (buf); -} - -void TiXmlAttribute::SetDoubleValue( double _value ) -{ - char buf [256]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%g", _value); - #else - sprintf (buf, "%g", _value); - #endif - SetValue (buf); -} - -int TiXmlAttribute::IntValue() const -{ - return atoi (value.c_str ()); -} - -double TiXmlAttribute::DoubleValue() const -{ - return atof (value.c_str ()); -} - - -TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::TINYXML_COMMENT ) -{ - copy.CopyTo( this ); -} - - -TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base ) -{ - Clear(); - base.CopyTo( this ); - return *this; -} - - -void TiXmlComment::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - for ( int i=0; i", value.c_str() ); -} - - -void TiXmlComment::CopyTo( TiXmlComment* target ) const -{ - TiXmlNode::CopyTo( target ); -} - - -bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlComment::Clone() const -{ - TiXmlComment* clone = new(std::nothrow) TiXmlComment(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlText::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - if ( cdata ) - { - int i; - fprintf( cfile, "\n" ); - for ( i=0; i\n", value.c_str() ); // unformatted output - } - else - { - TIXML_STRING buffer; - EncodeString( value, &buffer ); - fprintf( cfile, "%s", buffer.c_str() ); - } -} - - -void TiXmlText::CopyTo( TiXmlText* target ) const -{ - TiXmlNode::CopyTo( target ); - target->cdata = cdata; -} - - -bool TiXmlText::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlText::Clone() const -{ - TiXmlText* clone = nullptr; - clone = new(std::nothrow) TiXmlText(""); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -TiXmlDeclaration::TiXmlDeclaration( const char * _version, - const char * _encoding, - const char * _standalone ) - : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) -{ - version = _version; - encoding = _encoding; - standalone = _standalone; -} - - -#ifdef TIXML_USE_STL -TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ) - : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) -{ - version = _version; - encoding = _encoding; - standalone = _standalone; -} -#endif - - -TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) - : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) -{ - copy.CopyTo( this ); -} - - -TiXmlDeclaration& TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) -{ - Clear(); - copy.CopyTo( this ); - return *this; -} - - -void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const -{ - if ( cfile ) fprintf( cfile, "" ); - if ( str ) (*str) += "?>"; -} - - -void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const -{ - TiXmlNode::CopyTo( target ); - - target->version = version; - target->encoding = encoding; - target->standalone = standalone; -} - - -bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlDeclaration::Clone() const -{ - TiXmlDeclaration* clone = new(std::nothrow) TiXmlDeclaration(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlUnknown::Print( FILE* cfile, int depth ) const -{ - for ( int i=0; i", value.c_str() ); -} - - -void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const -{ - TiXmlNode::CopyTo( target ); -} - - -bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlUnknown::Clone() const -{ - TiXmlUnknown* clone = new(std::nothrow) TiXmlUnknown(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -TiXmlAttributeSet::TiXmlAttributeSet() -{ - sentinel.next = &sentinel; - sentinel.prev = &sentinel; -} - - -TiXmlAttributeSet::~TiXmlAttributeSet() -{ - assert( sentinel.next == &sentinel ); - assert( sentinel.prev == &sentinel ); -} - - -void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) -{ - #ifdef TIXML_USE_STL - assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. - #else - assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. - #endif - - addMe->next = &sentinel; - addMe->prev = sentinel.prev; - - sentinel.prev->next = addMe; - sentinel.prev = addMe; -} - -void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) -{ - TiXmlAttribute* node; - - for( node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node == removeMe ) - { - node->prev->next = node->next; - node->next->prev = node->prev; - node->next = 0; - node->prev = 0; - return; - } - } - assert( 0 ); // we tried to remove a non-linked attribute. -} - - -#ifdef TIXML_USE_STL -TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const -{ - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node->name == name ) - return node; - } - return 0; -} - -TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const std::string& _name ) -{ - TiXmlAttribute* attrib = Find( _name ); - if ( !attrib ) { - attrib = new TiXmlAttribute(); - Add( attrib ); - attrib->SetName( _name ); - } - return attrib; -} -#endif - - -TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const -{ - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( strcmp( node->name.c_str(), name ) == 0 ) - return node; - } - return 0; -} - - -TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const char* _name ) -{ - TiXmlAttribute* attrib = Find( _name ); - if ( !attrib ) { - attrib = new TiXmlAttribute(); - Add( attrib ); - attrib->SetName( _name ); - } - return attrib; -} - - -#ifdef TIXML_USE_STL -std::istream& operator>> (std::istream & in, TiXmlNode & base) -{ - TIXML_STRING tag; - tag.reserve( 8 * 1000 ); - base.StreamIn( &in, &tag ); - - base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); - return in; -} -#endif - - -#ifdef TIXML_USE_STL -std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) -{ - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out << printer.Str(); - - return out; -} - - -std::string& operator<< (std::string& out, const TiXmlNode& base ) -{ - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out.append( printer.Str() ); - - return out; -} -#endif - - -TiXmlHandle TiXmlHandle::FirstChild() const -{ - if ( node ) - { - TiXmlNode* child = node->FirstChild(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const -{ - if ( node ) - { - TiXmlNode* child = node->FirstChild( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChildElement() const -{ - if ( node ) - { - TiXmlElement* child = node->FirstChildElement(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const -{ - if ( node ) - { - TiXmlElement* child = node->FirstChildElement( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::Child( int count ) const -{ - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild(); - for ( i=0; - child && iNextSibling(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const -{ - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild( value ); - for ( i=0; - child && iNextSibling( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::ChildElement( int count ) const -{ - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement(); - for ( i=0; - child && iNextSiblingElement(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const -{ - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement( value ); - for ( i=0; - child && iNextSiblingElement( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) -{ - return true; -} - -bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) -{ - return true; -} - -bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) -{ - DoIndent(); - buffer += "<"; - buffer += element.Value(); - - for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) - { - buffer += " "; - attrib->Print( 0, 0, &buffer ); - } - - if ( !element.FirstChild() ) - { - buffer += " />"; - DoLineBreak(); - } - else - { - buffer += ">"; - if ( element.FirstChild()->ToText() - && element.LastChild() == element.FirstChild() - && element.FirstChild()->ToText()->CDATA() == false ) - { - simpleTextPrint = true; - // no DoLineBreak()! - } - else - { - DoLineBreak(); - } - } - ++depth; - return true; -} - - -bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) -{ - --depth; - if ( !element.FirstChild() ) - { - // nothing. - } - else - { - if ( simpleTextPrint ) - { - simpleTextPrint = false; - } - else - { - DoIndent(); - } - buffer += ""; - DoLineBreak(); - } - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlText& text ) -{ - if ( text.CDATA() ) - { - DoIndent(); - buffer += ""; - DoLineBreak(); - } - else if ( simpleTextPrint ) - { - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - } - else - { - DoIndent(); - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - DoLineBreak(); - } - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) -{ - DoIndent(); - declaration.Print( 0, 0, &buffer ); - DoLineBreak(); - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlComment& comment ) -{ - DoIndent(); - buffer += ""; - DoLineBreak(); - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) -{ - DoIndent(); - buffer += "<"; - buffer += unknown.Value(); - buffer += ">"; - DoLineBreak(); - return true; -} - diff --git a/OpenSauce/shared/Include/TinyXml/tinyxml.hpp b/OpenSauce/shared/Include/TinyXml/tinyxml.hpp deleted file mode 100644 index a1934bb74..000000000 --- a/OpenSauce/shared/Include/TinyXml/tinyxml.hpp +++ /dev/null @@ -1,1813 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code by 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 -#include -#include -#include -#include - -// Help out windows: -#if defined( _DEBUG ) && !defined( DEBUG ) -#define DEBUG -#endif - -#ifdef TIXML_USE_STL - #include - #include - #include - #define TIXML_STRING std::string -#else - #include - #define TIXML_STRING TiXmlString -#endif - -// 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_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_SSCANF sscanf - #elif defined(__GNUC__) && (__GNUC__ >= 3 ) - // GCC version 3 and higher.s - //#warning( "Using sn* functions." ) - #define TIXML_SNPRINTF snprintf - #define TIXML_SSCANF sscanf - #else - #define TIXML_SNPRINTF snprintf - #define TIXML_SSCANF sscanf - #endif -#endif - -// If TIXML_SAFE is undefined, these won't ever be defined... -#ifndef TIXML_SNPRINTF - #define TIXML_SNPRINTF snprintf -#endif -#ifndef TIXML_SSCANF - #define TIXML_SSCANF sscanf -#endif - -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 = 6; -const int TIXML_PATCH_VERSION = 2; - -/* 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. -}; - - -/** - Implements the interface to the "Visitor pattern" (see the Accept() method.) - 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 simply called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its sibilings 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 unknown 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_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 - { - TINYXML_DOCUMENT, - TINYXML_ELEMENT, - TINYXML_COMMENT, - TINYXML_UNKNOWN, - TINYXML_TEXT, - TINYXML_DECLARATION, - TINYXML_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: TINYXML_DOCUMENT, TINYXML_ELEMENT, TINYXML_COMMENT, - TINYXML_UNKNOWN, TINYXML_TEXT, and TINYXML_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; } - - TiXmlAttribute* Find( const char* _name ) const; - TiXmlAttribute* FindOrCreate( const char* _name ); - -# ifdef TIXML_USE_STL - TiXmlAttribute* Find( const std::string& _name ) const; - TiXmlAttribute* FindOrCreate( const std::string& _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& ); - - TiXmlElement& 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; - /// QueryUnsignedAttribute examines the attribute - see QueryIntAttribute(). - int QueryUnsignedAttribute( const char* name, unsigned* _value ) const; - /** QueryBoolAttribute examines the attribute - see QueryIntAttribute(). - Note that '1', 'true', or 'yes' are considered true, while '0', 'false' - and 'no' are considered false. - */ - int QueryBoolAttribute( const char* name, bool* _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 - /// QueryStringAttribute examines the attribute - see QueryIntAttribute(). - int QueryStringAttribute( const char* name, std::string* _value ) const { - const char* cstr = Attribute( name ); - if ( cstr ) { - *_value = std::string( cstr ); - return TIXML_SUCCESS; - } - return TIXML_NO_ATTRIBUTE; - } - - /** 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 that contain spaces. - - @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; - } - - 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 ); - ///< STL std::string form. - void SetDoubleAttribute( const std::string& name, double 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 - This is text - 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 - This is text - @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 - This is text - @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::TINYXML_COMMENT ) {} - /// Construct a comment from text. - TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::TINYXML_COMMENT ) { - SetValue( _value ); - } - TiXmlComment( const TiXmlComment& ); - TiXmlComment& 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::TINYXML_TEXT) - { - SetValue( initValue ); - cdata = false; - } - virtual ~TiXmlText() {} - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TINYXML_TEXT) - { - SetValue( initValue ); - cdata = false; - } - #endif - - TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TINYXML_TEXT ) { copy.CopyTo( this ); } - TiXmlText& operator=( const TiXmlText& base ) { base.CopyTo( this ); return *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 - - @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::TINYXML_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 ); - TiXmlDeclaration& 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::TINYXML_UNKNOWN ) {} - virtual ~TiXmlUnknown() {} - - TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::TINYXML_UNKNOWN ) { copy.CopyTo( this ); } - TiXmlUnknown& operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); return *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 ); - TiXmlDocument& 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( FILE*, 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. - { - return LoadFile( filename.c_str(), encoding ); - } - bool SaveFile( const std::string& filename ) const ///< STL std::string version. - { - 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 - - - - - - - @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 ) { if ( &ref != this ) 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 - -// The goal of the seperate error file is to make the first -// step towards localization. tinyxml (currently) only supports -// english error messages, but the could now be translated. -// -// It also cleans up the code a bit. -// - -const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] = -{ - "No error", - "Error", - "Failed to open file", - "Error parsing Element.", - "Failed to read Element name", - "Error reading Element value.", - "Error reading Attributes.", - "Error: empty tag.", - "Error reading end tag.", - "Error parsing Unknown.", - "Error parsing Comment.", - "Error parsing Declaration.", - "Error document empty.", - "Error null (0) or unexpected EOF found in input stream.", - "Error parsing CDATA.", - "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", -}; diff --git a/OpenSauce/shared/Include/TinyXml/tinyxmlparser.cpp b/OpenSauce/shared/Include/TinyXml/tinyxmlparser.cpp deleted file mode 100644 index 2c2469f5c..000000000 --- a/OpenSauce/shared/Include/TinyXml/tinyxmlparser.cpp +++ /dev/null @@ -1,1639 +0,0 @@ -#include "Common/Precompile.hpp" -/* -www.sourceforge.net/projects/tinyxml -Original code by 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. -*/ - -#include -#include - -#include - -//#define DEBUG_PARSER -#if defined( DEBUG_PARSER ) -# if defined( DEBUG ) && defined( _MSC_VER ) -# include -# define TIXML_LOG OutputDebugString -# else -# define TIXML_LOG printf -# endif -#endif - -// Note tha "PutString" hardcodes the same list. This -// is less flexible than it appears. Changing the entries -// or order will break putstring. -TiXmlBase::Entity TiXmlBase::entity[ TiXmlBase::NUM_ENTITY ] = -{ - { "&", 5, '&' }, - { "<", 4, '<' }, - { ">", 4, '>' }, - { """, 6, '\"' }, - { "'", 6, '\'' } -}; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// Including the basic of this table, which determines the #bytes in the -// sequence from the lead byte. 1 placed for invalid sequences -- -// although the result will be junk, pass it through as much as possible. -// Beware of the non-characters in UTF-8: -// ef bb bf (Microsoft "lead bytes") -// ef bf be -// ef bf bf - -const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - -const int TiXmlBase::utf8ByteTable[256] = -{ - // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 - 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte - 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid -}; - - -void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) - *length = 1; - else if ( input < 0x800 ) - *length = 2; - else if ( input < 0x10000 ) - *length = 3; - else if ( input < 0x200000 ) - *length = 4; - else - { *length = 0; return; } // This code won't covert this correctly anyway. - - output += *length; - - // Scary scary fall throughs. - switch (*length) - { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - } -} - - -/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalpha( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalpha( anyByte ); -// } -} - - -/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalnum( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalnum( anyByte ); -// } -} - - -class TiXmlParsingData -{ - friend class TiXmlDocument; - public: - void Stamp( const char* now, TiXmlEncoding encoding ); - - const TiXmlCursor& Cursor() const { return cursor; } - - private: - // Only used by the document! - TiXmlParsingData( const char* start, int _tabsize, int row, int col ) - { - assert( start ); - stamp = start; - tabsize = _tabsize; - cursor.row = row; - cursor.col = col; - } - - TiXmlCursor cursor; - const char* stamp; - int tabsize; -}; - - -void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) -{ - assert( now ); - - // Do nothing if the tabsize is 0. - if ( tabsize < 1 ) - { - return; - } - - // Get the current row, column. - int row = cursor.row; - int col = cursor.col; - const char* p = stamp; - assert( p ); - - while ( p < now ) - { - // Treat p as unsigned, so we have a happy compiler. - const unsigned char* pU = (const unsigned char*)p; - - // Code contributed by Fletcher Dunn: (modified by lee) - switch (*pU) { - case 0: - // We *should* never get here, but in case we do, don't - // advance past the terminating null character, ever - return; - - case '\r': - // bump down to the next line - ++row; - col = 0; - // Eat the character - ++p; - - // Check for \r\n sequence, and treat this as a single character - if (*p == '\n') { - ++p; - } - break; - - case '\n': - // bump down to the next line - ++row; - col = 0; - - // Eat the character - ++p; - - // Check for \n\r sequence, and treat this as a single - // character. (Yes, this bizarre thing does occur still - // on some arcane platforms...) - if (*p == '\r') { - ++p; - } - break; - - case '\t': - // Eat the character - ++p; - - // Skip to next tab stop - col = (col / tabsize + 1) * tabsize; - break; - - case TIXML_UTF_LEAD_0: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( *(p+1) && *(p+2) ) - { - // In these cases, don't advance the column. These are - // 0-width spaces. - if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) - p += 3; - else - { p +=3; ++col; } // A normal character. - } - } - else - { - ++p; - ++col; - } - break; - - default: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // Eat the 1 to 4 byte utf8 character. - int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; - if ( step == 0 ) - step = 1; // Error case from bad encoding, but handle gracefully. - p += step; - - // Just advance one column, of course. - ++col; - } - else - { - ++p; - ++col; - } - break; - } - } - cursor.row = row; - cursor.col = col; - assert( cursor.row >= -1 ); - assert( cursor.col >= -1 ); - stamp = p; - assert( stamp ); -} - - -const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) -{ - if ( !p || !*p ) - { - return 0; - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - while ( *p ) - { - const unsigned char* pU = (const unsigned char*)p; - - // Skip the stupid Microsoft UTF-8 Byte order marks - if ( *(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==TIXML_UTF_LEAD_1 - && *(pU+2)==TIXML_UTF_LEAD_2 ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbeU ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbfU ) - { - p += 3; - continue; - } - - if ( IsWhiteSpace( *p ) ) // Still using old rules for white space. - ++p; - else - break; - } - } - else - { - while ( *p && IsWhiteSpace( *p ) ) - ++p; - } - - return p; -} - -#ifdef TIXML_USE_STL -/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) -{ - for( ;; ) - { - if ( !in->good() ) return false; - - int c = in->peek(); - // At this scope, we can't get to a document. So fail silently. - if ( !IsWhiteSpace( c ) || c <= 0 ) - return true; - - *tag += (char) in->get(); - } -} - -/*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) -{ - //assert( character > 0 && character < 128 ); // else it won't work in utf-8 - while ( in->good() ) - { - int c = in->peek(); - if ( c == character ) - return true; - if ( c <= 0 ) // Silent failure: can't get document at this scope - return false; - - in->get(); - *tag += (char) c; - } - return false; -} -#endif - -// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The -// "assign" optimization removes over 10% of the execution time. -// -const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) -{ - // Oddly, not supported on some comilers, - //name->clear(); - // So use this: - *name = ""; - assert( p ); - - // Names start with letters or underscores. - // Of course, in unicode, tinyxml has no idea what a letter *is*. The - // algorithm is generous. - // - // After that, they can be letters, underscores, numbers, - // hyphens, or colons. (Colons are valid ony for namespaces, - // but tinyxml can't tell namespaces from names.) - if ( p && *p - && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) - { - const char* start = p; - while( p && *p - && ( IsAlphaNum( (unsigned char ) *p, encoding ) - || *p == '_' - || *p == '-' - || *p == '.' - || *p == ':' ) ) - { - //(*name) += *p; // expensive - ++p; - } - if ( p-start > 0 ) { - name->assign( start, p-start ); - } - return p; - } - return 0; -} - -const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) -{ - // Presume an entity, and pull it out. - TIXML_STRING ent; - int i; - *length = 0; - - if ( *(p+1) && *(p+1) == '#' && *(p+2) ) - { - unsigned long ucs = 0; - ptrdiff_t delta = 0; - unsigned mult = 1; - - if ( *(p+2) == 'x' ) - { - // Hexadecimal. - if ( !*(p+3) ) return 0; - - const char* q = p+3; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != 'x' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else if ( *q >= 'a' && *q <= 'f' ) - ucs += mult * (*q - 'a' + 10); - else if ( *q >= 'A' && *q <= 'F' ) - ucs += mult * (*q - 'A' + 10 ); - else - return 0; - mult *= 16; - --q; - } - } - else - { - // Decimal. - if ( !*(p+2) ) return 0; - - const char* q = p+2; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != '#' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else - return 0; - mult *= 10; - --q; - } - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - } - else - { - *value = (char)ucs; - *length = 1; - } - return p + delta + 1; - } - - // Now try to match it. - for( i=0; iappend( cArr, len ); - } - } - else - { - bool whitespace = false; - - // Remove leading white space: - p = SkipWhiteSpace( p, encoding ); - while ( p && *p - && !StringEqual( p, endTag, caseInsensitive, encoding ) ) - { - if ( *p == '\r' || *p == '\n' ) - { - whitespace = true; - ++p; - } - else if ( IsWhiteSpace( *p ) ) - { - whitespace = true; - ++p; - } - else - { - // If we've found whitespace, add it before the - // new character. Any whitespace just becomes a space. - if ( whitespace ) - { - (*text) += ' '; - whitespace = false; - } - int len; - char cArr[4] = { 0, 0, 0, 0 }; - p = GetChar( p, cArr, &len, encoding ); - if ( len == 1 ) - (*text) += cArr[0]; // more efficient - else - text->append( cArr, len ); - } - } - } - if ( p && *p ) - p += strlen( endTag ); - return ( p && *p ) ? p : 0; -} - -#ifdef TIXML_USE_STL - -void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - // The basic issue with a document is that we don't know what we're - // streaming. Read something presumed to be a tag (and hope), then - // identify it, and call the appropriate stream method on the tag. - // - // This "pre-streaming" will never read the closing ">" so the - // sub-tag can orient itself. - - if ( !StreamTo( in, '<', tag ) ) - { - SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - while ( in->good() ) - { - int tagIndex = (int) tag->length(); - while ( in->good() && in->peek() != '>' ) - { - int c = in->get(); - if ( c <= 0 ) - { - SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - break; - } - (*tag) += (char) c; - } - - if ( in->good() ) - { - // We now have something we presume to be a node of - // some sort. Identify it, and call the node to - // continue streaming. - TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); - - if ( node ) - { - node->StreamIn( in, tag ); - bool isElement = node->ToElement() != 0; - delete node; - node = 0; - - // If this is the root element, we're done. Parsing will be - // done by the >> operator. - if ( isElement ) - { - return; - } - } - else - { - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - } - } - // We should have returned sooner. - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); -} - -#endif - -const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) -{ - ClearError(); - - // Parse away, at the document level. Since a document - // contains nothing but other tags, most of what happens - // here is skipping white space. - if ( !p || !*p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - // Note that, for a document, this needs to come - // before the while space skip, so that parsing - // starts from the pointer we are given. - location.Clear(); - if ( prevData ) - { - location.row = prevData->cursor.row; - location.col = prevData->cursor.col; - } - else - { - location.row = 0; - location.col = 0; - } - TiXmlParsingData data( p, TabSize(), location.row, location.col ); - location = data.Cursor(); - - if ( encoding == TIXML_ENCODING_UNKNOWN ) - { - // Check for the Microsoft UTF-8 lead bytes. - const unsigned char* pU = (const unsigned char*)p; - if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 - && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 - && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) - { - encoding = TIXML_ENCODING_UTF8; - useMicrosoftBOM = true; - } - } - - p = SkipWhiteSpace( p, encoding ); - if ( !p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - while ( p && *p ) - { - TiXmlNode* node = Identify( p, encoding ); - if ( node ) - { - p = node->Parse( p, &data, encoding ); - LinkEndChild( node ); - } - else - { - break; - } - - // Did we get encoding info? - if ( encoding == TIXML_ENCODING_UNKNOWN - && node->ToDeclaration() ) - { - TiXmlDeclaration* dec = node->ToDeclaration(); - const char* enc = dec->Encoding(); - assert( enc ); - - if ( *enc == 0 ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice - else - encoding = TIXML_ENCODING_LEGACY; - } - - p = SkipWhiteSpace( p, encoding ); - } - - // Was this empty? - if ( !firstChild ) { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); - return 0; - } - - // All is well. - return p; -} - -void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - // The first error in a chain is more accurate - don't set again! - if ( error ) - return; - - assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); - error = true; - errorId = err; - errorDesc = errorString[ errorId ]; - - errorLocation.Clear(); - if ( pError && data ) - { - data->Stamp( pError, encoding ); - errorLocation = data->Cursor(); - } -} - - -TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) -{ - TiXmlNode* returnNode = 0; - - p = SkipWhiteSpace( p, encoding ); - if( !p || !*p || *p != '<' ) - { - return 0; - } - - p = SkipWhiteSpace( p, encoding ); - - if ( !p || !*p ) - { - return 0; - } - - // What is this thing? - // - Elements start with a letter or underscore, but xml is reserved. - // - Comments: "; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - if ( document ) - document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // [ 1475201 ] TinyXML parses entities in comments - // Oops - ReadText doesn't work, because we don't want to parse the entities. - // p = ReadText( p, &value, false, endTag, false, encoding ); - // - // from the XML spec: - /* - [Definition: Comments may appear anywhere in a document outside other markup; in addition, - they may appear within the document type declaration at places allowed by the grammar. - They are not part of the document's character data; an XML processor MAY, but need not, - make it possible for an application to retrieve the text of comments. For compatibility, - the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity - references MUST NOT be recognized within comments. - - An example of a comment: - - - */ - - value = ""; - // Keep all the white space. - while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) - { - value.append( p, 1 ); - ++p; - } - if ( p && *p ) - p += strlen( endTag ); - - return p; -} - - -const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) return 0; - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - // Read the name, the '=' and the value. - const char* pErr = p; - p = ReadName( p, &name, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); - return 0; - } - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p || *p != '=' ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - ++p; // skip '=' - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - const char* end; - const char SINGLE_QUOTE = '\''; - const char DOUBLE_QUOTE = '\"'; - - if ( *p == SINGLE_QUOTE ) - { - ++p; - end = "\'"; // single quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else if ( *p == DOUBLE_QUOTE ) - { - ++p; - end = "\""; // double quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else - { - // All attribute values should be in single or double quotes. - // But this is such a common error that the parser will try - // its best, even without them. - value = ""; - while ( p && *p // existence - && !IsWhiteSpace( *p ) // whitespace - && *p != '/' && *p != '>' ) // tag end - { - if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) { - // [ 1451649 ] Attribute values with trailing quotes not handled correctly - // We did not have an opening quote but seem to have a - // closing one. Give up and throw an error. - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - value += *p; - ++p; - } - } - return p; -} - -#ifdef TIXML_USE_STL -void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->peek(); - if ( !cdata && (c == '<' ) ) - { - return; - } - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - (*tag) += (char) c; - in->get(); // "commits" the peek made above - - if ( cdata && c == '>' && tag->size() >= 3 ) { - size_t len = tag->size(); - if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) { - // terminator of cdata. - return; - } - } - } -} -#endif - -const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - value = ""; - TiXmlDocument* document = GetDocument(); - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - - const char* const startTag = ""; - - if ( cdata || StringEqual( p, startTag, false, encoding ) ) - { - cdata = true; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - if ( document ) - document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // Keep all the white space, ignore the encoding, etc. - while ( p && *p - && !StringEqual( p, endTag, false, encoding ) - ) - { - value += *p; - ++p; - } - - TIXML_STRING dummy; - p = ReadText( p, &dummy, false, endTag, false, encoding ); - return p; - } - else - { - bool ignoreWhite = true; - - const char* end = "<"; - p = ReadText( p, &value, ignoreWhite, end, false, encoding ); - if ( p && *p ) - return p-1; // don't truncate the '<' - return 0; - } -} - -#ifdef TIXML_USE_STL -void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->get(); - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - (*tag) += (char) c; - - if ( c == '>' ) - { - // All is well. - return; - } - } -} -#endif - -const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) -{ - p = SkipWhiteSpace( p, _encoding ); - // Find the beginning, find the end, and look for - // the stuff in-between. - TiXmlDocument* document = GetDocument(); - if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); - return 0; - } - if ( data ) - { - data->Stamp( p, _encoding ); - location = data->Cursor(); - } - p += 5; - - version = ""; - encoding = ""; - standalone = ""; - - while ( p && *p ) - { - if ( *p == '>' ) - { - ++p; - return p; - } - - p = SkipWhiteSpace( p, _encoding ); - if ( StringEqual( p, "version", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - version = attrib.Value(); - } - else if ( StringEqual( p, "encoding", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - encoding = attrib.Value(); - } - else if ( StringEqual( p, "standalone", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - standalone = attrib.Value(); - } - else - { - // Read over whatever it is. - while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) - ++p; - } - } - return 0; -} - -bool TiXmlText::Blank() const -{ - for ( unsigned i=0; i - -namespace Yelo -{ - namespace Memory - { - template - struct DataArray { - private: - typedef DataArray DataArrayT; - - public: - struct Iterator { - private: - s_data_iterator iterator; - - public: - Iterator(DataArrayT* data) { - blam::data_iterator_new(iterator, &data->Header); - } - - DatumT* Next() { - return CAST_PTR(DatumT*, blam::data_iterator_next( *CAST_PTR(s_data_iterator*, this) )); - } - - datum_index Current() const { return this->iterator.index; } - }; - - s_data_array Header; - - public: - - Iterator& IteratorNew(Iterator& iter) { - return iter = Iterator(this); - } - - API_INLINE DatumT* Datums() { - return CAST_PTR(DatumT*, this->Header.data); - } - - API_INLINE operator s_data_array*() { - return &this->Header; - } - - API_INLINE DatumT* operator [](datum_index handle) - { -#if PLATFORM_IS_EDITOR - return CAST_PTR(DatumT*, blam::datum_get(&this->Header, handle)); -#else - return &CAST_PTR(DatumT*, this->Header.data)[handle.index]; -#endif - } - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.cpp b/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.cpp deleted file mode 100644 index 407528d00..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#include "Common/Precompile.hpp" -#if PLATFORM_IS_EDITOR -#include - -#include -#include -#include -#include -#include - -namespace Yelo -{ - namespace blam - { - }; -}; - -#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/cache/cache_files.hpp b/OpenSauce/shared/Include/blamlib/Halo2/cache/cache_files.hpp deleted file mode 100644 index 516121531..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/cache/cache_files.hpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include -#include - -namespace Yelo -{ - namespace Enums - { - enum { - k_number_of_relative_tag_instances = 10000, - }; - }; - - namespace Cache - { - struct s_cache_header : public s_cache_header_base - { - enum { - k_version = 8, - - k_pad_size = 321 * sizeof(int32), - }; - - tag header_signature; - - int32 version; - uint32 file_length; - uint32 compressed_file_length; - - uint32 offset_to_index; - uint32 index_stream_size; - uint32 tag_buffer_size; - uint32 total_stream_size; - uint32 virtual_base_address; - - struct _tag_dependency_graph { - uint32 offset; - uint32 size; - }tag_dependency_graph; - - long_string source_file; - tag_string build; - long_enum cache_type; - uint32 crc; - - PAD32; - PAD32; PAD32; - PAD32; // count of some sort? only on the xbox - PAD32; - PAD32; - - struct _debug_string_id { - PAD32; - uint32 count; - uint32 buffer_size; - uint32 indices_offset; - uint32 buffer_offset; - }string_ids; - - PAD8; PAD8; PAD8; PAD8; // 4 bools - - FILETIME cache_build_dates[4]; - - tag_string cache_name; - PAD32; - long_string scenario_name; - uint32 minor_version; - - struct _debug_tag_names { - uint32 count; - uint32 buffer_offset; - uint32 buffer_size; - uint32 indices_offset; - }tag_names; - - struct _language_pack { - uint32 offset; - uint32 size; - }language_pack; - - datum_index secondary_sound_gestalt_index; - - struct _fast_geometry_load_region { - uint32 cache_block_offset; - uint32 cache_block_size; - }fast_geometry_load_region; - - uint32 checksum; - uint32 mopp_code_checksum; - - byte padding[k_pad_size /*- sizeof(s_cache_header_yelo)*/]; - - tag footer_signature; - }; BOOST_STATIC_ASSERT( sizeof(s_cache_header) == 0x800 ); - - struct s_cache_tag_instance - { - tag group_tag; - datum_index handle; - void* address; - uint32 size; - - template API_INLINE T* Definition() const { return CAST_PTR(T*, definition); } - - }; BOOST_STATIC_ASSERT( sizeof(s_cache_tag_instance) == 0x10 ); - struct s_cache_tag_header - { - struct _debug_group_tags { - void* address; - int32 count; - }group_tags; - s_cache_tag_instance* instances; - datum_index scenario_index; - datum_index globals_index; - uint32 checksum; - int32 tag_count; - tag signature; - }; BOOST_STATIC_ASSERT( sizeof(s_cache_tag_header) == 0x20 ); - - - struct s_cache_file_resource_database_item { - void* owner; - uint32 size; - void* data; - uint32 hash; - void* resource_ptr; - }; BOOST_STATIC_ASSERT( sizeof(s_cache_file_resource_database_item) == 0x14 ); - struct s_cache_file_resource_database { - bool initialized; - tag_string name; - PAD24; - Memory::s_hash_table* hash_table; - PAD32; - int32 maximum_count; - s_cache_file_resource_database_item* items; - FILE* file_handle; - }; BOOST_STATIC_ASSERT( sizeof(s_cache_file_resource_database) == 0x38 ); - - - struct s_shared_tag_index_entry { - tag group_tag; - long_string name; - datum_index tag_index; - }; BOOST_STATIC_ASSERT( sizeof(s_shared_tag_index_entry) == 0x108 ); - struct s_shared_tag_index { - s_shared_tag_index_entry entries[Enums::k_number_of_relative_tag_instances]; - int32 count; - }; BOOST_STATIC_ASSERT( sizeof(s_shared_tag_index) == sizeof(int32) + (sizeof(s_shared_tag_index_entry)*Enums::k_number_of_relative_tag_instances) ); - - // Dependency range description for a single shared tag - struct s_shared_dependency_graph_entry { - int32 start; // Index of the first dependency of this tag - int32 count; // How many tag dependencies this tag has - - API_INLINE bool IsNull() const { return start == NONE; } - API_INLINE void Nullify() - { - start = NONE; - count = 0; - } - }; - struct s_shared_dependency_graph_buffer { - int32 count; - - // nasty hack gagger -#pragma warning(push) -#pragma warning(disable : 4200) - s_shared_dependency_graph_entry entries[]; -#pragma warning(pop) - }; - struct s_shared_dependency_graph { - s_shared_dependency_graph_buffer* buffer; - // For each shared tag (any tag indexed at 0x2710 or higher) there is an entry in this graph - // which gives the range values in [dependencies] which define its immediate tag references - s_shared_dependency_graph_entry* entries; - datum_index* dependencies; - }; BOOST_STATIC_ASSERT( sizeof(s_shared_dependency_graph) == 0xC ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/cache/predicted_resources.hpp b/OpenSauce/shared/Include/blamlib/Halo2/cache/predicted_resources.hpp deleted file mode 100644 index 806babab2..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/cache/predicted_resources.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - enum predicted_resource : _enum { - _predicted_resource_bitmap, - _predicted_resource_sound, - - // TODO: Halo 2 defines more types of predicted resources (tho, not all of them are actually put to use) - - _predicted_resource - }; - }; - - namespace TagGroups - { - struct predicted_resource - { - _enum type; - int16 resource_index; - datum_index tag_index; - }; BOOST_STATIC_ASSERT( sizeof(predicted_resource) == 0x8 ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/cseries/cseries.hpp b/OpenSauce/shared/Include/blamlib/Halo2/cseries/cseries.hpp deleted file mode 100644 index 99bd61bd8..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/cseries/cseries.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include -#include - -namespace Yelo -{ -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/cseries/errors.hpp b/OpenSauce/shared/Include/blamlib/Halo2/cseries/errors.hpp deleted file mode 100644 index 299f46575..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/cseries/errors.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - enum error_message_priority : long_enum - { - _error_message_priority_none, // ? - _error_message_priority_warning, - _error_message_priority_assert, - _error_message_priority_critical, - _error_message_priority, - }; - - enum error_category : long_enum - { - _error_category_none, - _error_category_warning, // _error_category_internal_full - _error_category_debug, // _error_category_internal_subfolder - _error_category_animation, - _error_category_ai, - _error_category_shaders, - _error_category_geometry, - _error_category_environment, - _error_category_objects, - _error_category_networking, - _error_category_tags, - _error_category_ui, - _error_category_sound, - _error_category_multiplayer, - _error_category_effects, - _error_category_animation_audio_content, - _error_category_environment_materials, - _error_category_object_materials, - _error_category_design, - _error_category_localization, - _error_category, - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/game/players.hpp b/OpenSauce/shared/Include/blamlib/Halo2/game/players.hpp deleted file mode 100644 index c76330dfd..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/game/players.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - enum { - k_maximum_players = 16, - k_maximum_teams = k_maximum_players, - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/hs/hs.hpp b/OpenSauce/shared/Include/blamlib/Halo2/hs/hs.hpp deleted file mode 100644 index a49fee6cc..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/hs/hs.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include -#include - -namespace Yelo -{ - namespace Enums - { - enum hs_script_type - { - _hs_script_type_startup, - _hs_script_type_dormant, - _hs_script_type_continuous, - _hs_script_type_static, - _hs_script_type_stub, - _hs_script_type_command_script, - _hs_script_type, - }; - - enum hs_type : _enum - { - _hs_unparsed, - _hs_special_form, - _hs_function_name, - _hs_passthrough, - _hs_type_void, - _hs_type_boolean, - _hs_type_real, - _hs_type_short, - _hs_type_long, - _hs_type_string, - _hs_type_script, - _hs_type_string_id, - _hs_type_unit_seat_mapping, - _hs_type_trigger_volume, - _hs_type_cutscene_flag, - _hs_type_cutscene_camera_point, - _hs_type_cutscene_title, - _hs_type_cutscene_recording, - _hs_type_device_group, - _hs_type_ai, - _hs_type_ai_command_list, - _hs_type_ai_command_script, - _hs_type_ai_behavior, - _hs_type_ai_orders, - _hs_type_starting_profile, - _hs_type_conversation, - _hs_type_structure_bsp, - _hs_type_navpoint, - _hs_type_point_reference, - _hs_type_style, - _hs_type_hud_message, - _hs_type_object_list, - _hs_type_sound, - _hs_type_effect, - _hs_type_damage, - _hs_type_looping_sound, - _hs_type_animation_graph, - _hs_type_object_definition, - _hs_type_bitmap, - _hs_type_shader, - _hs_type_render_model, - _hs_type_structure_definition, - _hs_type_lightmap_definition, - _hs_type_game_difficulty, - _hs_type_team, - _hs_type_actor_type, - _hs_type_hud_corner, - _hs_type_model_state, - _hs_type_network_event, - _hs_type_object, - _hs_type_unit, - _hs_type_vehicle, - _hs_type_weapon, - _hs_type_device, - _hs_type_scenery, - _hs_type_object_name, - _hs_type_unit_name, - _hs_type_vehicle_name, - _hs_type_weapon_name, - _hs_type_device_name, - _hs_type_scenery_name, - _hs_type, - }; - }; - - namespace Scripting - { - typedef void (PLATFORM_API* hs_parse_proc)(int32 function_index, datum_index expression_index); - typedef void (PLATFORM_API* hs_evaluate_proc)(int32 function_index, datum_index expression_index, bool* execute); - - // halo script function definition - struct hs_function_definition - { - _enum return_type; - uint16 flags; // padding in halo, special flags in project yellow -#if PLATFORM_IS_EDITOR || PLATFORM_ID == PLATFORM_H2_ALPHA - cstring name; -#endif - long_flags unknown; // TODO: was this in alpha? -#if PLATFORM_IS_EDITOR - hs_parse_proc parse; -#endif - hs_evaluate_proc evaluate; -#if PLATFORM_IS_EDITOR - cstring info; -#endif - cstring param_info; - int16 paramc; -#pragma warning( push ) -#pragma warning( disable : 4200 ) // nonstandard extension used : zero-sized array in struct/union, Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array - int16 params[]; -#pragma warning( pop ) - }; - - // halo script accessible value - struct hs_global_definition - { -#if PLATFORM_IS_EDITOR - cstring name; -#endif - _enum type; - word_flags flags; // padding in halo, special flags in project yellow - union { - void* address; - - union { - bool* _bool; - real* _real; - int16* _short; - int32* _long; - char* _string; - datum_index _datum; - }Value; - }; - }; - - - struct hs_syntax_node : Memory::s_datum_base - { - union { - int16 ConstantType; - int16 FunctionIndex; - }; - int16 Type; - union { - uint16 Flags; - int16 PointerType; - }; - datum_index NextExpression; - int32 Pointer; - union { - void* Address; - - struct { - bool _bool; - real _real; - int16 _short; - int32 _long; - datum_index _datum; - }Value; - }; - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface.hpp b/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface.hpp deleted file mode 100644 index e92bbcf83..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - enum { - // Maximum number of users per machine - k_number_of_users = -#if PLATFORM_TARGET == PLATFORM_TARGET_PC - 1, -#else - 4, -#endif - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface_controller.hpp b/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface_controller.hpp deleted file mode 100644 index 4aff0f2d1..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/interface/user_interface_controller.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include - -namespace Yelo -{ - namespace Enums - { - enum { - k_no_controller = NONE, - k_number_of_controllers = k_number_of_users, - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/constant_pool.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/constant_pool.hpp deleted file mode 100644 index 5ab1097c8..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/constant_pool.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include -#include -#include - -namespace Yelo -{ - namespace Memory - { - struct s_constant_pool_datum { - uint32 header; - void* address; // inside s_constant_pool->values_pool - }; BOOST_STATIC_ASSERT( sizeof(s_constant_pool_datum) == 0x8 ); - - struct s_constant_pool { - tag_string name; - void* sizeof_proc; // size_t (const void* buffer) - void* hasher_proc; - void* format_proc; // char* (char* buffer) - void* comparer_proc; - void* copy_proc; // void (const void* src, const void* dst) - void** allocator; - s_hash_table* keys; - s_data_array* values; - s_memory_pool* values_pool; - }; BOOST_STATIC_ASSERT( sizeof(s_constant_pool) == 0x44 ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/data.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/data.hpp deleted file mode 100644 index c3477ee0d..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/data.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include - -namespace Yelo -{ - namespace Flags - { - enum data_array - { - _data_array_can_disconnect_bit, - _data_array_disconnected_bit, - - _data_array_allocation_bit, - _data_array, - - _data_array_can_disconnect_flag = FLAG(_data_array_can_disconnect_bit), - _data_array_disconnected_flag = FLAG(_data_array_disconnected_bit), - - _data_array_allocation_flag = FLAG(_data_array_allocation_bit), - }; - }; - - namespace Memory - { - struct s_data_array { - tag_string name; // Name of the data array - int32 maximum_count; // How many datums this array can hold - uint32 datum_size; // Size of one datum - byte alignment_bit; - bool is_valid; // True if this array is usable - word_flags flags; - tag signature; // 'd@t@' - void** allocator; // allocation object - struct { - int32 next_index; // Next available bit index in the bit vector that can be used - int32 length; // Current length (in bits) of the bit index - }active_indices; - int32 actual_count; // Number of datums in use - datum_index next_datum; - void* data; - byte* active_indices_bit_vector; - - inline int32 GetLength() const { return actual_count; } - }; BOOST_STATIC_ASSERT( sizeof(s_data_array) == 0x4C ); - - struct s_data_iterator - { - s_data_array* data; - datum_index index; - int32 absolute_index; - tag signature; - }; BOOST_STATIC_ASSERT( sizeof(s_data_iterator) == 0x10 ); - }; - - namespace blam - { - using namespace Yelo::Memory; - - void data_iterator_new(s_data_iterator& iterator, s_data_array* data); - - void* data_iterator_next(s_data_iterator& iterator); - - void* datum_get(s_data_array* data, datum_index index); - }; -}; - -#include \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/hashtable.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/hashtable.hpp deleted file mode 100644 index 6c9fd851d..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/hashtable.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Memory - { - struct s_hash_table_item { - void* data; - uint32 hash; - s_hash_table_item* next; - }; BOOST_STATIC_ASSERT( sizeof(s_hash_table_item) == 0xC ); - - struct s_hash_table { - tag_string name; - uint32 buffer_size; - int32 maximum_count; - uint32 key_size; - void* hash_proc; // uint32 (void* buffer) - void* compare_proc; // bool (const void*, const void*) - void** allocator; - s_hash_table_item* items; - }; BOOST_STATIC_ASSERT( sizeof(s_hash_table) == 0x3C ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/lruv_cache.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/lruv_cache.hpp deleted file mode 100644 index 0400b8f06..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/lruv_cache.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include - -namespace Yelo -{ - namespace Memory - { - struct s_lruv_cache_block - { - UNKNOWN_TYPE(int32); // not sure if the header is a short or a datum_index, please check km00! - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - int32 next_block_index; - int32 prev_block_index; - int32 last_used_frame_index; - }; - - struct s_lruv_cache - { - tag_string name; - void* delete_proc; - void* locked_proc; - void* unknown_proc; - int32 hole_algorithm_type; - int32 block_size; - int32 page_size_bits; - long_flags flags; - int32 first_block_index; - int32 last_block_index; - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - UNKNOWN_TYPE(int32); - s_data_array* blocks; - tag signature; - void* allocation_procs_vtable; - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/memory_pool.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/memory_pool.hpp deleted file mode 100644 index faa84ca05..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/memory_pool.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Memory - { - struct s_memory_pool_block_header { - tag signature; - cstring file; - uint32 line; - uint32 time_code; - }; BOOST_STATIC_ASSERT( sizeof(s_memory_pool_block_header) == 0x10 ); - - struct s_memory_pool_block { - uint32 size; // Total size of this entire block plus sizeof(memory_pool_block) - void** address; // Pointer to a reference that interfaces with this block in the pool (see: object header) - s_memory_pool_block* next_block; - s_memory_pool_block* prev_block; - - // Total size of the block data - inline uint32 DataSize() { return size - sizeof(s_memory_pool_block); } - }; BOOST_STATIC_ASSERT( sizeof(s_memory_pool_block) == 0x10 ); - - struct s_memory_pool { - tag signature; - tag_string name; - void** allocator; - void* next_address; - uint32 size; - uint32 free_space; - s_memory_pool_block* first_block; - s_memory_pool_block* last_block; - bool dont_compact_blocks; - bool allow_block_allocations_anywhere; - PAD8; - bool uses_debug_header; - }; BOOST_STATIC_ASSERT( sizeof(s_memory_pool) == 0x40 ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/memory/resource_database.hpp b/OpenSauce/shared/Include/blamlib/Halo2/memory/resource_database.hpp deleted file mode 100644 index c976a0e47..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/memory/resource_database.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Memory - { - struct s_resource_database_item { - uint32 size; - void* address; - uint32 hash; - bool unknown; - PAD24; - }; BOOST_STATIC_ASSERT( sizeof(s_resource_database_item) == 0x10 ); - - struct s_resource_database { - tag_string name; - uint32 key_size; - void* allocator; - void* hash_table; - int32 count; - int32 maximum_count; - HANDLE unknown1; - HANDLE unknown2; - void* base_address; - s_resource_database_item* items; - }; BOOST_STATIC_ASSERT( sizeof(s_resource_database) == 0x44 ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/networking/session/network_session.hpp b/OpenSauce/shared/Include/blamlib/Halo2/networking/session/network_session.hpp deleted file mode 100644 index 397dd08f4..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/networking/session/network_session.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - enum { - k_maximum_machines = 16, - - k_network_maximum_players_per_session = k_maximum_machines, - }; - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/shaders/shader_definitions.hpp b/OpenSauce/shared/Include/blamlib/Halo2/shaders/shader_definitions.hpp deleted file mode 100644 index 351a4223b..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/shaders/shader_definitions.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include - -namespace Yelo -{ - namespace TagGroups - { - struct s_shader_definition - { - enum { k_group_tag = 'shad' }; - - TAG_FIELD(tag_reference, shader_template, 'stem'); - TAG_FIELD(string_id, material_name); - TAG_BLOCK(runtime_properties, s_shader_properties); - word_flags internal_flags; - TAG_FIELD(word_flags, flags); - TAG_BLOCK(parameters, s_shader_parameter); - TAG_BLOCK(postprocess_definition, s_shader_postprocess_definition_new); - TAG_PAD(int32, 1); - //TAG_PAD(int32, 3); // useless padding - TAG_BLOCK(predicted_resources, predicted_resource); - TAG_FIELD(tag_reference, light_response, 'slit'); - TAG_ENUM(shader_lod_bias); - TAG_ENUM(specular_type); - TAG_ENUM(lightmap_type); - PAD16; - TAG_FIELD(real, lightmap_specular_brightness); - TAG_FIELD(real, lightmap_ambient_bias); - TAG_BLOCK(postprocess_properties, int32); - TAG_FIELD(real, added_depth_bias_offset); - TAG_FIELD(real, added_depth_bias_slope_scale); - }; BOOST_STATIC_ASSERT( sizeof(s_shader_definition) == 0x80 ); - - struct s_shader_pass_definition - { - enum { k_group_tag = 'spas' }; - - TAG_FIELD(tag_data, documentation); - TAG_BLOCK(parameters, s_shader_pass_parameter); - PAD16; - PAD16; - TAG_BLOCK(implementations, s_shader_pass_implementation); - TAG_BLOCK(postprocess_definition, s_shader_pass_postprocess_definition_new); - }; BOOST_STATIC_ASSERT( sizeof(s_shader_pass_definition) == 0x3C ); - - struct s_shader_template_definition - { - enum { k_group_tag = 'stem' }; - - TAG_FIELD(tag_data, documentation); - TAG_FIELD(string_id, default_material_name); - word_flags internal_flags; - TAG_FIELD(word_flags, flags); - TAG_BLOCK(properties, s_shader_template_property); - TAG_BLOCK(categories, s_shader_template_category); - TAG_FIELD(tag_reference, light_response, 'slit'); - TAG_BLOCK(lods, s_shader_template_level_of_detail); - TAG_PAD(tag_block, 2); - struct { - TAG_FIELD(tag_reference, shader, 'shad'); - TAG_ENUM(layer); - PAD16; - }aux_shaders[2]; - TAG_BLOCK(postprocess_definition, s_shader_template_postprocess_definition_new); - }; BOOST_STATIC_ASSERT( sizeof(s_shader_template_definition) == 0x9C ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/sound/sound_definitions.hpp b/OpenSauce/shared/Include/blamlib/Halo2/sound/sound_definitions.hpp deleted file mode 100644 index 08fad2eb8..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/sound/sound_definitions.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include - -namespace Yelo -{ - namespace TagGroups - { - struct sound_definition - { - enum { k_group_tag = 'snd!' }; - - }; //BOOST_STATIC_ASSERT( sizeof(sound_definition) == 0x ); - - - struct s_sound_effect_template_collection - { - enum { k_group_tag = '' }; - - TAG_BLOCK(template_collection, s_sound_effect_template_definition); - TAG_FIELD(string_id, input_effect_name); - TAG_BLOCK(additional_sound_inputs, s_sound_effect_template_sound_input_definition); - TAG_BLOCK(platform_definition, s_platform_sound_effect_template_collection); - }; BOOST_STATIC_ASSERT( sizeof(s_sound_effect_template_collection) == 0x28 ); - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/tag_files/files.hpp b/OpenSauce/shared/Include/blamlib/Halo2/tag_files/files.hpp deleted file mode 100644 index 1a78a2900..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/tag_files/files.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -namespace Yelo -{ - namespace Enums - { - }; - - struct s_file_reference { - tag signature; - word_flags flags; - _enum location; - long_string file_name; - HANDLE handle; - HRESULT api_result; - }; BOOST_STATIC_ASSERT( sizeof(s_file_reference) == 0x110 ); -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo2/tag_files/tag_groups.hpp b/OpenSauce/shared/Include/blamlib/Halo2/tag_files/tag_groups.hpp deleted file mode 100644 index d6892c212..000000000 --- a/OpenSauce/shared/Include/blamlib/Halo2/tag_files/tag_groups.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - Yelo: Open Sauce SDK - - See license\OpenSauce\OpenSauce for specific license information -*/ -#pragma once - -#include -#include - -namespace Yelo -{ - namespace TagGroups - { - }; -}; \ No newline at end of file diff --git a/OpenSauce/shared/Include/mongoose/mongoose.c b/OpenSauce/shared/Include/mongoose/mongoose.c deleted file mode 100644 index 21a9aba62..000000000 --- a/OpenSauce/shared/Include/mongoose/mongoose.c +++ /dev/null @@ -1,5025 +0,0 @@ -// Copyright (c) 2004-2012 Sergey Lyubka -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if defined(_WIN32) -#define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005 -#else -#ifdef __linux__ -#define _XOPEN_SOURCE 600 // For flockfile() on Linux -#endif -#define _LARGEFILE_SOURCE // Enable 64-bit file offsets -#define __STDC_FORMAT_MACROS // wants this for C++ -#define __STDC_LIMIT_MACROS // C++ wants that for INT64_MAX -#endif - -// Disable WIN32_LEAN_AND_MEAN. -// This makes windows.h always include winsock2.h -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#if defined(__SYMBIAN32__) -#define NO_SSL // SSL is not supported -#define NO_CGI // CGI is not supported -#define PATH_MAX FILENAME_MAX -#endif // __SYMBIAN32__ - -#ifndef _WIN32_WCE // Some ANSI #includes are not available on Windows CE -#include -#include -#include -#include -#include -#endif // !_WIN32_WCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) && !defined(__SYMBIAN32__) // Windows specific -#define _WIN32_WINNT 0x0400 // To make it link in VS2005 -#include - -#ifndef PATH_MAX -#define PATH_MAX MAX_PATH -#endif - -#ifndef _WIN32_WCE -#include -#include -#include -#else // _WIN32_WCE -#define NO_CGI // WinCE has no pipes - -typedef long off_t; - -#define errno GetLastError() -#define strerror(x) _ultoa(x, (char *) _alloca(sizeof(x) *3 ), 10) -#endif // _WIN32_WCE - -#define MAKEUQUAD(lo, hi) ((uint64_t)(((uint32_t)(lo)) | \ - ((uint64_t)((uint32_t)(hi))) << 32)) -#define RATE_DIFF 10000000 // 100 nsecs -#define EPOCH_DIFF MAKEUQUAD(0xd53e8000, 0x019db1de) -#define SYS2UNIX_TIME(lo, hi) \ - (time_t) ((MAKEUQUAD((lo), (hi)) - EPOCH_DIFF) / RATE_DIFF) - -// Visual Studio 6 does not know __func__ or __FUNCTION__ -// The rest of MS compilers use __FUNCTION__, not C99 __func__ -// Also use _strtoui64 on modern M$ compilers -#if defined(_MSC_VER) && _MSC_VER < 1300 -#define STRX(x) #x -#define STR(x) STRX(x) -#define __func__ "line " STR(__LINE__) -#define strtoull(x, y, z) strtoul(x, y, z) -#define strtoll(x, y, z) strtol(x, y, z) -#else -#define __func__ __FUNCTION__ -#define strtoull(x, y, z) _strtoui64(x, y, z) -#define strtoll(x, y, z) _strtoi64(x, y, z) -#endif // _MSC_VER - -#define ERRNO GetLastError() -#define NO_SOCKLEN_T -#define SSL_LIB "ssleay32.dll" -#define CRYPTO_LIB "libeay32.dll" -#define O_NONBLOCK 0 -#if !defined(EWOULDBLOCK) -#define EWOULDBLOCK WSAEWOULDBLOCK -#endif // !EWOULDBLOCK -#define _POSIX_ -#define INT64_FMT "I64d" - -#define WINCDECL __cdecl -#define SHUT_WR 1 -#define snprintf _snprintf -#define vsnprintf _vsnprintf -#define mg_sleep(x) Sleep(x) - -#define pipe(x) _pipe(x, MG_BUF_LEN, _O_BINARY) -#define popen(x, y) _popen(x, y) -#define pclose(x) _pclose(x) -#define close(x) _close(x) -#define dlsym(x,y) GetProcAddress((HINSTANCE) (x), (y)) -#define RTLD_LAZY 0 -#define fseeko(x, y, z) _lseeki64(_fileno(x), (y), (z)) -#define fdopen(x, y) _fdopen((x), (y)) -#define write(x, y, z) _write((x), (y), (unsigned) z) -#define read(x, y, z) _read((x), (y), (unsigned) z) -#define flockfile(x) EnterCriticalSection(&global_log_file_lock) -#define funlockfile(x) LeaveCriticalSection(&global_log_file_lock) -#define sleep(x) Sleep((x) * 1000) - -#if !defined(fileno) -#define fileno(x) _fileno(x) -#endif // !fileno MINGW #defines fileno - -typedef HANDLE pthread_mutex_t; -typedef struct {HANDLE signal, broadcast;} pthread_cond_t; -typedef DWORD pthread_t; -#define pid_t HANDLE // MINGW typedefs pid_t to int. Using #define here. - -static int pthread_mutex_lock(pthread_mutex_t *); -static int pthread_mutex_unlock(pthread_mutex_t *); - -static void to_unicode(const char *path, wchar_t *wbuf, size_t wbuf_len); -static char *mg_fgets(char *buf, size_t size, struct file *filep, char **p); - -#if defined(HAVE_STDINT) -#include -#else -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned __int64 uint64_t; -typedef __int64 int64_t; -#define INT64_MAX 9223372036854775807 -#endif // HAVE_STDINT - -// POSIX dirent interface -struct dirent { - char d_name[PATH_MAX]; -}; - -typedef struct DIR { - HANDLE handle; - WIN32_FIND_DATAW info; - struct dirent result; -} DIR; - -// Mark required libraries -#pragma comment(lib, "Ws2_32.lib") - -#else // UNIX specific -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#if !defined(NO_SSL_DL) && !defined(NO_SSL) -#include -#endif -#include -#if defined(__MACH__) -#define SSL_LIB "libssl.dylib" -#define CRYPTO_LIB "libcrypto.dylib" -#else -#if !defined(SSL_LIB) -#define SSL_LIB "libssl.so" -#endif -#if !defined(CRYPTO_LIB) -#define CRYPTO_LIB "libcrypto.so" -#endif -#endif -#ifndef O_BINARY -#define O_BINARY 0 -#endif // O_BINARY -#define closesocket(a) close(a) -#define mg_mkdir(x, y) mkdir(x, y) -#define mg_remove(x) remove(x) -#define mg_rename(x, y) rename(x, y) -#define mg_sleep(x) usleep((x) * 1000) -#define ERRNO errno -#define INVALID_SOCKET (-1) -#define INT64_FMT PRId64 -typedef int SOCKET; -#define WINCDECL - -#endif // End of Windows and UNIX specific includes - -#include "mongoose.h" - -#ifdef USE_LUA -#include -#include -#endif - -#define MONGOOSE_VERSION "3.4" -#define PASSWORDS_FILE_NAME ".htpasswd" -#define CGI_ENVIRONMENT_SIZE 4096 -#define MAX_CGI_ENVIR_VARS 64 -#define MG_BUF_LEN 8192 -#define MAX_REQUEST_SIZE 16384 -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) - -#ifdef _WIN32 -static CRITICAL_SECTION global_log_file_lock; -static pthread_t pthread_self(void) { - return GetCurrentThreadId(); -} -#endif // _WIN32 - -#ifdef DEBUG_TRACE -#undef DEBUG_TRACE -#define DEBUG_TRACE(x) -#else -#if defined(DEBUG) -#define DEBUG_TRACE(x) do { \ - flockfile(stdout); \ - printf("*** %lu.%p.%s.%d: ", \ - (unsigned long) time(NULL), (void *) pthread_self(), \ - __func__, __LINE__); \ - printf x; \ - putchar('\n'); \ - fflush(stdout); \ - funlockfile(stdout); \ -} while (0) -#else -#define DEBUG_TRACE(x) -#endif // DEBUG -#endif // DEBUG_TRACE - -// Darwin prior to 7.0 and Win32 do not have socklen_t -#ifdef NO_SOCKLEN_T -typedef int socklen_t; -#endif // NO_SOCKLEN_T -#define _DARWIN_UNLIMITED_SELECT - -#if !defined(MSG_NOSIGNAL) -#define MSG_NOSIGNAL 0 -#endif - -#if !defined(SOMAXCONN) -#define SOMAXCONN 100 -#endif - -#if !defined(PATH_MAX) -#define PATH_MAX 4096 -#endif - -static const char *http_500_error = "Internal Server Error"; - -// Snatched from OpenSSL includes. I put the prototypes here to be independent -// from the OpenSSL source installation. Having this, mongoose + SSL can be -// built on any system with binary SSL libraries installed. -typedef struct ssl_st SSL; -typedef struct ssl_method_st SSL_METHOD; -typedef struct ssl_ctx_st SSL_CTX; - -#define SSL_ERROR_WANT_READ 2 -#define SSL_ERROR_WANT_WRITE 3 -#define SSL_FILETYPE_PEM 1 -#define CRYPTO_LOCK 1 - -#if defined(NO_SSL_DL) -extern void SSL_free(SSL *); -extern int SSL_accept(SSL *); -extern int SSL_connect(SSL *); -extern int SSL_read(SSL *, void *, int); -extern int SSL_write(SSL *, const void *, int); -extern int SSL_get_error(const SSL *, int); -extern int SSL_set_fd(SSL *, int); -extern SSL *SSL_new(SSL_CTX *); -extern SSL_CTX *SSL_CTX_new(SSL_METHOD *); -extern SSL_METHOD *SSLv23_server_method(void); -extern SSL_METHOD *SSLv23_client_method(void); -extern int SSL_library_init(void); -extern void SSL_load_error_strings(void); -extern int SSL_CTX_use_PrivateKey_file(SSL_CTX *, const char *, int); -extern int SSL_CTX_use_certificate_file(SSL_CTX *, const char *, int); -extern int SSL_CTX_use_certificate_chain_file(SSL_CTX *, const char *); -extern void SSL_CTX_set_default_passwd_cb(SSL_CTX *, mg_callback_t); -extern void SSL_CTX_free(SSL_CTX *); -extern unsigned long ERR_get_error(void); -extern char *ERR_error_string(unsigned long, char *); -extern int CRYPTO_num_locks(void); -extern void CRYPTO_set_locking_callback(void (*)(int, int, const char *, int)); -extern void CRYPTO_set_id_callback(unsigned long (*)(void)); -#else -// Dynamically loaded SSL functionality -struct ssl_func { - const char *name; // SSL function name - void (*ptr)(void); // Function pointer -}; - -#define SSL_free (* (void (*)(SSL *)) ssl_sw[0].ptr) -#define SSL_accept (* (int (*)(SSL *)) ssl_sw[1].ptr) -#define SSL_connect (* (int (*)(SSL *)) ssl_sw[2].ptr) -#define SSL_read (* (int (*)(SSL *, void *, int)) ssl_sw[3].ptr) -#define SSL_write (* (int (*)(SSL *, const void *,int)) ssl_sw[4].ptr) -#define SSL_get_error (* (int (*)(SSL *, int)) ssl_sw[5].ptr) -#define SSL_set_fd (* (int (*)(SSL *, SOCKET)) ssl_sw[6].ptr) -#define SSL_new (* (SSL * (*)(SSL_CTX *)) ssl_sw[7].ptr) -#define SSL_CTX_new (* (SSL_CTX * (*)(SSL_METHOD *)) ssl_sw[8].ptr) -#define SSLv23_server_method (* (SSL_METHOD * (*)(void)) ssl_sw[9].ptr) -#define SSL_library_init (* (int (*)(void)) ssl_sw[10].ptr) -#define SSL_CTX_use_PrivateKey_file (* (int (*)(SSL_CTX *, \ - const char *, int)) ssl_sw[11].ptr) -#define SSL_CTX_use_certificate_file (* (int (*)(SSL_CTX *, \ - const char *, int)) ssl_sw[12].ptr) -#define SSL_CTX_set_default_passwd_cb \ - (* (void (*)(SSL_CTX *, mg_callback_t)) ssl_sw[13].ptr) -#define SSL_CTX_free (* (void (*)(SSL_CTX *)) ssl_sw[14].ptr) -#define SSL_load_error_strings (* (void (*)(void)) ssl_sw[15].ptr) -#define SSL_CTX_use_certificate_chain_file \ - (* (int (*)(SSL_CTX *, const char *)) ssl_sw[16].ptr) -#define SSLv23_client_method (* (SSL_METHOD * (*)(void)) ssl_sw[17].ptr) - -#define CRYPTO_num_locks (* (int (*)(void)) crypto_sw[0].ptr) -#define CRYPTO_set_locking_callback \ - (* (void (*)(void (*)(int, int, const char *, int))) crypto_sw[1].ptr) -#define CRYPTO_set_id_callback \ - (* (void (*)(unsigned long (*)(void))) crypto_sw[2].ptr) -#define ERR_get_error (* (unsigned long (*)(void)) crypto_sw[3].ptr) -#define ERR_error_string (* (char * (*)(unsigned long,char *)) crypto_sw[4].ptr) - -// set_ssl_option() function updates this array. -// It loads SSL library dynamically and changes NULLs to the actual addresses -// of respective functions. The macros above (like SSL_connect()) are really -// just calling these functions indirectly via the pointer. -static struct ssl_func ssl_sw[] = { - {"SSL_free", NULL}, - {"SSL_accept", NULL}, - {"SSL_connect", NULL}, - {"SSL_read", NULL}, - {"SSL_write", NULL}, - {"SSL_get_error", NULL}, - {"SSL_set_fd", NULL}, - {"SSL_new", NULL}, - {"SSL_CTX_new", NULL}, - {"SSLv23_server_method", NULL}, - {"SSL_library_init", NULL}, - {"SSL_CTX_use_PrivateKey_file", NULL}, - {"SSL_CTX_use_certificate_file",NULL}, - {"SSL_CTX_set_default_passwd_cb",NULL}, - {"SSL_CTX_free", NULL}, - {"SSL_load_error_strings", NULL}, - {"SSL_CTX_use_certificate_chain_file", NULL}, - {"SSLv23_client_method", NULL}, - {NULL, NULL} -}; - -// Similar array as ssl_sw. These functions could be located in different lib. -#if !defined(NO_SSL) -static struct ssl_func crypto_sw[] = { - {"CRYPTO_num_locks", NULL}, - {"CRYPTO_set_locking_callback", NULL}, - {"CRYPTO_set_id_callback", NULL}, - {"ERR_get_error", NULL}, - {"ERR_error_string", NULL}, - {NULL, NULL} -}; -#endif // NO_SSL -#endif // NO_SSL_DL - -static const char *month_names[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -// Unified socket address. For IPv6 support, add IPv6 address structure -// in the union u. -union usa { - struct sockaddr sa; - struct sockaddr_in sin; -#if defined(USE_IPV6) - struct sockaddr_in6 sin6; -#endif -}; - -// Describes a string (chunk of memory). -struct vec { - const char *ptr; - size_t len; -}; - -struct file { - int is_directory; - time_t modification_time; - int64_t size; - FILE *fp; - const char *membuf; // Non-NULL if file data is in memory -}; -#define STRUCT_FILE_INITIALIZER {0, 0, 0, NULL, NULL} - -// Describes listening socket, or socket which was accept()-ed by the master -// thread and queued for future handling by the worker thread. -struct socket { - struct socket *next; // Linkage - SOCKET sock; // Listening socket - union usa lsa; // Local socket address - union usa rsa; // Remote socket address - int is_ssl; // Is socket SSL-ed -}; - -// NOTE(lsm): this enum shoulds be in sync with the config_options below. -enum { - CGI_EXTENSIONS, CGI_ENVIRONMENT, PUT_DELETE_PASSWORDS_FILE, CGI_INTERPRETER, - PROTECT_URI, AUTHENTICATION_DOMAIN, SSI_EXTENSIONS, THROTTLE, - ACCESS_LOG_FILE, ENABLE_DIRECTORY_LISTING, ERROR_LOG_FILE, - GLOBAL_PASSWORDS_FILE, INDEX_FILES, ENABLE_KEEP_ALIVE, ACCESS_CONTROL_LIST, - EXTRA_MIME_TYPES, LISTENING_PORTS, DOCUMENT_ROOT, SSL_CERTIFICATE, - NUM_THREADS, RUN_AS_USER, REWRITE, HIDE_FILES, - NUM_OPTIONS -}; - -static const char *config_options[] = { - "C", "cgi_pattern", "**.cgi$|**.pl$|**.php$", - "E", "cgi_environment", NULL, - "G", "put_delete_passwords_file", NULL, - "I", "cgi_interpreter", NULL, - "P", "protect_uri", NULL, - "R", "authentication_domain", "mydomain.com", - "S", "ssi_pattern", "**.shtml$|**.shtm$", - "T", "throttle", NULL, - "a", "access_log_file", NULL, - "d", "enable_directory_listing", "yes", - "e", "error_log_file", NULL, - "g", "global_passwords_file", NULL, - "i", "index_files", "index.html,index.htm,index.cgi,index.shtml,index.php", - "k", "enable_keep_alive", "no", - "l", "access_control_list", NULL, - "m", "extra_mime_types", NULL, - "p", "listening_ports", "8080", - "r", "document_root", ".", - "s", "ssl_certificate", NULL, - "t", "num_threads", "20", - "u", "run_as_user", NULL, - "w", "url_rewrite_patterns", NULL, - "x", "hide_files_patterns", NULL, - NULL -}; -#define ENTRIES_PER_CONFIG_OPTION 3 - -struct mg_context { - volatile int stop_flag; // Should we stop event loop - SSL_CTX *ssl_ctx; // SSL context - SSL_CTX *client_ssl_ctx; // Client SSL context - char *config[NUM_OPTIONS]; // Mongoose configuration parameters - mg_callback_t user_callback; // User-defined callback function - void *user_data; // User-defined data - - struct socket *listening_sockets; - - volatile int num_threads; // Number of threads - pthread_mutex_t mutex; // Protects (max|num)_threads - pthread_cond_t cond; // Condvar for tracking workers terminations - - struct socket queue[20]; // Accepted sockets - volatile int sq_head; // Head of the socket queue - volatile int sq_tail; // Tail of the socket queue - pthread_cond_t sq_full; // Signaled when socket is produced - pthread_cond_t sq_empty; // Signaled when socket is consumed -}; - -struct mg_connection { - struct mg_request_info request_info; - struct mg_context *ctx; - SSL *ssl; // SSL descriptor - struct socket client; // Connected client - time_t birth_time; // Time when request was received - int64_t num_bytes_sent; // Total bytes sent to client - int64_t content_len; // Content-Length header value - int64_t consumed_content; // How many bytes of content have been read - char *buf; // Buffer for received data - char *path_info; // PATH_INFO part of the URL - int must_close; // 1 if connection must be closed - int buf_size; // Buffer size - int request_len; // Size of the request + headers in a buffer - int data_len; // Total size of data in a buffer - int status_code; // HTTP reply status code, e.g. 200 - int throttle; // Throttling, bytes/sec. <= 0 means no throttle - time_t last_throttle_time; // Last time throttled data was sent - int64_t last_throttle_bytes;// Bytes sent this second -}; - -const char **mg_get_valid_option_names(void) { - return config_options; -} - -static void *call_user(struct mg_connection *conn, enum mg_event event) { - if (conn != NULL && conn->ctx != NULL) { - conn->request_info.user_data = conn->ctx->user_data; - } - return conn == NULL || conn->ctx == NULL || conn->ctx->user_callback == NULL ? - NULL : conn->ctx->user_callback(event, conn); -} - -static int is_file_in_memory(struct mg_connection *conn, const char *path, - struct file *filep) { - conn->request_info.ev_data = (void *) path; - if ((filep->membuf = call_user(conn, MG_OPEN_FILE)) != NULL) { - filep->size = (long) conn->request_info.ev_data; - } - return filep->membuf != NULL; -} - -static int is_file_opened(const struct file *filep) { - return filep->membuf != NULL || filep->fp != NULL; -} - -static int mg_fopen(struct mg_connection *conn, const char *path, - const char *mode, struct file *filep) { - if (!is_file_in_memory(conn, path, filep)) { -#ifdef _WIN32 - wchar_t wbuf[PATH_MAX], wmode[20]; - to_unicode(path, wbuf, ARRAY_SIZE(wbuf)); - MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, ARRAY_SIZE(wmode)); - filep->fp = _wfopen(wbuf, wmode); -#else - filep->fp = fopen(path, mode); -#endif - } - - return is_file_opened(filep); -} - -static void mg_fclose(struct file *filep) { - if (filep != NULL && filep->fp != NULL) { - fclose(filep->fp); - } -} - -static int get_option_index(const char *name) { - int i; - - for (i = 0; config_options[i] != NULL; i += ENTRIES_PER_CONFIG_OPTION) { - if (strcmp(config_options[i], name) == 0 || - strcmp(config_options[i + 1], name) == 0) { - return i / ENTRIES_PER_CONFIG_OPTION; - } - } - return -1; -} - -const char *mg_get_option(const struct mg_context *ctx, const char *name) { - int i; - if ((i = get_option_index(name)) == -1) { - return NULL; - } else if (ctx->config[i] == NULL) { - return ""; - } else { - return ctx->config[i]; - } -} - -static void sockaddr_to_string(char *buf, size_t len, - const union usa *usa) { - buf[0] = '\0'; -#if defined(USE_IPV6) - inet_ntop(usa->sa.sa_family, usa->sa.sa_family == AF_INET ? - (void *) &usa->sin.sin_addr : - (void *) &usa->sin6.sin6_addr, buf, len); -#elif defined(_WIN32) - // Only Windoze Vista (and newer) have inet_ntop() - strncpy(buf, inet_ntoa(usa->sin.sin_addr), len); -#else - inet_ntop(usa->sa.sa_family, (void *) &usa->sin.sin_addr, buf, len); -#endif -} - -static void cry(struct mg_connection *conn, - PRINTF_FORMAT_STRING(const char *fmt), ...) PRINTF_ARGS(2, 3); - -// Print error message to the opened error log stream. -static void cry(struct mg_connection *conn, const char *fmt, ...) { - char buf[MG_BUF_LEN], src_addr[20]; - va_list ap; - FILE *fp; - time_t timestamp; - - va_start(ap, fmt); - (void) vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - - // Do not lock when getting the callback value, here and below. - // I suppose this is fine, since function cannot disappear in the - // same way string option can. - conn->request_info.ev_data = buf; - if (call_user(conn, MG_EVENT_LOG) == NULL) { - fp = conn->ctx == NULL || conn->ctx->config[ERROR_LOG_FILE] == NULL ? NULL : - fopen(conn->ctx->config[ERROR_LOG_FILE], "a+"); - - if (fp != NULL) { - flockfile(fp); - timestamp = time(NULL); - - sockaddr_to_string(src_addr, sizeof(src_addr), &conn->client.rsa); - fprintf(fp, "[%010lu] [error] [client %s] ", (unsigned long) timestamp, - src_addr); - - if (conn->request_info.request_method != NULL) { - fprintf(fp, "%s %s: ", conn->request_info.request_method, - conn->request_info.uri); - } - - fprintf(fp, "%s", buf); - fputc('\n', fp); - funlockfile(fp); - fclose(fp); - } - } - conn->request_info.ev_data = NULL; -} - -// Return fake connection structure. Used for logging, if connection -// is not applicable at the moment of logging. -static struct mg_connection *fc(struct mg_context *ctx) { - static struct mg_connection fake_connection; - fake_connection.ctx = ctx; - return &fake_connection; -} - -const char *mg_version(void) { - return MONGOOSE_VERSION; -} - -struct mg_request_info *mg_get_request_info(struct mg_connection *conn) { - return &conn->request_info; -} - -static void mg_strlcpy(register char *dst, register const char *src, size_t n) { - for (; *src != '\0' && n > 1; n--) { - *dst++ = *src++; - } - *dst = '\0'; -} - -static int lowercase(const char *s) { - return tolower(* (const unsigned char *) s); -} - -static int mg_strncasecmp(const char *s1, const char *s2, size_t len) { - int diff = 0; - - if (len > 0) - do { - diff = lowercase(s1++) - lowercase(s2++); - } while (diff == 0 && s1[-1] != '\0' && --len > 0); - - return diff; -} - -static int mg_strcasecmp(const char *s1, const char *s2) { - int diff; - - do { - diff = lowercase(s1++) - lowercase(s2++); - } while (diff == 0 && s1[-1] != '\0'); - - return diff; -} - -static char * mg_strndup(const char *ptr, size_t len) { - char *p; - - if ((p = (char *) malloc(len + 1)) != NULL) { - mg_strlcpy(p, ptr, len + 1); - } - - return p; -} - -static char * mg_strdup(const char *str) { - return mg_strndup(str, strlen(str)); -} - -// Like snprintf(), but never returns negative value, or a value -// that is larger than a supplied buffer. -// Thanks to Adam Zeldis to pointing snprintf()-caused vulnerability -// in his audit report. -static int mg_vsnprintf(struct mg_connection *conn, char *buf, size_t buflen, - const char *fmt, va_list ap) { - int n; - - if (buflen == 0) - return 0; - - n = vsnprintf(buf, buflen, fmt, ap); - - if (n < 0) { - cry(conn, "vsnprintf error"); - n = 0; - } else if (n >= (int) buflen) { - cry(conn, "truncating vsnprintf buffer: [%.*s]", - n > 200 ? 200 : n, buf); - n = (int) buflen - 1; - } - buf[n] = '\0'; - - return n; -} - -static int mg_snprintf(struct mg_connection *conn, char *buf, size_t buflen, - PRINTF_FORMAT_STRING(const char *fmt), ...) - PRINTF_ARGS(4, 5); - -static int mg_snprintf(struct mg_connection *conn, char *buf, size_t buflen, - const char *fmt, ...) { - va_list ap; - int n; - - va_start(ap, fmt); - n = mg_vsnprintf(conn, buf, buflen, fmt, ap); - va_end(ap); - - return n; -} - -// Skip the characters until one of the delimiters characters found. -// 0-terminate resulting word. Skip the delimiter and following whitespaces if any. -// Advance pointer to buffer to the next word. Return found 0-terminated word. -// Delimiters can be quoted with quotechar. -static char *skip_quoted(char **buf, const char *delimiters, - const char *whitespace, char quotechar) { - char *p, *begin_word, *end_word, *end_whitespace; - - begin_word = *buf; - end_word = begin_word + strcspn(begin_word, delimiters); - - // Check for quotechar - if (end_word > begin_word) { - p = end_word - 1; - while (*p == quotechar) { - // If there is anything beyond end_word, copy it - if (*end_word == '\0') { - *p = '\0'; - break; - } else { - size_t end_off = strcspn(end_word + 1, delimiters); - memmove (p, end_word, end_off + 1); - p += end_off; // p must correspond to end_word - 1 - end_word += end_off + 1; - } - } - for (p++; p < end_word; p++) { - *p = '\0'; - } - } - - if (*end_word == '\0') { - *buf = end_word; - } else { - end_whitespace = end_word + 1 + strspn(end_word + 1, whitespace); - - for (p = end_word; p < end_whitespace; p++) { - *p = '\0'; - } - - *buf = end_whitespace; - } - - return begin_word; -} - -// Simplified version of skip_quoted without quote char -// and whitespace == delimiters -static char *skip(char **buf, const char *delimiters) { - return skip_quoted(buf, delimiters, delimiters, 0); -} - - -// Return HTTP header value, or NULL if not found. -static const char *get_header(const struct mg_request_info *ri, - const char *name) { - int i; - - for (i = 0; i < ri->num_headers; i++) - if (!mg_strcasecmp(name, ri->http_headers[i].name)) - return ri->http_headers[i].value; - - return NULL; -} - -const char *mg_get_header(const struct mg_connection *conn, const char *name) { - return get_header(&conn->request_info, name); -} - -// A helper function for traversing a comma separated list of values. -// It returns a list pointer shifted to the next value, or NULL if the end -// of the list found. -// Value is stored in val vector. If value has form "x=y", then eq_val -// vector is initialized to point to the "y" part, and val vector length -// is adjusted to point only to "x". -static const char *next_option(const char *list, struct vec *val, - struct vec *eq_val) { - if (list == NULL || *list == '\0') { - // End of the list - list = NULL; - } else { - val->ptr = list; - if ((list = strchr(val->ptr, ',')) != NULL) { - // Comma found. Store length and shift the list ptr - val->len = list - val->ptr; - list++; - } else { - // This value is the last one - list = val->ptr + strlen(val->ptr); - val->len = list - val->ptr; - } - - if (eq_val != NULL) { - // Value has form "x=y", adjust pointers and lengths - // so that val points to "x", and eq_val points to "y". - eq_val->len = 0; - eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len); - if (eq_val->ptr != NULL) { - eq_val->ptr++; // Skip over '=' character - eq_val->len = val->ptr + val->len - eq_val->ptr; - val->len = (eq_val->ptr - val->ptr) - 1; - } - } - } - - return list; -} - -static int match_prefix(const char *pattern, int pattern_len, const char *str) { - const char *or_str; - int i, j, len, res; - - if ((or_str = (const char *) memchr(pattern, '|', pattern_len)) != NULL) { - res = match_prefix(pattern, or_str - pattern, str); - return res > 0 ? res : - match_prefix(or_str + 1, (pattern + pattern_len) - (or_str + 1), str); - } - - i = j = 0; - res = -1; - for (; i < pattern_len; i++, j++) { - if (pattern[i] == '?' && str[j] != '\0') { - continue; - } else if (pattern[i] == '$') { - return str[j] == '\0' ? j : -1; - } else if (pattern[i] == '*') { - i++; - if (pattern[i] == '*') { - i++; - len = (int) strlen(str + j); - } else { - len = (int) strcspn(str + j, "/"); - } - if (i == pattern_len) { - return j + len; - } - do { - res = match_prefix(pattern + i, pattern_len - i, str + j + len); - } while (res == -1 && len-- > 0); - return res == -1 ? -1 : j + res + len; - } else if (pattern[i] != str[j]) { - return -1; - } - } - return j; -} - -// HTTP 1.1 assumes keep alive if "Connection:" header is not set -// This function must tolerate situations when connection info is not -// set up, for example if request parsing failed. -static int should_keep_alive(const struct mg_connection *conn) { - const char *http_version = conn->request_info.http_version; - const char *header = mg_get_header(conn, "Connection"); - if (conn->must_close || - conn->status_code == 401 || - mg_strcasecmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes") != 0 || - (header != NULL && mg_strcasecmp(header, "keep-alive") != 0) || - (header == NULL && http_version && strcmp(http_version, "1.1"))) { - return 0; - } - return 1; -} - -static const char *suggest_connection_header(const struct mg_connection *conn) { - return should_keep_alive(conn) ? "keep-alive" : "close"; -} - -static void send_http_error(struct mg_connection *, int, const char *, - PRINTF_FORMAT_STRING(const char *fmt), ...) - PRINTF_ARGS(4, 5); - - -static void send_http_error(struct mg_connection *conn, int status, - const char *reason, const char *fmt, ...) { - char buf[MG_BUF_LEN]; - va_list ap; - int len; - - conn->status_code = status; - conn->request_info.ev_data = (void *) (long) status; - if (call_user(conn, MG_HTTP_ERROR) == NULL) { - buf[0] = '\0'; - len = 0; - - // Errors 1xx, 204 and 304 MUST NOT send a body - if (status > 199 && status != 204 && status != 304) { - len = mg_snprintf(conn, buf, sizeof(buf), "Error %d: %s", status, reason); - buf[len++] = '\n'; - - va_start(ap, fmt); - len += mg_vsnprintf(conn, buf + len, sizeof(buf) - len, fmt, ap); - va_end(ap); - } - DEBUG_TRACE(("[%s]", buf)); - - mg_printf(conn, "HTTP/1.1 %d %s\r\n" - "Content-Length: %d\r\n" - "Connection: %s\r\n\r\n", status, reason, len, - suggest_connection_header(conn)); - conn->num_bytes_sent += mg_printf(conn, "%s", buf); - } -} - -#if defined(_WIN32) && !defined(__SYMBIAN32__) -static int pthread_mutex_init(pthread_mutex_t *mutex, void *unused) { - unused = NULL; - *mutex = CreateMutex(NULL, FALSE, NULL); - return *mutex == NULL ? -1 : 0; -} - -static int pthread_mutex_destroy(pthread_mutex_t *mutex) { - return CloseHandle(*mutex) == 0 ? -1 : 0; -} - -static int pthread_mutex_lock(pthread_mutex_t *mutex) { - return WaitForSingleObject(*mutex, INFINITE) == WAIT_OBJECT_0? 0 : -1; -} - -static int pthread_mutex_unlock(pthread_mutex_t *mutex) { - return ReleaseMutex(*mutex) == 0 ? -1 : 0; -} - -static int pthread_cond_init(pthread_cond_t *cv, const void *unused) { - unused = NULL; - cv->signal = CreateEvent(NULL, FALSE, FALSE, NULL); - cv->broadcast = CreateEvent(NULL, TRUE, FALSE, NULL); - return cv->signal != NULL && cv->broadcast != NULL ? 0 : -1; -} - -static int pthread_cond_wait(pthread_cond_t *cv, pthread_mutex_t *mutex) { - HANDLE handles[] = {cv->signal, cv->broadcast}; - ReleaseMutex(*mutex); - WaitForMultipleObjects(2, handles, FALSE, INFINITE); - return WaitForSingleObject(*mutex, INFINITE) == WAIT_OBJECT_0? 0 : -1; -} - -static int pthread_cond_signal(pthread_cond_t *cv) { - return SetEvent(cv->signal) == 0 ? -1 : 0; -} - -static int pthread_cond_broadcast(pthread_cond_t *cv) { - // Implementation with PulseEvent() has race condition, see - // http://www.cs.wustl.edu/~schmidt/win32-cv-1.html - return PulseEvent(cv->broadcast) == 0 ? -1 : 0; -} - -static int pthread_cond_destroy(pthread_cond_t *cv) { - return CloseHandle(cv->signal) && CloseHandle(cv->broadcast) ? 0 : -1; -} - -// For Windows, change all slashes to backslashes in path names. -static void change_slashes_to_backslashes(char *path) { - int i; - - for (i = 0; path[i] != '\0'; i++) { - if (path[i] == '/') - path[i] = '\\'; - // i > 0 check is to preserve UNC paths, like \\server\file.txt - if (path[i] == '\\' && i > 0) - while (path[i + 1] == '\\' || path[i + 1] == '/') - (void) memmove(path + i + 1, - path + i + 2, strlen(path + i + 1)); - } -} - -// Encode 'path' which is assumed UTF-8 string, into UNICODE string. -// wbuf and wbuf_len is a target buffer and its length. -static void to_unicode(const char *path, wchar_t *wbuf, size_t wbuf_len) { - char buf[PATH_MAX], buf2[PATH_MAX], *p; - - mg_strlcpy(buf, path, sizeof(buf)); - change_slashes_to_backslashes(buf); - - // Point p to the end of the file name - p = buf + strlen(buf) - 1; - - // Trim trailing backslash character - while (p > buf && *p == '\\' && p[-1] != ':') { - *p-- = '\0'; - } - - // Protect from CGI code disclosure. - // This is very nasty hole. Windows happily opens files with - // some garbage in the end of file name. So fopen("a.cgi ", "r") - // actually opens "a.cgi", and does not return an error! - if (*p == 0x20 || // No space at the end - (*p == 0x2e && p > buf) || // No '.' but allow '.' as full path - *p == 0x2b || // No '+' - (*p & ~0x7f)) { // And generally no non-ASCII chars - (void) fprintf(stderr, "Rejecting suspicious path: [%s]", buf); - wbuf[0] = L'\0'; - } else { - // Convert to Unicode and back. If doubly-converted string does not - // match the original, something is fishy, reject. - memset(wbuf, 0, wbuf_len * sizeof(wchar_t)); - MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len); - WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2), - NULL, NULL); - if (strcmp(buf, buf2) != 0) { - wbuf[0] = L'\0'; - } - } -} - -#if defined(_WIN32_WCE) -static time_t time(time_t *ptime) { - time_t t; - SYSTEMTIME st; - FILETIME ft; - - GetSystemTime(&st); - SystemTimeToFileTime(&st, &ft); - t = SYS2UNIX_TIME(ft.dwLowDateTime, ft.dwHighDateTime); - - if (ptime != NULL) { - *ptime = t; - } - - return t; -} - -static struct tm *localtime(const time_t *ptime, struct tm *ptm) { - int64_t t = ((int64_t) *ptime) * RATE_DIFF + EPOCH_DIFF; - FILETIME ft, lft; - SYSTEMTIME st; - TIME_ZONE_INFORMATION tzinfo; - - if (ptm == NULL) { - return NULL; - } - - * (int64_t *) &ft = t; - FileTimeToLocalFileTime(&ft, &lft); - FileTimeToSystemTime(&lft, &st); - ptm->tm_year = st.wYear - 1900; - ptm->tm_mon = st.wMonth - 1; - ptm->tm_wday = st.wDayOfWeek; - ptm->tm_mday = st.wDay; - ptm->tm_hour = st.wHour; - ptm->tm_min = st.wMinute; - ptm->tm_sec = st.wSecond; - ptm->tm_yday = 0; // hope nobody uses this - ptm->tm_isdst = - GetTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_DAYLIGHT ? 1 : 0; - - return ptm; -} - -static struct tm *gmtime(const time_t *ptime, struct tm *ptm) { - // FIXME(lsm): fix this. - return localtime(ptime, ptm); -} - -static size_t strftime(char *dst, size_t dst_size, const char *fmt, - const struct tm *tm) { - (void) snprintf(dst, dst_size, "implement strftime() for WinCE"); - return 0; -} -#endif - -static int mg_rename(const char* oldname, const char* newname) { - wchar_t woldbuf[PATH_MAX]; - wchar_t wnewbuf[PATH_MAX]; - - to_unicode(oldname, woldbuf, ARRAY_SIZE(woldbuf)); - to_unicode(newname, wnewbuf, ARRAY_SIZE(wnewbuf)); - - return MoveFileW(woldbuf, wnewbuf) ? 0 : -1; -} - -static int mg_stat(struct mg_connection *conn, const char *path, - struct file *filep) { - wchar_t wbuf[PATH_MAX]; - WIN32_FILE_ATTRIBUTE_DATA info; - - if (!is_file_in_memory(conn, path, filep)) { - to_unicode(path, wbuf, ARRAY_SIZE(wbuf)); - if (GetFileAttributesExW(wbuf, GetFileExInfoStandard, &info) != 0) { - filep->size = MAKEUQUAD(info.nFileSizeLow, info.nFileSizeHigh); - filep->modification_time = SYS2UNIX_TIME( - info.ftLastWriteTime.dwLowDateTime, - info.ftLastWriteTime.dwHighDateTime); - filep->is_directory = info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; - } - } - - return filep->membuf != NULL || filep->modification_time != 0; -} - -static int mg_remove(const char *path) { - wchar_t wbuf[PATH_MAX]; - to_unicode(path, wbuf, ARRAY_SIZE(wbuf)); - return DeleteFileW(wbuf) ? 0 : -1; -} - -static int mg_mkdir(const char *path, int mode) { - char buf[PATH_MAX]; - wchar_t wbuf[PATH_MAX]; - - mode = 0; // Unused - mg_strlcpy(buf, path, sizeof(buf)); - change_slashes_to_backslashes(buf); - - (void) MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, sizeof(wbuf)); - - return CreateDirectoryW(wbuf, NULL) ? 0 : -1; -} - -// Implementation of POSIX opendir/closedir/readdir for Windows. -static DIR * opendir(const char *name) { - DIR *dir = NULL; - wchar_t wpath[PATH_MAX]; - DWORD attrs; - - if (name == NULL) { - SetLastError(ERROR_BAD_ARGUMENTS); - } else if ((dir = (DIR *) malloc(sizeof(*dir))) == NULL) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - } else { - to_unicode(name, wpath, ARRAY_SIZE(wpath)); - attrs = GetFileAttributesW(wpath); - if (attrs != 0xFFFFFFFF && - ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)) { - (void) wcscat(wpath, L"\\*"); - dir->handle = FindFirstFileW(wpath, &dir->info); - dir->result.d_name[0] = '\0'; - } else { - free(dir); - dir = NULL; - } - } - - return dir; -} - -static int closedir(DIR *dir) { - int result = 0; - - if (dir != NULL) { - if (dir->handle != INVALID_HANDLE_VALUE) - result = FindClose(dir->handle) ? 0 : -1; - - free(dir); - } else { - result = -1; - SetLastError(ERROR_BAD_ARGUMENTS); - } - - return result; -} - -static struct dirent *readdir(DIR *dir) { - struct dirent *result = 0; - - if (dir) { - if (dir->handle != INVALID_HANDLE_VALUE) { - result = &dir->result; - (void) WideCharToMultiByte(CP_UTF8, 0, - dir->info.cFileName, -1, result->d_name, - sizeof(result->d_name), NULL, NULL); - - if (!FindNextFileW(dir->handle, &dir->info)) { - (void) FindClose(dir->handle); - dir->handle = INVALID_HANDLE_VALUE; - } - - } else { - SetLastError(ERROR_FILE_NOT_FOUND); - } - } else { - SetLastError(ERROR_BAD_ARGUMENTS); - } - - return result; -} - -#define set_close_on_exec(x) // No FD_CLOEXEC on Windows - -int mg_start_thread(mg_thread_func_t f, void *p) { - return _beginthread((void (__cdecl *)(void *)) f, 0, p) == -1L ? -1 : 0; -} - -static HANDLE dlopen(const char *dll_name, int flags) { - wchar_t wbuf[PATH_MAX]; - flags = 0; // Unused - to_unicode(dll_name, wbuf, ARRAY_SIZE(wbuf)); - return LoadLibraryW(wbuf); -} - -#if !defined(NO_CGI) -#define SIGKILL 0 -static int kill(pid_t pid, int sig_num) { - (void) TerminateProcess(pid, sig_num); - (void) CloseHandle(pid); - return 0; -} - -static void trim_trailing_whitespaces(char *s) { - char *e = s + strlen(s) - 1; - while (e > s && isspace(* (unsigned char *) e)) { - *e-- = '\0'; - } -} - -static pid_t spawn_process(struct mg_connection *conn, const char *prog, - char *envblk, char *envp[], int fd_stdin, - int fd_stdout, const char *dir) { - HANDLE me; - char *p, *interp, full_interp[PATH_MAX], cmdline[PATH_MAX], buf[PATH_MAX]; - struct file file; - STARTUPINFOA si = { sizeof(si) }; - PROCESS_INFORMATION pi = { 0 }; - - envp = NULL; // Unused - - // TODO(lsm): redirect CGI errors to the error log file - si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; - si.wShowWindow = SW_HIDE; - - me = GetCurrentProcess(); - DuplicateHandle(me, (HANDLE) _get_osfhandle(fd_stdin), me, - &si.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); - DuplicateHandle(me, (HANDLE) _get_osfhandle(fd_stdout), me, - &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); - - // If CGI file is a script, try to read the interpreter line - interp = conn->ctx->config[CGI_INTERPRETER]; - if (interp == NULL) { - buf[0] = buf[1] = '\0'; - - // Read the first line of the script into the buffer - snprintf(cmdline, sizeof(cmdline), "%s%c%s", dir, '/', prog); - if (mg_fopen(conn, cmdline, "r", &file)) { - p = (char *) file.membuf; - mg_fgets(buf, sizeof(buf), &file, &p); - mg_fclose(&file); - buf[sizeof(buf) - 1] = '\0'; - } - - if (buf[0] == '#' && buf[1] == '!') { - trim_trailing_whitespaces(buf + 2); - } else { - buf[2] = '\0'; - } - interp = buf + 2; - } - - if (interp[0] != '\0') { - GetFullPathName(interp, sizeof(full_interp), full_interp, NULL); - interp = full_interp; - } - - mg_snprintf(conn, cmdline, sizeof(cmdline), "%s%s%s", - interp, interp[0] == '\0' ? "" : " ", prog); - - DEBUG_TRACE(("Running [%s]", cmdline)); - if (CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, - CREATE_NEW_PROCESS_GROUP, envblk, dir, &si, &pi) == 0) { - cry(conn, "%s: CreateProcess(%s): %d", - __func__, cmdline, ERRNO); - pi.hProcess = (pid_t) -1; - } - - // Always close these to prevent handle leakage. - (void) close(fd_stdin); - (void) close(fd_stdout); - - (void) CloseHandle(si.hStdOutput); - (void) CloseHandle(si.hStdInput); - (void) CloseHandle(pi.hThread); - - return (pid_t) pi.hProcess; -} -#endif // !NO_CGI - -static int set_non_blocking_mode(SOCKET sock) { - unsigned long on = 1; - return ioctlsocket(sock, FIONBIO, &on); -} - -#else -static int mg_stat(struct mg_connection *conn, const char *path, - struct file *filep) { - struct stat st; - - if (!is_file_in_memory(conn, path, filep) && !stat(path, &st)) { - filep->size = st.st_size; - filep->modification_time = st.st_mtime; - filep->is_directory = S_ISDIR(st.st_mode); - } else { - filep->modification_time = (time_t) 0; - } - - return filep->membuf != NULL || filep->modification_time != (time_t) 0; -} - -static void set_close_on_exec(int fd) { - fcntl(fd, F_SETFD, FD_CLOEXEC); -} - -int mg_start_thread(mg_thread_func_t func, void *param) { - pthread_t thread_id; - pthread_attr_t attr; - - (void) pthread_attr_init(&attr); - (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - // TODO(lsm): figure out why mongoose dies on Linux if next line is enabled - // (void) pthread_attr_setstacksize(&attr, sizeof(struct mg_connection) * 5); - - return pthread_create(&thread_id, &attr, func, param); -} - -#ifndef NO_CGI -static pid_t spawn_process(struct mg_connection *conn, const char *prog, - char *envblk, char *envp[], int fd_stdin, - int fd_stdout, const char *dir) { - pid_t pid; - const char *interp; - - envblk = NULL; // Unused - - if ((pid = fork()) == -1) { - // Parent - send_http_error(conn, 500, http_500_error, "fork(): %s", strerror(ERRNO)); - } else if (pid == 0) { - // Child - if (chdir(dir) != 0) { - cry(conn, "%s: chdir(%s): %s", __func__, dir, strerror(ERRNO)); - } else if (dup2(fd_stdin, 0) == -1) { - cry(conn, "%s: dup2(%d, 0): %s", __func__, fd_stdin, strerror(ERRNO)); - } else if (dup2(fd_stdout, 1) == -1) { - cry(conn, "%s: dup2(%d, 1): %s", __func__, fd_stdout, strerror(ERRNO)); - } else { - (void) dup2(fd_stdout, 2); - (void) close(fd_stdin); - (void) close(fd_stdout); - - interp = conn->ctx->config[CGI_INTERPRETER]; - if (interp == NULL) { - (void) execle(prog, prog, NULL, envp); - cry(conn, "%s: execle(%s): %s", __func__, prog, strerror(ERRNO)); - } else { - (void) execle(interp, interp, prog, NULL, envp); - cry(conn, "%s: execle(%s %s): %s", __func__, interp, prog, - strerror(ERRNO)); - } - } - exit(EXIT_FAILURE); - } - - // Parent. Close stdio descriptors - (void) close(fd_stdin); - (void) close(fd_stdout); - - return pid; -} -#endif // !NO_CGI - -static int set_non_blocking_mode(SOCKET sock) { - int flags; - - flags = fcntl(sock, F_GETFL, 0); - (void) fcntl(sock, F_SETFL, flags | O_NONBLOCK); - - return 0; -} -#endif // _WIN32 - -// Write data to the IO channel - opened file descriptor, socket or SSL -// descriptor. Return number of bytes written. -static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf, - int64_t len) { - int64_t sent; - int n, k; - - sent = 0; - while (sent < len) { - - // How many bytes we send in this iteration - k = len - sent > INT_MAX ? INT_MAX : (int) (len - sent); - - if (ssl != NULL) { - n = SSL_write(ssl, buf + sent, k); - } else if (fp != NULL) { - n = (int) fwrite(buf + sent, 1, (size_t) k, fp); - if (ferror(fp)) - n = -1; - } else { - n = send(sock, buf + sent, (size_t) k, MSG_NOSIGNAL); - } - - if (n < 0) - break; - - sent += n; - } - - return sent; -} - -// This function is needed to prevent Mongoose to be stuck in a blocking -// socket read when user requested exit. To do that, we sleep in select -// with a timeout, and when returned, check the context for the stop flag. -// If it is set, we return 0, and this means that we must not continue -// reading, must give up and close the connection and exit serving thread. -static int wait_until_socket_is_readable(struct mg_connection *conn) { - int result; - struct timeval tv; - fd_set set; - - do { - tv.tv_sec = 0; - tv.tv_usec = 300 * 1000; - FD_ZERO(&set); - FD_SET(conn->client.sock, &set); - result = select(conn->client.sock + 1, &set, NULL, NULL, &tv); - } while ((result == 0 || (result < 0 && ERRNO == EINTR)) && - conn->ctx->stop_flag == 0); - - return conn->ctx->stop_flag || result < 0 ? 0 : 1; -} - -// Read from IO channel - opened file descriptor, socket, or SSL descriptor. -// Return negative value on error, or number of bytes read on success. -static int pull(FILE *fp, struct mg_connection *conn, char *buf, int len) { - int nread; - - if (fp != NULL) { - // Use read() instead of fread(), because if we're reading from the CGI - // pipe, fread() may block until IO buffer is filled up. We cannot afford - // to block and must pass all read bytes immediately to the client. - nread = read(fileno(fp), buf, (size_t) len); - } else if (!conn->must_close && !wait_until_socket_is_readable(conn)) { - nread = -1; - } else if (conn->ssl != NULL) { - nread = SSL_read(conn->ssl, buf, len); - } else { - nread = recv(conn->client.sock, buf, (size_t) len, 0); - } - - return conn->ctx->stop_flag ? -1 : nread; -} - -int mg_read(struct mg_connection *conn, void *buf, size_t len) { - int n, buffered_len, nread; - const char *body; - - nread = 0; - if (conn->consumed_content < conn->content_len) { - // Adjust number of bytes to read. - int64_t to_read = conn->content_len - conn->consumed_content; - if (to_read < (int64_t) len) { - len = (size_t) to_read; - } - - // Return buffered data - body = conn->buf + conn->request_len + conn->consumed_content; - buffered_len = &conn->buf[conn->data_len] - body; - if (buffered_len > 0) { - if (len < (size_t) buffered_len) { - buffered_len = (int) len; - } - memcpy(buf, body, (size_t) buffered_len); - len -= buffered_len; - conn->consumed_content += buffered_len; - nread += buffered_len; - buf = (char *) buf + buffered_len; - } - - // We have returned all buffered data. Read new data from the remote socket. - while (len > 0) { - n = pull(NULL, conn, (char *) buf, (int) len); - if (n < 0) { - nread = n; // Propagate the error - break; - } else if (n == 0) { - break; // No more data to read - } else { - buf = (char *) buf + n; - conn->consumed_content += n; - nread += n; - len -= n; - } - } - } - return nread; -} - -int mg_write(struct mg_connection *conn, const void *buf, size_t len) { - time_t now; - int64_t n, total, allowed; - - if (conn->throttle > 0) { - if ((now = time(NULL)) != conn->last_throttle_time) { - conn->last_throttle_time = now; - conn->last_throttle_bytes = 0; - } - allowed = conn->throttle - conn->last_throttle_bytes; - if (allowed > (int64_t) len) { - allowed = len; - } - if ((total = push(NULL, conn->client.sock, conn->ssl, (const char *) buf, - (int64_t) allowed)) == allowed) { - buf = (char *) buf + total; - conn->last_throttle_bytes += total; - while (total < (int64_t) len && conn->ctx->stop_flag == 0) { - allowed = conn->throttle > (int64_t) len - total ? - (int64_t) len - total : conn->throttle; - if ((n = push(NULL, conn->client.sock, conn->ssl, (const char *) buf, - (int64_t) allowed)) != allowed) { - break; - } - sleep(1); - conn->last_throttle_bytes = allowed; - conn->last_throttle_time = time(NULL); - buf = (char *) buf + n; - total += n; - } - } - } else { - total = push(NULL, conn->client.sock, conn->ssl, (const char *) buf, - (int64_t) len); - } - return (int) total; -} - -int mg_printf(struct mg_connection *conn, const char *fmt, ...) { - char mem[MG_BUF_LEN], *buf = mem; - int len; - va_list ap; - - // Print in a local buffer first, hoping that it is large enough to - // hold the whole message - va_start(ap, fmt); - len = vsnprintf(mem, sizeof(mem), fmt, ap); - va_end(ap); - - if (len == 0) { - // Do nothing. mg_printf(conn, "%s", "") was called. - } else if (len < 0) { - // vsnprintf() error, give up - len = -1; - cry(conn, "%s(%s, ...): vsnprintf() error", __func__, fmt); - } else if (len > (int) sizeof(mem) && (buf = (char *) malloc(len + 1)) != NULL) { - // Local buffer is not large enough, allocate big buffer on heap - va_start(ap, fmt); - vsnprintf(buf, len + 1, fmt, ap); - va_end(ap); - len = mg_write(conn, buf, (size_t) len); - free(buf); - } else if (len > (int) sizeof(mem)) { - // Failed to allocate large enough buffer, give up - cry(conn, "%s(%s, ...): Can't allocate %d bytes, not printing anything", - __func__, fmt, len); - len = -1; - } else { - // Copy to the local buffer succeeded - len = mg_write(conn, buf, (size_t) len); - } - - return len; -} - -// URL-decode input buffer into destination buffer. -// 0-terminate the destination buffer. Return the length of decoded data. -// form-url-encoded data differs from URI encoding in a way that it -// uses '+' as character for space, see RFC 1866 section 8.2.1 -// http://ftp.ics.uci.edu/pub/ietf/html/rfc1866.txt -static int url_decode(const char *src, int src_len, char *dst, - int dst_len, int is_form_url_encoded) { - int i, j, a, b; -#define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') - - for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) { - if (src[i] == '%' && - isxdigit(* (const unsigned char *) (src + i + 1)) && - isxdigit(* (const unsigned char *) (src + i + 2))) { - a = tolower(* (const unsigned char *) (src + i + 1)); - b = tolower(* (const unsigned char *) (src + i + 2)); - dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b)); - i += 2; - } else if (is_form_url_encoded && src[i] == '+') { - dst[j] = ' '; - } else { - dst[j] = src[i]; - } - } - - dst[j] = '\0'; // Null-terminate the destination - - return i >= src_len ? j : -1; -} - -// Scan given buffer and fetch the value of the given variable. -// It can be specified in query string, or in the POST data. -// Return -1 if the variable not found, or length of the URL-decoded value -// stored in dst. The dst buffer is guaranteed to be NUL-terminated if it -// is not NULL or zero-length. If dst is NULL or zero-length, then -// -2 is returned. -int mg_get_var(const char *buf, size_t buf_len, const char *name, - char *dst, size_t dst_len) { - const char *p, *e, *s; - size_t name_len; - int len; - - if (dst == NULL || dst_len == 0) { - len = -2; - } else if (buf == NULL || name == NULL || buf_len == 0) { - len = -1; - dst[0] = '\0'; - } else { - name_len = strlen(name); - e = buf + buf_len; - len = -1; - dst[0] = '\0'; - - // buf is "var1=val1&var2=val2...". Find variable first - for (p = buf; p + name_len < e; p++) { - if ((p == buf || p[-1] == '&') && p[name_len] == '=' && - !mg_strncasecmp(name, p, name_len)) { - - // Point p to variable value - p += name_len + 1; - - // Point s to the end of the value - s = (const char *) memchr(p, '&', (size_t)(e - p)); - if (s == NULL) { - s = e; - } - assert(s >= p); - - // Decode variable into destination buffer - len = url_decode(p, (size_t)(s - p), dst, dst_len, 1); - break; - } - } - } - - return len; -} - -int mg_get_cookie(const struct mg_connection *conn, const char *cookie_name, - char *dst, size_t dst_size) { - const char *s, *p, *end; - int name_len, len = -1; - - dst[0] = '\0'; - if ((s = mg_get_header(conn, "Cookie")) == NULL) { - return -1; - } - - name_len = (int) strlen(cookie_name); - end = s + strlen(s); - - for (; (s = strstr(s, cookie_name)) != NULL; s += name_len) - if (s[name_len] == '=') { - s += name_len + 1; - if ((p = strchr(s, ' ')) == NULL) - p = end; - if (p[-1] == ';') - p--; - if (*s == '"' && p[-1] == '"' && p > s + 1) { - s++; - p--; - } - if ((size_t) (p - s) < dst_size) { - len = p - s; - mg_strlcpy(dst, s, (size_t) len + 1); - } - break; - } - - return len; -} - -static void convert_uri_to_file_name(struct mg_connection *conn, char *buf, - size_t buf_len, struct file *filep) { - struct vec a, b; - const char *rewrite, *uri = conn->request_info.uri; - char *p; - int match_len; - - // Using buf_len - 1 because memmove() for PATH_INFO may shift part - // of the path one byte on the right. - mg_snprintf(conn, buf, buf_len - 1, "%s%s", conn->ctx->config[DOCUMENT_ROOT], - uri); - - rewrite = conn->ctx->config[REWRITE]; - while ((rewrite = next_option(rewrite, &a, &b)) != NULL) { - if ((match_len = match_prefix(a.ptr, a.len, uri)) > 0) { - mg_snprintf(conn, buf, buf_len - 1, "%.*s%s", (int) b.len, b.ptr, - uri + match_len); - break; - } - } - - if (!mg_stat(conn, buf, filep)) { - // Support PATH_INFO for CGI scripts. - for (p = buf + strlen(buf); p > buf + 1; p--) { - if (*p == '/') { - *p = '\0'; - if (match_prefix(conn->ctx->config[CGI_EXTENSIONS], - strlen(conn->ctx->config[CGI_EXTENSIONS]), buf) > 0 && - mg_stat(conn, buf, filep)) { - // Shift PATH_INFO block one character right, e.g. - // "/x.cgi/foo/bar\x00" => "/x.cgi\x00/foo/bar\x00" - // conn->path_info is pointing to the local variable "path" declared - // in handle_request(), so PATH_INFO is not valid after - // handle_request returns. - conn->path_info = p + 1; - memmove(p + 2, p + 1, strlen(p + 1) + 1); // +1 is for trailing \0 - p[1] = '/'; - break; - } else { - *p = '/'; - } - } - } - } -} - -static int sslize(struct mg_connection *conn, SSL_CTX *s, int (*func)(SSL *)) { - return (conn->ssl = SSL_new(s)) != NULL && - SSL_set_fd(conn->ssl, conn->client.sock) == 1 && - func(conn->ssl) == 1; -} - -// Check whether full request is buffered. Return: -// -1 if request is malformed -// 0 if request is not yet fully buffered -// >0 actual request length, including last \r\n\r\n -static int get_request_len(const char *buf, int buflen) { - const char *s, *e; - int len = 0; - - for (s = buf, e = s + buflen - 1; len <= 0 && s < e; s++) - // Control characters are not allowed but >=128 is. - if (!isprint(* (const unsigned char *) s) && *s != '\r' && - *s != '\n' && * (const unsigned char *) s < 128) { - len = -1; - break; // [i_a] abort scan as soon as one malformed character is found; don't let subsequent \r\n\r\n win us over anyhow - } else if (s[0] == '\n' && s[1] == '\n') { - len = (int) (s - buf) + 2; - } else if (s[0] == '\n' && &s[1] < e && - s[1] == '\r' && s[2] == '\n') { - len = (int) (s - buf) + 3; - } - - return len; -} - -// Convert month to the month number. Return -1 on error, or month number -static int get_month_index(const char *s) { - size_t i; - - for (i = 0; i < ARRAY_SIZE(month_names); i++) - if (!strcmp(s, month_names[i])) - return (int) i; - - return -1; -} - -static int num_leap_years(int year) { - return year / 4 - year / 100 + year / 400; -} - -// Parse UTC date-time string, and return the corresponding time_t value. -static time_t parse_date_string(const char *datetime) { - static const unsigned short days_before_month[] = { - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 - }; - char month_str[32]; - int second, minute, hour, day, month, year, leap_days, days; - time_t result = (time_t) 0; - - if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d", - &day, month_str, &year, &hour, &minute, &second) == 6) || - (sscanf(datetime, "%d %3s %d %d:%d:%d", - &day, month_str, &year, &hour, &minute, &second) == 6) || - (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d", - &day, month_str, &year, &hour, &minute, &second) == 6) || - (sscanf(datetime, "%d-%3s-%d %d:%d:%d", - &day, month_str, &year, &hour, &minute, &second) == 6)) && - year > 1970 && - (month = get_month_index(month_str)) != -1) { - leap_days = num_leap_years(year) - num_leap_years(1970); - year -= 1970; - days = year * 365 + days_before_month[month] + (day - 1) + leap_days; - result = days * 24 * 3600 + hour * 3600 + minute * 60 + second; - } - - return result; -} - -// Protect against directory disclosure attack by removing '..', -// excessive '/' and '\' characters -static void remove_double_dots_and_double_slashes(char *s) { - char *p = s; - - while (*s != '\0') { - *p++ = *s++; - if (s[-1] == '/' || s[-1] == '\\') { - // Skip all following slashes, backslashes and double-dots - while (s[0] != '\0') { - if (s[0] == '/' || s[0] == '\\') { - s++; - } else if (s[0] == '.' && s[1] == '.') { - s += 2; - } else { - break; - } - } - } - } - *p = '\0'; -} - -static const struct { - const char *extension; - size_t ext_len; - const char *mime_type; -} builtin_mime_types[] = { - {".html", 5, "text/html"}, - {".htm", 4, "text/html"}, - {".shtm", 5, "text/html"}, - {".shtml", 6, "text/html"}, - {".css", 4, "text/css"}, - {".js", 3, "application/x-javascript"}, - {".ico", 4, "image/x-icon"}, - {".gif", 4, "image/gif"}, - {".jpg", 4, "image/jpeg"}, - {".jpeg", 5, "image/jpeg"}, - {".png", 4, "image/png"}, - {".svg", 4, "image/svg+xml"}, - {".txt", 4, "text/plain"}, - {".torrent", 8, "application/x-bittorrent"}, - {".wav", 4, "audio/x-wav"}, - {".mp3", 4, "audio/x-mp3"}, - {".mid", 4, "audio/mid"}, - {".m3u", 4, "audio/x-mpegurl"}, - {".ram", 4, "audio/x-pn-realaudio"}, - {".xml", 4, "text/xml"}, - {".json", 5, "text/json"}, - {".xslt", 5, "application/xml"}, - {".xsl", 4, "application/xml"}, - {".ra", 3, "audio/x-pn-realaudio"}, - {".doc", 4, "application/msword"}, - {".exe", 4, "application/octet-stream"}, - {".zip", 4, "application/x-zip-compressed"}, - {".xls", 4, "application/excel"}, - {".tgz", 4, "application/x-tar-gz"}, - {".tar", 4, "application/x-tar"}, - {".gz", 3, "application/x-gunzip"}, - {".arj", 4, "application/x-arj-compressed"}, - {".rar", 4, "application/x-arj-compressed"}, - {".rtf", 4, "application/rtf"}, - {".pdf", 4, "application/pdf"}, - {".swf", 4, "application/x-shockwave-flash"}, - {".mpg", 4, "video/mpeg"}, - {".webm", 5, "video/webm"}, - {".mpeg", 5, "video/mpeg"}, - {".mp4", 4, "video/mp4"}, - {".m4v", 4, "video/x-m4v"}, - {".asf", 4, "video/x-ms-asf"}, - {".avi", 4, "video/x-msvideo"}, - {".bmp", 4, "image/bmp"}, - {NULL, 0, NULL} -}; - -const char *mg_get_builtin_mime_type(const char *path) { - const char *ext; - size_t i, path_len; - - path_len = strlen(path); - - for (i = 0; builtin_mime_types[i].extension != NULL; i++) { - ext = path + (path_len - builtin_mime_types[i].ext_len); - if (path_len > builtin_mime_types[i].ext_len && - mg_strcasecmp(ext, builtin_mime_types[i].extension) == 0) { - return builtin_mime_types[i].mime_type; - } - } - - return "text/plain"; -} - -// Look at the "path" extension and figure what mime type it has. -// Store mime type in the vector. -static void get_mime_type(struct mg_context *ctx, const char *path, - struct vec *vec) { - struct vec ext_vec, mime_vec; - const char *list, *ext; - size_t path_len; - - path_len = strlen(path); - - // Scan user-defined mime types first, in case user wants to - // override default mime types. - list = ctx->config[EXTRA_MIME_TYPES]; - while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) { - // ext now points to the path suffix - ext = path + path_len - ext_vec.len; - if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) { - *vec = mime_vec; - return; - } - } - - vec->ptr = mg_get_builtin_mime_type(path); - vec->len = strlen(vec->ptr); -} - -#ifndef HAVE_MD5 -typedef struct MD5Context { - uint32_t buf[4]; - uint32_t bits[2]; - unsigned char in[64]; -} MD5_CTX; - -#if defined(__BYTE_ORDER) && (__BYTE_ORDER == 1234) -#define byteReverse(buf, len) // Do nothing -#else -static void byteReverse(unsigned char *buf, unsigned longs) { - uint32_t t; - do { - t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | - ((unsigned) buf[1] << 8 | buf[0]); - *(uint32_t *) buf = t; - buf += 4; - } while (--longs); -} -#endif - -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -#define MD5STEP(f, w, x, y, z, data, s) \ - ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) - -// Start MD5 accumulation. Set bit count to 0 and buffer to mysterious -// initialization constants. -static void MD5Init(MD5_CTX *ctx) { - ctx->buf[0] = 0x67452301; - ctx->buf[1] = 0xefcdab89; - ctx->buf[2] = 0x98badcfe; - ctx->buf[3] = 0x10325476; - - ctx->bits[0] = 0; - ctx->bits[1] = 0; -} - -static void MD5Transform(uint32_t buf[4], uint32_t const in[16]) { - register uint32_t a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -static void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len) { - uint32_t t; - - t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) - ctx->bits[1]++; - ctx->bits[1] += len >> 29; - - t = (t >> 3) & 0x3f; - - if (t) { - unsigned char *p = (unsigned char *) ctx->in + t; - - t = 64 - t; - if (len < t) { - memcpy(p, buf, len); - return; - } - memcpy(p, buf, t); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32_t *) ctx->in); - buf += t; - len -= t; - } - - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32_t *) ctx->in); - buf += 64; - len -= 64; - } - - memcpy(ctx->in, buf, len); -} - -static void MD5Final(unsigned char digest[16], MD5_CTX *ctx) { - unsigned count; - unsigned char *p; - - count = (ctx->bits[0] >> 3) & 0x3F; - - p = ctx->in + count; - *p++ = 0x80; - count = 64 - 1 - count; - if (count < 8) { - memset(p, 0, count); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (uint32_t *) ctx->in); - memset(ctx->in, 0, 56); - } else { - memset(p, 0, count - 8); - } - byteReverse(ctx->in, 14); - - ((uint32_t *) ctx->in)[14] = ctx->bits[0]; - ((uint32_t *) ctx->in)[15] = ctx->bits[1]; - - MD5Transform(ctx->buf, (uint32_t *) ctx->in); - byteReverse((unsigned char *) ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - memset((char *) ctx, 0, sizeof(*ctx)); -} -#endif // !HAVE_MD5 - -// Stringify binary data. Output buffer must be twice as big as input, -// because each byte takes 2 bytes in string representation -static void bin2str(char *to, const unsigned char *p, size_t len) { - static const char *hex = "0123456789abcdef"; - - for (; len--; p++) { - *to++ = hex[p[0] >> 4]; - *to++ = hex[p[0] & 0x0f]; - } - *to = '\0'; -} - -// Return stringified MD5 hash for list of strings. Buffer must be 33 bytes. -void mg_md5(char buf[33], ...) { - unsigned char hash[16]; - const char *p; - va_list ap; - MD5_CTX ctx; - - MD5Init(&ctx); - - va_start(ap, buf); - while ((p = va_arg(ap, const char *)) != NULL) { - MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p)); - } - va_end(ap); - - MD5Final(hash, &ctx); - bin2str(buf, hash, sizeof(hash)); -} - -// Check the user's password, return 1 if OK -static int check_password(const char *method, const char *ha1, const char *uri, - const char *nonce, const char *nc, const char *cnonce, - const char *qop, const char *response) { - char ha2[32 + 1], expected_response[32 + 1]; - - // Some of the parameters may be NULL - if (method == NULL || nonce == NULL || nc == NULL || cnonce == NULL || - qop == NULL || response == NULL) { - return 0; - } - - // NOTE(lsm): due to a bug in MSIE, we do not compare the URI - // TODO(lsm): check for authentication timeout - if (// strcmp(dig->uri, c->ouri) != 0 || - strlen(response) != 32 - // || now - strtoul(dig->nonce, NULL, 10) > 3600 - ) { - return 0; - } - - mg_md5(ha2, method, ":", uri, NULL); - mg_md5(expected_response, ha1, ":", nonce, ":", nc, - ":", cnonce, ":", qop, ":", ha2, NULL); - - return mg_strcasecmp(response, expected_response) == 0; -} - -// Use the global passwords file, if specified by auth_gpass option, -// or search for .htpasswd in the requested directory. -static void open_auth_file(struct mg_connection *conn, const char *path, - struct file *filep) { - char name[PATH_MAX]; - const char *p, *e, *gpass = conn->ctx->config[GLOBAL_PASSWORDS_FILE]; - - if (gpass != NULL) { - // Use global passwords file - if (!mg_fopen(conn, gpass, "r", filep)) { - cry(conn, "fopen(%s): %s", gpass, strerror(ERRNO)); - } - } else if (mg_stat(conn, path, filep) && filep->is_directory) { - mg_snprintf(conn, name, sizeof(name), "%s%c%s", - path, '/', PASSWORDS_FILE_NAME); - mg_fopen(conn, name, "r", filep); - } else { - // Try to find .htpasswd in requested directory. - for (p = path, e = p + strlen(p) - 1; e > p; e--) - if (e[0] == '/') - break; - mg_snprintf(conn, name, sizeof(name), "%.*s%c%s", - (int) (e - p), p, '/', PASSWORDS_FILE_NAME); - mg_fopen(conn, name, "r", filep); - } -} - -// Parsed Authorization header -struct ah { - char *user, *uri, *cnonce, *response, *qop, *nc, *nonce; -}; - -// Return 1 on success. Always initializes the ah structure. -static int parse_auth_header(struct mg_connection *conn, char *buf, - size_t buf_size, struct ah *ah) { - char *name, *value, *s; - const char *auth_header; - - (void) memset(ah, 0, sizeof(*ah)); - if ((auth_header = mg_get_header(conn, "Authorization")) == NULL || - mg_strncasecmp(auth_header, "Digest ", 7) != 0) { - return 0; - } - - // Make modifiable copy of the auth header - (void) mg_strlcpy(buf, auth_header + 7, buf_size); - s = buf; - - // Parse authorization header - for (;;) { - // Gobble initial spaces - while (isspace(* (unsigned char *) s)) { - s++; - } - name = skip_quoted(&s, "=", " ", 0); - // Value is either quote-delimited, or ends at first comma or space. - if (s[0] == '\"') { - s++; - value = skip_quoted(&s, "\"", " ", '\\'); - if (s[0] == ',') { - s++; - } - } else { - value = skip_quoted(&s, ", ", " ", 0); // IE uses commas, FF uses spaces - } - if (*name == '\0') { - break; - } - - if (!strcmp(name, "username")) { - ah->user = value; - } else if (!strcmp(name, "cnonce")) { - ah->cnonce = value; - } else if (!strcmp(name, "response")) { - ah->response = value; - } else if (!strcmp(name, "uri")) { - ah->uri = value; - } else if (!strcmp(name, "qop")) { - ah->qop = value; - } else if (!strcmp(name, "nc")) { - ah->nc = value; - } else if (!strcmp(name, "nonce")) { - ah->nonce = value; - } - } - - // CGI needs it as REMOTE_USER - if (ah->user != NULL) { - conn->request_info.remote_user = mg_strdup(ah->user); - } else { - return 0; - } - - return 1; -} - -static char *mg_fgets(char *buf, size_t size, struct file *filep, char **p) { - char *eof; - size_t len; - - if (filep->membuf != NULL && *p != NULL) { - eof = memchr(*p, '\n', &filep->membuf[filep->size] - *p); - len = (size_t) (eof - *p) > size - 1 ? size - 1 : (size_t) (eof - *p); - memcpy(buf, *p, len); - buf[len] = '\0'; - *p = eof; - return eof; - } else if (filep->fp != NULL) { - return fgets(buf, size, filep->fp); - } else { - return NULL; - } -} - -// Authorize against the opened passwords file. Return 1 if authorized. -static int authorize(struct mg_connection *conn, struct file *filep) { - struct ah ah; - char line[256], f_user[256], ha1[256], f_domain[256], buf[MG_BUF_LEN], *p; - - if (!parse_auth_header(conn, buf, sizeof(buf), &ah)) { - return 0; - } - - // Loop over passwords file - p = (char *) filep->membuf; - while (mg_fgets(line, sizeof(line), filep, &p) != NULL) { - if (sscanf(line, "%[^:]:%[^:]:%s", f_user, f_domain, ha1) != 3) { - continue; - } - - if (!strcmp(ah.user, f_user) && - !strcmp(conn->ctx->config[AUTHENTICATION_DOMAIN], f_domain)) - return check_password(conn->request_info.request_method, ha1, ah.uri, - ah.nonce, ah.nc, ah.cnonce, ah.qop, ah.response); - } - - return 0; -} - -// Return 1 if request is authorised, 0 otherwise. -static int check_authorization(struct mg_connection *conn, const char *path) { - char fname[PATH_MAX]; - struct vec uri_vec, filename_vec; - const char *list; - struct file file = STRUCT_FILE_INITIALIZER; - int authorized = 1; - - list = conn->ctx->config[PROTECT_URI]; - while ((list = next_option(list, &uri_vec, &filename_vec)) != NULL) { - if (!memcmp(conn->request_info.uri, uri_vec.ptr, uri_vec.len)) { - mg_snprintf(conn, fname, sizeof(fname), "%.*s", - (int) filename_vec.len, filename_vec.ptr); - if (!mg_fopen(conn, fname, "r", &file)) { - cry(conn, "%s: cannot open %s: %s", __func__, fname, strerror(errno)); - } - break; - } - } - - if (!is_file_opened(&file)) { - open_auth_file(conn, path, &file); - } - - if (is_file_opened(&file)) { - authorized = authorize(conn, &file); - mg_fclose(&file); - } - - return authorized; -} - -static void send_authorization_request(struct mg_connection *conn) { - conn->status_code = 401; - mg_printf(conn, - "HTTP/1.1 401 Unauthorized\r\n" - "Content-Length: 0\r\n" - "WWW-Authenticate: Digest qop=\"auth\", " - "realm=\"%s\", nonce=\"%lu\"\r\n\r\n", - conn->ctx->config[AUTHENTICATION_DOMAIN], - (unsigned long) time(NULL)); -} - -static int is_authorized_for_put(struct mg_connection *conn) { - struct file file = STRUCT_FILE_INITIALIZER; - const char *passfile = conn->ctx->config[PUT_DELETE_PASSWORDS_FILE]; - int ret = 0; - - if (passfile != NULL && mg_fopen(conn, passfile, "r", &file)) { - ret = authorize(conn, &file); - mg_fclose(&file); - } - - return ret; -} - -int mg_modify_passwords_file(const char *fname, const char *domain, - const char *user, const char *pass) { - int found; - char line[512], u[512], d[512], ha1[33], tmp[PATH_MAX]; - FILE *fp, *fp2; - - found = 0; - fp = fp2 = NULL; - - // Regard empty password as no password - remove user record. - if (pass != NULL && pass[0] == '\0') { - pass = NULL; - } - - (void) snprintf(tmp, sizeof(tmp), "%s.tmp", fname); - - // Create the file if does not exist - if ((fp = fopen(fname, "a+")) != NULL) { - (void) fclose(fp); - } - - // Open the given file and temporary file - if ((fp = fopen(fname, "r")) == NULL) { - return 0; - } else if ((fp2 = fopen(tmp, "w+")) == NULL) { - fclose(fp); - return 0; - } - - // Copy the stuff to temporary file - while (fgets(line, sizeof(line), fp) != NULL) { - if (sscanf(line, "%[^:]:%[^:]:%*s", u, d) != 2) { - continue; - } - - if (!strcmp(u, user) && !strcmp(d, domain)) { - found++; - if (pass != NULL) { - mg_md5(ha1, user, ":", domain, ":", pass, NULL); - fprintf(fp2, "%s:%s:%s\n", user, domain, ha1); - } - } else { - fprintf(fp2, "%s", line); - } - } - - // If new user, just add it - if (!found && pass != NULL) { - mg_md5(ha1, user, ":", domain, ":", pass, NULL); - fprintf(fp2, "%s:%s:%s\n", user, domain, ha1); - } - - // Close files - fclose(fp); - fclose(fp2); - - // Put the temp file in place of real file - remove(fname); - rename(tmp, fname); - - return 1; -} - -struct de { - struct mg_connection *conn; - char *file_name; - struct file file; -}; - -static void url_encode(const char *src, char *dst, size_t dst_len) { - static const char *dont_escape = "._-$,;~()"; - static const char *hex = "0123456789abcdef"; - const char *end = dst + dst_len - 1; - - for (; *src != '\0' && dst < end; src++, dst++) { - if (isalnum(*(const unsigned char *) src) || - strchr(dont_escape, * (const unsigned char *) src) != NULL) { - *dst = *src; - } else if (dst + 2 < end) { - dst[0] = '%'; - dst[1] = hex[(* (const unsigned char *) src) >> 4]; - dst[2] = hex[(* (const unsigned char *) src) & 0xf]; - dst += 2; - } - } - - *dst = '\0'; -} - -static void print_dir_entry(struct de *de) { - char size[64], mod[64], href[PATH_MAX]; - - if (de->file.is_directory) { - mg_snprintf(de->conn, size, sizeof(size), "%s", "[DIRECTORY]"); - } else { - // We use (signed) cast below because MSVC 6 compiler cannot - // convert unsigned __int64 to double. Sigh. - if (de->file.size < 1024) { - mg_snprintf(de->conn, size, sizeof(size), "%d", (int) de->file.size); - } else if (de->file.size < 0x100000) { - mg_snprintf(de->conn, size, sizeof(size), - "%.1fk", (double) de->file.size / 1024.0); - } else if (de->file.size < 0x40000000) { - mg_snprintf(de->conn, size, sizeof(size), - "%.1fM", (double) de->file.size / 1048576); - } else { - mg_snprintf(de->conn, size, sizeof(size), - "%.1fG", (double) de->file.size / 1073741824); - } - } - strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", - localtime(&de->file.modification_time)); - url_encode(de->file_name, href, sizeof(href)); - de->conn->num_bytes_sent += mg_printf(de->conn, - "%s%s" - " %s  %s\n", - de->conn->request_info.uri, href, de->file.is_directory ? "/" : "", - de->file_name, de->file.is_directory ? "/" : "", mod, size); -} - -// This function is called from send_directory() and used for -// sorting directory entries by size, or name, or modification time. -// On windows, __cdecl specification is needed in case if project is built -// with __stdcall convention. qsort always requires __cdels callback. -static int WINCDECL compare_dir_entries(const void *p1, const void *p2) { - const struct de *a = (const struct de *) p1, *b = (const struct de *) p2; - const char *query_string = a->conn->request_info.query_string; - int cmp_result = 0; - - if (query_string == NULL) { - query_string = "na"; - } - - if (a->file.is_directory && !b->file.is_directory) { - return -1; // Always put directories on top - } else if (!a->file.is_directory && b->file.is_directory) { - return 1; // Always put directories on top - } else if (*query_string == 'n') { - cmp_result = strcmp(a->file_name, b->file_name); - } else if (*query_string == 's') { - cmp_result = a->file.size == b->file.size ? 0 : - a->file.size > b->file.size ? 1 : -1; - } else if (*query_string == 'd') { - cmp_result = a->file.modification_time == b->file.modification_time ? 0 : - a->file.modification_time > b->file.modification_time ? 1 : -1; - } - - return query_string[1] == 'd' ? -cmp_result : cmp_result; -} - -static int must_hide_file(struct mg_connection *conn, const char *path) { - const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$"; - const char *pattern = conn->ctx->config[HIDE_FILES]; - return match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 || - (pattern != NULL && match_prefix(pattern, strlen(pattern), path) > 0); -} - -static int scan_directory(struct mg_connection *conn, const char *dir, - void *data, void (*cb)(struct de *, void *)) { - char path[PATH_MAX]; - struct dirent *dp; - DIR *dirp; - struct de de; - - if ((dirp = opendir(dir)) == NULL) { - return 0; - } else { - de.conn = conn; - - while ((dp = readdir(dirp)) != NULL) { - // Do not show current dir and hidden files - if (!strcmp(dp->d_name, ".") || - !strcmp(dp->d_name, "..") || - must_hide_file(conn, dp->d_name)) { - continue; - } - - mg_snprintf(conn, path, sizeof(path), "%s%c%s", dir, '/', dp->d_name); - - // If we don't memset stat structure to zero, mtime will have - // garbage and strftime() will segfault later on in - // print_dir_entry(). memset is required only if mg_stat() - // fails. For more details, see - // http://code.google.com/p/mongoose/issues/detail?id=79 - // mg_stat will memset the whole struct file with zeroes. - mg_stat(conn, path, &de.file); - - de.file_name = dp->d_name; - cb(&de, data); - } - (void) closedir(dirp); - } - return 1; -} - -struct dir_scan_data { - struct de *entries; - int num_entries; - int arr_size; -}; - -static void dir_scan_callback(struct de *de, void *data) { - struct dir_scan_data *dsd = (struct dir_scan_data *) data; - - if (dsd->entries == NULL || dsd->num_entries >= dsd->arr_size) { - dsd->arr_size *= 2; - dsd->entries = (struct de *) realloc(dsd->entries, dsd->arr_size * - sizeof(dsd->entries[0])); - } - if (dsd->entries == NULL) { - // TODO(lsm): propagate an error to the caller - dsd->num_entries = 0; - } else { - dsd->entries[dsd->num_entries].file_name = mg_strdup(de->file_name); - dsd->entries[dsd->num_entries].file = de->file; - dsd->entries[dsd->num_entries].conn = de->conn; - dsd->num_entries++; - } -} - -static void handle_directory_request(struct mg_connection *conn, - const char *dir) { - int i, sort_direction; - struct dir_scan_data data = { NULL, 0, 128 }; - - if (!scan_directory(conn, dir, &data, dir_scan_callback)) { - send_http_error(conn, 500, "Cannot open directory", - "Error: opendir(%s): %s", dir, strerror(ERRNO)); - return; - } - - sort_direction = conn->request_info.query_string != NULL && - conn->request_info.query_string[1] == 'd' ? 'a' : 'd'; - - conn->must_close = 1; - mg_printf(conn, "%s", - "HTTP/1.1 200 OK\r\n" - "Connection: close\r\n" - "Content-Type: text/html; charset=utf-8\r\n\r\n"); - - conn->num_bytes_sent += mg_printf(conn, - "Index of %s" - "" - "

Index of %s

"
-      ""
-      ""
-      ""
-      "",
-      conn->request_info.uri, conn->request_info.uri,
-      sort_direction, sort_direction, sort_direction);
-
-  // Print first entry - link to a parent directory
-  conn->num_bytes_sent += mg_printf(conn,
-      ""
-      "\n",
-      conn->request_info.uri, "..", "Parent directory", "-", "-");
-
-  // Sort and print directory entries
-  qsort(data.entries, (size_t) data.num_entries, sizeof(data.entries[0]),
-        compare_dir_entries);
-  for (i = 0; i < data.num_entries; i++) {
-    print_dir_entry(&data.entries[i]);
-    free(data.entries[i].file_name);
-  }
-  free(data.entries);
-
-  conn->num_bytes_sent += mg_printf(conn, "%s", "
NameModifiedSize

%s %s  %s
"); - conn->status_code = 200; -} - -// Send len bytes from the opened file to the client. -static void send_file_data(struct mg_connection *conn, struct file *filep, - int64_t offset, int64_t len) { - char buf[MG_BUF_LEN]; - int to_read, num_read, num_written; - - if (len > 0 && filep->membuf != NULL && filep->size > 0) { - if (len > filep->size - offset) { - len = filep->size - offset; - } - mg_write(conn, filep->membuf + offset, (size_t) len); - } else if (len > 0 && filep->fp != NULL) { - fseeko(filep->fp, offset, SEEK_SET); - while (len > 0) { - // Calculate how much to read from the file in the buffer - to_read = sizeof(buf); - if ((int64_t) to_read > len) { - to_read = (int) len; - } - - // Read from file, exit the loop on error - if ((num_read = fread(buf, 1, (size_t) to_read, filep->fp)) <= 0) { - break; - } - - // Send read bytes to the client, exit the loop on error - if ((num_written = mg_write(conn, buf, (size_t) num_read)) != num_read) { - break; - } - - // Both read and were successful, adjust counters - conn->num_bytes_sent += num_written; - len -= num_written; - } - } -} - -static int parse_range_header(const char *header, int64_t *a, int64_t *b) { - return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b); -} - -static void gmt_time_string(char *buf, size_t buf_len, time_t *t) { - strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(t)); -} - -static void construct_etag(char *buf, size_t buf_len, - const struct file *filep) { - snprintf(buf, buf_len, "\"%lx.%" INT64_FMT "\"", - (unsigned long) filep->modification_time, filep->size); -} - -static void fclose_on_exec(struct file *filep) { - if (filep != NULL && filep->fp != NULL) { -#ifndef _WIN32 - fcntl(fileno(filep->fp), F_SETFD, FD_CLOEXEC); -#endif - } -} - -static void handle_file_request(struct mg_connection *conn, const char *path, - struct file *filep) { - char date[64], lm[64], etag[64], range[64]; - const char *msg = "OK", *hdr; - time_t curtime = time(NULL); - int64_t cl, r1, r2; - struct vec mime_vec; - int n; - - get_mime_type(conn->ctx, path, &mime_vec); - cl = filep->size; - conn->status_code = 200; - range[0] = '\0'; - - if (!mg_fopen(conn, path, "rb", filep)) { - send_http_error(conn, 500, http_500_error, - "fopen(%s): %s", path, strerror(ERRNO)); - return; - } - fclose_on_exec(filep); - - // If Range: header specified, act accordingly - r1 = r2 = 0; - hdr = mg_get_header(conn, "Range"); - if (hdr != NULL && (n = parse_range_header(hdr, &r1, &r2)) > 0 && - r1 >= 0 && r2 > 0) { - conn->status_code = 206; - cl = n == 2 ? (r2 > cl ? cl : r2) - r1 + 1: cl - r1; - mg_snprintf(conn, range, sizeof(range), - "Content-Range: bytes " - "%" INT64_FMT "-%" - INT64_FMT "/%" INT64_FMT "\r\n", - r1, r1 + cl - 1, filep->size); - msg = "Partial Content"; - } - - // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to - // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 - gmt_time_string(date, sizeof(date), &curtime); - gmt_time_string(lm, sizeof(lm), &filep->modification_time); - construct_etag(etag, sizeof(etag), filep); - - (void) mg_printf(conn, - "HTTP/1.1 %d %s\r\n" - "Date: %s\r\n" - "Last-Modified: %s\r\n" - "Etag: %s\r\n" - "Content-Type: %.*s\r\n" - "Content-Length: %" INT64_FMT "\r\n" - "Connection: %s\r\n" - "Accept-Ranges: bytes\r\n" - "%s\r\n", - conn->status_code, msg, date, lm, etag, (int) mime_vec.len, - mime_vec.ptr, cl, suggest_connection_header(conn), range); - - if (strcmp(conn->request_info.request_method, "HEAD") != 0) { - send_file_data(conn, filep, r1, cl); - } - mg_fclose(filep); -} - -void mg_send_file(struct mg_connection *conn, const char *path) { - struct file file; - if (mg_stat(conn, path, &file)) { - handle_file_request(conn, path, &file); - } else { - send_http_error(conn, 404, "Not Found", "%s", "File not found"); - } -} - - -// Parse HTTP headers from the given buffer, advance buffer to the point -// where parsing stopped. -static void parse_http_headers(char **buf, struct mg_request_info *ri) { - int i; - - for (i = 0; i < (int) ARRAY_SIZE(ri->http_headers); i++) { - ri->http_headers[i].name = skip_quoted(buf, ":", " ", 0); - ri->http_headers[i].value = skip(buf, "\r\n"); - if (ri->http_headers[i].name[0] == '\0') - break; - ri->num_headers = i + 1; - } -} - -static int is_valid_http_method(const char *method) { - return !strcmp(method, "GET") || !strcmp(method, "POST") || - !strcmp(method, "HEAD") || !strcmp(method, "CONNECT") || - !strcmp(method, "PUT") || !strcmp(method, "DELETE") || - !strcmp(method, "OPTIONS") || !strcmp(method, "PROPFIND"); -} - -// Parse HTTP request, fill in mg_request_info structure. -// This function modifies the buffer by NUL-terminating -// HTTP request components, header names and header values. -static int parse_http_message(char *buf, int len, struct mg_request_info *ri) { - int request_length = get_request_len(buf, len); - if (request_length > 0) { - // Reset attributes. DO NOT TOUCH is_ssl, remote_ip, remote_port - ri->remote_user = ri->request_method = ri->uri = ri->http_version = NULL; - ri->num_headers = 0; - - buf[request_length - 1] = '\0'; - - // RFC says that all initial whitespaces should be ingored - while (*buf != '\0' && isspace(* (unsigned char *) buf)) { - buf++; - } - ri->request_method = skip(&buf, " "); - ri->uri = skip(&buf, " "); - ri->http_version = skip(&buf, "\r\n"); - parse_http_headers(&buf, ri); - } - return request_length; -} - -static int parse_http_request(char *buf, int len, struct mg_request_info *ri) { - int result = parse_http_message(buf, len, ri); - if (result > 0 && - is_valid_http_method(ri->request_method) && - !strncmp(ri->http_version, "HTTP/", 5)) { - ri->http_version += 5; // Skip "HTTP/" - } else { - result = -1; - } - return result; -} - -static int parse_http_response(char *buf, int len, struct mg_request_info *ri) { - int result = parse_http_message(buf, len, ri); - return result > 0 && !strncmp(ri->request_method, "HTTP/", 5) ? result : -1; -} - -// Keep reading the input (either opened file descriptor fd, or socket sock, -// or SSL descriptor ssl) into buffer buf, until \r\n\r\n appears in the -// buffer (which marks the end of HTTP request). Buffer buf may already -// have some data. The length of the data is stored in nread. -// Upon every read operation, increase nread by the number of bytes read. -static int read_request(FILE *fp, struct mg_connection *conn, - char *buf, int bufsiz, int *nread) { - int request_len, n = 1; - - request_len = get_request_len(buf, *nread); - while (*nread < bufsiz && request_len == 0 && n > 0) { - n = pull(fp, conn, buf + *nread, bufsiz - *nread); - if (n > 0) { - *nread += n; - request_len = get_request_len(buf, *nread); - } - } - - if (n < 0) { - // recv() error -> propagate error; do not process a b0rked-with-very-high-probability request - return -1; - } - return request_len; -} - -// For given directory path, substitute it to valid index file. -// Return 0 if index file has been found, -1 if not found. -// If the file is found, it's stats is returned in stp. -static int substitute_index_file(struct mg_connection *conn, char *path, - size_t path_len, struct file *filep) { - const char *list = conn->ctx->config[INDEX_FILES]; - struct file file = STRUCT_FILE_INITIALIZER; - struct vec filename_vec; - size_t n = strlen(path); - int found = 0; - - // The 'path' given to us points to the directory. Remove all trailing - // directory separator characters from the end of the path, and - // then append single directory separator character. - while (n > 0 && path[n - 1] == '/') { - n--; - } - path[n] = '/'; - - // Traverse index files list. For each entry, append it to the given - // path and see if the file exists. If it exists, break the loop - while ((list = next_option(list, &filename_vec, NULL)) != NULL) { - - // Ignore too long entries that may overflow path buffer - if (filename_vec.len > path_len - (n + 2)) - continue; - - // Prepare full path to the index file - mg_strlcpy(path + n + 1, filename_vec.ptr, filename_vec.len + 1); - - // Does it exist? - if (mg_stat(conn, path, &file)) { - // Yes it does, break the loop - *filep = file; - found = 1; - break; - } - } - - // If no index file exists, restore directory path - if (!found) { - path[n] = '\0'; - } - - return found; -} - -// Return True if we should reply 304 Not Modified. -static int is_not_modified(const struct mg_connection *conn, - const struct file *filep) { - char etag[64]; - const char *ims = mg_get_header(conn, "If-Modified-Since"); - const char *inm = mg_get_header(conn, "If-None-Match"); - construct_etag(etag, sizeof(etag), filep); - return (inm != NULL && !mg_strcasecmp(etag, inm)) || - (ims != NULL && filep->modification_time <= parse_date_string(ims)); -} - -static int forward_body_data(struct mg_connection *conn, FILE *fp, - SOCKET sock, SSL *ssl) { - const char *expect, *body; - char buf[MG_BUF_LEN]; - int to_read, nread, buffered_len, success = 0; - - expect = mg_get_header(conn, "Expect"); - assert(fp != NULL); - - if (conn->content_len == -1) { - send_http_error(conn, 411, "Length Required", "%s", ""); - } else if (expect != NULL && mg_strcasecmp(expect, "100-continue")) { - send_http_error(conn, 417, "Expectation Failed", "%s", ""); - } else { - if (expect != NULL) { - (void) mg_printf(conn, "%s", "HTTP/1.1 100 Continue\r\n\r\n"); - } - - body = conn->buf + conn->request_len + conn->consumed_content; - buffered_len = &conn->buf[conn->data_len] - body; - assert(buffered_len >= 0); - assert(conn->consumed_content == 0); - - if (buffered_len > 0) { - if ((int64_t) buffered_len > conn->content_len) { - buffered_len = (int) conn->content_len; - } - push(fp, sock, ssl, body, (int64_t) buffered_len); - conn->consumed_content += buffered_len; - } - - nread = 0; - while (conn->consumed_content < conn->content_len) { - to_read = sizeof(buf); - if ((int64_t) to_read > conn->content_len - conn->consumed_content) { - to_read = (int) (conn->content_len - conn->consumed_content); - } - nread = pull(NULL, conn, buf, to_read); - if (nread <= 0 || push(fp, sock, ssl, buf, nread) != nread) { - break; - } - conn->consumed_content += nread; - } - - if (conn->consumed_content == conn->content_len) { - success = nread >= 0; - } - - // Each error code path in this function must send an error - if (!success) { - send_http_error(conn, 577, http_500_error, "%s", ""); - } - } - - return success; -} - -#if !defined(NO_CGI) -// This structure helps to create an environment for the spawned CGI program. -// Environment is an array of "VARIABLE=VALUE\0" ASCIIZ strings, -// last element must be NULL. -// However, on Windows there is a requirement that all these VARIABLE=VALUE\0 -// strings must reside in a contiguous buffer. The end of the buffer is -// marked by two '\0' characters. -// We satisfy both worlds: we create an envp array (which is vars), all -// entries are actually pointers inside buf. -struct cgi_env_block { - struct mg_connection *conn; - char buf[CGI_ENVIRONMENT_SIZE]; // Environment buffer - int len; // Space taken - char *vars[MAX_CGI_ENVIR_VARS]; // char **envp - int nvars; // Number of variables -}; - -static char *addenv(struct cgi_env_block *block, - PRINTF_FORMAT_STRING(const char *fmt), ...) - PRINTF_ARGS(2, 3); - -// Append VARIABLE=VALUE\0 string to the buffer, and add a respective -// pointer into the vars array. -static char *addenv(struct cgi_env_block *block, const char *fmt, ...) { - int n, space; - char *added; - va_list ap; - - // Calculate how much space is left in the buffer - space = sizeof(block->buf) - block->len - 2; - assert(space >= 0); - - // Make a pointer to the free space int the buffer - added = block->buf + block->len; - - // Copy VARIABLE=VALUE\0 string into the free space - va_start(ap, fmt); - n = mg_vsnprintf(block->conn, added, (size_t) space, fmt, ap); - va_end(ap); - - // Make sure we do not overflow buffer and the envp array - if (n > 0 && n + 1 < space && - block->nvars < (int) ARRAY_SIZE(block->vars) - 2) { - // Append a pointer to the added string into the envp array - block->vars[block->nvars++] = added; - // Bump up used length counter. Include \0 terminator - block->len += n + 1; - } else { - cry(block->conn, "%s: CGI env buffer truncated for [%s]", __func__, fmt); - } - - return added; -} - -static void prepare_cgi_environment(struct mg_connection *conn, - const char *prog, - struct cgi_env_block *blk) { - const char *s, *slash; - struct vec var_vec; - char *p, src_addr[20]; - int i; - - blk->len = blk->nvars = 0; - blk->conn = conn; - sockaddr_to_string(src_addr, sizeof(src_addr), &conn->client.rsa); - - addenv(blk, "SERVER_NAME=%s", conn->ctx->config[AUTHENTICATION_DOMAIN]); - addenv(blk, "SERVER_ROOT=%s", conn->ctx->config[DOCUMENT_ROOT]); - addenv(blk, "DOCUMENT_ROOT=%s", conn->ctx->config[DOCUMENT_ROOT]); - - // Prepare the environment block - addenv(blk, "%s", "GATEWAY_INTERFACE=CGI/1.1"); - addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1"); - addenv(blk, "%s", "REDIRECT_STATUS=200"); // For PHP - - // TODO(lsm): fix this for IPv6 case - addenv(blk, "SERVER_PORT=%d", ntohs(conn->client.lsa.sin.sin_port)); - - addenv(blk, "REQUEST_METHOD=%s", conn->request_info.request_method); - addenv(blk, "REMOTE_ADDR=%s", src_addr); - addenv(blk, "REMOTE_PORT=%d", conn->request_info.remote_port); - addenv(blk, "REQUEST_URI=%s", conn->request_info.uri); - - // SCRIPT_NAME - assert(conn->request_info.uri[0] == '/'); - slash = strrchr(conn->request_info.uri, '/'); - if ((s = strrchr(prog, '/')) == NULL) - s = prog; - addenv(blk, "SCRIPT_NAME=%.*s%s", (int) (slash - conn->request_info.uri), - conn->request_info.uri, s); - - addenv(blk, "SCRIPT_FILENAME=%s", prog); - addenv(blk, "PATH_TRANSLATED=%s", prog); - addenv(blk, "HTTPS=%s", conn->ssl == NULL ? "off" : "on"); - - if ((s = mg_get_header(conn, "Content-Type")) != NULL) - addenv(blk, "CONTENT_TYPE=%s", s); - - if (conn->request_info.query_string != NULL) - addenv(blk, "QUERY_STRING=%s", conn->request_info.query_string); - - if ((s = mg_get_header(conn, "Content-Length")) != NULL) - addenv(blk, "CONTENT_LENGTH=%s", s); - - if ((s = getenv("PATH")) != NULL) - addenv(blk, "PATH=%s", s); - - if (conn->path_info != NULL) { - addenv(blk, "PATH_INFO=%s", conn->path_info); - } - -#if defined(_WIN32) - if ((s = getenv("COMSPEC")) != NULL) { - addenv(blk, "COMSPEC=%s", s); - } - if ((s = getenv("SYSTEMROOT")) != NULL) { - addenv(blk, "SYSTEMROOT=%s", s); - } - if ((s = getenv("SystemDrive")) != NULL) { - addenv(blk, "SystemDrive=%s", s); - } -#else - if ((s = getenv("LD_LIBRARY_PATH")) != NULL) - addenv(blk, "LD_LIBRARY_PATH=%s", s); -#endif // _WIN32 - - if ((s = getenv("PERLLIB")) != NULL) - addenv(blk, "PERLLIB=%s", s); - - if (conn->request_info.remote_user != NULL) { - addenv(blk, "REMOTE_USER=%s", conn->request_info.remote_user); - addenv(blk, "%s", "AUTH_TYPE=Digest"); - } - - // Add all headers as HTTP_* variables - for (i = 0; i < conn->request_info.num_headers; i++) { - p = addenv(blk, "HTTP_%s=%s", - conn->request_info.http_headers[i].name, - conn->request_info.http_headers[i].value); - - // Convert variable name into uppercase, and change - to _ - for (; *p != '=' && *p != '\0'; p++) { - if (*p == '-') - *p = '_'; - *p = (char) toupper(* (unsigned char *) p); - } - } - - // Add user-specified variables - s = conn->ctx->config[CGI_ENVIRONMENT]; - while ((s = next_option(s, &var_vec, NULL)) != NULL) { - addenv(blk, "%.*s", (int) var_vec.len, var_vec.ptr); - } - - blk->vars[blk->nvars++] = NULL; - blk->buf[blk->len++] = '\0'; - - assert(blk->nvars < (int) ARRAY_SIZE(blk->vars)); - assert(blk->len > 0); - assert(blk->len < (int) sizeof(blk->buf)); -} - -static void handle_cgi_request(struct mg_connection *conn, const char *prog) { - int headers_len, data_len, i, fd_stdin[2], fd_stdout[2]; - const char *status, *status_text; - char buf[16384], *pbuf, dir[PATH_MAX], *p; - struct mg_request_info ri; - struct cgi_env_block blk; - FILE *in, *out; - struct file fout = STRUCT_FILE_INITIALIZER; - pid_t pid; - - prepare_cgi_environment(conn, prog, &blk); - - // CGI must be executed in its own directory. 'dir' must point to the - // directory containing executable program, 'p' must point to the - // executable program name relative to 'dir'. - (void) mg_snprintf(conn, dir, sizeof(dir), "%s", prog); - if ((p = strrchr(dir, '/')) != NULL) { - *p++ = '\0'; - } else { - dir[0] = '.', dir[1] = '\0'; - p = (char *) prog; - } - - pid = (pid_t) -1; - fd_stdin[0] = fd_stdin[1] = fd_stdout[0] = fd_stdout[1] = -1; - in = out = NULL; - - if (pipe(fd_stdin) != 0 || pipe(fd_stdout) != 0) { - send_http_error(conn, 500, http_500_error, - "Cannot create CGI pipe: %s", strerror(ERRNO)); - goto done; - } - - pid = spawn_process(conn, p, blk.buf, blk.vars, fd_stdin[0], fd_stdout[1], - dir); - // spawn_process() must close those! - // If we don't mark them as closed, close() attempt before - // return from this function throws an exception on Windows. - // Windows does not like when closed descriptor is closed again. - fd_stdin[0] = fd_stdout[1] = -1; - - if (pid == (pid_t) -1) { - send_http_error(conn, 500, http_500_error, - "Cannot spawn CGI process [%s]: %s", prog, strerror(ERRNO)); - goto done; - } - - if ((in = fdopen(fd_stdin[1], "wb")) == NULL || - (out = fdopen(fd_stdout[0], "rb")) == NULL) { - send_http_error(conn, 500, http_500_error, - "fopen: %s", strerror(ERRNO)); - goto done; - } - - setbuf(in, NULL); - setbuf(out, NULL); - fout.fp = out; - - // Send POST data to the CGI process if needed - if (!strcmp(conn->request_info.request_method, "POST") && - !forward_body_data(conn, in, INVALID_SOCKET, NULL)) { - goto done; - } - - // Close so child gets an EOF. - fclose(in); - in = NULL; - fd_stdin[1] = -1; - - // Now read CGI reply into a buffer. We need to set correct - // status code, thus we need to see all HTTP headers first. - // Do not send anything back to client, until we buffer in all - // HTTP headers. - data_len = 0; - headers_len = read_request(out, conn, buf, sizeof(buf), &data_len); - if (headers_len <= 0) { - send_http_error(conn, 500, http_500_error, - "CGI program sent malformed or too big (>%u bytes) " - "HTTP headers: [%.*s]", - (unsigned) sizeof(buf), data_len, buf); - goto done; - } - pbuf = buf; - buf[headers_len - 1] = '\0'; - parse_http_headers(&pbuf, &ri); - - // Make up and send the status line - status_text = "OK"; - if ((status = get_header(&ri, "Status")) != NULL) { - conn->status_code = atoi(status); - status_text = status; - while (isdigit(* (unsigned char *) status_text) || *status_text == ' ') { - status_text++; - } - } else if (get_header(&ri, "Location") != NULL) { - conn->status_code = 302; - } else { - conn->status_code = 200; - } - if (get_header(&ri, "Connection") != NULL && - !mg_strcasecmp(get_header(&ri, "Connection"), "keep-alive")) { - conn->must_close = 1; - } - (void) mg_printf(conn, "HTTP/1.1 %d %s\r\n", conn->status_code, - status_text); - - // Send headers - for (i = 0; i < ri.num_headers; i++) { - mg_printf(conn, "%s: %s\r\n", - ri.http_headers[i].name, ri.http_headers[i].value); - } - mg_write(conn, "\r\n", 2); - - // Send chunk of data that may have been read after the headers - conn->num_bytes_sent += mg_write(conn, buf + headers_len, - (size_t)(data_len - headers_len)); - - // Read the rest of CGI output and send to the client - send_file_data(conn, &fout, 0, INT64_MAX); - -done: - if (pid != (pid_t) -1) { - kill(pid, SIGKILL); - } - if (fd_stdin[0] != -1) { - close(fd_stdin[0]); - } - if (fd_stdout[1] != -1) { - close(fd_stdout[1]); - } - - if (in != NULL) { - fclose(in); - } else if (fd_stdin[1] != -1) { - close(fd_stdin[1]); - } - - if (out != NULL) { - fclose(out); - } else if (fd_stdout[0] != -1) { - close(fd_stdout[0]); - } -} -#endif // !NO_CGI - -// For a given PUT path, create all intermediate subdirectories -// for given path. Return 0 if the path itself is a directory, -// or -1 on error, 1 if OK. -static int put_dir(struct mg_connection *conn, const char *path) { - char buf[PATH_MAX]; - const char *s, *p; - struct file file; - int len, res = 1; - - for (s = p = path + 2; (p = strchr(s, '/')) != NULL; s = ++p) { - len = p - path; - if (len >= (int) sizeof(buf)) { - res = -1; - break; - } - memcpy(buf, path, len); - buf[len] = '\0'; - - // Try to create intermediate directory - DEBUG_TRACE(("mkdir(%s)", buf)); - if (!mg_stat(conn, buf, &file) && mg_mkdir(buf, 0755) != 0) { - res = -1; - break; - } - - // Is path itself a directory? - if (p[1] == '\0') { - res = 0; - } - } - - return res; -} - -static void put_file(struct mg_connection *conn, const char *path) { - struct file file; - const char *range; - int64_t r1, r2; - int rc; - - conn->status_code = mg_stat(conn, path, &file) ? 200 : 201; - - if ((rc = put_dir(conn, path)) == 0) { - mg_printf(conn, "HTTP/1.1 %d OK\r\n\r\n", conn->status_code); - } else if (rc == -1) { - send_http_error(conn, 500, http_500_error, - "put_dir(%s): %s", path, strerror(ERRNO)); - } else if (!mg_fopen(conn, path, "wb+", &file) || file.fp == NULL) { - mg_fclose(&file); - send_http_error(conn, 500, http_500_error, - "fopen(%s): %s", path, strerror(ERRNO)); - } else { - fclose_on_exec(&file); - range = mg_get_header(conn, "Content-Range"); - r1 = r2 = 0; - if (range != NULL && parse_range_header(range, &r1, &r2) > 0) { - conn->status_code = 206; - fseeko(file.fp, r1, SEEK_SET); - } - if (forward_body_data(conn, file.fp, INVALID_SOCKET, NULL)) { - mg_printf(conn, "HTTP/1.1 %d OK\r\n\r\n", conn->status_code); - } - mg_fclose(&file); - } -} - -static void send_ssi_file(struct mg_connection *, const char *, - struct file *, int); - -static void do_ssi_include(struct mg_connection *conn, const char *ssi, - char *tag, int include_level) { - char file_name[MG_BUF_LEN], path[PATH_MAX], *p; - struct file file; - - // sscanf() is safe here, since send_ssi_file() also uses buffer - // of size MG_BUF_LEN to get the tag. So strlen(tag) is always < MG_BUF_LEN. - if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) { - // File name is relative to the webserver root - (void) mg_snprintf(conn, path, sizeof(path), "%s%c%s", - conn->ctx->config[DOCUMENT_ROOT], '/', file_name); - } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1) { - // File name is relative to the webserver working directory - // or it is absolute system path - (void) mg_snprintf(conn, path, sizeof(path), "%s", file_name); - } else if (sscanf(tag, " \"%[^\"]\"", file_name) == 1) { - // File name is relative to the currect document - (void) mg_snprintf(conn, path, sizeof(path), "%s", ssi); - if ((p = strrchr(path, '/')) != NULL) { - p[1] = '\0'; - } - (void) mg_snprintf(conn, path + strlen(path), - sizeof(path) - strlen(path), "%s", file_name); - } else { - cry(conn, "Bad SSI #include: [%s]", tag); - return; - } - - if (!mg_fopen(conn, path, "rb", &file)) { - cry(conn, "Cannot open SSI #include: [%s]: fopen(%s): %s", - tag, path, strerror(ERRNO)); - } else { - fclose_on_exec(&file); - if (match_prefix(conn->ctx->config[SSI_EXTENSIONS], - strlen(conn->ctx->config[SSI_EXTENSIONS]), path) > 0) { - send_ssi_file(conn, path, &file, include_level + 1); - } else { - send_file_data(conn, &file, 0, INT64_MAX); - } - mg_fclose(&file); - } -} - -#if !defined(NO_POPEN) -static void do_ssi_exec(struct mg_connection *conn, char *tag) { - char cmd[MG_BUF_LEN]; - struct file file = STRUCT_FILE_INITIALIZER; - - if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) { - cry(conn, "Bad SSI #exec: [%s]", tag); - } else if ((file.fp = popen(cmd, "r")) == NULL) { - cry(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(ERRNO)); - } else { - send_file_data(conn, &file, 0, INT64_MAX); - pclose(file.fp); - } -} -#endif // !NO_POPEN - -static int mg_fgetc(struct file *filep, int offset) { - if (filep->membuf != NULL && offset >=0 && offset < filep->size) { - return ((unsigned char *) filep->membuf)[offset]; - } else if (filep->fp != NULL) { - return fgetc(filep->fp); - } else { - return EOF; - } -} - -static void send_ssi_file(struct mg_connection *conn, const char *path, - struct file *filep, int include_level) { - char buf[MG_BUF_LEN]; - int ch, offset, len, in_ssi_tag; - - if (include_level > 10) { - cry(conn, "SSI #include level is too deep (%s)", path); - return; - } - - in_ssi_tag = len = offset = 0; - while ((ch = mg_fgetc(filep, offset)) != EOF) { - if (in_ssi_tag && ch == '>') { - in_ssi_tag = 0; - buf[len++] = (char) ch; - buf[len] = '\0'; - assert(len <= (int) sizeof(buf)); - if (len < 6 || memcmp(buf, " - - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip - + Common\Shared\7zip diff --git a/OpenSauce/shared/config/msbuild/CrashRpt.props b/OpenSauce/shared/config/msbuild/CrashRpt.props index a7b6fd62a..eca3e0a0a 100644 --- a/OpenSauce/shared/config/msbuild/CrashRpt.props +++ b/OpenSauce/shared/config/msbuild/CrashRpt.props @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/CrashRpt.vcxproj.filters b/OpenSauce/shared/config/msbuild/CrashRpt.vcxproj.filters index 0ce740e40..a6caac7ef 100644 --- a/OpenSauce/shared/config/msbuild/CrashRpt.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/CrashRpt.vcxproj.filters @@ -1,14 +1,8 @@ - - - + Common\Shared\CrashRpt diff --git a/OpenSauce/shared/config/msbuild/GameSpyOpen.props b/OpenSauce/shared/config/msbuild/GameSpyOpen.props index 2fdbd435c..9d81ff9b1 100644 --- a/OpenSauce/shared/config/msbuild/GameSpyOpen.props +++ b/OpenSauce/shared/config/msbuild/GameSpyOpen.props @@ -1,130 +1,130 @@ - - + + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/OpenSauce/shared/config/msbuild/GameSpyOpen.vcxproj.filters b/OpenSauce/shared/config/msbuild/GameSpyOpen.vcxproj.filters index 9d8ae8c3f..12bedc015 100644 --- a/OpenSauce/shared/config/msbuild/GameSpyOpen.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/GameSpyOpen.vcxproj.filters @@ -14,191 +14,191 @@ - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\common - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp - + Common\Shared\GameSpy\ghttp diff --git a/OpenSauce/shared/config/msbuild/TinyXml.props b/OpenSauce/shared/config/msbuild/TinyXml.props index 8f53e7709..3ffedcae5 100644 --- a/OpenSauce/shared/config/msbuild/TinyXml.props +++ b/OpenSauce/shared/config/msbuild/TinyXml.props @@ -1,13 +1,13 @@ - + - - - - - - + + + + + + \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/TinyXml.vcxproj.filters b/OpenSauce/shared/config/msbuild/TinyXml.vcxproj.filters index b76d33c5f..40ddcce1c 100644 --- a/OpenSauce/shared/config/msbuild/TinyXml.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/TinyXml.vcxproj.filters @@ -1,34 +1,28 @@ - - - + Common\Shared\TinyXml - + Common\Shared\TinyXml - + Common\Shared\TinyXml - + Common\Shared\TinyXml - + Common\Shared\TinyXml - + Common\Shared\TinyXml - + Common\Shared\TinyXml diff --git a/OpenSauce/shared/config/msbuild/YeloLib.props b/OpenSauce/shared/config/msbuild/YeloLib.props index c632ea5b3..79ea3dacf 100644 --- a/OpenSauce/shared/config/msbuild/YeloLib.props +++ b/OpenSauce/shared/config/msbuild/YeloLib.props @@ -1,7 +1,7 @@ - $(SolutionDir)shared\Include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\source;%(AdditionalIncludeDirectories) true Sync @@ -33,26 +33,13 @@ true - - - - HALO2_CHEAPE_EXPORTS;%(PreprocessorDefinitions) - - - + d3dxof.lib;dxguid.lib;d3dx9.lib;d3d9.lib;dinput8.lib;winmm.lib;%(AdditionalDependencies) - - - Create diff --git a/OpenSauce/shared/config/msbuild/YeloLib.vcxproj.filters b/OpenSauce/shared/config/msbuild/YeloLib.vcxproj.filters index 6567856c6..97fd1d26c 100644 --- a/OpenSauce/shared/config/msbuild/YeloLib.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/YeloLib.vcxproj.filters @@ -1,233 +1,155 @@ - - - + .YeloLib\cache - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\files - + .YeloLib\files - + .YeloLib\main - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory - + .YeloLib\memory\compression - + .YeloLib\memory\compression - + .YeloLib\memory\compression - + .YeloLib\memory\compression - + .YeloLib\memory\security - + .YeloLib\memory\security - + .YeloLib\open_sauce\settings - + .YeloLib\open_sauce\settings - + .YeloLib\open_sauce\che_ape - + .YeloLib\open_sauce\che_ape - + .YeloLib\open_sauce\che_ape - + .YeloLib\shell - + .YeloLib\tag_files - + .YeloLib\tag_files diff --git a/OpenSauce/shared/config/msbuild/YeloLib_Halo1.props b/OpenSauce/shared/config/msbuild/YeloLib_Halo1.props index 05c620513..06e6b597c 100644 --- a/OpenSauce/shared/config/msbuild/YeloLib_Halo1.props +++ b/OpenSauce/shared/config/msbuild/YeloLib_Halo1.props @@ -1,148 +1,148 @@ - - - - - - + + + + + + - - - - - - - + + + + + + + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - + - - - - - - - - - - + + + + + + + + + + - - + + - - - + + + - + - - - - - - - + + + + + + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - - - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cseries - + .YeloLib\cseries - + .YeloLib\effects - + .YeloLib\files - + .YeloLib\files - + .YeloLib\game - + .YeloLib\game - + .YeloLib\hs - + .YeloLib\hs - + .YeloLib\interface - + .YeloLib\items - + .YeloLib\items - + .YeloLib\memory - + .YeloLib\models - + .YeloLib\models - + .YeloLib\objects - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce - + .YeloLib\open_sauce\settings - + .YeloLib\open_sauce\settings - + .YeloLib\open_sauce\settings - + .YeloLib\rasterizer - + .YeloLib\rasterizer - + .YeloLib\render - + .YeloLib\render - + .YeloLib\render - + .YeloLib\saved_games - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shaders - + .YeloLib\shell - + .YeloLib\shell - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files\string_ids - + .YeloLib\units diff --git a/OpenSauce/shared/config/msbuild/YeloLib_Halo1_Editor.vcxproj.filters b/OpenSauce/shared/config/msbuild/YeloLib_Halo1_Editor.vcxproj.filters index f54adae66..adb134ee1 100644 --- a/OpenSauce/shared/config/msbuild/YeloLib_Halo1_Editor.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/YeloLib_Halo1_Editor.vcxproj.filters @@ -7,63 +7,63 @@ --> - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\cache - + .YeloLib\guerilla - + .YeloLib\guerilla - + .YeloLib\tag_files\string_ids - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files - + .YeloLib\tag_files diff --git a/OpenSauce/shared/config/msbuild/YeloLib_Halo2.props b/OpenSauce/shared/config/msbuild/YeloLib_Halo2.props deleted file mode 100644 index 536d1602f..000000000 --- a/OpenSauce/shared/config/msbuild/YeloLib_Halo2.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/YeloLib_Halo2.vcxproj.filters b/OpenSauce/shared/config/msbuild/YeloLib_Halo2.vcxproj.filters deleted file mode 100644 index f09b57c05..000000000 --- a/OpenSauce/shared/config/msbuild/YeloLib_Halo2.vcxproj.filters +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/blamlib.props b/OpenSauce/shared/config/msbuild/blamlib.props index 8317f0bb8..f2029234e 100644 --- a/OpenSauce/shared/config/msbuild/blamlib.props +++ b/OpenSauce/shared/config/msbuild/blamlib.props @@ -1,38 +1,38 @@ - + - + - - - - - + + + + + - - - + + + - + - + - - + + diff --git a/OpenSauce/shared/config/msbuild/blamlib.vcxproj.filters b/OpenSauce/shared/config/msbuild/blamlib.vcxproj.filters index 39e44aa87..9563b16ca 100644 --- a/OpenSauce/shared/config/msbuild/blamlib.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/blamlib.vcxproj.filters @@ -1,187 +1,70 @@ - - - - - + .blamlib\cache - + .blamlib\cseries - + .blamlib\math - + .blamlib\math - + .blamlib\math - + .blamlib\math - + .blamlib\math - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\scenario - + .blamlib\tag_files - + .blamlib\tag_files diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo1.props b/OpenSauce/shared/config/msbuild/blamlib_Halo1.props index 308f60dde..25ec94722 100644 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo1.props +++ b/OpenSauce/shared/config/msbuild/blamlib_Halo1.props @@ -1,381 +1,381 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - - - + + + - - - - - - - + + + + + + + - - - + + + - + - - + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - + + + + - + - + - - - - - - - + + + + + + + - - + + - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - + + + + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - + + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo1.vcxproj.filters b/OpenSauce/shared/config/msbuild/blamlib_Halo1.vcxproj.filters index 8bbbf29a4..5fcc892e2 100644 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo1.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/blamlib_Halo1.vcxproj.filters @@ -8,784 +8,784 @@ --> - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\ai - + .blamlib\bitmaps - + .blamlib\bungie_net\common - + .blamlib\bungie_net\network - + .blamlib\bungie_net\network - + .blamlib\bungie_net\network - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\camera - + .blamlib\cseries - + .blamlib\cseries - + .blamlib\cutscene - + .blamlib\cutscene - + .blamlib\cutscene - + .blamlib\cutscene - + .blamlib\cutscene - + .blamlib\devices - + .blamlib\devices - + .blamlib\devices - + .blamlib\devices - + .blamlib\devices - + .blamlib\devices - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\effects - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\game - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\hs - + .blamlib\input - + .blamlib\input - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\interface - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\items - + .blamlib\main - + .blamlib\main - + .blamlib\main - + .blamlib\main - + .blamlib\math - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\memory - + .blamlib\models - + .blamlib\models - + .blamlib\models - + .blamlib\models - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\networking - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects - + .blamlib\objects\widgets - + .blamlib\physics - + .blamlib\physics - + .blamlib\physics - + .blamlib\physics - + .blamlib\physics - + .blamlib\physics - + .blamlib\physics - + .blamlib\rasterizer - + .blamlib\rasterizer - + .blamlib\rasterizer\dx9 - + .blamlib\rasterizer\dx9 - + .blamlib\render - + .blamlib\render - + .blamlib\render - + .blamlib\render - + .blamlib\saved_games - + .blamlib\saved_games - + .blamlib\saved_games - + .blamlib\saved_games - + .blamlib\scenario - + .blamlib\scenario - + .blamlib\scenario - + .blamlib\scenario - + .blamlib\scenario - + .blamlib\shaders - + .blamlib\sound - + .blamlib\sound - + .blamlib\structures - + .blamlib\structures - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\text - + .blamlib\text - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units - + .blamlib\units diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo1_Editor.vcxproj.filters b/OpenSauce/shared/config/msbuild/blamlib_Halo1_Editor.vcxproj.filters index b694ce8c4..4ab6f5fdd 100644 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo1_Editor.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/blamlib_Halo1_Editor.vcxproj.filters @@ -7,103 +7,103 @@ --> - + .blamlib\cache - + .blamlib\cache - + .blamlib\cache - + .blamlib\cseries - + .blamlib\cseries - + .blamlib\cseries - + .blamlib\cseries - + .blamlib\guerilla - + .blamlib\guerilla - + .blamlib\hs - + .blamlib\memory - + .blamlib\memory - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tag_files - + .blamlib\tool diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo1_Game.vcxproj.filters b/OpenSauce/shared/config/msbuild/blamlib_Halo1_Game.vcxproj.filters index aa9162cd5..bfb098127 100644 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo1_Game.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/blamlib_Halo1_Game.vcxproj.filters @@ -7,35 +7,35 @@ --> - + .blamlib\effects - + .blamlib\interface - + .blamlib\main - + .blamlib\objects - + .blamlib\rasterizer\dx9 diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo2.props b/OpenSauce/shared/config/msbuild/blamlib_Halo2.props deleted file mode 100644 index c3ebaaf3d..000000000 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo2.props +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/blamlib_Halo2.vcxproj.filters b/OpenSauce/shared/config/msbuild/blamlib_Halo2.vcxproj.filters deleted file mode 100644 index 4820977b8..000000000 --- a/OpenSauce/shared/config/msbuild/blamlib_Halo2.vcxproj.filters +++ /dev/null @@ -1,66 +0,0 @@ - - - - - .blamlib\cache - - - .blamlib\cache - - - - - .blamlib\cseries - - - .blamlib\cseries - - - - - - - - - - - - - .blamlib\memory - - - - - - - .blamlib\shaders - - - - - .blamlib\sound - - - - - .blamlib\tag_files - - - - - .blamlib\tag_files - - - \ No newline at end of file diff --git a/OpenSauce/shared/config/msbuild/mongoose.props b/OpenSauce/shared/config/msbuild/mongoose.props index c8a963f20..f5349a2ae 100644 --- a/OpenSauce/shared/config/msbuild/mongoose.props +++ b/OpenSauce/shared/config/msbuild/mongoose.props @@ -1,8 +1,8 @@ - - + + 4090;%(DisableSpecificWarnings) diff --git a/OpenSauce/shared/config/msbuild/mongoose.vcxproj.filters b/OpenSauce/shared/config/msbuild/mongoose.vcxproj.filters index d97a2bc5d..29532519a 100644 --- a/OpenSauce/shared/config/msbuild/mongoose.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/mongoose.vcxproj.filters @@ -8,10 +8,10 @@ - + Common\Shared\mongoose - + Common\Shared\mongoose diff --git a/OpenSauce/shared/config/msbuild/zlib.props b/OpenSauce/shared/config/msbuild/zlib.props index dbf6e6248..a1a0a8821 100644 --- a/OpenSauce/shared/config/msbuild/zlib.props +++ b/OpenSauce/shared/config/msbuild/zlib.props @@ -1,85 +1,85 @@ - + - + - + - - + + - - + + - + - + - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + diff --git a/OpenSauce/shared/config/msbuild/zlib.vcxproj.filters b/OpenSauce/shared/config/msbuild/zlib.vcxproj.filters index edbe273f8..6a262f46f 100644 --- a/OpenSauce/shared/config/msbuild/zlib.vcxproj.filters +++ b/OpenSauce/shared/config/msbuild/zlib.vcxproj.filters @@ -1,118 +1,106 @@ - - - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib\contrib\minizip - + Common\Shared\zlib\contrib\minizip diff --git a/bin/_scripts/OpenSauce_Halo1_CE_BuildInstallers.bat b/scripts/OpenSauce_Halo1_CE_BuildInstallers.bat similarity index 100% rename from bin/_scripts/OpenSauce_Halo1_CE_BuildInstallers.bat rename to scripts/OpenSauce_Halo1_CE_BuildInstallers.bat diff --git a/bin/_scripts/PrereqChecks.bat b/scripts/PrereqChecks.bat similarity index 100% rename from bin/_scripts/PrereqChecks.bat rename to scripts/PrereqChecks.bat diff --git a/shared/config/msbuild/Common.Cpp.props b/shared/config/msbuild/Common.Cpp.props index 3090d659c..ca058dd7f 100644 --- a/shared/config/msbuild/Common.Cpp.props +++ b/shared/config/msbuild/Common.Cpp.props @@ -43,7 +43,7 @@ - $(ProjectDir);$(OSRootDir)shared\include_cpp\;%(AdditionalIncludeDirectories) + $(OSRootDir)source;$(ProjectDir);$(OSRootDir)shared\include_cpp\;$(OSRootDir)external_libraries;%(AdditionalIncludeDirectories) Default /J /Zc:trigraphs true diff --git a/shared/config/msbuild/OpenSauceUserConfigDefaults.props b/shared/config/msbuild/OpenSauceUserConfigDefaults.props index 1a33cc8ab..da8787ecf 100644 --- a/shared/config/msbuild/OpenSauceUserConfigDefaults.props +++ b/shared/config/msbuild/OpenSauceUserConfigDefaults.props @@ -6,8 +6,8 @@ $(XEDK)\lib\$(Platform)\$(LocalXenonLibBinVer)\ boost_1_65_1 $(OSRootDir)external_libraries\$(LocalUserBoostVer)\ - $(OSRootDir)OpenSauce\shared\Include\GameSpyOpen - $(OSRootDir)OpenSauce\shared\Include\RakNet + $(OSRootDir)external_libraries\GameSpyOpen + $(OSRootDir)external_libraries\RakNet diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/ai/ai_yelo.cpp b/source/YeloLib/ai/ai_yelo.cpp similarity index 88% rename from OpenSauce/shared/Include/YeloLib/Halo1/ai/ai_yelo.cpp rename to source/YeloLib/ai/ai_yelo.cpp index f6cb88806..1ce8fcb4f 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/ai/ai_yelo.cpp +++ b/source/YeloLib/ai/ai_yelo.cpp @@ -5,15 +5,15 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/ai/ai_yelo.hpp b/source/YeloLib/ai/ai_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/ai/ai_yelo.hpp rename to source/YeloLib/ai/ai_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.cpp b/source/YeloLib/ai/c_actor_variant_transform_manager.cpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.cpp rename to source/YeloLib/ai/c_actor_variant_transform_manager.cpp index 8701d7c12..b3471cad1 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.cpp +++ b/source/YeloLib/ai/c_actor_variant_transform_manager.cpp @@ -5,34 +5,34 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.hpp b/source/YeloLib/ai/c_actor_variant_transform_manager.hpp similarity index 97% rename from OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.hpp rename to source/YeloLib/ai/c_actor_variant_transform_manager.hpp index d0406f079..3768c0d55 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/ai/c_actor_variant_transform_manager.hpp +++ b/source/YeloLib/ai/c_actor_variant_transform_manager.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.cpp b/source/YeloLib/cache/cache_file_builder_yelo.cpp similarity index 89% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.cpp rename to source/YeloLib/cache/cache_file_builder_yelo.cpp index 1039fc184..707b98320 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.cpp +++ b/source/YeloLib/cache/cache_file_builder_yelo.cpp @@ -4,22 +4,22 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include // for predicated resources -#include // for predicated resources -#include // for predicated resources -#include // for predicated resources -#include -#include +#include +#include // for predicated resources +#include // for predicated resources +#include // for predicated resources +#include // for predicated resources +#include +#include #include #include -#include -#include // for cull tags -#include // for predicated resources -#include +#include +#include // for cull tags +#include // for predicated resources +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.hpp b/source/YeloLib/cache/cache_file_builder_yelo.hpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.hpp rename to source/YeloLib/cache/cache_file_builder_yelo.hpp index edcc04701..66d99237e 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_builder_yelo.hpp +++ b/source/YeloLib/cache/cache_file_builder_yelo.hpp @@ -6,7 +6,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.cpp b/source/YeloLib/cache/cache_file_memory.cpp similarity index 72% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.cpp rename to source/YeloLib/cache/cache_file_memory.cpp index 77ad79c74..6637c6bf9 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.cpp +++ b/source/YeloLib/cache/cache_file_memory.cpp @@ -4,12 +4,12 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include "YeloLib/Halo1/cache/cache_file_memory.hpp" +#include "YeloLib/cache/cache_file_memory.hpp" #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.hpp b/source/YeloLib/cache/cache_file_memory.hpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.hpp rename to source/YeloLib/cache/cache_file_memory.hpp index 3603da865..6783f3655 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory.hpp +++ b/source/YeloLib/cache/cache_file_memory.hpp @@ -6,7 +6,7 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_gestalt_definitions.hpp b/source/YeloLib/cache/cache_file_memory_gestalt_definitions.hpp similarity index 91% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_gestalt_definitions.hpp rename to source/YeloLib/cache/cache_file_memory_gestalt_definitions.hpp index e33adb384..aff03fe27 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_gestalt_definitions.hpp +++ b/source/YeloLib/cache/cache_file_memory_gestalt_definitions.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_layout_table_definitions.hpp b/source/YeloLib/cache/cache_file_memory_layout_table_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_layout_table_definitions.hpp rename to source/YeloLib/cache/cache_file_memory_layout_table_definitions.hpp index 185615bdb..427c191ba 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_file_memory_layout_table_definitions.hpp +++ b/source/YeloLib/cache/cache_file_memory_layout_table_definitions.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_structures_yelo.hpp b/source/YeloLib/cache/cache_files_structures_yelo.hpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_structures_yelo.hpp rename to source/YeloLib/cache/cache_files_structures_yelo.hpp index dbde20790..0ae74145d 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_structures_yelo.hpp +++ b/source/YeloLib/cache/cache_files_structures_yelo.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_yelo.cpp b/source/YeloLib/cache/cache_files_yelo.cpp similarity index 92% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_yelo.cpp rename to source/YeloLib/cache/cache_files_yelo.cpp index 0098f18d0..0a51228ef 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_yelo.cpp +++ b/source/YeloLib/cache/cache_files_yelo.cpp @@ -4,21 +4,21 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_yelo.hpp b/source/YeloLib/cache/cache_files_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/cache_files_yelo.hpp rename to source/YeloLib/cache/cache_files_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cache/cache_files_yelo_base.hpp b/source/YeloLib/cache/cache_files_yelo_base.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cache/cache_files_yelo_base.hpp rename to source/YeloLib/cache/cache_files_yelo_base.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.cpp b/source/YeloLib/cache/data_file_yelo.cpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.cpp rename to source/YeloLib/cache/data_file_yelo.cpp index 478a4959f..da20f259c 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.cpp +++ b/source/YeloLib/cache/data_file_yelo.cpp @@ -4,14 +4,14 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #include // _mkdir -#include +#include #include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.hpp b/source/YeloLib/cache/data_file_yelo.hpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.hpp rename to source/YeloLib/cache/data_file_yelo.hpp index 58e8d9237..db57132cf 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/data_file_yelo.hpp +++ b/source/YeloLib/cache/data_file_yelo.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_file_definitions.hpp b/source/YeloLib/cache/shared_cache_file_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_file_definitions.hpp rename to source/YeloLib/cache/shared_cache_file_definitions.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_files.cpp b/source/YeloLib/cache/shared_cache_files.cpp similarity index 67% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_files.cpp rename to source/YeloLib/cache/shared_cache_files.cpp index 87de633cd..77ea065d9 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_files.cpp +++ b/source/YeloLib/cache/shared_cache_files.cpp @@ -4,4 +4,4 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_files.hpp b/source/YeloLib/cache/shared_cache_files.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/cache/shared_cache_files.hpp rename to source/YeloLib/cache/shared_cache_files.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container.cpp b/source/YeloLib/configuration/c_configuration_container.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container.cpp rename to source/YeloLib/configuration/c_configuration_container.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container.hpp b/source/YeloLib/configuration/c_configuration_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container.hpp rename to source/YeloLib/configuration/c_configuration_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container_list.hpp b/source/YeloLib/configuration/c_configuration_container_list.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_container_list.hpp rename to source/YeloLib/configuration/c_configuration_container_list.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_file_factory.cpp b/source/YeloLib/configuration/c_configuration_file_factory.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_file_factory.cpp rename to source/YeloLib/configuration/c_configuration_file_factory.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_file_factory.hpp b/source/YeloLib/configuration/c_configuration_file_factory.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_file_factory.hpp rename to source/YeloLib/configuration/c_configuration_file_factory.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_list.hpp b/source/YeloLib/configuration/c_configuration_list.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_list.hpp rename to source/YeloLib/configuration/c_configuration_list.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_singleton.hpp b/source/YeloLib/configuration/c_configuration_singleton.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_singleton.hpp rename to source/YeloLib/configuration/c_configuration_singleton.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_value.hpp b/source/YeloLib/configuration/c_configuration_value.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_value.hpp rename to source/YeloLib/configuration/c_configuration_value.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/c_configuration_value_list.hpp b/source/YeloLib/configuration/c_configuration_value_list.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/c_configuration_value_list.hpp rename to source/YeloLib/configuration/c_configuration_value_list.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/i_configuration_container.hpp b/source/YeloLib/configuration/i_configuration_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/i_configuration_container.hpp rename to source/YeloLib/configuration/i_configuration_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/i_configuration_file.hpp b/source/YeloLib/configuration/i_configuration_file.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/i_configuration_file.hpp rename to source/YeloLib/configuration/i_configuration_file.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/i_configuration_leaf.hpp b/source/YeloLib/configuration/i_configuration_leaf.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/i_configuration_leaf.hpp rename to source/YeloLib/configuration/i_configuration_leaf.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/i_configuration_leaf_iterator.hpp b/source/YeloLib/configuration/i_configuration_leaf_iterator.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/i_configuration_leaf_iterator.hpp rename to source/YeloLib/configuration/i_configuration_leaf_iterator.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/i_configuration_value.hpp b/source/YeloLib/configuration/i_configuration_value.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/i_configuration_value.hpp rename to source/YeloLib/configuration/i_configuration_value.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_file.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_file.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_json.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_file_json.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_json.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file_json.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_json.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_file_json.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_json.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file_json.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_xml.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_file_xml.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_xml.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file_xml.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_xml.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_file_xml.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_file_xml.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_file_xml.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_leaf.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_leaf.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_leaf.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_leaf.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_leaf_iterator.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_json.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory_json.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_json.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory_json.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_json.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory_json.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_json.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory_json.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_xml.cpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory_xml.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_xml.cpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory_xml.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_xml.hpp b/source/YeloLib/configuration/property_tree/c_property_tree_memory_xml.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/c_property_tree_memory_xml.hpp rename to source/YeloLib/configuration/property_tree/c_property_tree_memory_xml.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/property_tree_logging.cpp b/source/YeloLib/configuration/property_tree/property_tree_logging.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/property_tree_logging.cpp rename to source/YeloLib/configuration/property_tree/property_tree_logging.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/property_tree/property_tree_logging.hpp b/source/YeloLib/configuration/property_tree/property_tree_logging.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/property_tree/property_tree_logging.hpp rename to source/YeloLib/configuration/property_tree/property_tree_logging.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_point2d_container.cpp b/source/YeloLib/configuration/type_containers/c_point2d_container.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_point2d_container.cpp rename to source/YeloLib/configuration/type_containers/c_point2d_container.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_point2d_container.hpp b/source/YeloLib/configuration/type_containers/c_point2d_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_point2d_container.hpp rename to source/YeloLib/configuration/type_containers/c_point2d_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_bounds_container.cpp b/source/YeloLib/configuration/type_containers/c_real_bounds_container.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_bounds_container.cpp rename to source/YeloLib/configuration/type_containers/c_real_bounds_container.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_bounds_container.hpp b/source/YeloLib/configuration/type_containers/c_real_bounds_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_bounds_container.hpp rename to source/YeloLib/configuration/type_containers/c_real_bounds_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_point2d_container.cpp b/source/YeloLib/configuration/type_containers/c_real_point2d_container.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_point2d_container.cpp rename to source/YeloLib/configuration/type_containers/c_real_point2d_container.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_point2d_container.hpp b/source/YeloLib/configuration/type_containers/c_real_point2d_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_point2d_container.hpp rename to source/YeloLib/configuration/type_containers/c_real_point2d_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_vector3d_container.cpp b/source/YeloLib/configuration/type_containers/c_real_vector3d_container.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_vector3d_container.cpp rename to source/YeloLib/configuration/type_containers/c_real_vector3d_container.cpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_vector3d_container.hpp b/source/YeloLib/configuration/type_containers/c_real_vector3d_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_real_vector3d_container.hpp rename to source/YeloLib/configuration/type_containers/c_real_vector3d_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_type_container.hpp b/source/YeloLib/configuration/type_containers/c_type_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/configuration/type_containers/c_type_container.hpp rename to source/YeloLib/configuration/type_containers/c_type_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cryptography/TEA.cpp b/source/YeloLib/cryptography/TEA.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cryptography/TEA.cpp rename to source/YeloLib/cryptography/TEA.cpp diff --git a/OpenSauce/shared/Include/YeloLib/cryptography/TEA.hpp b/source/YeloLib/cryptography/TEA.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cryptography/TEA.hpp rename to source/YeloLib/cryptography/TEA.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cseries/cseries_yelo.cpp b/source/YeloLib/cseries/cseries_yelo.cpp similarity index 82% rename from OpenSauce/shared/Include/YeloLib/Halo1/cseries/cseries_yelo.cpp rename to source/YeloLib/cseries/cseries_yelo.cpp index 5ea7e8e7f..e5e0868a9 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cseries/cseries_yelo.cpp +++ b/source/YeloLib/cseries/cseries_yelo.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cseries/cseries_yelo.hpp b/source/YeloLib/cseries/cseries_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/cseries/cseries_yelo.hpp rename to source/YeloLib/cseries/cseries_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/cseries_yelo_base.cpp b/source/YeloLib/cseries/cseries_yelo_base.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/cseries/cseries_yelo_base.cpp rename to source/YeloLib/cseries/cseries_yelo_base.cpp index e774390c9..bffd1b958 100644 --- a/OpenSauce/shared/Include/YeloLib/cseries/cseries_yelo_base.cpp +++ b/source/YeloLib/cseries/cseries_yelo_base.cpp @@ -6,7 +6,7 @@ #include "Common/Precompile.hpp" #include -#include +#include #if PLATFORM_TARGET != PLATFORM_TARGET_XBOX #include diff --git a/OpenSauce/shared/Include/YeloLib/cseries/cseries_yelo_base.hpp b/source/YeloLib/cseries/cseries_yelo_base.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/cseries_yelo_base.hpp rename to source/YeloLib/cseries/cseries_yelo_base.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/debug_memory_yelo.cpp b/source/YeloLib/cseries/debug_memory_yelo.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/debug_memory_yelo.cpp rename to source/YeloLib/cseries/debug_memory_yelo.cpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/debug_memory_yelo.hpp b/source/YeloLib/cseries/debug_memory_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/debug_memory_yelo.hpp rename to source/YeloLib/cseries/debug_memory_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/enum_wrappers.hpp b/source/YeloLib/cseries/enum_wrappers.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/enum_wrappers.hpp rename to source/YeloLib/cseries/enum_wrappers.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/errors_yelo.cpp b/source/YeloLib/cseries/errors_yelo.cpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/cseries/errors_yelo.cpp rename to source/YeloLib/cseries/errors_yelo.cpp index fc6dd7c92..bd4d2bde3 100644 --- a/OpenSauce/shared/Include/YeloLib/cseries/errors_yelo.cpp +++ b/source/YeloLib/cseries/errors_yelo.cpp @@ -7,7 +7,7 @@ #include #if PLATFORM_IS_EDITOR || defined(API_DEBUG) -#include +#include namespace Yelo { @@ -90,7 +90,7 @@ namespace Yelo #endif #if !PLATFORM_IS_EDITOR -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/cseries/errors_yelo.hpp b/source/YeloLib/cseries/errors_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/errors_yelo.hpp rename to source/YeloLib/cseries/errors_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/handle_abi.hpp b/source/YeloLib/cseries/handle_abi.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/handle_abi.hpp rename to source/YeloLib/cseries/handle_abi.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/cseries/memory_yelo.hpp b/source/YeloLib/cseries/memory_yelo.hpp similarity index 96% rename from OpenSauce/shared/Include/YeloLib/Halo1/cseries/memory_yelo.hpp rename to source/YeloLib/cseries/memory_yelo.hpp index 22b55883a..bd1cdab0c 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/cseries/memory_yelo.hpp +++ b/source/YeloLib/cseries/memory_yelo.hpp @@ -11,7 +11,7 @@ // BLAM_* variants directly use the engine's normal C memory functions for the target platform, sans any special ops (eg, auto-nulling) #if PLATFORM_IS_EDITOR - #include + #include #define YELO_MALLOC(size, fill_with_garbage) Yelo::blam::debug_malloc( (size), fill_with_garbage, __FILE__, __LINE__) #define YELO_NEW_ARRAY(type, count) Yelo::blam::debug_new_array( (count), false, __FILE__, __LINE__) diff --git a/OpenSauce/shared/Include/YeloLib/cseries/non_pod_container.hpp b/source/YeloLib/cseries/non_pod_container.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/non_pod_container.hpp rename to source/YeloLib/cseries/non_pod_container.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/pc_crashreport.cpp b/source/YeloLib/cseries/pc_crashreport.cpp similarity index 97% rename from OpenSauce/shared/Include/YeloLib/cseries/pc_crashreport.cpp rename to source/YeloLib/cseries/pc_crashreport.cpp index 2b9d95492..b74504dbf 100644 --- a/OpenSauce/shared/Include/YeloLib/cseries/pc_crashreport.cpp +++ b/source/YeloLib/cseries/pc_crashreport.cpp @@ -14,7 +14,7 @@ #pragma comment (lib, "../../shared/lib/x86/CrashRpt1401.lib") // TODO: setup proper shared lib directories in vcxproj #include -#include +#include //#define TEST_CRASH_REPORT diff --git a/OpenSauce/shared/Include/YeloLib/cseries/pc_crashreport.hpp b/source/YeloLib/cseries/pc_crashreport.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/pc_crashreport.hpp rename to source/YeloLib/cseries/pc_crashreport.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/random.cpp b/source/YeloLib/cseries/random.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/random.cpp rename to source/YeloLib/cseries/random.cpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/random.hpp b/source/YeloLib/cseries/random.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/random.hpp rename to source/YeloLib/cseries/random.hpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/value_conversion.cpp b/source/YeloLib/cseries/value_conversion.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/value_conversion.cpp rename to source/YeloLib/cseries/value_conversion.cpp diff --git a/OpenSauce/shared/Include/YeloLib/cseries/value_conversion.hpp b/source/YeloLib/cseries/value_conversion.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/cseries/value_conversion.hpp rename to source/YeloLib/cseries/value_conversion.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/effects/effects_constants_yelo.hpp b/source/YeloLib/effects/effects_constants_yelo.hpp similarity index 87% rename from OpenSauce/shared/Include/YeloLib/Halo1/effects/effects_constants_yelo.hpp rename to source/YeloLib/effects/effects_constants_yelo.hpp index a72d29fc6..462c0403c 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/effects/effects_constants_yelo.hpp +++ b/source/YeloLib/effects/effects_constants_yelo.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/files/files.cpp b/source/YeloLib/files/files.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/files/files.cpp rename to source/YeloLib/files/files.cpp diff --git a/OpenSauce/shared/Include/YeloLib/files/files.hpp b/source/YeloLib/files/files.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/files/files.hpp rename to source/YeloLib/files/files.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/files/packed_file.cpp b/source/YeloLib/files/packed_file.cpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/files/packed_file.cpp rename to source/YeloLib/files/packed_file.cpp index a66032869..ecf2fb51f 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/files/packed_file.cpp +++ b/source/YeloLib/files/packed_file.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if !PLATFORM_IS_EDITOR #include // for OpenFileByID forward declaration #else #include - #include + #include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/files/packed_file.hpp b/source/YeloLib/files/packed_file.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/files/packed_file.hpp rename to source/YeloLib/files/packed_file.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/game/game_engine_yelo.hpp b/source/YeloLib/game/game_engine_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/game/game_engine_yelo.hpp rename to source/YeloLib/game/game_engine_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/game/game_results_yelo.hpp b/source/YeloLib/game/game_results_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/game/game_results_yelo.hpp rename to source/YeloLib/game/game_results_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/guerilla/mfc_interfaces.cpp b/source/YeloLib/guerilla/mfc_interfaces.cpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/guerilla/mfc_interfaces.cpp rename to source/YeloLib/guerilla/mfc_interfaces.cpp index 8140b7236..bee13d3f6 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/guerilla/mfc_interfaces.cpp +++ b/source/YeloLib/guerilla/mfc_interfaces.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CheApe for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_TYPE == PLATFORM_GUERILLA namespace Yelo diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/guerilla/mfc_interfaces.hpp b/source/YeloLib/guerilla/mfc_interfaces.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/guerilla/mfc_interfaces.hpp rename to source/YeloLib/guerilla/mfc_interfaces.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_library_definitions_yelo.cpp b/source/YeloLib/hs/hs_library_definitions_yelo.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_library_definitions_yelo.cpp rename to source/YeloLib/hs/hs_library_definitions_yelo.cpp index 452ece188..4a043993d 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_library_definitions_yelo.cpp +++ b/source/YeloLib/hs/hs_library_definitions_yelo.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_library_definitions_yelo.hpp b/source/YeloLib/hs/hs_library_definitions_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_library_definitions_yelo.hpp rename to source/YeloLib/hs/hs_library_definitions_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.cpp b/source/YeloLib/hs/hs_yelo.cpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.cpp rename to source/YeloLib/hs/hs_yelo.cpp index dfc22e872..03d804472 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.cpp +++ b/source/YeloLib/hs/hs_yelo.cpp @@ -4,10 +4,10 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.hpp b/source/YeloLib/hs/hs_yelo.hpp similarity index 96% rename from OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.hpp rename to source/YeloLib/hs/hs_yelo.hpp index 900bb8870..10e126173 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/hs/hs_yelo.hpp +++ b/source/YeloLib/hs/hs_yelo.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/interface/equipment_hud_interface_definition.hpp b/source/YeloLib/interface/equipment_hud_interface_definition.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/interface/equipment_hud_interface_definition.hpp rename to source/YeloLib/interface/equipment_hud_interface_definition.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/items/equipment_definitions_yelo.hpp b/source/YeloLib/items/equipment_definitions_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/items/equipment_definitions_yelo.hpp rename to source/YeloLib/items/equipment_definitions_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/items/equipment_structures_yelo.hpp b/source/YeloLib/items/equipment_structures_yelo.hpp similarity index 69% rename from OpenSauce/shared/Include/YeloLib/Halo1/items/equipment_structures_yelo.hpp rename to source/YeloLib/items/equipment_structures_yelo.hpp index bfaedf13a..a39156342 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/items/equipment_structures_yelo.hpp +++ b/source/YeloLib/items/equipment_structures_yelo.hpp @@ -5,10 +5,10 @@ */ #pragma once -#include -#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/main/main_yelo_base.hpp b/source/YeloLib/main/main_yelo_base.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/main/main_yelo_base.hpp rename to source/YeloLib/main/main_yelo_base.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/array_yelo.hpp b/source/YeloLib/memory/array_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/array_yelo.hpp rename to source/YeloLib/memory/array_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/compression/7zip_codec.cpp b/source/YeloLib/memory/compression/7zip_codec.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/compression/7zip_codec.cpp rename to source/YeloLib/memory/compression/7zip_codec.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/compression/7zip_codec.hpp b/source/YeloLib/memory/compression/7zip_codec.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/compression/7zip_codec.hpp rename to source/YeloLib/memory/compression/7zip_codec.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/compression/zip_codec.cpp b/source/YeloLib/memory/compression/zip_codec.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/compression/zip_codec.cpp rename to source/YeloLib/memory/compression/zip_codec.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/compression/zip_codec.hpp b/source/YeloLib/memory/compression/zip_codec.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/compression/zip_codec.hpp rename to source/YeloLib/memory/compression/zip_codec.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/memory/constant_pool.hpp b/source/YeloLib/memory/constant_pool.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/memory/constant_pool.hpp rename to source/YeloLib/memory/constant_pool.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/memory/data_yelo.hpp b/source/YeloLib/memory/data_yelo.hpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/memory/data_yelo.hpp rename to source/YeloLib/memory/data_yelo.hpp index 9419cb0d2..6eb303807 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/memory/data_yelo.hpp +++ b/source/YeloLib/memory/data_yelo.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/memory/function_interface.cpp b/source/YeloLib/memory/function_interface.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/function_interface.cpp rename to source/YeloLib/memory/function_interface.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/function_interface.hpp b/source/YeloLib/memory/function_interface.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/function_interface.hpp rename to source/YeloLib/memory/function_interface.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/function_interface.inl b/source/YeloLib/memory/function_interface.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/function_interface.inl rename to source/YeloLib/memory/function_interface.inl diff --git a/OpenSauce/shared/Include/YeloLib/memory/function_interface_macros.inl b/source/YeloLib/memory/function_interface_macros.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/function_interface_macros.inl rename to source/YeloLib/memory/function_interface_macros.inl diff --git a/OpenSauce/shared/Include/YeloLib/memory/function_interface_test.inl b/source/YeloLib/memory/function_interface_test.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/function_interface_test.inl rename to source/YeloLib/memory/function_interface_test.inl diff --git a/OpenSauce/shared/Include/YeloLib/memory/linked_list.cpp b/source/YeloLib/memory/linked_list.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/linked_list.cpp rename to source/YeloLib/memory/linked_list.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/linked_list.hpp b/source/YeloLib/memory/linked_list.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/linked_list.hpp rename to source/YeloLib/memory/linked_list.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/memory_interface_base.cpp b/source/YeloLib/memory/memory_interface_base.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/memory_interface_base.cpp rename to source/YeloLib/memory/memory_interface_base.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/memory_interface_base.hpp b/source/YeloLib/memory/memory_interface_base.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/memory_interface_base.hpp rename to source/YeloLib/memory/memory_interface_base.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/naked_func_writer.hpp b/source/YeloLib/memory/naked_func_writer.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/naked_func_writer.hpp rename to source/YeloLib/memory/naked_func_writer.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/physical_memory_allocation.cpp b/source/YeloLib/memory/physical_memory_allocation.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/physical_memory_allocation.cpp rename to source/YeloLib/memory/physical_memory_allocation.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/physical_memory_allocation.hpp b/source/YeloLib/memory/physical_memory_allocation.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/physical_memory_allocation.hpp rename to source/YeloLib/memory/physical_memory_allocation.hpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/security/xxtea.cpp b/source/YeloLib/memory/security/xxtea.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/security/xxtea.cpp rename to source/YeloLib/memory/security/xxtea.cpp diff --git a/OpenSauce/shared/Include/YeloLib/memory/security/xxtea.hpp b/source/YeloLib/memory/security/xxtea.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/memory/security/xxtea.hpp rename to source/YeloLib/memory/security/xxtea.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.cpp b/source/YeloLib/models/model_animation_definitions_yelo.cpp similarity index 86% rename from OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.cpp rename to source/YeloLib/models/model_animation_definitions_yelo.cpp index aa4db10a9..e4ec75fd0 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.cpp +++ b/source/YeloLib/models/model_animation_definitions_yelo.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.hpp b/source/YeloLib/models/model_animation_definitions_yelo.hpp similarity index 86% rename from OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.hpp rename to source/YeloLib/models/model_animation_definitions_yelo.hpp index 74909118f..21466b509 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/models/model_animation_definitions_yelo.hpp +++ b/source/YeloLib/models/model_animation_definitions_yelo.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/objects/object_damage_upgrades.inl b/source/YeloLib/objects/object_damage_upgrades.inl similarity index 92% rename from OpenSauce/shared/Include/YeloLib/Halo1/objects/object_damage_upgrades.inl rename to source/YeloLib/objects/object_damage_upgrades.inl index d3a12cc2a..fdd70172f 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/objects/object_damage_upgrades.inl +++ b/source/YeloLib/objects/object_damage_upgrades.inl @@ -5,8 +5,8 @@ See license\OpenSauce\Halo1_CE for specific license information */ -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.cpp b/source/YeloLib/objects/objects_yelo.cpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.cpp rename to source/YeloLib/objects/objects_yelo.cpp index 228b5e9a7..ea452d5f2 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.cpp +++ b/source/YeloLib/objects/objects_yelo.cpp @@ -5,12 +5,12 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.hpp b/source/YeloLib/objects/objects_yelo.hpp similarity index 97% rename from OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.hpp rename to source/YeloLib/objects/objects_yelo.hpp index d1d6e8b2d..9313daee3 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/objects/objects_yelo.hpp +++ b/source/YeloLib/objects/objects_yelo.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/blam_memory_upgrades.hpp b/source/YeloLib/open_sauce/blam_memory_upgrades.hpp similarity index 88% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/blam_memory_upgrades.hpp rename to source/YeloLib/open_sauce/blam_memory_upgrades.hpp index caf9e68e1..99e1d24ca 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/blam_memory_upgrades.hpp +++ b/source/YeloLib/open_sauce/blam_memory_upgrades.hpp @@ -5,17 +5,17 @@ */ #pragma once -#include -#include -#include // for k_maximum_network_machine_count -#include -#include +#include +#include +#include // for k_maximum_network_machine_count +#include +#include -#include -#include +#include +#include -#include -#include +#include +#include // How much more memory we're adding. // 50% diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.cpp b/source/YeloLib/open_sauce/che_ape/che_ape_api.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.cpp rename to source/YeloLib/open_sauce/che_ape/che_ape_api.cpp diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.hpp b/source/YeloLib/open_sauce/che_ape/che_ape_api.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.hpp rename to source/YeloLib/open_sauce/che_ape/che_ape_api.hpp diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.inl b/source/YeloLib/open_sauce/che_ape/che_ape_api.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/che_ape/che_ape_api.inl rename to source/YeloLib/open_sauce/che_ape/che_ape_api.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.cpp b/source/YeloLib/open_sauce/project_yellow_global_definitions.cpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.cpp rename to source/YeloLib/open_sauce/project_yellow_global_definitions.cpp index 382cbd8d0..0360bff25 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.cpp +++ b/source/YeloLib/open_sauce/project_yellow_global_definitions.cpp @@ -5,11 +5,11 @@ */ #include "Common/Precompile.hpp" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.hpp b/source/YeloLib/open_sauce/project_yellow_global_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.hpp rename to source/YeloLib/open_sauce/project_yellow_global_definitions.hpp index 8e9ccd995..6f9cdb6e1 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_global_definitions.hpp +++ b/source/YeloLib/open_sauce/project_yellow_global_definitions.hpp @@ -7,10 +7,10 @@ #pragma once #include -#include +#include #if PLATFORM_IS_EDITOR -#include +#include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario.cpp b/source/YeloLib/open_sauce/project_yellow_scenario.cpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario.cpp rename to source/YeloLib/open_sauce/project_yellow_scenario.cpp index 87cb5dcd7..3311c393f 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario.cpp +++ b/source/YeloLib/open_sauce/project_yellow_scenario.cpp @@ -4,17 +4,17 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario.hpp b/source/YeloLib/open_sauce/project_yellow_scenario.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario.hpp rename to source/YeloLib/open_sauce/project_yellow_scenario.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario_definitions.cpp b/source/YeloLib/open_sauce/project_yellow_scenario_definitions.cpp similarity index 88% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario_definitions.cpp rename to source/YeloLib/open_sauce/project_yellow_scenario_definitions.cpp index eeaea5a3f..477b60860 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario_definitions.cpp +++ b/source/YeloLib/open_sauce/project_yellow_scenario_definitions.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario_definitions.hpp b/source/YeloLib/open_sauce/project_yellow_scenario_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/project_yellow_scenario_definitions.hpp rename to source/YeloLib/open_sauce/project_yellow_scenario_definitions.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.cpp b/source/YeloLib/open_sauce/settings/c_settings_cheape.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.cpp rename to source/YeloLib/open_sauce/settings/c_settings_cheape.cpp index 1074f1682..0eaf9a46b 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.cpp +++ b/source/YeloLib/open_sauce/settings/c_settings_cheape.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CheApe for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_IS_EDITOR diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.hpp b/source/YeloLib/open_sauce/settings/c_settings_cheape.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.hpp rename to source/YeloLib/open_sauce/settings/c_settings_cheape.hpp index 6e3dcdfe9..ddebff8d6 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/c_settings_cheape.hpp +++ b/source/YeloLib/open_sauce/settings/c_settings_cheape.hpp @@ -8,15 +8,15 @@ #if PLATFORM_IS_EDITOR -#include -#include +#include +#include #include #include #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_manager.cpp b/source/YeloLib/open_sauce/settings/c_settings_manager.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_manager.cpp rename to source/YeloLib/open_sauce/settings/c_settings_manager.cpp diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_manager.hpp b/source/YeloLib/open_sauce/settings/c_settings_manager.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_manager.hpp rename to source/YeloLib/open_sauce/settings/c_settings_manager.hpp diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_singleton.hpp b/source/YeloLib/open_sauce/settings/c_settings_singleton.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/settings/c_settings_singleton.hpp rename to source/YeloLib/open_sauce/settings/c_settings_singleton.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_settings_definitions.hpp b/source/YeloLib/open_sauce/settings/yelo_settings_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_settings_definitions.hpp rename to source/YeloLib/open_sauce/settings/yelo_settings_definitions.hpp index 3b994ac14..5ace062b8 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_settings_definitions.hpp +++ b/source/YeloLib/open_sauce/settings/yelo_settings_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.cpp b/source/YeloLib/open_sauce/settings/yelo_shared_settings.cpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.cpp rename to source/YeloLib/open_sauce/settings/yelo_shared_settings.cpp index 92330dc50..18dac21b6 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.cpp +++ b/source/YeloLib/open_sauce/settings/yelo_shared_settings.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.hpp b/source/YeloLib/open_sauce/settings/yelo_shared_settings.hpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.hpp rename to source/YeloLib/open_sauce/settings/yelo_shared_settings.hpp index 3b5a56fce..f8565cc6b 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/settings/yelo_shared_settings.hpp +++ b/source/YeloLib/open_sauce/settings/yelo_shared_settings.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include #include diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/settings/yelo_shared_settings_base.cpp b/source/YeloLib/open_sauce/settings/yelo_shared_settings_base.cpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/settings/yelo_shared_settings_base.cpp rename to source/YeloLib/open_sauce/settings/yelo_shared_settings_base.cpp diff --git a/OpenSauce/shared/Include/YeloLib/open_sauce/settings/yelo_shared_settings_base.hpp b/source/YeloLib/open_sauce/settings/yelo_shared_settings_base.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/open_sauce/settings/yelo_shared_settings_base.hpp rename to source/YeloLib/open_sauce/settings/yelo_shared_settings_base.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/yelo_version.hpp b/source/YeloLib/open_sauce/yelo_version.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/open_sauce/yelo_version.hpp rename to source/YeloLib/open_sauce/yelo_version.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/rasterizer/rasterizer.hpp b/source/YeloLib/rasterizer/rasterizer.hpp similarity index 61% rename from OpenSauce/shared/Include/YeloLib/Halo1/rasterizer/rasterizer.hpp rename to source/YeloLib/rasterizer/rasterizer.hpp index 86ad8da6a..5857f8693 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/rasterizer/rasterizer.hpp +++ b/source/YeloLib/rasterizer/rasterizer.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/rasterizer/rasterizer_upgrades.inl b/source/YeloLib/rasterizer/rasterizer_upgrades.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/rasterizer/rasterizer_upgrades.inl rename to source/YeloLib/rasterizer/rasterizer_upgrades.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.cpp b/source/YeloLib/render/lightmaps/c_lightmap_manager.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.cpp rename to source/YeloLib/render/lightmaps/c_lightmap_manager.cpp index cf3aaf39e..d24d72bba 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.cpp +++ b/source/YeloLib/render/lightmaps/c_lightmap_manager.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.hpp b/source/YeloLib/render/lightmaps/c_lightmap_manager.hpp similarity index 87% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.hpp rename to source/YeloLib/render/lightmaps/c_lightmap_manager.hpp index e9a510172..fc254a858 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/render/lightmaps/c_lightmap_manager.hpp +++ b/source/YeloLib/render/lightmaps/c_lightmap_manager.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/render_constants_yelo.hpp b/source/YeloLib/render/render_constants_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/render_constants_yelo.hpp rename to source/YeloLib/render/render_constants_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/render_objects_upgrades.inl b/source/YeloLib/render/render_objects_upgrades.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/render_objects_upgrades.inl rename to source/YeloLib/render/render_objects_upgrades.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/render_particles_upgrades.inl b/source/YeloLib/render/render_particles_upgrades.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/render_particles_upgrades.inl rename to source/YeloLib/render/render_particles_upgrades.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.cpp b/source/YeloLib/render/sky/c_sky_manager.cpp similarity index 96% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.cpp rename to source/YeloLib/render/sky/c_sky_manager.cpp index 6847e2744..6b4e03f7f 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.cpp +++ b/source/YeloLib/render/sky/c_sky_manager.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.hpp b/source/YeloLib/render/sky/c_sky_manager.hpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.hpp rename to source/YeloLib/render/sky/c_sky_manager.hpp index 97688e20d..ae1c6d43a 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/render/sky/c_sky_manager.hpp +++ b/source/YeloLib/render/sky/c_sky_manager.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/saved_games/game_state_yelo.hpp b/source/YeloLib/saved_games/game_state_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/saved_games/game_state_yelo.hpp rename to source/YeloLib/saved_games/game_state_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_collection_definitions.hpp b/source/YeloLib/shaders/effect_postprocess_collection_definitions.hpp similarity index 91% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_collection_definitions.hpp rename to source/YeloLib/shaders/effect_postprocess_collection_definitions.hpp index 8929c09eb..c26935d85 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_collection_definitions.hpp +++ b/source/YeloLib/shaders/effect_postprocess_collection_definitions.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_generic_definitions.hpp b/source/YeloLib/shaders/effect_postprocess_generic_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_generic_definitions.hpp rename to source/YeloLib/shaders/effect_postprocess_generic_definitions.hpp index 5c75a8932..4c0385bed 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/effect_postprocess_generic_definitions.hpp +++ b/source/YeloLib/shaders/effect_postprocess_generic_definitions.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.cpp b/source/YeloLib/shaders/shader_postprocess_definitions.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.cpp rename to source/YeloLib/shaders/shader_postprocess_definitions.cpp index fa6b0614b..b78c27c20 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.cpp +++ b/source/YeloLib/shaders/shader_postprocess_definitions.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.hpp b/source/YeloLib/shaders/shader_postprocess_definitions.hpp similarity index 91% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.hpp rename to source/YeloLib/shaders/shader_postprocess_definitions.hpp index ddecad7db..9b6e93267 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_definitions.hpp +++ b/source/YeloLib/shaders/shader_postprocess_definitions.hpp @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include #include namespace Yelo @@ -220,9 +220,9 @@ namespace Yelo }; }; -#include +#include -#include -#include -#include -#include \ No newline at end of file +#include +#include +#include +#include \ No newline at end of file diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_generic_definitions.hpp b/source/YeloLib/shaders/shader_postprocess_generic_definitions.hpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_generic_definitions.hpp rename to source/YeloLib/shaders/shader_postprocess_generic_definitions.hpp index ebdb4b3c4..d031696b3 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_generic_definitions.hpp +++ b/source/YeloLib/shaders/shader_postprocess_generic_definitions.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_globals_definitions.hpp b/source/YeloLib/shaders/shader_postprocess_globals_definitions.hpp similarity index 90% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_globals_definitions.hpp rename to source/YeloLib/shaders/shader_postprocess_globals_definitions.hpp index adad3d7f9..4dbccb4f8 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_globals_definitions.hpp +++ b/source/YeloLib/shaders/shader_postprocess_globals_definitions.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_runtime.inl b/source/YeloLib/shaders/shader_postprocess_runtime.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/shaders/shader_postprocess_runtime.inl rename to source/YeloLib/shaders/shader_postprocess_runtime.inl diff --git a/OpenSauce/shared/Include/YeloLib/shell/platform_yelo.hpp b/source/YeloLib/shell/platform_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/shell/platform_yelo.hpp rename to source/YeloLib/shell/platform_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.cpp b/source/YeloLib/shell/shell_windows_command_line.cpp similarity index 84% rename from OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.cpp rename to source/YeloLib/shell/shell_windows_command_line.cpp index 288a99dad..c810ecc21 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.cpp +++ b/source/YeloLib/shell/shell_windows_command_line.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include #define CMDLINE_ARG(name, type) c_cmd_line_argument CMDLINE_PARAM_NAME(name) #define CMDLINE_SWITCH(name) c_cmd_line_switch CMDLINE_PARAM_NAME(name) @@ -21,13 +21,13 @@ namespace Yelo // Actually define the params here #define CMDLINE_DEFINE_ARG(name, type) CMDLINE_ARG(name, type); #define CMDLINE_DEFINE_SWITCH(name) CMDLINE_SWITCH(name); -#include +#include static c_cmd_line_parameter* g_cmd_line_params[] = { #define CMDLINE_DEFINE_ARG(name, type) &CMDLINE_GET_PARAM(name), #define CMDLINE_DEFINE_SWITCH(name) &CMDLINE_GET_PARAM(name), -#include +#include nullptr }; @@ -37,7 +37,7 @@ namespace Yelo { #define CMDLINE_DEFINE_ARG(name, type) CMDLINE_INIT_PARAM(name, BOOST_PP_CAT("-", #name)); #define CMDLINE_DEFINE_SWITCH(name) CMDLINE_INIT_PARAM(name, BOOST_PP_CAT("-", #name)); -#include +#include // we don't use ranged for here because the last entry is NULL and we'd then have to check for null for(size_t i = 0; i < NUMBEROF(g_cmd_line_params)-1; i++) diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.hpp b/source/YeloLib/shell/shell_windows_command_line.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.hpp rename to source/YeloLib/shell/shell_windows_command_line.hpp index 42c550b59..6a3f50e6a 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.hpp +++ b/source/YeloLib/shell/shell_windows_command_line.hpp @@ -140,7 +140,7 @@ namespace Yelo // Declare the params here #define CMDLINE_DEFINE_ARG(name, type) extern c_cmd_line_argument<##type##> CMDLINE_PARAM_NAME(name); #define CMDLINE_DEFINE_SWITCH(name) extern c_cmd_line_switch CMDLINE_PARAM_NAME(name); -#include +#include void ReadCmdLineSettings(); }; diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.inl b/source/YeloLib/shell/shell_windows_command_line.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/shell/shell_windows_command_line.inl rename to source/YeloLib/shell/shell_windows_command_line.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_from_tag_string_list.inl b/source/YeloLib/tag_files/string_id_from_tag_string_list.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_from_tag_string_list.inl rename to source/YeloLib/tag_files/string_id_from_tag_string_list.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_yelo.cpp b/source/YeloLib/tag_files/string_id_yelo.cpp similarity index 88% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_yelo.cpp rename to source/YeloLib/tag_files/string_id_yelo.cpp index 43bb8bc7e..071e57ed2 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_yelo.cpp +++ b/source/YeloLib/tag_files/string_id_yelo.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_yelo.hpp b/source/YeloLib/tag_files/string_id_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_id_yelo.hpp rename to source/YeloLib/tag_files/string_id_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.components.inl b/source/YeloLib/tag_files/string_ids.components.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.components.inl rename to source/YeloLib/tag_files/string_ids.components.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.game_engine.inl b/source/YeloLib/tag_files/string_ids.game_engine.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.game_engine.inl rename to source/YeloLib/tag_files/string_ids.game_engine.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.global.inl b/source/YeloLib/tag_files/string_ids.global.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.global.inl rename to source/YeloLib/tag_files/string_ids.global.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui.inl b/source/YeloLib/tag_files/string_ids.gui.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui.inl rename to source/YeloLib/tag_files/string_ids.gui.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui_alert.inl b/source/YeloLib/tag_files/string_ids.gui_alert.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui_alert.inl rename to source/YeloLib/tag_files/string_ids.gui_alert.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui_dialog.inl b/source/YeloLib/tag_files/string_ids.gui_dialog.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.gui_dialog.inl rename to source/YeloLib/tag_files/string_ids.gui_dialog.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.incident.inl b/source/YeloLib/tag_files/string_ids.incident.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.incident.inl rename to source/YeloLib/tag_files/string_ids.incident.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.os_setting.inl b/source/YeloLib/tag_files/string_ids.os_setting.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.os_setting.inl rename to source/YeloLib/tag_files/string_ids.os_setting.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.properties.inl b/source/YeloLib/tag_files/string_ids.properties.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids.properties.inl rename to source/YeloLib/tag_files/string_ids.properties.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.cpp b/source/YeloLib/tag_files/string_ids_yelo.cpp similarity index 77% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.cpp rename to source/YeloLib/tag_files/string_ids_yelo.cpp index bbe3ce470..e28cac6d5 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.cpp +++ b/source/YeloLib/tag_files/string_ids_yelo.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include #if PLATFORM_IS_EDITOR || defined(API_DEBUG) struct string_id_yelo_kv_pair @@ -31,15 +31,15 @@ }; STRING_ID_YELO_KV_PAIRS_ARRAY_STATIC_ASSERT_LENGTH( __STRING_ID_GENERATE_SET_NAME ); #define __STRING_ID_EMPTY_STRING_HACK() {Yelo::_string_id::_string_id_empty_string, ""}, - #include - #include - #include - #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include + #include static const string_id_yelo_kv_pair* const k_string_id_kv_pairs[] = { STRING_ID_YELO_KV_PAIRS_ARRAY_NAME(global), nullptr, // the 'cache' set is defined in the cache file diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.hpp b/source/YeloLib/tag_files/string_ids_yelo.hpp similarity index 78% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.hpp rename to source/YeloLib/tag_files/string_ids_yelo.hpp index b70cd50ba..b43d044c1 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/string_ids_yelo.hpp +++ b/source/YeloLib/tag_files/string_ids_yelo.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #define STRING_ID(set, value) \ _string_id::_##set##_string_##value @@ -49,17 +49,17 @@ namespace Yelo ////////////////////////////////////////////////////////////////////////// -#include +#include BOOST_STATIC_ASSERT( _string_id_empty_string == 0 ); // NO CACHE STRINGS DEFINED IN CODE! -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #undef __STRING_ID_GENERATE_SET_NAME diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_database_definitions.cpp b/source/YeloLib/tag_files/tag_database_definitions.cpp similarity index 92% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_database_definitions.cpp rename to source/YeloLib/tag_files/tag_database_definitions.cpp index 8d08afee2..0a9912fe2 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_database_definitions.cpp +++ b/source/YeloLib/tag_files/tag_database_definitions.cpp @@ -4,10 +4,10 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_IS_EDITOR - #include + #include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_database_definitions.hpp b/source/YeloLib/tag_files/tag_database_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_database_definitions.hpp rename to source/YeloLib/tag_files/tag_database_definitions.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.cpp b/source/YeloLib/tag_files/tag_fieldset_replacement_builder.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.cpp rename to source/YeloLib/tag_files/tag_fieldset_replacement_builder.cpp index 192916350..9399d739c 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.cpp +++ b/source/YeloLib/tag_files/tag_fieldset_replacement_builder.cpp @@ -5,10 +5,10 @@ */ #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.hpp b/source/YeloLib/tag_files/tag_fieldset_replacement_builder.hpp similarity index 97% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.hpp rename to source/YeloLib/tag_files/tag_fieldset_replacement_builder.hpp index 4ef8f4831..a75b59e30 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_fieldset_replacement_builder.hpp +++ b/source/YeloLib/tag_files/tag_fieldset_replacement_builder.hpp @@ -7,8 +7,8 @@ #if PLATFORM_IS_EDITOR // DON'T INCLUDE ME UNLESS YOUR NAME IS TagFieldSetReplacements.cpp -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory.cpp b/source/YeloLib/tag_files/tag_group_memory.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory.cpp rename to source/YeloLib/tag_files/tag_group_memory.cpp index 778e46320..31df14245 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory.cpp +++ b/source/YeloLib/tag_files/tag_group_memory.cpp @@ -5,13 +5,13 @@ */ #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory.hpp b/source/YeloLib/tag_files/tag_group_memory.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory.hpp rename to source/YeloLib/tag_files/tag_group_memory.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_allocations.cpp b/source/YeloLib/tag_files/tag_group_memory_allocations.cpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_allocations.cpp rename to source/YeloLib/tag_files/tag_group_memory_allocations.cpp index 7f4602725..903eae646 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_allocations.cpp +++ b/source/YeloLib/tag_files/tag_group_memory_allocations.cpp @@ -5,11 +5,11 @@ */ #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_stats.cpp b/source/YeloLib/tag_files/tag_group_memory_stats.cpp similarity index 94% rename from OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_stats.cpp rename to source/YeloLib/tag_files/tag_group_memory_stats.cpp index fee0cecae..67c18e5cf 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/tag_files/tag_group_memory_stats.cpp +++ b/source/YeloLib/tag_files/tag_group_memory_stats.cpp @@ -5,11 +5,11 @@ */ #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/tag_files/tag_groups_base_yelo.hpp b/source/YeloLib/tag_files/tag_groups_base_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/tag_files/tag_groups_base_yelo.hpp rename to source/YeloLib/tag_files/tag_groups_base_yelo.hpp diff --git a/OpenSauce/shared/Include/YeloLib/tag_files/tag_groups_markup.hpp b/source/YeloLib/tag_files/tag_groups_markup.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/tag_files/tag_groups_markup.hpp rename to source/YeloLib/tag_files/tag_groups_markup.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_base.hpp b/source/YeloLib/time/interpolation/c_interp_base.hpp similarity index 86% rename from OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_base.hpp rename to source/YeloLib/time/interpolation/c_interp_base.hpp index f7c66124b..8d307bd59 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_base.hpp +++ b/source/YeloLib/time/interpolation/c_interp_base.hpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_function.hpp b/source/YeloLib/time/interpolation/c_interp_function.hpp similarity index 86% rename from OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_function.hpp rename to source/YeloLib/time/interpolation/c_interp_function.hpp index 216dde101..81dd0443e 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_function.hpp +++ b/source/YeloLib/time/interpolation/c_interp_function.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_linear.hpp b/source/YeloLib/time/interpolation/c_interp_linear.hpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_linear.hpp rename to source/YeloLib/time/interpolation/c_interp_linear.hpp index a37c51962..042919b3d 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/c_interp_linear.hpp +++ b/source/YeloLib/time/interpolation/c_interp_linear.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/i_interpolator.hpp b/source/YeloLib/time/interpolation/i_interpolator.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/i_interpolator.hpp rename to source/YeloLib/time/interpolation/i_interpolator.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/interpolation.hpp b/source/YeloLib/time/interpolation/interpolation.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/time/interpolation/interpolation.hpp rename to source/YeloLib/time/interpolation/interpolation.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_boarding_manager.cpp b/source/YeloLib/units/c_unit_seat_boarding_manager.cpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_boarding_manager.cpp rename to source/YeloLib/units/c_unit_seat_boarding_manager.cpp index 729d85261..8d7ce53cc 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_boarding_manager.cpp +++ b/source/YeloLib/units/c_unit_seat_boarding_manager.cpp @@ -5,21 +5,21 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_boarding_manager.hpp b/source/YeloLib/units/c_unit_seat_boarding_manager.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_boarding_manager.hpp rename to source/YeloLib/units/c_unit_seat_boarding_manager.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_damage_manager.cpp b/source/YeloLib/units/c_unit_seat_damage_manager.cpp similarity index 92% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_damage_manager.cpp rename to source/YeloLib/units/c_unit_seat_damage_manager.cpp index 28cfc3ff1..834df606b 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_damage_manager.cpp +++ b/source/YeloLib/units/c_unit_seat_damage_manager.cpp @@ -5,19 +5,19 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_damage_manager.hpp b/source/YeloLib/units/c_unit_seat_damage_manager.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/c_unit_seat_damage_manager.hpp rename to source/YeloLib/units/c_unit_seat_damage_manager.hpp diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/unit_definitions_yelo.hpp b/source/YeloLib/units/unit_definitions_yelo.hpp similarity index 96% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/unit_definitions_yelo.hpp rename to source/YeloLib/units/unit_definitions_yelo.hpp index 85f3defc8..82d377237 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/units/unit_definitions_yelo.hpp +++ b/source/YeloLib/units/unit_definitions_yelo.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/unit_transform_definition.hpp b/source/YeloLib/units/unit_transform_definition.hpp similarity index 95% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/unit_transform_definition.hpp rename to source/YeloLib/units/unit_transform_definition.hpp index 513397dd0..027b32d19 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/units/unit_transform_definition.hpp +++ b/source/YeloLib/units/unit_transform_definition.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include +#include +#include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/units_grenade_count_upgrade.inl b/source/YeloLib/units/units_grenade_count_upgrade.inl similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/units_grenade_count_upgrade.inl rename to source/YeloLib/units/units_grenade_count_upgrade.inl diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/units_yelo.cpp b/source/YeloLib/units/units_yelo.cpp similarity index 93% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/units_yelo.cpp rename to source/YeloLib/units/units_yelo.cpp index aef7c8fcc..ab1b093bc 100644 --- a/OpenSauce/shared/Include/YeloLib/Halo1/units/units_yelo.cpp +++ b/source/YeloLib/units/units_yelo.cpp @@ -5,17 +5,17 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/YeloLib/Halo1/units/units_yelo.hpp b/source/YeloLib/units/units_yelo.hpp similarity index 100% rename from OpenSauce/shared/Include/YeloLib/Halo1/units/units_yelo.hpp rename to source/YeloLib/units/units_yelo.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_alert.hpp b/source/blamlib/ai/action_alert.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_alert.hpp rename to source/blamlib/ai/action_alert.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_avoid.hpp b/source/blamlib/ai/action_avoid.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_avoid.hpp rename to source/blamlib/ai/action_avoid.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_charge.hpp b/source/blamlib/ai/action_charge.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_charge.hpp rename to source/blamlib/ai/action_charge.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_converse.hpp b/source/blamlib/ai/action_converse.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_converse.hpp rename to source/blamlib/ai/action_converse.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_fight.hpp b/source/blamlib/ai/action_fight.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_fight.hpp rename to source/blamlib/ai/action_fight.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_flee.hpp b/source/blamlib/ai/action_flee.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_flee.hpp rename to source/blamlib/ai/action_flee.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_guard.hpp b/source/blamlib/ai/action_guard.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_guard.hpp rename to source/blamlib/ai/action_guard.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_obey.hpp b/source/blamlib/ai/action_obey.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_obey.hpp rename to source/blamlib/ai/action_obey.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_search.hpp b/source/blamlib/ai/action_search.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_search.hpp rename to source/blamlib/ai/action_search.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_sleep.hpp b/source/blamlib/ai/action_sleep.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_sleep.hpp rename to source/blamlib/ai/action_sleep.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_uncover.hpp b/source/blamlib/ai/action_uncover.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_uncover.hpp rename to source/blamlib/ai/action_uncover.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_vehicle.hpp b/source/blamlib/ai/action_vehicle.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_vehicle.hpp rename to source/blamlib/ai/action_vehicle.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/action_wait.hpp b/source/blamlib/ai/action_wait.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/action_wait.hpp rename to source/blamlib/ai/action_wait.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actions.hpp b/source/blamlib/ai/actions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actions.hpp rename to source/blamlib/ai/actions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_combat.hpp b/source/blamlib/ai/actor_combat.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_combat.hpp rename to source/blamlib/ai/actor_combat.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_definitions.hpp b/source/blamlib/ai/actor_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_definitions.hpp rename to source/blamlib/ai/actor_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_looking.hpp b/source/blamlib/ai/actor_looking.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_looking.hpp rename to source/blamlib/ai/actor_looking.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_moving.hpp b/source/blamlib/ai/actor_moving.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_moving.hpp rename to source/blamlib/ai/actor_moving.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_perception.hpp b/source/blamlib/ai/actor_perception.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_perception.hpp rename to source/blamlib/ai/actor_perception.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_stimulus.hpp b/source/blamlib/ai/actor_stimulus.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_stimulus.hpp rename to source/blamlib/ai/actor_stimulus.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_structures.hpp b/source/blamlib/ai/actor_structures.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_structures.hpp rename to source/blamlib/ai/actor_structures.hpp index f79019524..3e498914b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_structures.hpp +++ b/source/blamlib/ai/actor_structures.hpp @@ -7,14 +7,14 @@ #pragma once #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actor_types.hpp b/source/blamlib/ai/actor_types.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actor_types.hpp rename to source/blamlib/ai/actor_types.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/actors.hpp b/source/blamlib/ai/actors.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/actors.hpp rename to source/blamlib/ai/actors.hpp index 2bf8a8658..df08a9c5d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/actors.hpp +++ b/source/blamlib/ai/actors.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai.hpp b/source/blamlib/ai/ai.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/ai.hpp rename to source/blamlib/ai/ai.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_communication.hpp b/source/blamlib/ai/ai_communication.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/ai_communication.hpp rename to source/blamlib/ai/ai_communication.hpp index cc3e973bb..6be86ce3c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_communication.hpp +++ b/source/blamlib/ai/ai_communication.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_scenario_definitions.hpp b/source/blamlib/ai/ai_scenario_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/ai_scenario_definitions.hpp rename to source/blamlib/ai/ai_scenario_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_script.hpp b/source/blamlib/ai/ai_script.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/ai_script.hpp rename to source/blamlib/ai/ai_script.hpp index ddf1000aa..2f156f6b9 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_script.hpp +++ b/source/blamlib/ai/ai_script.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/ai_structures.hpp b/source/blamlib/ai/ai_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/ai_structures.hpp rename to source/blamlib/ai/ai_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/encounters.hpp b/source/blamlib/ai/encounters.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/encounters.hpp rename to source/blamlib/ai/encounters.hpp index 6df6ae585..e78586f4f 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/encounters.hpp +++ b/source/blamlib/ai/encounters.hpp @@ -7,11 +7,11 @@ #pragma once #include -#include +#include #include #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/path.hpp b/source/blamlib/ai/path.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/path.hpp rename to source/blamlib/ai/path.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/prop_structures.hpp b/source/blamlib/ai/prop_structures.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/prop_structures.hpp rename to source/blamlib/ai/prop_structures.hpp index 4c102e51f..b6d9b03af 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/ai/prop_structures.hpp +++ b/source/blamlib/ai/prop_structures.hpp @@ -6,13 +6,13 @@ */ #pragma once -#include +#include #include #include #include #include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/ai/props.hpp b/source/blamlib/ai/props.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/ai/props.hpp rename to source/blamlib/ai/props.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/bitmaps/bitmap_definition.hpp b/source/blamlib/bitmaps/bitmap_definition.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/bitmaps/bitmap_definition.hpp rename to source/blamlib/bitmaps/bitmap_definition.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/common/message_header.hpp b/source/blamlib/bungie_net/common/message_header.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/bungie_net/common/message_header.hpp rename to source/blamlib/bungie_net/common/message_header.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_address.hpp b/source/blamlib/bungie_net/network/transport_address.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_address.hpp rename to source/blamlib/bungie_net/network/transport_address.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_set_winsock.hpp b/source/blamlib/bungie_net/network/transport_endpoint_set_winsock.hpp similarity index 81% rename from OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_set_winsock.hpp rename to source/blamlib/bungie_net/network/transport_endpoint_set_winsock.hpp index fff73de80..6ea623b4a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_set_winsock.hpp +++ b/source/blamlib/bungie_net/network/transport_endpoint_set_winsock.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_winsock.hpp b/source/blamlib/bungie_net/network/transport_endpoint_winsock.hpp similarity index 83% rename from OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_winsock.hpp rename to source/blamlib/bungie_net/network/transport_endpoint_winsock.hpp index 6438ea064..ce5fa2628 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/bungie_net/network/transport_endpoint_winsock.hpp +++ b/source/blamlib/bungie_net/network/transport_endpoint_winsock.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_constants.hpp b/source/blamlib/cache/cache_constants.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_constants.hpp rename to source/blamlib/cache/cache_constants.hpp index a6e9d6ad6..fa009da12 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_constants.hpp +++ b/source/blamlib/cache/cache_constants.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.cpp b/source/blamlib/cache/cache_file_builder.cpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.cpp rename to source/blamlib/cache/cache_file_builder.cpp index 3b22e4ac4..b694d681e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.cpp +++ b/source/blamlib/cache/cache_file_builder.cpp @@ -4,28 +4,28 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_TYPE == PLATFORM_TOOL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.hpp b/source/blamlib/cache/cache_file_builder.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.hpp rename to source/blamlib/cache/cache_file_builder.hpp index ed8e1fa83..7d4f10de3 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_file_builder.hpp +++ b/source/blamlib/cache/cache_file_builder.hpp @@ -6,13 +6,13 @@ #pragma once #if PLATFORM_TYPE == PLATFORM_TOOL -#include +#include #include #include #include #include #include -#include +#include namespace Yelo { namespace Cache { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.cpp b/source/blamlib/cache/cache_files.cpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.cpp rename to source/blamlib/cache/cache_files.cpp index e669da9e5..0cfe0085b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.cpp +++ b/source/blamlib/cache/cache_files.cpp @@ -4,24 +4,24 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if PLATFORM_IS_EDITOR -#include +#include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.hpp b/source/blamlib/cache/cache_files.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.hpp rename to source/blamlib/cache/cache_files.hpp index e7feed4f9..3b79fe352 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files.hpp +++ b/source/blamlib/cache/cache_files.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include // Terminology: // maps_path: The system directory path to a "maps\" folder. diff --git a/OpenSauce/shared/Include/blamlib/cache/cache_files_base.hpp b/source/blamlib/cache/cache_files_base.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/cache/cache_files_base.hpp rename to source/blamlib/cache/cache_files_base.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_globals.hpp b/source/blamlib/cache/cache_files_globals.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_globals.hpp rename to source/blamlib/cache/cache_files_globals.hpp index 27f7fb8ea..7f5a4d7fb 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_globals.hpp +++ b/source/blamlib/cache/cache_files_globals.hpp @@ -5,9 +5,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include BOOST_STATIC_ASSERT( sizeof(z_stream) == 0x38 ); diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_structures.hpp b/source/blamlib/cache/cache_files_structures.hpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_structures.hpp rename to source/blamlib/cache/cache_files_structures.hpp index 90ec3a61a..b9fdadc7d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_structures.hpp +++ b/source/blamlib/cache/cache_files_structures.hpp @@ -7,9 +7,9 @@ #pragma once #include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_windows.cpp b/source/blamlib/cache/cache_files_windows.cpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_windows.cpp rename to source/blamlib/cache/cache_files_windows.cpp index 5ccc4a751..76d0c633e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/cache_files_windows.cpp +++ b/source/blamlib/cache/cache_files_windows.cpp @@ -4,15 +4,15 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/data_file.cpp b/source/blamlib/cache/data_file.cpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/data_file.cpp rename to source/blamlib/cache/data_file.cpp index c55139ccd..6f55692a9 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/data_file.cpp +++ b/source/blamlib/cache/data_file.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/data_file.hpp b/source/blamlib/cache/data_file.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/data_file.hpp rename to source/blamlib/cache/data_file.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/data_file_structures.hpp b/source/blamlib/cache/data_file_structures.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/data_file_structures.hpp rename to source/blamlib/cache/data_file_structures.hpp index 22b5dd711..c592d97bd 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/data_file_structures.hpp +++ b/source/blamlib/cache/data_file_structures.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.cpp b/source/blamlib/cache/pc_sound_cache.cpp similarity index 84% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.cpp rename to source/blamlib/cache/pc_sound_cache.cpp index f946e5e09..97102c880 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.cpp +++ b/source/blamlib/cache/pc_sound_cache.cpp @@ -4,11 +4,11 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.hpp b/source/blamlib/cache/pc_sound_cache.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.hpp rename to source/blamlib/cache/pc_sound_cache.hpp index 89f418ad9..3a967f1a7 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_sound_cache.hpp +++ b/source/blamlib/cache/pc_sound_cache.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.cpp b/source/blamlib/cache/pc_texture_cache.cpp similarity index 80% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.cpp rename to source/blamlib/cache/pc_texture_cache.cpp index ce0cbc45e..2045aa657 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.cpp +++ b/source/blamlib/cache/pc_texture_cache.cpp @@ -4,11 +4,11 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.hpp b/source/blamlib/cache/pc_texture_cache.hpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.hpp rename to source/blamlib/cache/pc_texture_cache.hpp index fcac036ae..fe08f1c17 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/pc_texture_cache.hpp +++ b/source/blamlib/cache/pc_texture_cache.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include struct IDirect3DBaseTexture9; diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map.cpp b/source/blamlib/cache/physical_memory_map.cpp similarity index 82% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map.cpp rename to source/blamlib/cache/physical_memory_map.cpp index 32ac74ca9..ef1e589ae 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map.cpp +++ b/source/blamlib/cache/physical_memory_map.cpp @@ -4,9 +4,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map.hpp b/source/blamlib/cache/physical_memory_map.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map.hpp rename to source/blamlib/cache/physical_memory_map.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map_structures.hpp b/source/blamlib/cache/physical_memory_map_structures.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map_structures.hpp rename to source/blamlib/cache/physical_memory_map_structures.hpp index 56bad59be..4b61864fa 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/physical_memory_map_structures.hpp +++ b/source/blamlib/cache/physical_memory_map_structures.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/predicted_resources.hpp b/source/blamlib/cache/predicted_resources.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/predicted_resources.hpp rename to source/blamlib/cache/predicted_resources.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.cpp b/source/blamlib/cache/s_data_file_globals.cpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.cpp rename to source/blamlib/cache/s_data_file_globals.cpp index 314743880..8a0b28b77 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.cpp +++ b/source/blamlib/cache/s_data_file_globals.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace Yelo { namespace Cache { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.h b/source/blamlib/cache/s_data_file_globals.h similarity index 87% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.h rename to source/blamlib/cache/s_data_file_globals.h index 88027161a..0cde44a92 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cache/s_data_file_globals.h +++ b/source/blamlib/cache/s_data_file_globals.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace Yelo { namespace Cache { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/sound_cache.hpp b/source/blamlib/cache/sound_cache.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/sound_cache.hpp rename to source/blamlib/cache/sound_cache.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cache/texture_cache.hpp b/source/blamlib/cache/texture_cache.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cache/texture_cache.hpp rename to source/blamlib/cache/texture_cache.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/camera_definitions.hpp b/source/blamlib/camera/camera_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/camera_definitions.hpp rename to source/blamlib/camera/camera_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/dead_camera.hpp b/source/blamlib/camera/dead_camera.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/dead_camera.hpp rename to source/blamlib/camera/dead_camera.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/director.hpp b/source/blamlib/camera/director.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/director.hpp rename to source/blamlib/camera/director.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/director_structures.hpp b/source/blamlib/camera/director_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/director_structures.hpp rename to source/blamlib/camera/director_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/first_person_camera.hpp b/source/blamlib/camera/first_person_camera.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/first_person_camera.hpp rename to source/blamlib/camera/first_person_camera.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/following_camera.hpp b/source/blamlib/camera/following_camera.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/following_camera.hpp rename to source/blamlib/camera/following_camera.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/camera/observer_structures.hpp b/source/blamlib/camera/observer_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/camera/observer_structures.hpp rename to source/blamlib/camera/observer_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cryptography/md5.hpp b/source/blamlib/cryptography/md5.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cryptography/md5.hpp rename to source/blamlib/cryptography/md5.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries.hpp b/source/blamlib/cseries/cseries.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries.hpp rename to source/blamlib/cseries/cseries.hpp index f0f86dbf4..570540be5 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries.hpp +++ b/source/blamlib/cseries/cseries.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/cseries/cseries_base.hpp b/source/blamlib/cseries/cseries_base.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/cseries/cseries_base.hpp rename to source/blamlib/cseries/cseries_base.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries_windows.cpp b/source/blamlib/cseries/cseries_windows.cpp similarity index 89% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries_windows.cpp rename to source/blamlib/cseries/cseries_windows.cpp index f3a641301..a8871929d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cseries/cseries_windows.cpp +++ b/source/blamlib/cseries/cseries_windows.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/debug_memory.cpp b/source/blamlib/cseries/debug_memory.cpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/debug_memory.cpp rename to source/blamlib/cseries/debug_memory.cpp index 2fd7e8cf6..b072f8ee1 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cseries/debug_memory.cpp +++ b/source/blamlib/cseries/debug_memory.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/debug_memory.hpp b/source/blamlib/cseries/debug_memory.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/debug_memory.hpp rename to source/blamlib/cseries/debug_memory.hpp diff --git a/OpenSauce/shared/Include/blamlib/cseries/enum_templates.h b/source/blamlib/cseries/enum_templates.h similarity index 100% rename from OpenSauce/shared/Include/blamlib/cseries/enum_templates.h rename to source/blamlib/cseries/enum_templates.h diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/errors.hpp b/source/blamlib/cseries/errors.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/errors.hpp rename to source/blamlib/cseries/errors.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/profile.cpp b/source/blamlib/cseries/profile.cpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/profile.cpp rename to source/blamlib/cseries/profile.cpp index b6a6d091e..aa93a2617 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cseries/profile.cpp +++ b/source/blamlib/cseries/profile.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cseries/profile.hpp b/source/blamlib/cseries/profile.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cseries/profile.hpp rename to source/blamlib/cseries/profile.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_definitions.hpp b/source/blamlib/cutscene/recorded_animation_definitions.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_definitions.hpp rename to source/blamlib/cutscene/recorded_animation_definitions.hpp index 355d0815c..959845ca7 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_definitions.hpp +++ b/source/blamlib/cutscene/recorded_animation_definitions.hpp @@ -7,8 +7,8 @@ #include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_playback.hpp b/source/blamlib/cutscene/recorded_animation_playback.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_playback.hpp rename to source/blamlib/cutscene/recorded_animation_playback.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_playback_v1.hpp b/source/blamlib/cutscene/recorded_animation_playback_v1.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animation_playback_v1.hpp rename to source/blamlib/cutscene/recorded_animation_playback_v1.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations.hpp b/source/blamlib/cutscene/recorded_animations.hpp similarity index 83% rename from OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations.hpp rename to source/blamlib/cutscene/recorded_animations.hpp index b23cff891..0c209c421 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations.hpp +++ b/source/blamlib/cutscene/recorded_animations.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations_structures.hpp b/source/blamlib/cutscene/recorded_animations_structures.hpp similarity index 76% rename from OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations_structures.hpp rename to source/blamlib/cutscene/recorded_animations_structures.hpp index 5f32e56d0..3c20401bc 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/cutscene/recorded_animations_structures.hpp +++ b/source/blamlib/cutscene/recorded_animations_structures.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_controls.hpp b/source/blamlib/devices/device_controls.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/device_controls.hpp rename to source/blamlib/devices/device_controls.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_definitions.hpp b/source/blamlib/devices/device_definitions.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/device_definitions.hpp rename to source/blamlib/devices/device_definitions.hpp index ff07b3d4c..a22a9203e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_definitions.hpp +++ b/source/blamlib/devices/device_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_light_fixtures.hpp b/source/blamlib/devices/device_light_fixtures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/device_light_fixtures.hpp rename to source/blamlib/devices/device_light_fixtures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_machines.hpp b/source/blamlib/devices/device_machines.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/device_machines.hpp rename to source/blamlib/devices/device_machines.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_structures.hpp b/source/blamlib/devices/device_structures.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/device_structures.hpp rename to source/blamlib/devices/device_structures.hpp index cf4cae112..86d5a430e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/devices/device_structures.hpp +++ b/source/blamlib/devices/device_structures.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/devices/devices.hpp b/source/blamlib/devices/devices.hpp similarity index 81% rename from OpenSauce/shared/Include/blamlib/Halo1/devices/devices.hpp rename to source/blamlib/devices/devices.hpp index b8b16fe61..5ee61d4ec 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/devices/devices.hpp +++ b/source/blamlib/devices/devices.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/contrail_definitions.hpp b/source/blamlib/effects/contrail_definitions.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/contrail_definitions.hpp rename to source/blamlib/effects/contrail_definitions.hpp index 09f153f4f..5faed922a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/contrail_definitions.hpp +++ b/source/blamlib/effects/contrail_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/contrails.hpp b/source/blamlib/effects/contrails.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/contrails.hpp rename to source/blamlib/effects/contrails.hpp index e9409af2a..0c152edae 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/contrails.hpp +++ b/source/blamlib/effects/contrails.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.cpp b/source/blamlib/effects/damage_effect_definitions.cpp similarity index 69% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.cpp rename to source/blamlib/effects/damage_effect_definitions.cpp index 19fc6c7d7..7732df265 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.cpp +++ b/source/blamlib/effects/damage_effect_definitions.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.hpp b/source/blamlib/effects/damage_effect_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.hpp rename to source/blamlib/effects/damage_effect_definitions.hpp index 085ce47c8..c24cb0529 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/damage_effect_definitions.hpp +++ b/source/blamlib/effects/damage_effect_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/effect_definitions.hpp b/source/blamlib/effects/effect_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/effect_definitions.hpp rename to source/blamlib/effects/effect_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/effects.hpp b/source/blamlib/effects/effects.hpp similarity index 89% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/effects.hpp rename to source/blamlib/effects/effects.hpp index 840defd9a..345702045 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/effects.hpp +++ b/source/blamlib/effects/effects.hpp @@ -6,11 +6,11 @@ */ #pragma once -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/effects_constants.hpp b/source/blamlib/effects/effects_constants.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/effects_constants.hpp rename to source/blamlib/effects/effects_constants.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/material_effect_definitions.hpp b/source/blamlib/effects/material_effect_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/material_effect_definitions.hpp rename to source/blamlib/effects/material_effect_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_definitions.hpp b/source/blamlib/effects/particle_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/particle_definitions.hpp rename to source/blamlib/effects/particle_definitions.hpp index ebe1655b9..98676c523 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_definitions.hpp +++ b/source/blamlib/effects/particle_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_system_definitions.hpp b/source/blamlib/effects/particle_system_definitions.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/particle_system_definitions.hpp rename to source/blamlib/effects/particle_system_definitions.hpp index a36800b36..c0c4821fb 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_system_definitions.hpp +++ b/source/blamlib/effects/particle_system_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_systems.hpp b/source/blamlib/effects/particle_systems.hpp similarity index 84% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/particle_systems.hpp rename to source/blamlib/effects/particle_systems.hpp index 754322840..820ab94b0 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/particle_systems.hpp +++ b/source/blamlib/effects/particle_systems.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include +#include -#include -#include +#include +#include #include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/particles.hpp b/source/blamlib/effects/particles.hpp similarity index 75% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/particles.hpp rename to source/blamlib/effects/particles.hpp index b22b0e8b3..dffff0af4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/particles.hpp +++ b/source/blamlib/effects/particles.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include +#include -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/player_effects.hpp b/source/blamlib/effects/player_effects.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/player_effects.hpp rename to source/blamlib/effects/player_effects.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_system_definitions.hpp b/source/blamlib/effects/weather_particle_system_definitions.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_system_definitions.hpp rename to source/blamlib/effects/weather_particle_system_definitions.hpp index f76faf5c0..dab515e3a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_system_definitions.hpp +++ b/source/blamlib/effects/weather_particle_system_definitions.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_systems.hpp b/source/blamlib/effects/weather_particle_systems.hpp similarity index 63% rename from OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_systems.hpp rename to source/blamlib/effects/weather_particle_systems.hpp index 950e8c6ca..7aff6091e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/effects/weather_particle_systems.hpp +++ b/source/blamlib/effects/weather_particle_systems.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/action_queue.hpp b/source/blamlib/game/action_queue.hpp similarity index 82% rename from OpenSauce/shared/Include/blamlib/Halo1/game/action_queue.hpp rename to source/blamlib/game/action_queue.hpp index 2107dfe17..89016d3e8 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/action_queue.hpp +++ b/source/blamlib/game/action_queue.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/cheats.hpp b/source/blamlib/game/cheats.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/cheats.hpp rename to source/blamlib/game/cheats.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game.hpp b/source/blamlib/game/game.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game.hpp rename to source/blamlib/game/game.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_allegiance.hpp b/source/blamlib/game/game_allegiance.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_allegiance.hpp rename to source/blamlib/game/game_allegiance.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_allegiance_structures.hpp b/source/blamlib/game/game_allegiance_structures.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_allegiance_structures.hpp rename to source/blamlib/game/game_allegiance_structures.hpp index a637be5c9..f23513da7 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_allegiance_structures.hpp +++ b/source/blamlib/game/game_allegiance_structures.hpp @@ -6,7 +6,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_configuration.hpp b/source/blamlib/game/game_configuration.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_configuration.hpp rename to source/blamlib/game/game_configuration.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine.hpp b/source/blamlib/game/game_engine.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine.hpp rename to source/blamlib/game/game_engine.hpp index a5d8a305e..51e2eabfe 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine.hpp +++ b/source/blamlib/game/game_engine.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_ctf.hpp b/source/blamlib/game/game_engine_ctf.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_ctf.hpp rename to source/blamlib/game/game_engine_ctf.hpp index 3bbe70747..8f1d2e081 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_ctf.hpp +++ b/source/blamlib/game/game_engine_ctf.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_king.hpp b/source/blamlib/game/game_engine_king.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_king.hpp rename to source/blamlib/game/game_engine_king.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_multiplayer_sounds.hpp b/source/blamlib/game/game_engine_multiplayer_sounds.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_multiplayer_sounds.hpp rename to source/blamlib/game/game_engine_multiplayer_sounds.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_oddball.hpp b/source/blamlib/game/game_engine_oddball.hpp similarity index 84% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_oddball.hpp rename to source/blamlib/game/game_engine_oddball.hpp index 55d3ba80a..e7e03c10d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_oddball.hpp +++ b/source/blamlib/game/game_engine_oddball.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_race.hpp b/source/blamlib/game/game_engine_race.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_race.hpp rename to source/blamlib/game/game_engine_race.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_slayer.hpp b/source/blamlib/game/game_engine_slayer.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_slayer.hpp rename to source/blamlib/game/game_engine_slayer.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_stub.hpp b/source/blamlib/game/game_engine_stub.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_engine_stub.hpp rename to source/blamlib/game/game_engine_stub.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_globals.hpp b/source/blamlib/game/game_globals.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_globals.hpp rename to source/blamlib/game/game_globals.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_definitions.hpp b/source/blamlib/game/game_globals_definitions.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_definitions.hpp rename to source/blamlib/game/game_globals_definitions.hpp index b60cdc508..ca0a32d50 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_definitions.hpp +++ b/source/blamlib/game/game_globals_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_structures.hpp b/source/blamlib/game/game_globals_structures.hpp similarity index 79% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_structures.hpp rename to source/blamlib/game/game_globals_structures.hpp index 08e8a72cb..cf75e8886 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_globals_structures.hpp +++ b/source/blamlib/game/game_globals_structures.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_time.cpp b/source/blamlib/game/game_time.cpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_time.cpp rename to source/blamlib/game/game_time.cpp index 17fad3e2c..876b976c7 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_time.cpp +++ b/source/blamlib/game/game_time.cpp @@ -4,9 +4,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_time.hpp b/source/blamlib/game/game_time.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_time.hpp rename to source/blamlib/game/game_time.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/game_time_structures.hpp b/source/blamlib/game/game_time_structures.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/game/game_time_structures.hpp rename to source/blamlib/game/game_time_structures.hpp index d2f488f9d..c2ea05015 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/game_time_structures.hpp +++ b/source/blamlib/game/game_time_structures.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/player_action.hpp b/source/blamlib/game/player_action.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/player_action.hpp rename to source/blamlib/game/player_action.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/player_control.hpp b/source/blamlib/game/player_control.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/game/player_control.hpp rename to source/blamlib/game/player_control.hpp index 5e612ea16..2ef9964f1 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/player_control.hpp +++ b/source/blamlib/game/player_control.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/player_structures.hpp b/source/blamlib/game/player_structures.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/game/player_structures.hpp rename to source/blamlib/game/player_structures.hpp index 54ecb9615..1e8498740 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/player_structures.hpp +++ b/source/blamlib/game/player_structures.hpp @@ -6,12 +6,12 @@ */ #pragma once -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/players.hpp b/source/blamlib/game/players.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/game/players.hpp rename to source/blamlib/game/players.hpp index 54176c804..745c669ef 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/players.hpp +++ b/source/blamlib/game/players.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/position_queue.hpp b/source/blamlib/game/position_queue.hpp similarity index 85% rename from OpenSauce/shared/Include/blamlib/Halo1/game/position_queue.hpp rename to source/blamlib/game/position_queue.hpp index 79420d23a..7e6bdf695 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/position_queue.hpp +++ b/source/blamlib/game/position_queue.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/simple_circular_queue.hpp b/source/blamlib/game/simple_circular_queue.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/game/simple_circular_queue.hpp rename to source/blamlib/game/simple_circular_queue.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/game/vehicle_update_queue.hpp b/source/blamlib/game/vehicle_update_queue.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/game/vehicle_update_queue.hpp rename to source/blamlib/game/vehicle_update_queue.hpp index 0b98c0336..26f4b185b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/game/vehicle_update_queue.hpp +++ b/source/blamlib/game/vehicle_update_queue.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/guerilla/field_dialog_structures.hpp b/source/blamlib/guerilla/field_dialog_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/guerilla/field_dialog_structures.hpp rename to source/blamlib/guerilla/field_dialog_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/guerilla/tags_interface.hpp b/source/blamlib/guerilla/tags_interface.hpp similarity index 89% rename from OpenSauce/shared/Include/blamlib/Halo1/guerilla/tags_interface.hpp rename to source/blamlib/guerilla/tags_interface.hpp index 22b8fb613..b8dc01c1c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/guerilla/tags_interface.hpp +++ b/source/blamlib/guerilla/tags_interface.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs.cpp b/source/blamlib/hs/hs.cpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs.cpp rename to source/blamlib/hs/hs.cpp index 7ff90ea0e..7fdd0b2ee 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs.cpp +++ b/source/blamlib/hs/hs.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs.hpp b/source/blamlib/hs/hs.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs.hpp rename to source/blamlib/hs/hs.hpp index 66c5e2c93..7bd3e48db 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs.hpp +++ b/source/blamlib/hs/hs.hpp @@ -5,10 +5,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { @@ -249,4 +249,4 @@ namespace Yelo }; }; -#include \ No newline at end of file +#include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_compile.cpp b/source/blamlib/hs/hs_compile.cpp similarity index 62% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_compile.cpp rename to source/blamlib/hs/hs_compile.cpp index be6146ba8..59deb7726 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_compile.cpp +++ b/source/blamlib/hs/hs_compile.cpp @@ -4,9 +4,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_compile.hpp b/source/blamlib/hs/hs_compile.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_compile.hpp rename to source/blamlib/hs/hs_compile.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_constants.hpp b/source/blamlib/hs/hs_constants.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_constants.hpp rename to source/blamlib/hs/hs_constants.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_external.hpp b/source/blamlib/hs/hs_library_external.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_external.hpp rename to source/blamlib/hs/hs_library_external.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal.hpp b/source/blamlib/hs/hs_library_internal.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal.hpp rename to source/blamlib/hs/hs_library_internal.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal_compile.inl b/source/blamlib/hs/hs_library_internal_compile.inl similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal_compile.inl rename to source/blamlib/hs/hs_library_internal_compile.inl diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal_runtime.inl b/source/blamlib/hs/hs_library_internal_runtime.inl similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_library_internal_runtime.inl rename to source/blamlib/hs/hs_library_internal_runtime.inl diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.cpp b/source/blamlib/hs/hs_runtime.cpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.cpp rename to source/blamlib/hs/hs_runtime.cpp index a60144e0d..51e8b66af 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.cpp +++ b/source/blamlib/hs/hs_runtime.cpp @@ -4,22 +4,22 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.hpp b/source/blamlib/hs/hs_runtime.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.hpp rename to source/blamlib/hs/hs_runtime.hpp index 4bf508c9b..edd717092 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime.hpp +++ b/source/blamlib/hs/hs_runtime.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime_structures.hpp b/source/blamlib/hs/hs_runtime_structures.hpp similarity index 77% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime_structures.hpp rename to source/blamlib/hs/hs_runtime_structures.hpp index 187d05980..7b0507985 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_runtime_structures.hpp +++ b/source/blamlib/hs/hs_runtime_structures.hpp @@ -6,9 +6,9 @@ #pragma once #include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.cpp b/source/blamlib/hs/hs_scenario_definitions.cpp similarity index 67% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.cpp rename to source/blamlib/hs/hs_scenario_definitions.cpp index 1b0590703..5bb5f5d2a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.cpp +++ b/source/blamlib/hs/hs_scenario_definitions.cpp @@ -4,4 +4,4 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.hpp b/source/blamlib/hs/hs_scenario_definitions.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.hpp rename to source/blamlib/hs/hs_scenario_definitions.hpp index dd3236d3b..79106cd1b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_scenario_definitions.hpp +++ b/source/blamlib/hs/hs_scenario_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_structures.hpp b/source/blamlib/hs/hs_structures.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_structures.hpp rename to source/blamlib/hs/hs_structures.hpp index a9dd7bd74..49063ae38 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_structures.hpp +++ b/source/blamlib/hs/hs_structures.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.cpp b/source/blamlib/hs/hs_threads.cpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.cpp rename to source/blamlib/hs/hs_threads.cpp index 402467911..1ebb13d65 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.cpp +++ b/source/blamlib/hs/hs_threads.cpp @@ -4,14 +4,14 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.hpp b/source/blamlib/hs/hs_threads.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.hpp rename to source/blamlib/hs/hs_threads.hpp index 463195409..0b7df22dc 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_threads.hpp +++ b/source/blamlib/hs/hs_threads.hpp @@ -6,8 +6,8 @@ #pragma once #include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.cpp b/source/blamlib/hs/hs_types.cpp similarity index 83% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.cpp rename to source/blamlib/hs/hs_types.cpp index 4187f622e..f305d543b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.cpp +++ b/source/blamlib/hs/hs_types.cpp @@ -4,24 +4,24 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include // for g_actor_type_names -#include // for k_hs_tag_reference_type_group_tags -#include // for g_ai_default_state_names -#include // for k_hs_tag_reference_type_group_tags -#include // for k_hs_tag_reference_type_group_tags -#include // for g_game_difficulty_level_names -#include // for g_game_team_names -#include -#include // for g_hud_anchor_names -#include // for k_hs_tag_reference_type_group_tags -#include // for k_hs_tag_reference_type_group_tags -#include -#include // for k_hs_tag_reference_type_group_tags - -#include -#include +#include + +#include // for g_actor_type_names +#include // for k_hs_tag_reference_type_group_tags +#include // for g_ai_default_state_names +#include // for k_hs_tag_reference_type_group_tags +#include // for k_hs_tag_reference_type_group_tags +#include // for g_game_difficulty_level_names +#include // for g_game_team_names +#include +#include // for g_hud_anchor_names +#include // for k_hs_tag_reference_type_group_tags +#include // for k_hs_tag_reference_type_group_tags +#include +#include // for k_hs_tag_reference_type_group_tags + +#include +#include namespace Yelo { @@ -104,7 +104,7 @@ namespace Yelo #define HS_TYPE_ABI_NAME(_hs_type) k##_hs_type##_abi #define HS_TYPE_ABI(abi_type, _hs_type, ...) static const abi_type HS_TYPE_ABI_NAME(_hs_type) = { Enums::_hs_type, __VA_ARGS__ }; -#include +#include #undef HS_TYPE_ABI const c_hs_type_abi* c_hs_type_abi::Get(Enums::hs_type type) @@ -112,7 +112,7 @@ namespace Yelo static std::array hs_type_abis = { #define HS_TYPE_ABI(abi_type, _hs_type, ...) &HS_TYPE_ABI_NAME(_hs_type), -#include +#include #undef HS_TYPE_ABI }; diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.hpp b/source/blamlib/hs/hs_types.hpp similarity index 97% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.hpp rename to source/blamlib/hs/hs_types.hpp index 262debdfc..1fdf8fa7c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types.hpp +++ b/source/blamlib/hs/hs_types.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_compile.inl b/source/blamlib/hs/hs_types_compile.inl similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_compile.inl rename to source/blamlib/hs/hs_types_compile.inl diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_definitions.inl b/source/blamlib/hs/hs_types_definitions.inl similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_definitions.inl rename to source/blamlib/hs/hs_types_definitions.inl diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_runtime.inl b/source/blamlib/hs/hs_types_runtime.inl similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_runtime.inl rename to source/blamlib/hs/hs_types_runtime.inl index 55ebbff38..085559031 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_runtime.inl +++ b/source/blamlib/hs/hs_types_runtime.inl @@ -5,15 +5,15 @@ */ #pragma once // should actually only ever be included by hs_types.cpp... -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_traits.hpp b/source/blamlib/hs/hs_types_traits.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_traits.hpp rename to source/blamlib/hs/hs_types_traits.hpp index 02273ac9f..327b4cdcf 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/hs_types_traits.hpp +++ b/source/blamlib/hs/hs_types_traits.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists.cpp b/source/blamlib/hs/object_lists.cpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists.cpp rename to source/blamlib/hs/object_lists.cpp index 5cd1ef649..b1f196ba2 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists.cpp +++ b/source/blamlib/hs/object_lists.cpp @@ -4,9 +4,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists.hpp b/source/blamlib/hs/object_lists.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists.hpp rename to source/blamlib/hs/object_lists.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists_structures.hpp b/source/blamlib/hs/object_lists_structures.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists_structures.hpp rename to source/blamlib/hs/object_lists_structures.hpp index e2d4b1faf..6322474ef 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/hs/object_lists_structures.hpp +++ b/source/blamlib/hs/object_lists_structures.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/input/input_abstraction.hpp b/source/blamlib/input/input_abstraction.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/input/input_abstraction.hpp rename to source/blamlib/input/input_abstraction.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/input/input_windows.hpp b/source/blamlib/input/input_windows.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/input/input_windows.hpp rename to source/blamlib/input/input_windows.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.cpp b/source/blamlib/interface/first_person_weapons.cpp similarity index 89% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.cpp rename to source/blamlib/interface/first_person_weapons.cpp index f53e9641c..3c7b02462 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.cpp +++ b/source/blamlib/interface/first_person_weapons.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.hpp b/source/blamlib/interface/first_person_weapons.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.hpp rename to source/blamlib/interface/first_person_weapons.hpp index 51722bf46..ed38dcf7a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons.hpp +++ b/source/blamlib/interface/first_person_weapons.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons_structures.hpp b/source/blamlib/interface/first_person_weapons_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/first_person_weapons_structures.hpp rename to source/blamlib/interface/first_person_weapons_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud.hpp b/source/blamlib/interface/hud.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud.hpp rename to source/blamlib/interface/hud.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_chat.hpp b/source/blamlib/interface/hud_chat.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_chat.hpp rename to source/blamlib/interface/hud_chat.hpp index 0f3288b7e..9f4e3df0e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_chat.hpp +++ b/source/blamlib/interface/hud_chat.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_definitions.hpp b/source/blamlib/interface/hud_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_definitions.hpp rename to source/blamlib/interface/hud_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_draw.hpp b/source/blamlib/interface/hud_draw.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_draw.hpp rename to source/blamlib/interface/hud_draw.hpp index d970edba6..3eb31dd3d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_draw.hpp +++ b/source/blamlib/interface/hud_draw.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging.hpp b/source/blamlib/interface/hud_messaging.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging.hpp rename to source/blamlib/interface/hud_messaging.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging_definitions.hpp b/source/blamlib/interface/hud_messaging_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging_definitions.hpp rename to source/blamlib/interface/hud_messaging_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging_structures.hpp b/source/blamlib/interface/hud_messaging_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_messaging_structures.hpp rename to source/blamlib/interface/hud_messaging_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_nav_points.hpp b/source/blamlib/interface/hud_nav_points.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_nav_points.hpp rename to source/blamlib/interface/hud_nav_points.hpp index f4291f312..80df9bc6a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_nav_points.hpp +++ b/source/blamlib/interface/hud_nav_points.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_unit.hpp b/source/blamlib/interface/hud_unit.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_unit.hpp rename to source/blamlib/interface/hud_unit.hpp index 4937dc0b5..fbf4fef11 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_unit.hpp +++ b/source/blamlib/interface/hud_unit.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_unit_structures.hpp b/source/blamlib/interface/hud_unit_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_unit_structures.hpp rename to source/blamlib/interface/hud_unit_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_weapon.hpp b/source/blamlib/interface/hud_weapon.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_weapon.hpp rename to source/blamlib/interface/hud_weapon.hpp index 7cc8df756..d0d214227 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_weapon.hpp +++ b/source/blamlib/interface/hud_weapon.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/hud_weapon_structures.hpp b/source/blamlib/interface/hud_weapon_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/hud_weapon_structures.hpp rename to source/blamlib/interface/hud_weapon_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/interface.hpp b/source/blamlib/interface/interface.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/interface.hpp rename to source/blamlib/interface/interface.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.cpp b/source/blamlib/interface/map_list.cpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.cpp rename to source/blamlib/interface/map_list.cpp index 1351728cf..5fad2526f 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.cpp +++ b/source/blamlib/interface/map_list.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include +#include +#include +#include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.hpp b/source/blamlib/interface/map_list.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.hpp rename to source/blamlib/interface/map_list.hpp index c6fe43a02..4e72f28aa 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/map_list.hpp +++ b/source/blamlib/interface/map_list.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/motion_sensor.hpp b/source/blamlib/interface/motion_sensor.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/motion_sensor.hpp rename to source/blamlib/interface/motion_sensor.hpp index 0b4549bba..db3e46acd 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/motion_sensor.hpp +++ b/source/blamlib/interface/motion_sensor.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include // for game teams -#include +#include // for game teams +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/terminal.hpp b/source/blamlib/interface/terminal.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/terminal.hpp rename to source/blamlib/interface/terminal.hpp index 867280883..6d297cb39 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/terminal.hpp +++ b/source/blamlib/interface/terminal.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_video_screen.hpp b/source/blamlib/interface/ui_video_screen.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_video_screen.hpp rename to source/blamlib/interface/ui_video_screen.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget.hpp b/source/blamlib/interface/ui_widget.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget.hpp rename to source/blamlib/interface/ui_widget.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_event_handler_functions.hpp b/source/blamlib/interface/ui_widget_event_handler_functions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_event_handler_functions.hpp rename to source/blamlib/interface/ui_widget_event_handler_functions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_game_data_input_functions.hpp b/source/blamlib/interface/ui_widget_game_data_input_functions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_game_data_input_functions.hpp rename to source/blamlib/interface/ui_widget_game_data_input_functions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_group.hpp b/source/blamlib/interface/ui_widget_group.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_group.hpp rename to source/blamlib/interface/ui_widget_group.hpp index 0f4211a09..8e4061e52 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_group.hpp +++ b/source/blamlib/interface/ui_widget_group.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_text_search_and_replace_functions.hpp b/source/blamlib/interface/ui_widget_text_search_and_replace_functions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/ui_widget_text_search_and_replace_functions.hpp rename to source/blamlib/interface/ui_widget_text_search_and_replace_functions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/unit_hud_interface_definition.hpp b/source/blamlib/interface/unit_hud_interface_definition.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/unit_hud_interface_definition.hpp rename to source/blamlib/interface/unit_hud_interface_definition.hpp index 88e987155..bed997bd2 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/unit_hud_interface_definition.hpp +++ b/source/blamlib/interface/unit_hud_interface_definition.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/interface/weapon_hud_interface_definition.hpp b/source/blamlib/interface/weapon_hud_interface_definition.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/interface/weapon_hud_interface_definition.hpp rename to source/blamlib/interface/weapon_hud_interface_definition.hpp index 9bebc950f..588711537 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/interface/weapon_hud_interface_definition.hpp +++ b/source/blamlib/interface/weapon_hud_interface_definition.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/equipment_definitions.hpp b/source/blamlib/items/equipment_definitions.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/items/equipment_definitions.hpp rename to source/blamlib/items/equipment_definitions.hpp index 4591dddbc..baf1d1ad4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/equipment_definitions.hpp +++ b/source/blamlib/items/equipment_definitions.hpp @@ -5,9 +5,9 @@ */ #pragma once -#include +#include -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/equipment_structures.hpp b/source/blamlib/items/equipment_structures.hpp similarity index 81% rename from OpenSauce/shared/Include/blamlib/Halo1/items/equipment_structures.hpp rename to source/blamlib/items/equipment_structures.hpp index fd4dbe1e3..6ed24db5b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/equipment_structures.hpp +++ b/source/blamlib/items/equipment_structures.hpp @@ -5,12 +5,12 @@ */ #pragma once -#include -#include +#include +#include -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/garbage_definitions.hpp b/source/blamlib/items/garbage_definitions.hpp similarity index 84% rename from OpenSauce/shared/Include/blamlib/Halo1/items/garbage_definitions.hpp rename to source/blamlib/items/garbage_definitions.hpp index 5521d4bf7..c8c4e0961 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/garbage_definitions.hpp +++ b/source/blamlib/items/garbage_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/item_definitions.hpp b/source/blamlib/items/item_definitions.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/items/item_definitions.hpp rename to source/blamlib/items/item_definitions.hpp index ea0fb7868..919c88c48 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/item_definitions.hpp +++ b/source/blamlib/items/item_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/item_structures.hpp b/source/blamlib/items/item_structures.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/items/item_structures.hpp rename to source/blamlib/items/item_structures.hpp index 40e4b406a..c75b850ad 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/item_structures.hpp +++ b/source/blamlib/items/item_structures.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/projectile_definitions.hpp b/source/blamlib/items/projectile_definitions.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/items/projectile_definitions.hpp rename to source/blamlib/items/projectile_definitions.hpp index 30f975d91..dd8a58af4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/projectile_definitions.hpp +++ b/source/blamlib/items/projectile_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/projectiles.hpp b/source/blamlib/items/projectiles.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/items/projectiles.hpp rename to source/blamlib/items/projectiles.hpp index 3b2ffcc29..54cad8618 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/projectiles.hpp +++ b/source/blamlib/items/projectiles.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/weapon_definitions.hpp b/source/blamlib/items/weapon_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/items/weapon_definitions.hpp rename to source/blamlib/items/weapon_definitions.hpp index 04729eb3f..462958f5e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/weapon_definitions.hpp +++ b/source/blamlib/items/weapon_definitions.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/weapon_structures.hpp b/source/blamlib/items/weapon_structures.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/items/weapon_structures.hpp rename to source/blamlib/items/weapon_structures.hpp index d1ea75b74..8326ed809 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/weapon_structures.hpp +++ b/source/blamlib/items/weapon_structures.hpp @@ -5,10 +5,10 @@ */ #pragma once -#include -#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/items/weapons.hpp b/source/blamlib/items/weapons.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/items/weapons.hpp rename to source/blamlib/items/weapons.hpp index c690230cb..af95dabcc 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/items/weapons.hpp +++ b/source/blamlib/items/weapons.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/console.hpp b/source/blamlib/main/console.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/main/console.hpp rename to source/blamlib/main/console.hpp index 183059599..433d367a4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/main/console.hpp +++ b/source/blamlib/main/console.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/editor.hpp b/source/blamlib/main/editor.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/main/editor.hpp rename to source/blamlib/main/editor.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/levels.hpp b/source/blamlib/main/levels.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/main/levels.hpp rename to source/blamlib/main/levels.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/main.cpp b/source/blamlib/main/main.cpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/main/main.cpp rename to source/blamlib/main/main.cpp index 69145d2c3..cbd0ed330 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/main/main.cpp +++ b/source/blamlib/main/main.cpp @@ -5,10 +5,10 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/main.hpp b/source/blamlib/main/main.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/main/main.hpp rename to source/blamlib/main/main.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/main/main_structures.hpp b/source/blamlib/main/main_structures.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/main/main_structures.hpp rename to source/blamlib/main/main_structures.hpp index 158ab5450..6adb92b5c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/main/main_structures.hpp +++ b/source/blamlib/main/main_structures.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/math/color_math.hpp b/source/blamlib/math/color_math.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/math/color_math.hpp rename to source/blamlib/math/color_math.hpp diff --git a/OpenSauce/shared/Include/blamlib/math/integer_math.hpp b/source/blamlib/math/integer_math.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/math/integer_math.hpp rename to source/blamlib/math/integer_math.hpp diff --git a/OpenSauce/shared/Include/blamlib/math/matrix_math.hpp b/source/blamlib/math/matrix_math.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/math/matrix_math.hpp rename to source/blamlib/math/matrix_math.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/math/periodic_functions.hpp b/source/blamlib/math/periodic_functions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/math/periodic_functions.hpp rename to source/blamlib/math/periodic_functions.hpp diff --git a/OpenSauce/shared/Include/blamlib/math/real_math.cpp b/source/blamlib/math/real_math.cpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/math/real_math.cpp rename to source/blamlib/math/real_math.cpp diff --git a/OpenSauce/shared/Include/blamlib/math/real_math.hpp b/source/blamlib/math/real_math.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/math/real_math.hpp rename to source/blamlib/math/real_math.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/array.hpp b/source/blamlib/memory/array.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/array.hpp rename to source/blamlib/memory/array.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/bitstream.hpp b/source/blamlib/memory/bitstream.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/bitstream.hpp rename to source/blamlib/memory/bitstream.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/byte_swapping.cpp b/source/blamlib/memory/byte_swapping.cpp similarity index 73% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/byte_swapping.cpp rename to source/blamlib/memory/byte_swapping.cpp index 0ab4b33f0..73d3f276e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/memory/byte_swapping.cpp +++ b/source/blamlib/memory/byte_swapping.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/byte_swapping.hpp b/source/blamlib/memory/byte_swapping.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/byte_swapping.hpp rename to source/blamlib/memory/byte_swapping.hpp diff --git a/OpenSauce/shared/Include/blamlib/memory/byte_swapping_base.hpp b/source/blamlib/memory/byte_swapping_base.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/memory/byte_swapping_base.hpp rename to source/blamlib/memory/byte_swapping_base.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/circular_queue.hpp b/source/blamlib/memory/circular_queue.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/circular_queue.hpp rename to source/blamlib/memory/circular_queue.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/data.cpp b/source/blamlib/memory/data.cpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/data.cpp rename to source/blamlib/memory/data.cpp index 691fd744e..3f98b8b18 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/memory/data.cpp +++ b/source/blamlib/memory/data.cpp @@ -4,7 +4,7 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include static const Yelo::datum_index::salt_t k_datum_index_salt_msb = 1U << diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/data.hpp b/source/blamlib/memory/data.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/data.hpp rename to source/blamlib/memory/data.hpp index 917885325..37dc9c80b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/memory/data.hpp +++ b/source/blamlib/memory/data.hpp @@ -99,4 +99,4 @@ namespace Yelo }; }; -#include \ No newline at end of file +#include \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/memory/data_base.cpp b/source/blamlib/memory/data_base.cpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/memory/data_base.cpp rename to source/blamlib/memory/data_base.cpp diff --git a/OpenSauce/shared/Include/blamlib/memory/data_base.hpp b/source/blamlib/memory/data_base.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/memory/data_base.hpp rename to source/blamlib/memory/data_base.hpp diff --git a/OpenSauce/shared/Include/blamlib/memory/datum_index.hpp b/source/blamlib/memory/datum_index.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/memory/datum_index.hpp rename to source/blamlib/memory/datum_index.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/lruv_cache.hpp b/source/blamlib/memory/lruv_cache.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/lruv_cache.hpp rename to source/blamlib/memory/lruv_cache.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/memory/memory_pool.hpp b/source/blamlib/memory/memory_pool.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/memory/memory_pool.hpp rename to source/blamlib/memory/memory_pool.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/models/collision_model_definitions.hpp b/source/blamlib/models/collision_model_definitions.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/models/collision_model_definitions.hpp rename to source/blamlib/models/collision_model_definitions.hpp index 04aa1cc7f..7e51acf37 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/models/collision_model_definitions.hpp +++ b/source/blamlib/models/collision_model_definitions.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/models/model_animation_definitions.hpp b/source/blamlib/models/model_animation_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/models/model_animation_definitions.hpp rename to source/blamlib/models/model_animation_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/models/model_animations.hpp b/source/blamlib/models/model_animations.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/models/model_animations.hpp rename to source/blamlib/models/model_animations.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/models/model_definitions.hpp b/source/blamlib/models/model_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/models/model_definitions.hpp rename to source/blamlib/models/model_definitions.hpp index 719e5b5d7..2ab2f5071 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/models/model_definitions.hpp +++ b/source/blamlib/models/model_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/models/models.hpp b/source/blamlib/models/models.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/models/models.hpp rename to source/blamlib/models/models.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/message_delta_definitions.hpp b/source/blamlib/networking/message_delta_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/message_delta_definitions.hpp rename to source/blamlib/networking/message_delta_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/message_delta_parameters_protocol.hpp b/source/blamlib/networking/message_delta_parameters_protocol.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/message_delta_parameters_protocol.hpp rename to source/blamlib/networking/message_delta_parameters_protocol.hpp index b167c6a50..4292077a5 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/message_delta_parameters_protocol.hpp +++ b/source/blamlib/networking/message_delta_parameters_protocol.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_manager.hpp b/source/blamlib/networking/network_client_manager.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_manager.hpp rename to source/blamlib/networking/network_client_manager.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_manager_structures.hpp b/source/blamlib/networking/network_client_manager_structures.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_manager_structures.hpp rename to source/blamlib/networking/network_client_manager_structures.hpp index a48f57e13..f248da522 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_manager_structures.hpp +++ b/source/blamlib/networking/network_client_manager_structures.hpp @@ -6,12 +6,12 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_time.hpp b/source/blamlib/networking/network_client_time.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_client_time.hpp rename to source/blamlib/networking/network_client_time.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_connection.hpp b/source/blamlib/networking/network_connection.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_connection.hpp rename to source/blamlib/networking/network_connection.hpp index 909563ab1..123595ab4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_connection.hpp +++ b/source/blamlib/networking/network_connection.hpp @@ -6,12 +6,12 @@ */ #pragma once -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_globals.hpp b/source/blamlib/networking/network_game_globals.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_globals.hpp rename to source/blamlib/networking/network_game_globals.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager.hpp b/source/blamlib/networking/network_game_manager.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager.hpp rename to source/blamlib/networking/network_game_manager.hpp index 2903d681f..35101b92d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager.hpp +++ b/source/blamlib/networking/network_game_manager.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager_structures.hpp b/source/blamlib/networking/network_game_manager_structures.hpp similarity index 83% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager_structures.hpp rename to source/blamlib/networking/network_game_manager_structures.hpp index 30da3a482..d3ca474cf 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_game_manager_structures.hpp +++ b/source/blamlib/networking/network_game_manager_structures.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_messages.hpp b/source/blamlib/networking/network_messages.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_messages.hpp rename to source/blamlib/networking/network_messages.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_messages_structures.hpp b/source/blamlib/networking/network_messages_structures.hpp similarity index 80% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_messages_structures.hpp rename to source/blamlib/networking/network_messages_structures.hpp index 69c3b190c..f3b9c90dc 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_messages_structures.hpp +++ b/source/blamlib/networking/network_messages_structures.hpp @@ -6,12 +6,12 @@ */ #pragma once -//#include -#include -#include -#include -#include -#include +//#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_server_manager.hpp b/source/blamlib/networking/network_server_manager.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_server_manager.hpp rename to source/blamlib/networking/network_server_manager.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_server_manager_structures.hpp b/source/blamlib/networking/network_server_manager_structures.hpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/network_server_manager_structures.hpp rename to source/blamlib/networking/network_server_manager_structures.hpp index fc10e730e..43ecebb7d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/network_server_manager_structures.hpp +++ b/source/blamlib/networking/network_server_manager_structures.hpp @@ -6,13 +6,13 @@ */ #pragma once -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update.hpp b/source/blamlib/networking/player_update.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/player_update.hpp rename to source/blamlib/networking/player_update.hpp index 4ee123849..a10634f43 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update.hpp +++ b/source/blamlib/networking/player_update.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_client.hpp b/source/blamlib/networking/player_update_client.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_client.hpp rename to source/blamlib/networking/player_update_client.hpp index bc616ef62..b8addf504 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_client.hpp +++ b/source/blamlib/networking/player_update_client.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_history.hpp b/source/blamlib/networking/player_update_history.hpp similarity index 87% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_history.hpp rename to source/blamlib/networking/player_update_history.hpp index cc842aedd..3d84297c5 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_history.hpp +++ b/source/blamlib/networking/player_update_history.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_server.hpp b/source/blamlib/networking/player_update_server.hpp similarity index 88% rename from OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_server.hpp rename to source/blamlib/networking/player_update_server.hpp index cf0cb0940..caa9d88fa 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/networking/player_update_server.hpp +++ b/source/blamlib/networking/player_update_server.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/damage.hpp b/source/blamlib/objects/damage.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/damage.hpp rename to source/blamlib/objects/damage.hpp index 336e1aae8..73155f3d2 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/damage.hpp +++ b/source/blamlib/objects/damage.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/index_resolution.hpp b/source/blamlib/objects/index_resolution.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/index_resolution.hpp rename to source/blamlib/objects/index_resolution.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_definitions.hpp b/source/blamlib/objects/object_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/object_definitions.hpp rename to source/blamlib/objects/object_definitions.hpp index 61328bc9b..f3a1caf05 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_definitions.hpp +++ b/source/blamlib/objects/object_definitions.hpp @@ -5,9 +5,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_lights.hpp b/source/blamlib/objects/object_lights.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/object_lights.hpp rename to source/blamlib/objects/object_lights.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.cpp b/source/blamlib/objects/object_structures.cpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.cpp rename to source/blamlib/objects/object_structures.cpp index ede51fe95..4cd79a918 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.cpp +++ b/source/blamlib/objects/object_structures.cpp @@ -5,7 +5,7 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.hpp b/source/blamlib/objects/object_structures.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.hpp rename to source/blamlib/objects/object_structures.hpp index d3ba05fdf..0223b99b0 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_structures.hpp +++ b/source/blamlib/objects/object_structures.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/object_types.hpp b/source/blamlib/objects/object_types.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/object_types.hpp rename to source/blamlib/objects/object_types.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/objects.cpp b/source/blamlib/objects/objects.cpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/objects.cpp rename to source/blamlib/objects/objects.cpp index dc57152f4..ea804052d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/objects.cpp +++ b/source/blamlib/objects/objects.cpp @@ -5,12 +5,12 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/objects.hpp b/source/blamlib/objects/objects.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/objects.hpp rename to source/blamlib/objects/objects.hpp index 53459083c..69ad75b6b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/objects.hpp +++ b/source/blamlib/objects/objects.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include // for object names +#include +#include +#include +#include // for object names namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/placeholder_definitions.hpp b/source/blamlib/objects/placeholder_definitions.hpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/placeholder_definitions.hpp rename to source/blamlib/objects/placeholder_definitions.hpp index dd6aba767..3edb2da49 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/placeholder_definitions.hpp +++ b/source/blamlib/objects/placeholder_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/scenery_definitions.hpp b/source/blamlib/objects/scenery_definitions.hpp similarity index 83% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/scenery_definitions.hpp rename to source/blamlib/objects/scenery_definitions.hpp index 600acd104..7b832fd31 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/scenery_definitions.hpp +++ b/source/blamlib/objects/scenery_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/sound_scenery_definitions.hpp b/source/blamlib/objects/sound_scenery_definitions.hpp similarity index 84% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/sound_scenery_definitions.hpp rename to source/blamlib/objects/sound_scenery_definitions.hpp index 425ba01a7..19cf87f1d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/sound_scenery_definitions.hpp +++ b/source/blamlib/objects/sound_scenery_definitions.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/vehicle_remapper.hpp b/source/blamlib/objects/vehicle_remapper.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/vehicle_remapper.hpp rename to source/blamlib/objects/vehicle_remapper.hpp index d8f3e4a17..3fa63a932 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/objects/vehicle_remapper.hpp +++ b/source/blamlib/objects/vehicle_remapper.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/objects/widgets/widgets.hpp b/source/blamlib/objects/widgets/widgets.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/objects/widgets/widgets.hpp rename to source/blamlib/objects/widgets/widgets.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_bsp.hpp b/source/blamlib/physics/collision_bsp.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/collision_bsp.hpp rename to source/blamlib/physics/collision_bsp.hpp index 3fc29135d..21038bff5 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_bsp.hpp +++ b/source/blamlib/physics/collision_bsp.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_bsp_definitions.hpp b/source/blamlib/physics/collision_bsp_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/collision_bsp_definitions.hpp rename to source/blamlib/physics/collision_bsp_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_features.hpp b/source/blamlib/physics/collision_features.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/collision_features.hpp rename to source/blamlib/physics/collision_features.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_models.hpp b/source/blamlib/physics/collision_models.hpp similarity index 86% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/collision_models.hpp rename to source/blamlib/physics/collision_models.hpp index 5164ae499..5256f69c8 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/physics/collision_models.hpp +++ b/source/blamlib/physics/collision_models.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/collisions.hpp b/source/blamlib/physics/collisions.hpp similarity index 87% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/collisions.hpp rename to source/blamlib/physics/collisions.hpp index 28ccf142a..59d7ea03c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/physics/collisions.hpp +++ b/source/blamlib/physics/collisions.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/physics.hpp b/source/blamlib/physics/physics.hpp similarity index 91% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/physics.hpp rename to source/blamlib/physics/physics.hpp index f264fc8f1..07977de64 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/physics/physics.hpp +++ b/source/blamlib/physics/physics.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/physics/point_physics.hpp b/source/blamlib/physics/point_physics.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/physics/point_physics.hpp rename to source/blamlib/physics/point_physics.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9.hpp b/source/blamlib/rasterizer/dx9/rasterizer_dx9.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9.hpp rename to source/blamlib/rasterizer/dx9/rasterizer_dx9.hpp index d8616e840..1caec75e5 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9.hpp +++ b/source/blamlib/rasterizer/dx9/rasterizer_dx9.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include struct IDirect3DVertexDeclaration9; diff --git a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9_render_targets.cpp b/source/blamlib/rasterizer/dx9/rasterizer_dx9_render_targets.cpp similarity index 89% rename from OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9_render_targets.cpp rename to source/blamlib/rasterizer/dx9/rasterizer_dx9_render_targets.cpp index d1b78a296..418016324 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9_render_targets.cpp +++ b/source/blamlib/rasterizer/dx9/rasterizer_dx9_render_targets.cpp @@ -6,7 +6,7 @@ */ #include "Common/Precompile.hpp" #if !PLATFORM_IS_EDITOR -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9_render_targets.hpp b/source/blamlib/rasterizer/dx9/rasterizer_dx9_render_targets.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/rasterizer/dx9/rasterizer_dx9_render_targets.hpp rename to source/blamlib/rasterizer/dx9/rasterizer_dx9_render_targets.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/rasterizer.hpp b/source/blamlib/rasterizer/rasterizer.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/rasterizer/rasterizer.hpp rename to source/blamlib/rasterizer/rasterizer.hpp index 113c264b6..96a6bd80f 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/rasterizer.hpp +++ b/source/blamlib/rasterizer/rasterizer.hpp @@ -6,15 +6,15 @@ */ #pragma once -#include -#include -#include +#include +#include +#include #if PLATFORM_TARGET == PLATFORM_TARGET_XBOX // TODO #else #include - #include + #include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/rasterizer/rasterizer_geometry.hpp b/source/blamlib/rasterizer/rasterizer_geometry.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/rasterizer/rasterizer_geometry.hpp rename to source/blamlib/rasterizer/rasterizer_geometry.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/render/render.hpp b/source/blamlib/render/render.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/render/render.hpp rename to source/blamlib/render/render.hpp index d33a11d4a..23cdc212e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/render/render.hpp +++ b/source/blamlib/render/render.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/render/render_cameras.hpp b/source/blamlib/render/render_cameras.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/render/render_cameras.hpp rename to source/blamlib/render/render_cameras.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/render/render_constants.hpp b/source/blamlib/render/render_constants.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/render/render_constants.hpp rename to source/blamlib/render/render_constants.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/render/render_objects.hpp b/source/blamlib/render/render_objects.hpp similarity index 79% rename from OpenSauce/shared/Include/blamlib/Halo1/render/render_objects.hpp rename to source/blamlib/render/render_objects.hpp index 5b8efb0ab..e070a65e4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/render/render_objects.hpp +++ b/source/blamlib/render/render_objects.hpp @@ -6,11 +6,11 @@ */ #pragma once -#include +#include -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state.hpp b/source/blamlib/saved_games/game_state.hpp similarity index 81% rename from OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state.hpp rename to source/blamlib/saved_games/game_state.hpp index a6105a14c..e1d521a6d 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state.hpp +++ b/source/blamlib/saved_games/game_state.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state_structures.hpp b/source/blamlib/saved_games/game_state_structures.hpp similarity index 82% rename from OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state_structures.hpp rename to source/blamlib/saved_games/game_state_structures.hpp index eb59a0464..f026f1a58 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_state_structures.hpp +++ b/source/blamlib/saved_games/game_state_structures.hpp @@ -6,9 +6,9 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_variant.hpp b/source/blamlib/saved_games/game_variant.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_variant.hpp rename to source/blamlib/saved_games/game_variant.hpp index f0c5a6e9d..29a51484c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/game_variant.hpp +++ b/source/blamlib/saved_games/game_variant.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/player_profile.hpp b/source/blamlib/saved_games/player_profile.hpp similarity index 87% rename from OpenSauce/shared/Include/blamlib/Halo1/saved_games/player_profile.hpp rename to source/blamlib/saved_games/player_profile.hpp index a689bfbfe..8123fff5b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/player_profile.hpp +++ b/source/blamlib/saved_games/player_profile.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/saved_games/saved_game_constants.hpp b/source/blamlib/saved_games/saved_game_constants.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/saved_games/saved_game_constants.hpp rename to source/blamlib/saved_games/saved_game_constants.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario.cpp b/source/blamlib/scenario/scenario.cpp similarity index 87% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario.cpp rename to source/blamlib/scenario/scenario.cpp index 9de8e7d1e..cf2d13f14 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario.cpp +++ b/source/blamlib/scenario/scenario.cpp @@ -4,18 +4,18 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario.hpp b/source/blamlib/scenario/scenario.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario.hpp rename to source/blamlib/scenario/scenario.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_definitions.hpp b/source/blamlib/scenario/scenario_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_definitions.hpp rename to source/blamlib/scenario/scenario_definitions.hpp index bc328773f..3a0f22306 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_definitions.hpp +++ b/source/blamlib/scenario/scenario_definitions.hpp @@ -6,12 +6,12 @@ */ #pragma once -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/scenario/scenario_location.hpp b/source/blamlib/scenario/scenario_location.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/scenario/scenario_location.hpp rename to source/blamlib/scenario/scenario_location.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_object_definitions_structures.hpp b/source/blamlib/scenario/scenario_object_definitions_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_object_definitions_structures.hpp rename to source/blamlib/scenario/scenario_object_definitions_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_structures.hpp b/source/blamlib/scenario/scenario_structures.hpp similarity index 85% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_structures.hpp rename to source/blamlib/scenario/scenario_structures.hpp index e477fd1b7..07d14e788 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/scenario/scenario_structures.hpp +++ b/source/blamlib/scenario/scenario_structures.hpp @@ -6,8 +6,8 @@ */ #pragma once -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/scenario/sky_definitions.hpp b/source/blamlib/scenario/sky_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/scenario/sky_definitions.hpp rename to source/blamlib/scenario/sky_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/shaders/shader_definitions.hpp b/source/blamlib/shaders/shader_definitions.hpp similarity index 97% rename from OpenSauce/shared/Include/blamlib/Halo1/shaders/shader_definitions.hpp rename to source/blamlib/shaders/shader_definitions.hpp index 4cade9f3b..de1b19bcf 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/shaders/shader_definitions.hpp +++ b/source/blamlib/shaders/shader_definitions.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/shell/shell.hpp b/source/blamlib/shell/shell.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/shell/shell.hpp rename to source/blamlib/shell/shell.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/sound/sound_definitions.hpp b/source/blamlib/sound/sound_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/sound/sound_definitions.hpp rename to source/blamlib/sound/sound_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/sound/sound_environment_definitions.hpp b/source/blamlib/sound/sound_environment_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/sound/sound_environment_definitions.hpp rename to source/blamlib/sound/sound_environment_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/structures/cluster_partitions.hpp b/source/blamlib/structures/cluster_partitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/structures/cluster_partitions.hpp rename to source/blamlib/structures/cluster_partitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/structures/structure_bsp_definitions.hpp b/source/blamlib/structures/structure_bsp_definitions.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/structures/structure_bsp_definitions.hpp rename to source/blamlib/structures/structure_bsp_definitions.hpp index e1221dbb3..9fb00427e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/structures/structure_bsp_definitions.hpp +++ b/source/blamlib/structures/structure_bsp_definitions.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/files.hpp b/source/blamlib/tag_files/files.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/files.hpp rename to source/blamlib/tag_files/files.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/files_windows.cpp b/source/blamlib/tag_files/files_windows.cpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/files_windows.cpp rename to source/blamlib/tag_files/files_windows.cpp index e85f661ed..816c030c8 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/files_windows.cpp +++ b/source/blamlib/tag_files/files_windows.cpp @@ -4,9 +4,9 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_collection_definitions.hpp b/source/blamlib/tag_files/tag_collection_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_collection_definitions.hpp rename to source/blamlib/tag_files/tag_collection_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_field_scanner.hpp b/source/blamlib/tag_files/tag_field_scanner.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_field_scanner.hpp rename to source/blamlib/tag_files/tag_field_scanner.hpp index e9899a99e..b8f173d72 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_field_scanner.hpp +++ b/source/blamlib/tag_files/tag_field_scanner.hpp @@ -6,7 +6,7 @@ #pragma once #if PLATFORM_IS_EDITOR -#include +#include //#define __TAG_FIELD_SCAN_USE_BLAM_DATA diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files.cpp b/source/blamlib/tag_files/tag_files.cpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files.cpp rename to source/blamlib/tag_files/tag_files.cpp index 2f4aee0d4..bcaf39f1c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files.cpp +++ b/source/blamlib/tag_files/tag_files.cpp @@ -4,15 +4,15 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include #if PLATFORM_IS_EDITOR -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files.hpp b/source/blamlib/tag_files/tag_files.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files.hpp rename to source/blamlib/tag_files/tag_files.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files_structures.hpp b/source/blamlib/tag_files/tag_files_structures.hpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files_structures.hpp rename to source/blamlib/tag_files/tag_files_structures.hpp index de9ee6b1c..2adfc54f4 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_files_structures.hpp +++ b/source/blamlib/tag_files/tag_files_structures.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_loading.cpp b/source/blamlib/tag_files/tag_group_loading.cpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_loading.cpp rename to source/blamlib/tag_files/tag_group_loading.cpp index 79260868c..e0a4147a6 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_loading.cpp +++ b/source/blamlib/tag_files/tag_group_loading.cpp @@ -5,15 +5,15 @@ */ #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include - -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include /* TODO: diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_loading.hpp b/source/blamlib/tag_files/tag_group_loading.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_loading.hpp rename to source/blamlib/tag_files/tag_group_loading.hpp diff --git a/source/blamlib/tag_files/tag_group_saving.cpp b/source/blamlib/tag_files/tag_group_saving.cpp new file mode 100644 index 000000000..88be921e2 --- /dev/null +++ b/source/blamlib/tag_files/tag_group_saving.cpp @@ -0,0 +1,23 @@ +/* + Yelo: Open Sauce SDK + + See license\OpenSauce\OpenSauce for specific license information +*/ +#include "Common/Precompile.hpp" +#if PLATFORM_IS_EDITOR +#include + +#include +#include +#include +#include +#include + +namespace Yelo +{ + namespace blam + { + }; +}; + +#endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.hpp b/source/blamlib/tag_files/tag_group_saving.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_saving.hpp rename to source/blamlib/tag_files/tag_group_saving.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.cpp b/source/blamlib/tag_files/tag_group_verification.cpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.cpp rename to source/blamlib/tag_files/tag_group_verification.cpp index d29b2bd65..0dccf242e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.cpp +++ b/source/blamlib/tag_files/tag_group_verification.cpp @@ -6,9 +6,9 @@ // NOTE: NON-STANDARD ENGINE SOURCE FILE #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.hpp b/source/blamlib/tag_files/tag_group_verification.hpp similarity index 90% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.hpp rename to source/blamlib/tag_files/tag_group_verification.hpp index eaffa0735..637bc369e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_group_verification.hpp +++ b/source/blamlib/tag_files/tag_group_verification.hpp @@ -6,7 +6,7 @@ // NOTE: NON-STANDARD ENGINE SOURCE FILE #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.cpp b/source/blamlib/tag_files/tag_groups.cpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.cpp rename to source/blamlib/tag_files/tag_groups.cpp index 4e2389846..5da4afc72 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.cpp +++ b/source/blamlib/tag_files/tag_groups.cpp @@ -4,13 +4,13 @@ See license\OpenSauce\OpenSauce for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Yelo { @@ -679,5 +679,5 @@ namespace Yelo }; #if PLATFORM_IS_EDITOR -#include +#include #endif \ No newline at end of file diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.field_definitions.inl b/source/blamlib/tag_files/tag_groups.field_definitions.inl similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.field_definitions.inl rename to source/blamlib/tag_files/tag_groups.field_definitions.inl diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.hpp b/source/blamlib/tag_files/tag_groups.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.hpp rename to source/blamlib/tag_files/tag_groups.hpp index 11158317f..e0c2fb00a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups.hpp +++ b/source/blamlib/tag_files/tag_groups.hpp @@ -9,7 +9,7 @@ #include #if PLATFORM_IS_EDITOR - #include + #include #endif namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/tag_files/tag_groups_base.cpp b/source/blamlib/tag_files/tag_groups_base.cpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/tag_files/tag_groups_base.cpp rename to source/blamlib/tag_files/tag_groups_base.cpp diff --git a/OpenSauce/shared/Include/blamlib/tag_files/tag_groups_base.hpp b/source/blamlib/tag_files/tag_groups_base.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/tag_files/tag_groups_base.hpp rename to source/blamlib/tag_files/tag_groups_base.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_field_scan.cpp b/source/blamlib/tag_files/tag_groups_field_scan.cpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_field_scan.cpp rename to source/blamlib/tag_files/tag_groups_field_scan.cpp index 9c9cd117d..6994f5f0a 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_field_scan.cpp +++ b/source/blamlib/tag_files/tag_groups_field_scan.cpp @@ -6,10 +6,10 @@ // NOTE: NON-STANDARD ENGINE SOURCE FILE #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include -#include +#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_structures.hpp b/source/blamlib/tag_files/tag_groups_structures.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_structures.hpp rename to source/blamlib/tag_files/tag_groups_structures.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_structures_macros.hpp b/source/blamlib/tag_files/tag_groups_structures_macros.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_structures_macros.hpp rename to source/blamlib/tag_files/tag_groups_structures_macros.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_system.cpp b/source/blamlib/tag_files/tag_groups_system.cpp similarity index 94% rename from OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_system.cpp rename to source/blamlib/tag_files/tag_groups_system.cpp index f1a659c40..35e44bcca 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/tag_files/tag_groups_system.cpp +++ b/source/blamlib/tag_files/tag_groups_system.cpp @@ -6,13 +6,13 @@ // NOTE: NON-STANDARD ENGINE SOURCE FILE #include "Common/Precompile.hpp" #if PLATFORM_IS_EDITOR -#include +#include -#include -#include -#include +#include +#include +#include #include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/text/draw_string.hpp b/source/blamlib/text/draw_string.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/text/draw_string.hpp rename to source/blamlib/text/draw_string.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/text/text_group.hpp b/source/blamlib/text/text_group.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/text/text_group.hpp rename to source/blamlib/text/text_group.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/tool/tool.hpp b/source/blamlib/tool/tool.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/tool/tool.hpp rename to source/blamlib/tool/tool.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/biped_definitions.hpp b/source/blamlib/units/biped_definitions.hpp similarity index 96% rename from OpenSauce/shared/Include/blamlib/Halo1/units/biped_definitions.hpp rename to source/blamlib/units/biped_definitions.hpp index 598ee1660..1d5d5d495 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/biped_definitions.hpp +++ b/source/blamlib/units/biped_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/biped_structures.hpp b/source/blamlib/units/biped_structures.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/biped_structures.hpp rename to source/blamlib/units/biped_structures.hpp index 6cff5d80e..805cd37ee 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/biped_structures.hpp +++ b/source/blamlib/units/biped_structures.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/bipeds.hpp b/source/blamlib/units/bipeds.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/bipeds.hpp rename to source/blamlib/units/bipeds.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/dialogue_definitions.hpp b/source/blamlib/units/dialogue_definitions.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/dialogue_definitions.hpp rename to source/blamlib/units/dialogue_definitions.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_camera.hpp b/source/blamlib/units/unit_camera.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_camera.hpp rename to source/blamlib/units/unit_camera.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_control.hpp b/source/blamlib/units/unit_control.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_control.hpp rename to source/blamlib/units/unit_control.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_definitions.hpp b/source/blamlib/units/unit_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_definitions.hpp rename to source/blamlib/units/unit_definitions.hpp index 36333515a..96a60b20e 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_definitions.hpp +++ b/source/blamlib/units/unit_definitions.hpp @@ -6,10 +6,10 @@ */ #pragma once -#include -#include +#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_dialogue.hpp b/source/blamlib/units/unit_dialogue.hpp similarity index 92% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_dialogue.hpp rename to source/blamlib/units/unit_dialogue.hpp index 45d6ae0b8..a979e532c 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_dialogue.hpp +++ b/source/blamlib/units/unit_dialogue.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_script.hpp b/source/blamlib/units/unit_script.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_script.hpp rename to source/blamlib/units/unit_script.hpp diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.cpp b/source/blamlib/units/unit_structures.cpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.cpp rename to source/blamlib/units/unit_structures.cpp index cc3b1a2ea..4a8ee058f 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.cpp +++ b/source/blamlib/units/unit_structures.cpp @@ -5,9 +5,9 @@ See license\OpenSauce\Halo1_CE for specific license information */ #include "Common/Precompile.hpp" -#include +#include -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.hpp b/source/blamlib/units/unit_structures.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.hpp rename to source/blamlib/units/unit_structures.hpp index d64892af2..def6f3193 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/unit_structures.hpp +++ b/source/blamlib/units/unit_structures.hpp @@ -5,12 +5,12 @@ */ #pragma once -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace Yelo { @@ -358,7 +358,7 @@ namespace Yelo PAD32; // 0x4C8 unused ////////////////////////////////////////////////////////////////////////// - public: // see YeloLib/Halo1/units/units_grenade_count_upgrade.inl + public: // see YeloLib/units/units_grenade_count_upgrade.inl static const size_t k_offset_zoom_level; static const size_t k_offset_desired_zoom_level; diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/units.hpp b/source/blamlib/units/units.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/units.hpp rename to source/blamlib/units/units.hpp index 2deb608f7..2e265b379 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/units.hpp +++ b/source/blamlib/units/units.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_definitions.hpp b/source/blamlib/units/vehicle_definitions.hpp similarity index 95% rename from OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_definitions.hpp rename to source/blamlib/units/vehicle_definitions.hpp index 028a1ecbc..9f7d0ca1b 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_definitions.hpp +++ b/source/blamlib/units/vehicle_definitions.hpp @@ -6,7 +6,7 @@ */ #pragma once -#include +#include namespace Yelo { diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_structures.hpp b/source/blamlib/units/vehicle_structures.hpp similarity index 93% rename from OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_structures.hpp rename to source/blamlib/units/vehicle_structures.hpp index bef7f98cd..5f74f4ab0 100644 --- a/OpenSauce/shared/Include/blamlib/Halo1/units/vehicle_structures.hpp +++ b/source/blamlib/units/vehicle_structures.hpp @@ -5,8 +5,8 @@ */ #pragma once -#include -#include +#include +#include #include namespace Yelo diff --git a/OpenSauce/shared/Include/blamlib/Halo1/units/vehicles.hpp b/source/blamlib/units/vehicles.hpp similarity index 100% rename from OpenSauce/shared/Include/blamlib/Halo1/units/vehicles.hpp rename to source/blamlib/units/vehicles.hpp