I modified Offsetfix to not do any fixing of the M2 or doodad info for WoTLK maps. I did this to try and fix the resulting non-noggit-compatible maps that Mjollna's GillijimProject creates. As such, my first experiment was a success, aside from the water disappearing (which I'm sure is due to how the offsetfix app processes liquid data - additional hacking will be needed to determine how to get the water back).As such, I've got Alpha WoW maps working within Noggit!
How much u all want Soft to delete "Duplicated" Models in ListFile of ADT ? i just started to coding :?
#include <cstdio>#include <stdint.h>#include <cassert>#include <vector>struct smddf{ uint32_t match1; uint32_t ign1; float match2[6]; uint32_t ign2;};struct smodf{ uint32_t match1; uint32_t ign1; float match2[6]; float ign2[6]; uint32_t ign3[2];};bool mddfcomp (smddf i,smddf j){ return (i.match1==j.match1)&&(i.match2[0]==j.match2[0]) && (i.match2[1]==j.match2[1]) && (i.match2[2]==j.match2[2]) && (i.match2[3]==j.match2[3]) && (i.match2[4]==j.match2[4]) && (i.match2[5]==j.match2[5]);}bool modfcomp (smodf i,smodf j){ return (i.match1==j.match1)&&(i.match2[0]==j.match2[0]) && (i.match2[1]==j.match2[1]) && (i.match2[2]==j.match2[2]) && (i.match2[3]==j.match2[3]) && (i.match2[4]==j.match2[4]) && (i.match2[5]==j.match2[5]);}int main(int n, char** v){ assert( n == 2 && "fixmddfs <adt>" ); FILE* file = fopen( v[1], "rb+" ); fseek(file,0,SEEK_END); size_t filesize = ftell(file); fseek(file,0,SEEK_SET); char* adt = new char[filesize]; fread(adt,filesize,1,file); assert(*(uint32_t*)adt == 'MVER'); assert(*(uint32_t*)(adt+0xC) == 'MHDR'); uint32_t mddf = *(uint32_t*)(adt+0x30) + 0x14; uint32_t modf = *(uint32_t*)(adt+0x34) + 0x14; assert(*(uint32_t*)(adt+mddf) == 'MDDF'); assert(*(uint32_t*)(adt+modf) == 'MODF'); size_t nmddf = *(uint32_t*)(adt+mddf+4) / sizeof(smddf); size_t nmodf = *(uint32_t*)(adt+modf+4) / sizeof(smodf); smddf* mddfsf = (smddf*)(adt+mddf+8); smodf* modfsf = (smodf*)(adt+modf+8); std::vector<smddf> mddfs; std::vector<smodf> modfs; for(size_t i = 0; i < nmddf; ++i) { for(size_t j = 0; j < nmddf; ++j) { if(i!=j && mddfcomp(mddfsf[i],mddfsf[j])) { memset(&mddfsf[j],0,sizeof(smddf)); } } if(mddfsf[i].match1) mddfs.push_back(mddfsf[i]); } for(size_t i = 0; i < nmodf; ++i) { for(size_t j = 0; j < nmodf; ++j) { if(i!=j && modfcomp(modfsf[i],modfsf[j])) { memset(&modfsf[j],0,sizeof(smodf)); } } if(modfsf[i].match1) modfs.push_back(modfsf[i]); } memcpy((adt+mddf+8),&mddfs[0],mddfs.size()); memcpy((adt+modf+8),&modfs[0],modfs.size()); memset((adt+mddf+8+mddfs.size()*sizeof(smddf)),0,sizeof(smddf)*(nmddf-mddfs.size())); memset((adt+modf+8+modfs.size()*sizeof(smodf)),0,sizeof(smodf)*(nmodf-modfs.size())); *(uint32_t*)(adt+mddf+4) = mddfs.size() * sizeof(smddf); *(uint32_t*)(adt+modf+4) = modfs.size() * sizeof(smodf); fseek(file,0,SEEK_SET); fwrite(adt,filesize,1,file); fclose(file); delete[] adt; return 0;}
Ok ......... pwned ... Thanks Schlumpf !
created my own Mountain StyleHope u guys like it:
Tinkering with my DBC editor
I'm working on some areas for my Gnomeregan rebuild, made with blender.