From 2bd6f60ebc2ca30b453015815e6d43e572a61928 Mon Sep 17 00:00:00 2001 From: Axanery <41282531+Axanery@users.noreply.github.com> Date: Fri, 22 Dec 2023 02:22:37 -0600 Subject: [PATCH 01/23] Add Animator, View, Draw Functions --- guides/Documentation.htm | 77 +++++++++++++- source/Engine/Application.cpp | 10 +- source/Engine/Bytecode/Compiler.cpp | 2 +- source/Engine/Bytecode/StandardLibrary.cpp | 112 ++++++++++++++++++++- source/Engine/Scene.cpp | 2 +- 5 files changed, 194 insertions(+), 9 deletions(-) diff --git a/guides/Documentation.htm b/guides/Documentation.htm index af760d2f..b889433f 100644 --- a/guides/Documentation.htm +++ b/guides/Documentation.htm @@ -158,6 +158,7 @@
+
Animator.Remove(animator)
+
Animator.SetAnimation(animator, sprite, animationID, frameID, forceApply)
@@ -3774,6 +3791,34 @@ Draw.ClearClip()
+
Draw.GetClipX()
+ +
Draw.GetClipY()
+ +
Draw.GetClipWidth()
+ +
Draw.GetClipHeight()
+
Draw.Save()
@@ -8548,6 +8593,36 @@ +
View.AdjustX(viewInde, )
+ +
View.AdjustY(viewIndex, y)
+ +
View.AdjustX(viewIndex, z)
+
View.SetAngle(viewIndex, x, y, z)
@@ -8962,7 +9037,7 @@ null
.661 out of 720 functions have descriptions.
+669 out of 728 functions have descriptions.
diff --git a/source/Engine/Application.cpp b/source/Engine/Application.cpp index 5935773b..b4ad77e6 100644 --- a/source/Engine/Application.cpp +++ b/source/Engine/Application.cpp @@ -1408,7 +1408,7 @@ PUBLIC STATIC void Application::LoadSceneInfo() { if (stgElement->attributes.Exists("folder")) XMLParser::CopyTokenToString(stgElement->attributes.Get("folder"), scene.folder, sizeof(scene.folder)); else - // Accounts for scenes placed in the root of the Scenes folder if the file type is not "bin" + // Accounts for scenes placed in the root of the Scenes folder scene.folder[0] = '\0'; if (stgElement->attributes.Exists("id")) @@ -1426,6 +1426,14 @@ PUBLIC STATIC void Application::LoadSceneInfo() { else snprintf(scene.fileType, sizeof(scene.fileType), "bin"); + if (stgElement->attributes.Exists("filter")) + Scene::Filter = XMLParser::TokenToNumber(stgElement->attributes.Get("filter")); + else + Scene::Filter = 0xFF; + if (Scene::Filter == 0x00) + Scene::Filter = 0xFF; + + Scene::ListData.push_back(scene); category.sceneCount++; Scene::StageCount++; diff --git a/source/Engine/Bytecode/Compiler.cpp b/source/Engine/Bytecode/Compiler.cpp index 0f177b92..435087b3 100644 --- a/source/Engine/Bytecode/Compiler.cpp +++ b/source/Engine/Bytecode/Compiler.cpp @@ -1441,7 +1441,7 @@ PUBLIC void Compiler::GetUnary(bool canAssign) { case TOKEN_LOGICAL_NOT: EmitByte(OP_LG_NOT); break; case TOKEN_TYPEOF: EmitByte(OP_TYPEOF); break; - // HACK: replace these with prefix version of OP + // TODO: replace these with prefix version of OP // case TOKEN_INCREMENT: EmitByte(OP_INCREMENT); break; // case TOKEN_DECREMENT: EmitByte(OP_DECREMENT); break; default: diff --git a/source/Engine/Bytecode/StandardLibrary.cpp b/source/Engine/Bytecode/StandardLibrary.cpp index d6c27875..35925cb2 100644 --- a/source/Engine/Bytecode/StandardLibrary.cpp +++ b/source/Engine/Bytecode/StandardLibrary.cpp @@ -469,6 +469,21 @@ VMValue Animator_Create(int argCount, VMValue* args, Uint32 threadID) { return INTEGER_VAL((int)index); } +/*** + * Animator.Remove + * \desc Removes an animator. + * \param animator (Integer): The index of the animator. + * \ns Animator + */ +VMValue Animator_Remove(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(1); + int animator = GET_ARG(0, GetInteger); + if (!Scene::AnimatorList[animator]) + return NULL_VAL; + delete Scene::AnimatorList[animator]; + Scene::AnimatorList[animator] = NULL; + return NULL_VAL; +} /*** * Animator.SetAnimation * \desc Sets the current animation and frame of an animator. @@ -4578,7 +4593,8 @@ VMValue Draw_UseStrokeSmoothing(int argCount, VMValue* args, Uint32 threadID) { */ VMValue Draw_SetClip(int argCount, VMValue* args, Uint32 threadID) { CHECK_ARGCOUNT(4); - Graphics::SetClip((int)GET_ARG(0, GetDecimal), (int)GET_ARG(1, GetDecimal), (int)GET_ARG(2, GetDecimal), (int)GET_ARG(3, GetDecimal)); + if (GET_ARG(2, GetDecimal) > 0.0 && GET_ARG(3, GetDecimal) > 0.0) + Graphics::SetClip((int)GET_ARG(0, GetDecimal), (int)GET_ARG(1, GetDecimal), (int)GET_ARG(2, GetDecimal), (int)GET_ARG(3, GetDecimal)); return NULL_VAL; } /*** @@ -4591,6 +4607,46 @@ VMValue Draw_ClearClip(int argCount, VMValue* args, Uint32 threadID) { Graphics::ClearClip(); return NULL_VAL; } +/*** + * Draw.GetClipX + * \desc Gets the X position in which drawing starts to occur. + * \return The X position if clipping is enabled, else 0. + * \ns Draw + */ +VMValue Draw_GetClipX(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(0); + return Graphics::CurrentClip.Enabled ? INTEGER_VAL((int)Graphics::CurrentClip.X) : INTEGER_VAL(0); +} +/*** + * Draw.GetClipY + * \desc Gets the Y position in which drawing starts to occur. + * \return The Y position if clipping is enabled, else 0. + * \ns Draw + */ +VMValue Draw_GetClipY(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(0); + return Graphics::CurrentClip.Enabled ? INTEGER_VAL((int)Graphics::CurrentClip.Y) : INTEGER_VAL(0); +} +/*** + * Draw.GetClipWidth + * \desc Gets the width in which drawing occurs. + * \return The width if clipping is enabled, else 0. + * \ns Draw + */ +VMValue Draw_GetClipWidth(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(0); + return Graphics::CurrentClip.Enabled ? INTEGER_VAL((int)Graphics::CurrentClip.Width) : INTEGER_VAL(0); +} +/*** + * Draw.GetClipHeight + * \desc Gets the height in which drawing occurs. + * \return The height if clipping is enabled, else 0. + * \ns Draw + */ +VMValue Draw_GetClipHeight(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(0); + return Graphics::CurrentClip.Enabled ? INTEGER_VAL((int)Graphics::CurrentClip.Height) : INTEGER_VAL(0); +} /*** * Draw.Save @@ -8443,8 +8499,8 @@ VMValue Scene_ObjectTileCollision(int argCount, VMValue* args, Uint32 threadID) int cLayers = GET_ARG(1, GetInteger); int cMode = GET_ARG(2, GetInteger); int cPlane = GET_ARG(3, GetInteger); - int xOffset = GET_ARG(4, GetDecimal); - int yOffset = GET_ARG(5, GetDecimal); + int xOffset = (int)GET_ARG(4, GetDecimal); + int yOffset = (int)GET_ARG(5, GetDecimal); int setPos = GET_ARG(6, GetInteger); auto ent = (Entity*)entity->EntityPtr; @@ -8470,8 +8526,8 @@ VMValue Scene_ObjectTileGrip(int argCount, VMValue* args, Uint32 threadID) { int cLayers = GET_ARG(1, GetInteger); int cMode = GET_ARG(2, GetInteger); int cPlane = GET_ARG(3, GetInteger); - float xOffset = GET_ARG(4, GetDecimal); - float yOffset = GET_ARG(5, GetDecimal); + int xOffset = (int)GET_ARG(4, GetDecimal); + int yOffset = (int)GET_ARG(5, GetDecimal); float tolerance = GET_ARG(6, GetDecimal); auto ent = (Entity*)entity->EntityPtr; @@ -13642,6 +13698,48 @@ VMValue View_SetPosition(int argCount, VMValue* args, Uint32 threadID) { Scene::Views[view_index].Z = GET_ARG(3, GetDecimal); return NULL_VAL; } +/*** +* View.AdjustX +* \desc Adjusts the x - axis position of the camera for the specified view by an amount. +* \param viewIndex(Integer) : Index of the view. +* \param x(Number) : Desired X adjust amount. +* \ns View +*/ +VMValue View_AdjustX(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(2); + int view_index = GET_ARG(0, GetInteger); + CHECK_VIEW_INDEX(); + Scene::Views[view_index].X += GET_ARG(1, GetDecimal); + return NULL_VAL; +} +/*** +* View.AdjustY +* \desc Adjusts the y-axis position of the camera for the specified view by an amount. +* \param viewIndex (Integer): Index of the view. +* \param y (Number): Desired Y adjust amount. +* \ns View +*/ +VMValue View_AdjustY(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(2); + int view_index = GET_ARG(0, GetInteger); + CHECK_VIEW_INDEX(); + Scene::Views[view_index].Y += GET_ARG(1, GetDecimal); + return NULL_VAL; +} +/*** +* View.AdjustX +* \desc Adjusts the z-axis position of the camera for the specified view by an amount. +* \param viewIndex (Integer): Index of the view. +* \param z (Number): Desired Z adjust amount. +* \ns View +*/ +VMValue View_AdjustZ(int argCount, VMValue* args, Uint32 threadID) { + CHECK_ARGCOUNT(2); + int view_index = GET_ARG(0, GetInteger); + CHECK_VIEW_INDEX(); + Scene::Views[view_index].Z += GET_ARG(1, GetDecimal); + return NULL_VAL; +} /*** * View.SetAngle * \desc Sets the angle of the camera for the specified view. @@ -14395,6 +14493,7 @@ PUBLIC STATIC void StandardLibrary::Link() { // #region Animator INIT_CLASS(Animator); DEF_NATIVE(Animator, Create); + DEF_NATIVE(Animator, Remove); DEF_NATIVE(Animator, SetAnimation); DEF_NATIVE(Animator, Animate); DEF_NATIVE(Animator, GetSprite); @@ -16202,6 +16301,9 @@ PUBLIC STATIC void StandardLibrary::Link() { DEF_NATIVE(View, SetY); DEF_NATIVE(View, SetZ); DEF_NATIVE(View, SetPosition); + DEF_NATIVE(View, AdjustX); + DEF_NATIVE(View, AdjustY); + DEF_NATIVE(View, AdjustZ); DEF_NATIVE(View, SetAngle); DEF_NATIVE(View, SetSize); DEF_NATIVE(View, SetOutputX); diff --git a/source/Engine/Scene.cpp b/source/Engine/Scene.cpp index d25b78b2..4f6bfe5c 100644 --- a/source/Engine/Scene.cpp +++ b/source/Engine/Scene.cpp @@ -3572,7 +3572,7 @@ PUBLIC STATIC bool Scene::ObjectTileCollision(Entity* entity, int cLayers, int c } } -PUBLIC STATIC bool Scene::ObjectTileGrip(Entity* entity, int cLayers, int cMode, int cPlane, float xOffset, float yOffset, float tolerance) { +PUBLIC STATIC bool Scene::ObjectTileGrip(Entity* entity, int cLayers, int cMode, int cPlane, int xOffset, int yOffset, float tolerance) { int layerID = 1; bool collided = false; int posX = xOffset + entity->X; From c254d6b6b929ae5a3f9ee02cd4633ca25b6a452a Mon Sep 17 00:00:00 2001 From: Axanery <41282531+Axanery@users.noreply.github.com> Date: Fri, 22 Dec 2023 02:37:05 -0600 Subject: [PATCH 02/23] Add Draw methods to definitions --- source/Engine/Bytecode/StandardLibrary.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/Engine/Bytecode/StandardLibrary.cpp b/source/Engine/Bytecode/StandardLibrary.cpp index ae0a1e69..e7963d40 100644 --- a/source/Engine/Bytecode/StandardLibrary.cpp +++ b/source/Engine/Bytecode/StandardLibrary.cpp @@ -15193,6 +15193,10 @@ PUBLIC STATIC void StandardLibrary::Link() { DEF_NATIVE(Draw, UseStrokeSmoothing); DEF_NATIVE(Draw, SetClip); DEF_NATIVE(Draw, ClearClip); + DEF_NATIVE(Draw, GetClipX); + DEF_NATIVE(Draw, GetClipY); + DEF_NATIVE(Draw, GetClipWidth); + DEF_NATIVE(Draw, GetClipHeight); DEF_NATIVE(Draw, Save); DEF_NATIVE(Draw, Scale); DEF_NATIVE(Draw, Rotate); From 69685dbd57195a6c26495b29829638f10891257e Mon Sep 17 00:00:00 2001 From: Axanery <41282531+Axanery@users.noreply.github.com> Date: Thu, 29 Feb 2024 02:47:52 -0500 Subject: [PATCH 03/23] Fix documentation --- guides/Documentation.htm | 1344 ++++++++++++++++---------------------- 1 file changed, 577 insertions(+), 767 deletions(-) diff --git a/guides/Documentation.htm b/guides/Documentation.htm index deff94ff..a4679101 100644 --- a/guides/Documentation.htm +++ b/guides/Documentation.htm @@ -72,9 +72,12 @@
@@ -748,15 +709,6 @@
@@ -832,6 +784,44 @@
+
+
+
@@ -1332,13 +1344,14 @@
TILECOLLISION_*
+
TimeOfDay_*
TintMode_*
TintMode_*
+
Weekday_*
+
Application.GetEngineVersionString()
+ +
Application.GetEngineVersionMajor()
+ +
Application.GetEngineVersionMinor()
+ +
Application.GetEngineVersionPatch()
+ +
Application.GetEngineVersionPrerelease()
+ null
.+
Application.GetEngineVersionCodename()
+ null
.
Application.GetFPS()
@@ -2051,20 +2131,20 @@ Application.GetGameTitleShort()
-
Application.GetVersion()
+ +
Application.GetGameVersion()
-
Application.GetDescription()
- +
Application.GetGameDescription()
+
Application.SetGameTitle(title)
-
Application.SetGameTitleShort(title)
- -
Application.SetVersion(title)
- +
Application.SetGameVersion(title)
+ -
Application.SetDescription(title)
- +
Application.SetGameDescription(title)
+ +
Controller.IsButtonHeld(controllerIndex, buttonIndex)
+ +
Controller.IsButtonPressed(controllerIndex, buttonIndex)
+
Controller.GetButton(controllerIndex, buttonIndex)
- Controller.IsButtonHeld
instead.)
Controller.Rumble(controllerIndex, largeMotorFrequency, smallMotorFrequency, duration)
+ Controller.Rumble(controllerIndex, strength, duration)
0
for infinite duration.
Controller.SetLargeMotorFrequency(controllerIndex, frequency)
-
Controller.SetSmallMotorFrequency(controllerIndex, frequency)
- -
Draw.UnbindVertexBuffer()
- -
Draw.InitArrayBuffer(arrayBufferIndex, numVertices)
- Scene3D.Create
instead.)-
Draw.SetArrayBufferDrawMode(arrayBufferIndex, drawMode)
- Scene3D.SetDrawMode
instead.)-
Draw.SetProjectionMatrix(arrayBufferIndex, projMatrix)
- Scene3D.SetCustomProjectionMatrix
instead.)-
Draw.SetViewMatrix(arrayBufferIndex, viewMatrix)
- Scene3D.SetViewMatrix
instead.)-
Draw.SetAmbientLighting(arrayBufferIndex, red, green, blue)
- Scene3D.SetAmbientLighting
instead.)-
Draw.SetDiffuseLighting(arrayBufferIndex, red, green, blue)
- Scene3D.SetDiffuseLighting
instead.)-
Draw.SetSpecularLighting(arrayBufferIndex, red, green, blue)
- Scene3D.SetSpecularLighting
instead.)-
Draw.SetFogDensity(arrayBufferIndex, density)
- Scene3D.SetFogDensity
instead.)-
Draw.SetFogColor(arrayBufferIndex, red, green, blue)
- Scene3D.SetFogColor
instead.)-
Draw.SetClipPolygons(arrayBufferIndex, clipPolygons)
- -
Draw.SetPointSize(arrayBufferIndex, pointSize)
- Scene3D.SetPointSize
instead.)-
Draw.BindArrayBuffer(arrayBufferIndex)
- Draw.BindScene3D
instead.)-
Draw.BindScene3D(scene3DIndex)
-
Draw.Texture(texture, x, y)
@@ -3214,20 +3181,6 @@ -
Draw.RenderArrayBuffer(arrayBufferIndex[, drawMode])
- Draw.RenderScene3D
instead.)-
Draw.RenderScene3D(scene3DIndex[, drawMode])
-
Draw.SetTintMode(tintMode)
@@ -3611,6 +3564,34 @@ Draw.ClearClip()
+
Draw.GetClipX()
+ +
Draw.GetClipY()
+ +
Draw.GetClipWidth()
+ +
Draw.GetClipHeight()
+
Draw.Save()
@@ -4016,75 +3997,6 @@ -
Draw.ClearClip()
- -
Draw.GetClipX()
- -
Draw.GetClipY()
- -
Draw.GetClipWidth()
- -
Draw.GetClipHeight()
- -
Draw.Save()
-
- -
Draw.Scale()
-
- -
Draw.Rotate()
-
- -
Draw.Restore()
-
- -
Draw.Translate()
-
- -
Draw.SetTextureTarget()
-
- -
Draw.Clear()
-
- -
Draw.ResetTextureTarget()
-
- -
Draw.UseSpriteDeform(useDeform)
-
Draw3D.SceneLayer(layer[, matrixModel, matrixNormal])
@@ -4671,71 +4583,6 @@ -
Input.GetControllerCount()
- Controller.GetCount
instead.)-
Input.GetControllerAttached(controllerIndex)
- Controller.IsConnected
instead.)-
Input.GetControllerHat(controllerIndex, hatIndex)
- Controller.GetButton
instead.)-
Input.GetControllerAxis(controllerIndex, axisIndex)
- Controller.GetAxis
instead.)-
Input.GetControllerButton(controllerIndex, buttonIndex)
- Controller.GetButton
instead.)-
Input.GetControllerName(controllerIndex)
- Controller.GetName
instead.)
Input.GetKeyName(keyID)
@@ -4883,7 +4730,7 @@ null
if the instance could not be found.null
if no instance was found.
JSON.ToString(json, prettyPrint)
+ JSON.ToString(json[, prettyPrint])
-
Math.ClearTrigLookupTables()
- -
Math.CalculateTrigAngles()
- -
Math.Sin1024(angle)
- -
Math.Cos1024(angle)
- -
Math.Tan1024(angle)
- -
Math.ASin1024(angle)
- -
Math.ACos1024(angle)
- -
Math.Cos512(angle)
- -
Math.Tan512(angle)
- -
Math.ASin512(angle)
- -
Math.ACos512(angle)
- -
Math.Cos256(angle)
- -
Math.Tan256(angle)
- -
Math.ASin256(angle)
- -
Math.ACos256(angle)
- -
Math.RadianToInteger(radian)
- -
Math.IntegerToRadian(integer)
-
Matrix.Create()
@@ -5459,134 +5131,40 @@
Matrix.Translate(matrix, x, y, z[, resetToIdentity, actuallyTranslate])
- false
)false
)-
Matrix.Scale(matrix, x, y, z)
- -
Matrix.Rotate(matrix, x, y, z)
- -
Matrix.Create256()
- -
Matrix.Identity256(matrix)
- -
Matrix.Multiply256(matrix, a, b)
- -
Matrix.Translate256(matrix, x, y, z, setIdentity)
- -
Matrix.Scale256(matrix, scaleX, scaleY, scaleZ)
- -
Matrix.RotateX256(matrix, rotationY)
- -
Matrix.RotateY256(matrix, rotationY)
- Matrix.Translate(matrix, x, y, z[, resetToIdentity, actuallyTranslate])
+ false
)false
)-
Matrix.RotateZ256(matrix, rotationZ)
- +
Matrix.Scale(matrix, x, y, z)
+ -
Matrix.Rotate256(matrix, rotationX, rotationY, rotationZ)
- +
Matrix.Rotate(matrix, x, y, z)
+ @@ -6215,109 +5793,114 @@
-
Palette.LoadFromResource(paletteIndex, filename[, activeRows])
- +
RSDK.Math.IntegerToRadian(integer)
+ -
Palette.LoadFromImage(paletteIndex, image)
- +
RSDK.Matrix.Create256()
+ +
RSDK.Matrix.Identity256(matrix)
+ -
Palette.GetColor(paletteIndex, colorIndex)
- +
RSDK.Matrix.Multiply256(matrix, a, b)
+ -
Palette.SetColor(paletteIndex, colorIndex, hex)
- +
RSDK.Matrix.Translate256(matrix, x, y, z, setIdentity)
+ -
Palette.MixPalettes(destinationPaletteIndex, paletteIndexA, paletteIndexB, mixRatio, colorIndexStart, colorCount)
- +
RSDK.Matrix.Scale256(matrix, scaleX, scaleY, scaleZ)
+ -
Palette.RotateColorsLeft(paletteIndex, colorIndexStart, colorCount)
- +
RSDK.Matrix.RotateX256(matrix, rotationY)
+ -
Palette.RotateColorsRight(paletteIndex, colorIndexStart, colorCount)
- +
RSDK.Matrix.RotateY256(matrix, rotationY)
+ -
Palette.CopyColors(paletteIndexA, colorIndexStartA, paletteIndexB, colorIndexStartB, colorCount)
- +
RSDK.Matrix.RotateZ256(matrix, rotationZ)
+ -
Palette.SetPaletteIndexLines(paletteIndex, lineStart, lineEnd)
- +
RSDK.Matrix.Rotate256(matrix, rotationX, rotationY, rotationZ)
+ @@ -6547,7 +6130,7 @@
Scene.LoadPosition([persistency])
-
Scene.GetLayerDrawGroup(layerIndex, drawGroup)
- Scene.GetLayerDrawGroup(layerIndex)
+ +
Scene.GetLayerHorizontalRepeat(layerIndex)
+ +
Scene.GetLayerVerticalRepeat(layerIndex)
+
-
Scene.GetTileSize()
- Scene.GetTileWidth
and Scene.GetTileHeight
instead.)
Scene.GetTileID(layer, x, y)
@@ -6929,7 +6528,7 @@
Scene.GetListPos()
-
Scene.GetCategoryCount()
- SceneList.GetCategoryCount
instead.)
Scene.GetStageCount()
- SceneList.GetSceneCount
instead.)
Scene.CheckValidScene()
-
Scene.CheckSceneFolder(folder)
-
Scene.CheckSceneID(id)
-
Scene.SetListPos()
-
Scene.SetActiveCategory()
-
Scene.SetScene(category, scene)
- @@ -7342,6 +6941,26 @@
+
Scene.SetLayerHorizontalRepeat(layerIndex, doesRepeat)
+ +
Scene.SetLayerVerticalRepeat(layerIndex, doesRepeat)
+
Scene.SetDrawGroupCount(count)
@@ -7746,6 +7365,132 @@ +
SceneList.Get(category, entry)
+ +
SceneList.GetEntryID(categoryName, entryName)
+ -1
if not found.+
SceneList.GetCategoryID(categoryName)
+ -1
if not found.+
SceneList.GetEntryName(category, entryID)
+ +
SceneList.GetCategoryName(categoryID)
+ -1
if not valid.+
SceneList.GetEntryProperty(category, entry, property)
+ null
if the entry has no such property.+
SceneList.GetCategoryProperty(category, property)
+ null
if the category has no such property.+
SceneList.HasEntryProperty(category, entry, property)
+ true
if the property exists, false
if not.+
SceneList.HasCategoryProperty(category, property)
+ true
if the property exists, false
if not.+
SceneList.GetCategoryCount()
+ +
SceneList.GetSceneCount([categoryName])
+ categoryName
is omitted, this returns the total amount of scenes in the entire list.
Serializer.WriteToStream(stream, value)
@@ -8361,6 +8106,25 @@ +
Sprite.MakePalettized(sprite, paletteIndex)
+ +
Sprite.MakeNonPalettized(sprite)
+
Stream.FromResource(filename)
@@ -9692,7 +9456,7 @@ null
.684 out of 743 functions have descriptions.
+692 out of 751 functions have descriptions.
@@ -9720,6 +9484,13 @@
instance.Animate()
+
instance.GetIDWithinClass()
+
instance.AddToRegistry(registry)
@@ -9781,9 +9552,9 @@ -
instance.GetHitboxFromSprite(sprite, animation, frame, hitbox)
+ +
instance.ReturnHitboxFromSprite(sprite, animation, frame, hitbox)
instance.StopAllSounds()
24 out of 24 methods have descriptions.
+25 out of 25 methods have descriptions.
@@ -10242,6 +10013,30 @@
instance.HitboxOffY
0.0
+
instance.HitboxLeft
+ 0.0
+
instance.HitboxTop
+ 0.0
+
instance.HitboxRight
+ 0.0
+
instance.HitboxBottom
+ 0.0
instance.FlipFlag
instance.Persistence
Persistence_NONE
69 out of 73 fields have descriptions.
+73 out of 77 fields have descriptions.
@@ -11075,6 +10870,22 @@
TILECOLLISION_DOWN
TILECOLLISION_UP
+
TimeOfDay_MORNING
+ +
TimeOfDay_MIDDAY
+ +
TimeOfDay_EVENING
+ +
TimeOfDay_NIGHT
+
TintMode_SRC_NORMAL
TintMode_SRC_BLEND
TintMode_DST_BLEND
166 out of 181 enums have descriptions.
Weekday_SUNDAY
-1
if the instance's update region width should be used.
+ * \param rangeY (Decimal): The y range to check, or -1
if the instance's update region height should be used.
+ * \return Returns whether the instance is on screen on any view.
* \ns View
*/
VMValue View_CheckOnScreen(int argCount, VMValue* args, Uint32 threadID) {
@@ -14812,17 +14812,16 @@ VMValue View_CheckOnScreen(int argCount, VMValue* args, Uint32 threadID) {
ObjInstance* instance = GET_ARG(0, GetInstance);
Entity* self = (Entity*)instance->EntityPtr;
- // TODO: Check if GetDecimal can get null values
float rangeX = GET_ARG(1, GetDecimal);
float rangeY = GET_ARG(2, GetDecimal);
if (!self)
return INTEGER_VAL(false);
- if (!rangeX)
+ if (rangeX == -1.0)
rangeX = self->OnScreenHitboxW;
- if (!rangeY)
+ if (rangeY == -1.0)
rangeY = self->OnScreenHitboxH;
return INTEGER_VAL(Scene::CheckPosOnScreen(self->X, self->Y, rangeX, rangeY));
From 34586b1c526b186f4ce0aa54d5f459e2870edafa Mon Sep 17 00:00:00 2001
From: Axanery GeoFillRule_*
-
HitboxSide_*
+
HITBOX_*
@@ -1753,13 +1751,13 @@
TILECOLLISION_*
-
TimeOfDay_*
+
TIMEOFDAY_*
@@ -1771,16 +1769,16 @@
TintMode_*
-
Weekday_*
+
WEEKDAY_*
Scene.GetListPos()
- -
Scene.GetCategoryCount()
- SceneList.GetCategoryCount
instead.)-
Scene.GetStageCount()
- SceneList.GetSceneCount
instead.)
Scene.GetDebugMode()
@@ -6688,14 +6672,14 @@
Scene.CheckValidScene()
-
Scene.CheckSceneFolder(folder)
-
Scene.CheckSceneID(id)
-
Scene.SetListPos()
-
Scene.SetActiveCategory()
-
Scene.SetScene(category, scene)
- -1
if the instance's update region width should be used.-1
if the instance's update region height should be used.
null
.692 out of 751 functions have descriptions.
+690 out of 749 functions have descriptions.
@@ -10658,20 +10642,20 @@
GeoFillRule_Positive
GeoFillRule_Negative
-
HitboxSide_LEFT
+ +
HITBOX_LEFT
-
HitboxSide_TOP
+ +
HITBOX_TOP
-
HitboxSide_RIGHT
+ +
HITBOX_RIGHT
-
HitboxSide_BOTTOM
+ +
HITBOX_BOTTOM
@@ -10870,20 +10854,20 @@
TILECOLLISION_DOWN
TILECOLLISION_UP
-
TimeOfDay_MORNING
+ +
TIMEOFDAY_MORNING
-
TimeOfDay_MIDDAY
+ +
TIMEOFDAY_MIDDAY
-
TimeOfDay_EVENING
+ +
TIMEOFDAY_EVENING
-
TimeOfDay_NIGHT
+ +
TIMEOFDAY_NIGHT
@@ -10902,32 +10886,32 @@
TintMode_SRC_BLEND
TintMode_DST_BLEND
-
Weekday_SUNDAY
+ +
WEEKDAY_SUNDAY
-
Weekday_MONDAY
+ +
WEEKDAY_MONDAY
-
Weekday_TUESDAY
+ +
WEEKDAY_TUESDAY
-
Weekday_WEDNESDAY
+ +
WEEKDAY_WEDNESDAY
-
Weekday_THURSDAY
+ +
WEEKDAY_THURSDAY
-
Weekday_FRIDAY
+ +
WEEKDAY_FRIDAY
-
Weekday_SATURDAY
+ +
WEEKDAY_SATURDAY
189 out of 189 enums have descriptions.
diff --git a/source/Engine/Bytecode/StandardLibrary.cpp b/source/Engine/Bytecode/StandardLibrary.cpp index 86ce3166..033e5a53 100644 --- a/source/Engine/Bytecode/StandardLibrary.cpp +++ b/source/Engine/Bytecode/StandardLibrary.cpp @@ -9547,7 +9547,7 @@ VMValue Scene_GetDrawGroupEntityDepthSorting(int argCount, VMValue* args, Uint32 } /*** * Scene.GetListPos - * \desc Gets the current list position of the scene. (Deprecated) + * \desc Gets the current list position of the scene. * \return Returns an Integer value. * \ns Scene */ @@ -9605,26 +9605,6 @@ VMValue Scene_GetActiveCategory(int argCount, VMValue* args, Uint32 threadID) { CHECK_ARGCOUNT(0); return INTEGER_VAL(Scene::ActiveCategory); } -/*** - * Scene.GetCategoryCount - * \desc Gets the amount of categories in the scene list. (Deprecated; use+
Resources.LoadSpriteByFolder(fallbackFolder, name, unloadPolicy)
+
Resources.LoadImage(filename, unloadPolicy)
@@ -9440,7 +9454,7 @@ null
.690 out of 749 functions have descriptions.
+691 out of 750 functions have descriptions.
diff --git a/source/Engine/Bytecode/StandardLibrary.cpp b/source/Engine/Bytecode/StandardLibrary.cpp
index 033e5a53..5ae5def2 100644
--- a/source/Engine/Bytecode/StandardLibrary.cpp
+++ b/source/Engine/Bytecode/StandardLibrary.cpp
@@ -8401,6 +8401,38 @@ VMValue Resources_LoadSprite(int argCount, VMValue* args, Uint32 threadID) {
resource->AsSprite = new (std::nothrow) ISprite(filename);
return INTEGER_VAL((int)index);
}
+/***
+ * Resources.LoadSpriteByFolder
+ * \desc Loads a Sprite resource via the current Scene's resource folder (else a fallback folder) if a scene list is loaded.
+ * \param fallbackFolder (String): Folder to check if the sprite does not exist in the current Scene's resource folder.
+ * \param name (String): Name of the animation file within the resource folder.
+ * \param unloadPolicy (Integer): Whether to unload the resource at the end of the current Scene, or the game end.
+ * \return Returns the index of the Resource.
+ * \ns Resources
+ */
+VMValue Resources_LoadSpriteByFolder(int argCount, VMValue* args, Uint32 threadID) {
+ CHECK_ARGCOUNT(3);
+
+ char filename[4096];
+ snprintf(filename, sizeof(filename), "Sprites/%s/%s.bin", Scene::CurrentSpriteFolder, GET_ARG(1, GetString));
+ if (!ResourceManager::ResourceExists(filename))
+ snprintf(filename, sizeof(filename), "Sprites/%s/%s.bin", GET_ARG(0, GetString), GET_ARG(1, GetString));
+
+ ResourceType* resource = new (std::nothrow) ResourceType();
+ resource->FilenameHash = CRC32::EncryptString(filename);
+ resource->UnloadPolicy = GET_ARG(2, GetInteger);
+
+ size_t index = 0;
+ bool emptySlot = false;
+ vectorScene
Scene.GetCurrentID
-
Scene.GetCurrentSpriteFolder()
- +
Scene.GetCurrentResourceFolder()
+ +
Math.ToFixed(n)
+ +
Math.FromFixed(n)
+
Math.Sign(n)
@@ -5970,10 +5982,10 @@ -
Resources.LoadSpriteByFolder(fallbackFolder, name, unloadPolicy)
- +
Resources.LoadDynamicSprite(fallbackFolder, name, unloadPolicy)
+ -
Scene.LoadNoPersistency(filename)
- Scene.Load
instead.)-
Scene.LoadPosition([persistency])
- Scene.Load
instead.)
Scene.Change(category, scene)
@@ -6604,13 +6598,6 @@ -
Scene.GetListPos()
- Scene_ListPos
instead.)
Scene.GetCurrentFolder()
@@ -6632,13 +6619,6 @@ -
Scene.GetCurrentSpriteFolder()
- Scene.GetCurrentResourceFolder
instead.)
Scene.GetCurrentCategory()
@@ -6646,13 +6626,6 @@ -
Scene.GetActiveCategory()
- Scene_ActiveCategory
instead.)
Scene.GetDebugMode()
@@ -6786,35 +6759,6 @@ -
Scene.CheckValidScene()
- Scene.IsCurrentEntryValid
instead.)-
Scene.CheckSceneFolder(folder)
- Scene.IsUsingFolder
instead.)-
Scene.CheckSceneID(id)
- Scene.IsUsingID
instead.)
Scene.IsPaused()
@@ -6822,39 +6766,11 @@ -
Scene.SetListPos(sceneNum)
- Scene_ListPos
instead.)-
Scene.SetActiveCategory(categoryNum)
- Scene_ActiveCategory
instead.)
Scene.SetDebugMode()
-
Scene.SetScene(category, scene)
- Scene.Change
instead.)
Scene.SetTile(layer, cellX, cellY, tileID, flipX, flipY[, collisionMaskA, collisionMaskB])
@@ -9567,7 +9483,7 @@ null
.694 out of 753 functions have descriptions.
+691 out of 750 functions have descriptions.
@@ -9663,20 +9579,6 @@
-
instance.ReturnHitboxFromSprite(sprite, animation, frame, hitbox)
-
instance.CollideWithObject(other)
@@ -9824,7 +9726,7 @@ instance.StopAllSounds()
25 out of 25 methods have descriptions.
+24 out of 24 methods have descriptions.
From 3904e6fb6ed34f3f87df93460bba3b7a21da5d4a Mon Sep 17 00:00:00 2001
From: Axanery <41282531+Axanery@users.noreply.github.com>
Date: Mon, 10 Jun 2024 17:05:24 -0500
Subject: [PATCH 19/23] Add ATan functionality
---
meta/win/lib/msvc/x86/assimp-vc143-mt.lib | Bin 0 -> 398692 bytes
source/Engine/Bytecode/ScriptEntity.cpp | 45 +++++++++++++++++++++
source/Engine/Bytecode/ScriptManager.cpp | 1 +
source/Engine/Bytecode/StandardLibrary.cpp | 14 ++++++-
source/Engine/Math/Math.cpp | 38 ++++++++++++++++-
5 files changed, 96 insertions(+), 2 deletions(-)
create mode 100644 meta/win/lib/msvc/x86/assimp-vc143-mt.lib
diff --git a/meta/win/lib/msvc/x86/assimp-vc143-mt.lib b/meta/win/lib/msvc/x86/assimp-vc143-mt.lib
new file mode 100644
index 0000000000000000000000000000000000000000..6a21fe5d1db7906701ee3dbe148e6779e8213b32
GIT binary patch
literal 398692
zcmeFa378yJ^*(&7Zq)!0Vpzl&5fLLIvSc&Fh;+{uGGUSonaKhoLuaOwbeQQLdwRkI
z5fCFHA|OUYL_|bHj0lK;0oe>&*didru!TiL#DIW+5ySVMd#k!`RoB`*neh96=6T+y
zGgW81=bpPS^|3=T#jYiXjyPy9_rC+iyZ^TT8fX1y{DkonryNXw96N%s?Y_tOZ_i@<
z`t^+eZg*zx^e8hvzC>d0HOv6`BQpey9nWC|{>WMZW6~BzFrT?ofZzEhlNgI%;I0z|
zjQwXZ0pmPo0Q?V3;`S352aHc$U||$~M=^fK#R7(TJ|plu#z?F=mvO-OH0% *P$=|Rjgh~ngi>`IFFL9g;l~s!sXs
zph#1d V8LcfnD5i8DN{U b@nAC U%!)E{_JEZ2-KWgTThb)S~Beu2#+B;JG#gw1bTI2FIZTd<$7
z?d(E$|m7f@DOgfQ{si)m_hgp>IXv46B0`gWd@-K<)5&mPa-#h83LE$7dY;8iNh8!
zgK*sniQg8P0q`wt0>)vG3-HHZ5->(hWd#1jQUT-ON0`8<)p)*|nSaBMK=!%{hO=FFi=
zsJGk>vu2svT(OIGeg)?0kfqk0t&PK}m&ObJ3B({Ra7YrDBZhQkJmCyPBIGMP7=vJY
z8SR^rm-af-l-@B&I2q1F()SkW5>$(@KOMk9yVvO8bCc^ZWL4aj)|mr6rCfZ~WXu)O
z5yc)eK$41~-0JJem0C0S;yiUB%H68Y@~tXCGZRS}m7I*LGB{roOQ`gCY!Q_Aas6MD
zP$v=-i3#mM#Lgu#Bj^^D63n7!8Cwi>DC96v@VP&XmKxia$raTP%lm!$4Oh|zkojCh
z`(8FNHMg%DUw{%rqu36l%dwqNwiuXN7gYuO#Wj!*Ci8LMd)UH|x=BvMmM`bKja=Ih;;QEBLr)*Rs
z0y&GIqHAE}Zr&+VIrM<%#CE@gbOP)4A
}U(sIu4)&owX+=GA#b;689z?yg8F7NRo_aO%
z`6`2*@@vHEmGIY{czy?B88JL*=9`ys#b7c|rW47ncajVt6;n-#1mL7Y<{i64fZV}25m1_gFzFcz#6}eWpoiaa
z1OXrl8TZI&4+x0?6?_;G
0SO*<#BA1BG^CQ>(;U}J#@ic(!gZ}$vRF-eAi
z9h~FA4x{tk@0joYVp}ca2y_K)r}N8^&My)6>6asj)Zp0)6AQvkM9F$aCF_H+W&+A6
z_6jORzeQLtC<5`?$1Kc(s=?Jq;%ZiO6=2yR=m6UgIncn~oC$vCn!`P-)x^7`EF8+e
z2xQ`_>Mnwh+k|^xXe72OVto?(I=gerazZ>uT2?z~NPjD-htkz|+Np!uk?(S=_LLBe
z;VBT_ujNLJS~D3imOiJqU