From 997e3eff08fc4c9918a1887d850eb9b7f7d64f0b Mon Sep 17 00:00:00 2001
From: Axanery <41282531+Axanery@users.noreply.github.com>
Date: Sat, 16 Nov 2024 16:25:41 -0600
Subject: [PATCH] Fix merge conflicts
---
guides/Documentation.htm | 967 ++++++++++++++++++++-------------
include/Engine/Application.h | 75 ++-
include/Engine/InputManager.h | 6 +
include/Engine/Math/Math.h | 1 +
include/Engine/Scene.h | 2 +-
include/Engine/Types/Entity.h | 4 +
source/Engine/Application.cpp | 33 +-
source/Engine/InputManager.cpp | 23 +-
source/Engine/Math/Math.cpp | 2 +-
9 files changed, 687 insertions(+), 426 deletions(-)
diff --git a/guides/Documentation.htm b/guides/Documentation.htm
index 3fd2639..4f121b8 100644
--- a/guides/Documentation.htm
+++ b/guides/Documentation.htm
@@ -50,6 +50,7 @@
Namespaces
Application
Array
Audio
+ Collision
Controller
Date
Device
@@ -121,7 +122,7 @@ Enums
FogEquation_*
GeoBooleanOp_*
GeoFillRule_*
- HitboxSide_*
+ HITBOX_*
InputBind_*
InputDevice_*
KeyBind_*
@@ -133,9 +134,9 @@ Enums
StencilOp_*
StencilTest_*
TILECOLLISION_*
- TimeOfDay_*
+ TIMEOFDAY_*
TintMode_*
- Weekday_*
+ WEEKDAY_*
Constants
@@ -233,10 +241,12 @@
Application
Application.GetGameTitleShort
Application.GetGameVersion
Application.GetGameDescription
+ Application.GetReservedSlotIDs
Application.SetGameTitle
Application.SetGameTitleShort
Application.SetGameVersion
Application.SetGameDescription
+ Application.SetReservedSlotIDs
Application.SetCursorVisible
Application.GetCursorVisible
@@ -270,6 +280,19 @@ Audio
Audio.SetSoundVolume
+
+
Collision
+ Class methods:
+
+
Controller
Class methods:
@@ -375,6 +398,7 @@ Draw
Draw.Text
Draw.TextWrapped
Draw.TextEllipsis
+ Draw.TextArray
Draw.SetBlendColor
Draw.SetTextureBlend
Draw.SetBlendMode
@@ -415,6 +439,10 @@ Draw
Draw.UseStrokeSmoothing
Draw.SetClip
Draw.ClearClip
+ Draw.GetClipX
+ Draw.GetClipY
+ Draw.GetClipWidth
+ Draw.GetClipHeight
Draw.Save
Draw.Scale
Draw.Rotate
@@ -637,6 +665,7 @@ Instance
instance.ScaleY
instance.Rotation
instance.Alpha
+ instance.BlendMode
instance.Priority
instance.Depth
instance.Sprite
@@ -649,6 +678,8 @@ Instance
instance.AnimationLoopIndex
instance.AnimationSpeedMult
instance.AnimationSpeedAdd
+ instance.PrevAnimation
+ instance.RotationStyle
instance.AutoAnimate
instance.OnScreen
instance.WasOffScreen
@@ -656,6 +687,7 @@ Instance
instance.OnScreenHitboxH
instance.ViewRenderFlag
instance.ViewOverrideFlag
+ instance.Visible
instance.UpdateRegionW
instance.UpdateRegionH
instance.UpdateRegionTop
@@ -726,6 +758,10 @@ Math
Math.Max
Math.Clamp
Math.Sign
+ Math.Uint8
+ Math.Uint16
+ Math.Uint32
+ Math.Uint64
Math.Random
Math.RandomMax
Math.RandomRange
@@ -735,6 +771,8 @@ Math
Math.Sqrt
Math.Pow
Math.Exp
+ RSDK.Math.ToFixed
+ RSDK.Math.FromFixed
@@ -774,14 +812,11 @@
Music
Class methods:
@@ -881,6 +917,7 @@ Resources
Class methods:
- Resources.LoadSprite
+ - Resources.LoadDynamicSprite
- Resources.LoadImage
- Resources.LoadFont
- Resources.LoadModel
@@ -895,16 +932,7 @@ Resources
Scene
Class methods:
@@ -1219,8 +1239,8 @@ String
- String.IndexOf
- String.Contains
- String.Substring
- - String.ToUpperCase
- - String.ToLowerCase
+ - String.ToUppercase
+ - String.ToLowercase
- String.LastIndexOf
- String.ParseInteger
- String.ParseDecimal
@@ -1323,6 +1343,9 @@ View
- View.SetY
- View.SetZ
- View.SetPosition
+ - View.AdjustX
+ - View.AdjustY
+ - View.AdjustX
- View.SetAngle
- View.SetSize
- View.SetOutputX
@@ -1442,6 +1465,7 @@ Instance
- instance.ScaleY
- instance.Rotation
- instance.Alpha
+ - instance.BlendMode
- instance.Priority
- instance.Depth
- instance.Sprite
@@ -1454,6 +1478,8 @@ Instance
- instance.AnimationLoopIndex
- instance.AnimationSpeedMult
- instance.AnimationSpeedAdd
+ - instance.PrevAnimation
+ - instance.RotationStyle
- instance.AutoAnimate
- instance.OnScreen
- instance.WasOffScreen
@@ -1461,6 +1487,7 @@ Instance
- instance.OnScreenHitboxH
- instance.ViewRenderFlag
- instance.ViewOverrideFlag
+ - instance.Visible
- instance.UpdateRegionW
- instance.UpdateRegionH
- instance.UpdateRegionTop
@@ -1518,6 +1545,7 @@ ACTIVE_*
- ACTIVE_XBOUNDS
- ACTIVE_YBOUNDS
- ACTIVE_RBOUNDS
+ - ACTIVE_DISABLED
@@ -1713,13 +1741,13 @@
GeoFillRule_*
GeoFillRule_Negative
-
-
HitboxSide_*
+
+
HITBOX_*
@@ -1935,13 +1963,13 @@
TILECOLLISION_*
TILECOLLISION_UP
-
-
TimeOfDay_*
+
+
TIMEOFDAY_*
@@ -1953,16 +1981,16 @@
TintMode_*
TintMode_DST_BLEND
-
-
Weekday_*
+
+
WEEKDAY_*
Constants
@@ -1971,8 +1999,15 @@ Globals
Class methods
Animator.Create
- Animator.Create()
+ Animator.Create(sprite, animationID, frameID, unloadPolicy)
Creates a new animator.
+ Parameters:
+
+ - sprite (Integer): The index of the sprite.
+ - animationID (Integer): The animator's changed animation ID.
+ - frameID (Integer): The animator's changed frame ID.
+ - unloadPolicy (Integer): When to unload the animator.
+
Returns:
Returns the index of the Animator.
@@ -2052,9 +2087,9 @@ Animator.GetHitbox
Returns:
Returns a reference value to a hitbox array.
-
-
Animator.GetPreviousAnimation
- Animator.GetPreviousAnimation(animator)
+
+
Animator.GetPrevAnimation
+ Animator.GetPrevAnimation(animator)
Gets the previous animation value of an animator.
Parameters:
@@ -2118,6 +2153,17 @@ Animator.GetLoopIndex
Returns:
Returns an Integer value.
+
+
Animator.GetRotationStyle
+ Animator.GetRotationStyle(animator)
+ Gets the loop index of an animator's rotation style.
+ Parameters:
+
+ - animator (Integer): The index of the animator.
+
+ Returns:
+ Returns an Integer value.
+
Animator.SetSprite
Animator.SetSprite(animator, animationID)
@@ -2148,6 +2194,16 @@ Animator.SetCurrentFrame
- frameID (Integer): The animator's changed frame ID.
+
+
Animator.SetPrevAnimation
+ Animator.SetPrevAnimation(animator, prevAnimation)
+ Sets the previous frame of an animator.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - prevAnimation (Integer): The animator's changed previous animation.
+
+
Animator.SetAnimationSpeed
Animator.SetAnimationSpeed(animator, animationSpeed)
@@ -2178,6 +2234,36 @@ Animator.SetDuration
duration (Integer): The animator's changed duration.
+
+
Animator.SetFrameCount
+ Animator.SetFrameCount(animator, frameCount)
+ Sets the frame count of an animator.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - frameCount (Integer): The animator's changed frame count.
+
+
+
+
Animator.SetLoopIndex
+ Animator.SetLoopIndex(animator, loopIndex)
+ Sets the loop index of an animator.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - loopIndex (Integer): The animator's changed loop index.
+
+
+
+
Animator.SetRotationStyle
+ Animator.SetRotationStyle(animator, rorationStyle)
+ Sets the rotation style of an animator.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - rorationStyle (Integer): The animator's changed rotation style.
+
+
Animator.AdjustCurrentAnimation
Animator.AdjustCurrentAnimation(animator, amount)
@@ -2228,6 +2314,26 @@ Animator.AdjustDuration
amount (Integer): The amount to adjust the animator's duration.
+
+
Animator.AdjustFrameCount
+ Animator.AdjustFrameCount(animator, amount)
+ Adjusts the frame count of an animator by an amount.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - amount (Integer): The amount to adjust the animator's duration.
+
+
+
+
Animator.AdjustLoopIndex
+ Animator.AdjustLoopIndex(animator, amount)
+ Adjusts the loop index of an animator by an amount.
+ Parameters:
+
+ - animator (Integer): The animator index to change.
+ - amount (Integer): The amount to adjust the animator's loop index.
+
+
Application.GetCommandLineArguments
Application.GetCommandLineArguments()
@@ -2346,6 +2452,15 @@ Application.GetGameDescription
Application.GetGameDescription()
Gets the description of the game.
+
+
Application.GetReservedSlotIDs
+ Application.GetReservedSlotIDs(amount)
+ Sets the number of reserved slot IDs the engine will use when creating instances.
+ Parameters:
+
+ - amount (Integer): How many reserved slot IDs the engine will use.
+
+
Application.SetGameTitle
Application.SetGameTitle(title)
@@ -2382,6 +2497,15 @@ Application.SetGameDescription
title (String): Game description.
+
+
Application.SetReservedSlotIDs
+ Application.SetReservedSlotIDs(amount)
+ Sets the number of reserved slot IDs the engine will use when creating instances.
+ Parameters:
+
+ - amount (Integer): How many reserved slot IDs the engine will use.
+
+
Application.SetCursorVisible
Application.SetCursorVisible(cursorVisible)
@@ -2563,6 +2687,109 @@ Audio.SetSoundVolume
volume (Integer): The sound effect volume, from 0 to 100.
+
+
Collision.ProcessObjectMovement
+ Collision.ProcessObjectMovement(entity, outer, inner)
+ Processes movement of an instance with an outer hitbox and an inner hitbox.
+ Parameters:
+
+ - entity (Instance): The instance to move.
+ - outer (Array): Array containing the outer hitbox.
+ - inner (Array): Array containing the inner hitbox.
+
+
+
+
Collision.ObjectTileCollision
+ Collision.ObjectTileCollision(entity, cLayers, cMode, cPlane, xOffset, yOffset, setPos)
+ Checks tile collision based on where an instance should check.
+ Parameters:
+
+ - entity (Instance): The instance to base the values on.
+ - cLayers (Bitfield): Which layers the entity can collide with.
+ - cMode (Integer): Collision mode of the entity (floor, left wall, roof, right wall).
+ - cPlane (Integer): Collision plane to get the collision of (A or B).
+ - xOffset (Number): How far from the entity's X value to start from.
+ - yOffset (Number): How far from the entity's Y value to start from.
+ - setPos (Boolean): Whether to set the entity's position if collision is found.
+
+ Returns:
+ Returns whether the instance has collided with a tile.
+
+
+
Collision.ObjectTileGrip
+ Collision.ObjectTileGrip(entity, cLayers, cMode, cPlane, xOffset, yOffset, tolerance)
+ Keeps an instance gripped to tile collision based on where an instance should check.
+ Parameters:
+
+ - entity (Instance): The instance to move.
+ - cLayers (Bitfield): Which layers the entity can collide with.
+ - cMode (Integer): Collision mode of the entity (floor, left wall, roof, right wall).
+ - cPlane (Integer): Collision plane to get the collision of (A or B).
+ - xOffset (Decimal): How far from the entity's X value to start from.
+ - yOffset (Decimal): How far from the entity's Y value to start from.
+ - tolerance (Decimal): How far of a tolerance the entity should check for.
+
+ Returns:
+ Returns whether to grip the instance.
+
+
+
Collision.CheckObjectCollisionTouch
+ Collision.CheckObjectCollisionTouch(thisEntity, thisHitbox, otherEntity, otherHitbox)
+ Checks if an instance is touching another instance with their respective hitboxes.
+ Parameters:
+
+ - thisEntity (Instance): The first instance to check.
+ - thisHitbox (Array): Array containing the first entity's hitbox.
+ - otherEntity (Instance): The other instance to check.
+ - otherHitbox (Array): Array containing the other entity's hitbox.
+
+ Returns:
+ Returns a Boolean value whether the entities are touching.
+
+
+
Collision.CheckObjectCollisionCircle
+ Collision.CheckObjectCollisionCircle(thisEnity, thisRadius, otherEntity, otherRadius)
+ Checks if an instance is touching another instance with within their respective radii.
+ Parameters:
+
+ - thisEnity (Instance): The first instance to check.
+ - thisRadius (Decimal): Radius of the first entity to check.
+ - otherEntity (Instance): The other instance to check.
+ - otherRadius (Array): Radius of the other entity to check.
+
+ Returns:
+ Returns a Boolean value whether the entities have collided.
+
+
+
Collision.CheckObjectCollisionBox
+ Collision.CheckObjectCollisionBox(thisEnity, thisHitbox, otherEntity, otherHitbox, setValues)
+ Checks if an instance is touching another instance with their respective hitboxes and sets the values of the other instance if specified.
+ Parameters:
+
+ - thisEnity (Instance): The first instance to check.
+ - thisHitbox (Array): Array containing the first entity's hitbox.
+ - otherEntity (Instance): The other instance to check.
+ - otherHitbox (Array): Array containing the other entity's hitbox.
+ - setValues (Boolean): Whether to set the values of the other entity.
+
+ Returns:
+ Returns the side the entities are colliding on.
+
+
+
Collision.CheckObjectCollisionPlatform
+ Collision.CheckObjectCollisionPlatform(thisEnity, thisHitbox, otherEntity, otherHitbox, setValues)
+ Checks if an instance is touching the top of another instance with their respective hitboxes and sets the values of the other instance if specified.
+ Parameters:
+
+ - thisEnity (Instance): The first instance to check.
+ - thisHitbox (Array): Array containing the first entity's hitbox.
+ - otherEntity (Instance): The other instance to check whether it is on top of the first instance.
+ - otherHitbox (Array): Array containing the other entity's hitbox.
+ - setValues (Boolean): Whether to set the values of the other entity.
+
+ Returns:
+ Returns a Boolean value whether the entities have collided.
+
Controller.GetCount
Controller.GetCount()
@@ -2971,12 +3198,13 @@ Draw.Sprite
Draw.SpriteBasic
- Draw.SpriteBasic(instance[, sprite])
+ Draw.SpriteBasic(instance[, x, y])
Draws a sprite based on an entity's current values (Sprite, CurrentAnimation, CurrentFrame, X, Y, Direction, ScaleX, ScaleY, Rotation).
Parameters:
- instance (Instance): The instance to draw.
- - sprite (Integer): The sprite index to use if not using the entity's sprite index.
+ - x (Number): X position of where to draw the sprite, otherwise uses the entity's X value.
+ - y (Number): Y position of where to draw the sprite, otherwise uses the entity's Y value.
@@ -2997,12 +3225,14 @@
Draw.Animator
Draw.AnimatorBasic
- Draw.AnimatorBasic(animator, instance[, sprite])
+ Draw.AnimatorBasic(animator, instance[, x, y, sprite])
Draws an animator based on its current values (Sprite, CurrentAnimation, CurrentFrame) and an entity's other values (X, Y, Direction, ScaleX, ScaleY, Rotation).
Parameters:
- animator (Animator): The animator to draw.
- instance (Instance): The instance to pull other values from.
+ - x (Number): X position of where to draw the sprite, otherwise uses the entity's X value.
+ - y (Number): Y position of where to draw the sprite, otherwise uses the entity's Y value.
- sprite (Integer): The sprite index to use if not using the entity's sprite index.
@@ -3317,6 +3547,25 @@ Draw.TextWrapped
Draw.TextEllipsis
Draw.TextEllipsis()
+
+
Draw.TextArray
+ Draw.TextArray(sprite, animation, x, y, string, startFrame, endFrame, align, spacing[, charOffsetsX, charOffsetsY])
+ Draws a series of sprites based on a converted sprite string.
+ Parameters:
+
+ - sprite (Integer): The index of the loaded sprite to be used as text.
+ - animation (Integer): The animation index.
+ - x (Number): The X value to begin drawing.
+ - y (Number): The Y value to begin drawing.
+ - string (Array): The array containing frame indexes.
+ - startFrame (Integer): The index to begin drawing.
+ - endFrame (Integer): The index to end drawing.
+ - align (Integer): The text alignment.
+ - spacing (Integer): The space between drawn sprites.
+ - charOffsetsX (Array): The X offsets at which to draw per frame. Must also have charOffsetsY to be used.
+ - charOffsetsY (Array): The Y offsets at which to draw per frame.
+
+
Draw.SetBlendColor
Draw.SetBlendColor(hex, alpha)
@@ -3769,6 +4018,34 @@ Draw.ClearClip
Draw.ClearClip()
Resets the drawing region.
+
+
Draw.GetClipX
+ Draw.GetClipX()
+ Gets the X position in which drawing starts to occur.
+ Returns:
+ The X position if clipping is enabled, else 0.
+
+
+
Draw.GetClipY
+ Draw.GetClipY()
+ Gets the Y position in which drawing starts to occur.
+ Returns:
+ The Y position if clipping is enabled, else 0.
+
+
+
Draw.GetClipWidth
+ Draw.GetClipWidth()
+ Gets the width in which drawing occurs.
+ Returns:
+ The width if clipping is enabled, else 0.
+
+
+
Draw.GetClipHeight
+ Draw.GetClipHeight()
+ Gets the height in which drawing occurs.
+ Returns:
+ The height if clipping is enabled, else 0.
+
Draw.Save
Draw.Save()
@@ -5177,7 +5454,7 @@ Instance.IsClass
Determines whether or not the instance is of a specified object class.
Parameters:
- - instance (Instance): The instance to check.
+ - instance (Instance): The instance to check. If there is no instance, this automatically returns false.
- className (String): Name of the object class.
Returns:
@@ -5437,6 +5714,50 @@ Math.Sign
Returns:
Returns -1
if n
is negative, 1
if positive, and 0
if otherwise.
+
+
Math.Uint8
+ Math.Uint8(n)
+ Converts an integer to an 8-bit unsigned value.
+ Parameters:
+
+ - n (Integer): Integer value to convert.
+
+ Returns:
+ Returns the converted value.
+
+
+
Math.Uint16
+ Math.Uint16(n)
+ Converts an integer to a 16-bit unsigned value.
+ Parameters:
+
+ - n (Integer): Integer value to convert.
+
+ Returns:
+ Returns the converted value.
+
+
+
Math.Uint32
+ Math.Uint32(n)
+ Converts an integer to a 32-bit unsigned value.
+ Parameters:
+
+ - n (Integer): Integer value to convert.
+
+ Returns:
+ Returns the converted value.
+
+
+
Math.Uint64
+ Math.Uint64(n)
+ Converts an integer to a 64-bit unsigned value.
+ Parameters:
+
+ - n (Integer): Integer value to convert.
+
+ Returns:
+ Returns the converted value.
+
Math.Random
Math.Random()
@@ -5534,6 +5855,28 @@ Math.Exp
Returns:
Returns the result number.
+
+
RSDK.Math.ToFixed
+ RSDK.Math.ToFixed(n)
+ Converts a decimal number to its fixed-point equivalent.
+ Parameters:
+
+ - n (Number): Number value.
+
+ Returns:
+ Returns the converted fixed-point Number value.
+
+
+
RSDK.Math.FromFixed
+ RSDK.Math.FromFixed(n)
+ Converts a fixed-point number to its decimal equivalent.
+ Parameters:
+
+ - n (Number): Number value.
+
+ Returns:
+ Returns the converted decimal Number value.
+
Matrix.Create
Matrix.Create()
@@ -5758,29 +6101,17 @@ Model.DeleteArmature
Music.Play
- Music.Play(music[, panning, speed, volume, fadeInAfterFinished])
+ Music.Play(music[, loopPoint, panning, speed, volume, startPoint, fadeInAfterFinished])
Places the music onto the music stack and plays it.
Parameters:
- music (Integer): The music index to play.
- - panning (Decimal): Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. (0.0 is the default.)
- - speed (Decimal): Control the speed of the audio. > 1.0 makes it faster, < 1.0 is slower, 1.0 is normal speed. (1.0 is the default.)
- - volume (Decimal): Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. (1.0 is the default.)
- - fadeInAfterFinished (Decimal): The time period to fade in the previous music track after the currently playing track finishes playing, in seconds. (0.0 disables this.)
-
-
-
-
Music.PlayAtTime
- Music.PlayAtTime(music, startPoint[, panning, speed, volume, fadeInAfterFinished])
- Places the music onto the music stack and plays it at a time (in seconds).
- Parameters:
-
- - music (Integer): The music index to play.
- - startPoint (Decimal): The time (in seconds) to start the music at.
- - panning (Decimal): Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. (0.0 is the default.)
- - speed (Decimal): Control the speed of the audio. > 1.0 makes it faster, < 1.0 is slower, 1.0 is normal speed. (1.0 is the default.)
- - volume (Decimal): Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. (1.0 is the default.)
- - fadeInAfterFinished (Decimal): The time period to fade in the previous music track after the currently playing track finishes playing, in seconds. (0.0 disables this.)
+ - loopPoint (Integer): The sample index to loop back to, or
-1
if the music should only play once. (-1 is the default).
+ - panning (Decimal): Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. (0.0 is the default).
+ - speed (Decimal): Control the speed of the audio. > 1.0 makes it faster, < 1.0 is slower, 1.0 is normal speed. (1.0 is the default).
+ - volume (Decimal): Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. (1.0 is the default).
+ - startPoint (Decimal): The time (in seconds) to start the music at. (0.0 is the default).
+ - fadeInAfterFinished (Decimal): The time period to fade in the previous music track after the currently playing track finishes playing, in seconds. (0.0 is the default, which disables it).
@@ -5789,7 +6120,7 @@
Music.Stop
Removes the music from the music stack, stopping it if currently playing.
Parameters:
- - music (Integer): The music index to play.
+ - music (Integer): The music index to stop.
@@ -5816,37 +6147,6 @@
Music.Clear
Music.Clear()
Completely clears the music stack, stopping all music.
-
-
Music.Loop
- Music.Loop(music, loop, loopPoint[, panning, speed, volume, fadeInAfterFinished])
- Places the music onto the music stack and plays it, looping back to the specified sample index if it reaches the end of playback.
- Parameters:
-
- - music (Integer): The music index to play.
- - loop (Boolean): Unused.
- - loopPoint (Integer): The sample index to loop back to.
- - panning (Decimal): Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. (0.0 is the default.)
- - speed (Decimal): Control the speed of the audio. > 1.0 makes it faster, < 1.0 is slower, 1.0 is normal speed. (1.0 is the default.)
- - volume (Decimal): Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. (1.0 is the default.)
- - fadeInAfterFinished (Decimal): The time period to fade in the previous music track after the currently playing track is interrupted, in seconds. (0.0 disables this.)
-
-
-
-
Music.LoopAtTime
- Music.LoopAtTime(music, startPoint, loop, loopPoint[, panning, speed, volume, fadeInAfterFinished])
- Places the music onto the music stack and plays it, looping back to the specified sample index if it reaches the end of playback.
- Parameters:
-
- - music (Integer): The music index to play.
- - startPoint (Decimal): The time (in seconds) to start the music at.
- - loop (Boolean): Unused.
- - loopPoint (Integer): The sample index to loop back to.
- - panning (Decimal): Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. (0.0 is the default.)
- - speed (Decimal): Control the speed of the audio. > 1.0 makes it faster, < 1.0 is slower, 1.0 is normal speed. (1.0 is the default.)
- - volume (Decimal): Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. (1.0 is the default.)
- - fadeInAfterFinished (Decimal): The time period to fade in the previous music track after the currently playing track is interrupted, in seconds. (0.0 disables this.)
-
-
Music.IsPlaying
Music.IsPlaying(music)
@@ -6285,6 +6585,18 @@ RSDK.Math.ACos256
Returns:
The arc cosine 256 of the angle.
+
+
RSDK.Math.ATan2
+ RSDK.Math.ATan2(x, y)
+ Returns the arc tangent of a position.
+ Parameters:
+
+ - x (Decimal): X value of the position.
+ - y (Decimal): Y value of the position.
+
+ Returns:
+ The arc tangent of the position.
+
RSDK.Math.RadianToInteger
RSDK.Math.RadianToInteger(radian)
@@ -6299,7 +6611,7 @@ RSDK.Math.RadianToInteger
RSDK.Math.IntegerToRadian
RSDK.Math.IntegerToRadian(integer)
- Gets the radia Decimal conversion of an integer, based on 256.
+ Gets the radian Decimal conversion of an integer, based on 256.
Parameters:
- integer (Integer): Integer value to convert.
@@ -6452,6 +6764,19 @@ Resources.LoadSprite
Returns:
Returns the index of the Resource.
+
+
Resources.LoadDynamicSprite
+ Resources.LoadDynamicSprite(fallbackFolder, name, unloadPolicy)
+ Loads a Sprite resource via the current Scene's resource folder if a scene list is loaded (else a fallback folder).
+ Parameters:
+
+ - fallbackFolder (String): Folder to check if the sprite does not exist in the current Scene's resource folder.
+ - name (String): Name of the animation file within the resource folder.
+ - unloadPolicy (Integer): Whether to unload the resource at the end of the current Scene, or the game end.
+
+ Returns:
+ Returns the index of the Resource.
+
Resources.LoadImage
Resources.LoadImage(filename, unloadPolicy)
@@ -6543,109 +6868,6 @@ Resources.ReadAllText
Returns:
Returns all the text in the resource as a String value if it can be read, otherwise it returns a null
value if it cannot be read.
-
-
Scene.ProcessObjectMovement
- Scene.ProcessObjectMovement(entity, outer, inner)
- Processes movement of an instance with an outer hitbox and an inner hitboxe.
- Parameters:
-
- - entity (Instance): The instance to move.
- - outer (Array): Array containing the outer hitbox.
- - inner (Array): Array containing the inner hitbox.
-
-
-
-
Scene.ObjectTileCollision
- Scene.ObjectTileCollision(entity, cLayers, cMode, cPlane, xOffset, yOffset, setPos)
- Checks tile collision based on where an instance should check.
- Parameters:
-
- - entity (Instance): The instance to base the values on.
- - cLayers (Bitfield): Which layers the entity can collide with.
- - cMode (Integer): Collision mode of the entity (floor, left wall, roof, right wall).
- - cPlane (Integer): Collision plane to get the collision of (A or B).
- - xOffset (Number): How far from the entity's X value to start from.
- - yOffset (Number): How far from the entity's Y value to start from.
- - setPos (Boolean): Whether to set the entity's position if collision is found.
-
- Returns:
- Returns whether the instance has collided with a tile.
-
-
-
Scene.ObjectTileGrip
- Scene.ObjectTileGrip(entity, cLayers, cMode, cPlane, xOffset, yOffset, tolerance)
- Keeps an instance gripped to tile collision based on where an instance should check.
- Parameters:
-
- - entity (Instance): The instance to move.
- - cLayers (Bitfield): Which layers the entity can collide with.
- - cMode (Integer): Collision mode of the entity (floor, left wall, roof, right wall).
- - cPlane (Integer): Collision plane to get the collision of (A or B).
- - xOffset (Decimal): How far from the entity's X value to start from.
- - yOffset (Decimal): How far from the entity's Y value to start from.
- - tolerance (Decimal): How far of a tolerance the entity should check for.
-
- Returns:
- Returns whether to grip the instance.
-
-
-
Scene.CheckObjectCollisionTouch
- Scene.CheckObjectCollisionTouch(thisEntity, thisHitbox, otherEntity, otherHitbox)
- Checks if an instance is touching another instance with their respective hitboxes.
- Parameters:
-
- - thisEntity (Instance): The first instance to check.
- - thisHitbox (Array): Array containing the first entity's hitbox.
- - otherEntity (Instance): The other instance to check.
- - otherHitbox (Array): Array containing the other entity's hitbox.
-
- Returns:
- Returns a Boolean value whether the entities are touching.
-
-
-
Scene.CheckObjectCollisionCircle
- Scene.CheckObjectCollisionCircle(thisEnity, thisRadius, otherEntity, otherRadius)
- Checks if an instance is touching another instance with within their respective radii.
- Parameters:
-
- - thisEnity (Instance): The first instance to check.
- - thisRadius (Decimal): Radius of the first entity to check.
- - otherEntity (Instance): The other instance to check.
- - otherRadius (Array): Radius of the other entity to check.
-
- Returns:
- Returns a Boolean value whether the entities have collided.
-
-
-
Scene.CheckObjectCollisionBox
- Scene.CheckObjectCollisionBox(thisEnity, thisHitbox, otherEntity, otherHitbox, setValues)
- Checks if an instance is touching another instance with their respective hitboxes and sets the values of the other instance if specified.
- Parameters:
-
- - thisEnity (Instance): The first instance to check.
- - thisHitbox (Array): Array containing the first entity's hitbox.
- - otherEntity (Instance): The other instance to check.
- - otherHitbox (Array): Array containing the other entity's hitbox.
- - setValues (Boolean): Whether to set the values of the other entity.
-
- Returns:
- Returns the side the entities are colliding on.
-
-
-
Scene.CheckObjectCollisionPlatform
- Scene.CheckObjectCollisionPlatform(thisEnity, thisHitbox, otherEntity, otherHitbox, setValues)
- Checks if an instance is touching the top of another instance with their respective hitboxes and sets the values of the other instance if specified.
- Parameters:
-
- - thisEnity (Instance): The first instance to check.
- - thisHitbox (Array): Array containing the first entity's hitbox.
- - otherEntity (Instance): The other instance to check whether it is on top of the first instance.
- - otherHitbox (Array): Array containing the other entity's hitbox.
- - setValues (Boolean): Whether to set the values of the other entity.
-
- Returns:
- Returns a Boolean value whether the entities have collided.
-
Scene.Load
Scene.Load([filename, persistency])
@@ -6656,24 +6878,6 @@ Scene.Load
- persistency (Boolean): Whether or not the scene should load with persistency.
-
-
Scene.LoadNoPersistency
- Scene.LoadNoPersistency(filename)
- Changes active scene to the one in the specified resource file, without keeping any persistent objects. (Deprecated; use
Scene.Load
instead.)
- Parameters:
-
- - filename (String): Filename of scene.
-
-
-
-
Scene.LoadPosition
- Scene.LoadPosition([persistency])
- Loads the scene located in the scene list's position slot, if a scene list is loaded. (Deprecated; use
Scene.Load
instead.)
- Parameters:
-
- - persistency (Boolean): Whether or not the scene should load with persistency.
-
-
Scene.Change
Scene.Change(category, scene)
@@ -7073,13 +7277,6 @@ Scene.GetDrawGroupEntityDepthSorting
Returns:
Returns a Boolean value.
-
-
Scene.GetListPos
- Scene.GetListPos()
- Gets the current list position of the scene. (Deprecated; use
Scene_ListPos
instead.)
- Returns:
- Returns an Integer value.
-
Scene.GetCurrentFolder
Scene.GetCurrentFolder()
@@ -7101,13 +7298,6 @@ Scene.GetCurrentResourceFolder
Returns:
Returns a String value.
-
-
Scene.GetCurrentSpriteFolder
- Scene.GetCurrentSpriteFolder()
-
- Returns:
- Returns a String value.
-
Scene.GetCurrentCategory
Scene.GetCurrentCategory()
@@ -7115,27 +7305,6 @@ Scene.GetCurrentCategory
Returns:
Returns a String value.
-
-
Scene.GetActiveCategory
- Scene.GetActiveCategory()
-
- Returns:
- Returns an Integer value.
-
-
-
Scene.GetCategoryCount
- Scene.GetCategoryCount()
-
- Returns:
- Returns an Integer value.
-
-
-
Scene.GetStageCount
- Scene.GetStageCount()
-
- Returns:
- Returns an Integer value.
-
Scene.GetDebugMode
Scene.GetDebugMode()
@@ -7269,35 +7438,6 @@ Scene.IsUsingID
Returns:
Returns a Boolean value.
-
-
Scene.CheckValidScene
- Scene.CheckValidScene()
- Checks whether the scene list's position is within the list's size, if a scene list is loaded. (Deprecated; use
Scene.IsCurrentEntryValid
instead.)
- Returns:
- Returns a Boolean value.
-
-
-
Scene.CheckSceneFolder
- Scene.CheckSceneFolder(folder)
- Checks whether the current scene's folder matches the string to check, if a scene list is loaded. (Deprecated; use
Scene.IsUsingFolder
instead.)
- Parameters:
-
- - folder (String): Folder name to compare.
-
- Returns:
- Returns a Boolean value.
-
-
-
Scene.CheckSceneID
- Scene.CheckSceneID(id)
- Checks whether the current scene's ID matches the string to check, if a scene list is loaded. (Deprecated; use
Scene.IsUsingID
instead.)
- Parameters:
-
- - id (String): ID to compare.
-
- Returns:
- Returns a Boolean value.
-
Scene.IsPaused
Scene.IsPaused()
@@ -7305,39 +7445,11 @@ Scene.IsPaused
Returns:
Returns a Boolean value.
-
-
Scene.SetListPos
- Scene.SetListPos(sceneNum)
- Sets the current list position of the scene. (Deprecated; use
Scene_ListPos
instead.)
- Parameters:
-
- - sceneNum (Integer): Scene number to use.
-
-
-
-
Scene.SetActiveCategory
- Scene.SetActiveCategory(categoryNum)
-
- Parameters:
-
- - categoryNum (Integer): Scene category number to use.
-
-
Scene.SetDebugMode
Scene.SetDebugMode()
Sets whether Debug Mode has been turned on in the current scene.
-
-
Scene.SetScene
- Scene.SetScene(category, scene)
- Sets the scene if the category and scene names exist within the scene list. (Deprecated; use
Scene.Change
instead.)
- Parameters:
-
- - category (String): Category name.
- - scene (String): Scene name. If the scene name is not found but the category name is, the first scene in the category is used.
-
-
Scene.SetTile
Scene.SetTile(layer, cellX, cellY, tileID, flipX, flipY[, collisionMaskA, collisionMaskB])
@@ -8572,6 +8684,19 @@ Sprite.GetAnimationIndexByName
Returns:
Returns the first animation index with the specified name, or -1 if there was no match.
+
+
Sprite.GetFrameExists
+ Sprite.GetFrameExists(sprite, animation, frame)
+ Checks if an animation and frame is valid within a sprite.
+ Parameters:
+
+ - sprite (Integer): The sprite index to check.
+ - animation (Integer): The animation index to check.
+ - frame (Integer): The sprite index to check.
+
+ Returns:
+ Returns the first animation index with the specified name, or -1 if there was no match.
+
Sprite.GetFrameLoopIndex
Sprite.GetFrameLoopIndex(sprite, animation)
@@ -8686,20 +8811,45 @@ Sprite.GetFrameOffsetY
Returns:
Returns the Y offset of the specified sprite frame.
-
-
Sprite.GetFrameHitbox
- Sprite.GetFrameHitbox(sprite, animationID, frame, hitboxID)
- Gets the hitbox of an animation and frame of a sprite.
+
+
Sprite.GetHitbox
+ Sprite.GetHitbox(instance, sprite, animationID, frameID, hitboxID)
+ Gets the hitbox of a sprite frame. If an entity is provided, the only two arguments are the entity and the hitboxID. Else, there are 4 arguments.
Parameters:
- - sprite (Integer): The sprite index to check.
- - animationID (Integer): The animation index of the sprite to check.
- - frame (Integer): The frame index of the animation to check.
+ - instance (Instance):An instance with Sprite, CurrentAnimation, and CurrentFrame values (if provided).
+ - sprite (Integer): The sprite index to check (if an entity is not provided).
+ - animationID (Integer): The animation index of the sprite to check (if an entity is not provided).
+ - frameID (Integer): The frame index of the animation to check (if an entity is not provided).
- hitboxID (Integer): The index number of the hitbox.
Returns:
Returns a reference value to a hitbox array.
+
+
Sprite.SetSpriteString
+ Sprite.SetSpriteString(sprite, animation, string)
+ Converts a string to an array of sprite indexes by comparing UTF-16 values to a frame's ID.
+ Parameters:
+
+ - sprite (Integer): The sprite index.
+ - animation (Integer): The animation index containing frames with UTF-16 ID values.
+ - string (String): The string to convert.
+
+
+
+
Sprite.GetStringWidth
+ Sprite.GetStringWidth(sprite, animation, string, startIndex, spacing)
+ Gets the width (in pixels) of a converted sprite string.
+ Parameters:
+
+ - sprite (Integer): The sprite index.
+ - animation (Integer): The animation index.
+ - string (Array): The array containing frame indexes.
+ - startIndex (Integer): Where to start checking the width.
+ - spacing (Integer): The spacing (in pixels) between frames.
+
+
Sprite.MakePalettized
Sprite.MakePalettized(sprite, paletteIndex)
@@ -9113,15 +9263,16 @@ String.Split
String.CharAt
- String.CharAt(string, index)
- Gets the UTF8 value of the character at the specified index.
+ String.CharAt(string, index[, utf16])
+ Gets the value of the character at the specified index.
Parameters:
- - string (String):
- - index (Integer):
+ - string (String): The string containing the character.
+ - index (Integer): The character index to check.
+ - utf16 (Boolean): Whether to use UTF-16 encoding. Otherwise, UTF-8 encoding is used.
Returns:
- Returns the UTF8 value as an Integer.
+ Returns the value as an Integer.
String.Length
@@ -9183,9 +9334,9 @@ String.Substring
Returns:
Returns a String value.
-
-
String.ToUpperCase
- String.ToUpperCase(string)
+
+
String.ToUppercase
+ String.ToUppercase(string)
Convert a String value to its uppercase representation.
Parameters:
@@ -9194,9 +9345,9 @@ String.ToUpperCase
Returns:
Returns a uppercase String value.
-
-
String.ToLowerCase
- String.ToLowerCase(string)
+
+
String.ToLowercase
+ String.ToLowercase(string)
Convert a String value to its lowercase representation.
Parameters:
@@ -9618,6 +9769,36 @@ View.SetPosition
- z (Number): Desired Z position
+
+
View.AdjustX
+ View.AdjustX(viewInde, )
+ Adjusts the x - axis position of the camera for the specified view by an amount.
+ Parameters:
+
+ - viewIndex(Integer) : Index of the view.
+ - x(Number) : Desired X adjust amount.
+
+
+
+
View.AdjustY
+ View.AdjustY(viewIndex, y)
+ Adjusts the y-axis position of the camera for the specified view by an amount.
+ Parameters:
+
+ - viewIndex (Integer): Index of the view.
+ - y (Number): Desired Y adjust amount.
+
+
+
+
View.AdjustX
+ View.AdjustX(viewIndex, z)
+ Adjusts the z-axis position of the camera for the specified view by an amount.
+ Parameters:
+
+ - viewIndex (Integer): Index of the view.
+ - z (Number): Desired Z adjust amount.
+
+
View.SetAngle
View.SetAngle(viewIndex, x, y, z)
@@ -9912,11 +10093,11 @@ View.CheckOnScreen
Parameters:
- instance (Instance): The instance to check.
- - rangeX (Decimal): The x range to check, or null if an update region width should be used.
- - rangeY (Decimal): The y range to check, or null if an update region height should be used.
+ - rangeX (Decimal): The x range to check, or
null
if the instance's update region width should be used.
+ - rangeY (Decimal): The y range to check, or
null
if the instance's update region height should be used.
Returns:
- Returns whether or not the instance is on screen on any view.
+ Returns whether the instance is on screen on any view.
View.CheckPosOnScreen
@@ -10032,7 +10213,7 @@ XML.Parse
Returns:
Returns a Map value if the text can be decoded, otherwise returns null
.
- 725 out of 784 functions have descriptions.
+ 737 out of 796 functions have descriptions.
Instance methods
@@ -10390,6 +10571,12 @@
instance.Alpha
Default: 0.0
A field that may be used in instance.Render
for changing the opacity of a sprite.
+
+
instance.BlendMode
+
Type: Integer
+ Default: BlendMode_NORMAL
+ A field that may be used in instance.Render
for changing the BlendMode of a sprite.
+
instance.Priority
Type: Integer
@@ -10412,7 +10599,7 @@ instance.Sprite
instance.CurrentAnimation
Type: Integer
Default: -1
- The current sprite animation index of the entity.
+ The current sprite animation index of the entity.
instance.CurrentFrame
@@ -10462,6 +10649,18 @@ instance.AnimationSpeedAdd
Default: 0
+
+
instance.PrevAnimation
+
Type: Integer
+ Default: -1
+ The previous sprite animation index of the entity, if it was changed.
+
+
+
instance.RotationStyle
+
Type: Integer
+ Default: 0
+ The way in which a sprite will rotate in some cases.
+
instance.AutoAnimate
Type: Boolean
@@ -10504,6 +10703,12 @@ instance.ViewOverrideFlag
Default: 0
+
+
instance.Visible
+
Type: Boolean
+ Default: true
+ Whether the entity will render.
+
instance.UpdateRegionW
Type: Decimal
@@ -10758,7 +10963,7 @@ instance.Persistence
Default: Persistence_NONE
Whether the entity persists between scenes.
- 73 out of 77 fields have descriptions.
+ 77 out of 81 fields have descriptions.
Enums
@@ -10793,6 +10998,10 @@
ACTIVE_YBOUNDS
ACTIVE_RBOUNDS
Entity updates within a radius. (uses UpdateRegionW)
+
+
ACTIVE_DISABLED
+
Entity will not even reach a point where it would check for an update.
+
Axis_LEFTX
Left controller stick X.
@@ -11245,20 +11454,20 @@ GeoFillRule_Positive
GeoFillRule_Negative
Only subregions that have winding counts lesser than zero (< 0) are filled.
-
-
HitboxSide_LEFT
+
+
HITBOX_LEFT
Left side, slot 0 of a hitbox array.
-
-
HitboxSide_TOP
+
+
HITBOX_TOP
Top side, slot 1 of a hitbox array.
-
-
HitboxSide_RIGHT
+
+
HITBOX_RIGHT
Right side, slot 2 of a hitbox array.
-
-
HitboxSide_BOTTOM
+
+
HITBOX_BOTTOM
Bottom side, slot 3 of a hitbox array.
@@ -11893,20 +12102,20 @@
TILECOLLISION_DOWN
TILECOLLISION_UP
Entity expects upward gravity for tile collision.
-
-
TimeOfDay_MORNING
+
+
TIMEOFDAY_MORNING
The early hours of the day (5AM to 11AM, or 05:00 to 11:00).
-
-
TimeOfDay_MIDDAY
+
+
TIMEOFDAY_MIDDAY
The middle hours of the day (12PM to 4PM, or 12:00 to 16:00).
-
-
TimeOfDay_EVENING
+
+
TIMEOFDAY_EVENING
The later hours of the day (5PM to 8PM, or 17:00 to 20:00).
-
-
TimeOfDay_NIGHT
+
+
TIMEOFDAY_NIGHT
The very late and very early hours of the day (9PM to 4AM, or 21:00 to 4:00).
@@ -11925,35 +12134,35 @@
TintMode_SRC_BLEND
TintMode_DST_BLEND
Blends the destination pixel with the tint color.
-
-
Weekday_SUNDAY
+
+
WEEKDAY_SUNDAY
The first day of the week.
-
-
Weekday_MONDAY
+
+
WEEKDAY_MONDAY
The second day of the week.
-
-
Weekday_TUESDAY
+
+
WEEKDAY_TUESDAY
The third day of the week.
-
-
Weekday_WEDNESDAY
+
+
WEEKDAY_WEDNESDAY
The fourth day of the week.
-
-
Weekday_THURSDAY
+
+
WEEKDAY_THURSDAY
The fifth day of the week.
-
-
Weekday_FRIDAY
+
+
WEEKDAY_FRIDAY
The sixth day of the week.
-
-
Weekday_SATURDAY
+
+
WEEKDAY_SATURDAY
The seventh day of the week.
- 298 out of 298 enums have descriptions.
+ 299 out of 299 enums have descriptions.
Constants
diff --git a/include/Engine/Application.h b/include/Engine/Application.h
index 80ff149..d9cb6f2 100644
--- a/include/Engine/Application.h
+++ b/include/Engine/Application.h
@@ -26,35 +26,53 @@ class Application {
static string ParseGameVersion(XMLNode* versionNode);
static void LoadGameInfo();
static int HandleAppEvents(void* data, SDL_Event* event);
+ static void DrawDevString(const char* string, int x, int y, int align, bool isSelected);
+ static void OpenDevMenu();
+ static void CloseDevMenu();
+ static void SetBlendColor(int color);
+ static void DrawRectangle(float x, float y, float width, float height, int color, int alpha, bool screenRelative);
+ static void DevMenu_DrawMainMenu();
+ static void DevMenu_MainMenu();
+ static void DevMenu_CategorySelectMenu();
+ static void DevMenu_SceneSelectMenu();
+ static void DevMenu_SettingsMenu();
+ static void DevMenu_ModsMenu();
public:
- static vector CmdLineArgs;
- static INI* Settings;
- static char SettingsFile[4096];
- static XMLNode* GameConfig;
- static int TargetFPS;
- static float CurrentFPS;
- static bool Running;
- static bool GameStart;
- static SDL_Window* Window;
- static char WindowTitle[256];
- static int WindowWidth;
- static int WindowHeight;
- static int DefaultMonitor;
- static Platforms Platform;
- static char EngineVersion[256];
- static char GameTitle[256];
- static char GameTitleShort[256];
- static char GameVersion[256];
- static char GameDescription[256];
- static int UpdatesPerFrame;
- static bool Stepper;
- static bool Step;
- static int MasterVolume;
- static int MusicVolume;
- static int SoundVolume;
- static int StartSceneNum;
- static bool DevMenuActivated;
+ static vector CmdLineArgs;
+ static INI* Settings;
+ static char SettingsFile[4096];
+ static XMLNode* GameConfig;
+ static int TargetFPS;
+ static float CurrentFPS;
+ static bool Running;
+ static bool GameStart;
+ static SDL_Window* Window;
+ static char WindowTitle[256];
+ static int WindowWidth;
+ static int WindowHeight;
+ static int DefaultMonitor;
+ static Platforms Platform;
+ static char EngineVersion[256];
+ static char GameTitle[256];
+ static char GameTitleShort[256];
+ static char GameVersion[256];
+ static char GameDescription[256];
+ static int UpdatesPerFrame;
+ static bool Stepper;
+ static bool Step;
+ static int MasterVolume;
+ static int MusicVolume;
+ static int SoundVolume;
+ static int StartSceneNum;
+ static bool DevMenuActivated;
+ static int ViewableVariableCount;
+ static ViewableVariable ViewableVariableList[64];
+ static DeveloperMenu DevMenu;
+ static int DeveloperDarkFont;
+ static int DeveloperLightFont;
+ static int ReservedSlotIDs;
+ static bool DevShowHitboxes;
static void Init(int argc, char* args[]);
static void SetTargetFrameRate(int targetFPS);
@@ -85,6 +103,9 @@ class Application {
static void SaveSettings();
static void SaveSettings(const char* filename);
static void SetSettingsFilename(const char* filename);
+ static void AddViewableVariable(const char* name, void* value, int type, int min, int max);
+ static Uint16* UTF8toUTF16(const char* utf8String);
+ static int LoadDevFont(const char* fileName);
};
#endif /* ENGINE_APPLICATION_H */
diff --git a/include/Engine/InputManager.h b/include/Engine/InputManager.h
index 2de33b6..620d40b 100644
--- a/include/Engine/InputManager.h
+++ b/include/Engine/InputManager.h
@@ -99,6 +99,12 @@ class InputManager {
static bool IsAnyActionHeld(unsigned playerID, unsigned device);
static bool IsAnyActionPressed(unsigned playerID, unsigned device);
static bool IsAnyActionReleased(unsigned playerID, unsigned device);
+ static bool IsActionHeldByAny(unsigned actionID);
+ static bool IsActionPressedByAny(unsigned actionID);
+ static bool IsActionReleasedByAny(unsigned actionID);
+ static bool IsActionHeldByAny(unsigned actionID, unsigned device);
+ static bool IsActionPressedByAny(unsigned actionID, unsigned device);
+ static bool IsActionReleasedByAny(unsigned actionID, unsigned device);
static bool IsPlayerUsingDevice(unsigned playerID, unsigned device);
static float GetAnalogActionInput(unsigned playerID, unsigned actionID);
static InputBind* GetPlayerInputBind(unsigned playerID, unsigned actionID, unsigned index, bool isDefault);
diff --git a/include/Engine/Math/Math.h b/include/Engine/Math/Math.h
index 7a950aa..ab55daa 100644
--- a/include/Engine/Math/Math.h
+++ b/include/Engine/Math/Math.h
@@ -31,6 +31,7 @@ class Math {
static int Tan256(int angle);
static int ASin256(int angle);
static int ACos256(int angle);
+ static unsigned int ArcTanLookup(int X, int Y);
static int CeilPOT(int n);
static float Abs(float n);
static float Max(float a, float b);
diff --git a/include/Engine/Scene.h b/include/Engine/Scene.h
index 4532012..d0b1583 100644
--- a/include/Engine/Scene.h
+++ b/include/Engine/Scene.h
@@ -185,7 +185,7 @@ class Scene {
static bool CheckObjectCollisionBox(Entity* thisEntity, CollisionBox* thisHitbox, Entity* otherEntity, CollisionBox* otherHitbox, bool setValues);
static bool CheckObjectCollisionPlatform(Entity* thisEntity, CollisionBox* thisHitbox, Entity* otherEntity, CollisionBox* otherHitbox, bool setValues);
static bool ObjectTileCollision(Entity* entity, int cLayers, int cMode, int cPlane, int xOffset, int yOffset, bool setPos);
- static bool ObjectTileGrip(Entity* entity, int cLayers, int cMode, int cPlane, float xOffset, float yOffset, float tolerance);
+ static bool ObjectTileGrip(Entity* entity, int cLayers, int cMode, int cPlane, int xOffset, int yOffset, float tolerance);
static void ProcessObjectMovement(Entity* entity, CollisionBox* outerBox, CollisionBox* innerBox);
static void ProcessPathGrip();
static void ProcessAirCollision_Down();
diff --git a/include/Engine/Types/Entity.h b/include/Engine/Types/Entity.h
index 1507662..40908d0 100644
--- a/include/Engine/Types/Entity.h
+++ b/include/Engine/Types/Entity.h
@@ -42,6 +42,7 @@ class Entity {
float OnScreenRegionBottom = 0.0f;
int ViewRenderFlag = 0xFFFFFFFF;
int ViewOverrideFlag = 0;
+ int Visible = true;
float RenderRegionW = 0.0f;
float RenderRegionH = 0.0f;
float RenderRegionTop = 0.0f;
@@ -54,6 +55,7 @@ class Entity {
float ScaleY = 1.0;
float Rotation = 0.0;
float Alpha = 1.0;
+ int BlendMode = BlendMode_NORMAL;
int AutoPhysics = false;
int Priority = 0;
int PriorityListIndex = -1;
@@ -67,6 +69,8 @@ class Entity {
int CurrentFrameCount = 0;
float AnimationSpeedMult = 1.0;
int AnimationSpeedAdd = 0;
+ int PrevAnimation = 0;
+ int RotationStyle = ROTSTYLE_NONE;
int AutoAnimate = true;
float AnimationSpeed = 0.0;
float AnimationTimer = 0.0;
diff --git a/source/Engine/Application.cpp b/source/Engine/Application.cpp
index 306409c..5afa139 100644
--- a/source/Engine/Application.cpp
+++ b/source/Engine/Application.cpp
@@ -62,7 +62,6 @@ vector Application::CmdLineArgs;
XMLNode* Application::GameConfig = NULL;
-float Application::FPS = 60.f;
int TargetFPS = 60;
bool Application::Running = false;
bool Application::GameStart = false;
@@ -1482,7 +1481,9 @@ void Application::InitSettings(const char* filename) {
Application::Settings->SetInteger("audio", "soundVolume", 0);
Application::Settings->SetBool("dev", "devMenu", false);
- Application::Settings->SetBool("dev", "writeToFile", false);
+#if WIN32 || MACOSX || LINUX || SWITCH
+ Application::Settings->SetBool("dev", "writeToFile", true);
+#endif
Application::Settings->SetBool("dev", "viewPerformance", false);
Application::Settings->SetBool("dev", "donothing", false);
Application::Settings->SetInteger("dev", "fastForward", 6);
@@ -1575,7 +1576,7 @@ int Application::HandleAppEvents(void* data, SDL_Event* event) {
}
}
-PRIVATE STATIC void Application::AddViewableVariable(const char* name, void* value, int type, int min, int max) {
+void Application::AddViewableVariable(const char* name, void* value, int type, int min, int max) {
if (Application::ViewableVariableCount < VIEWABLEVARIABLE_COUNT) {
ViewableVariable* viewVar = &Application::ViewableVariableList[Application::ViewableVariableCount++];
@@ -1595,7 +1596,7 @@ PRIVATE STATIC void Application::AddViewableVariable(const char* name, void* val
}
}
-PUBLIC STATIC Uint16* Application::UTF8toUTF16(const char* utf8String) {
+Uint16* Application::UTF8toUTF16(const char* utf8String) {
size_t len = strlen(utf8String);
Uint16* utf16String = (Uint16*)malloc((len + 1) * sizeof(Uint16));
size_t i = 0, j = 0;
@@ -1617,7 +1618,7 @@ PUBLIC STATIC Uint16* Application::UTF8toUTF16(const char* utf8String) {
return utf16String;
}
-PUBLIC STATIC int Application::LoadDevFont(const char* fileName) {
+int Application::LoadDevFont(const char* fileName) {
ResourceType* resource = new (std::nothrow) ResourceType();
resource->FilenameHash = CRC32::EncryptString(fileName);
resource->UnloadPolicy = SCOPE_GAME;
@@ -1640,7 +1641,7 @@ PUBLIC STATIC int Application::LoadDevFont(const char* fileName) {
return (int)index;
}
-PRIVATE STATIC void Application::DrawDevString(const char* string, int x, int y, int align, bool isSelected) {
+void Application::DrawDevString(const char* string, int x, int y, int align, bool isSelected) {
x += Scene::Views[0].X;
y += Scene::Views[0].Y;
@@ -1752,7 +1753,7 @@ PRIVATE STATIC void Application::DrawDevString(const char* string, int x, int y,
}
}
-PRIVATE STATIC void Application::OpenDevMenu() {
+void Application::OpenDevMenu() {
DevMenu.State = Application::DevMenu_MainMenu;
DevMenu.Selection = 0;
DevMenu.ScrollPos = 0;
@@ -1769,7 +1770,7 @@ PRIVATE STATIC void Application::OpenDevMenu() {
Application::DevMenuActivated = true;
}
-PRIVATE STATIC void Application::CloseDevMenu() {
+void Application::CloseDevMenu() {
Application::DevMenuActivated = false;
AudioManager::AudioUnpauseAll();
@@ -1779,14 +1780,14 @@ PRIVATE STATIC void Application::CloseDevMenu() {
AudioManager::Unlock();
}
-PRIVATE STATIC void Application::SetBlendColor(int color) {
+void Application::SetBlendColor(int color) {
Graphics::SetBlendColor(
(color >> 16 & 0xFF) / 255.f,
(color >> 8 & 0xFF) / 255.f,
(color & 0xFF) / 255.f, 1.0);
}
-PRIVATE STATIC void Application::DrawRectangle(float x, float y, float width, float height, int color, int alpha, bool screenRelative) {
+void Application::DrawRectangle(float x, float y, float width, float height, int color, int alpha, bool screenRelative) {
if (screenRelative) {
x += Scene::Views[0].X;
y += Scene::Views[0].Y;
@@ -1798,7 +1799,7 @@ PRIVATE STATIC void Application::DrawRectangle(float x, float y, float width, fl
Graphics::FillRectangle(x, y, width, height);
}
-PRIVATE STATIC void Application::DevMenu_DrawMainMenu() {
+void Application::DevMenu_DrawMainMenu() {
const int selectionCount = 6;
bool isSelected[] = { false, false, false, false, false, false };
const char* selectionNames[] = { "Resume", "Restart", "Stage Select", "Settings", "Mods", "Exit" };
@@ -1825,7 +1826,7 @@ PRIVATE STATIC void Application::DevMenu_DrawMainMenu() {
y += 20;
}
-PRIVATE STATIC void Application::DevMenu_MainMenu() {
+void Application::DevMenu_MainMenu() {
const int selectionCount = 6;
DevMenu_DrawMainMenu();
@@ -1940,7 +1941,7 @@ PRIVATE STATIC void Application::DevMenu_MainMenu() {
}
}
-PRIVATE STATIC void Application::DevMenu_CategorySelectMenu() {
+void Application::DevMenu_CategorySelectMenu() {
const int selectionCount = 6;
DevMenu_DrawMainMenu();
@@ -2080,7 +2081,7 @@ PRIVATE STATIC void Application::DevMenu_CategorySelectMenu() {
}
}
-PRIVATE STATIC void Application::DevMenu_SceneSelectMenu() {
+void Application::DevMenu_SceneSelectMenu() {
DevMenu_DrawMainMenu();
View view = Scene::Views[0];
@@ -2200,10 +2201,10 @@ PRIVATE STATIC void Application::DevMenu_SceneSelectMenu() {
}
}
-PRIVATE STATIC void Application::DevMenu_SettingsMenu() {
+void Application::DevMenu_SettingsMenu() {
}
-PRIVATE STATIC void Application::DevMenu_ModsMenu() {
+void Application::DevMenu_ModsMenu() {
}
\ No newline at end of file
diff --git a/source/Engine/InputManager.cpp b/source/Engine/InputManager.cpp
index 2a9a662..f9d162b 100644
--- a/source/Engine/InputManager.cpp
+++ b/source/Engine/InputManager.cpp
@@ -772,6 +772,27 @@ bool InputManager::IsAnyActionReleased(unsigned playerID, unsigned device) {
return player.IsAnyInputReleased(device);
}
+bool InputManager::IsActionHeldByAny(unsigned actionID) {
+ for (unsigned playerID = 0; playerID <= Players.size() - 1; playerID++) {
+ InputPlayer& player = Players[playerID];
+ if (player.IsInputHeld(actionID)) return true;
+ }
+ return false;
+}
+bool InputManager::IsActionPressedByAny(unsigned actionID) {
+ for (unsigned playerID = 0; playerID <= Players.size() - 1; playerID++) {
+ InputPlayer& player = Players[playerID];
+ if (player.IsInputPressed(actionID)) return true;
+ }
+ return false;
+}
+bool InputManager::IsActionReleasedByAny(unsigned actionID) {
+ for (unsigned playerID = 0; playerID <= Players.size() - 1; playerID++) {
+ InputPlayer& player = Players[playerID];
+ if (player.IsInputReleased(actionID)) return true;
+ }
+ return false;
+}
bool InputManager::IsActionHeldByAny(unsigned actionID, unsigned device) {
for (unsigned playerID = 0; playerID <= Players.size() - 1; playerID++) {
InputPlayer& player = Players[playerID];
@@ -796,8 +817,6 @@ bool InputManager::IsActionReleasedByAny(unsigned actionID, unsigned device) {
return false;
}
-bool InputManager::IsPlayerUsingDevice(unsigned playerID, unsigned device) {
-
bool InputManager::IsPlayerUsingDevice(unsigned playerID, unsigned device) {
if (playerID >= Players.size() || device >= InputDevice_MAX)
return false;
diff --git a/source/Engine/Math/Math.cpp b/source/Engine/Math/Math.cpp
index e80ff93..64f8cb1 100644
--- a/source/Engine/Math/Math.cpp
+++ b/source/Engine/Math/Math.cpp
@@ -202,7 +202,7 @@ int Math::ACos256(int angle) {
return -ACos256LookupTable[-angle];
return ACos256LookupTable[angle];
}
-PUBLIC STATIC unsigned int Math::ArcTanLookup(int X, int Y) {
+unsigned int Math::ArcTanLookup(int X, int Y) {
int x = abs(X);
int y = abs(Y);