DatReader class heritage
Start Atlas maker class for generate atlas texture
This commit is contained in:
parent
7fb6345839
commit
18203c539f
6 changed files with 65 additions and 22 deletions
|
|
@ -1,43 +1,40 @@
|
|||
using AC2RE.Definitions;
|
||||
|
||||
namespace LandblockExtraction.DatEngine {
|
||||
public class PortalEngine {
|
||||
public class PortalEngine : DatEngine {
|
||||
private readonly DataId TERRAINDESCID = new DataId(0x12000000);
|
||||
private readonly DataId SURFACEDESCID = new DataId(0x13000000);
|
||||
private readonly DataId LANDSCAPEID = new DataId(0x36000000);
|
||||
|
||||
private DatReader portalReader;
|
||||
|
||||
public CTerrainDesc cTerrainDesc { get; private set; }
|
||||
public CSurfaceDesc cSurfaceDesc { get; private set; }
|
||||
public LandScapeDefs landScapeDefs { get; private set; }
|
||||
|
||||
public PortalEngine() {
|
||||
portalReader = new(@"X:\DatFiles\portal.dat");
|
||||
public PortalEngine() : base(@"X:\DatFiles\portal.dat") {
|
||||
InitTerrainDesc();
|
||||
InitSurfaceDesc();
|
||||
InitLandScapeDesc();
|
||||
}
|
||||
|
||||
public bool InitTerrainDesc() {
|
||||
if (!portalReader.contains(TERRAINDESCID)) return false;
|
||||
using (var data = portalReader.getFileReader(TERRAINDESCID)) {
|
||||
if (!datReader.contains(TERRAINDESCID)) return false;
|
||||
using (var data = datReader.getFileReader(TERRAINDESCID)) {
|
||||
if (data == null) return false;
|
||||
cTerrainDesc = new(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool InitSurfaceDesc() {
|
||||
if (!portalReader.contains(SURFACEDESCID)) return false;
|
||||
using (var data = portalReader.getFileReader(SURFACEDESCID)) {
|
||||
if (!datReader.contains(SURFACEDESCID)) return false;
|
||||
using (var data = datReader.getFileReader(SURFACEDESCID)) {
|
||||
if (data == null) return false;
|
||||
cSurfaceDesc = new(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool InitLandScapeDesc() {
|
||||
if (!portalReader.contains(LANDSCAPEID)) return false;
|
||||
using (var data = portalReader.getFileReader(LANDSCAPEID)) {
|
||||
if (!datReader.contains(LANDSCAPEID)) return false;
|
||||
using (var data = datReader.getFileReader(LANDSCAPEID)) {
|
||||
if (data == null) return false;
|
||||
landScapeDefs = new(data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue