1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef R1_VERT_HH
|
---|
10 | #define R1_VERT_HH
|
---|
11 |
|
---|
12 | #include "arch.hh"
|
---|
13 | #include "math/num_type.hh"
|
---|
14 | #include "math/point.hh"
|
---|
15 |
|
---|
16 | // when calling a render_api's function, you need only specify r1_vert parameters
|
---|
17 | // that will actually be used. i.e. if you have alpha off, you do not need to specify a
|
---|
18 |
|
---|
19 | class r1_3d_point_class : public i4_3d_vector
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | float pad;
|
---|
23 | };
|
---|
24 |
|
---|
25 | typedef struct //dont reorder this stuff
|
---|
26 | {
|
---|
27 | r1_3d_point_class v; // 3d position (not used for rendering)
|
---|
28 |
|
---|
29 | float px, py, // projected x & y
|
---|
30 | s,t, // texture coordinates 0..1
|
---|
31 | r,g,b, // shading values, if white light mode r acts at white
|
---|
32 | a, // alpha 0..1
|
---|
33 | w; // 1/z used for w-buffering and perspective correct tmapping
|
---|
34 |
|
---|
35 | w8 outcode; // used for clipping (calculated by r1_full_clip)
|
---|
36 | w8 pad0;
|
---|
37 | w8 pad1;
|
---|
38 | w8 pad2; //pad so its 8 bytes
|
---|
39 |
|
---|
40 | void set_color(i4_float _r, i4_float _g, i4_float _b, i4_float _a=1.) { r=_r; g=_g; b=_b; a=_a; }
|
---|
41 | void set_st(i4_float _s, i4_float _t) { s=_s; t=_t; }
|
---|
42 |
|
---|
43 | i4_3d_point_class *point() { return (i4_3d_point_class *)&v; }
|
---|
44 | // creates a pointer to a i4_3d_point_class that represents the
|
---|
45 | // same values in v
|
---|
46 | } r1_vert;
|
---|
47 |
|
---|
48 | #endif
|
---|