"Fix" warnings

This commit is contained in:
Simon Lübeß
2026-08-16 20:11:36 +02:00
parent 39d78ab4c1
commit 2a90374b5b
25 changed files with 53 additions and 45 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ namespace GlitchyEngine.Content
for (var mesh in modelData.Meshes)
{
var name = StringView(mesh.Name);
//var name = StringView(mesh.Name);
//if (name == meshName)
{
@@ -616,7 +616,7 @@ namespace GlitchyEngine.Content
CGLTF.AccessorReadFloat(accessor, (uint)index, (float*)&result, 16);
case typeof(uint16):
CGLTF.AccessorReadUint(accessor, (uint)index, (uint32*)&result, 2);
case default:
default:
uint8* data = (uint8*)accessor.BufferView.Buffer.Data;
data += accessor.BufferView.Offset;
+5 -1
View File
@@ -15,7 +15,11 @@ class TextureLoader : IProcessedAssetLoader
Format pixelFormat = Try!(dataStream.Read<Format>());
uint32 width = Try!(dataStream.Read<uint32>());
uint32 height = Try!(dataStream.Read<uint32>());
uint32 depth = Try!(dataStream.Read<uint32>());
// TODO: We don't need the depth-value?
//uint32 depth =
Try!(dataStream.Read<uint32>());
uint32 arraySize = Try!(dataStream.Read<uint32>());
uint32 mipMapCount = Try!(dataStream.Read<uint32>());
bool isCubemap = Try!(dataStream.Read<bool>());
@@ -0,0 +1,10 @@
using System;
using GlitchyEngine.Math;
namespace Box2D;
extension b2Color
{
[Inline]
#unwarn
public static explicit operator ColorRGBA(b2Color color) => ColorRGBA(color.r, color.g, color.b, color.a);
}
-5
View File
@@ -929,10 +929,5 @@ static
return (int64)gcd((uint64)Math.Abs(u), (uint64)Math.Abs(v));
}
public static this()
{
int64 i = (int64)gcd(38, 123);
}
#endregion
}
+1 -1
View File
@@ -476,7 +476,7 @@ public struct Matrix
float3 right = normalize(cross(up, forward));
float3 newUp = normalize(cross(forward, right));
//float3 newUp = normalize(cross(forward, right));
Matrix result = .Identity;
@@ -68,7 +68,7 @@ namespace GlitchyEngine.Renderer
uint32 backBufferCount = 2;
Format backBufferFormat = .R8G8B8A8_UNorm;
Format backBufferViewFormat = .R8G8B8A8_UNorm; // _SRGB
//Format backBufferViewFormat = .R8G8B8A8_UNorm; // _SRGB
if(nativeSwapChain != null)
{
@@ -335,7 +335,7 @@ namespace GlitchyEngine.Renderer
{
Debug.Profiler.ProfileResourceFunction!();
SubresourceData resData = .(data, linePitch, slicePitch);
//SubresourceData resData = .(data, linePitch, slicePitch);
// If data is null, set subresourceData null
SubresourceData* resDataPtr = null;//data == null ? null : &resData;
@@ -131,7 +131,7 @@ namespace GlitchyEngine
keycode = VK_XBUTTON1;
case .XButton2:
keycode = VK_XBUTTON2;
case default:
default:
return false;
}
+2 -2
View File
@@ -1205,12 +1205,12 @@ namespace GlitchyEngine.Renderer
#endif
Runtime.FatalError("Circle renderer currently broken, do we need it?");
QueueCircleInstance(transform, color, texture, null, transform.Translation.Z, uvTransform, innerRadius, entityId);
/*QueueCircleInstance(transform, color, texture, null, transform.Translation.Z, uvTransform, innerRadius, entityId);
if(s_drawOrder == .Immediate)
{
DrawDeferred();
}
}*/
}
public struct Statistics
@@ -242,7 +242,7 @@ namespace GlitchyEngine.Renderer.Text
StyleStack<bool> richTextStack = scope .(true);
// TODO: color stack not used?!
StyleStack<ColorRGBA> fontColorStack = scope .(textRenderer.Color);
//StyleStack<ColorRGBA> fontColorStack = scope .(textRenderer.Color);
StyleStack<float> fontSizeStack = scope .(textRenderer.FontSize);
@@ -117,8 +117,6 @@ struct EngineFunctionsGeneratorAttribute : Attribute, IComptimeTypeApply
{
String parameters = new String();
StringView str = method.Name;
for (int i < method.ParamCount)
{
if (i != 0)
@@ -247,6 +247,7 @@ class SerializedObject
static T GetFieldDataAs<T>(FieldData fieldData)
{
#unwarn
return *(T*)&fieldData.RawData;
}
@@ -323,7 +324,7 @@ class SerializedObject
Serialize.Value(writer, ValueView(typeof(StringView), &dataView), environment);
case .EngineObjectReference:
writer.Type("EngineObject");
if (field.Data.EngineObject.FullTypeName != null)
if (field.Data.EngineObject.FullTypeName.IsEmpty)
writer.Type((StringView)field.Data.ListEngineObject.FullTypeName);
Serialize.Value(writer, field.Data.EngineObject.ID, environment);
case .ObjectReference:
+7 -7
View File
@@ -322,12 +322,12 @@ namespace GlitchyEngine.World
let start = vertices[i - 1];
let end = vertices[i];
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f), *(ColorRGBA*)&color);
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f), (ColorRGBA)color);
}
let start = vertices[vertexCount - 1];
let end = vertices[0];
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f), *(ColorRGBA*)&color);
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f),(ColorRGBA)color);
};
draw.drawSolidPolygonCallback = (vertices, vertexCount, color, userData) =>
{
@@ -336,20 +336,20 @@ namespace GlitchyEngine.World
let start = vertices[i - 1];
let end = vertices[i];
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f), *(ColorRGBA*)&color);
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f),(ColorRGBA)color);
}
let start = vertices[vertexCount - 1];
let end = vertices[0];
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f), *(ColorRGBA*)&color);
Renderer2D.DrawLine(float3(start.x, start.y, 0.0f), float3(end.x, end.y, 0.0f),(ColorRGBA)color);
};
draw.drawCircleCallback = (center, radius, color, userData) =>
{
Renderer2D.DrawCircle(center, radius.XX, *(ColorRGBA*)&color, 0.1f);
Renderer2D.DrawCircle(center, radius.XX, (ColorRGBA)color, 0.1f);
};
draw.drawSolidCircleCallback = (center, radius, axis, color, userData) =>
{
Renderer2D.DrawCircle(center, radius.XX, *(ColorRGBA*)&color);
Renderer2D.DrawCircle(center, radius.XX, (ColorRGBA)color);
};
draw.drawSegmentCallback = (p1, p2, color, userData) =>
{
@@ -723,7 +723,7 @@ namespace GlitchyEngine.World
b2Body* body = rigidbody.RuntimeBody;
b2Vec2 position = Box2D.Body.GetPosition(body);
float angle = Box2D.Body.GetAngle(body);
//float angle = Box2D.Body.GetAngle(body);
b2Transform bodyTransform = Box2D.Body.GetTransform(body);
float cos = sqrt((1 + bodyTransform.q.c) / 2);