Changeset 3097 in orxonox.OLD for orxonox/branches/images/importer
- Timestamp:
- Dec 5, 2004, 3:07:19 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/images/importer/material.cc
r3096 r3097 525 525 } 526 526 527 /** 528 \brief reads in a jpg-file 529 \param jpgName the Name of the Image to load 530 \param texture a reference to the Texture to write the image to 531 */ 527 532 bool Material::loadJPG (char* jpgName, GLuint* texture) 528 533 { … … 614 619 } 615 620 621 /** 622 \brief reads in a tga-file 623 \param tgaName the Name of the Image to load 624 \param texture a reference to the Texture to write the image to 625 */ 616 626 bool Material::loadTGA(const char * tgaName, GLuint* texture) 617 627 { 618 628 typedef struct 619 629 { 620 GLubyte Header[12]; /* TGA File Header */630 GLubyte Header[12]; 621 631 } TGAHeader; 622 TGAHeader tgaHeader;623 624 GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0}; / * Uncompressed TGA Header */625 GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; / * Compressed TGA Header */632 TGAHeader tgaHeader; 633 634 GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0}; // Uncompressed TGA Header 635 GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; // Compressed TGA Header 626 636 FILE * fTGA; 627 637 fTGA = fopen(tgaName, "rb"); … … 665 675 } 666 676 677 /** 678 \brief reads in an uncompressed tga-file 679 \param filename the Name of the Image to load 680 \param fTGA a Pointer to a File, that should be read 681 \param texture a reference to the Texture to write the image to 682 */ 667 683 bool Material::loadUncompressedTGA(const char * filename, FILE * fTGA, GLuint* texture) 668 684 { … … 723 739 } 724 740 725 /* Byte Swapping Optimized By Steve Thomas */726 741 for(cswap = 0; cswap < (int)imageSize; cswap += bytesPerPixel) 727 742 { … … 735 750 } 736 751 752 /** 753 \brief reads in a compressed tga-file 754 \param filename the Name of the Image to load 755 \param fTGA a Pointer to a File, that should be read 756 \param texture a reference to the Texture to write the image to 757 */ 737 758 bool Material::loadCompressedTGA(const char * filename, FILE * fTGA, GLuint* texture) 738 759 { … … 873 894 for(counter = 0; counter < chunkheader; counter++) //copy the color into the image data as many times as dictated 874 895 { 875 // switch R and B bytes areound while copying /* by the header */896 // switch R and B bytes areound while copying 876 897 pImage->data[currentbyte ] = colorbuffer[2]; 877 898 pImage->data[currentbyte + 1] = colorbuffer[1]; … … 905 926 } 906 927 907 while(currentpixel < pixelcount); /* Loop while there are still pixels left */ 928 while(currentpixel < pixelcount); // Loop while there are still pixels left 929 908 930 loadTexToGL (pImage, texture); 909 931
Note: See TracChangeset
for help on using the changeset viewer.