root/OpenSceneGraph/trunk/src/osgPlugins/3ds/types.h @ 6461

Revision 6461, 4.0 kB (checked in by robert, 8 years ago)

From Eric Wing, pedantic warning fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[8]1/* -*- c -*- */
2#ifndef INCLUDED_LIB3DS_TYPES_H
3#define INCLUDED_LIB3DS_TYPES_H
4/*
5 * The 3D Studio File Format Library
6 * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
7 * All rights reserved.
8 *
9 * This program is  free  software;  you can redistribute it and/or modify it
10 * under the terms of the  GNU Lesser General Public License  as published by
11 * the  Free Software Foundation;  either version 2.1 of the License,  or (at
12 * your option) any later version.
13 *
14 * This  program  is  distributed in  the  hope that it will  be useful,  but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public 
17 * License for more details.
18 *
19 * You should  have received  a copy of the GNU Lesser General Public License
20 * along with  this program;  if not, write to the  Free Software Foundation,
21 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * $Id$
24 */
25#ifdef __cplusplus
26extern "C" {
27#endif
28
[151]29/*
30 * #if defined (_LIB3DS_DLL) && defined(_WIN32) && (!defined(__GNUC__))
31 * #ifdef LIB3DS_EXPORT
32 * #define LIB3DSAPI __declspec(dllexport)
33 * #else               
34 * #define LIB3DSAPI __declspec(dllimport)
35 * #endif           
36 * #else
37 * #define LIB3DSAPI
38 * #endif
39 */
40// within the OSG just use the libary inline, no need to export symbols.
[8]41#define LIB3DSAPI
42
43#define LIB3DS_TRUE 1
44#define LIB3DS_FALSE 0
45
46typedef int Lib3dsBool;
47typedef unsigned char Lib3dsByte;
[5453]48typedef unsigned short Lib3dsWord;
49typedef unsigned int Lib3dsDword;
[8]50typedef signed char Lib3dsIntb;
[5453]51typedef signed short Lib3dsIntw;
52typedef signed int Lib3dsIntd;
[8]53typedef float Lib3dsFloat;
54typedef double Lib3dsDouble;
55
56typedef float Lib3dsVector[3];
57typedef float Lib3dsTexel[2];
58typedef float Lib3dsQuat[4];
59typedef float Lib3dsMatrix[4][4];
60typedef float Lib3dsRgb[3];
61typedef float Lib3dsRgba[4];
62
63#define LIB3DS_EPSILON (1e-8)
64#define LIB3DS_PI 3.14159265358979323846
65#define LIB3DS_TWOPI (2.0*LIB3DS_PI)
66#define LIB3DS_HALFPI (LIB3DS_PI/2.0)
67#define LIB3DS_DEG(x) ((180.0/LIB3DS_PI)*(x))
68#define LIB3DS_RAD(x) ((LIB3DS_PI/180.0)*(x))
69 
70#ifndef INCLUDED_STDIO_H
71#define INCLUDED_STDIO_H
72#include <stdio.h>
73#endif
74
75#ifdef _DEBUG
76  #ifndef ASSERT
77  #include <assert.h>
78  #define ASSERT(__expr) assert(__expr)
79  #endif
80  #define LIB3DS_ERROR_LOG \
81    {printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
82#else 
83  #ifndef ASSERT
84  #define ASSERT(__expr)
85  #endif
86  #define LIB3DS_ERROR_LOG
87#endif
88
89typedef struct _Lib3dsFile Lib3dsFile;
90typedef struct _Lib3dsBackground Lib3dsBackground;
91typedef struct _Lib3dsAtmosphere Lib3dsAtmosphere;
92typedef struct _Lib3dsShadow Lib3dsShadow;
93typedef struct _Lib3dsViewport Lib3dsViewport;
94typedef struct _Lib3dsMaterial Lib3dsMaterial;
95typedef struct _Lib3dsFace Lib3dsFace;
96typedef struct _Lib3dsBoxMap Lib3dsBoxMap;
97typedef struct _Lib3dsMapData Lib3dsMapData;
98typedef struct _Lib3dsMesh Lib3dsMesh;
99typedef struct _Lib3dsCamera Lib3dsCamera;
100typedef struct _Lib3dsLight Lib3dsLight;
101typedef struct _Lib3dsBoolKey Lib3dsBoolKey;
102typedef struct _Lib3dsBoolTrack Lib3dsBoolTrack;
103typedef struct _Lib3dsLin1Key Lib3dsLin1Key;
104typedef struct _Lib3dsLin1Track Lib3dsLin1Track;
105typedef struct _Lib3dsLin3Key Lib3dsLin3Key;
106typedef struct _Lib3dsLin3Track Lib3dsLin3Track;
107typedef struct _Lib3dsQuatKey Lib3dsQuatKey;
108typedef struct _Lib3dsQuatTrack Lib3dsQuatTrack;
109typedef struct _Lib3dsMorphKey Lib3dsMorphKey;
110typedef struct _Lib3dsMorphTrack Lib3dsMorphTrack;
111
112typedef enum _Lib3dsNodeTypes {
113  LIB3DS_UNKNOWN_NODE =0,
114  LIB3DS_AMBIENT_NODE =1,
115  LIB3DS_OBJECT_NODE  =2,
116  LIB3DS_CAMERA_NODE  =3,
117  LIB3DS_TARGET_NODE  =4,
118  LIB3DS_LIGHT_NODE   =5,
119  LIB3DS_SPOT_NODE    =6
120} Lib3dsNodeTypes;
121
122typedef struct _Lib3dsNode Lib3dsNode;
123
124typedef union _Lib3dsUserData {
125    void *p;
126    Lib3dsIntd i;
127    Lib3dsDword d;
128    Lib3dsFloat f;
129    Lib3dsMaterial *material;
130    Lib3dsMesh *mesh;
131    Lib3dsCamera *camera;
132    Lib3dsLight *light;
133    Lib3dsNode *node;
134} Lib3dsUserData;
135
136#ifdef __cplusplus
[6461]137}
[8]138#endif
139#endif
140
141
142
143
144
145
146
147
Note: See TracBrowser for help on using the browser.