Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Jan 14, 2023
1 parent 481d9d3 commit f98c8b3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public Snooper SnooperViewer
{
return Application.Current.Dispatcher.Invoke(delegate
{
return _snooper ??= new Snooper(GameWindowSettings.Default,
return _snooper ??= new Snooper(
new GameWindowSettings { RenderFrequency = 240 },
new NativeWindowSettings
{
Size = new OpenTK.Mathematics.Vector2i(
Expand Down
1 change: 0 additions & 1 deletion FModel/Views/Snooper/Lights/PointLight.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using CUE4Parse.UE4.Assets.Exports;
using CUE4Parse.UE4.Objects.Core.Math;
using CUE4Parse.UE4.Objects.Core.Misc;
using FModel.Views.Snooper.Shading;
using ImGuiNET;
Expand Down
1 change: 0 additions & 1 deletion FModel/Views/Snooper/Lights/SpotLight.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using CUE4Parse.UE4.Assets.Exports;
using CUE4Parse.UE4.Objects.Core.Math;
using CUE4Parse.UE4.Objects.Core.Misc;
using FModel.Views.Snooper.Shading;
using ImGuiNET;
Expand Down
6 changes: 3 additions & 3 deletions FModel/Views/Snooper/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ protected Model(UObject export)
Type = export.ExportType;
UvCount = 1;
Box = new FBox(new FVector(-2f), new FVector(2f));
Sockets = Array.Empty<Socket>();
Morphs = Array.Empty<Morph>();
Transforms = new List<Transform>();
}

Expand All @@ -97,8 +99,6 @@ public Model(UStaticMesh export, CStaticMesh staticMesh, Transform transform) :
if (export.Sockets[i].Load<UStaticMeshSocket>() is not { } socket) continue;
Sockets[i] = new Socket(socket, Transforms[0]);
}

Morphs = Array.Empty<Morph>();
}

public Model(USkeletalMesh export, CSkeletalMesh skeletalMesh) : this(export, skeletalMesh, Transform.Identity) {}
Expand Down Expand Up @@ -301,7 +301,7 @@ public void SetupInstances()
public void Setup(Options options)
{
_handle = GL.CreateProgram();
var broken = GL.GetInteger(GetPName.MaxTextureUnits) == 0;
var broken = GL.GetInteger(GetPName.MaxTextureCoords) == 0;

_ebo = new BufferObject<uint>(Indices, BufferTarget.ElementArrayBuffer);
_vbo = new BufferObject<float>(Vertices, BufferTarget.ArrayBuffer);
Expand Down
2 changes: 1 addition & 1 deletion FModel/Views/Snooper/Shading/Shader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private int LoadShader(ShaderType type, string file)
var handle = GL.CreateShader(type);

var content = reader.ReadToEnd();
if (file.Equals("default.frag") && GL.GetInteger(GetPName.MaxTextureUnits) == 0)
if (file.Equals("default.frag") && GL.GetInteger(GetPName.MaxTextureCoords) == 0)
content = content.Replace("#define MAX_UV_COUNT 8", "#define MAX_UV_COUNT 1");

GL.ShaderSource(handle, content);
Expand Down

0 comments on commit f98c8b3

Please sign in to comment.