File: types.h

package info (click to toggle)
boson 0.13-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 12,992 kB
  • ctags: 29,287
  • sloc: cpp: 203,902; ansic: 9,959; makefile: 75; sh: 64; sed: 47
file content (148 lines) | stat: -rw-r--r-- 4,495 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* -*- c -*- */
#ifndef INCLUDED_LIB3DS_TYPES_H
#define INCLUDED_LIB3DS_TYPES_H
/*
 * The 3D Studio File Format Library
 * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
 * All rights reserved.
 *
 * This program is  free  software;  you can redistribute it and/or modify it
 * under the terms of the  GNU Lesser General Public License  as published by 
 * the  Free Software Foundation;  either version 2.1 of the License,  or (at 
 * your option) any later version.
 *
 * This  program  is  distributed in  the  hope that it will  be useful,  but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public  
 * License for more details.
 *
 * You should  have received  a copy of the GNU Lesser General Public License
 * along with  this program;  if not, write to the  Free Software Foundation,
 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: types.h,v 1.18 2005/01/11 16:12:52 madmac Exp $
 */
#ifdef __cplusplus
extern "C" {
#endif

#if defined (UBUILD_SHARED) && defined(_WIN32) && (!defined(__GNUC__))
#ifdef LIB3DS_EXPORT
#define LIB3DSAPI __declspec(dllexport)
#else               
#define LIB3DSAPI __declspec(dllimport)
#endif           
#else
#define LIB3DSAPI
#endif

#define LIB3DS_TRUE 1
#define LIB3DS_FALSE 0

typedef int Lib3dsBool;
typedef unsigned char Lib3dsByte;
typedef unsigned short int Lib3dsWord;
typedef unsigned long Lib3dsDword;
typedef signed char Lib3dsIntb;
typedef signed short int Lib3dsIntw;
typedef signed long Lib3dsIntd;
typedef float Lib3dsFloat;
typedef double Lib3dsDouble;

typedef float Lib3dsVector[3];
typedef float Lib3dsTexel[2];
typedef float Lib3dsQuat[4];
typedef float Lib3dsMatrix[4][4];
typedef float Lib3dsRgb[3];
typedef float Lib3dsRgba[4];

#define LIB3DS_EPSILON (1e-8)
#define LIB3DS_PI 3.14159265358979323846
#define LIB3DS_TWOPI (2.0*LIB3DS_PI)
#define LIB3DS_HALFPI (LIB3DS_PI/2.0)
#define LIB3DS_RAD_TO_DEG(x) ((180.0/LIB3DS_PI)*(x))
#define LIB3DS_DEG_TO_RAD(x) ((LIB3DS_PI/180.0)*(x))
  
#ifndef INCLUDED_STDIO_H
#define INCLUDED_STDIO_H
#include <stdio.h>
#endif

#ifdef _DEBUG
  #ifndef ASSERT
  #include <assert.h>
  #define ASSERT(__expr) assert(__expr)
  #endif
  #define LIB3DS_ERROR_LOG \
    {printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
#else 
  #ifndef ASSERT
  #define ASSERT(__expr)
  #endif
  #define LIB3DS_ERROR_LOG
#endif

typedef struct _Lib3dsIo Lib3dsIo;
typedef struct _Lib3dsFile Lib3dsFile;
typedef struct _Lib3dsBackground Lib3dsBackground;
typedef struct _Lib3dsAtmosphere Lib3dsAtmosphere;
typedef struct _Lib3dsShadow Lib3dsShadow;
typedef struct _Lib3dsViewport Lib3dsViewport;
typedef struct _Lib3dsMaterial Lib3dsMaterial;
typedef struct _Lib3dsFace Lib3dsFace; 
typedef struct _Lib3dsBoxMap Lib3dsBoxMap; 
typedef struct _Lib3dsMapData Lib3dsMapData; 
typedef struct _Lib3dsMesh Lib3dsMesh;
typedef struct _Lib3dsCamera Lib3dsCamera;
typedef struct _Lib3dsLight Lib3dsLight;
typedef struct _Lib3dsBoolKey Lib3dsBoolKey;
typedef struct _Lib3dsBoolTrack Lib3dsBoolTrack;
typedef struct _Lib3dsLin1Key Lib3dsLin1Key;
typedef struct _Lib3dsLin1Track Lib3dsLin1Track;
typedef struct _Lib3dsLin3Key Lib3dsLin3Key;
typedef struct _Lib3dsLin3Track Lib3dsLin3Track;
typedef struct _Lib3dsQuatKey Lib3dsQuatKey;
typedef struct _Lib3dsQuatTrack Lib3dsQuatTrack;
typedef struct _Lib3dsMorphKey Lib3dsMorphKey;
typedef struct _Lib3dsMorphTrack Lib3dsMorphTrack;

typedef enum _Lib3dsNodeTypes {
  LIB3DS_UNKNOWN_NODE =0,
  LIB3DS_AMBIENT_NODE =1,
  LIB3DS_OBJECT_NODE  =2,
  LIB3DS_CAMERA_NODE  =3,
  LIB3DS_TARGET_NODE  =4,
  LIB3DS_LIGHT_NODE   =5,
  LIB3DS_SPOT_NODE    =6
} Lib3dsNodeTypes;

typedef struct _Lib3dsNode Lib3dsNode;

typedef union _Lib3dsUserData {
    void *p;
    Lib3dsIntd i;
    Lib3dsDword d;
    Lib3dsFloat f;
    Lib3dsMaterial *material;
    Lib3dsMesh *mesh;
    Lib3dsCamera *camera;
    Lib3dsLight *light;
    Lib3dsNode *node;
} Lib3dsUserData;

#ifndef	LIB3DS_EXPORT
	/* The purpose of this variable is to force a recompile of any code
	 * that links to the lib3ds library whenever there is an incompatible
	 * change in the header files.  It should be sufficient to include
	 * any lib3ds header file in any source file to satisfy this dependency.
	 *
	 * This variable will be updated any time there is an incompatible change
	 * in the lib3ds data structures.
	 */
//	int lib3ds_version1_3;
#endif

#ifdef __cplusplus
}
#endif
#endif