root/OpenSceneGraph/trunk/src/osgPlugins/lwo/old_lw.h @ 13041

Revision 13041, 2.7 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * Copyright (C) 1998,1999 Janne Löf <jlof@mail.student.oulu.fi>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18
19
20#ifndef LW_H
21#define LW_H
22
23#include <osg/GL>
24#include <iostream>
25
26#define LW_MAX_POINTS   200
27#define LW_MAX_NAME_LEN 500
28
29enum lwTextureFlags {
30  X_AXIS = 0x01,
31  Y_AXIS = 0x02,
32  Z_AXIS = 0x04,
33  WORLD_COORDS = 0x10,
34  NEGATIVE_IMAGE = 0x20,
35  PIXEL_BLENDING = 0x40,
36  ANTIALIASING = 0x80
37};
38
39enum lwTextureWrap {
40  BLACK = 0,
41  CLAMP = 1,
42  REPEAT = 2,
43  MIRROR_REPEAT = 3
44};
45
46struct lwTexture
47{
48  char name[LW_MAX_NAME_LEN];
49  unsigned int flags;
50  lwTextureWrap u_wrap, v_wrap;
51  GLfloat sx,sy,sz;
52  GLfloat cx,cy,cz;
53
54  void init() {
55    name[0] = 0;
56    flags = 0;
57    u_wrap = v_wrap = REPEAT;
58    sx = sy = sz = 0.0f;
59    cx = cy = cz = 0.0f;
60  }
61};
62
63struct lwMaterial
64{
65  char name[LW_MAX_NAME_LEN];
66  GLfloat r,g,b;
67  struct lwTexture ctex;
68
69  lwMaterial()
70  {
71    r=1.0f;
72    g=1.0f;
73    b=1.0f;
74    name[0] = 0;
75    ctex.init();
76  }
77};
78
79struct lwFace
80{
81  int material;         /* material of this face */
82  int index_cnt;        /* number of vertices */
83  int *index;           /* index to vertex */
84  float *texcoord;      /* u,v texture coordinates */
85
86  void init()
87  {
88    material = 0;       /* material of this face */
89    index_cnt = 0;      /* number of vertices */
90    index = 0;          /* index to vertex */
91    texcoord = 0;       /* u,v texture coordinates */
92  }
93
94};
95
96struct lwObject
97{
98  int face_cnt;
99  lwFace *face;
100
101  int material_cnt;
102  lwMaterial *material;
103
104  int vertex_cnt;
105  GLfloat *vertex;
106
107  void init()
108  {
109    face_cnt = 0;
110    face = 0;
111
112    material_cnt=0;
113    material = 0;
114
115    vertex_cnt=0;
116    vertex = 0;
117  }
118};
119
120
121typedef int gint32;
122typedef unsigned int guint32;
123typedef int gint;
124
125
126gint      lw_is_lwobject(const char     *lw_file);
127lwObject *lw_object_read(const char     *lw_file, std::ostream& output);
128void      lw_object_free(      lwObject *lw_object);
129
130GLfloat   lw_object_radius(const lwObject *lw_object);
131void      lw_object_scale (lwObject *lw_object, GLfloat scale);
132
133#endif /* LW_H */
Note: See TracBrowser for help on using the browser.