diff --git a/Capy64/Runtime/Objects/GPUBuffer.cs b/Capy64/Runtime/Objects/GPUBuffer.cs index 7b5540f..111f50c 100644 --- a/Capy64/Runtime/Objects/GPUBuffer.cs +++ b/Capy64/Runtime/Objects/GPUBuffer.cs @@ -14,6 +14,7 @@ // limitations under the License. using Capy64.API; +using Capy64.Core; using KeraLua; using System; @@ -59,11 +60,24 @@ public class GPUBuffer : IComponent new(), }; + private static IGame _game; + public GPUBuffer(IGame game) { + _game = game; + } + public void LuaInit(Lua L) { CreateMeta(L); } + public static uint GetColor(uint color) + { + if(_game.EngineMode == EngineMode.Classic) + return ColorPalette.GetColor(color); + + return color; + } + public static void CreateMeta(Lua L) { L.NewMetaTable(ObjectType); @@ -142,6 +156,7 @@ public class GPUBuffer : IComponent } var value = (uint)L.ToInteger(3); + value = GetColor(value); // RGB to ABGR value =