mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
RenderTargetGroup GetData, Shader uint support
This commit is contained in:
@@ -8,7 +8,7 @@ namespace GlitchyEngine.World
|
||||
{
|
||||
public class EcsWorld
|
||||
{
|
||||
const int MaxEntities = 1024;
|
||||
const int MaxEntities = 16348;
|
||||
|
||||
internal typealias BitmaskEntry = (EcsEntity ID, BitArray ComponentMask);
|
||||
internal List<BitmaskEntry> _entities = new .();
|
||||
@@ -149,6 +149,28 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether the given entity is valid or not.
|
||||
public bool IsValid(EcsEntity entity)
|
||||
{
|
||||
if(entity.Index > _entities.Count)
|
||||
return false;
|
||||
|
||||
var listEntity = ref _entities[entity.Index];
|
||||
|
||||
return entity == listEntity.ID;
|
||||
}
|
||||
|
||||
/// Returns the entity with the same ID and the current version. Or null, if no such entity exists.
|
||||
public EcsEntity? GetCurrentVersion(EcsEntity entity)
|
||||
{
|
||||
if(entity.Index > _entities.Count)
|
||||
return null;
|
||||
|
||||
var listEntity = ref _entities[entity.Index];
|
||||
|
||||
return listEntity.ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns a component of type T to the specified entity and returns it.
|
||||
*/
|
||||
@@ -208,7 +230,7 @@ namespace GlitchyEngine.World
|
||||
|
||||
listEntity.ComponentMask[entry.Id] = false;
|
||||
}
|
||||
|
||||
|
||||
public void RemoveComponent<T>(EcsEntity entity) where T : struct, new, IDisposableComponent
|
||||
{
|
||||
if(entity.Index > _entities.Count)
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace GlitchyEngine.World
|
||||
{
|
||||
}
|
||||
|
||||
public void UpdateRuntime(GameTime gameTime, RenderTarget2D finalTarget)
|
||||
public void UpdateRuntime(GameTime gameTime, RenderTargetGroup finalTarget)
|
||||
{
|
||||
Debug.Profiler.ProfileRendererFunction!();
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEditor(GameTime gameTime, EditorCamera camera, RenderTarget2D viewportTarget, delegate void() DebugDraw3D, delegate void() DrawDebug2D)
|
||||
public void UpdateEditor(GameTime gameTime, EditorCamera camera, RenderTargetGroup viewportTarget, delegate void() DebugDraw3D, delegate void() DrawDebug2D)
|
||||
{
|
||||
Debug.Profiler.ProfileRendererFunction!();
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace GlitchyEngine.World
|
||||
|
||||
for (var (entity, transform, mesh, meshRenderer) in _ecsWorld.Enumerate<TransformComponent, MeshComponent, MeshRendererComponent>())
|
||||
{
|
||||
Renderer.Submit(mesh.Mesh, meshRenderer.Material, transform.WorldTransform);
|
||||
Renderer.Submit(mesh.Mesh, meshRenderer.Material, entity, transform.WorldTransform);
|
||||
}
|
||||
|
||||
for (var (entity, transform, light) in _ecsWorld.Enumerate<TransformComponent, LightComponent>())
|
||||
|
||||
Reference in New Issue
Block a user