├── logo ├── logo.ico ├── logo.png ├── logo_text.png ├── logo_tiny.png ├── logo_text_h.png ├── logo_text_full.png └── logo_transparent.png ├── src ├── kiwano │ ├── 2d │ │ ├── Actor.h │ │ ├── Stage.h │ │ ├── Canvas.h │ │ ├── Sprite.h │ │ ├── DebugActor.h │ │ ├── GifSprite.h │ │ ├── LayerActor.h │ │ ├── ShapeActor.h │ │ ├── TextActor.h │ │ ├── GifSprite.cpp │ │ ├── TextActor.cpp │ │ ├── animation │ │ │ ├── Animator.h │ │ │ ├── EaseFunc.h │ │ │ ├── Animation.h │ │ │ ├── PathAnimation.h │ │ │ ├── AnimationGroup.h │ │ │ ├── CustomAnimation.h │ │ │ ├── DelayAnimation.h │ │ │ ├── FrameAnimation.h │ │ │ ├── TweenAnimation.h │ │ │ ├── AnimationWrapper.h │ │ │ └── DelayAnimation.cpp │ │ ├── transition │ │ │ ├── Transition.h │ │ │ ├── BoxTransition.h │ │ │ ├── FadeTransition.h │ │ │ ├── MoveTransition.h │ │ │ ├── RotationTransition.h │ │ │ ├── BoxTransition.cpp │ │ │ └── FadeTransition.cpp │ │ ├── LayerActor.cpp │ │ └── Stage.cpp │ ├── core │ │ ├── Any.h │ │ ├── Common.h │ │ ├── String.h │ │ ├── Time.h │ │ ├── UUID.h │ │ ├── Duration.h │ │ ├── Library.h │ │ ├── Resource.h │ │ ├── Allocator.h │ │ ├── BinaryData.h │ │ ├── Duration.cpp │ │ ├── Exception.h │ │ ├── RefBasePtr.hpp │ │ ├── Serializable.h │ │ ├── IntrusiveList.hpp │ │ ├── Cloneable.h │ │ ├── Singleton.h │ │ ├── BitOperator.h │ │ ├── Library.cpp │ │ ├── UUID.cpp │ │ ├── Allocator.cpp │ │ └── Defer.h │ ├── base │ │ ├── Module.h │ │ ├── RefPtr.h │ │ ├── Director.h │ │ ├── ObjectBase.h │ │ ├── RefObject.h │ │ └── component │ │ │ ├── Button.h │ │ │ ├── Component.h │ │ │ ├── MouseSensor.h │ │ │ ├── ComponentManager.h │ │ │ ├── Component.cpp │ │ │ └── Button.cpp │ ├── event │ │ ├── Event.h │ │ ├── EventType.h │ │ ├── KeyEvent.h │ │ ├── MouseEvent.h │ │ ├── WindowEvent.h │ │ ├── EventDispatcher.h │ │ ├── listener │ │ │ ├── EventListener.h │ │ │ ├── KeyEventListener.h │ │ │ ├── MouseEventListener.h │ │ │ └── KeyEventListener.cpp │ │ ├── Event.cpp │ │ ├── KeyEvent.cpp │ │ ├── WindowEvent.cpp │ │ ├── MouseEvent.cpp │ │ └── Events.h │ ├── math │ │ ├── Random.h │ │ ├── Transform.hpp │ │ ├── Constants.h │ │ └── Math.h │ ├── render │ │ ├── Font.h │ │ ├── Bitmap.h │ │ ├── Brush.h │ │ ├── Color.h │ │ ├── Layer.h │ │ ├── Shader.h │ │ ├── Shape.h │ │ ├── GifImage.h │ │ ├── Renderer.h │ │ ├── TextStyle.h │ │ ├── BitmapCache.h │ │ ├── GifImage.cpp │ │ ├── ShapeMaker.h │ │ ├── StrokeStyle.h │ │ ├── TextLayout.h │ │ ├── RenderContext.h │ │ ├── Layer.cpp │ │ ├── TextStyle.cpp │ │ ├── DirectX │ │ │ ├── TextRenderer.h │ │ │ ├── D3DDeviceResources.h │ │ │ ├── D3DDeviceResourcesBase.h │ │ │ └── TextDrawingEffect.h │ │ └── Renderer.cpp │ ├── utils │ │ ├── Json.h │ │ ├── Task.h │ │ ├── Timer.h │ │ ├── Xml.h │ │ ├── Logger.h │ │ ├── Ticker.h │ │ ├── ConfigIni.h │ │ ├── UserData.h │ │ ├── EventTicker.h │ │ ├── TaskScheduler.h │ │ ├── EventTicker.cpp │ │ └── UserData.cpp │ ├── platform │ │ ├── Keys.h │ │ ├── Input.h │ │ ├── Runner.h │ │ ├── Window.h │ │ ├── Application.h │ │ ├── FileSystem.h │ │ ├── NativeObject.hpp │ │ └── win32 │ │ │ ├── libraries.cpp │ │ │ └── libraries.h │ └── config.h ├── kiwano-audio │ ├── Sound.h │ ├── Module.h │ ├── AudioData.h │ ├── Transcoder.h │ ├── SoundPlayer.h │ ├── Ogg │ │ └── OggTranscoder.h │ ├── MediaFoundation │ │ ├── MFTranscoder.cpp │ │ └── MFTranscoder.h │ ├── CMakeLists.txt │ ├── kiwano-audio.h │ ├── AudioData.cpp │ ├── libraries.h │ └── libraries.cpp ├── kiwano-imgui │ ├── Layer.h │ ├── Module.h │ ├── CMakeLists.txt │ ├── imgui_impl │ │ ├── imgui_impl_dx10.h │ │ ├── imgui_impl_dx11.h │ │ └── imgui_impl.h │ ├── kiwano-imgui.h │ └── Layer.cpp ├── 3rd-party │ ├── vorbis │ │ ├── AUTHORS │ │ ├── lib │ │ │ ├── window.h │ │ │ ├── tone.c │ │ │ ├── lpc.h │ │ │ ├── lsp.h │ │ │ ├── smallft.h │ │ │ ├── lookup.h │ │ │ ├── registry.h │ │ │ ├── registry.c │ │ │ ├── highlevel.h │ │ │ ├── Makefile.am │ │ │ ├── bitrate.h │ │ │ ├── misc.h │ │ │ ├── mdct.h │ │ │ ├── modes │ │ │ │ ├── setup_44p51.h │ │ │ │ └── setup_44u.h │ │ │ └── envelope.h │ │ └── COPYING │ ├── nlohmann │ │ └── CMakeLists.txt │ ├── ogg │ │ ├── AUTHORS │ │ └── COPYING │ ├── pugixml │ │ └── CMakeLists.txt │ ├── imgui │ │ ├── CMakeLists.txt │ │ └── LICENSE.txt │ └── Box2D │ │ ├── LICENSE │ │ ├── Common │ │ ├── b2Draw.cpp │ │ ├── b2Settings.cpp │ │ ├── b2Timer.h │ │ ├── b2StackAllocator.h │ │ ├── b2BlockAllocator.h │ │ ├── b2GrowableStack.h │ │ └── b2StackAllocator.cpp │ │ ├── Dynamics │ │ ├── Contacts │ │ │ ├── b2CircleContact.h │ │ │ ├── b2PolygonContact.h │ │ │ ├── b2EdgeAndCircleContact.h │ │ │ ├── b2PolygonAndCircleContact.h │ │ │ ├── b2EdgeAndPolygonContact.h │ │ │ ├── b2ChainAndCircleContact.h │ │ │ ├── b2ChainAndPolygonContact.h │ │ │ ├── b2EdgeAndCircleContact.cpp │ │ │ ├── b2EdgeAndPolygonContact.cpp │ │ │ ├── b2PolygonAndCircleContact.cpp │ │ │ ├── b2CircleContact.cpp │ │ │ └── b2PolygonContact.cpp │ │ ├── b2WorldCallbacks.cpp │ │ ├── b2ContactManager.h │ │ └── b2TimeStep.h │ │ └── Collision │ │ ├── b2TimeOfImpact.h │ │ └── Shapes │ │ └── b2CircleShape.h └── kiwano-physics │ ├── Body.h │ ├── World.h │ ├── Contact.h │ ├── Global.h │ ├── CMakeLists.txt │ └── kiwano-physics.h ├── scripts ├── coapp │ └── CoApp.Tools.Powershell.msi └── appveyor │ ├── appveyor_get_artifacts.ps1 │ ├── appveyor_get_build.ps1 │ ├── install_coapp.ps1 │ ├── copy_recurse.ps1 │ ├── wait_for_other_jobs.ps1 │ ├── clear_project_configuration.ps1 │ └── coapp_make.ps1 ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ ├── confused.md │ └── bug_report.md └── workflows │ ├── deploy-minio.yaml │ ├── deploy-qcloud.yaml │ ├── deploy-aliyunoss.yaml │ └── deploy-deno.yaml ├── projects ├── kiwano │ └── suppress_warning.ruleset ├── kiwano-physics │ └── kiwano-physics.vcxproj.filters ├── 3rd-party │ ├── libogg │ │ └── libogg.vcxproj.filters │ └── imgui │ │ └── libimgui.vcxproj.filters ├── kiwano-imgui │ └── kiwano-imgui.vcxproj.filters └── kiwano-audio │ └── kiwano-audio.vcxproj.filters ├── .gitignore ├── .editorconfig ├── CMakeLists.txt ├── LICENSE └── README-zh.md /logo/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo.ico -------------------------------------------------------------------------------- /logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo.png -------------------------------------------------------------------------------- /logo/logo_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo_text.png -------------------------------------------------------------------------------- /logo/logo_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo_tiny.png -------------------------------------------------------------------------------- /logo/logo_text_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo_text_h.png -------------------------------------------------------------------------------- /src/kiwano/2d/Actor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/Actor.h -------------------------------------------------------------------------------- /src/kiwano/2d/Stage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/Stage.h -------------------------------------------------------------------------------- /src/kiwano/core/Any.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Any.h -------------------------------------------------------------------------------- /logo/logo_text_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo_text_full.png -------------------------------------------------------------------------------- /src/kiwano-audio/Sound.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/Sound.h -------------------------------------------------------------------------------- /src/kiwano-imgui/Layer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-imgui/Layer.h -------------------------------------------------------------------------------- /src/kiwano/2d/Canvas.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/Canvas.h -------------------------------------------------------------------------------- /src/kiwano/2d/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/Sprite.h -------------------------------------------------------------------------------- /src/kiwano/base/Module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/Module.h -------------------------------------------------------------------------------- /src/kiwano/base/RefPtr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/RefPtr.h -------------------------------------------------------------------------------- /src/kiwano/core/Common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Common.h -------------------------------------------------------------------------------- /src/kiwano/core/String.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/String.h -------------------------------------------------------------------------------- /src/kiwano/core/Time.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Time.h -------------------------------------------------------------------------------- /src/kiwano/core/UUID.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/UUID.h -------------------------------------------------------------------------------- /src/kiwano/event/Event.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/Event.h -------------------------------------------------------------------------------- /src/kiwano/math/Random.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/math/Random.h -------------------------------------------------------------------------------- /src/kiwano/render/Font.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Font.h -------------------------------------------------------------------------------- /src/kiwano/utils/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Json.h -------------------------------------------------------------------------------- /src/kiwano/utils/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Task.h -------------------------------------------------------------------------------- /src/kiwano/utils/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Timer.h -------------------------------------------------------------------------------- /src/kiwano/utils/Xml.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Xml.h -------------------------------------------------------------------------------- /logo/logo_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/logo/logo_transparent.png -------------------------------------------------------------------------------- /src/3rd-party/vorbis/AUTHORS: -------------------------------------------------------------------------------- 1 | Monty 2 | 3 | and the rest of the Xiph.org Foundation. 4 | -------------------------------------------------------------------------------- /src/kiwano-audio/Module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/Module.h -------------------------------------------------------------------------------- /src/kiwano-imgui/Module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-imgui/Module.h -------------------------------------------------------------------------------- /src/kiwano-physics/Body.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-physics/Body.h -------------------------------------------------------------------------------- /src/kiwano-physics/World.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-physics/World.h -------------------------------------------------------------------------------- /src/kiwano/2d/DebugActor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/DebugActor.h -------------------------------------------------------------------------------- /src/kiwano/2d/GifSprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/GifSprite.h -------------------------------------------------------------------------------- /src/kiwano/2d/LayerActor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/LayerActor.h -------------------------------------------------------------------------------- /src/kiwano/2d/ShapeActor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/ShapeActor.h -------------------------------------------------------------------------------- /src/kiwano/2d/TextActor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/TextActor.h -------------------------------------------------------------------------------- /src/kiwano/base/Director.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/Director.h -------------------------------------------------------------------------------- /src/kiwano/core/Duration.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Duration.h -------------------------------------------------------------------------------- /src/kiwano/core/Library.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Library.h -------------------------------------------------------------------------------- /src/kiwano/core/Resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Resource.h -------------------------------------------------------------------------------- /src/kiwano/platform/Keys.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/Keys.h -------------------------------------------------------------------------------- /src/kiwano/render/Bitmap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Bitmap.h -------------------------------------------------------------------------------- /src/kiwano/render/Brush.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Brush.h -------------------------------------------------------------------------------- /src/kiwano/render/Color.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Color.h -------------------------------------------------------------------------------- /src/kiwano/render/Layer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Layer.h -------------------------------------------------------------------------------- /src/kiwano/render/Shader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Shader.h -------------------------------------------------------------------------------- /src/kiwano/render/Shape.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Shape.h -------------------------------------------------------------------------------- /src/kiwano/utils/Logger.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Logger.h -------------------------------------------------------------------------------- /src/kiwano/utils/Ticker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/Ticker.h -------------------------------------------------------------------------------- /src/kiwano-audio/AudioData.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/AudioData.h -------------------------------------------------------------------------------- /src/kiwano-audio/Transcoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/Transcoder.h -------------------------------------------------------------------------------- /src/kiwano-physics/Contact.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-physics/Contact.h -------------------------------------------------------------------------------- /src/kiwano-physics/Global.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-physics/Global.h -------------------------------------------------------------------------------- /src/kiwano/2d/GifSprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/GifSprite.cpp -------------------------------------------------------------------------------- /src/kiwano/2d/TextActor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/TextActor.cpp -------------------------------------------------------------------------------- /src/kiwano/base/ObjectBase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/ObjectBase.h -------------------------------------------------------------------------------- /src/kiwano/base/RefObject.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/RefObject.h -------------------------------------------------------------------------------- /src/kiwano/core/Allocator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Allocator.h -------------------------------------------------------------------------------- /src/kiwano/core/BinaryData.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/BinaryData.h -------------------------------------------------------------------------------- /src/kiwano/core/Duration.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Duration.cpp -------------------------------------------------------------------------------- /src/kiwano/core/Exception.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Exception.h -------------------------------------------------------------------------------- /src/kiwano/event/EventType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/EventType.h -------------------------------------------------------------------------------- /src/kiwano/event/KeyEvent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/KeyEvent.h -------------------------------------------------------------------------------- /src/kiwano/event/MouseEvent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/MouseEvent.h -------------------------------------------------------------------------------- /src/kiwano/math/Transform.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/math/Transform.hpp -------------------------------------------------------------------------------- /src/kiwano/platform/Input.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/Input.h -------------------------------------------------------------------------------- /src/kiwano/platform/Runner.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/Runner.h -------------------------------------------------------------------------------- /src/kiwano/platform/Window.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/Window.h -------------------------------------------------------------------------------- /src/kiwano/render/GifImage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/GifImage.h -------------------------------------------------------------------------------- /src/kiwano/render/Renderer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/Renderer.h -------------------------------------------------------------------------------- /src/kiwano/render/TextStyle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/TextStyle.h -------------------------------------------------------------------------------- /src/kiwano/utils/ConfigIni.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/ConfigIni.h -------------------------------------------------------------------------------- /src/kiwano/utils/UserData.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/UserData.h -------------------------------------------------------------------------------- /src/kiwano-audio/SoundPlayer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/SoundPlayer.h -------------------------------------------------------------------------------- /src/kiwano/core/RefBasePtr.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/RefBasePtr.hpp -------------------------------------------------------------------------------- /src/kiwano/core/Serializable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/Serializable.h -------------------------------------------------------------------------------- /src/kiwano/event/WindowEvent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/WindowEvent.h -------------------------------------------------------------------------------- /src/kiwano/render/BitmapCache.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/BitmapCache.h -------------------------------------------------------------------------------- /src/kiwano/render/GifImage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/GifImage.cpp -------------------------------------------------------------------------------- /src/kiwano/render/ShapeMaker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/ShapeMaker.h -------------------------------------------------------------------------------- /src/kiwano/render/StrokeStyle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/StrokeStyle.h -------------------------------------------------------------------------------- /src/kiwano/render/TextLayout.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/TextLayout.h -------------------------------------------------------------------------------- /src/kiwano/utils/EventTicker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/EventTicker.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/Animator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/Animator.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/EaseFunc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/EaseFunc.h -------------------------------------------------------------------------------- /src/kiwano/base/component/Button.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/component/Button.h -------------------------------------------------------------------------------- /src/kiwano/core/IntrusiveList.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/core/IntrusiveList.hpp -------------------------------------------------------------------------------- /src/kiwano/event/EventDispatcher.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/EventDispatcher.h -------------------------------------------------------------------------------- /src/kiwano/platform/Application.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/Application.h -------------------------------------------------------------------------------- /src/kiwano/platform/FileSystem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/FileSystem.h -------------------------------------------------------------------------------- /src/kiwano/render/RenderContext.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/render/RenderContext.h -------------------------------------------------------------------------------- /src/kiwano/utils/TaskScheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/utils/TaskScheduler.h -------------------------------------------------------------------------------- /src/kiwano-audio/Ogg/OggTranscoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/Ogg/OggTranscoder.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/Animation.h -------------------------------------------------------------------------------- /src/kiwano/platform/NativeObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/platform/NativeObject.hpp -------------------------------------------------------------------------------- /src/kiwano/2d/animation/PathAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/PathAnimation.h -------------------------------------------------------------------------------- /src/kiwano/2d/transition/Transition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/transition/Transition.h -------------------------------------------------------------------------------- /src/kiwano/base/component/Component.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/component/Component.h -------------------------------------------------------------------------------- /src/kiwano/base/component/MouseSensor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/component/MouseSensor.h -------------------------------------------------------------------------------- /scripts/coapp/CoApp.Tools.Powershell.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/scripts/coapp/CoApp.Tools.Powershell.msi -------------------------------------------------------------------------------- /src/kiwano/2d/animation/AnimationGroup.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/AnimationGroup.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/CustomAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/CustomAnimation.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/DelayAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/DelayAnimation.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/FrameAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/FrameAnimation.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/TweenAnimation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/TweenAnimation.h -------------------------------------------------------------------------------- /src/kiwano/2d/transition/BoxTransition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/transition/BoxTransition.h -------------------------------------------------------------------------------- /src/kiwano/2d/transition/FadeTransition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/transition/FadeTransition.h -------------------------------------------------------------------------------- /src/kiwano/2d/transition/MoveTransition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/transition/MoveTransition.h -------------------------------------------------------------------------------- /src/kiwano/event/listener/EventListener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/listener/EventListener.h -------------------------------------------------------------------------------- /src/kiwano/2d/animation/AnimationWrapper.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/animation/AnimationWrapper.h -------------------------------------------------------------------------------- /src/kiwano/base/component/ComponentManager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/base/component/ComponentManager.h -------------------------------------------------------------------------------- /src/kiwano/event/listener/KeyEventListener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/listener/KeyEventListener.h -------------------------------------------------------------------------------- /src/kiwano/2d/transition/RotationTransition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/2d/transition/RotationTransition.h -------------------------------------------------------------------------------- /src/kiwano/event/listener/MouseEventListener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano/event/listener/MouseEventListener.h -------------------------------------------------------------------------------- /src/kiwano-audio/MediaFoundation/MFTranscoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/MediaFoundation/MFTranscoder.cpp -------------------------------------------------------------------------------- /src/kiwano-audio/MediaFoundation/MFTranscoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KiwanoEngine/Kiwano/HEAD/src/kiwano-audio/MediaFoundation/MFTranscoder.h -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: 想要提出一个优化建议,请选择这个模版 4 | 5 | --- 6 | 7 | ### 需求描述 8 | 9 | 描述你认为需要进行优化的地方 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/confused.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Confused 3 | about: 使用 Kiwano 时有任何疑问,请选择这个模版 4 | 5 | --- 6 | 7 | ### 简述 8 | 9 | 用一两句话描述你的疑惑 10 | 11 | ### 环境 12 | 13 | 留下你使用的 Kiwano 版本号,以及系统、编译器等信息 14 | -------------------------------------------------------------------------------- /src/kiwano/event/Event.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace kiwano 4 | { 5 | Event::Event(const EventType& type) 6 | : type_(type) 7 | { 8 | } 9 | 10 | Event::~Event() {} 11 | 12 | } // namespace kiwano 13 | -------------------------------------------------------------------------------- /src/3rd-party/nlohmann/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | 3 | set(SOURCE_FILES 4 | json.hpp) 5 | 6 | add_library(libnlohmann ${SOURCE_FILES}) 7 | 8 | set_target_properties(libnlohmann PROPERTIES LINKER_LANGUAGE CXX) 9 | 10 | -------------------------------------------------------------------------------- /src/3rd-party/ogg/AUTHORS: -------------------------------------------------------------------------------- 1 | Monty 2 | Greg Maxwell 3 | Ralph Giles 4 | Cristian Adam 5 | Tim Terriberry 6 | 7 | and the rest of the Xiph.Org Foundation. 8 | -------------------------------------------------------------------------------- /src/3rd-party/pugixml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | 3 | set(SOURCE_FILES 4 | pugiconfig.hpp 5 | pugixml-impl.hpp 6 | pugixml.hpp) 7 | 8 | add_library(libpugixml ${SOURCE_FILES}) 9 | 10 | set_target_properties(libpugixml PROPERTIES LINKER_LANGUAGE CXX) 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: 创建一个 Bug 报告,请选择这个模版 4 | 5 | --- 6 | 7 | ### 编译环境 8 | 9 | - Kiwano 版本号: 10 | - 操作系统: 11 | - 编译器: 12 | 13 | ### 复现步骤 14 | 15 | (告诉我们如何才能复现这个 BUG) 16 | 17 | 1. 步骤一 18 | 2. 步骤二 19 | 20 | ### 预期现象 21 | 22 | 描述一下你认为正常情况下应该发生什么现象 23 | 24 | ### 实际现象 25 | 26 | 描述一下你运行代码时实际发生的现象 27 | -------------------------------------------------------------------------------- /projects/kiwano/suppress_warning.ruleset: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/kiwano-audio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | 3 | set(SOURCE_FILES 4 | AudioModule.cpp 5 | AudioModule.h 6 | kiwano-audio.h 7 | libraries.cpp 8 | libraries.h 9 | Sound.cpp 10 | Sound.h 11 | SoundPlayer.cpp 12 | SoundPlayer.h 13 | Transcoder.cpp 14 | Transcoder.h) 15 | 16 | add_library(libkiwanoaudio ${SOURCE_FILES}) 17 | -------------------------------------------------------------------------------- /src/3rd-party/imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | 3 | set(SOURCE_FILES 4 | imconfig.h 5 | imgui.cpp 6 | imgui.h 7 | imgui_draw.cpp 8 | imgui_internal.h 9 | imgui_widgets.cpp 10 | imstb_rectpack.h 11 | imstb_textedit.h 12 | imstb_truetype.h 13 | imgui_stdlib.h 14 | imgui_stdlib.cpp) 15 | 16 | add_library(libimgui ${SOURCE_FILES}) 17 | -------------------------------------------------------------------------------- /src/kiwano-imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | 3 | set(SOURCE_FILES 4 | imgui_impl/imgui_impl.h 5 | imgui_impl/imgui_impl_dx10.cpp 6 | imgui_impl/imgui_impl_dx10.h 7 | imgui_impl/imgui_impl_dx11.cpp 8 | imgui_impl/imgui_impl_dx11.h 9 | ImGuiLayer.cpp 10 | ImGuiLayer.h 11 | ImGuiModule.cpp 12 | ImGuiModule.h 13 | kiwano-imgui.h) 14 | 15 | add_library(libkiwanoimgui ${SOURCE_FILES}) 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build folders 2 | build/ 3 | output/ 4 | 5 | x64/ 6 | Debug/ 7 | Release/ 8 | 9 | # CMake folders 10 | /cmake-build-release/ 11 | /cmake-build-debug/ 12 | 13 | # Application folders 14 | .vs 15 | .idea 16 | ._Kiwano.sln 17 | .vscode 18 | 19 | # vs2010 20 | ipch/ 21 | *.opensdf 22 | *.sdf 23 | *.suo 24 | 25 | *.user 26 | *.lnk 27 | 28 | # NuGet packages 29 | packages/ 30 | 31 | !*.dll 32 | !*.lib 33 | 34 | # Resources bin 35 | *.aps 36 | 37 | # Mac cache files 38 | .DS_Store 39 | 40 | # Documents 41 | docs/ 42 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = crlf 9 | insert_final_newline = true 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{h,hpp,cpp}] 14 | charset = gb2312 15 | 16 | # 4 space indentation 17 | indent_style = space 18 | indent_size = 4 19 | 20 | # Matches the exact files 21 | [*.{json,xml}] 22 | indent_style = space 23 | indent_size = 2 24 | -------------------------------------------------------------------------------- /scripts/appveyor/appveyor_get_artifacts.ps1: -------------------------------------------------------------------------------- 1 | function Get-AppVeyorArtifacts { 2 | param( 3 | [string]$Job 4 | ) 5 | 6 | if (-not ($env:APPVEYOR_API_TOKEN)) { 7 | throw "missing api token for AppVeyor." 8 | } 9 | if (-not ($env:APPVEYOR_ACCOUNT_NAME)) { 10 | throw "not an appveyor build." 11 | } 12 | 13 | return Invoke-RestMethod -Method GET -Uri "https://ci.appveyor.com/api/buildjobs/$Job/artifacts" -Headers @{ 14 | "Authorization" = "Bearer $env:APPVEYOR_API_TOKEN" 15 | "Content-type" = "application/json" 16 | } 17 | } -------------------------------------------------------------------------------- /scripts/appveyor/appveyor_get_build.ps1: -------------------------------------------------------------------------------- 1 | function Get-AppVeyorBuild { 2 | param() 3 | 4 | if (-not ($env:APPVEYOR_API_TOKEN)) { 5 | throw "missing api token for AppVeyor." 6 | } 7 | if (-not ($env:APPVEYOR_ACCOUNT_NAME)) { 8 | throw "not an appveyor build." 9 | } 10 | 11 | return Invoke-RestMethod -Method GET -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/build/$env:APPVEYOR_BUILD_VERSION" -Headers @{ 12 | "Authorization" = "Bearer $env:APPVEYOR_API_TOKEN" 13 | "Content-type" = "application/json" 14 | } 15 | } -------------------------------------------------------------------------------- /scripts/appveyor/install_coapp.ps1: -------------------------------------------------------------------------------- 1 | # Download the CoApp tools. 2 | # $msiPath = "$($env:USERPROFILE)\CoApp.Tools.Powershell.msi" 3 | # (New-Object Net.WebClient).DownloadFile('https://coapp.github.io//files/CoApp.Tools.Powershell.msi', $msiPath) 4 | $msiPath = "scripts\coapp\CoApp.Tools.Powershell.msi" 5 | 6 | # Install the CoApp tools from the downloaded .msi. 7 | Start-Process -FilePath msiexec -ArgumentList /i, $msiPath, /quiet -Wait 8 | 9 | # Make the tools available for later PS scripts to use. 10 | $env:PSModulePath = $env:PSModulePath + ';C:\Program Files (x86)\Outercurve Foundation\Modules' 11 | Import-Module CoApp 12 | -------------------------------------------------------------------------------- /src/kiwano-physics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(..) 2 | include_directories(../3rd-party) 3 | 4 | set(SOURCE_FILES 5 | Contact.cpp 6 | Contact.h 7 | ContactEdge.cpp 8 | ContactEdge.h 9 | ContactEvent.cpp 10 | ContactEvent.h 11 | Fixture.cpp 12 | Fixture.h 13 | Global.cpp 14 | Global.h 15 | Joint.cpp 16 | Joint.h 17 | kiwano-physics.h 18 | PhysicBody.cpp 19 | PhysicBody.h 20 | PhysicWorld.cpp 21 | PhysicWorld.h) 22 | 23 | add_library(libkiwanophysics ${SOURCE_FILES}) 24 | 25 | target_link_libraries(libkiwanophysics libbox2d) 26 | -------------------------------------------------------------------------------- /src/kiwano/event/KeyEvent.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace kiwano 4 | { 5 | 6 | KeyEvent::KeyEvent(const EventType& type) 7 | : Event(type) 8 | { 9 | } 10 | 11 | KeyDownEvent::KeyDownEvent() 12 | : KeyEvent(KGE_EVENT(KeyDownEvent)) 13 | , code() 14 | { 15 | } 16 | 17 | KeyUpEvent::KeyUpEvent() 18 | : KeyEvent(KGE_EVENT(KeyUpEvent)) 19 | , code() 20 | { 21 | } 22 | 23 | KeyCharEvent::KeyCharEvent() 24 | : KeyEvent(KGE_EVENT(KeyCharEvent)) 25 | , value() 26 | { 27 | } 28 | 29 | IMEInputEvent::IMEInputEvent() 30 | : KeyEvent(KGE_EVENT(IMEInputEvent)) 31 | , value() 32 | { 33 | } 34 | 35 | } // namespace kiwano 36 | -------------------------------------------------------------------------------- /.github/workflows/deploy-minio.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy to minio 2 | 3 | on: 4 | push: 5 | branches: [ main, master ] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | 14 | - name: build 15 | uses: mattnotmitt/doxygen-action@v1.9.4 16 | 17 | - name: Upload to minio 18 | uses: lovellfelix/minio-deploy-action@v1 19 | with: 20 | endpoint: ${{ vars.MINIO_ENDPOINT }} 21 | access_key: ${{ secrets.MINIO_ACCESS_KEY }} 22 | secret_key: ${{ secrets.MINIO_SECRET_KEY }} 23 | bucket: ${{ vars.MINIO_BUCKET }} 24 | source_dir: 'docs/html' 25 | target_dir: '/' 26 | -------------------------------------------------------------------------------- /.github/workflows/deploy-qcloud.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy to Tencent Cloud COS 2 | 3 | on: 4 | push: 5 | branches: [ main, master ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | 14 | - name: setup node 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: 16 18 | 19 | - name: build 20 | uses: mattnotmitt/doxygen-action@v1.9.4 21 | 22 | - name: Upload 23 | uses: zkqiang/tencent-cos-action@v0.1.0 24 | with: 25 | args: upload -rf --sync -y ./docs/html/ / 26 | secret_id: ${{ secrets.QCLOUD_SECRET_ID }} 27 | secret_key: ${{ secrets.QCLOUD_SECRET_KEY }} 28 | bucket: kiwano-web-1252696634 29 | region: ap-guangzhou 30 | -------------------------------------------------------------------------------- /projects/kiwano-physics/kiwano-physics.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/deploy-aliyunoss.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy to Aliyun OSS 2 | 3 | on: 4 | push: 5 | branches: [ main, master ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: setup node 13 | uses: actions/setup-node@v1 14 | with: 15 | node-version: 16 16 | 17 | - name: build 18 | uses: mattnotmitt/doxygen-action@v1.9.4 19 | 20 | - name: setup aliyun oss 21 | uses: manyuanrong/setup-ossutil@master 22 | with: 23 | endpoint: oss-cn-chengdu.aliyuncs.com 24 | access-key-id: ${{ secrets.OSS_KEY_ID }} 25 | access-key-secret: ${{ secrets.OSS_KEY_SECRET }} 26 | 27 | - name: upload files 28 | run: ossutil sync --force --update --delete ./docs/html oss://kiwano-docs-website/ 29 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project(Kiwano C CXX) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | if (WIN32) 7 | message(STATUS "Building on Windows platform.") 8 | elseif (APPLE) 9 | message(STATUS "Building on MacOS platform.") 10 | add_compile_definitions(TARGET_OS_MAC) 11 | elseif (UNIX) 12 | message(STATUS "Building on UNIX-like OS platform.") 13 | endif () 14 | 15 | include_directories(src/3rd-party) 16 | include_directories(src) 17 | 18 | add_subdirectory(src/kiwano) 19 | add_subdirectory(src/kiwano-audio) 20 | add_subdirectory(src/kiwano-imgui) 21 | add_subdirectory(src/kiwano-network) 22 | add_subdirectory(src/kiwano-physics) 23 | add_subdirectory(src/3rd-party/Box2D) 24 | add_subdirectory(src/3rd-party/curl) 25 | add_subdirectory(src/3rd-party/nlohmann) 26 | add_subdirectory(src/3rd-party/pugixml) 27 | -------------------------------------------------------------------------------- /scripts/appveyor/copy_recurse.ps1: -------------------------------------------------------------------------------- 1 | function Copy-Recurse { 2 | param( 3 | [string]$Path, 4 | [string]$Destination, 5 | [string]$Filter 6 | ) 7 | 8 | New-Item -ItemType Directory -Force -Path $Destination | Out-Null 9 | 10 | Get-ChildItem -Recurse -Path $Path -Filter $Filter | ForEach-Object { 11 | $relativePath = $_.FullName.Replace((Resolve-Path $Path).Path, "") 12 | $targetFile = Join-Path -Path $Destination -ChildPath $relativePath 13 | 14 | $targetFileDirectory = Split-Path -Path $targetFile -Parent 15 | 16 | if (!(Test-Path $targetFileDirectory)) 17 | { 18 | New-Item -ItemType Directory -Force -Path $targetFileDirectory | Out-Null 19 | } 20 | 21 | Copy-Item -Path $_.FullName -Destination $targetFile -Force 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/deploy-deno.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy to Deno 2 | on: 3 | push: 4 | branches: master 5 | pull_request: 6 | branches: master 7 | workflow_dispatch: 8 | 9 | jobs: 10 | deploy: 11 | name: Deploy 12 | runs-on: ubuntu-latest 13 | 14 | permissions: 15 | id-token: write # Needed for auth with Deno Deploy 16 | contents: read # Needed to clone the repository 17 | 18 | steps: 19 | - name: Clone repository 20 | uses: actions/checkout@v3 21 | 22 | - name: Install Deno 23 | uses: denoland/setup-deno@v1 24 | with: 25 | deno-version: v1.x 26 | 27 | - name: Build step 28 | uses: mattnotmitt/doxygen-action@v1.9.4 29 | 30 | - name: Upload to Deno Deploy 31 | uses: denoland/deployctl@v1 32 | with: 33 | project: kiwano-docs 34 | entrypoint: https://deno.land/std/http/file_server.ts 35 | root: ./docs/html 36 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2017 Erin Catto http://www.box2d.org 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | -------------------------------------------------------------------------------- /src/kiwano/event/WindowEvent.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace kiwano 4 | { 5 | 6 | WindowEvent::WindowEvent(const EventType& type) 7 | : Event(type) 8 | , window(nullptr) 9 | { 10 | } 11 | 12 | WindowMovedEvent::WindowMovedEvent() 13 | : WindowEvent(KGE_EVENT(WindowMovedEvent)) 14 | , x(0) 15 | , y(0) 16 | { 17 | } 18 | 19 | WindowResizedEvent::WindowResizedEvent() 20 | : WindowEvent(KGE_EVENT(WindowResizedEvent)) 21 | , real_width(0) 22 | , real_height(0) 23 | { 24 | } 25 | 26 | WindowFocusChangedEvent::WindowFocusChangedEvent() 27 | : WindowEvent(KGE_EVENT(WindowFocusChangedEvent)) 28 | , focus(false) 29 | { 30 | } 31 | 32 | WindowTitleChangedEvent::WindowTitleChangedEvent() 33 | : WindowEvent(KGE_EVENT(WindowTitleChangedEvent)) 34 | , title() 35 | { 36 | } 37 | 38 | WindowClosedEvent::WindowClosedEvent() 39 | : WindowEvent(KGE_EVENT(WindowClosedEvent)) 40 | { 41 | } 42 | 43 | } // namespace kiwano 44 | -------------------------------------------------------------------------------- /src/kiwano/event/MouseEvent.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace kiwano 4 | { 5 | MouseEvent::MouseEvent(const EventType& type) 6 | : Event(type) 7 | , pos() 8 | { 9 | } 10 | 11 | MouseMoveEvent::MouseMoveEvent() 12 | : MouseEvent(KGE_EVENT(MouseMoveEvent)) 13 | { 14 | } 15 | 16 | MouseDownEvent::MouseDownEvent() 17 | : MouseEvent(KGE_EVENT(MouseDownEvent)) 18 | , button() 19 | { 20 | } 21 | 22 | MouseUpEvent::MouseUpEvent() 23 | : MouseEvent(KGE_EVENT(MouseUpEvent)) 24 | , button() 25 | { 26 | } 27 | 28 | MouseClickEvent::MouseClickEvent() 29 | : MouseEvent(KGE_EVENT(MouseClickEvent)) 30 | , button() 31 | { 32 | } 33 | 34 | MouseHoverEvent::MouseHoverEvent() 35 | : MouseEvent(KGE_EVENT(MouseHoverEvent)) 36 | { 37 | } 38 | 39 | MouseOutEvent::MouseOutEvent() 40 | : MouseEvent(KGE_EVENT(MouseOutEvent)) 41 | { 42 | } 43 | 44 | MouseWheelEvent::MouseWheelEvent() 45 | : MouseEvent(KGE_EVENT(MouseWheelEvent)) 46 | , wheel(0.f) 47 | { 48 | } 49 | 50 | } // namespace kiwano 51 | -------------------------------------------------------------------------------- /src/kiwano/config.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Compile-time configurations for Kiwano 3 | //----------------------------------------------------------------------------- 4 | 5 | #pragma once 6 | 7 | //---- Define assertion handler. Defaults to calling assert() 8 | // #define KGE_ASSERT(EXPR) MyAssert(EXPR) 9 | // #define KGE_ASSERT(EXPR) __noop // Disable asserts 10 | 11 | //---- Define debug-output handler. Defaults to calling kiwano::logs::Messageln()/Warningln()/Errorln() 12 | // #define KGE_LOGF(FORMAT, ...) printf(FORMAT "\n", __VA_ARGS__) 13 | // #define KGE_WARNF(FORMAT, ...) printf(FORMAT "\n", __VA_ARGS__) 14 | // #define KGE_ERRORF(FORMAT, ...) printf(FORMAT "\n", __VA_ARGS__) 15 | 16 | //---- Define attributes of all API symbols declarations for DLL 17 | // #define KGE_USE_DLL 18 | // #define KGE_EXPORT_DLL 19 | 20 | //---- Define DirectX version. Defaults to using Direct3D11 21 | // #define KGE_USE_DIRECTX10 22 | 23 | //---- Define to enable DirectX debug layer 24 | // #define KGE_ENABLE_DX_DEBUG 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Haibo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /projects/3rd-party/libogg/libogg.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {6160FE38-37E6-41B0-9EAC-17047E5FB604} 6 | 7 | 8 | {679F9030-0259-4621-87DD-08D71081C409} 9 | 10 | 11 | 12 | 13 | src 14 | 15 | 16 | src 17 | 18 | 19 | 20 | 21 | include 22 | 23 | 24 | include 25 | 26 | 27 | include 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/3rd-party/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2025 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /scripts/appveyor/wait_for_other_jobs.ps1: -------------------------------------------------------------------------------- 1 | . .\scripts\appveyor\appveyor_get_build.ps1 2 | 3 | # Ignore commits without APPVEYOR_API_TOKEN envrionment variable 4 | if (-not ($env:APPVEYOR_API_TOKEN)) { return } 5 | 6 | # Only deploy when commit message contains "[deploy]" 7 | if (!(Get-AppVeyorBuild).build.message.Contains('[deploy]')) { return } 8 | 9 | # Deploy once on last job 10 | if ($env:APPVEYOR_JOB_NUMBER -ne $env:job_to_deploy) { return } 11 | 12 | # Wait for other jobs complete 13 | Write-Host "Waiting for other jobs to complete" 14 | 15 | [datetime]$stop = ([datetime]::Now).AddMinutes($env:time_out_mins) 16 | [bool]$success = $false 17 | 18 | while(!$success -and ([datetime]::Now) -lt $stop) { 19 | $success = $true 20 | (Get-AppVeyorBuild).build.jobs | foreach-object { 21 | if (($_.jobId -ne $env:APPVEYOR_JOB_ID) -and ($_.status -ne "success")) { 22 | $success = $false 23 | } 24 | Write-Host "Job `"$($_.jobId)`" $($_.status)"; 25 | } 26 | if (!$success) { Start-sleep 5 } 27 | } 28 | 29 | if (!$success) { 30 | throw "Test jobs were not finished in $env:time_out_mins minutes" 31 | } 32 | 33 | # Set flag to deploy 34 | $env:flag_to_deploy = $success -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/window.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: window functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_WINDOW_ 18 | #define _V_WINDOW_ 19 | 20 | extern const float *_vorbis_window_get(int n); 21 | extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes, 22 | int lW,int W,int nW); 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/tone.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void usage(){ 7 | fprintf(stderr,"tone ,[] [,[]...]\n"); 8 | exit(1); 9 | } 10 | 11 | int main (int argc,char *argv[]){ 12 | int i,j; 13 | double *f; 14 | double *amp; 15 | 16 | if(argc<2)usage(); 17 | 18 | f=alloca(sizeof(*f)*(argc-1)); 19 | amp=alloca(sizeof(*amp)*(argc-1)); 20 | 21 | i=0; 22 | while(argv[i+1]){ 23 | char *pos=strchr(argv[i+1],','); 24 | 25 | f[i]=atof(argv[i+1]); 26 | if(pos) 27 | amp[i]=atof(pos+1)*32767.f; 28 | else 29 | amp[i]=32767.f; 30 | 31 | fprintf(stderr,"%g Hz, %g amp\n",f[i],amp[i]); 32 | 33 | i++; 34 | } 35 | 36 | for(i=0;i<44100*10;i++){ 37 | float val=0; 38 | int ival; 39 | for(j=0;j32767.f)ival=32767.f; 44 | if(ival<-32768.f)ival=-32768.f; 45 | 46 | fprintf(stdout,"%c%c%c%c", 47 | (char)(ival&0xff), 48 | (char)((ival>>8)&0xff), 49 | (char)(ival&0xff), 50 | (char)((ival>>8)&0xff)); 51 | } 52 | return(0); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/lpc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LPC low level routines 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LPC_H_ 18 | #define _V_LPC_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | /* simple linear scale LPC code */ 23 | extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m); 24 | 25 | extern void vorbis_lpc_predict(float *coeff,float *prime,int m, 26 | float *data,long n); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/lsp.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LSP (also called LSF) conversion routines 14 | 15 | ********************************************************************/ 16 | 17 | 18 | #ifndef _V_LSP_H_ 19 | #define _V_LSP_H_ 20 | 21 | extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m); 22 | 23 | extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln, 24 | float *lsp,int m, 25 | float amp,float ampoffset); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/kiwano-audio/kiwano-audio.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | -------------------------------------------------------------------------------- /src/kiwano-physics/kiwano-physics.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018-2019 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | -------------------------------------------------------------------------------- /src/kiwano-imgui/imgui_impl/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for Kiwano (DirectX10) 2 | 3 | #pragma once 4 | #include 5 | 6 | #ifndef KGE_DOXYGEN_DO_NOT_INCLUDE 7 | #ifndef IMGUI_DISABLE 8 | 9 | struct ID3D10Device; 10 | struct ID3D10SamplerState; 11 | struct ID3D10Buffer; 12 | 13 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 14 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 15 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 16 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 17 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 18 | 19 | // Use if you want to reset your rendering device without losing Dear ImGui state. 20 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 21 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 22 | 23 | // [BETA] Selected render state data shared with callbacks. 24 | // This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplDX10_RenderDrawData() call. 25 | // (Please open an issue if you feel you need access to more data) 26 | struct ImGui_ImplDX10_RenderState 27 | { 28 | ID3D10Device* Device; 29 | ID3D10SamplerState* SamplerDefault; 30 | ID3D10Buffer* VertexConstantBuffer; 31 | }; 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | #endif 35 | -------------------------------------------------------------------------------- /src/kiwano-imgui/kiwano-imgui.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | // ImGui 27 | #include 28 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/smallft.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: fft transform 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_SMFT_H_ 18 | #define _V_SMFT_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | typedef struct { 23 | int n; 24 | float *trigcache; 25 | int *splitcache; 26 | } drft_lookup; 27 | 28 | extern void drft_forward(drft_lookup *l,float *data); 29 | extern void drft_backward(drft_lookup *l,float *data); 30 | extern void drft_init(drft_lookup *l,int n); 31 | extern void drft_clear(drft_lookup *l); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/kiwano/event/Events.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/lookup.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: lookup based functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LOOKUP_H_ 18 | 19 | #ifdef FLOAT_LOOKUP 20 | extern float vorbis_coslook(float a); 21 | extern float vorbis_invsqlook(float a); 22 | extern float vorbis_invsq2explook(int a); 23 | extern float vorbis_fromdBlook(float a); 24 | #endif 25 | #ifdef INT_LOOKUP 26 | extern long vorbis_invsqlook_i(long a,long e); 27 | extern long vorbis_coslook_i(long a); 28 | extern float vorbis_fromdBlook_i(long a); 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/registry.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_REG_H_ 18 | #define _V_REG_H_ 19 | 20 | #define VI_TRANSFORMB 1 21 | #define VI_WINDOWB 1 22 | #define VI_TIMEB 1 23 | #define VI_FLOORB 2 24 | #define VI_RESB 3 25 | #define VI_MAPB 1 26 | 27 | extern const vorbis_func_floor *const _floor_P[]; 28 | extern const vorbis_func_residue *const _residue_P[]; 29 | extern const vorbis_func_mapping *const _mapping_P[]; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2Draw.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Erin Catto http://box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2Draw.h" 20 | 21 | b2Draw::b2Draw() 22 | { 23 | m_drawFlags = 0; 24 | } 25 | 26 | void b2Draw::SetFlags(uint32 flags) 27 | { 28 | m_drawFlags = flags; 29 | } 30 | 31 | uint32 b2Draw::GetFlags() const 32 | { 33 | return m_drawFlags; 34 | } 35 | 36 | void b2Draw::AppendFlags(uint32 flags) 37 | { 38 | m_drawFlags |= flags; 39 | } 40 | 41 | void b2Draw::ClearFlags(uint32 flags) 42 | { 43 | m_drawFlags &= ~flags; 44 | } 45 | -------------------------------------------------------------------------------- /projects/kiwano-imgui/kiwano-imgui.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | imgui_impl 9 | 10 | 11 | imgui_impl 12 | 13 | 14 | imgui_impl 15 | 16 | 17 | 18 | 19 | 20 | 21 | imgui_impl 22 | 23 | 24 | imgui_impl 25 | 26 | 27 | 28 | 29 | {a11036bf-f334-4e51-aef2-15dd46be924d} 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/kiwano-imgui/imgui_impl/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for Kiwano (DirectX11) 2 | 3 | #pragma once 4 | #include 5 | 6 | #ifndef KGE_DOXYGEN_DO_NOT_INCLUDE 7 | #ifndef IMGUI_DISABLE 8 | 9 | struct ID3D11Device; 10 | struct ID3D11DeviceContext; 11 | struct ID3D11SamplerState; 12 | struct ID3D11Buffer; 13 | 14 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 15 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 16 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 17 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 18 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 19 | 20 | // Use if you want to reset your rendering device without losing Dear ImGui state. 21 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 23 | 24 | // [BETA] Selected render state data shared with callbacks. 25 | // This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplDX11_RenderDrawData() call. 26 | // (Please open an issue if you feel you need access to more data) 27 | struct ImGui_ImplDX11_RenderState 28 | { 29 | ID3D11Device* Device; 30 | ID3D11DeviceContext* DeviceContext; 31 | ID3D11SamplerState* SamplerDefault; 32 | ID3D11Buffer* VertexConstantBuffer; 33 | }; 34 | 35 | #endif // #ifndef IMGUI_DISABLE 36 | #endif 37 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2Settings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2Settings.h" 20 | #include 21 | #include 22 | #include 23 | 24 | b2Version b2_version = {2, 3, 2}; 25 | 26 | // Memory allocators. Modify these to use your own allocator. 27 | void* b2Alloc(int32 size) 28 | { 29 | return malloc(size); 30 | } 31 | 32 | void b2Free(void* mem) 33 | { 34 | free(mem); 35 | } 36 | 37 | // You can modify this to use your logging facility. 38 | void b2Log(const char* string, ...) 39 | { 40 | va_list args; 41 | va_start(args, string); 42 | vprintf(string, args); 43 | va_end(args); 44 | } 45 | -------------------------------------------------------------------------------- /src/3rd-party/ogg/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002, Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2020 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /src/kiwano/core/Cloneable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | namespace kiwano 24 | { 25 | 26 | template 27 | class Cloneable 28 | { 29 | public: 30 | virtual _Ty* Clone() const = 0; 31 | 32 | protected: 33 | Cloneable() = default; 34 | 35 | private: 36 | Cloneable(const Cloneable&) = delete; 37 | 38 | Cloneable& operator=(const Cloneable&) = delete; 39 | }; 40 | 41 | } // namespace kiwano 42 | -------------------------------------------------------------------------------- /scripts/appveyor/clear_project_configuration.ps1: -------------------------------------------------------------------------------- 1 | function Set-FileConfiguration { 2 | param( 3 | [string]$filePath 4 | ) 5 | 6 | $debugInfoReplace = "(EditAndContinue|ProgramDatabase)" 7 | $debugInfoReplaceTo = "None" 8 | 9 | $optimizationReplace = "true" 10 | $optimizationReplaceTo = "false" 11 | 12 | # Create a copy of .vcxproj file 13 | Copy-Item -Path $filePath -Destination ($filePath + '.template') 14 | 15 | # Overlay some configurations 16 | Get-Content ($filePath + '.template') -Encoding UTF8 | ForEach-Object { 17 | ( $_ -replace $debugInfoReplace, $debugInfoReplaceTo ) -replace $optimizationReplace, $optimizationReplaceTo 18 | } | Out-File $filePath -Encoding UTF8 19 | 20 | # Delete the copy file 21 | Remove-Item -Path ($filePath + '.template') 22 | } 23 | 24 | Get-ChildItem -Path 'projects\' -Directory | ForEach-Object { 25 | $dirPath = "projects\$($_)" 26 | 27 | # Search all vcxproj files 28 | Get-ChildItem -Path $dirPath *.vcxproj -File | ForEach-Object { 29 | Set-FileConfiguration ($dirPath + '\' + $_) 30 | } 31 | } 32 | 33 | Get-ChildItem -Path 'projects\3rd-party' -Directory | ForEach-Object { 34 | $dirPath = "projects\3rd-party\$($_)" 35 | 36 | # Search all vcxproj files 37 | Get-ChildItem -Path $dirPath *.vcxproj -File | ForEach-Object { 38 | Set-FileConfiguration ($dirPath + '\' + $_) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/kiwano/event/listener/KeyEventListener.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | 27 | void KeyEventListener::Handle(Event* evt) 28 | { 29 | if (auto key_evt = evt->Cast()) 30 | { 31 | OnKeyDown(key_evt->code); 32 | } 33 | else if (auto key_evt = evt->Cast()) 34 | { 35 | OnKeyUp(key_evt->code); 36 | } 37 | } 38 | 39 | } // namespace kiwano 40 | -------------------------------------------------------------------------------- /src/kiwano-audio/AudioData.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | namespace audio 26 | { 27 | AudioData::AudioData(const BinaryData& data, const AudioMeta& meta) 28 | : data_(data) 29 | , meta_(meta) 30 | { 31 | } 32 | 33 | AudioMeta AudioData::GetMeta() const 34 | { 35 | return meta_; 36 | } 37 | 38 | BinaryData AudioData::GetData() const 39 | { 40 | return data_; 41 | } 42 | 43 | } // namespace audio 44 | } // namespace kiwano 45 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2CircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CIRCLE_CONTACT_H 20 | #define B2_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2CircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2CircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/kiwano/render/Layer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2019 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | Layer::Layer(const Rect& bounds, float opacity) 27 | : Layer(nullptr, Matrix3x2(), opacity, bounds) 28 | { 29 | } 30 | 31 | Layer::Layer(RefPtr mask, const Matrix3x2& mask_transform, float opacity, const Rect& bounds) 32 | : mask(mask) 33 | , mask_transform(mask_transform) 34 | , opacity(opacity) 35 | , bounds(bounds) 36 | { 37 | } 38 | 39 | } // namespace kiwano 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2PolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_POLYGON_CONTACT_H 20 | #define B2_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2PolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2PolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Erin Catto http://box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIMER_H 20 | #define B2_TIMER_H 21 | 22 | #include "b2Settings.h" 23 | 24 | /// Timer for profiling. This has platform specific code and may 25 | /// not work on every platform. 26 | class b2Timer 27 | { 28 | public: 29 | 30 | /// Constructor 31 | b2Timer(); 32 | 33 | /// Reset the timer. 34 | void Reset(); 35 | 36 | /// Get the time since construction or the last reset. 37 | float32 GetMilliseconds() const; 38 | 39 | private: 40 | 41 | #if defined(_WIN32) 42 | float64 m_start; 43 | static float64 s_invFrequency; 44 | #elif defined(__linux__) || defined (__APPLE__) 45 | unsigned long long m_start_sec; 46 | unsigned long long m_start_usec; 47 | #endif 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/kiwano/2d/animation/DelayAnimation.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | DelayAnimation::DelayAnimation(Duration delay) 27 | { 28 | this->SetDelay(delay); 29 | } 30 | 31 | DelayAnimation* DelayAnimation::Clone() const 32 | { 33 | DelayAnimation* ptr = new DelayAnimation(GetDelay()); 34 | DoClone(ptr); 35 | return ptr; 36 | } 37 | 38 | DelayAnimation* DelayAnimation::Reverse() const 39 | { 40 | return Clone(); 41 | } 42 | 43 | } // namespace kiwano 44 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_EDGE_AND_CIRCLE_CONTACT_H 20 | #define B2_EDGE_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2EdgeAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2EdgeAndCircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H 20 | #define B2_POLYGON_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2PolygonAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 30 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 31 | 32 | b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 33 | ~b2PolygonAndCircleContact() {} 34 | 35 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_EDGE_AND_POLYGON_CONTACT_H 20 | #define B2_EDGE_AND_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2EdgeAndPolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2EdgeAndPolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H 20 | #define B2_CHAIN_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2ChainAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); 34 | ~b2ChainAndCircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CHAIN_AND_POLYGON_CONTACT_H 20 | #define B2_CHAIN_AND_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2ChainAndPolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); 34 | ~b2ChainAndPolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/b2WorldCallbacks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 20 | #include "Box2D/Dynamics/b2Fixture.h" 21 | 22 | // Return true if contact calculations should be performed between these two shapes. 23 | // If you implement your own collision filter you may want to build from this implementation. 24 | bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) 25 | { 26 | const b2Filter& filterA = fixtureA->GetFilterData(); 27 | const b2Filter& filterB = fixtureB->GetFilterData(); 28 | 29 | if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) 30 | { 31 | return filterA.groupIndex > 0; 32 | } 33 | 34 | bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; 35 | return collide; 36 | } 37 | -------------------------------------------------------------------------------- /src/kiwano/math/Constants.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | namespace kiwano 24 | { 25 | namespace math 26 | { 27 | 28 | constexpr auto PI_F = 3.141592653589793f; 29 | constexpr auto PI_F_2 = 1.570796326794896f; 30 | constexpr auto PI_F_X_2 = 6.283185307179586f; 31 | 32 | constexpr auto PI_D = 3.14159265358979323846; 33 | constexpr auto PI_D_2 = 1.57079632679489661923; 34 | constexpr auto PI_D_X_2 = 6.28318530717958647692; 35 | 36 | constexpr auto FLOAT_MAX = 3.402823466e+38F; 37 | constexpr auto FLOAT_MIN = 1.175494351e-38F; 38 | 39 | } // namespace math 40 | } // namespace kiwano 41 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/b2ContactManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CONTACT_MANAGER_H 20 | #define B2_CONTACT_MANAGER_H 21 | 22 | #include "../Collision/b2BroadPhase.h" 23 | 24 | class b2Contact; 25 | class b2ContactFilter; 26 | class b2ContactListener; 27 | class b2BlockAllocator; 28 | 29 | // Delegate of b2World. 30 | class b2ContactManager 31 | { 32 | public: 33 | b2ContactManager(); 34 | 35 | // Broad-phase callback. 36 | void AddPair(void* proxyUserDataA, void* proxyUserDataB); 37 | 38 | void FindNewContacts(); 39 | 40 | void Destroy(b2Contact* c); 41 | 42 | void Collide(); 43 | 44 | b2BroadPhase m_broadPhase; 45 | b2Contact* m_contactList; 46 | int32 m_contactCount; 47 | b2ContactFilter* m_contactFilter; 48 | b2ContactListener* m_contactListener; 49 | b2BlockAllocator* m_allocator; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /projects/3rd-party/imgui/libimgui.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {6160FE38-37E6-41B0-9EAC-17047E5FB604} 6 | 7 | 8 | {679F9030-0259-4621-87DD-08D71081C409} 9 | 10 | 11 | 12 | 13 | include 14 | 15 | 16 | include 17 | 18 | 19 | include 20 | 21 | 22 | include 23 | 24 | 25 | include 26 | 27 | 28 | include 29 | 30 | 31 | 32 | 33 | src 34 | 35 | 36 | src 37 | 38 | 39 | src 40 | 41 | 42 | src 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/kiwano/base/component/Component.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | 27 | Component::Component() 28 | : enabled_(true) 29 | , actor_(nullptr) 30 | { 31 | } 32 | 33 | Component::~Component() {} 34 | 35 | void Component::InitComponent(Actor* actor) 36 | { 37 | actor_ = actor; 38 | } 39 | 40 | void Component::DestroyComponent() 41 | { 42 | actor_ = nullptr; 43 | } 44 | 45 | void Component::RemoveFromActor() 46 | { 47 | if (actor_) 48 | { 49 | actor_->RemoveComponent(this); 50 | actor_ = nullptr; 51 | } 52 | } 53 | 54 | } // namespace kiwano 55 | -------------------------------------------------------------------------------- /src/kiwano/render/TextStyle.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | TextStyle::TextStyle() 27 | : TextStyle(Font("", 18.f)) 28 | { 29 | } 30 | 31 | TextStyle::TextStyle(Font font) 32 | : font(font) 33 | , alignment(TextAlign::Left) 34 | , word_wrapping(TextWordWrapping::NoWrap) 35 | , wrap_width(0) 36 | , line_spacing(0) 37 | , show_underline(false) 38 | , show_strikethrough(false) 39 | { 40 | } 41 | 42 | TextStyle::TextStyle(StringView font_family, float font_size, uint32_t font_weight) 43 | : TextStyle(Font(font_family, font_size, font_weight)) 44 | { 45 | } 46 | 47 | } // namespace kiwano 48 | -------------------------------------------------------------------------------- /src/kiwano/math/Math.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace kiwano 32 | { 33 | 34 | using Vec2 = kiwano::math::Vec2T; 35 | using Rect = kiwano::math::RectT; 36 | using Matrix3x2 = kiwano::math::Matrix3x2T; 37 | using Transform = kiwano::math::TransformT; 38 | 39 | using Point = Vec2; 40 | using Size = Vec2; 41 | 42 | } // namespace kiwano 43 | -------------------------------------------------------------------------------- /src/kiwano/core/Singleton.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2020 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | namespace kiwano 24 | { 25 | 26 | template 27 | class Singleton 28 | { 29 | public: 30 | using object_type = _Ty; 31 | 32 | static inline object_type& GetInstance() 33 | { 34 | return instance_; 35 | } 36 | 37 | static inline object_type* GetInstancePtr() 38 | { 39 | return &instance_; 40 | } 41 | 42 | protected: 43 | Singleton() = default; 44 | Singleton(const Singleton&) = delete; 45 | Singleton& operator=(const Singleton&) = delete; 46 | 47 | static _Ty instance_; 48 | }; 49 | 50 | template 51 | _Ty Singleton<_Ty>::instance_; 52 | 53 | } // namespace kiwano 54 | -------------------------------------------------------------------------------- /src/kiwano/utils/EventTicker.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | TickEvent::TickEvent() 27 | : Event(KGE_EVENT(TickEvent)) 28 | , ticker_(nullptr) 29 | { 30 | } 31 | 32 | EventTicker::EventTicker() {} 33 | 34 | EventTicker::EventTicker(Duration interval, int tick_count) 35 | : Ticker(interval, tick_count) 36 | { 37 | } 38 | 39 | bool EventTicker::Tick(Duration dt) 40 | { 41 | if (Ticker::Tick(dt)) 42 | { 43 | RefPtr evt = new TickEvent; 44 | evt->delta_time_ = GetDeltaTime(); 45 | evt->ticker_ = this; 46 | DispatchEvent(evt.Get()); 47 | 48 | return true; 49 | } 50 | return false; 51 | } 52 | 53 | } // namespace kiwano 54 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2StackAllocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_STACK_ALLOCATOR_H 20 | #define B2_STACK_ALLOCATOR_H 21 | 22 | #include "b2Settings.h" 23 | 24 | const int32 b2_stackSize = 100 * 1024; // 100k 25 | const int32 b2_maxStackEntries = 32; 26 | 27 | struct b2StackEntry 28 | { 29 | char* data; 30 | int32 size; 31 | bool usedMalloc; 32 | }; 33 | 34 | // This is a stack allocator used for fast per step allocations. 35 | // You must nest allocate/free pairs. The code will assert 36 | // if you try to interleave multiple allocate/free pairs. 37 | class b2StackAllocator 38 | { 39 | public: 40 | b2StackAllocator(); 41 | ~b2StackAllocator(); 42 | 43 | void* Allocate(int32 size); 44 | void Free(void* p); 45 | 46 | int32 GetMaxAllocation() const; 47 | 48 | private: 49 | 50 | char m_data[b2_stackSize]; 51 | int32 m_index; 52 | 53 | int32 m_allocation; 54 | int32 m_maxAllocation; 55 | 56 | b2StackEntry m_entries[b2_maxStackEntries]; 57 | int32 m_entryCount; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | ![Kiwano Logo](./logo/logo_text_h.png) 2 | 3 | # Kiwano 游戏引擎 4 | 5 | [![Build status](https://ci.appveyor.com/api/projects/status/frqh09om9ldaklr9/branch/master?svg=true)](https://ci.appveyor.com/project/Nomango/kiwano/branch/master) 6 | [![GitHub release](https://img.shields.io/github/release/nomango/kiwano)](https://github.com/Nomango/Kiwano/releases/latest) 7 | [![GitHub license](https://img.shields.io/github/license/nomango/kiwano)](https://github.com/Nomango/Kiwano/blob/master/LICENSE) 8 | 9 | [English](./README.md) | 简体中文 10 | 11 | ## 介绍 12 | 13 | Kiwano 是一个使用 C++ 开发的 2D 游戏引擎,目前仅支持 Windows 平台。 14 | 15 | Kiwano-Core 是一个提供了一系列实用工具的游戏无关库,它的目的是简化 C++ 开发过程。 16 | 17 | 这个仓库仍处于开发过程中,我创建这个仓库用来学习游戏引擎知识和开发自己的小游戏。 18 | 19 | 你可以到 [Kiwano Demos](https://github.com/kiwanogame/KiwanoDemos) 仓库查看和学习如何使用 Kiwano 引擎实现小游戏。 20 | 21 | 欢迎您任何形式的贡献。 22 | 23 | ## 功能 24 | 25 | * 舞台和角色管理 26 | * 舞台过渡动画 27 | * 动作行为 28 | * 按钮等简易UI元素 29 | * 音频支持 30 | * 网络通信支持 31 | * 数据持久化 32 | * 物理引擎 (基于 Box2D) 33 | * GUI 引擎 (基于 ImGui) 34 | 35 | ## 安装 36 | 37 | ### 开发环境 38 | 39 | - Win8 或更高 (推荐 Win10) 40 | - Visual Studio 2015 或更高 41 | 42 | ### 通过 NuGet 安装 43 | 44 | 1. 打开你的 Visual Studio 解决方案 45 | 2. 在解决方案资源管理器, 右击 `引用` 并选择 `管理 NuGet 程序包` 46 | 3. 选择 `浏览` 选项卡, 搜索 `kiwano`, 选中列表中的包然后点击 `安装` 47 | 4. 开始使用 Kiwano 进行开发吧! 48 | 49 | ### 通过源代码安装 50 | 51 | 1. 从 Github 仓库克隆或下载源代码 52 | 2. 打开你的 Visual Studio 解决方案, 在解决方案资源管理器中右键你的解决方案, 选择 `添加` => `现有项` 53 | 3. 选中源代码目录下 /projects 文件夹中所有的 `.vcxproj` 文件,并确认添加 54 | 4. 右键你的项目,打开 `属性`, 选中 C\C++ => 常规, 并将源代码文件夹下的 src 目录添加到 `附加包含目录` 中 55 | 5. 右键你的项目 `引用` 并选择 `添加引用`, 选中 `kiwano` 项目和其他你需要的项目 56 | 6. 开始使用 Kiwano 进行开发吧! 57 | 58 | ## Star History 59 | 60 | [![Star History Chart](https://api.star-history.com/svg?repos=kiwanoengine/kiwano&type=Date)](https://star-history.com/#kiwanoengine/kiwano&Date) 61 | 62 | ## 开发计划 63 | 64 | * 跨平台支持 65 | * 粒子系统 66 | 67 | ## 社交媒体 68 | 69 | * 网站: [kiwanoengine.com](https://kiwanoengine.com) 70 | * QQ群: 608406540 71 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/registry.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #include "vorbis/codec.h" 18 | #include "codec_internal.h" 19 | #include "registry.h" 20 | #include "misc.h" 21 | /* seems like major overkill now; the backend numbers will grow into 22 | the infrastructure soon enough */ 23 | 24 | extern const vorbis_func_floor floor0_exportbundle; 25 | extern const vorbis_func_floor floor1_exportbundle; 26 | extern const vorbis_func_residue residue0_exportbundle; 27 | extern const vorbis_func_residue residue1_exportbundle; 28 | extern const vorbis_func_residue residue2_exportbundle; 29 | extern const vorbis_func_mapping mapping0_exportbundle; 30 | 31 | const vorbis_func_floor *const _floor_P[]={ 32 | &floor0_exportbundle, 33 | &floor1_exportbundle, 34 | }; 35 | 36 | const vorbis_func_residue *const _residue_P[]={ 37 | &residue0_exportbundle, 38 | &residue1_exportbundle, 39 | &residue2_exportbundle, 40 | }; 41 | 42 | const vorbis_func_mapping *const _mapping_P[]={ 43 | &mapping0_exportbundle, 44 | }; 45 | -------------------------------------------------------------------------------- /src/kiwano-imgui/imgui_impl/imgui_impl.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for Kiwano 2 | 3 | #pragma once 4 | 5 | #ifndef KGE_DOXYGEN_DO_NOT_INCLUDE 6 | 7 | #if !defined(KGE_USE_DIRECTX10) 8 | 9 | #include 10 | #include 11 | 12 | inline bool ImGui_Impl_Init() 13 | { 14 | auto d3d = kiwano::graphics::directx::GetD3DDeviceResources(); 15 | return ImGui_ImplDX11_Init(d3d->GetDevice(), d3d->GetDeviceContext()); 16 | } 17 | 18 | inline void ImGui_Impl_Shutdown() 19 | { 20 | ImGui_ImplDX11_Shutdown(); 21 | } 22 | 23 | inline void ImGui_Impl_NewFrame() 24 | { 25 | ImGui_ImplDX11_NewFrame(); 26 | } 27 | 28 | inline void ImGui_Impl_RenderDrawData(ImDrawData* draw_data) 29 | { 30 | ImGui_ImplDX11_RenderDrawData(draw_data); 31 | } 32 | 33 | inline void ImGui_Impl_InvalidateDeviceObjects() 34 | { 35 | ImGui_ImplDX11_InvalidateDeviceObjects(); 36 | } 37 | 38 | inline bool ImGui_Impl_CreateDeviceObjects() 39 | { 40 | return ImGui_ImplDX11_CreateDeviceObjects(); 41 | } 42 | 43 | #else 44 | 45 | #include 46 | #include 47 | 48 | inline bool ImGui_Impl_Init() 49 | { 50 | auto d3d = kiwano::graphics::directx::GetD3DDeviceResources(); 51 | return ImGui_ImplDX10_Init(d3d->GetDevice()); 52 | } 53 | 54 | inline void ImGui_Impl_Shutdown() 55 | { 56 | ImGui_ImplDX10_Shutdown(); 57 | } 58 | 59 | inline void ImGui_Impl_NewFrame() 60 | { 61 | ImGui_ImplDX10_NewFrame(); 62 | } 63 | 64 | inline void ImGui_Impl_RenderDrawData(ImDrawData* draw_data) 65 | { 66 | ImGui_ImplDX10_RenderDrawData(draw_data); 67 | } 68 | 69 | inline void ImGui_Impl_InvalidateDeviceObjects() 70 | { 71 | ImGui_ImplDX10_InvalidateDeviceObjects(); 72 | } 73 | 74 | inline bool ImGui_Impl_CreateDeviceObjects() 75 | { 76 | return ImGui_ImplDX10_CreateDeviceObjects(); 77 | } 78 | 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/kiwano/platform/win32/libraries.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | namespace win32 27 | { 28 | namespace dlls 29 | { 30 | 31 | Shlwapi::Shlwapi() 32 | : shlwapi() 33 | , PathFileExistsW(nullptr) 34 | , SHCreateMemStream(nullptr) 35 | { 36 | if (shlwapi.Load("shlwapi.dll")) 37 | { 38 | PathFileExistsW = shlwapi.GetProcess("PathFileExistsW"); 39 | SHCreateMemStream = shlwapi.GetProcess("SHCreateMemStream"); 40 | } 41 | else 42 | { 43 | KGE_THROW_SYSTEM_ERROR(HRESULT_FROM_WIN32(GetLastError()), "Load shlapi.dll failed"); 44 | } 45 | } 46 | 47 | } // namespace dlls 48 | } // namespace win32 49 | } // namespace kiwano 50 | -------------------------------------------------------------------------------- /src/kiwano/core/BitOperator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019-2020 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include // std::is_arithmetic 23 | 24 | namespace kiwano 25 | { 26 | namespace bits 27 | { 28 | 29 | template 30 | inline void Set(_Ty& old, _Ty flag) 31 | { 32 | static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); 33 | old |= flag; 34 | } 35 | 36 | template 37 | inline void Unset(_Ty& old, _Ty flag) 38 | { 39 | static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); 40 | old &= ~flag; 41 | } 42 | 43 | template 44 | inline bool Has(_Ty old, _Ty flag) 45 | { 46 | static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type"); 47 | return !!(old & flag); 48 | } 49 | 50 | } // namespace bits 51 | } // namespace kiwano 52 | -------------------------------------------------------------------------------- /src/kiwano-audio/libraries.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | #include 24 | 25 | #ifndef KGE_DOXYGEN_DO_NOT_INCLUDE 26 | 27 | namespace kiwano 28 | { 29 | namespace audio 30 | { 31 | namespace dlls 32 | { 33 | class KGE_API XAudio2 34 | { 35 | public: 36 | static inline XAudio2& Get() 37 | { 38 | static XAudio2 instance; 39 | return instance; 40 | } 41 | 42 | // XAudio2 functions 43 | typedef HRESULT(WINAPI* PFN_XAudio2Create)(IXAudio2**, UINT32, XAUDIO2_PROCESSOR); 44 | 45 | PFN_XAudio2Create XAudio2Create; 46 | 47 | private: 48 | XAudio2(); 49 | 50 | XAudio2(const XAudio2&) = delete; 51 | XAudio2& operator=(const XAudio2&) = delete; 52 | 53 | Library xaudio2; 54 | }; 55 | } // namespace dlls 56 | } // namespace audio 57 | } // namespace kiwano 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/b2TimeStep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2011 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIME_STEP_H 20 | #define B2_TIME_STEP_H 21 | 22 | #include "../Common/b2Math.h" 23 | 24 | /// Profiling data. Times are in milliseconds. 25 | struct b2Profile 26 | { 27 | float32 step; 28 | float32 collide; 29 | float32 solve; 30 | float32 solveInit; 31 | float32 solveVelocity; 32 | float32 solvePosition; 33 | float32 broadphase; 34 | float32 solveTOI; 35 | }; 36 | 37 | /// This is an internal structure. 38 | struct b2TimeStep 39 | { 40 | float32 dt; // time step 41 | float32 inv_dt; // inverse time step (0 if dt == 0). 42 | float32 dtRatio; // dt * inv_dt0 43 | int32 velocityIterations; 44 | int32 positionIterations; 45 | bool warmStarting; 46 | }; 47 | 48 | /// This is an internal structure. 49 | struct b2Position 50 | { 51 | b2Vec2 c; 52 | float32 a; 53 | }; 54 | 55 | /// This is an internal structure. 56 | struct b2Velocity 57 | { 58 | b2Vec2 v; 59 | float32 w; 60 | }; 61 | 62 | /// Solver Data 63 | struct b2SolverData 64 | { 65 | b2TimeStep step; 66 | b2Position* positions; 67 | b2Velocity* velocities; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/highlevel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: highlevel encoder setup struct separated out for vorbisenc clarity 14 | 15 | ********************************************************************/ 16 | 17 | typedef struct highlevel_byblocktype { 18 | double tone_mask_setting; 19 | double tone_peaklimit_setting; 20 | double noise_bias_setting; 21 | double noise_compand_setting; 22 | } highlevel_byblocktype; 23 | 24 | typedef struct highlevel_encode_setup { 25 | int set_in_stone; 26 | const void *setup; 27 | double base_setting; 28 | 29 | double impulse_noisetune; 30 | 31 | /* bitrate management below all settable */ 32 | float req; 33 | int managed; 34 | long bitrate_min; 35 | long bitrate_av; 36 | double bitrate_av_damp; 37 | long bitrate_max; 38 | long bitrate_reservoir; 39 | double bitrate_reservoir_bias; 40 | 41 | int impulse_block_p; 42 | int noise_normalize_p; 43 | int coupling_p; 44 | 45 | double stereo_point_setting; 46 | double lowpass_kHz; 47 | int lowpass_altered; 48 | 49 | double ath_floating_dB; 50 | double ath_absolute_dB; 51 | 52 | double amplitude_track_dBpersec; 53 | double trigger_setting; 54 | 55 | highlevel_byblocktype block[4]; /* padding, impulse, transition, long */ 56 | 57 | } highlevel_encode_setup; 58 | -------------------------------------------------------------------------------- /src/kiwano/2d/LayerActor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | 28 | LayerActor::LayerActor(const Rect& bounds, float opacity) 29 | : swallow_(false) 30 | , layer_(bounds, opacity) 31 | { 32 | } 33 | 34 | LayerActor::LayerActor(RefPtr mask, const Matrix3x2& mask_transform, float opacity, const Rect& bounds) 35 | : swallow_(false) 36 | , layer_(mask, mask_transform, opacity, bounds) 37 | { 38 | } 39 | 40 | LayerActor::~LayerActor() {} 41 | 42 | void LayerActor::Render(RenderContext& ctx) 43 | { 44 | PrepareToRender(ctx); 45 | ctx.PushLayer(layer_); 46 | Actor::Render(ctx); 47 | ctx.PopLayer(); 48 | } 49 | 50 | bool LayerActor::CheckVisibility(RenderContext& ctx) const 51 | { 52 | // Do not need to render LayerActor 53 | return false; 54 | } 55 | 56 | } // namespace kiwano 57 | -------------------------------------------------------------------------------- /src/kiwano/render/DirectX/TextRenderer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | namespace graphics 27 | { 28 | namespace directx 29 | { 30 | interface DWRITE_DECLARE_INTERFACE("b293e798-9916-4096-a3c1-e5d4039dfa64") ITextRenderer : public IDWriteTextRenderer 31 | { 32 | public: 33 | static KGE_API HRESULT Create(_Out_ ITextRenderer * *ppTextRenderer, _In_ ID2D1DeviceContext * pContext); 34 | 35 | STDMETHOD(DrawTextLayout) 36 | (_In_ IDWriteTextLayout * pTextLayout, float fOriginX, float fOriginY, _In_opt_ ID2D1Brush* pDefaultFillBrush, 37 | _In_opt_ ID2D1Brush* pDefaultOutlineBrush, float fDefaultOutlineWidth, 38 | _In_opt_ ID2D1StrokeStyle* pDefaultStrokeStyle) PURE; 39 | 40 | STDMETHOD_(uint32_t, GetLastPrimitivesCount)() PURE; 41 | }; 42 | } // namespace directx 43 | } // namespace graphics 44 | } // namespace kiwano 45 | -------------------------------------------------------------------------------- /src/kiwano/platform/win32/libraries.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | namespace win32 28 | { 29 | namespace dlls 30 | { 31 | class KGE_API Shlwapi 32 | { 33 | public: 34 | static inline Shlwapi& Get() 35 | { 36 | static Shlwapi instance; 37 | return instance; 38 | } 39 | 40 | // Shlwapi functions 41 | typedef BOOL(WINAPI* PFN_PathFileExistsW)(LPCWSTR); 42 | typedef IStream*(WINAPI* PFN_SHCreateMemStream)(const BYTE*, UINT); 43 | 44 | PFN_PathFileExistsW PathFileExistsW; 45 | PFN_SHCreateMemStream SHCreateMemStream; 46 | 47 | private: 48 | Shlwapi(); 49 | 50 | Shlwapi(const Shlwapi&) = delete; 51 | Shlwapi& operator=(const Shlwapi&) = delete; 52 | 53 | Library shlwapi; 54 | }; 55 | } // namespace dlls 56 | } // namespace win32 57 | } // namespace kiwano 58 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Collision/b2TimeOfImpact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIME_OF_IMPACT_H 20 | #define B2_TIME_OF_IMPACT_H 21 | 22 | #include "../Common/b2Math.h" 23 | #include "b2Distance.h" 24 | 25 | /// Input parameters for b2TimeOfImpact 26 | struct b2TOIInput 27 | { 28 | b2DistanceProxy proxyA; 29 | b2DistanceProxy proxyB; 30 | b2Sweep sweepA; 31 | b2Sweep sweepB; 32 | float32 tMax; // defines sweep interval [0, tMax] 33 | }; 34 | 35 | /// Output parameters for b2TimeOfImpact. 36 | struct b2TOIOutput 37 | { 38 | enum State 39 | { 40 | e_unknown, 41 | e_failed, 42 | e_overlapped, 43 | e_touching, 44 | e_separated 45 | }; 46 | 47 | State state; 48 | float32 t; 49 | }; 50 | 51 | /// Compute the upper bound on time before two shapes penetrate. Time is represented as 52 | /// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, 53 | /// non-tunneling collisions. If you change the time interval, you should call this function 54 | /// again. 55 | /// Note: use b2Distance to compute the contact point and normal at the time of impact. 56 | void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Collision/Shapes/b2CircleShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CIRCLE_SHAPE_H 20 | #define B2_CIRCLE_SHAPE_H 21 | 22 | #include "b2Shape.h" 23 | 24 | /// A circle shape. 25 | class b2CircleShape : public b2Shape 26 | { 27 | public: 28 | b2CircleShape(); 29 | 30 | /// Implement b2Shape. 31 | b2Shape* Clone(b2BlockAllocator* allocator) const override; 32 | 33 | /// @see b2Shape::GetChildCount 34 | int32 GetChildCount() const override; 35 | 36 | /// Implement b2Shape. 37 | bool TestPoint(const b2Transform& transform, const b2Vec2& p) const override; 38 | 39 | /// Implement b2Shape. 40 | bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, 41 | const b2Transform& transform, int32 childIndex) const override; 42 | 43 | /// @see b2Shape::ComputeAABB 44 | void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const override; 45 | 46 | /// @see b2Shape::ComputeMass 47 | void ComputeMass(b2MassData* massData, float32 density) const override; 48 | 49 | /// Position 50 | b2Vec2 m_p; 51 | }; 52 | 53 | inline b2CircleShape::b2CircleShape() 54 | { 55 | m_type = e_circle; 56 | m_radius = 0.0f; 57 | m_p.SetZero(); 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/kiwano/render/DirectX/D3DDeviceResources.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | 23 | #if defined(KGE_USE_DIRECTX10) 24 | #include 25 | #else 26 | #include 27 | #endif 28 | 29 | namespace kiwano 30 | { 31 | namespace graphics 32 | { 33 | namespace directx 34 | { 35 | 36 | #if defined(KGE_USE_DIRECTX10) 37 | using ID3DDeviceResources = kiwano::graphics::directx::ID3D10DeviceResources; 38 | 39 | inline ComPtr GetD3DDeviceResources() 40 | { 41 | return kiwano::graphics::directx::GetD3D10DeviceResources(); 42 | } 43 | #else 44 | using ID3DDeviceResources = kiwano::graphics::directx::ID3D11DeviceResources; 45 | 46 | inline ComPtr GetD3DDeviceResources() 47 | { 48 | return kiwano::graphics::directx::GetD3D11DeviceResources(); 49 | } 50 | #endif 51 | 52 | } // namespace directx 53 | } // namespace graphics 54 | } // namespace kiwano 55 | -------------------------------------------------------------------------------- /src/kiwano/core/Library.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | Library::Library() 27 | : instance_(nullptr) 28 | { 29 | } 30 | 31 | Library::Library(StringView lib) 32 | : instance_(nullptr) 33 | { 34 | Load(lib); 35 | } 36 | 37 | Library::~Library() 38 | { 39 | Free(); 40 | } 41 | 42 | bool Library::Load(StringView lib) 43 | { 44 | instance_ = ::LoadLibraryA(lib.data()); 45 | return IsValid(); 46 | } 47 | 48 | bool Library::IsValid() const 49 | { 50 | return instance_ != nullptr; 51 | } 52 | 53 | void Library::Free() 54 | { 55 | if (instance_) 56 | { 57 | ::FreeLibrary(instance_); 58 | instance_ = nullptr; 59 | } 60 | } 61 | 62 | FARPROC Library::GetProcess(StringView proc_name) 63 | { 64 | KGE_ASSERT(instance_ != nullptr); 65 | 66 | if (!IsValid()) 67 | return nullptr; 68 | return GetProcAddress(instance_, proc_name.data()); 69 | } 70 | 71 | } // namespace kiwano 72 | -------------------------------------------------------------------------------- /src/kiwano/core/UUID.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include "UUID.h" 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | 28 | String UUID::ToString() const 29 | { 30 | char s[39]; 31 | ::sprintf_s(s, sizeof(s), "%08x-%04x-%04x-%04x-%012llx", part1, part2, part3, (part4[0] << 8) | part4[1], 32 | *((unsigned long long*)&part4[2])); 33 | return String(s); 34 | } 35 | 36 | UUID UUID::FromString(StringView s) 37 | { 38 | UUID uuid = { 0 }; 39 | 40 | unsigned int data4[8] = { 0 }; 41 | if (::sscanf_s(s.data(), "%8lx-%4hx-%4hx-%2x%2x-%2x%2x%2x%2x%2x%2x", &uuid.part1, &uuid.part2, &uuid.part3, 42 | &data4[0], &data4[1], &data4[2], &data4[3], &data4[4], &data4[5], &data4[6], &data4[7]) 43 | != 11) 44 | { 45 | throw std::invalid_argument("Invalid UUID format"); 46 | } 47 | for (int i = 0; i < 8; ++i) 48 | { 49 | uuid.part4[i] = static_cast(data4[i]); 50 | } 51 | return uuid; 52 | } 53 | 54 | } // namespace kiwano 55 | -------------------------------------------------------------------------------- /projects/kiwano-audio/kiwano-audio.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | MediaFoundation 12 | 13 | 14 | 15 | MediaFoundation 16 | 17 | 18 | Ogg 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | MediaFoundation 28 | 29 | 30 | 31 | MediaFoundation 32 | 33 | 34 | Ogg 35 | 36 | 37 | 38 | 39 | {213a58dc-8054-4bc7-bac5-456e889ae038} 40 | 41 | 42 | {fd19f717-c321-45c3-948d-5cad830e1072} 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = modes books 4 | 5 | AM_CPPFLAGS = -I$(top_srcdir)/include @OGG_CFLAGS@ 6 | 7 | lib_LTLIBRARIES = libvorbis.la libvorbisfile.la libvorbisenc.la 8 | 9 | libvorbis_la_SOURCES = mdct.c smallft.c block.c envelope.c window.c lsp.c \ 10 | lpc.c analysis.c synthesis.c psy.c info.c \ 11 | floor1.c floor0.c\ 12 | res0.c mapping0.c registry.c codebook.c sharedbook.c\ 13 | lookup.c bitrate.c\ 14 | envelope.h lpc.h lsp.h codebook.h misc.h psy.h\ 15 | masking.h os.h mdct.h smallft.h highlevel.h\ 16 | registry.h scales.h window.h lookup.h lookup_data.h\ 17 | codec_internal.h backends.h bitrate.h 18 | libvorbis_la_LDFLAGS = -no-undefined -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@ 19 | libvorbis_la_LIBADD = @VORBIS_LIBS@ @OGG_LIBS@ 20 | 21 | libvorbisfile_la_SOURCES = vorbisfile.c 22 | libvorbisfile_la_LDFLAGS = -no-undefined -version-info @VF_LIB_CURRENT@:@VF_LIB_REVISION@:@VF_LIB_AGE@ 23 | libvorbisfile_la_LIBADD = libvorbis.la @OGG_LIBS@ 24 | 25 | libvorbisenc_la_SOURCES = vorbisenc.c 26 | libvorbisenc_la_LDFLAGS = -no-undefined -version-info @VE_LIB_CURRENT@:@VE_LIB_REVISION@:@VE_LIB_AGE@ 27 | libvorbisenc_la_LIBADD = libvorbis.la @OGG_LIBS@ 28 | 29 | EXTRA_PROGRAMS = barkmel tone psytune 30 | CLEANFILES = $(EXTRA_PROGRAMS) 31 | 32 | barkmel_SOURCES = barkmel.c 33 | tone_SOURCES = tone.c 34 | psytune_SOURCES = psytune.c 35 | psytune_LDFLAGS = -static 36 | psytune_LDADD = libvorbis.la 37 | 38 | EXTRA_DIST = lookups.pl CMakeLists.txt 39 | 40 | # build and run the self tests on 'make check' 41 | 42 | #vorbis_selftests = test_codebook test_sharedbook 43 | vorbis_selftests = test_sharedbook 44 | 45 | noinst_PROGRAMS = $(vorbis_selftests) 46 | 47 | check: $(noinst_PROGRAMS) 48 | ./test_sharedbook$(EXEEXT) 49 | 50 | #test_codebook_SOURCES = codebook.c 51 | #test_codebook_CFLAGS = -D_V_SELFTEST 52 | 53 | test_sharedbook_SOURCES = sharedbook.c 54 | test_sharedbook_CFLAGS = -D_V_SELFTEST 55 | test_sharedbook_LDADD = @VORBIS_LIBS@ 56 | 57 | # recurse for alternate targets 58 | 59 | debug: 60 | $(MAKE) all CFLAGS="@DEBUG@" 61 | 62 | profile: 63 | $(MAKE) all CFLAGS="@PROFILE@" 64 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/bitrate.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: bitrate tracking and management 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_BITRATE_H_ 18 | #define _V_BITRATE_H_ 19 | 20 | #include "vorbis/codec.h" 21 | #include "codec_internal.h" 22 | #include "os.h" 23 | 24 | /* encode side bitrate tracking */ 25 | typedef struct bitrate_manager_state { 26 | int managed; 27 | 28 | long avg_reservoir; 29 | long minmax_reservoir; 30 | long avg_bitsper; 31 | long min_bitsper; 32 | long max_bitsper; 33 | 34 | long short_per_long; 35 | double avgfloat; 36 | 37 | vorbis_block *vb; 38 | int choice; 39 | } bitrate_manager_state; 40 | 41 | typedef struct bitrate_manager_info{ 42 | long avg_rate; 43 | long min_rate; 44 | long max_rate; 45 | long reservoir_bits; 46 | double reservoir_bias; 47 | 48 | double slew_damp; 49 | 50 | } bitrate_manager_info; 51 | 52 | extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs); 53 | extern void vorbis_bitrate_clear(bitrate_manager_state *bs); 54 | extern int vorbis_bitrate_managed(vorbis_block *vb); 55 | extern int vorbis_bitrate_addblock(vorbis_block *vb); 56 | extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/kiwano-audio/libraries.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | namespace audio 28 | { 29 | namespace dlls 30 | { 31 | XAudio2::XAudio2() 32 | : xaudio2() 33 | , XAudio2Create(nullptr) 34 | { 35 | const auto xaudio2_dll_names = { 36 | "xaudio2_9.dll", // for Windows 10 37 | "xaudio2_8.dll", // for Windows 8 38 | "xaudio2_7.dll" // for DirectX SDK 39 | }; 40 | 41 | for (const auto& name : xaudio2_dll_names) 42 | { 43 | if (xaudio2.Load(name)) 44 | { 45 | break; 46 | } 47 | } 48 | 49 | if (xaudio2.IsValid()) 50 | { 51 | XAudio2Create = xaudio2.GetProcess("XAudio2Create"); 52 | } 53 | else 54 | { 55 | KGE_THROW_SYSTEM_ERROR(HRESULT_FROM_WIN32(GetLastError()), "Load xaudio2.dll failed"); 56 | } 57 | } 58 | } // namespace dlls 59 | } // namespace audio 60 | } // namespace kiwano 61 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2BlockAllocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_BLOCK_ALLOCATOR_H 20 | #define B2_BLOCK_ALLOCATOR_H 21 | 22 | #include "b2Settings.h" 23 | 24 | const int32 b2_chunkSize = 16 * 1024; 25 | const int32 b2_maxBlockSize = 640; 26 | const int32 b2_blockSizes = 14; 27 | const int32 b2_chunkArrayIncrement = 128; 28 | 29 | struct b2Block; 30 | struct b2Chunk; 31 | 32 | /// This is a small object allocator used for allocating small 33 | /// objects that persist for more than one time step. 34 | /// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp 35 | class b2BlockAllocator 36 | { 37 | public: 38 | b2BlockAllocator(); 39 | ~b2BlockAllocator(); 40 | 41 | /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. 42 | void* Allocate(int32 size); 43 | 44 | /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. 45 | void Free(void* p, int32 size); 46 | 47 | void Clear(); 48 | 49 | private: 50 | 51 | b2Chunk* m_chunks; 52 | int32 m_chunkCount; 53 | int32 m_chunkSpace; 54 | 55 | b2Block* m_freeLists[b2_blockSizes]; 56 | 57 | static int32 s_blockSizes[b2_blockSizes]; 58 | static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; 59 | static bool s_blockSizeLookupInitialized; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/misc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: miscellaneous prototypes 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_RANDOM_H_ 18 | #define _V_RANDOM_H_ 19 | #include "vorbis/codec.h" 20 | 21 | extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes); 22 | extern void _vorbis_block_ripcord(vorbis_block *vb); 23 | extern int ov_ilog(ogg_uint32_t v); 24 | 25 | #ifdef ANALYSIS 26 | extern int analysis_noisy; 27 | extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, 28 | ogg_int64_t off); 29 | extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, 30 | ogg_int64_t off); 31 | #endif 32 | 33 | #ifdef DEBUG_MALLOC 34 | 35 | #define _VDBG_GRAPHFILE "malloc.m" 36 | #undef _VDBG_GRAPHFILE 37 | extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line); 38 | extern void _VDBG_free(void *ptr,char *file,long line); 39 | 40 | #ifndef MISC_C 41 | #undef _ogg_malloc 42 | #undef _ogg_calloc 43 | #undef _ogg_realloc 44 | #undef _ogg_free 45 | 46 | #define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__) 47 | #define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__) 48 | #define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__) 49 | #define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__) 50 | #endif 51 | #endif 52 | 53 | #endif 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/kiwano-imgui/Layer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | namespace imgui 26 | { 27 | 28 | Layer::Layer() 29 | : LayerActor(nullptr) 30 | { 31 | } 32 | 33 | Layer::Layer(StringView name, const Pipeline& item) 34 | : Layer() 35 | { 36 | AddItem(name, item); 37 | } 38 | 39 | Layer::~Layer() {} 40 | 41 | void Layer::OnRender(RenderContext& ctx) 42 | { 43 | for (const auto& pipeline : pipelines_) 44 | { 45 | pipeline.second(); 46 | } 47 | } 48 | 49 | bool Layer::CheckVisibility(RenderContext& ctx) const 50 | { 51 | return true; 52 | } 53 | 54 | void Layer::AddItem(StringView name, const Pipeline& item) 55 | { 56 | pipelines_[name] = item; 57 | } 58 | 59 | void Layer::RemoveItem(StringView name) 60 | { 61 | auto iter = pipelines_.find(name); 62 | if (iter != pipelines_.end()) 63 | { 64 | pipelines_.erase(iter); 65 | } 66 | } 67 | 68 | void Layer::RemoveAllItems() 69 | { 70 | pipelines_.clear(); 71 | } 72 | } // namespace imgui 73 | } // namespace kiwano 74 | -------------------------------------------------------------------------------- /src/kiwano/2d/transition/BoxTransition.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | BoxTransition::BoxTransition(Duration duration) 27 | { 28 | SetDuration(duration); 29 | } 30 | 31 | void BoxTransition::Init(Stage* prev, Stage* next) 32 | { 33 | Transition::Init(prev, next); 34 | 35 | in_layer_.opacity = 0.f; 36 | } 37 | 38 | void BoxTransition::Update(Duration dt) 39 | { 40 | Transition::Update(dt); 41 | 42 | if (process_ < .5f) 43 | { 44 | out_layer_.bounds = Rect(window_size_.x * process_, window_size_.y * process_, window_size_.x * (1 - process_), 45 | window_size_.y * (1 - process_)); 46 | } 47 | else 48 | { 49 | out_layer_.opacity = 0.f; 50 | in_layer_.opacity = 1.f; 51 | in_layer_.bounds = Rect(window_size_.x * (1 - process_), window_size_.y * (1 - process_), 52 | window_size_.x * process_, window_size_.y * process_); 53 | } 54 | } 55 | 56 | } // namespace kiwano 57 | -------------------------------------------------------------------------------- /src/kiwano/2d/Stage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | 28 | Stage::Stage() 29 | { 30 | SetStage(this); 31 | 32 | SetAnchor(Vec2{ 0, 0 }); 33 | SetSize(Renderer::GetInstance().GetOutputSize()); 34 | } 35 | 36 | Stage::~Stage() {} 37 | 38 | void Stage::OnEnter() 39 | { 40 | KGE_DEBUG_LOGF("Stage entered"); 41 | } 42 | 43 | void Stage::OnExit() 44 | { 45 | KGE_DEBUG_LOGF("Stage exited"); 46 | } 47 | 48 | void Stage::RenderBorder(RenderContext& ctx) 49 | { 50 | ctx.SetBrushOpacity(GetDisplayedOpacity()); 51 | 52 | if (!border_fill_brush_) 53 | { 54 | border_fill_brush_ = MakePtr(); 55 | border_fill_brush_->SetColor(Color(Color::Red, .4f)); 56 | } 57 | 58 | if (!border_stroke_brush_) 59 | { 60 | border_stroke_brush_ = MakePtr(); 61 | border_stroke_brush_->SetColor(Color(Color::Red, .8f)); 62 | } 63 | 64 | Actor::RenderBorder(ctx); 65 | } 66 | 67 | } // namespace kiwano 68 | -------------------------------------------------------------------------------- /src/kiwano/2d/transition/FadeTransition.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | FadeTransition::FadeTransition(Duration duration, bool parallel) 27 | : parallel_(parallel) 28 | { 29 | SetDuration(duration); 30 | } 31 | 32 | void FadeTransition::Init(Stage* prev, Stage* next) 33 | { 34 | Transition::Init(prev, next); 35 | 36 | out_layer_.opacity = 1.f; 37 | in_layer_.opacity = 0.f; 38 | } 39 | 40 | void FadeTransition::Update(Duration dt) 41 | { 42 | Transition::Update(dt); 43 | 44 | if (parallel_) 45 | { 46 | out_layer_.opacity = 1 - process_; 47 | in_layer_.opacity = process_; 48 | } 49 | else 50 | { 51 | if (process_ < 0.5) 52 | { 53 | out_layer_.opacity = 1 - process_ * 2; 54 | in_layer_.opacity = 0.f; 55 | } 56 | else 57 | { 58 | out_layer_.opacity = 0.f; 59 | in_layer_.opacity = (process_ - 0.5f) * 2; 60 | } 61 | } 62 | } 63 | 64 | } // namespace kiwano 65 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); 28 | return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); 34 | allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); 35 | } 36 | 37 | b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 42 | } 43 | 44 | void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollideEdgeAndCircle( manifold, 47 | (b2EdgeShape*)m_fixtureA->GetShape(), xfA, 48 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/mdct.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: modified discrete cosine transform prototypes 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _OGG_mdct_H_ 18 | #define _OGG_mdct_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | 23 | 24 | 25 | 26 | /*#define MDCT_INTEGERIZED <- be warned there could be some hurt left here*/ 27 | #ifdef MDCT_INTEGERIZED 28 | 29 | #define DATA_TYPE int 30 | #define REG_TYPE register int 31 | #define TRIGBITS 14 32 | #define cPI3_8 6270 33 | #define cPI2_8 11585 34 | #define cPI1_8 15137 35 | 36 | #define FLOAT_CONV(x) ((int)((x)*(1<>TRIGBITS) 38 | #define HALVE(x) ((x)>>1) 39 | 40 | #else 41 | 42 | #define DATA_TYPE float 43 | #define REG_TYPE float 44 | #define cPI3_8 .38268343236508977175F 45 | #define cPI2_8 .70710678118654752441F 46 | #define cPI1_8 .92387953251128675613F 47 | 48 | #define FLOAT_CONV(x) (x) 49 | #define MULT_NORM(x) (x) 50 | #define HALVE(x) ((x)*.5f) 51 | 52 | #endif 53 | 54 | 55 | typedef struct { 56 | int n; 57 | int log2n; 58 | 59 | DATA_TYPE *trig; 60 | int *bitrev; 61 | 62 | DATA_TYPE scale; 63 | } mdct_lookup; 64 | 65 | extern void mdct_init(mdct_lookup *lookup,int n); 66 | extern void mdct_clear(mdct_lookup *l); 67 | extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); 68 | extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/kiwano/core/Allocator.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | namespace memory 26 | { 27 | 28 | MemoryAllocator* current_allocator_ = nullptr; 29 | 30 | MemoryAllocator* GetGlobalAllocator() 31 | { 32 | class KGE_API GlobalAllocator : public MemoryAllocator 33 | { 34 | public: 35 | virtual void* Alloc(size_t size) override 36 | { 37 | return ::operator new(size); 38 | } 39 | 40 | virtual void Free(void* ptr) override 41 | { 42 | ::operator delete(ptr); 43 | } 44 | }; 45 | 46 | static GlobalAllocator global_allocator; 47 | return &global_allocator; 48 | } 49 | 50 | MemoryAllocator* GetAllocator() 51 | { 52 | if (!current_allocator_) 53 | { 54 | current_allocator_ = GetGlobalAllocator(); 55 | } 56 | return current_allocator_; 57 | } 58 | 59 | void SetAllocator(MemoryAllocator* allocator) 60 | { 61 | KGE_ASSERT(allocator); 62 | current_allocator_ = allocator; 63 | } 64 | 65 | } // namespace memory 66 | } // namespace kiwano 67 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); 28 | return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); 34 | allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); 35 | } 36 | 37 | b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); 42 | } 43 | 44 | void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollideEdgeAndPolygon( manifold, 47 | (b2EdgeShape*)m_fixtureA->GetShape(), xfA, 48 | (b2PolygonShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /src/kiwano/render/Renderer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | 27 | Renderer::Renderer() 28 | : vsync_(true) 29 | , auto_reset_resolution_(true) 30 | , clear_color_(Color::Black) 31 | { 32 | } 33 | 34 | void Renderer::SetClearColor(const Color& color) 35 | { 36 | clear_color_ = color; 37 | } 38 | 39 | void Renderer::SetVSyncEnabled(bool enabled) 40 | { 41 | vsync_ = enabled; 42 | } 43 | 44 | void Renderer::ResetResolutionWhenWindowResized(bool enabled) 45 | { 46 | auto_reset_resolution_ = enabled; 47 | } 48 | 49 | void Renderer::Destroy() 50 | { 51 | FontCache::GetInstance().Clear(); 52 | } 53 | 54 | void Renderer::HandleEvent(EventModuleContext& ctx) 55 | { 56 | if (auto_reset_resolution_) 57 | { 58 | auto evt = ctx.evt->Cast(); 59 | if (evt) 60 | { 61 | auto size = evt->window->GetLogicalSize(); 62 | Resize((uint32_t)size.x, (uint32_t)size.y); 63 | } 64 | } 65 | } 66 | 67 | } // namespace kiwano 68 | -------------------------------------------------------------------------------- /src/kiwano/render/DirectX/D3DDeviceResourcesBase.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | namespace graphics 27 | { 28 | namespace directx 29 | { 30 | 31 | MIDL_INTERFACE("fb99fa64-d9cf-4e0e-9c75-90514797b01d") 32 | ID3DDeviceResourcesBase : public IUnknown 33 | { 34 | public: 35 | virtual HRESULT Initialize(HWND hwnd, Size logical_size, float dpi) = 0; 36 | 37 | virtual HRESULT Present(bool vsync) = 0; 38 | 39 | virtual void ClearRenderTarget(Color & clear_color) = 0; 40 | 41 | virtual HRESULT HandleDeviceLost() = 0; 42 | 43 | virtual HRESULT SetLogicalSize(Size logical_size) = 0; 44 | 45 | virtual HRESULT SetFullscreenState(bool fullscreen) = 0; 46 | 47 | virtual HRESULT GetFullscreenState(bool* fullscreen) = 0; 48 | 49 | virtual HRESULT ResizeTarget(UINT width, UINT height) = 0; 50 | 51 | virtual HRESULT GetDisplaySettings(DXGI_MODE_DESC * *mode_descs, int* num) = 0; 52 | 53 | virtual void DiscardResources() = 0; 54 | }; 55 | 56 | } // namespace directx 57 | } // namespace graphics 58 | } // namespace kiwano 59 | -------------------------------------------------------------------------------- /src/kiwano/core/Defer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | 24 | namespace kiwano 25 | { 26 | 27 | class Defer 28 | { 29 | public: 30 | Defer() = default; 31 | 32 | Defer(const Function& func) 33 | : func_(func) 34 | { 35 | } 36 | 37 | Defer(Defer&& other) noexcept 38 | : func_(other.func_) 39 | { 40 | other.func_ = nullptr; 41 | } 42 | 43 | ~Defer() 44 | { 45 | if (func_) 46 | func_(); 47 | } 48 | 49 | private: 50 | Defer(const Defer&) = delete; 51 | Defer& operator=(const Defer&) = delete; 52 | 53 | Function func_; 54 | }; 55 | 56 | class __DeferHelper 57 | { 58 | public: 59 | Defer operator-(const Function& func) const 60 | { 61 | return Defer{ func }; 62 | } 63 | }; 64 | 65 | #define KGE_DEFER auto __KGE_DEFER_VAR(__defer_line_, __LINE__, __) = ::kiwano::__DeferHelper() - 66 | #define __KGE_DEFER_VAR(a, b, c) __KGE_DEFER_TOKEN_CONNECT(a, b, c) 67 | #define __KGE_DEFER_TOKEN_CONNECT(a, b, c) a##b##c 68 | 69 | } // namespace kiwano 70 | -------------------------------------------------------------------------------- /src/kiwano/render/DirectX/TextDrawingEffect.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #pragma once 22 | #include 23 | #include 24 | 25 | namespace kiwano 26 | { 27 | namespace graphics 28 | { 29 | namespace directx 30 | { 31 | interface DWRITE_DECLARE_INTERFACE("7431F439-6E54-4707-A0DC-1AA035D6AFB8") ITextDrawingEffect : public IUnknown 32 | { 33 | public: 34 | static HRESULT Create(_Out_ ITextDrawingEffect * *ppTextDrawingEffect, _In_ ID2D1Factory * pFactory); 35 | 36 | STDMETHOD(CreateOutlineGeomerty) 37 | (_Out_ ID2D1Geometry * *ppOutlineGeo, _In_ DWRITE_GLYPH_RUN const* glyphRun, float fOriginX, float fOriginY) PURE; 38 | 39 | STDMETHOD(CreateStrikethroughGeomerty) 40 | (_Out_ ID2D1Geometry * *ppStrikethroughGeo, _In_ DWRITE_STRIKETHROUGH const* strikethrough, float fOriginX, 41 | float fOriginY) PURE; 42 | 43 | STDMETHOD(CreateUnderlineGeomerty) 44 | (_Out_ ID2D1Geometry * *ppUnderlineGeo, _In_ DWRITE_UNDERLINE const* underline, float fOriginX, float fOriginY) 45 | PURE; 46 | }; 47 | } // namespace directx 48 | } // namespace graphics 49 | } // namespace kiwano 50 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/modes/setup_44p51.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: toplevel settings for 44.1/48kHz 5.1 surround modes 14 | 15 | ********************************************************************/ 16 | 17 | #include "modes/residue_44p51.h" 18 | 19 | static const double rate_mapping_44p51[12]={ 20 | 14000.,20000.,28000.,38000.,46000.,54000., 21 | 75000.,96000.,120000.,140000.,180000.,240001. 22 | }; 23 | 24 | static const ve_setup_data_template ve_setup_44_51={ 25 | 11, 26 | rate_mapping_44p51, 27 | quality_mapping_44, 28 | 6, 29 | 40000, 30 | 70000, 31 | 32 | blocksize_short_44, 33 | blocksize_long_44, 34 | 35 | _psy_tone_masteratt_44, 36 | _psy_tone_0dB, 37 | _psy_tone_suppress, 38 | 39 | _vp_tonemask_adj_otherblock, 40 | _vp_tonemask_adj_longblock, 41 | _vp_tonemask_adj_otherblock, 42 | 43 | _psy_noiseguards_44, 44 | _psy_noisebias_impulse, 45 | _psy_noisebias_padding, 46 | _psy_noisebias_trans, 47 | _psy_noisebias_long, 48 | _psy_noise_suppress, 49 | 50 | _psy_compand_44, 51 | _psy_compand_short_mapping, 52 | _psy_compand_long_mapping, 53 | 54 | {_noise_start_short_44,_noise_start_long_44}, 55 | {_noise_part_short_44,_noise_part_long_44}, 56 | _noise_thresh_44, 57 | 58 | _psy_ath_floater, 59 | _psy_ath_abs, 60 | 61 | _psy_lowpass_44, 62 | 63 | _psy_global_44, 64 | _global_mapping_44, 65 | _psy_stereo_modes_44, 66 | 67 | _floor_books, 68 | _floor, 69 | 3, 70 | _floor_mapping_44, 71 | 72 | _mapres_template_44_51 73 | }; 74 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); 28 | return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); 34 | allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); 35 | } 36 | 37 | b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 42 | } 43 | 44 | void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollidePolygonAndCircle( manifold, 47 | (b2PolygonShape*)m_fixtureA->GetShape(), xfA, 48 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/modes/setup_44u.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: toplevel settings for 44.1/48kHz uncoupled modes 14 | 15 | ********************************************************************/ 16 | 17 | #include "modes/residue_44u.h" 18 | 19 | static const double rate_mapping_44_un[12]={ 20 | 32000.,48000.,60000.,70000.,80000.,86000., 21 | 96000.,110000.,120000.,140000.,160000.,240001. 22 | }; 23 | 24 | static const ve_setup_data_template ve_setup_44_uncoupled={ 25 | 11, 26 | rate_mapping_44_un, 27 | quality_mapping_44, 28 | -1, 29 | 40000, 30 | 50000, 31 | 32 | blocksize_short_44, 33 | blocksize_long_44, 34 | 35 | _psy_tone_masteratt_44, 36 | _psy_tone_0dB, 37 | _psy_tone_suppress, 38 | 39 | _vp_tonemask_adj_otherblock, 40 | _vp_tonemask_adj_longblock, 41 | _vp_tonemask_adj_otherblock, 42 | 43 | _psy_noiseguards_44, 44 | _psy_noisebias_impulse, 45 | _psy_noisebias_padding, 46 | _psy_noisebias_trans, 47 | _psy_noisebias_long, 48 | _psy_noise_suppress, 49 | 50 | _psy_compand_44, 51 | _psy_compand_short_mapping, 52 | _psy_compand_long_mapping, 53 | 54 | {_noise_start_short_44,_noise_start_long_44}, 55 | {_noise_part_short_44,_noise_part_long_44}, 56 | _noise_thresh_44, 57 | 58 | _psy_ath_floater, 59 | _psy_ath_abs, 60 | 61 | _psy_lowpass_44, 62 | 63 | _psy_global_44, 64 | _global_mapping_44, 65 | _psy_stereo_modes_44, 66 | 67 | _floor_books, 68 | _floor, 69 | 2, 70 | _floor_mapping_44, 71 | 72 | _mapres_template_44_uncoupled 73 | }; 74 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2CircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2CircleContact.h" 20 | #include "Box2D/Dynamics/b2Body.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 23 | #include "Box2D/Common/b2BlockAllocator.h" 24 | #include "Box2D/Collision/b2TimeOfImpact.h" 25 | 26 | #include 27 | 28 | b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 29 | { 30 | void* mem = allocator->Allocate(sizeof(b2CircleContact)); 31 | return new (mem) b2CircleContact(fixtureA, fixtureB); 32 | } 33 | 34 | void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 35 | { 36 | ((b2CircleContact*)contact)->~b2CircleContact(); 37 | allocator->Free(contact, sizeof(b2CircleContact)); 38 | } 39 | 40 | b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 41 | : b2Contact(fixtureA, 0, fixtureB, 0) 42 | { 43 | b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); 44 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 45 | } 46 | 47 | void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 48 | { 49 | b2CollideCircles(manifold, 50 | (b2CircleShape*)m_fixtureA->GetShape(), xfA, 51 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 52 | } 53 | -------------------------------------------------------------------------------- /src/kiwano/utils/UserData.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018-2019 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | Any UserData::Get(StringView key, const Any& default_data) const 26 | { 27 | auto iter = data_.find(key); 28 | if (iter != data_.end()) 29 | { 30 | return iter->second; 31 | } 32 | return default_data; 33 | } 34 | 35 | void UserData::Set(StringView key, const Any& data) 36 | { 37 | data_[key] = data; 38 | } 39 | 40 | void UserData::Set(const DataPair& pair) 41 | { 42 | data_[pair.first] = pair.second; 43 | } 44 | 45 | void UserData::Set(const std::initializer_list& list) 46 | { 47 | for (const auto& pair : list) 48 | { 49 | data_[pair.first] = pair.second; 50 | } 51 | } 52 | 53 | void UserData::Set(const DataMap& map) 54 | { 55 | data_ = map; 56 | } 57 | 58 | bool UserData::Contains(StringView key) const 59 | { 60 | return data_.count(key) != 0; 61 | } 62 | 63 | const UserData::DataMap& UserData::GetDataMap() const 64 | { 65 | return data_; 66 | } 67 | 68 | void UserData::Clear() 69 | { 70 | data_.clear(); 71 | } 72 | 73 | } // namespace kiwano 74 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2GrowableStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_GROWABLE_STACK_H 20 | #define B2_GROWABLE_STACK_H 21 | #include "b2Settings.h" 22 | #include 23 | 24 | /// This is a growable LIFO stack with an initial capacity of N. 25 | /// If the stack size exceeds the initial capacity, the heap is used 26 | /// to increase the size of the stack. 27 | template 28 | class b2GrowableStack 29 | { 30 | public: 31 | b2GrowableStack() 32 | { 33 | m_stack = m_array; 34 | m_count = 0; 35 | m_capacity = N; 36 | } 37 | 38 | ~b2GrowableStack() 39 | { 40 | if (m_stack != m_array) 41 | { 42 | b2Free(m_stack); 43 | m_stack = nullptr; 44 | } 45 | } 46 | 47 | void Push(const T& element) 48 | { 49 | if (m_count == m_capacity) 50 | { 51 | T* old = m_stack; 52 | m_capacity *= 2; 53 | m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); 54 | memcpy(m_stack, old, m_count * sizeof(T)); 55 | if (old != m_array) 56 | { 57 | b2Free(old); 58 | } 59 | } 60 | 61 | m_stack[m_count] = element; 62 | ++m_count; 63 | } 64 | 65 | T Pop() 66 | { 67 | b2Assert(m_count > 0); 68 | --m_count; 69 | return m_stack[m_count]; 70 | } 71 | 72 | int32 GetCount() 73 | { 74 | return m_count; 75 | } 76 | 77 | private: 78 | T* m_stack; 79 | T m_array[N]; 80 | int32 m_count; 81 | int32 m_capacity; 82 | }; 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Dynamics/Contacts/b2PolygonContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2PolygonContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Collision/b2TimeOfImpact.h" 22 | #include "Box2D/Dynamics/b2Body.h" 23 | #include "Box2D/Dynamics/b2Fixture.h" 24 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 25 | 26 | #include 27 | 28 | b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 29 | { 30 | void* mem = allocator->Allocate(sizeof(b2PolygonContact)); 31 | return new (mem) b2PolygonContact(fixtureA, fixtureB); 32 | } 33 | 34 | void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 35 | { 36 | ((b2PolygonContact*)contact)->~b2PolygonContact(); 37 | allocator->Free(contact, sizeof(b2PolygonContact)); 38 | } 39 | 40 | b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 41 | : b2Contact(fixtureA, 0, fixtureB, 0) 42 | { 43 | b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); 44 | b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); 45 | } 46 | 47 | void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 48 | { 49 | b2CollidePolygons( manifold, 50 | (b2PolygonShape*)m_fixtureA->GetShape(), xfA, 51 | (b2PolygonShape*)m_fixtureB->GetShape(), xfB); 52 | } 53 | -------------------------------------------------------------------------------- /scripts/appveyor/coapp_make.ps1: -------------------------------------------------------------------------------- 1 | . .\scripts\appveyor\appveyor_get_build.ps1 2 | . .\scripts\appveyor\appveyor_get_artifacts.ps1 3 | . .\scripts\appveyor\copy_recurse.ps1 4 | 5 | # get job artifacts 6 | Write-Host "Start to download artifacts from other jobs" 7 | 8 | (Get-AppVeyorBuild).build.jobs | foreach-object { 9 | $jobId = $_.jobId 10 | if ($jobId -ne $env:APPVEYOR_JOB_ID) { 11 | # Get job artifacts information 12 | (Get-AppVeyorArtifacts -Job $jobId) | foreach-object { 13 | # Create directory if not exists 14 | $filePath = $_.fileName.Substring(0, $_.fileName.LastIndexOf('/')) 15 | if (!(Test-Path -Path $filePath)) { 16 | New-Item -ItemType "directory" -Path $filePath 17 | } 18 | # Download artifact from other job 19 | Start-FileDownload "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$($_.fileName)" -FileName $_.fileName 20 | } 21 | }; 22 | } 23 | 24 | Write-Host "Start to build nupkg files" 25 | 26 | # This is the CoApp .autopkg file to create. 27 | $autopkgFile = "scripts\coapp\kiwano.autopkg" 28 | 29 | # Copy include files 30 | Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.h" 31 | Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.hpp" 32 | Remove-Item -Path "include\3rd-party" -Recurse 33 | Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.h" 34 | Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.hpp" 35 | 36 | # Create a copy of ".autopkg" file 37 | Copy-Item -Path $autopkgFile -Destination ($autopkgFile + '.template') 38 | 39 | # Get the ".autopkg.template" file, replace "@appveyor_version" with the Appveyor version number, then save to the ".autopkg" file. 40 | Get-Content ($autopkgFile + ".template") -Encoding UTF8 | ForEach-Object { $_ -replace "@appveyor_version", $env:appveyor_build_version } | Out-File $autopkgFile -Encoding UTF8 41 | 42 | # Delete the copy file 43 | Remove-Item -Path ($autopkgFile + '.template') 44 | 45 | # Use the CoApp tools to create NuGet native packages from the .autopkg. 46 | Write-NuGetPackage $autopkgFile 47 | 48 | # Push all newly created .nupkg files as Appveyor artifacts for later deployment. 49 | Get-ChildItem .\*.nupkg | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name } 50 | -------------------------------------------------------------------------------- /src/3rd-party/Box2D/Common/b2StackAllocator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2StackAllocator.h" 20 | #include "Box2D/Common/b2Math.h" 21 | 22 | b2StackAllocator::b2StackAllocator() 23 | { 24 | m_index = 0; 25 | m_allocation = 0; 26 | m_maxAllocation = 0; 27 | m_entryCount = 0; 28 | } 29 | 30 | b2StackAllocator::~b2StackAllocator() 31 | { 32 | b2Assert(m_index == 0); 33 | b2Assert(m_entryCount == 0); 34 | } 35 | 36 | void* b2StackAllocator::Allocate(int32 size) 37 | { 38 | b2Assert(m_entryCount < b2_maxStackEntries); 39 | 40 | b2StackEntry* entry = m_entries + m_entryCount; 41 | entry->size = size; 42 | if (m_index + size > b2_stackSize) 43 | { 44 | entry->data = (char*)b2Alloc(size); 45 | entry->usedMalloc = true; 46 | } 47 | else 48 | { 49 | entry->data = m_data + m_index; 50 | entry->usedMalloc = false; 51 | m_index += size; 52 | } 53 | 54 | m_allocation += size; 55 | m_maxAllocation = b2Max(m_maxAllocation, m_allocation); 56 | ++m_entryCount; 57 | 58 | return entry->data; 59 | } 60 | 61 | void b2StackAllocator::Free(void* p) 62 | { 63 | b2Assert(m_entryCount > 0); 64 | b2StackEntry* entry = m_entries + m_entryCount - 1; 65 | b2Assert(p == entry->data); 66 | if (entry->usedMalloc) 67 | { 68 | b2Free(p); 69 | } 70 | else 71 | { 72 | m_index -= entry->size; 73 | } 74 | m_allocation -= entry->size; 75 | --m_entryCount; 76 | 77 | p = nullptr; 78 | } 79 | 80 | int32 b2StackAllocator::GetMaxAllocation() const 81 | { 82 | return m_maxAllocation; 83 | } 84 | -------------------------------------------------------------------------------- /src/3rd-party/vorbis/lib/envelope.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: PCM data envelope analysis and manipulation 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_ENVELOPE_ 18 | #define _V_ENVELOPE_ 19 | 20 | #include "mdct.h" 21 | 22 | #define VE_PRE 16 23 | #define VE_WIN 4 24 | #define VE_POST 2 25 | #define VE_AMP (VE_PRE+VE_POST-1) 26 | 27 | #define VE_BANDS 7 28 | #define VE_NEARDC 15 29 | 30 | #define VE_MINSTRETCH 2 /* a bit less than short block */ 31 | #define VE_MAXSTRETCH 12 /* one-third full block */ 32 | 33 | typedef struct { 34 | float ampbuf[VE_AMP]; 35 | int ampptr; 36 | 37 | float nearDC[VE_NEARDC]; 38 | float nearDC_acc; 39 | float nearDC_partialacc; 40 | int nearptr; 41 | 42 | } envelope_filter_state; 43 | 44 | typedef struct { 45 | int begin; 46 | int end; 47 | float *window; 48 | float total; 49 | } envelope_band; 50 | 51 | typedef struct { 52 | int ch; 53 | int winlength; 54 | int searchstep; 55 | float minenergy; 56 | 57 | mdct_lookup mdct; 58 | float *mdct_win; 59 | 60 | envelope_band band[VE_BANDS]; 61 | envelope_filter_state *filter; 62 | int stretch; 63 | 64 | int *mark; 65 | 66 | long storage; 67 | long current; 68 | long curmark; 69 | long cursor; 70 | } envelope_lookup; 71 | 72 | extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi); 73 | extern void _ve_envelope_clear(envelope_lookup *e); 74 | extern long _ve_envelope_search(vorbis_dsp_state *v); 75 | extern void _ve_envelope_shift(envelope_lookup *e,long shift); 76 | extern int _ve_envelope_mark(vorbis_dsp_state *v); 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/kiwano/base/component/Button.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2018 Kiwano - Nomango 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include 22 | 23 | namespace kiwano 24 | { 25 | 26 | ButtonBase::ButtonBase() 27 | { 28 | SetName("__KGE_BUTTON__"); 29 | } 30 | 31 | ButtonBase::~ButtonBase() {} 32 | 33 | void ButtonBase::HandleEvent(kiwano::Event* evt) 34 | { 35 | MouseSensor::HandleEvent(evt); 36 | 37 | if (evt->IsType()) 38 | { 39 | OnEvent(Event::MouseEntered); 40 | } 41 | else if (evt->IsType()) 42 | { 43 | OnEvent(Event::MouseExited); 44 | } 45 | else if (evt->IsType() && this->IsHovering()) 46 | { 47 | OnEvent(Event::Pressed); 48 | } 49 | else if (evt->IsType() && this->IsPressing()) 50 | { 51 | OnEvent(Event::Released); 52 | } 53 | else if (evt->IsType()) 54 | { 55 | OnEvent(Event::Clicked); 56 | } 57 | } 58 | 59 | Button::Button() {} 60 | 61 | Button::Button(const Callback& cb) 62 | { 63 | SetCallback(cb); 64 | } 65 | 66 | void Button::OnEvent(Event evt) 67 | { 68 | if (cb_) 69 | { 70 | cb_(this, evt); 71 | } 72 | 73 | if (evt == Event::Clicked && clicked_cb_) 74 | { 75 | clicked_cb_(this); 76 | } 77 | } 78 | 79 | } // namespace kiwano 80 | --------------------------------------------------------------------------------