Last change
on this file since 336 was 331, checked in by alloc, 6 years ago |
Major allocation and execution time improvements on the map rendering code
|
File size:
908 bytes
|
Rev | Line | |
---|
[325] | 1 | using AllocsFixes.NetConnections.Servers.Web;
|
---|
| 2 | using AllocsFixes.NetConnections.Servers.Web.Handlers;
|
---|
[224] | 3 |
|
---|
[331] | 4 | namespace AllocsFixes {
|
---|
[324] | 5 | public class API : IModApi {
|
---|
[325] | 6 | public void InitMod () {
|
---|
| 7 | ModEvents.GameAwake.RegisterHandler (GameAwake);
|
---|
| 8 | ModEvents.GameStartDone.RegisterHandler (GameStartDone);
|
---|
| 9 | ModEvents.GameShutdown.RegisterHandler (GameShutdown);
|
---|
| 10 | ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
|
---|
| 11 | }
|
---|
| 12 |
|
---|
[324] | 13 | private void GameAwake () {
|
---|
| 14 | // ReSharper disable once ObjectCreationAsStatement
|
---|
[325] | 15 | new Web ();
|
---|
[326] | 16 | LogBuffer.Init ();
|
---|
[224] | 17 | }
|
---|
| 18 |
|
---|
[324] | 19 | private void GameStartDone () {
|
---|
[325] | 20 | if (ItemIconHandler.Instance != null) {
|
---|
| 21 | ItemIconHandler.Instance.LoadIcons ();
|
---|
[291] | 22 | }
|
---|
| 23 | }
|
---|
[267] | 24 |
|
---|
[324] | 25 | private void GameShutdown () {
|
---|
[299] | 26 | AllocsFixes.MapRendering.MapRendering.Shutdown ();
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[324] | 29 | private void CalcChunkColorsDone (Chunk _chunk) {
|
---|
[224] | 30 | AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
[325] | 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.