-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsparrowPrimitiveDrawingThread.h
136 lines (133 loc) · 2.82 KB
/
sparrowPrimitiveDrawingThread.h
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
/* This file is part of sparrow3d.
* Sparrow3d is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Sparrow3d 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar. If not, see <http://www.gnu.org/licenses/>
*
* For feedback and questions about my Files and Projects please mail me,
* Alexander Matthes (Ziz) , zizsdl_at_googlemail.com */
#include "sparrow3d.h"
#include <SDL.h>
typedef struct {
Sint32 mode; //0 triangle, 1 texTriangle, 2 perspectiveTexTriangle, 3 rectangle, 4 rectangleBorder, 5 ellipse, 6 ellipseBorder
//informations for setPixel:
Uint16* texturePixel;
Sint32 textureX;
Sint32 textureScanLine;
Sint32 textureY;
Uint8 pattern[8];
//informations for the "tree of choices" in the different functions (2^5 = 32 states)
Sint32 zTest;
Sint32 zSet;
Sint32 alphaTest;
Sint32 usePattern;
Sint32 blending;
union {
struct {
Sint32 x1;
Sint32 y1;
Sint32 z1;
Sint32 x2;
Sint32 y2;
Sint32 z2;
Sint32 x3;
Sint32 y3;
Sint32 z3;
Uint32 color; } triangle;
struct {
Sint32 x1;
Sint32 y1;
Sint32 z1;
Sint32 u1;
Sint32 v1;
Sint32 x2;
Sint32 y2;
Sint32 z2;
Sint32 u2;
Sint32 v2;
Sint32 x3;
Sint32 y3;
Sint32 z3;
Sint32 u3;
Sint32 v3;
Uint32 color; } texTriangle;
struct {
Sint32 x1;
Sint32 y1;
Sint32 z1;
Sint32 u1;
Sint32 v1;
Sint32 w1;
Sint32 x2;
Sint32 y2;
Sint32 z2;
Sint32 u2;
Sint32 v2;
Sint32 w2;
Sint32 x3;
Sint32 y3;
Sint32 z3;
Sint32 u3;
Sint32 v3;
Sint32 w3;
Uint32 color; } perspectiveTexTriangle;
struct {
Sint32 x1;
Sint32 y1;
Sint32 x2;
Sint32 y2;
Sint32 z;
Uint32 color; } rectangle;
struct {
Sint32 x1;
Sint32 y1;
Sint32 x2;
Sint32 y2;
Sint32 z;
Sint32 bx;
Sint32 by;
Uint32 color; } rectangleBorder;
struct {
Sint32 x1;
Sint32 y1;
Sint32 rxl;
Sint32 rxr;
Sint32 rx;
Sint32 ryl;
Sint32 ryr;
Sint32 ry;
Sint32 z;
Uint32 color; } ellipse;
struct {
Sint32 x1;
Sint32 y1;
Sint32 rxl;
Sint32 rxr;
Sint32 rx;
Sint32 ryl;
Sint32 ryr;
Sint32 ry;
Sint32 z;
Sint32 bx;
Sint32 by;
Uint32 color; } ellipseBorder;
struct {
Sint32 x1;
Sint32 x3;
Sint32 y1;
Sint32 y3;
Sint32 sx;
Sint32 sy;
Sint32 w;
Sint32 h; } rotozoom;
} primitive;
} type_spScanLineCache;
int sp_intern_drawing_thread(void* reserved);