TORCS
1.3.9
The Open Racing Car Simulator
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
51
class
ssgSGIHeader
{
52
public
:
53
unsigned
short
magic
;
54
int
max
;
55
int
min
;
56
int
colormap
;
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 ];
70
int
isSwapped
;
71
unsigned
char
*
rle_temp
;
72
bool
loadSGI_bool
;
73
ssgSGIHeader
() ;
74
ssgSGIHeader
(
const
char
*fname, ssgTextureInfo* info );
75
~ssgSGIHeader
() ;
76
77
bool
openFile
(
const
char
*fname);
78
void
makeConsistant
() ;
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_
ssgSGIHeader::zsize
unsigned short zsize
Definition:
grloadsgi.h:64
ssgSGIHeader::ysize
unsigned short ysize
Definition:
grloadsgi.h:63
ssgSGIHeader::openFile
bool openFile(const char *fname)
ssgSGIHeader::min
int min
Definition:
grloadsgi.h:55
ssgSGIHeader
Definition:
grloadsgi.h:51
ssgSGIHeader::swab_int
void swab_int(unsigned int *x)
ssgSGIHeader::tablen
int tablen
Definition:
grloadsgi.h:65
ssgSGIHeader::readByte
unsigned char readByte()
ssgSGIHeader::image_fd
FILE * image_fd
Definition:
grloadsgi.h:68
ssgSGIHeader::loadSGI_bool
bool loadSGI_bool
Definition:
grloadsgi.h:72
ssgSGIHeader::~ssgSGIHeader
~ssgSGIHeader()
ssgSGIHeader::getImage
void getImage(unsigned char *buf)
ssgSGIHeader::readHeader
void readHeader()
ssgSGIHeader::isSwapped
int isSwapped
Definition:
grloadsgi.h:70
ssgSGIHeader::max
int max
Definition:
grloadsgi.h:54
ssgSGIHeader::getRow
void getRow(unsigned char *buf, int y, int z)
ssgSGIHeader::readShort
unsigned short readShort()
ssgSGIHeader::swab_int_array
void swab_int_array(int *x, int leng)
ssgSGIHeader::getPlane
void getPlane(unsigned char *buf, int z)
ssgSGIHeader::makeConsistant
void makeConsistant()
ssgSGIHeader::dim
unsigned short dim
Definition:
grloadsgi.h:61
ssgSGIHeader::leng
int * leng
Definition:
grloadsgi.h:60
y
static Vector y[4]
Definition:
Convex.cpp:56
ssgSGIHeader::readInt
unsigned int readInt()
ssgSGIHeader::image_fname
char image_fname[512]
Definition:
grloadsgi.h:69
ssgSGIHeader::magic
unsigned short magic
Definition:
grloadsgi.h:53
ssgSGIHeader::rle_temp
unsigned char * rle_temp
Definition:
grloadsgi.h:71
ssgSGIHeader::ssgSGIHeader
ssgSGIHeader()
ssgSGIHeader::xsize
unsigned short xsize
Definition:
grloadsgi.h:62
ssgSGIHeader::start
unsigned int * start
Definition:
grloadsgi.h:59
ssgSGIHeader::colormap
int colormap
Definition:
grloadsgi.h:56
ssgSGIHeader::swab_short
void swab_short(unsigned short *x)
ssgSGIHeader::type
char type
Definition:
grloadsgi.h:57
ssgSGIHeader::bpp
char bpp
Definition:
grloadsgi.h:58
src
modules
graphic
ssggraph
grloadsgi.h
Generated by
1.8.14