1
0
Fork 0

Adjust for the api

This commit is contained in:
Booklordofthedings 2024-11-19 19:49:21 +01:00
parent a3e655583b
commit c06c70a3ff
4 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,5 @@
FileVersion = 1 FileVersion = 1
Dependencies = {corlib = "*", raylib-beef = "*", Theater-ECS = "*"} Dependencies = {corlib = "*", Theater-ECS = "*", raylib-beef = "*"}
[Project] [Project]
Name = "Theater-ECS-Example" Name = "Theater-ECS-Example"

View file

@ -1,5 +1,5 @@
FileVersion = 1 FileVersion = 1
Projects = {Theater-ECS-Example = {Path = "."}, raylib-beef = {Path = "../../Program Files/BeefLang/BeefLibs/raylib-beef/raylib-beef"}, Theater-ECS = {Path = "../Theater-ECS"}} Projects = {Theater-ECS-Example = {Path = "."}, Theater-ECS = {Path = "../Theater-ECS"}, raylib-beef = {Path = "../raylib-beef/raylib-beef"}}
[Workspace] [Workspace]
StartupProject = "Theater-ECS-Example" StartupProject = "Theater-ECS-Example"

View file

@ -8,9 +8,11 @@ class MovementSystem : System
{ {
RegisterComponent<Position>(ecs); RegisterComponent<Position>(ecs);
RegisterComponent<Velocity>(ecs); RegisterComponent<Velocity>(ecs);
Run_2 = => RunFunction;
} }
public override void Run(void* pos, void* vel) public static void RunFunction(void* pos, void* vel)
{ {
var mPos = ((Position*)pos); var mPos = ((Position*)pos);

View file

@ -10,9 +10,11 @@ class RendererSystem : System
{ {
RegisterComponent<Position>(ecs); RegisterComponent<Position>(ecs);
RegisterComponent<Sprite>(ecs); RegisterComponent<Sprite>(ecs);
Run_2 = => RunFunction;
} }
public override void Run(void* pos, void* sprite) public static void RunFunction(void* pos, void* sprite)
{ {
var toDraw = (Position*)pos; var toDraw = (Position*)pos;
Raylib.DrawTexture(((Sprite*)sprite).sprite, (.)toDraw.x, (.)toDraw.y, Raylib.WHITE); Raylib.DrawTexture(((Sprite*)sprite).sprite, (.)toDraw.x, (.)toDraw.y, Raylib.WHITE);