mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
fix thread-unsafe tga loader
This commit is contained in:
parent
78e72288ad
commit
e137dfcaa4
@ -199,6 +199,12 @@ Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number) :
|
|||||||
ColorMap = NULL;
|
ColorMap = NULL;
|
||||||
AlphaMap = NULL;
|
AlphaMap = NULL;
|
||||||
|
|
||||||
|
Red = 0;
|
||||||
|
Grn = 0;
|
||||||
|
Blu = 0;
|
||||||
|
Alpha = 0;
|
||||||
|
l = 0;
|
||||||
|
|
||||||
/* Read the Targa file header. */
|
/* Read the Targa file header. */
|
||||||
readtga( file, tga_head, magic_number );
|
readtga( file, tga_head, magic_number );
|
||||||
/*
|
/*
|
||||||
@ -701,10 +707,7 @@ get_map_entry( istream *ifp, pixel *Value, int Size, gray *Alpha ) {
|
|||||||
|
|
||||||
void PNMFileTypeTGA::Reader::
|
void PNMFileTypeTGA::Reader::
|
||||||
get_pixel( istream *ifp, pixel *dest, int Size, gray *alpha_p) {
|
get_pixel( istream *ifp, pixel *dest, int Size, gray *alpha_p) {
|
||||||
static pixval Red, Grn, Blu;
|
|
||||||
static pixval Alpha;
|
|
||||||
unsigned char j, k;
|
unsigned char j, k;
|
||||||
static unsigned int l;
|
|
||||||
|
|
||||||
/* Check if run length encoded. */
|
/* Check if run length encoded. */
|
||||||
if ( rlencoded )
|
if ( rlencoded )
|
||||||
|
@ -66,6 +66,10 @@ public:
|
|||||||
pixel *ColorMap;
|
pixel *ColorMap;
|
||||||
gray *AlphaMap;
|
gray *AlphaMap;
|
||||||
int RLE_count, RLE_flag;
|
int RLE_count, RLE_flag;
|
||||||
|
|
||||||
|
pixval Red, Grn, Blu;
|
||||||
|
pixval Alpha;
|
||||||
|
unsigned int l;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Writer : public PNMWriter {
|
class Writer : public PNMWriter {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user