-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNixelWrapperCS.cs
More file actions
4526 lines (3791 loc) · 148 KB
/
Copy pathNixelWrapperCS.cs
File metadata and controls
4526 lines (3791 loc) · 148 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// E:\Graphine Granite Toolset\NixelWrapperCS.dll
// NixelWrapperCS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Global type: <Module>
// Architecture: x64
// Runtime: v4.0.30319
// Hash algorithm: SHA1
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Graphine.Core;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("Graphine NV")]
[assembly: AssemblyProduct("Granite SDK")]
[assembly: AssemblyCopyright("Copyright Graphine NV © 2013-2017")]
[assembly: AssemblyInformationalVersion("5.0.0.34144")]
[assembly: AssemblyDescription("Generated by cholleme@ZELDA from master/9a8e2032016ca90aea9bc098289abc7dc1f56d8c")]
[assembly: AssemblyTitle("NixelWrapperCS")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fce57ce5-5771-415c-927a-97ba7bb34616")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Nixel
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct TiledTopology
{
public uint width;
public uint height;
public uint numLevels;
public uint numLayers;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public DataType[] dataType;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public Color[] defaultLayerColors;
public TiledTopology(uint width, uint height, uint numLayers)
{
this.width = width;
this.height = height;
this.numLayers = numLayers;
uint num = ((width < height) ? width : height);
uint num2 = 0u;
do
{
num >>= 1;
num2++;
}
while (num != 0);
numLevels = num2;
dataType = new DataType[4];
defaultLayerColors = new Color[4];
}
public uint GetLevelWidth(uint level)
{
if (level >= numLevels)
{
return 0u;
}
uint num = width / (uint)Math.Pow(2.0, level);
if (num == 0)
{
num = 1u;
}
return num;
}
public uint GetLevelHeight(uint level)
{
if (level >= numLevels)
{
return 0u;
}
uint num = height / (uint)Math.Pow(2.0, level);
if (num == 0)
{
num = 1u;
}
return num;
}
public bool IsEqual(ref TiledTopology tiledObject)
{
if (tiledObject.width != width || tiledObject.height != height || tiledObject.numLayers != numLayers || tiledObject.numLevels != numLevels)
{
return false;
}
for (int i = 0; i < 4; i++)
{
if (tiledObject.dataType[i] != dataType[i])
{
return false;
}
}
return true;
}
public bool IsValidTile(ref TileId tid)
{
if (tid.level >= numLevels)
{
return false;
}
if (tid.x > GetLevelWidth(tid.level))
{
return false;
}
if (tid.y > GetLevelHeight(tid.level))
{
return false;
}
return true;
}
public bool IsTopTile(ref TileId tid)
{
return tid.y == GetLevelHeight(tid.level) - 1;
}
public bool IsBottomTile(ref TileId tid)
{
return tid.y == 0;
}
public bool IsLeftTile(ref TileId tid)
{
return tid.x == 0;
}
public bool IsRightTile(ref TileId tid)
{
return tid.x == GetLevelWidth(tid.level) - 1;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Color
{
public byte r;
public byte g;
public byte b;
public byte a;
public Color(byte _r, byte _g, byte _b, byte _a)
{
r = _r;
g = _g;
b = _b;
a = _a;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct TileId
{
public uint x;
public uint y;
public uint level;
public TileId(uint tx, uint ty, uint tlevel)
{
x = tx;
y = ty;
level = tlevel;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LayerTileId
{
public uint x;
public uint y;
public uint level;
public uint layer;
public LayerTileId(uint tx, uint ty, uint tlevel, uint tLayer)
{
x = tx;
y = ty;
level = tlevel;
layer = tLayer;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct RasterTileDimension
{
public uint width;
public uint height;
public uint border;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MappedTileLayer
{
public IntPtr data;
public uint rowPitch;
public MappedTileLayer(IntPtr data, uint rowPitch)
{
this.data = data;
this.rowPitch = rowPitch;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MappedTileLayerRead
{
public readonly IntPtr data;
public uint rowPitch;
public float rectX;
public float rectY;
public float rectWidth;
public float rectHeight;
public MappedTileLayerRead(IntPtr data, uint rowPitch, float rectX, float rectY, float rectWidth, float rectHeight)
{
this.data = data;
this.rowPitch = rowPitch;
this.rectX = rectX;
this.rectY = rectY;
this.rectWidth = rectWidth;
this.rectHeight = rectHeight;
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct TileLayerCodingGroup
{
public int id;
public uint layer;
public int codecTypeId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string codingParameters;
public TileLayerCodingGroup(int id)
{
this.id = id;
layer = 0u;
codecTypeId = 0;
codingParameters = "";
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Layout
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] src;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] mask;
public void Init()
{
src = new byte[4];
mask = new byte[4];
for (byte b = 0; b < 4; b = (byte)(b + 1))
{
src[b] = b;
mask[b] = 1;
}
}
public void Set(string strLayoutSrc, string strLayoutMask)
{
Init();
if (Check(strLayoutSrc))
{
for (int i = 0; i < strLayoutSrc.Length; i++)
{
src[i] = (byte)char.GetNumericValue(strLayoutSrc[i]);
}
SetMask(strLayoutMask);
}
}
public void SetMask(string strLayoutMask)
{
if (CheckMask(strLayoutMask))
{
for (int i = 0; i < strLayoutMask.Length; i++)
{
mask[i] = (byte)char.GetNumericValue(strLayoutMask[i]);
}
}
}
public bool IsDefault()
{
for (byte b = 0; b < 4; b = (byte)(b + 1))
{
if (src[b] != b)
{
return false;
}
if (mask[b] != 1)
{
return false;
}
}
return true;
}
public void CorrectForBGR()
{
byte b = src[2];
src[2] = src[0];
src[0] = b;
}
public bool Swizzle(string swizzle)
{
if (!Check(swizzle))
{
return false;
}
byte[] array = new byte[4];
Array.Copy(src, array, 4);
for (int i = 0; i < swizzle.Length; i++)
{
src[i] = array[int.Parse(swizzle[i].ToString())];
}
return true;
}
private bool Check(string strLayout)
{
if (strLayout == null)
{
return false;
}
if (strLayout.Length > 4)
{
return false;
}
for (int i = 0; i < strLayout.Length; i++)
{
if (!char.IsNumber(strLayout[i]))
{
return false;
}
if (int.Parse(strLayout[i].ToString()) < 0 || int.Parse(strLayout[i].ToString()) >= 4)
{
return false;
}
}
return true;
}
private bool CheckMask(string strLayoutMask)
{
if (strLayoutMask == null)
{
return false;
}
if (strLayoutMask.Length > 4)
{
return false;
}
for (int i = 0; i < strLayoutMask.Length; i++)
{
if (strLayoutMask[i] != '0' && strLayoutMask[i] != '1')
{
return false;
}
}
return true;
}
public string Get()
{
string text = "";
for (int i = 0; i < 4; i++)
{
text += src[i];
}
return text;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct FlatTileInfo
{
public uint totalSize;
public uint dataSize;
public uint pageFileId;
public uint pageId;
public ulong dataOffset;
public uint codec;
public uint parameterBlock;
public uint flatTileId;
[MarshalAs(UnmanagedType.I1)]
public bool bNoDataTile;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct TileInfo
{
public uint totalTileSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public FlatTileInfo[] layerTile;
public void Init()
{
layerTile = new FlatTileInfo[4];
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct GtsInfo
{
[MarshalAs(UnmanagedType.Struct)]
public GraphineGuid guid;
public uint pagesize;
public uint numPages;
public uint numPageFiles;
public uint numParameterBlocks;
public uint numTiles;
public uint numFlatTiles;
[MarshalAs(UnmanagedType.I4)]
public TileFileType type;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct BuildHeader
{
[MarshalAs(UnmanagedType.Struct)]
public GraphineGuid guid;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct TileOrderItem
{
public TileId tileId;
public uint fileId;
public TileOrderItem(TileId tid, uint fid)
{
tileId = tid;
fileId = fid;
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct BuilderSettings
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string gtsFilename;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string pagesDirectoryPath;
public uint pageSize;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct RebuilderSettings
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string gtsFilename;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string pagesDirectoryPath;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string sharedMipRasterFilename;
[MarshalAs(UnmanagedType.I1)]
public bool useRedirection;
[MarshalAs(UnmanagedType.I1)]
public bool useMipStripping;
[MarshalAs(UnmanagedType.I1)]
public bool buildGTSForGTex;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct SoupBuilderSettings
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string soupFilename;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string soupPatchSourceFilename;
[MarshalAs(UnmanagedType.I1)]
public bool patchMode;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct BuildReport
{
[MarshalAs(UnmanagedType.Struct)]
public GraphineGuid guid;
public ulong slack;
public uint numPageFiles;
public uint numPages;
public uint pageSize;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Thumbnail
{
[MarshalAs(UnmanagedType.Struct)]
public GraphineGuid Identifier;
public uint width;
public uint height;
public readonly IntPtr rgbaData;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct PageFileInfo
{
[MarshalAs(UnmanagedType.I1)]
public bool loaded;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string name;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string filename;
public uint checksumHeader0;
public uint checksumHeader1;
public uint checksumHeader2;
public uint checksumHeader3;
public uint checksumFile0;
public uint checksumFile1;
public uint checksumFile2;
public uint checksumFile3;
public uint numPages;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct PagingSettings
{
[MarshalAs(UnmanagedType.I1)]
public bool autoPagesize;
public uint pagesize;
public uint blockSize;
public uint targetDisk;
public int pagingStrategy;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CodecLogInfo
{
[MarshalAs(UnmanagedType.LPWStr)]
public string codec;
[MarshalAs(UnmanagedType.LPWStr)]
public string file;
public int line;
[MarshalAs(UnmanagedType.LPWStr)]
public string callstack;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct ErrorInfo
{
[MarshalAs(UnmanagedType.LPWStr)]
public string file;
public int line;
[MarshalAs(UnmanagedType.LPWStr)]
public string function;
public int code;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string message;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct LibraryVersionInfo
{
public int major;
public int minor;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string buildUser;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string buildHost;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string buildGitBranch;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string buildGitHash;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct NixelInitializationInfo
{
public int value1;
public int value2;
public int value3;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string value4;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct PackedSoupFile
{
public uint packedX;
public uint packedY;
public uint packedWidth;
public uint packedHeight;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string soupFilePath;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string relativeSoupFilePath;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string assetName;
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum BorderMode
{
Neighbor,
Clamp,
Repeat
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum BuildAction
{
Continue,
Stop
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum BuildMode
{
Fast,
High
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum BuildPass
{
Pre,
SharedMipRasterizing,
SharedMipMipMapping,
RedirectionMappingSetup,
WriteEncode,
Post,
RedirectionMapping,
FinishPaging
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum CancelResult
{
Continue,
Cancel
}
public enum Enum
{
Default,
GTPPerLevel,
GTPPerGTex
}
[Obfuscation(Exclude = true, ApplyToMembers = true)]
public enum Error
{
Ok,
InvalidParameter,
OutOfRange,
InvalidDimensions,
Pagesize,
InvalidState,
OutOfMemory,
IoBadPath,
IoFileNotFound,
IoDiskFull,
IoAccessDenied,
IoLocked,
IoUnknown,
Graphics,
WouldBlock,
CacheFull,
NoData,
HasData,
InvalidLayerData,
NotYetImplemented,
InvalidPageFile,
InvalidGtsFile,
InvalidSoupFile,
InvalidSoupIndex,
InvalidSoupCoding,
InvalidCacheFile,
InvalidRasterIndex,
InvalidHeader,
InvalidVersion,
MissingMetadata,
MissingSoupCoding,
MissingSoupIndex,
MissingRasterIndex,
MissingSoupFile,
InvalidCodingGroupIndex,
InvalidCodecParamter,
BlockCodingError,
InvalidCodecConfiguration,
CodecIOError,
NotEnoughChannels,
TranscoderLoadFailed,
Aborted,
Unknown
}
public class IBuildCallback : IDisposable
{
public delegate void SwigDelegateIBuildCallback_0(int buildPass);
public delegate void SwigDelegateIBuildCallback_1(int buildPass);
public delegate void SwigDelegateIBuildCallback_2(IntPtr tid);
public delegate int SwigDelegateIBuildCallback_3(IntPtr tid, int errorCode);
public delegate int SwigDelegateIBuildCallback_4(IntPtr tid);
private HandleRef swigCPtr;
protected bool swigCMemOwn;
private SwigDelegateIBuildCallback_0 swigDelegate0;
private SwigDelegateIBuildCallback_1 swigDelegate1;
private SwigDelegateIBuildCallback_2 swigDelegate2;
private SwigDelegateIBuildCallback_3 swigDelegate3;
private SwigDelegateIBuildCallback_4 swigDelegate4;
private static Type[] swigMethodTypes0 = new Type[1] { typeof(BuildPass) };
private static Type[] swigMethodTypes1 = new Type[1] { typeof(BuildPass) };
private static Type[] swigMethodTypes2 = new Type[1] { typeof(LayerTileId) };
private static Type[] swigMethodTypes3 = new Type[2]
{
typeof(LayerTileId),
typeof(Error)
};
private static Type[] swigMethodTypes4 = new Type[1] { typeof(LayerTileId) };
internal IBuildCallback(IntPtr cPtr, bool cMemoryOwn)
{
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
internal static HandleRef getCPtr(IBuildCallback obj)
{
return obj?.swigCPtr ?? new HandleRef(null, IntPtr.Zero);
}
~IBuildCallback()
{
Dispose();
}
public virtual void Dispose()
{
lock (this)
{
if (swigCPtr.Handle != IntPtr.Zero)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
NixelWrapperCPPPINVOKE.delete_IBuildCallback(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
GC.SuppressFinalize(this);
}
}
public virtual void StartingPass(BuildPass buildPass)
{
if (SwigDerivedClassHasMethod("StartingPass", swigMethodTypes0))
{
NixelWrapperCPPPINVOKE.IBuildCallback_StartingPassSwigExplicitIBuildCallback(swigCPtr, (int)buildPass);
}
else
{
NixelWrapperCPPPINVOKE.IBuildCallback_StartingPass(swigCPtr, (int)buildPass);
}
}
public virtual void FinishedPass(BuildPass buildPass)
{
if (SwigDerivedClassHasMethod("FinishedPass", swigMethodTypes1))
{
NixelWrapperCPPPINVOKE.IBuildCallback_FinishedPassSwigExplicitIBuildCallback(swigCPtr, (int)buildPass);
}
else
{
NixelWrapperCPPPINVOKE.IBuildCallback_FinishedPass(swigCPtr, (int)buildPass);
}
}
public virtual void OnTileStart(LayerTileId tid)
{
IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LayerTileId)));
Marshal.StructureToPtr((object)tid, intPtr, fDeleteOld: false);
try
{
if (SwigDerivedClassHasMethod("OnTileStart", swigMethodTypes2))
{
NixelWrapperCPPPINVOKE.IBuildCallback_OnTileStartSwigExplicitIBuildCallback(swigCPtr, intPtr);
}
else
{
NixelWrapperCPPPINVOKE.IBuildCallback_OnTileStart(swigCPtr, intPtr);
}
}
finally
{
Marshal.FreeHGlobal(intPtr);
}
}
public virtual BuildAction OnTileFailed(LayerTileId tid, Error errorCode)
{
IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LayerTileId)));
Marshal.StructureToPtr((object)tid, intPtr, fDeleteOld: false);
try
{
return (BuildAction)(SwigDerivedClassHasMethod("OnTileFailed", swigMethodTypes3) ? NixelWrapperCPPPINVOKE.IBuildCallback_OnTileFailedSwigExplicitIBuildCallback(swigCPtr, intPtr, (int)errorCode) : NixelWrapperCPPPINVOKE.IBuildCallback_OnTileFailed(swigCPtr, intPtr, (int)errorCode));
}
finally
{
Marshal.FreeHGlobal(intPtr);
}
}
public virtual BuildAction OnTileCompleted(LayerTileId tid)
{
IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LayerTileId)));
Marshal.StructureToPtr((object)tid, intPtr, fDeleteOld: false);
try
{
return (BuildAction)(SwigDerivedClassHasMethod("OnTileCompleted", swigMethodTypes4) ? NixelWrapperCPPPINVOKE.IBuildCallback_OnTileCompletedSwigExplicitIBuildCallback(swigCPtr, intPtr) : NixelWrapperCPPPINVOKE.IBuildCallback_OnTileCompleted(swigCPtr, intPtr));
}
finally
{
Marshal.FreeHGlobal(intPtr);
}
}
public IBuildCallback()
: this(NixelWrapperCPPPINVOKE.new_IBuildCallback(), cMemoryOwn: true)
{
SwigDirectorConnect();
}
private void SwigDirectorConnect()
{
if (SwigDerivedClassHasMethod("StartingPass", swigMethodTypes0))
{
swigDelegate0 = SwigDirectorStartingPass;
}
if (SwigDerivedClassHasMethod("FinishedPass", swigMethodTypes1))
{
swigDelegate1 = SwigDirectorFinishedPass;
}
if (SwigDerivedClassHasMethod("OnTileStart", swigMethodTypes2))
{
swigDelegate2 = SwigDirectorOnTileStart;
}
if (SwigDerivedClassHasMethod("OnTileFailed", swigMethodTypes3))
{
swigDelegate3 = SwigDirectorOnTileFailed;
}
if (SwigDerivedClassHasMethod("OnTileCompleted", swigMethodTypes4))
{
swigDelegate4 = SwigDirectorOnTileCompleted;
}
NixelWrapperCPPPINVOKE.IBuildCallback_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4);
}
private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes)
{
return GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, methodTypes, null).DeclaringType.IsSubclassOf(typeof(IBuildCallback));
}
private void SwigDirectorStartingPass(int buildPass)
{
StartingPass((BuildPass)buildPass);
}
private void SwigDirectorFinishedPass(int buildPass)
{
FinishedPass((BuildPass)buildPass);
}
private void SwigDirectorOnTileStart(IntPtr tid)
{
LayerTileId tid2 = (LayerTileId)Marshal.PtrToStructure(tid, typeof(LayerTileId));
OnTileStart(tid2);
}
private int SwigDirectorOnTileFailed(IntPtr tid, int errorCode)
{
LayerTileId tid2 = (LayerTileId)Marshal.PtrToStructure(tid, typeof(LayerTileId));
return (int)OnTileFailed(tid2, (Error)errorCode);
}
private int SwigDirectorOnTileCompleted(IntPtr tid)
{
LayerTileId tid2 = (LayerTileId)Marshal.PtrToStructure(tid, typeof(LayerTileId));
return (int)OnTileCompleted(tid2);
}
}
public class IBuildProgressTracker : IDisposable
{
public delegate void SwigDelegateIBuildProgressTracker_0(int buildPass);
public delegate void SwigDelegateIBuildProgressTracker_1(int buildPass);
public delegate void SwigDelegateIBuildProgressTracker_2(IntPtr tid, uint tileCountInPass);
public delegate void SwigDelegateIBuildProgressTracker_3(uint index, uint count);
public delegate int SwigDelegateIBuildProgressTracker_4(uint level, uint numLevels);
private HandleRef swigCPtr;
protected bool swigCMemOwn;
private SwigDelegateIBuildProgressTracker_0 swigDelegate0;
private SwigDelegateIBuildProgressTracker_1 swigDelegate1;