mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Lazy allocate
This commit is contained in:
parent
8150ff22ff
commit
d05f4ab214
@ -63,7 +63,7 @@
|
||||
<DebugType>None</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE;USE_DX;USE16_BIT</DefineConstants>
|
||||
<DefineConstants>TRACE;USE_DX;</DefineConstants>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
<StartAction>Project</StartAction>
|
||||
</PropertyGroup>
|
||||
|
@ -71,11 +71,7 @@ namespace ClassicalSharp {
|
||||
WorldEvents.OnNewMapLoaded += OnNewMapLoadedCore;
|
||||
Events.TextureChanged += TextureChangedCore;
|
||||
|
||||
#if USE16_BIT
|
||||
BlockInfo.Allocate(768);
|
||||
#else
|
||||
BlockInfo.Allocate(256);
|
||||
#endif
|
||||
BlockInfo.Init();
|
||||
|
||||
ModelCache = new ModelCache(this);
|
||||
|
@ -79,6 +79,10 @@ namespace ClassicalSharp.Network {
|
||||
|
||||
net.reader.ExtendedBlocks = true;
|
||||
net.writer.ExtendedBlocks = true;
|
||||
if (BlockInfo.Count < 768) {
|
||||
BlockInfo.Allocate(768);
|
||||
BlockInfo.Reset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user