Merge branch 'master' of github.com:Warzone2100/warzone2100

master
Per Inge Mathisen 2011-12-29 18:02:11 +01:00
commit cf4dc9c9ad
21 changed files with 322 additions and 404 deletions

View File

@ -1,39 +1,28 @@
PIE 2
TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVELS 2
LEVEL 1
POINTS 16
5 3 -23
5 3 -42
5 5 -42
5 5 -23
4 4 -23
4 4 -42
7 4 -42
7 4 -23
-5 3 -23
-5 3 -42
-5 5 -42
-5 5 -23
-7 4 -23
-7 4 -42
-4 4 -42
-4 4 -23
POLYGONS 16
200 3 0 1 2 211 73 211 55 207 55
200 3 0 2 3 211 73 207 55 207 73
200 3 3 2 1 207 73 207 55 211 55
200 3 3 1 0 207 73 211 55 211 73
200 3 4 5 6 211 73 211 55 207 55
200 3 4 6 7 211 73 207 55 207 73
200 3 7 6 5 207 73 207 55 211 55
200 3 7 5 4 207 73 211 55 211 73
200 3 8 9 10 211 73 211 55 207 55
200 3 8 10 11 211 73 207 55 207 73
200 3 11 10 9 207 73 207 55 211 55
200 3 11 9 8 207 73 211 55 211 73
200 3 12 13 14 211 73 211 55 207 55
200 3 12 14 15 211 73 207 55 207 73
200 3 15 14 13 207 73 207 55 211 55
200 3 15 13 12 207 73 211 55 211 73
POINTS 4
-8 0 13
-8 0 -13
-6 0 -13
-6 0 13
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
-7 0 0
LEVEL 2
POINTS 4
6 0 13
6 0 -13
8 0 -13
8 0 13
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
7 0 0

View File

@ -1,71 +1,52 @@
PIE 2
TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVELS 4
LEVEL 1
POINTS 32
-5 11 -16
-5 11 -36
-5 14 -36
-5 14 -16
-7 13 -16
-7 13 -36
-4 13 -36
-4 13 -16
5 11 -16
5 11 -36
5 14 -36
5 14 -16
4 13 -16
4 13 -36
7 13 -36
7 13 -16
5 3 -23
5 3 -42
5 5 -42
5 5 -23
4 4 -23
4 4 -42
7 4 -42
7 4 -23
-5 3 -23
-5 3 -42
-5 5 -42
-5 5 -23
-7 4 -23
-7 4 -42
-4 4 -42
-4 4 -23
POLYGONS 32
200 3 0 1 2 211 73 211 55 207 55
200 3 0 2 3 211 73 207 55 207 73
200 3 3 2 1 207 73 207 55 211 55
200 3 3 1 0 207 73 211 55 211 73
200 3 4 5 6 211 73 211 55 207 55
200 3 4 6 7 211 73 207 55 207 73
200 3 7 6 5 207 73 207 55 211 55
200 3 7 5 4 207 73 211 55 211 73
200 3 8 9 10 211 73 211 55 207 55
200 3 8 10 11 211 73 207 55 207 73
200 3 11 10 9 207 73 207 55 211 55
200 3 11 9 8 207 73 211 55 211 73
200 3 12 13 14 211 73 211 55 207 55
200 3 12 14 15 211 73 207 55 207 73
200 3 15 14 13 207 73 207 55 211 55
200 3 15 13 12 207 73 211 55 211 73
200 3 16 17 18 211 73 211 55 207 55
200 3 16 18 19 211 73 207 55 207 73
200 3 19 18 17 207 73 207 55 211 55
200 3 19 17 16 207 73 211 55 211 73
200 3 20 21 22 211 73 211 55 207 55
200 3 20 22 23 211 73 207 55 207 73
200 3 23 22 21 207 73 207 55 211 55
200 3 23 21 20 207 73 211 55 211 73
200 3 24 25 26 211 73 211 55 207 55
200 3 24 26 27 211 73 207 55 207 73
200 3 27 26 25 207 73 207 55 211 55
200 3 27 25 24 207 73 211 55 211 73
200 3 28 29 30 211 73 211 55 207 55
200 3 28 30 31 211 73 207 55 207 73
200 3 31 30 29 207 73 207 55 211 55
200 3 31 29 28 207 73 211 55 211 73
POINTS 4
-6 -5 4
-6 -5 -16
-4 -5 -16
-4 -5 4
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
-5 -5 -6
LEVEL 2
POINTS 4
4 -5 4
4 -5 -16
6 -5 -16
6 -5 4
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
5 -5 -6
LEVEL 3
POINTS 4
-6 5 16
-6 5 -4
-4 5 -4
-4 5 16
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
-5 5 6
LEVEL 4
POINTS 4
4 5 16
4 5 -4
6 5 -4
6 5 16
POLYGONS 2
200 3 3 2 1 207 72 207 55 210 55
200 3 3 1 0 207 72 210 55 210 72
CONNECTORS 2
1 1 0
5 5 6

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 1 -45
0 1 -54
0 7 -54
0 7 -45
-2 4 -45
-2 4 -54
2 4 -54
2 4 -45
POLYGONS 8
200 3 0 1 2 203 69 203 54 192 54
200 3 0 2 3 203 69 192 54 192 69
POINTS 4
-2 0 5
-2 0 -5
2 0 -5
2 0 5
POLYGONS 2
200 3 3 2 1 192 69 192 54 203 54
200 3 3 1 0 192 69 203 54 203 69
200 3 4 5 6 203 69 203 54 192 54
200 3 4 6 7 203 69 192 54 192 69
200 3 7 6 5 192 69 192 54 203 54
200 3 7 5 4 192 69 203 54 203 69
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 2 -46
0 2 -52
0 6 -52
0 6 -46
-1 4 -46
-1 4 -52
1 4 -52
1 4 -46
POLYGONS 8
200 3 0 1 2 203 69 203 54 192 54
200 3 0 2 3 203 69 192 54 192 69
POINTS 4
-2 0 7
-2 0 -7
2 0 -7
2 0 7
POLYGONS 2
200 3 3 2 1 192 69 192 54 203 54
200 3 3 1 0 192 69 203 54 203 69
200 3 4 5 6 203 69 203 54 192 54
200 3 4 6 7 203 69 192 54 192 69
200 3 7 6 5 192 69 192 54 203 54
200 3 7 5 4 192 69 203 54 203 69
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 4 41
0 4 -41
0 -3 -41
0 -3 41
-3 0 41
-3 0 -41
3 0 -41
POINTS 4
-3 0 41
-3 0 -41
3 0 -41
3 0 41
POLYGONS 8
200 3 0 1 2 88 128 0 128 0 135
200 3 0 2 3 88 128 0 135 88 135
200 3 3 2 1 88 135 0 135 0 128
200 3 3 1 0 88 135 0 128 88 128
200 3 4 5 6 88 128 0 128 0 135
200 3 4 6 7 88 128 0 135 88 135
200 3 7 6 5 88 135 0 135 0 128
200 3 7 5 4 88 135 0 128 88 128
POLYGONS 2
200 3 3 2 1 74 134 1 134 1 127
200 3 3 1 0 74 134 1 127 74 127
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 5 12
0 5 -12
0 -5 -12
0 -5 12
-5 0 12
-5 0 -12
5 0 -12
POINTS 4
-5 0 12
-5 0 -12
5 0 -12
5 0 12
POLYGONS 8
200 3 0 1 2 29 138 0 138 0 151
200 3 0 2 3 29 138 0 151 29 151
200 3 3 2 1 29 151 0 151 0 138
200 3 3 1 0 29 151 0 138 29 138
200 3 4 5 6 29 138 0 138 0 151
200 3 4 6 7 29 138 0 151 29 151
200 3 7 6 5 29 151 0 151 0 138
200 3 7 5 4 29 151 0 138 29 138
POLYGONS 2
200 3 3 2 1 28 137 -1 137 -1 150
200 3 3 1 0 28 137 -1 150 28 150
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 4 52
0 4 -52
0 -4 -52
0 -4 52
-4 0 52
-4 0 -52
4 0 -52
POINTS 4
-4 0 52
-4 0 -52
4 0 -52
4 0 52
POLYGONS 8
200 3 0 1 2 88 128 0 128 0 135
200 3 0 2 3 88 128 0 135 88 135
200 3 3 2 1 88 135 0 135 0 128
200 3 3 1 0 88 135 0 128 88 128
200 3 4 5 6 88 128 0 128 0 135
200 3 4 6 7 88 128 0 135 88 135
200 3 7 6 5 88 135 0 135 0 128
200 3 7 5 4 88 135 0 128 88 128
POLYGONS 2
200 3 3 2 1 74 134 1 134 1 127
200 3 3 1 0 74 134 1 127 74 127
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-23-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -12 39
0 12 39
0 12 -39
0 -12 -39
-12 0 39
12 0 39
12 0 -39
POINTS 4
-12 0 39
-12 0 -39
POLYGONS 8
200 3 0 1 2 228 195 228 181 203 181
200 3 0 2 3 228 195 203 181 203 195
200 3 3 2 1 203 195 203 181 228 181
200 3 3 1 0 203 195 228 181 228 195
200 3 4 5 6 228 195 228 181 203 181
200 3 4 6 7 228 195 203 181 203 195
200 3 7 6 5 203 195 203 181 228 181
200 3 7 5 4 203 195 228 181 228 195
12 0 -39
12 0 39
POLYGONS 2
200 3 3 2 1 227 194 202 194 202 181
200 3 3 1 0 227 194 202 181 227 181
CONNECTORS 2
1 2 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 3 21
0 3 -21
0 -3 -21
0 -3 21
-3 0 21
-3 0 -21
3 0 -21
POINTS 4
-3 0 21
-3 0 -21
3 0 -21
3 0 21
POLYGONS 8
200 3 0 1 2 19 153 0 153 0 160
200 3 0 2 3 19 153 0 160 19 160
200 3 3 2 1 19 160 0 160 0 153
200 3 3 1 0 19 160 0 153 19 153
200 3 4 5 6 19 153 0 153 0 160
200 3 4 6 7 19 153 0 160 19 160
200 3 7 6 5 19 160 0 160 0 153
200 3 7 5 4 19 160 0 153 19 153
POLYGONS 2
200 3 3 2 1 19 159 0 159 0 152
200 3 3 1 0 19 159 0 152 19 152
CONNECTORS 2
1 2 0
0 0 0

View File

@ -3,29 +3,14 @@ TYPE 200
TEXTURE 0 page-23-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 12
24 -24 0
24 25 0
-24 25 0
-24 -24 0
24 0 25
24 0 -24
-24 0 -24
-24 0 25
0 -24 24
0 25 24
0 25 -24
0 -24 -24
POLYGONS 12
200 3 0 1 2 186 255 186 227 157 227
200 3 0 2 3 186 255 157 227 157 255
200 3 3 2 1 157 255 157 227 186 227
200 3 3 1 0 157 255 186 227 186 255
200 3 4 5 6 186 255 186 227 157 227
200 3 4 6 7 186 255 157 227 157 255
200 3 7 6 5 157 255 157 227 186 227
200 3 7 5 4 157 255 186 227 186 255
200 3 8 9 10 186 255 186 227 157 227
200 3 8 10 11 186 255 157 227 157 255
200 3 11 10 9 157 255 157 227 186 227
200 3 11 9 8 157 255 186 227 186 255
POINTS 4
-24 0 24
-24 0 -24
24 0 -24
24 0 24
POLYGONS 2
200 3 3 2 1 157 253 157 226 184 226
200 3 3 1 0 157 253 184 226 184 253
CONNECTORS 2
2 2 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-23-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -9 29
0 9 29
0 9 -29
0 -9 -29
-9 0 29
9 0 29
9 0 -29
POINTS 4
-9 0 29
-9 0 -29
POLYGONS 8
200 3 0 1 2 228 195 228 181 203 181
200 3 0 2 3 228 195 203 181 203 195
200 3 3 2 1 203 195 203 181 228 181
200 3 3 1 0 203 195 228 181 228 195
200 3 4 5 6 228 195 228 181 203 181
200 3 4 6 7 228 195 203 181 203 195
200 3 7 6 5 203 195 203 181 228 181
200 3 7 5 4 203 195 228 181 228 195
9 0 -29
9 0 29
POLYGONS 2
200 3 3 2 1 227 194 202 194 202 181
200 3 3 1 0 227 194 202 181 227 181
CONNECTORS 2
1 2 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 3 88
0 3 -88
0 -3 -88
0 -3 88
-3 0 88
-3 0 -88
3 0 -88
POINTS 4
-3 0 88
-3 0 -88
3 0 -88
3 0 88
POLYGONS 8
200 3 0 1 2 61 153 41 153 41 160
200 3 0 2 3 61 153 41 160 61 160
200 3 3 2 1 61 160 41 160 41 153
200 3 3 1 0 61 160 41 153 61 153
200 3 4 5 6 61 153 41 153 41 160
200 3 4 6 7 61 153 41 160 61 160
200 3 7 6 5 61 160 41 160 41 153
200 3 7 5 4 61 160 41 153 61 153
POLYGONS 2
200 3 3 2 1 59 159 40 159 40 152
200 3 3 1 0 59 159 40 152 59 152
CONNECTORS 2
1 2 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-23-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -6 20
0 6 20
0 6 -20
0 -6 -20
-6 0 20
6 0 20
6 0 -20
POINTS 4
-6 0 20
-6 0 -20
POLYGONS 8
200 3 0 1 2 254 195 254 181 230 181
200 3 0 2 3 254 195 230 181 230 195
200 3 3 2 1 230 195 230 181 254 181
200 3 3 1 0 230 195 254 181 254 195
200 3 4 5 6 254 195 254 181 230 181
200 3 4 6 7 254 195 230 181 230 195
200 3 7 6 5 230 195 230 181 254 181
200 3 7 5 4 230 195 254 181 254 195
6 0 -20
6 0 20
POLYGONS 2
200 3 3 2 1 254 194 229 194 229 181
200 3 3 1 0 254 194 229 181 254 181
CONNECTORS 2
1 2 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -2 7
0 -2 -7
0 2 -7
0 2 7
POINTS 4
-2 0 7
-2 0 -7
2 0 -7
2 0 7
POLYGONS 8
200 3 0 1 2 206 65 206 54 203 54
200 3 0 2 3 206 65 203 54 203 65
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
200 3 4 5 6 206 65 206 54 203 54
200 3 4 6 7 206 65 203 54 203 65
200 3 7 6 5 203 65 203 54 206 54
200 3 7 5 4 203 65 206 54 206 65
CONNECTORS 2
1 1 0
0 0 0

View File

@ -1,39 +1,28 @@
PIE 2
TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVELS 2
LEVEL 1
POINTS 16
-9 -2 7
-9 -2 -7
-9 2 -7
-9 2 7
POINTS 4
-11 0 7
-11 0 -7
-7 0 -7
-7 0 7
9 -2 7
9 -2 -7
9 2 -7
9 2 7
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
CONNECTORS 2
1 1 0
-9 0 0
LEVEL 2
POINTS 4
7 0 7
7 0 -7
11 0 -7
11 0 7
POLYGONS 16
200 3 0 1 2 206 65 206 54 203 54
200 3 0 2 3 206 65 203 54 203 65
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
200 3 4 5 6 206 65 206 54 203 54
200 3 4 6 7 206 65 203 54 203 65
200 3 7 6 5 203 65 203 54 206 54
200 3 7 5 4 203 65 206 54 206 65
200 3 8 9 10 206 65 206 54 203 54
200 3 8 10 11 206 65 203 54 203 65
200 3 11 10 9 203 65 203 54 206 54
200 3 11 9 8 203 65 206 54 206 65
200 3 12 13 14 206 65 206 54 203 54
200 3 12 14 15 206 65 203 54 203 65
200 3 15 14 13 203 65 203 54 206 54
200 3 15 13 12 203 65 206 54 206 65
CONNECTORS 2
1 1 0
9 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -2 14
0 -2 -14
0 2 -14
0 2 14
POINTS 4
-2 0 14
-2 0 -14
2 0 -14
2 0 14
POLYGONS 8
200 3 0 1 2 206 65 206 54 203 54
200 3 0 2 3 206 65 203 54 203 65
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
200 3 4 5 6 206 65 206 54 203 54
200 3 4 6 7 206 65 203 54 203 65
200 3 7 6 5 203 65 203 54 206 54
200 3 7 5 4 203 65 206 54 206 65
CONNECTORS 2
1 1 0
0 0 0

View File

@ -1,39 +1,28 @@
PIE 2
TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVELS 2
LEVEL 1
POINTS 16
-9 -2 14
-9 -2 -14
-9 2 -14
-9 2 14
POINTS 4
-11 0 14
-11 0 -14
-7 0 -14
-7 0 14
9 -2 14
9 -2 -14
9 2 -14
9 2 14
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
CONNECTORS 2
1 1 0
-9 0 0
LEVEL 2
POINTS 4
7 0 14
7 0 -14
11 0 -14
11 0 14
POLYGONS 16
200 3 0 1 2 206 65 206 54 203 54
200 3 0 2 3 206 65 203 54 203 65
POLYGONS 2
200 3 3 2 1 203 65 203 54 206 54
200 3 3 1 0 203 65 206 54 206 65
200 3 4 5 6 206 65 206 54 203 54
200 3 4 6 7 206 65 203 54 203 65
200 3 7 6 5 203 65 203 54 206 54
200 3 7 5 4 203 65 206 54 206 65
200 3 8 9 10 206 65 206 54 203 54
200 3 8 10 11 206 65 203 54 203 65
200 3 11 10 9 203 65 203 54 206 54
200 3 11 9 8 203 65 206 54 206 65
200 3 12 13 14 206 65 206 54 203 54
200 3 12 14 15 206 65 203 54 203 65
200 3 15 14 13 203 65 203 54 206 54
200 3 15 13 12 203 65 206 54 206 65
CONNECTORS 2
1 1 0
9 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-21-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 -7 17
0 -7 -17
0 7 -17
0 7 17
-7 0 17
-7 0 -17
7 0 -17
POINTS 4
-7 0 17
-7 0 -17
7 0 -17
7 0 17
POLYGONS 8
200 3 0 1 2 203 74 203 54 192 54
200 3 0 2 3 203 74 192 54 192 74
POLYGONS 2
200 3 3 2 1 192 74 192 54 203 54
200 3 3 1 0 192 74 203 54 203 74
200 3 4 5 6 203 74 203 54 192 54
200 3 4 6 7 203 74 192 54 192 74
200 3 7 6 5 192 74 192 54 203 54
200 3 7 5 4 192 74 203 54 203 74
CONNECTORS 2
1 1 0
0 0 0

View File

@ -3,21 +3,14 @@ TYPE 200
TEXTURE 0 page-18-fx.png 256 256
LEVELS 1
LEVEL 1
POINTS 8
0 7 17
0 7 -17
0 -7 -17
0 -7 17
-7 0 17
-7 0 -17
7 0 -17
POINTS 4
-7 0 17
-7 0 -17
7 0 -17
7 0 17
POLYGONS 8
200 3 0 1 2 29 138 0 138 0 151
200 3 0 2 3 29 138 0 151 29 151
200 3 3 2 1 29 151 0 151 0 138
200 3 3 1 0 29 151 0 138 29 138
200 3 4 5 6 29 138 0 138 0 151
200 3 4 6 7 29 138 0 151 29 151
200 3 7 6 5 29 151 0 151 0 138
200 3 7 5 4 29 151 0 138 29 138
POLYGONS 2
200 3 3 2 1 28 137 -1 137 -1 150
200 3 3 1 0 28 137 -1 150 28 150
CONNECTORS 2
1 1 0
0 0 0

View File

@ -135,6 +135,12 @@ void NotifyUserOfError(char *msg);
/******************** Variables ********************/
// Should be cleaned up properly and be put in structures.
// Initialised at start of drawTiles().
// In model coordinates where x is east, y is up and z is north, rather than world coordinates where x is east, y is south and z is up.
// To get the real camera position, still need to add Vector3i(player.p.x, 0, player.p.z).
static Vector3i actualCameraPosition;
bool bRender3DOnly;
static bool bRangeDisplay = false;
static SDWORD rangeCenterX,rangeCenterY,rangeRadius;
@ -308,6 +314,16 @@ static const int BLUEPRINT_OPACITY=120;
/******************** Functions ********************/
static inline void rotateSomething(int &x, int &y, uint16_t angle)
{
int64_t cra = iCos(angle), sra = iSin(angle);
int newX = (x*cra - y*sra)>>16;
int newY = (x*sra + y*cra)>>16;
x = newX;
y = newY;
}
void NotifyUserOfError(char *msg)
{
errorWaiting = true;
@ -950,20 +966,35 @@ static void drawTiles(iView *player)
/* Push identity matrix onto stack */
pie_MatBegin();
actualCameraPosition = Vector3i(0, 0, 0);
/* Set the camera position */
pie_TRANSLATE(0, 0, distance);
actualCameraPosition.z -= distance;
// Now, scale the world according to what resolution we're running in
pie_MatScale(pie_GetResScalingFactor() / 100.f);
actualCameraPosition.z /= pie_GetResScalingFactor() / 100.f;
/* Rotate for the player */
pie_MatRotZ(player->r.z);
pie_MatRotX(player->r.x);
pie_MatRotY(player->r.y);
rotateSomething(actualCameraPosition.x, actualCameraPosition.y, -player->r.z);
rotateSomething(actualCameraPosition.y, actualCameraPosition.z, -player->r.x);
rotateSomething(actualCameraPosition.z, actualCameraPosition.x, -player->r.y);
/* Translate */
pie_TRANSLATE(0, -player->p.y, 0);
actualCameraPosition.y -= -player->p.y;
// Not sure if should do this here or whenever using, since this transform seems to be done all over the place.
//actualCameraPosition -= Vector3i(-player->p.x, 0, player->p.z);
// this also detemines the length of the shadows
theSun = getTheSun();
pie_BeginLighting(&theSun, getDrawShadows());
@ -1238,9 +1269,29 @@ void renderProjectile(PROJECTILE *psCurr)
/*Need to draw the graphic depending on what the projectile is doing - hitting target,
missing target, in flight etc - JUST DO IN FLIGHT FOR NOW! */
pIMD = psStats->pInFlightGraphic;
//unsigned faceInFlight = psStats->faceInFlight;
if (clipXY(st.pos.x, st.pos.y))
for (; pIMD != NULL; pIMD = pIMD->next)
{
bool rollToCamera = false;
bool pitchToCamera = false;
bool additive = psStats->weaponSubClass == WSC_ROCKET || psStats->weaponSubClass == WSC_MISSILE || psStats->weaponSubClass == WSC_SLOWROCKET || psStats->weaponSubClass == WSC_SLOWMISSILE;
if (pIMD->nconnectors >= 2)
{
switch (pIMD->connectors[0].x)
{
case 1: rollToCamera = true; break;
case 2: rollToCamera = true; pitchToCamera = true; break;
}
switch (pIMD->connectors[0].y)
{
case 1: additive = false; break;
case 2: additive = true; break;
}
}
/* Get bullet's x coord */
dv.x = st.pos.x - player.p.x;
@ -1251,20 +1302,51 @@ void renderProjectile(PROJECTILE *psCurr)
dv.y = st.pos.z;
/* Set up the matrix */
pie_MatBegin();
Vector3i camera = actualCameraPosition;
/* Translate to the correct position */
pie_TRANSLATE(dv.x,dv.y,dv.z);
camera -= Vector3i(dv.x, dv.y, dv.z);
/* Rotate it to the direction it's facing */
imdRot2.y = st.rot.direction;
pie_MatRotY(-imdRot2.y);
rotateSomething(camera.z, camera.x, -(-imdRot2.y));
/* pitch it */
imdRot2.x = st.rot.pitch;
pie_MatRotX(imdRot2.x);
rotateSomething(camera.y, camera.z, -imdRot2.x);
if (psStats->weaponSubClass == WSC_ROCKET || psStats->weaponSubClass == WSC_MISSILE
|| psStats->weaponSubClass == WSC_SLOWROCKET || psStats->weaponSubClass == WSC_SLOWMISSILE)
if (pitchToCamera || rollToCamera)
{
// Centre on projectile (relevant for twin projectiles).
pie_TRANSLATE(pIMD->connectors[1].x, pIMD->connectors[1].y, pIMD->connectors[1].z);
camera -= Vector3i(pIMD->connectors[1].x, pIMD->connectors[1].y, pIMD->connectors[1].z);
}
if (pitchToCamera)
{
imdRot2.x = iAtan2(camera.z, camera.y);
pie_MatRotX(imdRot2.x);
rotateSomething(camera.y, camera.z, -imdRot2.x);
}
if (rollToCamera)
{
imdRot2.z = -iAtan2(camera.x, camera.y);
pie_MatRotZ(imdRot2.z);
rotateSomething(camera.x, camera.y, -imdRot2.z);
}
if (pitchToCamera || rollToCamera)
{
// Undo centre on projectile (relevant for twin projectiles).
pie_TRANSLATE(-pIMD->connectors[1].x, -pIMD->connectors[1].y, -pIMD->connectors[1].z);
camera -= Vector3i(-pIMD->connectors[1].x, -pIMD->connectors[1].y, -pIMD->connectors[1].z);
}
if (additive)
{
pie_Draw3DShape(pIMD, 0, 0, WZCOL_WHITE, pie_ADDITIVE, 164);
}

View File

@ -1720,6 +1720,7 @@ static void renderExplosionEffect(const EFFECT *psEffect)
if(TEST_FACING(psEffect))
{
/* Always face the viewer! */
// TODO This only faces towards the viewer, if the effect is in the middle of the screen... It draws the effect parallel with the screens near/far planes.
pie_MatRotY(-player.r.y);
pie_MatRotX(-player.r.x);
}