TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
grloadsgi.h
Go to the documentation of this file.
1/***************************************************************************
2
3 file : grloadsgi.h
4 created : Wed Jun 1 14:56:31 CET 2005
5 copyright : (C) 2005 by Bernhard Wymann
6 version : $Id$
7
8***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19/*
20 Contains the header of the ssgSGIHeader class to allow me to overload,
21 the source is the file ssgLoadSGI.cxx. This is a stupid solution, but
22 the architecture of plib forces that... really.
23*/
24
25#ifndef _GRLOADSGI_H_
26#define _GRLOADSGI_H_
27
28/*
29 The latter parts are derived from plib (plib.sf.net) and have this license:
30
31 PLIB - A Suite of Portable Game Libraries
32 Copyright (C) 1998,2002 Steve Baker
33
34 This library is free software; you can redistribute it and/or
35 modify it under the terms of the GNU Library General Public
36 License as published by the Free Software Foundation; either
37 version 2 of the License, or (at your option) any later version.
38
39 This library is distributed in the hope that it will be useful,
40 but WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42 Library General Public License for more details.
43
44 You should have received a copy of the GNU Library General Public
45 License along with this library; if not, write to the Free Software
46 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47
48 For further information visit http://plib.sourceforge.net
49*/
50
52 public:
53 unsigned short magic ;
54 int max ;
55 int min ;
57 char type ;
58 char bpp ;
59 unsigned int *start ;
60 int *leng ;
61 unsigned short dim ;
62 unsigned short xsize ;
63 unsigned short ysize ;
64 unsigned short zsize ;
65 int tablen ;
66
67 /* added by J. Nathan Matias */
68 FILE *image_fd;
69 char image_fname [ 512 ];
71 unsigned char *rle_temp;
74 ssgSGIHeader(const char *fname, ssgTextureInfo* info );
76
77 bool openFile(const char *fname);
79 void getRow ( unsigned char *buf, int y, int z ) ;
80 void getPlane ( unsigned char *buf, int z ) ;
81 void getImage ( unsigned char *buf ) ;
82 void readHeader () ;
83
84 protected:
85 void swab_short ( unsigned short *x );
86 void swab_int ( unsigned int *x );
87 void swab_int_array ( int *x, int leng );
88 unsigned char readByte ();
89 unsigned short readShort ();
90 unsigned int readInt ();
91};
92
93#endif // _GRLOADSGI_H_
static Vector y[4]
Definition Convex.cpp:56
unsigned short ysize
Definition grloadsgi.h:63
void readHeader()
unsigned char * rle_temp
Definition grloadsgi.h:71
unsigned char readByte()
unsigned short xsize
Definition grloadsgi.h:62
FILE * image_fd
Definition grloadsgi.h:68
void getPlane(unsigned char *buf, int z)
unsigned short readShort()
void getImage(unsigned char *buf)
void swab_short(unsigned short *x)
bool openFile(const char *fname)
void getRow(unsigned char *buf, int y, int z)
unsigned int * start
Definition grloadsgi.h:59
unsigned short magic
Definition grloadsgi.h:53
unsigned int readInt()
void swab_int_array(int *x, int leng)
void makeConsistant()
unsigned short zsize
Definition grloadsgi.h:64
bool loadSGI_bool
Definition grloadsgi.h:72
void swab_int(unsigned int *x)
char image_fname[512]
Definition grloadsgi.h:69
unsigned short dim
Definition grloadsgi.h:61
ssgSGIHeader(const char *fname, ssgTextureInfo *info)