mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -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;
|
||||
AlphaMap = NULL;
|
||||
|
||||
Red = 0;
|
||||
Grn = 0;
|
||||
Blu = 0;
|
||||
Alpha = 0;
|
||||
l = 0;
|
||||
|
||||
/* Read the Targa file header. */
|
||||
readtga( file, tga_head, magic_number );
|
||||
/*
|
||||
@ -701,10 +707,7 @@ get_map_entry( istream *ifp, pixel *Value, int Size, gray *Alpha ) {
|
||||
|
||||
void PNMFileTypeTGA::Reader::
|
||||
get_pixel( istream *ifp, pixel *dest, int Size, gray *alpha_p) {
|
||||
static pixval Red, Grn, Blu;
|
||||
static pixval Alpha;
|
||||
unsigned char j, k;
|
||||
static unsigned int l;
|
||||
|
||||
/* Check if run length encoded. */
|
||||
if ( rlencoded )
|
||||
|
@ -66,6 +66,10 @@ public:
|
||||
pixel *ColorMap;
|
||||
gray *AlphaMap;
|
||||
int RLE_count, RLE_flag;
|
||||
|
||||
pixval Red, Grn, Blu;
|
||||
pixval Alpha;
|
||||
unsigned int l;
|
||||
};
|
||||
|
||||
class Writer : public PNMWriter {
|
||||
|
Loading…
x
Reference in New Issue
Block a user