Jump to content
  • 0

C++ Expertise needed !!


antz

Question

I am attempting to convert some legacy mangos C++ libraries to C#. the original class in C++ is:-

//

// Adt file cell chunk

//

class adt_MCNK

{

union

{

uint32 fcc;

char fcc_txt[4];

};

uint32 size;

public:

uint32 flags;

uint32 ix;

uint32 iy;

uint32 nLayers;

uint32 nDoodadRefs;

uint32 offsMCVT; // height map

uint32 offsMCNR; // Normal vectors for each vertex

uint32 offsMCLY; // Texture layer definitions

uint32 offsMCRF; // A list of indices into the parent file's MDDF chunk

uint32 offsMCAL; // Alpha maps for additional texture layers

uint32 sizeMCAL;

uint32 offsMCSH; // Shadow map for static shadows on the terrain

uint32 sizeMCSH;

uint32 areaid;

uint32 nMapObjRefs;

uint16 holes; // locations where models pierce the heightmap

uint16 pad;

uint16 s[2];

uint32 data1;

uint32 data2;

uint32 data3;

uint32 predTex;

uint32 nEffectDoodad;

uint32 offsMCSE;

uint32 nSndEmitters;

uint32 offsMCLQ; // Liqid level (old)

uint32 sizeMCLQ; //

float zpos;

float xpos;

float ypos;

uint32 offsMCCV; // offsColorValues in WotLK

uint32 props;

uint32 effectId;

bool prepareLoadedData();

adt_MCVT* getMCVT()

{

if (offsMCVT)

return (adt_MCVT*)((uint8*)this + offsMCVT);

return 0;

}

adt_MCLQ* getMCLQ()

{

if (offsMCLQ)

return (adt_MCLQ*)((uint8*)this + offsMCLQ);

return 0;

}

};

I have managed to convert it to the following:-

class adt_MCNK

{

uint fcc;

string[] fcc_txt = new string[4];

uint size;

uint flags;

uint ix;

uint iy;

uint nLayers;

uint nDoodadRefs;

//// height map

uint offsMCVT;

//// Normal vectors for each vertex

uint offsMCNR;

//// Texture layer definitions

uint offsMCLY;

//// A list of indices into the parent file's MDDF chunk

uint offsMCRF;

//// Alpha maps for additional texture layers

uint offsMCAL;

uint sizeMCAL;

//// Shadow map for static shadows on the terrain

uint offsMCSH;

uint sizeMCSH;

uint areaid;

uint nMapObjRefs;

//// locations where models pierce the heightmap

ushort holes;

ushort pad;

ushort[] s = new ushort[3];

uint data1;

uint data2;

uint data3;

uint predTex;

uint nEffectDoodad;

uint offsMCSE;

uint nSndEmitters;

//// Liqid level (old)

uint offsMCLQ;

////

uint sizeMCLQ;

double zpos;

double xpos;

double ypos;

//// offsColorValues in WotLK

uint offsMCCV;

uint props;

uint effectId;

bool[] prepareLoadedData;

//adt_MCVT* getMCVT()

//{

// if (offsMCVT)

// return (adt_MCVT*)((uint8*)this + offsMCVT)

// return 0

//}

//adt_MCLQ* getMCLQ()

//{

// if (offsMCLQ)

// return (adt_MCLQ*)((uint8*)this + offsMCLQ)

// return 0

//}

}

I need to work out how to implement the last three functions

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use