UFO: Alien Invasion
ufotypes.h
Go to the documentation of this file.
1
9/*
10Copyright (C) 2002-2022 UFO: Alien Invasion.
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26*/
27
28#pragma once
29
30#include <stddef.h>
31#include <stdint.h>
32
33#ifndef byte
34typedef uint8_t byte;
35#endif
36
37typedef float vec_t;
38typedef vec_t vec2_t[2];
39typedef vec_t vec3_t[3];
40typedef vec_t vec4_t[4];
41typedef vec_t vec5_t[5];
42
43/* structures that can be mapped to vector arrays since they have the same size. */
44typedef struct vec2_struct_s {
45 vec_t a1, a2;
47typedef struct vec3_struct_s {
48 vec_t a1, a2, a3;
50typedef struct vec4_struct_s {
51 vec_t a1, a2, a3, a4;
53typedef struct vec5_struct_s {
54 vec_t a1, a2, a3, a4, a5;
56
57typedef byte pos_t;
58typedef pos_t pos3_t[3];
59typedef pos_t pos4_t[4];
60
61/* structures that can be mapped to position arrays since they have the same size. */
62typedef struct pos3_struct_s {
63 pos_t a1, a2, a3;
65typedef struct pos4_struct_s {
66 pos_t a1, a2, a3, a4;
68
69typedef int ipos_t;
70typedef ipos_t ipos3_t[3];
71
72/* structures that can be mapped to integer position arrays since they have the same size. */
73typedef struct ipos3_struct_s {
74 ipos_t a1, a2, a3;
76
77typedef int32_t actorSizeEnum_t;
78
79#if defined _WIN32
80# define UFO_SIZE_T "%Iu"
81#else
82#ifdef __cplusplus
83#if __WORDSIZE == 64
84# define UFO_SIZE_T "%lu"
85#else
86# define UFO_SIZE_T "%u"
87#endif
88#else
89# define UFO_SIZE_T "%zu"
90#endif
91#endif
ipos_t a1
Definition: ufotypes.h:74
pos_t a1
Definition: ufotypes.h:63
pos_t a1
Definition: ufotypes.h:66
vec_t a1
Definition: ufotypes.h:45
vec_t a1
Definition: ufotypes.h:48
vec_t a1
Definition: ufotypes.h:51
vec_t a1
Definition: ufotypes.h:54
pos_t pos3_t[3]
Definition: ufotypes.h:58
byte pos_t
Definition: ufotypes.h:57
float vec_t
Definition: ufotypes.h:37
vec_t vec5_t[5]
Definition: ufotypes.h:41
vec_t vec3_t[3]
Definition: ufotypes.h:39
ipos_t ipos3_t[3]
Definition: ufotypes.h:70
int32_t actorSizeEnum_t
Definition: ufotypes.h:77
int ipos_t
Definition: ufotypes.h:69
vec_t vec4_t[4]
Definition: ufotypes.h:40
uint8_t byte
Definition: ufotypes.h:34
pos_t pos4_t[4]
Definition: ufotypes.h:59
vec_t vec2_t[2]
Definition: ufotypes.h:38