/* ************************ Copyright Terrain Experts Inc. Terrain Experts Inc (TERREX) reserves all rights to this source code unless otherwise specified in writing by the President of TERREX. This copyright may be updated in the future, in which case that version supercedes this one. ------------------- Terrex Experts Inc. 4400 East Broadway #314 Tucson, AZ 85711 info@terrex.com Tel: (520) 323-7990 ************************ */ #include #include #include /* trpage_print.cpp Print out the contents of a TerraPage archive. This module provides an example of how to access each of the classes within a TerraPage archive. */ #include /* ****************************************** Print Buffer implementation The print buffer is a way to dump debugging data out to a file (or console). You can make your own subclass of trpgPrintBuffer if you have specific needs. ****************************************** */ trpgPrintBuffer::trpgPrintBuffer() { curIndent = 0; indentStr[0] = 0; } // Increase the current indent void trpgPrintBuffer::IncreaseIndent(int amount) { curIndent+=amount; updateIndent(); } // Decrease the current indent void trpgPrintBuffer::DecreaseIndent(int amount) { curIndent-=amount; curIndent = MAX(0,curIndent); updateIndent(); } // Reprint the indent string void trpgPrintBuffer::updateIndent() { int i; for (i=0;i(this))->GetMaterialRef(j,i); mat->Print(buf); } buf.DecreaseIndent(); } buf.DecreaseIndent(2); return true; } /* Print out texture. */ bool trpgTexture::Print(trpgPrintBuffer &buf) const { char ls[1024]; buf.prnLine("----Texture----"); buf.IncreaseIndent(); sprintf(ls,"mode = %d, type = %d",mode,type); buf.prnLine(ls); sprintf(ls,"Name = %s",name); buf.prnLine(ls); sprintf(ls,"useCount = %d",useCount); buf.prnLine(ls); sprintf(ls,"sizeX = %d, sizeY = %d, sizeZ = %d",sizeX,sizeY,numLayer); buf.prnLine(ls); sprintf(ls,"sensor band organization = %d",org); buf.prnLine(ls); sprintf(ls,"ismipmap = %d",isMipmap); buf.prnLine(ls); sprintf(ls,"addr.file = %d, addr.offset = %d",addr.file,addr.offset); buf.prnLine(ls); buf.DecreaseIndent(); buf.prnLine(); return true; } /* Print out texture table */ bool trpgTexTable::Print(trpgPrintBuffer &buf) const { char ls[1024]; buf.prnLine("----Texture Table----"); buf.IncreaseIndent(); for (int i=0;i (ex,ey) = (%d,%d) -> (%d,%d)",sx,sy,ex,ey); buf.prnLine(ls); sprintf(ls,"dest (width,height) = (%d,%d)",destWidth,destHeight); buf.prnLine(ls); for (int i=0;i