3DS文件结构(7)

2019-08-31 09:11

unsigned long tellertje=6L; // 2 id + 4 pointer

current_pointer=GetChunkPointer (); temp_pointer =ReadChunkPointer ();

while (end_found==FALSE) {

temp_int=ReadInt ();

switch (temp_int) {

case COL_RGB :

#ifdef __DEBUG__

printf (\ temp_int); #endif

tellertje+=ReadRGBColor (); break; case COL_TRU :

#ifdef __DEBUG__

printf (\Found Color def (24bit) chunk id of %0X\\n\ temp_int); #endif

tellertje+=ReadTrueColor (); break; default: break; }

tellertje+=2;

if (tellertje=temp_pointer) end_found=TRUE; }

ChangeChunkPointer (current_pointer+temp_pointer); // move to the new chunk position return (temp_pointer); }

/*----------------------------------------------------------------------------*/

unsigned long ReadAmbientChunk (void) {

unsigned char end_found=FALSE; unsigned int temp_int;

unsigned long current_pointer;

unsigned long temp_pointer;

unsigned long tellertje=6L; // 2 id + 4 pointer

current_pointer=GetChunkPointer (); temp_pointer =ReadChunkPointer ();

while (end_found==FALSE) {

temp_int=ReadInt ();

switch (temp_int) {

case COL_RGB :

#ifdef __DEBUG__

printf (\ temp_int); #endif

tellertje+=ReadRGBColor (); break; case COL_TRU :

#ifdef __DEBUG__

printf (\Found Color def (24bit) chunk id of %0X\\n\ temp_int); #endif

tellertje+=ReadTrueColor (); break; default: break; }

tellertje+=2;

if (tellertje=temp_pointer) end_found=TRUE; }

ChangeChunkPointer (current_pointer+temp_pointer); // move to the new chunk position return (temp_pointer); }

/*----------------------------------------------------------------------------*/

unsigned long FindCameraChunk (void) {

long temp_pointer=0L;

for (int i=0;i<12;i++) ReadInt ();

temp_pointer=11L;

temp_pointer=ReadName ();

#ifdef __DEBUG__ if (temp_pointer==-1)

printf (\ #endif

return (temp_pointer); }

/*----------------------------------------------------------------------------*/

unsigned long ReadViewPortChunk (void) {

unsigned long current_pointer; unsigned long temp_pointer; unsigned int port,attribs;

views_read++;

current_pointer=GetChunkPointer (); temp_pointer =ReadChunkPointer ();

attribs=ReadInt (); if (attribs==3) {

#ifdef __DEBUG__

printf (\ #endif }

if (attribs==5) {

#ifdef __DEBUG__

printf (\ #endif }

for (int i=1;i<6;i++) ReadInt (); // read 5 ints to get to the viewport

port=ReadInt ();

if ((port==0xFFFF) || (port==0))

{

FindCameraChunk (); port=CAMERA; }

#ifdef __DEBUG__

printf (\[%s] information with id:%d\\n\[port],port); #endif

ChangeChunkPointer (current_pointer+temp_pointer); // move to the new chunk position return (temp_pointer); }

/*----------------------------------------------------------------------------*/

unsigned long ReadViewChunk (void) {

unsigned char end_found=FALSE; unsigned int temp_int;

unsigned long current_pointer; unsigned long temp_pointer; unsigned long tellertje=6L;

current_pointer=GetChunkPointer (); temp_pointer =ReadChunkPointer ();

while (end_found==FALSE) {

temp_int=ReadInt ();

switch (temp_int) {

case EDIT_VIEW_P1 :

#ifdef __DEBUG__

printf (\ temp_int); #endif

tellertje+=ReadViewPortChunk (); break; case EDIT_VIEW_P2 :

#ifdef __DEBUG__

printf (\of %0X\\n\

temp_int);

#endif

tellertje+=ReadUnknownChunk (EDIT_VIEW_P2); break; case EDIT_VIEW_P3 :

#ifdef __DEBUG__

printf (\ temp_int); #endif

tellertje+=ReadViewPortChunk (); break; default :break; }

tellertje+=2;

if (tellertje=temp_pointer) end_found=TRUE;

if (views_read3) end_found=TRUE; }

ChangeChunkPointer (current_pointer+temp_pointer); // move to the new chunk position return (temp_pointer); }

/*----------------------------------------------------------------------------*/

unsigned long ReadMatDefChunk (void) {

unsigned long current_pointer; unsigned long temp_pointer;

current_pointer=GetChunkPointer (); temp_pointer =ReadChunkPointer ();

if (ReadLongName ()==-1) {

#ifdef __DEBUG__

printf (\ #endif }

ChangeChunkPointer (current_pointer+temp_pointer); // move to the new chunk position


3DS文件结构(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:第五章 脂类代谢(试题与答案)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: