mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Convert color in GPUBuffer
This commit is contained in:
parent
e941a481ea
commit
2f604f3b42
1 changed files with 15 additions and 0 deletions
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue