modelloader update
This commit is contained in:
parent
e4d98e5434
commit
3c583f6527
|
@ -20,24 +20,36 @@ bool Load3ds::parse() {
|
|||
}
|
||||
|
||||
unsigned short ident;
|
||||
unsigned int len;
|
||||
unsigned char m, n;
|
||||
|
||||
std::cout << "size: " << sizeof(int) << std::endl;
|
||||
while(!mfile.eof()) {
|
||||
ident = m = n = 0;
|
||||
ident = len = 0;
|
||||
mfile.read((char *)&ident, 2);
|
||||
mfile.read((char *)&m, 1);
|
||||
mfile.read((char *)&n, 1);
|
||||
std::cout << "Chunk: " << ident << " (" << (int)m << ", " << (int)n << ")" << std::endl;
|
||||
mfile.read((char *)&len, 4);
|
||||
// mfile.read((char *)&m, 1);
|
||||
// mfile.read((char *)&n, 1);
|
||||
std::cout << "Chunk: 0x" << std::hex << ident << " (" << std::dec << len << ")" << std::endl;
|
||||
switch(ident) {
|
||||
case 0x4d4d:
|
||||
// Main Chunk
|
||||
std::cout << "yeah!" << std::endl;
|
||||
break;
|
||||
case 0x3d3d:
|
||||
// 3D Editor Chunk
|
||||
std::cout << "editorchunk" << std::endl;
|
||||
break;
|
||||
case 0x4000:
|
||||
std::cout << "namechunk" << std::endl;
|
||||
break;
|
||||
default:
|
||||
//Switch Chunk
|
||||
mfile.ignore(m+n);
|
||||
std::cout << "einfach ignorieren..." << std::endl;
|
||||
mfile.ignore(len-6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mfile.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue