mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
compile on Linux
This commit is contained in:
parent
83a138529d
commit
55181edef0
@ -179,12 +179,12 @@ BMPreadinfoheader(
|
|||||||
int *pclassv)
|
int *pclassv)
|
||||||
{
|
{
|
||||||
unsigned long cbFix;
|
unsigned long cbFix;
|
||||||
unsigned short cPlanes;
|
unsigned short cPlanes = 0;
|
||||||
|
|
||||||
unsigned long cx;
|
unsigned long cx = 0;
|
||||||
unsigned long cy;
|
unsigned long cy = 0;
|
||||||
unsigned short cBitCount;
|
unsigned short cBitCount = 0;
|
||||||
int classv;
|
int classv = 0;
|
||||||
|
|
||||||
cbFix = GetLong(fp);
|
cbFix = GetLong(fp);
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ BMPreadrow(
|
|||||||
pixval *G,
|
pixval *G,
|
||||||
pixval *B)
|
pixval *B)
|
||||||
{
|
{
|
||||||
BITSTREAM b;
|
BITSTREAM b = NULL;
|
||||||
unsigned nbyte = 0;
|
unsigned nbyte = 0;
|
||||||
int rc;
|
int rc;
|
||||||
unsigned x;
|
unsigned x;
|
||||||
|
@ -143,7 +143,7 @@ BMPwriteinfoheader(
|
|||||||
unsigned long x,
|
unsigned long x,
|
||||||
unsigned long y)
|
unsigned long y)
|
||||||
{
|
{
|
||||||
long cbFix;
|
long cbFix = 0;
|
||||||
|
|
||||||
/* cbFix */
|
/* cbFix */
|
||||||
switch (classv)
|
switch (classv)
|
||||||
|
@ -31,6 +31,14 @@
|
|||||||
#include <windows.h> // we need to include this before jpeglib.
|
#include <windows.h> // we need to include this before jpeglib.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PNG
|
||||||
|
// If we are going to be including png.h (in the unrelated file
|
||||||
|
// pnmFileTypePNG.h), be sure to include it before including setjmp.h.
|
||||||
|
// Ugly hack due to png weirdness with setjmp.
|
||||||
|
#include <png.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <stdio.h> // jpeglib requires this to be included first.
|
#include <stdio.h> // jpeglib requires this to be included first.
|
||||||
#include <jpeglib.h>
|
#include <jpeglib.h>
|
||||||
|
@ -351,7 +351,10 @@ read_data(xel *array, xelval *alpha_data) {
|
|||||||
for (yi = 0; yi < num_rows; yi++) {
|
for (yi = 0; yi < num_rows; yi++) {
|
||||||
png_bytep source = rows[yi];
|
png_bytep source = rows[yi];
|
||||||
for (int xi = 0; xi < _x_size; xi++) {
|
for (int xi = 0; xi < _x_size; xi++) {
|
||||||
int red, green, blue, alpha;
|
int red = 0;
|
||||||
|
int green = 0;
|
||||||
|
int blue = 0;
|
||||||
|
int alpha = 0;
|
||||||
|
|
||||||
if (_maxval > 255) {
|
if (_maxval > 255) {
|
||||||
if (get_color) {
|
if (get_color) {
|
||||||
@ -430,7 +433,7 @@ void PNMFileTypePNG::Reader::
|
|||||||
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
|
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
|
||||||
Reader *self = (Reader *)png_get_io_ptr(png_ptr);
|
Reader *self = (Reader *)png_get_io_ptr(png_ptr);
|
||||||
self->_file->read((char *)data, length);
|
self->_file->read((char *)data, length);
|
||||||
if (self->_file->gcount() != length) {
|
if (length != (png_size_t)self->_file->gcount()) {
|
||||||
pnmimage_png_cat.error()
|
pnmimage_png_cat.error()
|
||||||
<< "Didn't read enough bytes.\n";
|
<< "Didn't read enough bytes.\n";
|
||||||
// Is there no way to indicate a read failure to libpng?
|
// Is there no way to indicate a read failure to libpng?
|
||||||
|
@ -346,7 +346,7 @@ read_channel(istream *ifp,
|
|||||||
TabEntry *table,
|
TabEntry *table,
|
||||||
ScanElem *channel_data, long table_start,
|
ScanElem *channel_data, long table_start,
|
||||||
int channel, int row) {
|
int channel, int row) {
|
||||||
ScanElem *temp;
|
ScanElem *temp = NULL;
|
||||||
int sgi_index, i;
|
int sgi_index, i;
|
||||||
long offset, length;
|
long offset, length;
|
||||||
|
|
||||||
|
@ -646,7 +646,8 @@ readtga( istream *ifp, struct ImageHeader *tgaP, const string &magic_number ) {
|
|||||||
|
|
||||||
void PNMFileTypeTGA::Reader::
|
void PNMFileTypeTGA::Reader::
|
||||||
get_map_entry( istream *ifp, pixel *Value, int Size, gray *Alpha ) {
|
get_map_entry( istream *ifp, pixel *Value, int Size, gray *Alpha ) {
|
||||||
unsigned char j, k, r, g, b, a;
|
unsigned char j, k;
|
||||||
|
unsigned char r = 0, g = 0, b = 0, a = 0;
|
||||||
|
|
||||||
/* Read appropriate number of bytes, break into rgb & put in map. */
|
/* Read appropriate number of bytes, break into rgb & put in map. */
|
||||||
switch ( Size )
|
switch ( Size )
|
||||||
@ -682,7 +683,7 @@ get_map_entry( istream *ifp, pixel *Value, int Size, gray *Alpha ) {
|
|||||||
}
|
}
|
||||||
PPM_ASSIGN( *Value, r, g, b );
|
PPM_ASSIGN( *Value, r, g, b );
|
||||||
*Alpha = a;
|
*Alpha = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user