Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Source.Common/Formats/BSP/BSPFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public static class BSPFileCommon
public const int MAX_DISP_CORNER_NEIGHBORS = 4;

public const int MAX_MAP_MODELS = 4096;
public const int MAX_MAP_BRUSHES = 16384;
public const int MAX_MAP_BRUSHES = 65535;
public const int MAX_MAP_ENTITIES = 8192;
public const int MAX_MAP_TEXINFO = 32768;
public const int MAX_MAP_TEXDATA = 8192;
public const int MAX_MAP_DISPINFO = 2048;
public const int MAX_MAP_DISPINFO = 16384;
public const int MAX_MAP_DISP_VERTS = (MAX_MAP_DISPINFO * ((1 << MAX_MAP_DISP_POWER) + 1) * ((1 << MAX_MAP_DISP_POWER) + 1));
public const int MAX_MAP_DISP_TRIS = ((1 << MAX_MAP_DISP_POWER) * (1 << MAX_MAP_DISP_POWER) * 2);
public const int MAX_DISPVERTS = ((1 << MAX_MAP_DISP_POWER) + 1) * ((1 << MAX_MAP_DISP_POWER) + 1);
Expand All @@ -46,7 +46,7 @@ public static class BSPFileCommon
public const int MAX_MAP_AREAPORTALS = 1024;
public const int MAX_MAP_PLANES = 65536;
public const int MAX_MAP_NODES = 65536;
public const int MAX_MAP_BRUSHSIDES = 163840;
public const int MAX_MAP_BRUSHSIDES = 655350;
public const int MAX_MAP_LEAFS = 65536;
public const int MAX_MAP_VERTS = 65536;
public const int MAX_MAP_VERTNORMALS = 256000;
Expand All @@ -62,7 +62,7 @@ public static class BSPFileCommon
public const int MAX_MAP_SURFEDGES = 512000;
public const int MAX_MAP_LIGHTING = 0x1000000;
public const int MAX_MAP_VISIBILITY = 0x1000000;
public const int MAX_MAP_TEXTURES = 1024;
public const int MAX_MAP_TEXTURES = 8192;
public const int MAX_MAP_WORLDLIGHTS = 8192;
public const int MAX_MAP_CUBEMAPSAMPLES = 1024;
public const int MAX_MAP_OVERLAYS = 8192;
Expand Down
3 changes: 2 additions & 1 deletion Source.Engine/DispMapload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ public static bool DispInfo_LoadDisplacements(Model world, MaterialSystem_SortIn

DispInfo_ReleaseMaterialSystemObjects(world);

Span<BSPDDispInfo> tempDisps = stackalloc BSPDDispInfo[BSPFileCommon.MAX_MAP_DISPINFO];
ErrorIfNot(numDisplacements <= BSPFileCommon.MAX_MAP_DISPINFO, $"DispInfo_LoadDisplacements: too many displacements ({numDisplacements})");
Span<BSPDDispInfo> tempDisps = new BSPDDispInfo[numDisplacements];
dispInfos.LoadLumpData(tempDisps);

DispInfo_LinkToParentFaces(world, tempDisps, numDisplacements);
Expand Down
Loading