DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
spritegn.h
Go to the documentation of this file.
1/*
2Copyright (C) 1996-1997 Id Software, Inc.
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20//
21// spritegn.h: header file for sprite generation program
22//
23
24// **********************************************************
25// * This file must be identical in the spritegen directory *
26// * and in the Quake directory, because it's used to *
27// * pass data from one to the other via .spr files. *
28// **********************************************************
29
30#ifndef SPRITEGEN_H
31#define SPRITEGEN_H
32
33//-------------------------------------------------------
34// This program generates .spr sprite package files.
35// The format of the files is as follows:
36//
37// dsprite_t file header structure
38// <repeat dsprite_t.numframes times>
39// <if spritegroup, repeat dspritegroup_t.numframes times>
40// dspriteframe_t frame header structure
41// sprite bitmap
42// <else (single sprite frame)>
43// dspriteframe_t frame header structure
44// sprite bitmap
45// <endrepeat>
46//-------------------------------------------------------
47
48#define SPRITE_VERSION 1
49#define SPRITEHL_VERSION 2
50#define SPRITE32_VERSION 32
51
52#define SPRITE2_VERSION 2
53
54typedef struct dsprite_s
55{
56 int ident;
58 int type;
60 int width;
61 int height;
65} dsprite_t;
66
67typedef struct dspritehl_s
68{
69 int ident;
71 int type;
74 int width;
75 int height;
80
81typedef struct dsprite2frame_s
82{
84 int origin_x, origin_y; // raster coordinates inside pic
85 char name[64]; // name of pcx file
87
88typedef struct dsprite2_s
89{
90 int ident;
93 dsprite2frame_t frames[1]; // variable sized
95
96#define SPR_VP_PARALLEL_UPRIGHT 0
97#define SPR_FACING_UPRIGHT 1
98#define SPR_VP_PARALLEL 2
99#define SPR_ORIENTED 3
100#define SPR_VP_PARALLEL_ORIENTED 4
101#define SPR_LABEL 5
102#define SPR_LABEL_SCALE 6
103#define SPR_OVERHEAD 7
104
105#define SPRHL_OPAQUE 0
106#define SPRHL_ADDITIVE 1
107#define SPRHL_INDEXALPHA 2
108#define SPRHL_ALPHATEST 3
109
110typedef struct dspriteframe_s {
111 int origin[2];
112 int width;
115
116typedef struct dspritegroup_s {
119
120typedef struct dspriteinterval_s {
121 float interval;
123
124typedef enum spriteframetype_e { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t;
125
126typedef struct dspriteframetype_s {
129
130#endif
vector origin
GLenum GLsizei width
Definition glquake.h:622
const GLchar * name
Definition glquake.h:601
spriteframetype_t
Definition spritegn.h:124
@ SPR_SINGLE
Definition spritegn.h:124
@ SPR_GROUP
Definition spritegn.h:124
int version
Definition spritegn.h:91
int ident
Definition spritegn.h:90
int numframes
Definition spritegn.h:92
int version
Definition spritegn.h:57
int numframes
Definition spritegn.h:62
float boundingradius
Definition spritegn.h:59
int synctype
Definition spritegn.h:64
int width
Definition spritegn.h:60
int type
Definition spritegn.h:58
int ident
Definition spritegn.h:56
int height
Definition spritegn.h:61
float beamlength
Definition spritegn.h:63
spriteframetype_t type
Definition spritegn.h:127
int numframes
Definition spritegn.h:76
int version
Definition spritegn.h:70
int synctype
Definition spritegn.h:78
float beamlength
Definition spritegn.h:77
float boundingradius
Definition spritegn.h:73
int rendermode
Definition spritegn.h:72