Skip to content

Commit

Permalink
Fixed a warning with the terrain model facecount.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilchRatchet committed Feb 7, 2024
1 parent 84a8b20 commit 35018c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LibReplanetizer/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public int vertexCount
}

[Category("Attributes"), DisplayName("Face Count")]
public int faceCount
public virtual int faceCount
{
get
{
Expand Down
12 changes: 10 additions & 2 deletions LibReplanetizer/Models/TerrainModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ public class TerrainModel : Model
private static short STATIC_ID = 0;

public List<int> lights = new List<int>();
int faceCount;

private int _faceCount;
public override int faceCount
{
get
{
return _faceCount;
}
}
public TerrainModel(FileStream fs, TerrainHead head, byte[] tfragBlock, int num)
{
id = GetIDAssigned();
Expand All @@ -36,7 +44,7 @@ public TerrainModel(FileStream fs, TerrainHead head, byte[] tfragBlock, int num)
int faceStart = ReadInt(ReadBlock(fs, texturePointer + 4, 4), 0);

textureConfig = GetTextureConfigs(fs, texturePointer, textureCount, 0x10, true);
faceCount = GetFaceCount();
_faceCount = GetFaceCount();

vertexBuffer = GetVertices(fs, head.vertexPointers[slotNum] + vertexIndex * 0x1C, head.uvPointers[slotNum] + vertexIndex * 0x08, vertexCount, 0x1C, 0x08);
indexBuffer = GetIndices(fs, head.indexPointers[slotNum] + faceStart * 2, faceCount, vertexIndex);
Expand Down

0 comments on commit 35018c3

Please sign in to comment.