Jo Engine  9
Jo Sega Saturn Engine
types.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2017, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
35 #ifndef __JO_TYPES_H__
36 # define __JO_TYPES_H__
37 
39 typedef unsigned short jo_color;
40 
42 typedef struct
43 {
44  int x;
45  int y;
46 } jo_pos2D;
47 
51 typedef struct
52 {
53  int x;
54  int y;
55  int z;
56 } jo_pos3D;
57 
61 typedef struct
62 {
64  short rz;
66 
70 typedef struct
71 {
73  short rx;
74  short ry;
76 
78 typedef struct
79 {
80  float x;
81  float y;
82  float z;
83 } jo_vectorf;
84 
88 typedef struct
89 {
91 } jo_vector;
92 
94 typedef union
95 {
96  float m[4][4];
97  float table[16];
98  struct
99  {
100  float m00, m01, m02, m03;
101  float m10, m11, m12, m13;
102  float m20, m21, m22, m23;
103  float m30, m31, m32, m33;
104  };
105 } jo_matrixf;
106 
108 typedef union
109 {
110  int m[4][4];
111  int table[16];
112  struct
113  {
114  int m00, m01, m02, m03;
115  int m10, m11, m12, m13;
116  int m20, m21, m22, m23;
117  int m30, m31, m32, m33;
118  };
119 } jo_matrix;
120 
122 typedef struct __jo_size
123 {
124  unsigned short width;
125  unsigned short height;
126 } jo_size;
127 
131 typedef struct
132 {
134  unsigned short adr;
135  unsigned short size;
137 
139 typedef struct
140 {
141  unsigned short index;
142  unsigned short color_mode;
143  void *data;
145 
147 typedef struct
148 {
149  unsigned short effect;
150  unsigned short direction;
151  unsigned int color_table_index;
152  unsigned int gouraud_shading_index;
153  unsigned int fixed_scale;
155 
157 typedef union
158 {
159  float f;
160  struct
161  {
162  unsigned int sign : 1;
163  unsigned int exponent : 8;
164  unsigned int mantissa : 23;
165 
166  } field;
167 } jo_IEEE754;
168 
170 typedef struct
171 {
172  int id;
173  int size;
174  int read;
175  void *handle;
176  char *read_buffer;
178 } jo_file;
179 
181 typedef enum
182 {
185  UP,
192 
193 #endif /* !__JO_TYPES_H__ */
194 
195 /*
196 ** END OF FILE
197 */
float x
Definition: types.h:80
short rx
Definition: types.h:73
File definition.
Definition: types.h:170
unsigned short width
Definition: types.h:124
int read_index
Definition: types.h:177
unsigned int gouraud_shading_index
Definition: types.h:152
jo_pos3D
Definition: types.h:63
4x4 MATRIX for 3D computation using floating numbers
Definition: types.h:94
Definition: types.h:189
unsigned short jo_color
15 bits color type
Definition: types.h:39
Texture definition.
Definition: types.h:131
Object for 2D manipulation (storyboard) using fixed number.
Definition: types.h:61
struct __jo_size jo_size
Size struct.
unsigned int color_table_index
Definition: types.h:151
int x
Definition: types.h:53
Float IEEE 754 format.
Definition: types.h:157
unsigned short size
Definition: types.h:135
char * read_buffer
Definition: types.h:176
int y
Definition: types.h:54
Definition: types.h:185
3D position
Definition: types.h:51
Picture definition.
Definition: types.h:139
jo_2d_object_attributes
Definition: types.h:72
float z
Definition: types.h:82
4x4 MATRIX for 3D computation using fixed number
Definition: types.h:108
void * data
Definition: types.h:143
Definition: types.h:183
Size struct.
Definition: types.h:122
unsigned short height
Definition: types.h:125
jo_size
Definition: types.h:133
Sprite attributes.
Definition: types.h:147
Definition: types.h:184
float f
Definition: types.h:159
2D position
Definition: types.h:42
unsigned short adr
Definition: types.h:134
jo_pos3D
Definition: types.h:90
jo_8_directions
8 directions definition
Definition: types.h:181
Object for 3D manipulation (storyboard) using fixed number.
Definition: types.h:70
int read
Definition: types.h:174
Definition: types.h:188
unsigned short effect
Definition: types.h:149
short rz
Definition: types.h:64
int z
Definition: types.h:55
Definition: types.h:187
Vector for 3D computation using fixed number.
Definition: types.h:88
unsigned short index
Definition: types.h:141
unsigned short color_mode
Definition: types.h:142
int id
Definition: types.h:172
Definition: types.h:186
short ry
Definition: types.h:74
int size
Definition: types.h:173
unsigned short direction
Definition: types.h:150
unsigned int fixed_scale
Definition: types.h:153
Definition: types.h:190
void * handle
Definition: types.h:175
Vector for 3D computation using floating numbers.
Definition: types.h:78
int y
Definition: types.h:45
int x
Definition: types.h:44
float y
Definition: types.h:81