1 #define _CRT_SECURE_NO_DEPRECATE
6 int holetab_h
[4] = {0x1111, 0x2222, 0x4444, 0x8888};
7 int holetab_v
[4] = {0x000F, 0x00F0, 0x0F00, 0xF000};
9 bool isHole(int holes
, int i
, int j
)
13 if(testi
> 3) testi
= 3;
14 if(testj
> 3) testj
= 3;
15 return (holes
& holetab_h
[testi
] & holetab_v
[testj
]) != 0;
19 // Adt file loader class
38 // Adt file check function
40 bool ADT_file::prepareLoadedData()
43 if (!FileLoader::prepareLoadedData())
46 // Check and prepare MHDR
47 a_grid
= (adt_MHDR
*)(GetData()+8+version
->size
);
48 if (!a_grid
->prepareLoadedData())
54 bool adt_MHDR::prepareLoadedData()
59 if (size
!=sizeof(adt_MHDR
)-8)
62 // Check and prepare MCIN
63 if (offsMCIN
&& !getMCIN()->prepareLoadedData())
66 // Check and prepare MH2O
67 if (offsMH2O
&& !getMH2O()->prepareLoadedData())
73 bool adt_MCIN::prepareLoadedData()
79 for (int i
=0; i
<ADT_CELLS_PER_GRID
;i
++)
80 for (int j
=0; j
<ADT_CELLS_PER_GRID
;j
++)
81 if (cells
[i
][j
].offsMCNK
&& !getMCNK(i
,j
)->prepareLoadedData())
87 bool adt_MH2O::prepareLoadedData()
93 // for (int i=0; i<ADT_CELLS_PER_GRID;i++)
94 // for (int j=0; j<ADT_CELLS_PER_GRID;j++)
99 bool adt_MCNK::prepareLoadedData()
105 if (offsMCVT
&& !getMCVT()->prepareLoadedData())
108 if (offsMCLQ
&& !getMCLQ()->prepareLoadedData())
114 bool adt_MCVT::prepareLoadedData()
119 if (size
!= sizeof(adt_MCVT
)-8)
125 bool adt_MCLQ::prepareLoadedData()