Rise
The Vieneo Province
Loading...
Searching...
No Matches
renderer.cpp
Go to the documentation of this file.
1#include "renderer.h"
2#include "VehicleVisibility.h"
3#include "ShipDrawBatch.h"
4#include "Viewscreen.h"
7#include "ShipSurfaceLights.h"
8#include "ShipLightSprites.h"
10#include <optional>
11
12#include <fcntl.h> // For _O_RDWR, _O_BINARY, _O_RDONLY, O_TEXT
13#include <sys/stat.h> // For _S_IWRITE, _S_IREAD
14#include "../UI/TextHelper.h"
15
16#include "../resource.h"
17#include "../MathUtilities.h"
18
19float renderer::timepassed = 0.0f;
20
22{
23 viewscreen = ptr;
24 logger = ptr->logger;
25}
26
27void renderer::LoadTextures(Rendering::RenderDevice* pd3dDevice, short* stage, short* instage)
28{
29 logger->AddToCallStack("renderer::LoadTextures");
30
31 short t;
32
33 RiseMath::Matrix matScale;
36
37 // Leave room for the shader status above the continuation prompt in the
38 // existing loading window, without changing its size or the font size.
40 txtHelper.Begin();
41 txtHelper.SetInsertionPos(5, 5);
42 txtHelper.SetForegroundColor(0xFFFF00FF);
43
44 if (*stage >= 0)
45 {
46#ifdef _WIN64
47#ifdef _DEBUG
48 txtHelper.DrawTextLine(L"Welcome to Rise: The Vieneo Province! (64-bit debug)");
49#else
50 txtHelper.DrawTextLine(L"Welcome to Rise: The Vieneo Province! (64-bit)");
51#endif
52#else
53#ifdef _DEBUG
54 txtHelper.DrawTextLine(L"Welcome to Rise: The Vieneo Province! (32-bit debug)");
55#else
56 txtHelper.DrawTextLine(L"Welcome to Rise: The Vieneo Province! (32-bit)");
57#endif
58#endif
59
60 if (*stage == 0)
61 {
62#ifdef _WIN64
63#ifdef _DEBUG
64 sprintf_s(msg, sizeof(msg), "Welcome to Rise: The Vieneo Province! (64-bit debug)");
65#else
66 sprintf_s(msg, sizeof(msg), "Welcome to Rise: The Vieneo Province! (64-bit)");
67#endif
68#else
69#ifdef _DEBUG
70 sprintf_s(msg, sizeof(msg), "Welcome to Rise: The Vieneo Province! (32-bit debug)");
71#else
72 sprintf_s(msg, sizeof(msg), "Welcome to Rise: The Vieneo Province! (32-bit)");
73#endif
74#endif
75 * instage = -1;
76 }
77 }
78
79 if (*stage < 29)
80 txtHelper.DrawFormattedTextLine(L"Resources loading... (%i MB free)", pd3dDevice->GetAvailableTextureMem() / 2048000);
81 else
82 txtHelper.DrawFormattedTextLine(L"Resources loaded successfully! (%i MB free)", pd3dDevice->GetAvailableTextureMem() / 2048000);
83
84 if (*stage >= 1)
85 {
96 {
97 txtHelper.DrawTextLine(L"Game controller support enabled...");
98 if (*stage == 1)
99 {
100 logger->Log("Game controller support enabled...");
101 *instage = -1;
102 }
103 }
104 else
105 {
106 txtHelper.DrawTextLine(L"No game controllers configured!");
107 if (*stage == 1)
108 {
109 logger->Log("No game controllers configured!", Logger::Level::Warn);
110 *instage = -1;
111 }
112 }
113
124 {
125 txtHelper.DrawTextLine(L"Force feedback support enabled...");
126 if (*stage == 1)
127 {
128 logger->Log("Force feedback support enabled...");
129 *instage = -1;
130 }
131 }
132
134 {
135 txtHelper.DrawTextLine(L"Device supports advanced occlusion effects...");
136 if (*stage == 1)
137 {
138 logger->Log("Device supports advanced occlusion effects...");
139 *instage = -1;
140 }
141 }
142 else
143 {
144 txtHelper.DrawTextLine(L"Sorry, no support for advanced occlusion effects!");
145 if (*stage == 1)
146 {
147 logger->Log("Sorry, no support for advanced occlusion effects!", Logger::Level::Warn);
148 *instage = -1;
149 }
150 }
151
152 if (*stage == 1)
153 {
154 viewscreen->m_bPsize = true;
155 logger->Log("Native point sprites available");
156 }
157
158 // Test for vs 1.1 and ps 2.0
159 txtHelper.DrawTextLine(L"Device has compatible vertex and pixel shaders!");
160 if (*stage == 1)
161 {
162 logger->Log("Device has compatible vertex and pixel shaders!");
163 }
164 } // stage 1
165
166 if (*stage >= 2)
167 {
168 if (*stage > 2)
169 txtHelper.DrawTextLine(L"Celestial textures loaded!");
170 if (*stage == 2 && *instage == 1)
171 {
172 txtHelper.DrawTextLine(L"Celestial textures loading (Iomere)...");
173 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\World2a1.dds", &viewscreen->m_pddsWorld2a1, 1)))
174 {
175 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\World2a1.dds\"! (%S)", Rendering::ErrorString(hr));
177 }
178 else
179 viewscreen->gameclass->AddTrackedResource("m_pddsWorld2a1"); // managed
180 *instage = -1;
181 }
182 if (*stage == 2 && *instage == 0)
183 {
184 txtHelper.DrawTextLine(L"Celestial textures loading (Yonmara)...");
185 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\sunmap.dds", &viewscreen->m_pddsSunTexture, 1)))
186 {
187 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\sunmap.dds\"! (%S)", Rendering::ErrorString(hr));
189 }
190 else
191 viewscreen->gameclass->AddTrackedResource("m_pddsSunTexture"); // managed
192 logger->Log("M -> Celestial textures loaded...");
193 *instage = 1;
194 }
195 }
196
197 if (*stage >= 3)
198 {
199 if (*stage > 3)
200 txtHelper.DrawTextLine(L"Vehicle textures loaded!");
201 if (*stage == 3)
202 {
203 (*instage)++; // start at 1
204
205 txtHelper.DrawFormattedTextLine(L"Vehicle textures loading (%i/%i)...", *instage, shiptextureC);
206
207 if (*instage == shiptextureC) // while less than shiptextureC
208 {
209 *instage = -1;
210 logger->Log("Vehicle textures loaded...");
211 }
212 else
213 {
214 WCHAR hullfile[199], lightfile[199];
215 t = *instage;
216 // Defaults
217 hullfile[0] = lightfile[0] = 0;
218 switch (t)
219 {
220 // E-10
221 case 1: wcscpy_s(hullfile, 199, L"textures\\Ships\\BOW.dds");
222 wcscpy_s(lightfile, 199, L"textures\\Ships\\BOWLIGHT.dds");
223 break;
224 case 2: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-cargohold-b.dds");
225 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-cargohold-bLIGHT.dds");
226 break;
227 case 3: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-cockpit-a1.dds");
228 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-cockpit-a1LIGHT.dds");
229 break;
230 case 4: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-bow-a-b.dds");
231 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-bow-a-bLIGHT.dds");
232 break;
233 case 5: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-docking module-a-b.dds");
234 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-docking module-a-bLIGHT.dds");
235 break;
236 case 6: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-landing pad pod.dds");
237 break;
238 case 7: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engineering-b1.dds");
239 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-engineering-b1LIGHT.dds");
240 break;
241 case 8: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-port engine boom.dds");
242 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-port engine boomLIGHT.dds");
243 break;
244 case 9: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-starboard engine boom.dds");
245 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-starboard engine boomLIGHT.dds");
246 break;
247 case 10: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-oval wing.dds");
248 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-oval wingLIGHT.dds");
249 break;
250 case 11: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod mount.dds");
251 break;
252 case 12: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod.dds");
253 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-engine podLIGHT.dds");
254 break;
255 case 13: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod pylon-port.dds");
256 break;
257 case 14: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod pylon-starboard.dds");
258 break;
259 case 15: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-tailfin.dds");
260 break;
261 case 16: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod wing.dds");
262 break;
263 case 17: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engineering-a1.dds");
264 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-engineering-a1LIGHT.dds");
265 break;
266 case 18: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-access module-b1.dds");
267 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-access module-b1LIGHT.dds");
268 break;
269 case 19: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-landing pad-2.dds");
270 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-landing pad-2LIGHT.dds");
271 break;
272 case 20: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-landing pad-1.dds");
273 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-landing pad-1LIGHT.dds");
274 break;
275 case 21: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-tailfin-flap.dds");
276 break;
277 case 22: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-PLATE.dds");
278 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-PLATELIGHT.dds");
279 break;
280 case 23: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-oval wing-flap.dds");
281 break;
282 case 24: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-ramp.dds");
283 wcscpy_s(lightfile, 199, L"textures\\Ships\\e10-rampLIGHT.dds");
284 break;
285 case 25: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-engine pod wing-flap.dds");
286 break;
287 // DIHV
288 case 26: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\command.dds");
289 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\commandLIGHT.dds");
290 break;
291 case 27: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\DIHVengine.dds");
292 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\DIHVengineLIGHT.dds");
293 break;
294 case 28: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\nosecone.dds");
295 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\noseconeLIGHT.dds");
296 break;
297 case 29: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\connectring1.dds");
298 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\connectring1LIGHT.dds");
299 break;
300 case 30: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\towpackage.dds");
301 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\towpackageLIGHT.dds");
302 break;
303 case 31: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\cargonode.dds");
304 break;
305 case 32: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\cargohall.dds");
306 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\cargohallLIGHT.dds");
307 break;
308 case 33: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\cargocontainer.dds");
309 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\cargocontainerLIGHT.dds");
310 break;
311 case 34: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\hallcap.dds");
312 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\hallcapLIGHT.dds");
313 break;
314 case 35: wcscpy_s(hullfile, 199, L"textures\\Large Ships\\DIHV-PLATE.dds");
315 wcscpy_s(lightfile, 199, L"textures\\Large Ships\\DIHV-PLATELIGHT.dds");
316 break;
317 // ARJ (AFT LOADER)
318 case 36: wcscpy_s(hullfile, 199, L"textures\\Containers\\cargo-standard-ext.dds");
319 break;
320 case 37: wcscpy_s(hullfile, 199, L"textures\\Containers\\tank-fuel-dynamic.dds");
321 wcscpy_s(lightfile, 199, L"textures\\Containers\\tank-fuel-dynamicLIGHT.dds");
322 break;
323 // ARJ (AUX FUEL)
324 case 38: wcscpy_s(hullfile, 199, L"textures\\Containers\\fuel-standard-ext.dds");
325 break;
326 case 39: wcscpy_s(hullfile, 199, L"textures\\Containers\\tank-fuel.dds");
327 break;
328 case 40: wcscpy_s(hullfile, 199, L"textures\\Containers\\tank-cap.dds");
329 break;
330 // ARJ (TOP LOADER)
331 case 41: wcscpy_s(hullfile, 199, L"textures\\Containers\\cargo-toploader-ext.dds");
332 break;
333 // ARJ (MUNITIONS)
334 case 42: wcscpy_s(hullfile, 199, L"textures\\Containers\\munitions-standard-ext.dds");
335 break;
336 // MuVER
337 case 43: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-glass-1.dds");
338 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\GV-glass-1LIGHT.dds");
339 break;
340 case 44: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-construction-1.dds");
341 break;
342 case 45: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-guts-1.dds");
343 break;
344 case 46: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-mirrors-1.dds");
345 break;
346 case 47: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-lights-1.dds");
347 // using the day map as the light map
348 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\GV-lights-1.dds");
349 break;
350 case 48: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-lockers-1.dds");
351 break;
352 case 49: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-mod-1.dds");
353 break;
354 case 50: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-galanovo-1.dds");
355 break;
356 case 51: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-galanovo-2.dds");
357 break;
358 case 52: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-stripped-1.dds");
359 break;
360 case 53: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-bumpers-1.dds");
361 break;
362 case 54: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-suspension-1.dds");
363 break;
364 case 55: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-tires-1.dds");
365 break;
366 case 56: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\licensePlateStd.dds");
367 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\licensePlateStdLIGHT.dds");
368 break;
369 // Prowler
370 case 57: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-cockpit.dds");
371 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-cockpitLIGHT.dds");
372 break;
373 case 58: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-intake.dds");
374 break;
375 case 59: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-aerodyn.dds");
376 break;
377 case 60: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-landing toe.dds");
378 break;
379 case 61: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-port-flap1.dds");
380 break;
381 case 62: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-port-flap2.dds");
382 break;
383 case 63: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-starboard-flap1.dds");
384 break;
385 case 64: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-starboard-flap2.dds");
386 break;
387 case 65: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-thruster.dds");
388 break;
389 case 66: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-equipment cowl.dds");
390 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-equipment cowlLIGHT.dds");
391 break;
392 case 67: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-landing pod.dds");
393 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-landing podLIGHT.dds");
394 break;
395 case 68: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-landing leg-4x14.dds");
396 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-landing leg-4x14LIGHT.dds");
397 break;
398 case 69: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-port.dds");
399 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-wing-portLIGHT.dds");
400 break;
401 case 70: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-wing-starboard.dds");
402 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-wing-starboardLIGHT.dds");
403 break;
404 case 71: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-weapons pod.dds");
405 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-weapons podLIGHT.dds");
406 break;
407 case 72: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-corridor.dds");
408 break;
409 case 73: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-crewcabin.dds");
410 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-crewcabinLIGHT.dds");
411 break;
412 case 74: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-engineering.dds");
413 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-engineeringLIGHT.dds");
414 break;
415 case 75: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-equipment wedge.dds");
416 break;
417 case 76: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-propulsion unit.dds");
418 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-propulsion unitLIGHT.dds");
419 break;
420 case 77: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-drive coil-port.dds");
421 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-drive coil-portLIGHT.dds");
422 break;
423 case 78: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-drive coil-starboard.dds");
424 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-drive coil-starboardLIGHT.dds");
425 break;
426 case 79: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-docking module.dds");
427 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-docking moduleLIGHT.dds");
428 break;
429 case 80: wcscpy_s(hullfile, 199, L"textures\\Cities\\WEP-source1.dds");
430 break;
431 case 81: wcscpy_s(hullfile, 199, L"textures\\Ships\\p13-police rack.dds");
432 wcscpy_s(lightfile, 199, L"textures\\Ships\\p13-police rackLIGHT.dds");
433 break;
434 // A-4 (aka T-8) (aka A-3)
435 case 82: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-cockpit.dds");
436 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-cockpitLIGHT.dds");
437 break;
438 case 83: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-landing pod.dds");
439 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-landing podLIGHT.dds");
440 break;
441 case 84: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wing1.dds");
442 break;
443 case 85: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wing1flap.dds");
444 break;
445 case 86: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-landing leg2.dds");
446 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-landing leg2LIGHT.dds");
447 break;
448 case 87: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wingmount.dds");
449 break;
450 case 88: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-braceshaft2.dds");
451 break;
452 case 89: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wing1hinge.dds");
453 break;
454 case 90: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-corridor.dds");
455 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-corridorLIGHT.dds");
456 break;
457 case 91: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-fuselage2.dds");
458 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-fuselage2LIGHT.dds");
459 break;
460 case 92: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-cargoslope1.dds");
461 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-cargoslope1LIGHT.dds");
462 break;
463 case 93: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-cargobay1.dds");
464 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-cargobay1LIGHT.dds");
465 break;
466 case 94: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-cargoslope1hatch.dds");
467 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-cargoslope1hatchLIGHT.dds");
468 break;
469 case 95: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-aerodyn.dds");
470 break;
471 case 96: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wing1-angle45.dds");
472 break;
473 case 97: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-wing1-angle45flap.dds");
474 break;
475 case 98: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-tailfin.dds");
476 break;
477 case 99: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-tailfin-flap.dds");
478 break;
479 case 100: wcscpy_s(hullfile, 199, L"textures\\Ships\\a3-enginepod.dds");
480 wcscpy_s(lightfile, 199, L"textures\\Ships\\a3-enginepodLIGHT.dds");
481 break;
482 // C-2 Dasher
483 // T-1 Stratoranger (THIS IS GONE NOW SO THESE MAY BE USED BY SUBSEQUENT MODELS)
484 case 101: wcscpy_s(hullfile, 199, L"textures\\Ships\\e10-access ramp-2.dds"); // this guy is definitely used by a subsequent model so he will move
485 break;
486 case 102: wcscpy_s(hullfile, 199, L"textures\\Ships\\LANDING LEG1.dds"); // this guy is definitely gone! delete the file from Textures\\Ships
487 break;
488 // T-120 Steerhead
489 case 103: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-1.dds");
490 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\GV-1LIGHT.dds");
491 break;
492 case 104: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\lightmod1.dds");
493 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\lightmod1.dds");
494 break;
495 case 105: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\cargo2.dds");
496 break;
497 // E-11
498 case 106: wcscpy_s(hullfile, 199, L"textures\\Ships\\BODY-BOTTOM.dds");
499 break;
500 case 107: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-ramp.dds");
501 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-rampLIGHT.dds");
502 break;
503 case 108: wcscpy_s(hullfile, 199, L"textures\\Ships\\DOOR-DOCK.dds");
504 wcscpy_s(lightfile, 199, L"textures\\Ships\\DOOR-DOCKLIGHT.dds");
505 break;
506 case 109: wcscpy_s(hullfile, 199, L"textures\\Ships\\BOOM.dds");
507 wcscpy_s(lightfile, 199, L"textures\\Ships\\BOOMLIGHT.dds");
508 break;
509 case 110: wcscpy_s(hullfile, 199, L"textures\\Ships\\BOW-BOTTOM.dds");
510 wcscpy_s(lightfile, 199, L"textures\\Ships\\BOW-BOTTOMLIGHT.dds");
511 break;
512 case 111: wcscpy_s(hullfile, 199, L"textures\\Ships\\EXHAUST.dds");
513 break;
514 case 112: wcscpy_s(hullfile, 199, L"textures\\Ships\\WING.dds");
515 wcscpy_s(lightfile, 199, L"textures\\Ships\\WINGLIGHT.dds");
516 break;
517 case 113: wcscpy_s(hullfile, 199, L"textures\\Ships\\ENGINE.dds");
518 wcscpy_s(lightfile, 199, L"textures\\Ships\\ENGINELIGHT.dds");
519 break;
520 case 114: wcscpy_s(hullfile, 199, L"textures\\Ships\\PAD-REAR.dds");
521 wcscpy_s(lightfile, 199, L"textures\\Ships\\PAD-REARLIGHT.dds");
522 break;
523 case 115: wcscpy_s(hullfile, 199, L"textures\\Ships\\BODY.dds");
524 wcscpy_s(lightfile, 199, L"textures\\Ships\\BODYLIGHT.dds");
525 break;
526 case 116: wcscpy_s(hullfile, 199, L"textures\\Ships\\DOCKCOVER.dds");
527 wcscpy_s(lightfile, 199, L"textures\\Ships\\DOCKCOVERLIGHT.dds");
528 break;
529 case 117: wcscpy_s(hullfile, 199, L"textures\\Ships\\BODYCOVER.dds");
530 break;
531 case 118: wcscpy_s(hullfile, 199, L"textures\\Ships\\CORECOVER.dds");
532 break;
533 case 119: wcscpy_s(hullfile, 199, L"textures\\Ships\\PAD-FRONT.dds");
534 wcscpy_s(lightfile, 199, L"textures\\Ships\\PAD-FRONTLIGHT.dds");
535 break;
536 case 120: wcscpy_s(hullfile, 199, L"textures\\Ships\\FLAPS.dds");
537 break;
538 case 121: wcscpy_s(hullfile, 199, L"textures\\Ships\\e11-PLATE.dds");
539 wcscpy_s(lightfile, 199, L"textures\\Ships\\e11-PLATELIGHT.dds");
540 break;
541 case 122: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-door-standard.dds");
542 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-door-standardLIGHT.dds");
543 break;
544 case 123: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-wall-lockers.dds");
545 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-wall-lockersLIGHT.dds");
546 break;
547 case 124: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-wall-standard.dds");
548 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-wall-standardLIGHT.dds");
549 break;
550 case 125: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-wall-supportangle.dds");
551 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-wall-supportangleLIGHT.dds");
552 break;
553 case 126: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-wall-weaponrack.dds");
554 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-wall-weaponrackLIGHT.dds");
555 break;
556 case 127: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-ceiling.dds");
557 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-ceilingLIGHT.dds");
558 break;
559 case 128: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-conveyor.dds");
560 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-conveyorLIGHT.dds");
561 break;
562 case 129: wcscpy_s(hullfile, 199, L"textures\\Ships\\eva-wall-standard.dds");
563 wcscpy_s(lightfile, 199, L"textures\\Ships\\eva-wall-standardLIGHT.dds");
564 break;
565 // BeishtKione
566 case 130: wcscpy_s(hullfile, 199, L"textures\\Holidays\\BeishtKione_BaseColor1.dds");
567 break;
568 // NEW C-2A Dasher
569 case 131: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\Glass.dds");
570 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\GlassLIGHT.dds");
571 break;
572 case 132: wcscpy_s(hullfile, 199, L"textures\\Cockpits\\door-front.dds");
573 break; // This is part of the wiper which is visible inside and outside
574 case 133: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\body.dds");
575 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\bodyLIGHT.dds");
576 break;
577 case 134: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\undercarriage.dds");
578 break;
579 case 135: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\back1.dds");
580 break;
581 case 136: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\tread1.dds");
582 break;
583 case 137: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\face1.dds");
584 break;
585 // W-6 Manx
586 case 138: wcscpy_s(hullfile, 199, L"textures\\Ships\\Manx_Diff.dds");
587 wcscpy_s(lightfile, 199, L"textures\\Ships\\Manx_DiffLIGHT.dds");
588 break;
589 case 139: wcscpy_s(hullfile, 199, L"textures\\Ships\\name plate.dds");
590 wcscpy_s(lightfile, 199, L"textures\\Ships\\name plateLIGHT.dds");
591 break;
592 // T-19 Stratomaster
593 case 140: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-default.dds");
594 break;
595 case 141: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-windshield.dds");
596 wcscpy_s(lightfile, 199, L"textures\\Ships\\painted-windshieldLIGHT.dds");
597 break;
598 case 142: wcscpy_s(hullfile, 199, L"textures\\Ships\\stainless1-bare.dds");
599 break;
600 case 143: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-ramp1.dds");
601 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-ramp1.dds");
602 break;
603 case 144: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-wall-storage.dds");
604 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-wall-storage.dds");
605 break;
606 case 145: wcscpy_s(hullfile, 199, L"textures\\Ships\\gear.dds");
607 wcscpy_s(lightfile, 199, L"textures\\Ships\\gear.dds");
608 break;
609 case 146: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-floor-carpet.dds");
610 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-floor-carpet.dds");
611 break;
612 case 147: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-wing-upper.dds");
613 wcscpy_s(lightfile, 199, L"textures\\Ships\\painted-wing-upperLIGHT.dds");
614 break;
615 case 148: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-wing-lower.dds");
616 break;
617 case 149: wcscpy_s(hullfile, 199, L"textures\\Ships\\engine-zefferfiche-turbine.dds");
618 break;
619 case 150: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-flaps-upper.dds");
620 break;
621 case 151: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-flaps-lower.dds");
622 break;
623 case 152: wcscpy_s(hullfile, 199, L"textures\\Ships\\lights.dds");
624 wcscpy_s(lightfile, 199, L"textures\\Ships\\lights.dds");
625 break;
626 case 153: wcscpy_s(hullfile, 199, L"textures\\Ships\\dynamic-stratomaster.dds");
627 break;
628 case 154: wcscpy_s(hullfile, 199, L"textures\\Ships\\substructure-standard.dds");
629 wcscpy_s(lightfile, 199, L"textures\\Ships\\substructure-standard.dds");
630 break;
631 case 155: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-wall-standard.dds");
632 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-wall-standard.dds");
633 break;
634 case 156: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-wall-filler.dds");
635 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-wall-filler.dds");
636 break;
637 case 157: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-conveyor1.dds");
638 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-conveyor1.dds");
639 break;
640 case 158: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-ceiling.dds");
641 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-ceiling.dds");
642 break;
643 case 159: wcscpy_s(hullfile, 199, L"textures\\Ships\\cabin-wall-weaponrack.dds");
644 wcscpy_s(lightfile, 199, L"textures\\Ships\\cabin-wall-weaponrack.dds");
645 break;
646 case 160: wcscpy_s(hullfile, 199, L"textures\\Ships\\painted-engine.dds");
647 break;
648 case 161: wcscpy_s(hullfile, 199, L"textures\\Ships\\wheels-standard.dds");
649 wcscpy_s(lightfile, 199, L"textures\\Ships\\wheels-standard.dds");
650 break;
651 case 162: wcscpy_s(hullfile, 199, L"textures\\Ships\\cargobay-door-standard1.dds");
652 wcscpy_s(lightfile, 199, L"textures\\Ships\\cargobay-door-standard1.dds");
653 break;
654 // Spacesuit and floating man
655 case 163: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\ARM-RU.dds");
656 break;
657 case 164: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\ARM-RL.dds");
658 break;
659 case 165: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\HAND-R-leisure.dds");
660 break;
661 case 166: wcscpy_s(hullfile, 199, L"textures\\Holidays\\TORSO.dds");
662 break;
663 case 167: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\HIPS.dds");
664 break;
665 case 168: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\LEG-RU.dds");
666 break;
667 case 169: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\LEG-RL.dds");
668 break;
669 case 170: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\FOOT-R.dds");
670 break;
671 case 171: wcscpy_s(hullfile, 199, L"textures\\Holidays\\HELMET.dds");
672 break;
673 case 172: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\NECK.dds");
674 break;
675 case 173: wcscpy_s(hullfile, 199, L"textures\\Holidays\\ears-floatingman1.dds");
676 break;
677 case 174: wcscpy_s(hullfile, 199, L"textures\\Holidays\\head-floatingman1.dds");
678 break;
679 case 175: wcscpy_s(hullfile, 199, L"textures\\Holidays\\nose-floatingman1.dds");
680 break;
681 case 176: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\HELMET-INNER.dds");
682 break;
683 case 177: wcscpy_s(hullfile, 199, L"textures\\People\\Spacesuit\\ARM-LL-fieldstandard.dds");
684 wcscpy_s(lightfile, 199, L"textures\\People\\Spacesuit\\ARM-LL-fieldstandardLIGHT.dds");
685 break;
686 case 178: wcscpy_s(hullfile, 199, L"textures\\Holidays\\HELMET-GLASS.dds");
687 break;
688 // Passenger ARJ
689 case 179: wcscpy_s(hullfile, 199, L"textures\\Containers\\passenger-ext.dds");
690 wcscpy_s(lightfile, 199, L"textures\\Containers\\passenger-extLIGHT.dds");
691 break;
692 // Construction ARJ
693 case 180: //wcscpy_s(hullfile, 199, L"textures\\Containers\\construction-ext.dds");
694 //not supported yet ... these are never "on"
695 //wcscpy_s(lightfile, 199, L"textures\\Containers\\construction-extLIGHT.dds");
696 break;
697 // Mammoth
698 case 181: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\window-bridge.dds");
699 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\window-bridgeLIGHT.dds");
700 break;
701 case 182: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\conveyorramp.dds");
702 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\conveyorramp.dds");
703 break;
704 case 183: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\int-hydraulic.dds");
705 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\int-hydraulic.dds");
706 break;
707 case 184: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\int-liftarm.dds");
708 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\int-liftarm.dds");
709 break;
710 case 185: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\int-wall-cargo.dds");
711 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\int-wall-cargo.dds");
712 break;
713 case 186: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\body-nose.dds");
714 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\body-noseLIGHT.dds");
715 break;
716 case 187: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\body-common.dds");
717 break;
718 case 188: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\dynamic-mammoth.dds");
719 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\dynamic-mammothLIGHT.dds");
720 break;
721 case 189: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\lift.dds");
722 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\liftLIGHT.dds");
723 break;
724 case 190: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\guts-hydraulic.dds");
725 break;
726 case 191: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\door1.dds");
727 break;
728 case 192: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\ramp-outer.dds");
729 break;
730 case 193: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\lights-common.dds");
731 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\lights-commonLIGHT.dds");
732 break;
733 case 194: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\conveyor.dds");
734 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\conveyor.dds");
735 break;
736 case 195: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\int-column-cargo.dds");
737 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\int-column-cargo.dds");
738 break;
739 case 196: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\body-windowed.dds");
740 wcscpy_s(lightfile, 199, L"textures\\Vehicles\\body-windowedLIGHT.dds");
741 break;
742 case 197: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\body-bottom.dds");
743 break;
744 case 198: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\sleeve.dds");
745 break;
746 case 199: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\face-toothandnail.dds");
747 break;
748 case 200: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\tread-toothandnail.dds");
749 break;
750 case 201: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\deck.dds");
751 break;
752 case 202: wcscpy_s(hullfile, 199, L"textures\\Animations\\Thrust.dds");
753 break;
754 case 203: wcscpy_s(hullfile, 199, L"textures\\Animations\\Afterburner.dds");
755 break;
756 // The new 2007 (2020) Steerhead
757 case 204: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-SKINS-stainless.dds");
758 break;
759 case 205: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-SKINS-flaps.dds");
760 break;
761 case 206: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-SKINS-techbed.dds");
762 break;
763 case 207: wcscpy_s(hullfile, 199, L"textures\\Vehicles\\GV-SKINS-underbed.dds");
764 break;
765 case 208: wcscpy_s(hullfile, 199, L"textures\\Holidays\\pumpkin_Diffuse.dds");
766 wcscpy_s(lightfile, 199, L"textures\\Holidays\\pumpkin_DiffuseLIGHT.dds");
767 break;
768 case 209: wcscpy_s(hullfile, 199, L"textures\\Holidays\\Rope.dds");
769 break;
770 case 210: wcscpy_s(hullfile, 199, L"textures\\Containers\\parachute.dds");
771 break;
772 }
773
774#ifndef skipVehicles
775 if (hullfile[0] != 0)
776 {
777 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, hullfile, &viewscreen->m_pddsShipTexture[t], 1)))
778 {
779 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", hullfile, Rendering::ErrorString(hr));
781 }
782 else
783 {
784 sprintf_s(msg, sizeof(msg), "m_pddsShipTexture[%i]", t);
786 }
787 }
788 if (lightfile[0] != 0)
789 {
790 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, lightfile, &viewscreen->m_pddsShipLights[t], 1)))
791 {
792 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", lightfile, Rendering::ErrorString(hr));
794 }
795 else
796 {
797 sprintf_s(msg, sizeof(msg), "m_pddsShipLights[%i]", t);
799 }
800 }
801#else
802 * instage = -1;
803#endif
804 } // instage loop
805 } // stage ==3
806 } // stage >=3
807
808 if (*stage >= 4)
809 {
810 if (*stage > 4)
811 txtHelper.DrawTextLine(L"City grids loaded!");
812 if (*stage == 4)
813 {
814 (*instage)++; // start at 1
815
816 txtHelper.DrawFormattedTextLine(L"City grids loading (%i/%i)...", *instage, RTStextureC);
817
818 if (*instage == RTStextureC) // while less than RTStextureC
819 {
820 *instage = -1;
821 logger->Log("City grids loaded...");
822 }
823 else
824 {
825 t = *instage;
826 WCHAR hullfile[199], lightfile[199];
827 hullfile[0] = lightfile[0] = 0;
828 switch (t)
829 {
830 case 1: swprintf_s(hullfile, 199, L"Textures\\RTS\\f1a.dds");
831 break;
832 case 2: swprintf_s(hullfile, 199, L"Textures\\RTS\\f1b.dds");
833 break;
834 case 3: swprintf_s(hullfile, 199, L"Textures\\RTS\\f1c.dds");
835 break;
836 case 4: swprintf_s(hullfile, 199, L"Textures\\RTS\\f2a.dds");
837 break;
838 case 5: swprintf_s(hullfile, 199, L"Textures\\RTS\\f2b.dds");
839 break;
840 case 6: swprintf_s(hullfile, 199, L"Textures\\RTS\\f2c.dds");
841 break;
842 case 7: swprintf_s(hullfile, 199, L"Textures\\RTS\\f3a.dds");
843 break;
844 case 8: swprintf_s(hullfile, 199, L"Textures\\RTS\\f3b.dds");
845 break;
846 case 9: swprintf_s(hullfile, 199, L"Textures\\RTS\\f4a.dds");
847 break;
848 case 10: swprintf_s(hullfile, 199, L"Textures\\RTS\\f4b.dds");
849 break;
850 case 11: swprintf_s(hullfile, 199, L"Textures\\RTS\\f5a.dds");
851 break;
852 case 12: swprintf_s(hullfile, 199, L"Textures\\RTS\\f6a.dds");
853 break;
854 case 13: swprintf_s(hullfile, 199, L"Textures\\RTS\\f6b.dds");
855 break;
856 case 14: swprintf_s(hullfile, 199, L"Textures\\RTS\\f6c.dds");
857 break;
858 case 15: swprintf_s(hullfile, 199, L"Textures\\RTS\\f6d.dds");
859 break;
860 case 16: swprintf_s(hullfile, 199, L"Textures\\RTS\\f6e.dds");
861 break;
862 case 17: swprintf_s(hullfile, 199, L"Textures\\RTS\\f7a.dds");
863 break;
864 case 18: swprintf_s(hullfile, 199, L"Textures\\RTS\\f7b.dds");
865 break;
866 case 19: swprintf_s(hullfile, 199, L"Textures\\RTS\\f7c.dds");
867 break;
868 case 20: swprintf_s(hullfile, 199, L"Textures\\RTS\\f8a.dds");
869 break;
870 case 21: swprintf_s(hullfile, 199, L"Textures\\RTS\\f8b.dds");
871 break;
872 case 22: swprintf_s(hullfile, 199, L"Textures\\RTS\\f8c.dds");
873 break;
874 case 23: swprintf_s(hullfile, 199, L"Textures\\RTS\\f9a.dds");
875 break;
876 case 24: swprintf_s(hullfile, 199, L"Textures\\RTS\\f9b.dds");
877 break;
878 case 25: swprintf_s(hullfile, 199, L"Textures\\RTS\\f10a.dds");
879 break;
880 case 26: swprintf_s(hullfile, 199, L"Textures\\RTS\\f10b.dds");
881 break;
882 case 27: swprintf_s(hullfile, 199, L"Textures\\RTS\\f10c.dds");
883 break;
884 case 28: swprintf_s(hullfile, 199, L"Textures\\RTS\\f10d.dds");
885 break;
886 case 29: swprintf_s(hullfile, 199, L"Textures\\RTS\\f11a.dds");
887 break;
888 case 30: swprintf_s(hullfile, 199, L"Textures\\RTS\\f33_Exit-above.dds");
889 swprintf_s(lightfile, 199, L"Textures\\RTS\\f33_Exit-aboveLIGHT.dds");
890 break;
891 case 31: swprintf_s(hullfile, 199, L"Textures\\RTS\\f12b.dds");
892 break;
893 case 32: swprintf_s(hullfile, 199, L"Textures\\RTS\\f33_Exit-below.dds");
894 swprintf_s(lightfile, 199, L"Textures\\RTS\\f33_Exit-belowLIGHT.dds");
895 break;
896 case 33: swprintf_s(hullfile, 199, L"Textures\\RTS\\f13b.dds");
897 break;
898 case 34: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31_Exit-above.dds");
899 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31_Exit-aboveLIGHT.dds");
900 break;
901 case 35: swprintf_s(hullfile, 199, L"Textures\\RTS\\f14b.dds");
902 break;
903 case 36: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15a.dds");
904 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15aLIGHT.dds");
905 break;
906 case 37: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15b.dds");
907 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15bLIGHT.dds");
908 break;
909 case 38: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15c.dds");
910 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15cLIGHT.dds");
911 break;
912 case 39: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15d.dds");
913 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15dLIGHT.dds");
914 break;
915 case 40: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15e.dds");
916 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15eLIGHT.dds");
917 break;
918 case 41: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31_Exit-above-above.dds");
919 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31_Exit-above-aboveLIGHT.dds");
920 break;
921 case 42: swprintf_s(hullfile, 199, L"Textures\\RTS\\f17.dds");
922 break;
923 case 43: swprintf_s(hullfile, 199, L"Textures\\RTS\\f18.dds");
924 break;
925 case 44: swprintf_s(hullfile, 199, L"Textures\\RTS\\f19.dds");
926 break;
927 case 45: swprintf_s(hullfile, 199, L"Textures\\RTS\\f20.dds");
928 break;
929 case 46: swprintf_s(hullfile, 199, L"Textures\\RTS\\f21.dds");
930 break;
931 case 47: swprintf_s(hullfile, 199, L"Textures\\RTS\\f22.dds");
932 break;
933 case 48: swprintf_s(hullfile, 199, L"Textures\\RTS\\f23.dds");
934 break;
935 case 49: swprintf_s(hullfile, 199, L"Textures\\RTS\\f24.dds");
936 break;
937 case 50: swprintf_s(hullfile, 199, L"Textures\\RTS\\f25.dds");
938 swprintf_s(lightfile, 199, L"Textures\\RTS\\f25LIGHT.dds");
939 break;
940 case 51: swprintf_s(hullfile, 199, L"Textures\\RTS\\f26.dds");
941 break;
942 case 52: swprintf_s(hullfile, 199, L"Textures\\RTS\\f27.dds");
943 break;
944 case 53: swprintf_s(hullfile, 199, L"Textures\\RTS\\f28.dds");
945 break;
946 case 54: swprintf_s(hullfile, 199, L"Textures\\RTS\\f29.dds");
947 break;
948 case 55: swprintf_s(hullfile, 199, L"Textures\\RTS\\f30.dds");
949 break;
950 case 56: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15f.dds");
951 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15fLIGHT.dds");
952 break;
953 case 57: swprintf_s(hullfile, 199, L"Textures\\RTS\\f15g.dds");
954 swprintf_s(lightfile, 199, L"Textures\\RTS\\f15gLIGHT.dds");
955 break;
956 case 58: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31.dds");
957 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31LIGHT.dds");
958 break;
959 case 59: swprintf_s(hullfile, 199, L"Textures\\RTS\\f32x.dds");
960 break;
961 case 60: swprintf_s(hullfile, 199, L"Textures\\RTS\\f33.dds");
962 swprintf_s(lightfile, 199, L"Textures\\RTS\\f33LIGHT.dds");
963 break;
964 case 61: swprintf_s(hullfile, 199, L"Textures\\RTS\\f34.dds");
965 swprintf_s(lightfile, 199, L"Textures\\RTS\\f34LIGHT.dds");
966 break;
967 case 62: swprintf_s(hullfile, 199, L"Textures\\RTS\\city2playerN.dds");
968 break;
969 case 63: swprintf_s(hullfile, 199, L"Textures\\RTS\\city2playerS.dds");
970 break;
971 case 64: swprintf_s(hullfile, 199, L"Textures\\RTS\\f3218.dds");
972 swprintf_s(lightfile, 199, L"Textures\\RTS\\f32LIGHT.dds");
973 break;
974 case 65: swprintf_s(hullfile, 199, L"Textures\\RTS\\f3236.dds");
975 swprintf_s(lightfile, 199, L"Textures\\RTS\\f32LIGHT.dds");
976 break;
977 case 66: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31aim.dds");
978 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31LIGHT.dds");
979 break;
980 case 67: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31stripe1.dds");
981 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31LIGHT.dds");
982 break;
983 case 68: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31stripe2.dds");
984 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31LIGHT.dds");
985 break;
986 case 69: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31stripe3.dds");
987 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31LIGHT.dds");
988 break;
989 case 70: swprintf_s(hullfile, 199, L"Textures\\RTS\\f8bpark.dds");
990 break;
991 case 71: swprintf_s(hullfile, 199, L"Textures\\RTS\\f9bpark.dds");
992 break;
993 case 72: swprintf_s(hullfile, 199, L"Textures\\RTS\\PolarCompassQuadrant.dds");
994 break;
995 case 73: swprintf_s(hullfile, 199, L"Textures\\RTS\\f31_Exit-above-above-NOSTRIPE.dds");
996 swprintf_s(lightfile, 199, L"Textures\\RTS\\f31_Exit-above-aboveLIGHT.dds");
997 break;
998 }
999#ifndef skipRTS
1000 if (hullfile[0] != 0)
1001 {
1002 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, hullfile, &viewscreen->m_pddsRTSTexture[t], Rendering::DefaultSize)))
1003 {
1004 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", hullfile, Rendering::ErrorString(hr));
1006 }
1007 else
1008 {
1009 sprintf_s(msg, sizeof(msg), "m_pddsRTSTexture[%i]", t);
1011 }
1012 }
1013 if (lightfile[0] != 0)
1014 {
1015 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, lightfile, &viewscreen->m_pddsRTSLights[t], Rendering::DefaultSize)))
1016 {
1017 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", lightfile, Rendering::ErrorString(hr));
1019 }
1020 else
1021 {
1022 sprintf_s(msg, sizeof(msg), "m_pddsRTSLights[%i]", t);
1024 }
1025 }
1026#else
1027 * instage = -1;
1028#endif
1029 } // instage loop
1030 } // stage==4
1031 } // stage>=4
1032
1033 if (*stage >= 5)
1034 {
1035 if (*stage > 5)
1036 txtHelper.DrawTextLine(L"Buildings loaded!");
1037 if (*stage == 5)
1038 {
1039 (*instage)++; // start at 1
1040
1041 txtHelper.DrawFormattedTextLine(L"Building loading (%i/%i)...", *instage, citytextureC + 1);
1042
1043 if (*instage == citytextureC)
1044 {
1045 *instage = -1;
1046 logger->Log("Buildings loaded...");
1047 }
1048 else
1049 {
1050 WCHAR hullfile[199], lightfile[199];
1051 // Defaults
1052 hullfile[0] = lightfile[0] = 0;
1054 switch (*instage)
1055 {
1056 // Deois financial district
1057 case 1: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_3_cap.dds");
1058 wcscpy_s(lightfile, 199, L"textures\\cities\\g_3_capLIGHT.dds");
1059 break;
1060 case 2: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_hangar1.dds");
1061 wcscpy_s(lightfile, 199, L"textures\\cities\\b_hangar1LIGHT.dds");
1062 break;
1063 case 3: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice.dds");
1064 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAofficeLIGHT.dds");
1065 break;
1066 case 4: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAhotel2.dds");
1067 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAhotel2LIGHT.dds");
1068 break;
1069 case 5: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice2.dds");
1070 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice2LIGHT.dds");
1071 break;
1072 case 6: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAhotel1.dds");
1073 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAhotel1LIGHT.dds");
1074 break;
1075 case 7: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice3.dds");
1076 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice3LIGHT.dds");
1077 break;
1078 case 8: wcscpy_s(hullfile, 199, L"textures\\Cities\\tmis.dds");
1079 wcscpy_s(lightfile, 199, L"textures\\cities\\tmisLIGHT.dds");
1080 break;
1081 case 9: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice4.dds");
1082 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice4LIGHT.dds");
1083 break;
1084 case 10: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice6.dds");
1085 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice6LIGHT.dds");
1086 break;
1087 case 11: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice5.dds");
1088 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice5LIGHT.dds");
1089 break;
1090 case 12: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice7.dds");
1091 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice7LIGHT.dds");
1092 break;
1093 case 13: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_1_mid.dds");
1094 wcscpy_s(lightfile, 199, L"textures\\cities\\r_1_midLIGHT.dds");
1095 break;
1096 case 14: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_flat.dds");
1097 wcscpy_s(lightfile, 199, L"textures\\cities\\b_flatLIGHT.dds");
1098 break;
1099 case 15: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAoffice8.dds");
1100 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAoffice8LIGHT.dds");
1101 break;
1102 case 16: wcscpy_s(hullfile, 199, L"textures\\Cities\\landing_fnd.dds");
1103 wcscpy_s(lightfile, 199, L"textures\\cities\\landing_fndLIGHT.dds");
1104 break;
1105 case 17: wcscpy_s(hullfile, 199, L"textures\\Cities\\landing_cap.dds");
1106 wcscpy_s(lightfile, 199, L"textures\\cities\\landing_capLIGHT.dds");
1107 break;
1108 case 18: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_1_fnd.dds");
1109 wcscpy_s(lightfile, 199, L"textures\\cities\\r_1_fndLIGHT.dds");
1110 break;
1111 case 19: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_1_fnd.dds");
1112 wcscpy_s(lightfile, 199, L"textures\\cities\\b_1_fndLIGHT.dds");
1113 break;
1114 case 20: wcscpy_s(hullfile, 199, L"textures\\Cities\\landing_flat.dds");
1115 break;
1116 case 21: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_3_fnd.dds");
1117 wcscpy_s(lightfile, 199, L"textures\\cities\\g_3_fndLIGHT.dds");
1118 break;
1119 case 22: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_hangar_flatunder.dds");
1120 wcscpy_s(lightfile, 199, L"textures\\cities\\b_hangar_flatunderLIGHT.dds");
1121 break;
1122 case 23: wcscpy_s(hullfile, 199, L"textures\\Cities\\t_to_r.dds");
1123 wcscpy_s(lightfile, 199, L"textures\\cities\\t_to_rLIGHT.dds");
1124 break;
1125 case 24: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_to_t.dds");
1126 wcscpy_s(lightfile, 199, L"textures\\cities\\r_to_tLIGHT.dds");
1127 break;
1128 case 25: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_to_b.dds");
1129 wcscpy_s(lightfile, 199, L"textures\\cities\\g_to_bLIGHT.dds");
1130 break;
1131 case 26: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_1_flat.dds");
1132 wcscpy_s(lightfile, 199, L"textures\\cities\\r_1_flatLIGHT.dds");
1133 break;
1134 case 27: wcscpy_s(hullfile, 199, L"textures\\Cities\\comm_fnd.dds");
1135 wcscpy_s(lightfile, 199, L"textures\\cities\\comm_fndLIGHT.dds");
1136 break;
1137 case 28: wcscpy_s(hullfile, 199, L"textures\\Cities\\comm_mid.dds");
1138 wcscpy_s(lightfile, 199, L"textures\\cities\\comm_midLIGHT.dds");
1139 break;
1140 case 29: wcscpy_s(hullfile, 199, L"textures\\Cities\\comm_cap.dds");
1141 wcscpy_s(lightfile, 199, L"textures\\cities\\comm_capLIGHT.dds");
1142 break;
1143 case 30: wcscpy_s(hullfile, 199, L"textures\\Cities\\generalgrey_cap.dds");
1144 break;
1145 case 31: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_to_g.dds");
1146 wcscpy_s(lightfile, 199, L"textures\\cities\\b_to_gLIGHT.dds");
1147 break;
1148 case 32: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_2_cap.dds");
1149 wcscpy_s(lightfile, 199, L"textures\\cities\\b_2_capLIGHT.dds");
1150 break;
1151 case 33: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_1_mid.dds");
1152 wcscpy_s(lightfile, 199, L"textures\\cities\\b_1_midLIGHT.dds");
1153 break;
1154 case 34: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_to_r.dds");
1155 wcscpy_s(lightfile, 199, L"textures\\cities\\b_to_rLIGHT.dds");
1156 break;
1157 case 35: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_2_fnd.dds");
1158 wcscpy_s(lightfile, 199, L"textures\\cities\\g_2_fndLIGHT.dds");
1159 break;
1160 case 36: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_2_mid.dds");
1161 wcscpy_s(lightfile, 199, L"textures\\cities\\g_2_midLIGHT.dds");
1162 break;
1163 case 37: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_to_b.dds");
1164 wcscpy_s(lightfile, 199, L"textures\\cities\\r_to_bLIGHT.dds");
1165 break;
1166 case 38: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_2_mid.dds");
1167 wcscpy_s(lightfile, 199, L"textures\\cities\\b_2_midLIGHT.dds");
1168 break;
1169 case 39: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_3_mid.dds");
1170 wcscpy_s(lightfile, 199, L"textures\\cities\\b_3_midLIGHT.dds");
1171 break;
1172 case 40: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_3_fnd.dds");
1173 wcscpy_s(lightfile, 199, L"textures\\cities\\b_3_fndLIGHT.dds");
1174 break;
1175 case 41: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_3_cap.dds");
1176 wcscpy_s(lightfile, 199, L"textures\\cities\\b_3_capLIGHT.dds");
1177 break;
1178 case 42: wcscpy_s(hullfile, 199, L"textures\\Cities\\b_1_cap.dds");
1179 wcscpy_s(lightfile, 199, L"textures\\cities\\b_1_capLIGHT.dds");
1180 break;
1181 case 43: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_1_cap.dds");
1182 wcscpy_s(lightfile, 199, L"textures\\cities\\g_1_capLIGHT.dds");
1183 break;
1184 case 44: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_flat.dds");
1185 wcscpy_s(lightfile, 199, L"textures\\cities\\g_flatLIGHT.dds");
1186 break;
1187 case 45: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_1_mid.dds");
1188 wcscpy_s(lightfile, 199, L"textures\\cities\\g_1_midLIGHT.dds");
1189 break;
1190 case 46: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_3_mid.dds");
1191 wcscpy_s(lightfile, 199, L"textures\\cities\\g_3_midLIGHT.dds");
1192 break;
1193 case 47: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-texture-b2.dds");
1194 break;
1195 case 48: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-texture-g3.dds");
1196 break;
1197 case 49: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-wall-b2.dds");
1198 wcscpy_s(lightfile, 199, L"textures\\cities\\CITY-wall-b2LIGHT.dds");
1199 break;
1200 case 50: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-wall-g3.dds");
1201 wcscpy_s(lightfile, 199, L"textures\\cities\\CITY-wall-g3LIGHT.dds");
1202 break;
1203 case 51: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-texture-g1.dds");
1204 break;
1205 case 52: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-wall-g2.dds");
1206 wcscpy_s(lightfile, 199, L"textures\\cities\\CITY-wall-g2LIGHT.dds");
1207 break;
1208 case 53: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-wall-g1.dds");
1209 wcscpy_s(lightfile, 199, L"textures\\cities\\CITY-wall-g1LIGHT.dds");
1210 break;
1211 case 54: wcscpy_s(hullfile, 199, L"textures\\Cities\\sign-FLEET_gnd.dds");
1212 wcscpy_s(lightfile, 199, L"textures\\cities\\sign-FLEET_gndLIGHT.dds");
1213 break;
1214 // Deois Industrial District
1215 case 55: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_2_fnd.dds");
1216 wcscpy_s(lightfile, 199, L"textures\\cities\\r_2_fndLIGHT.dds");
1217 break;
1218 case 56: wcscpy_s(hullfile, 199, L"textures\\Cities\\ir_fnd.dds");
1219 wcscpy_s(lightfile, 199, L"textures\\Cities\\ir_fndLIGHT.dds");
1220 break;
1221 case 57: wcscpy_s(hullfile, 199, L"textures\\Cities\\ircap1.dds");
1222 wcscpy_s(lightfile, 199, L"textures\\Cities\\ircap1LIGHT.dds");
1223 break;
1224 case 58: wcscpy_s(hullfile, 199, L"textures\\Cities\\igcap2.dds");
1225 wcscpy_s(lightfile, 199, L"textures\\Cities\\igcap2LIGHT.dds");
1226 break;
1227 case 59: wcscpy_s(hullfile, 199, L"textures\\Cities\\igcap1.dds");
1228 wcscpy_s(lightfile, 199, L"textures\\Cities\\igcap1LIGHT.dds");
1229 break;
1230 case 60: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-tank.dds");
1231 wcscpy_s(lightfile, 199, L"textures\\cities\\ibf-tankLIGHT.dds");
1232 break;
1233 case 61: wcscpy_s(hullfile, 199, L"textures\\Cities\\r-tank-tower8.dds");
1234 wcscpy_s(lightfile, 199, L"textures\\cities\\r-tank-tower8LIGHT.dds");
1235 break;
1236 case 62: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-materialstorage.dds");
1237 wcscpy_s(lightfile, 199, L"textures\\cities\\c-materialstorageLIGHT.dds");
1238 break;
1239 case 63: wcscpy_s(hullfile, 199, L"textures\\Cities\\R.dds");
1240 wcscpy_s(lightfile, 199, L"textures\\cities\\RLIGHT.dds");
1241 break;
1242 case 64: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_2_flat.dds");
1243 wcscpy_s(lightfile, 199, L"textures\\cities\\r_2_flatLIGHT.dds");
1244 break;
1245 case 65: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_2_mid.dds");
1246 wcscpy_s(lightfile, 199, L"textures\\cities\\r_2_midLIGHT.dds");
1247 break;
1248 case 66: wcscpy_s(hullfile, 199, L"textures\\Cities\\r-tank.dds");
1249 wcscpy_s(lightfile, 199, L"textures\\cities\\r-tankLIGHT.dds");
1250 break;
1251 case 67: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibg-production.dds");
1252 wcscpy_s(lightfile, 199, L"textures\\cities\\ibg-productionLIGHT.dds");
1253 break;
1254 case 68: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibg-processor.dds");
1255 wcscpy_s(lightfile, 199, L"textures\\cities\\ibg-processorLIGHT.dds");
1256 break;
1257 case 69: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibg-assembly.dds");
1258 wcscpy_s(lightfile, 199, L"textures\\cities\\ibg-assemblyLIGHT.dds");
1259 break;
1260 case 70: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibg-warehouse.dds");
1261 wcscpy_s(lightfile, 199, L"textures\\cities\\ibg-warehouseLIGHT.dds");
1262 break;
1263 case 71: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-separator.dds");
1264 wcscpy_s(lightfile, 199, L"textures\\cities\\c-separatorLIGHT.dds");
1265 break;
1266 case 72: wcscpy_s(hullfile, 199, L"textures\\Cities\\ib.dds");
1267 wcscpy_s(lightfile, 199, L"textures\\cities\\ibLIGHT.dds");
1268 break;
1269 case 73: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-materialobliteration.dds");
1270 wcscpy_s(lightfile, 199, L"textures\\cities\\c-materialobliterationLIGHT.dds");
1271 break;
1272 case 74: wcscpy_s(hullfile, 199, L"textures\\Cities\\ig.dds");
1273 wcscpy_s(lightfile, 199, L"textures\\Cities\\igLIGHT.dds");
1274 break;
1275 case 75: wcscpy_s(hullfile, 199, L"textures\\Cities\\igs.dds");
1276 wcscpy_s(lightfile, 199, L"textures\\Cities\\igsLIGHT.dds");
1277 break;
1278 case 76: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibe.dds");
1279 wcscpy_s(lightfile, 199, L"textures\\cities\\ibeLIGHT.dds");
1280 break;
1281 case 77: wcscpy_s(hullfile, 199, L"textures\\Cities\\igscap1.dds");
1282 wcscpy_s(lightfile, 199, L"textures\\Cities\\igscap1LIGHT.dds");
1283 break;
1284 case 78: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibb-1.dds");
1285 wcscpy_s(lightfile, 199, L"textures\\cities\\ibb-1LIGHT.dds");
1286 break;
1287 case 79: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibb-2.dds");
1288 wcscpy_s(lightfile, 199, L"textures\\cities\\ibb-2LIGHT.dds");
1289 break;
1290 case 80: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibb-3.dds");
1291 wcscpy_s(lightfile, 199, L"textures\\cities\\ibb-3LIGHT.dds");
1292 break;
1293 case 81: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-distillery.dds");
1294 wcscpy_s(lightfile, 199, L"textures\\cities\\ibf-distilleryLIGHT.dds");
1295 break;
1296 case 82: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-overpass1.dds");
1297 wcscpy_s(lightfile, 199, L"textures\\Cities\\ibf-overpass1LIGHT.dds");
1298 break;
1299 case 83: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-processor.dds");
1300 wcscpy_s(lightfile, 199, L"textures\\cities\\ibf-processorLIGHT.dds");
1301 break;
1302 case 84: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-refiner.dds");
1303 wcscpy_s(lightfile, 199, L"textures\\cities\\ibf-refinerLIGHT.dds");
1304 break;
1305 case 85: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibf-tankcap.dds");
1306 wcscpy_s(lightfile, 199, L"textures\\Cities\\ibf-tankcapLIGHT.dds");
1307 break;
1308 case 86: wcscpy_s(hullfile, 199, L"textures\\Cities\\ibsf-fueltank.dds");
1309 wcscpy_s(lightfile, 199, L"textures\\cities\\ibsf-fueltankLIGHT.dds");
1310 break;
1311 case 87: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-repairgarage.dds");
1312 wcscpy_s(lightfile, 199, L"textures\\cities\\c-repairgarageLIGHT.dds");
1313 break;
1314 case 88: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-equipmentstorage.dds");
1315 wcscpy_s(lightfile, 199, L"textures\\cities\\c-equipmentstorageLIGHT.dds");
1316 break;
1317 // Deois City Center
1318 case 89: wcscpy_s(hullfile, 199, L"textures\\Cities\\tank-water.dds");
1319 wcscpy_s(lightfile, 199, L"textures\\cities\\tank-waterLIGHT.dds");
1320 break;
1321 case 90: wcscpy_s(hullfile, 199, L"textures\\Cities\\arch_post.dds");
1322 wcscpy_s(lightfile, 199, L"textures\\cities\\arch_postLIGHT.dds");
1323 break;
1324 case 91: wcscpy_s(hullfile, 199, L"textures\\Cities\\arch.dds");
1325 wcscpy_s(lightfile, 199, L"textures\\Cities\\archLIGHT.dds");
1326 break;
1327 case 92: wcscpy_s(hullfile, 199, L"textures\\Cities\\g_2_cap.dds");
1328 wcscpy_s(lightfile, 199, L"textures\\Cities\\g_2_capLIGHT.dds");
1329 break;
1330 // Deois Transit District
1331 case 93: wcscpy_s(hullfile, 199, L"textures\\Cities\\r_1_land.dds");
1332 wcscpy_s(lightfile, 199, L"textures\\cities\\r_1_landLIGHT.dds");
1333 break;
1334 case 94: wcscpy_s(hullfile, 199, L"textures\\Cities\\tower-control.dds");
1335 break;
1336 // Deois Port District
1337 case 95: wcscpy_s(hullfile, 199, L"textures\\Cities\\concrete2.dds");
1338 break;
1339 case 96: wcscpy_s(hullfile, 199, L"textures\\Cities\\concrete1-window.dds");
1340 wcscpy_s(lightfile, 199, L"textures\\Cities\\concrete1-windowLIGHT.dds");
1341 break;
1342 case 97: wcscpy_s(hullfile, 199, L"textures\\Cities\\concrete1.dds");
1343 break;
1344 case 98: wcscpy_s(hullfile, 199, L"textures\\Cities\\glassy1-panel.dds");
1345 wcscpy_s(lightfile, 199, L"textures\\Cities\\glassy1-panelLIGHT.dds");
1346 break;
1347 case 99: wcscpy_s(hullfile, 199, L"textures\\Cities\\steel1-corrugated.dds");
1348 break;
1349 case 100: wcscpy_s(hullfile, 199, L"textures\\Cities\\steel1-smooth.dds");
1350 break;
1351 case 101: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAcasino1.dds");
1352 wcscpy_s(lightfile, 199, L"textures\\Cities\\AAAcasino1LIGHT.dds");
1353 break;
1354 case 102: wcscpy_s(hullfile, 199, L"textures\\Cities\\CITY-wall-airport.dds");
1355 break;
1356 case 103: wcscpy_s(hullfile, 199, L"textures\\Cities\\concrete1-groove.dds");
1357 break;
1358 // House1
1359 case 104: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-house1_foot.dds");
1360 wcscpy_s(lightfile, 199, L"textures\\cities\\c-house1_footLIGHT.dds");
1361 break;
1362 case 105: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-house1.dds");
1363 wcscpy_s(lightfile, 199, L"textures\\cities\\c-house1LIGHT.dds");
1364 break;
1365 // Mining1
1366 case 106: wcscpy_s(hullfile, 199, L"textures\\Cities\\mining-com_fnd.dds");
1367 wcscpy_s(lightfile, 199, L"textures\\cities\\mining-com_fndLIGHT.dds");
1368 break;
1369 case 107: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-residence.dds");
1370 wcscpy_s(lightfile, 199, L"textures\\cities\\c-residenceLIGHT.dds");
1371 break;
1372 case 108: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-lzcorner.dds");
1373 wcscpy_s(lightfile, 199, L"textures\\cities\\c-lzcornerLIGHT.dds");
1374 break;
1375 case 109: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAFOUNDATION.dds");
1376 break;
1377 case 110: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAFOUNDATION-LF.dds");
1378 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAFOUNDATION-LFLIGHT.dds");
1379 break;
1380 case 111: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-extractor.dds");
1381 wcscpy_s(lightfile, 199, L"textures\\cities\\c-extractorLIGHT.dds");
1382 break;
1383 case 112: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-biosupport.dds");
1384 wcscpy_s(lightfile, 199, L"textures\\cities\\c-biosupportLIGHT.dds");
1385 break;
1386 case 113: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-powerplant.dds");
1387 wcscpy_s(lightfile, 199, L"textures\\cities\\c-powerplantLIGHT.dds");
1388 break;
1389 case 114: wcscpy_s(hullfile, 199, L"textures\\Cities\\mining-com.dds");
1390 wcscpy_s(lightfile, 199, L"textures\\cities\\mining-comLIGHT.dds");
1391 break;
1392 case 115: wcscpy_s(hullfile, 199, L"textures\\Cities\\WEP-source1.dds");
1393 break;
1394 case 116: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-watertower.dds");
1395 wcscpy_s(lightfile, 199, L"textures\\cities\\c-watertowerLIGHT.dds");
1396 break;
1397 case 117: wcscpy_s(hullfile, 199, L"textures\\Cities\\WEP-tower1.dds");
1398 break;
1399 // Farm1
1400 case 118: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-silo.dds");
1401 wcscpy_s(lightfile, 199, L"textures\\cities\\c-siloLIGHT.dds");
1402 break;
1403 case 119: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-greenhouse1.dds");
1404 wcscpy_s(lightfile, 199, L"textures\\cities\\c-greenhouse1LIGHT.dds");
1405 break;
1406 case 120: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-greenhouse2.dds");
1407 wcscpy_s(lightfile, 199, L"textures\\cities\\c-greenhouse2LIGHT.dds");
1408 break;
1409 case 121: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-greenhouse3.dds");
1410 wcscpy_s(lightfile, 199, L"textures\\cities\\c-greenhouse3LIGHT.dds");
1411 break;
1412 // Township
1413 case 122: wcscpy_s(hullfile, 199, L"textures\\Cities\\AAAcasino2.dds");
1414 wcscpy_s(lightfile, 199, L"textures\\cities\\AAAcasino2LIGHT.dds");
1415 break;
1416 case 123: wcscpy_s(hullfile, 199, L"textures\\Cities\\c-powerproduction.dds");
1417 wcscpy_s(lightfile, 199, L"textures\\cities\\c-powerproductionLIGHT.dds");
1418 break;
1419 case 138: wcscpy_s(hullfile, 199, L"textures\\Cities\\CCCtownblock10-park.dds");
1420 break;
1421 // Prison
1422 case 124: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-plat_cap.dds");
1423 wcscpy_s(lightfile, 199, L"textures\\cities\\sea-plat_capLIGHT.dds");
1424 break;
1425 case 125: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-bldwall3.dds");
1426 wcscpy_s(lightfile, 199, L"textures\\cities\\sea-bldwall3LIGHT.dds");
1427 break;
1428 case 126: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-bldwall1.dds");
1429 wcscpy_s(lightfile, 199, L"textures\\cities\\sea-bldwall1LIGHT.dds");
1430 break;
1431 case 127: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-bldroofA.dds");
1432 break;
1433 case 128: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-bldroofB.dds");
1434 break;
1435 case 129: wcscpy_s(hullfile, 199, L"textures\\Cities\\roverstreet-segment.dds");
1436 wcscpy_s(lightfile, 199, L"textures\\cities\\roverstreet-segmentLIGHT.dds");
1437 break;
1438 case 130: wcscpy_s(hullfile, 199, L"textures\\Cities\\arch_walk10.dds");
1439 wcscpy_s(lightfile, 199, L"textures\\cities\\arch_walk10LIGHT.dds");
1440 break;
1441 case 131: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-legs_trns.dds");
1442 break;
1443 case 132: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-legs_fnd.dds");
1444 break;
1445 case 133: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-legs.dds");
1446 break;
1447 case 134: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-plat.dds");
1448 wcscpy_s(lightfile, 199, L"textures\\cities\\sea-platLIGHT.dds");
1449 break;
1450 case 135: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-platwall1.dds");
1451 wcscpy_s(lightfile, 199, L"textures\\cities\\sea-platwall1LIGHT.dds");
1452 break;
1453 case 136: wcscpy_s(hullfile, 199, L"textures\\Cities\\sea-bldwall2.dds");
1454 break;
1455 case 137: wcscpy_s(hullfile, 199, L"textures\\RTS\\f15d.dds");
1456 wcscpy_s(lightfile, 199, L"textures\\RTS\\f15dLIGHT.dds");
1457 break;
1458 // O-4 ruins
1459 case 139: wcscpy_s(hullfile, 199, L"textures\\Cities\\TOWER.dds");
1460 break;
1461 case 140: wcscpy_s(hullfile, 199, L"textures\\Cities\\ROOF-1.dds");
1462 break;
1463 case 141: wcscpy_s(hullfile, 199, L"textures\\Cities\\ARM-skin-3.dds");
1464 break;
1465 case 142: wcscpy_s(hullfile, 199, L"textures\\Cities\\ALCOVE.dds");
1466 break;
1467 case 143: wcscpy_s(hullfile, 199, L"textures\\Cities\\COLUMN.dds");
1468 break;
1469 case 144: wcscpy_s(hullfile, 199, L"textures\\Cities\\ARM2.dds");
1470 break;
1471 case 145: wcscpy_s(hullfile, 199, L"textures\\Cities\\GUTS3.dds");
1472 break;
1473 case 146: wcscpy_s(hullfile, 199, L"textures\\Cities\\ARM-skin-2.dds");
1474 break;
1475 case 147: wcscpy_s(hullfile, 199, L"textures\\Cities\\ARM.dds");
1476 break;
1477 case 148: wcscpy_s(hullfile, 199, L"textures\\Cities\\CLAMP.dds");
1478 break;
1479 case 149: wcscpy_s(hullfile, 199, L"textures\\Cities\\BOX.dds");
1480 break;
1481 case 150: wcscpy_s(hullfile, 199, L"textures\\Cities\\WALL1-caution.dds");
1482 break;
1483 case 151: wcscpy_s(hullfile, 199, L"textures\\Cities\\COLUMN2.dds");
1484 break;
1485 case 152: wcscpy_s(hullfile, 199, L"textures\\Cities\\WALL1-lit.dds");
1486 break;
1487 case 153: wcscpy_s(hullfile, 199, L"textures\\Cities\\DOORFRAME.dds");
1488 break;
1489 case 154: wcscpy_s(hullfile, 199, L"textures\\Cities\\WALL2-dark.dds");
1490 break;
1491 case 155: wcscpy_s(hullfile, 199, L"textures\\Cities\\WALL2-caution.dds");
1492 break;
1493 case 156: wcscpy_s(hullfile, 199, L"textures\\Cities\\BOX-int2.dds");
1494 break;
1495 case 157: wcscpy_s(hullfile, 199, L"textures\\Cities\\BOX-int.dds");
1496 break;
1497 case 158: wcscpy_s(hullfile, 199, L"textures\\Cities\\GUTS1.dds");
1498 break;
1499 case 159: wcscpy_s(hullfile, 199, L"textures\\Cities\\GUTS2.dds");
1500 break;
1501 case 160: wcscpy_s(hullfile, 199, L"textures\\Cities\\DISH-int.dds");
1502 break;
1503 case 161: wcscpy_s(hullfile, 199, L"textures\\Cities\\DISH-ext.dds");
1504 break;
1505 case 162: wcscpy_s(hullfile, 199, L"textures\\Cities\\ARM-skin.dds");
1506 break;
1507 case 163: wcscpy_s(hullfile, 199, L"textures\\Cities\\TANK.dds");
1508 break;
1509 case 164: wcscpy_s(hullfile, 199, L"textures\\Cities\\dome4.dds");
1511 break;
1512 // Airfield
1513 case 165: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\terminal1.dds");
1514 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\terminal1LIGHT.dds");
1515 break;
1516 case 166: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\gravel2.dds");
1517 break;
1518 case 167: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\power1.dds");
1519 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\power1LIGHT.dds");
1520 break;
1521 case 168: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\steel1-corrugated.dds");
1522 break;
1523 case 169: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\hotel1.dds");
1524 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\hotel1LIGHT.dds");
1525 break;
1526 case 170: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\hangar1.dds");
1527 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\hangar1LIGHT.dds");
1528 break;
1529 case 171: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\hangardoor1.dds");
1530 break;
1531 case 172: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\warehouse1.dds");
1532 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\warehouse1LIGHT.dds");
1533 break;
1534 case 173: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\garage1.dds");
1535 wcscpy_s(lightfile, 199, L"textures\\Colonies\\Airfield\\garage1LIGHT.dds");
1536 break;
1537 case 174: wcscpy_s(hullfile, 199, L"textures\\Colonies\\Airfield\\steel2-corrugated.dds");
1538 break;
1539 // Christmas Town
1540 case 175: wcscpy_s(hullfile, 199, L"textures\\Cities\\B5-DO.dds");
1541 wcscpy_s(lightfile, 199, L"textures\\cities\\B5-DOLIGHT.dds");
1542 break;
1543 case 176: wcscpy_s(hullfile, 199, L"textures\\Cities\\B4-DO.dds");
1544 wcscpy_s(lightfile, 199, L"textures\\cities\\B4-DOLIGHT.dds");
1545 break;
1546 case 177: wcscpy_s(hullfile, 199, L"textures\\Cities\\B3-DO.dds");
1547 wcscpy_s(lightfile, 199, L"textures\\cities\\B3-DOLIGHT.dds");
1548 break;
1549 case 178: wcscpy_s(hullfile, 199, L"textures\\Cities\\needles.dds");
1550 break;
1551 case 179: wcscpy_s(hullfile, 199, L"textures\\Cities\\Ballspng.dds");
1552 break;
1553 case 180: wcscpy_s(hullfile, 199, L"textures\\Cities\\treebark.dds");
1554 break;
1555 case 181: wcscpy_s(hullfile, 199, L"textures\\Cities\\gold star.dds");
1556 // we use the same texture for the light/emissive map
1557 wcscpy_s(lightfile, 199, L"textures\\cities\\gold star.dds");
1558 break;
1559 case 182: wcscpy_s(hullfile, 199, L"textures\\Cities\\Sign-screen-lattice.dds");
1560 break;
1561 }
1562
1563#ifndef skipBuildings
1564
1565 if (hullfile[0] != 0)
1566 {
1567 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, hullfile, &viewscreen->m_pddsCityTexture[*instage], Rendering::DefaultSize)))
1568 {
1569 sprintf_s(msg, sizeof(msg), "Could not load \"%S\": %S", hullfile, Rendering::ErrorString(hr));
1571 }
1572 else
1573 {
1574 sprintf_s(msg, sizeof(msg), "m_pddsCityTexture[%i]", *instage);
1576 viewscreen->gameclass->TouchFile(hullfile);
1577 }
1578 }
1579
1580 if (lightfile[0] != 0)
1581 {
1582 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, lightfile, &viewscreen->m_pddsCityLights[*instage], Rendering::DefaultSize)))
1583 {
1584 sprintf_s(msg, sizeof(msg), "Could not load \"%S\": %S", hullfile, Rendering::ErrorString(hr));
1586 }
1587 else
1588 {
1589 sprintf_s(msg, sizeof(msg), "m_pddsCityLights[%i]", *instage);
1591 viewscreen->gameclass->TouchFile(lightfile);
1592 }
1593 }
1594#else
1595 * instage = -1;
1596#endif
1597 } // instage loop
1598 } // stage==5
1599 } // stage>=5
1600
1601 if (*stage >= 6)
1602 {
1603 if (*stage > 6)
1604 txtHelper.DrawTextLine(L"Orbital facilities loaded!");
1605 if (*stage == 6)
1606 {
1607 (*instage)++; // start at 1
1608
1609 txtHelper.DrawFormattedTextLine(L"Orbital facilities loading (%i/%i)...", *instage, docktextureC);
1610
1611 if (*instage == docktextureC) // while less than docktextureC
1612 {
1613 *instage = -1;
1614 logger->Log("Orbital facilities loaded...");
1615 }
1616 else
1617 {
1618 WCHAR hullfile[199], lightfile[199];
1619 t = *instage;
1620 // Defaults
1621 hullfile[0] = lightfile[0] = 0;
1622 switch (t)
1623 {
1624 // Cutter's Port CPOC
1625 case 1: wcscpy_s(hullfile, 199, L"textures\\Docks\\Stationnode.dds");
1626 wcscpy_s(lightfile, 199, L"textures\\Docks\\StationnodeLIGHT.dds");
1627 break;
1628 case 2: wcscpy_s(hullfile, 199, L"textures\\Docks\\Node-ang45.dds");
1629 break;
1630 case 3: wcscpy_s(hullfile, 199, L"textures\\Docks\\Corridor1-ang45.dds");
1631 wcscpy_s(lightfile, 199, L"textures\\Docks\\Corridor1-ang45LIGHT.dds");
1632 break;
1633 case 4: wcscpy_s(hullfile, 199, L"textures\\Docks\\Big-Tank_cap.dds");
1634 wcscpy_s(lightfile, 199, L"textures\\Docks\\Big-Tank_capLIGHT.dds");
1635 break;
1636 case 5: wcscpy_s(hullfile, 199, L"textures\\Docks\\Big-Tank_section1.dds");
1637 wcscpy_s(lightfile, 199, L"textures\\Docks\\Big-Tank_section1LIGHT.dds");
1638 break;
1639 case 6: wcscpy_s(hullfile, 199, L"textures\\Docks\\Big-Tank_section2.dds");
1640 wcscpy_s(lightfile, 199, L"textures\\Docks\\Big-Tank_section2LIGHT.dds");
1641 break;
1642 case 7: wcscpy_s(hullfile, 199, L"textures\\Docks\\Tank.dds");
1643 wcscpy_s(lightfile, 199, L"textures\\Docks\\TankLIGHT.dds");
1644 break;
1645 case 8: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-ATI.dds");
1646 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-ATI.dds");
1647 break;
1648 case 9: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-BIGREDWIRE.dds");
1649 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-BIGREDWIRE.dds");
1650 break;
1651 case 10: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-JVC.dds");
1652 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-JVC.dds");
1653 break;
1654 case 11: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-KOSS.dds");
1655 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-KOSS.dds");
1656 break;
1657 case 12: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-LOCKHEED.dds");
1658 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-LOCKHEED.dds");
1659 break;
1660 case 13: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-TECHROFORM.dds");
1661 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-TECHROFORM.dds");
1662 break;
1663 case 14: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-VERBATIM.dds");
1664 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-VERBATIM.dds");
1665 break;
1666 case 15: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-45-CUTTER'S.dds");
1667 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-45-CUTTER'SLIGHT.dds");
1668 break;
1669 case 16: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-MINOLTA.dds");
1670 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-MINOLTA.dds");
1671 break;
1672 case 17: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-body1.dds");
1673 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-body1LIGHT.dds");
1674 break;
1675 case 18: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-int1.dds");
1676 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-int1LIGHT.dds");
1677 break;
1678 case 19: wcscpy_s(hullfile, 199, L"textures\\Docks\\Gangway.dds");
1679 wcscpy_s(lightfile, 199, L"textures\\Docks\\GangwayLIGHT.dds");
1680 break;
1681 case 20: wcscpy_s(hullfile, 199, L"textures\\Docks\\Joint.dds");
1682 wcscpy_s(lightfile, 199, L"textures\\Docks\\JointLIGHT.dds");
1683 break;
1684 case 21: wcscpy_s(hullfile, 199, L"textures\\Docks\\Reactor.dds");
1685 wcscpy_s(lightfile, 199, L"textures\\Docks\\ReactorLIGHT.dds");
1686 break;
1687 case 22: wcscpy_s(hullfile, 199, L"textures\\Docks\\Brace.dds");
1688 wcscpy_s(lightfile, 199, L"textures\\Docks\\BraceLIGHT.dds");
1689 break;
1690 case 23: wcscpy_s(hullfile, 199, L"textures\\Docks\\Communications.dds");
1691 wcscpy_s(lightfile, 199, L"textures\\Docks\\CommunicationsLIGHT.dds");
1692 break;
1693 case 24: wcscpy_s(hullfile, 199, L"textures\\Docks\\Xition2.dds");
1694 wcscpy_s(lightfile, 199, L"textures\\Docks\\Xition2LIGHT.dds");
1695 break;
1696 case 25: wcscpy_s(hullfile, 199, L"textures\\Docks\\Panel1.dds");
1697 wcscpy_s(lightfile, 199, L"textures\\Docks\\Panel1LIGHT.dds");
1698 break;
1699 case 26: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-fnd1.dds");
1700 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-fnd1LIGHT.dds");
1701 break;
1702 case 27: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-cap1.dds");
1703 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-cap1LIGHT.dds");
1704 break;
1705 case 28: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-fnd2.dds");
1706 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-fnd2LIGHT.dds");
1707 break;
1708 case 29: wcscpy_s(hullfile, 199, L"textures\\Docks\\Xition1.dds");
1709 wcscpy_s(lightfile, 199, L"textures\\Docks\\Xition1LIGHT.dds");
1710 break;
1711 case 30: wcscpy_s(hullfile, 199, L"textures\\Docks\\Riser2.dds");
1712 wcscpy_s(lightfile, 199, L"textures\\Docks\\Riser2LIGHT.dds");
1713 break;
1714 case 31: wcscpy_s(hullfile, 199, L"textures\\Docks\\Interface.dds");
1715 wcscpy_s(lightfile, 199, L"textures\\Docks\\InterfaceLIGHT.dds");
1716 break;
1717 case 32: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-rectangle.dds");
1718 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-rectangleLIGHT.dds");
1719 break;
1720 case 33: wcscpy_s(hullfile, 199, L"textures\\Docks\\Corridor1.dds");
1721 wcscpy_s(lightfile, 199, L"textures\\Docks\\Corridor1LIGHT.dds");
1722 break;
1723 case 34: wcscpy_s(hullfile, 199, L"textures\\Cities\\WEP-source1.dds");
1724 break;
1725 case 35: wcscpy_s(hullfile, 199, L"textures\\Docks\\Lounge.dds");
1726 wcscpy_s(lightfile, 199, L"textures\\Docks\\LoungeLIGHT.dds");
1727 break;
1728 case 36: wcscpy_s(hullfile, 199, L"textures\\Docks\\Riser1.dds");
1729 wcscpy_s(lightfile, 199, L"textures\\Docks\\Riser1LIGHT.dds");
1730 break;
1731 case 37: wcscpy_s(hullfile, 199, L"textures\\Docks\\Office-cap2.dds");
1732 wcscpy_s(lightfile, 199, L"textures\\Docks\\Office-cap2LIGHT.dds");
1733 break;
1734 // Easydock TAC
1735 case 38: wcscpy_s(hullfile, 199, L"textures\\Docks\\ring-ad.dds");
1736 wcscpy_s(lightfile, 199, L"textures\\Docks\\ring-adLIGHT.dds");
1737 break;
1738 case 39: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZStationnode.dds");
1739 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZStationnodeLIGHT.dds");
1740 break;
1741 case 40: wcscpy_s(hullfile, 199, L"textures\\Docks\\Bracenode.dds");
1742 break;
1743 case 41: wcscpy_s(hullfile, 199, L"textures\\Docks\\braceshaft.dds");
1744 break;
1745 case 42: wcscpy_s(hullfile, 199, L"textures\\Docks\\Braceshaft1.dds");
1746 wcscpy_s(lightfile, 199, L"textures\\Docks\\Braceshaft1LIGHT.dds");
1747 break;
1748 case 43: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZBig-Tank_cap.dds");
1749 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZBig-Tank_capLIGHT.dds");
1750 break;
1751 case 44: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZBig-Tank_section1.dds");
1752 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZBig-Tank_section1LIGHT.dds");
1753 break;
1754 case 45: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-square.dds");
1755 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-squareLIGHT.dds");
1756 break;
1757 case 46: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZTank.dds");
1758 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZTankLIGHT.dds");
1759 break;
1760 case 47: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-body1.dds");
1761 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-body1LIGHT.dds");
1762 break;
1763 case 48: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-int1.dds");
1764 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-int1LIGHT.dds");
1765 break;
1766 case 49: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZJoint.dds");
1767 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZJointLIGHT.dds");
1768 break;
1769 case 50: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZGangway.dds");
1770 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZGangwayLIGHT.dds");
1771 break;
1772 case 51: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZReactor.dds");
1773 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZReactorLIGHT.dds");
1774 break;
1775 case 52: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZXition2.dds");
1776 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZXition2LIGHT.dds");
1777 break;
1778 case 53: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZXition1.dds");
1779 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZXition1LIGHT.dds");
1780 break;
1781 case 54: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-fnd1.dds");
1782 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-fnd1LIGHT.dds");
1783 break;
1784 case 55: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-cap1.dds");
1785 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-cap1LIGHT.dds");
1786 break;
1787 case 56: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-fnd2.dds");
1788 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-fnd2LIGHT.dds");
1789 break;
1790 case 57: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZRiser2.dds");
1791 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZRiser2LIGHT.dds");
1792 break;
1793 case 58: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-EZDOCK.dds");
1794 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-EZDOCKLIGHT.dds");
1795 break;
1796 case 59: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZInterface.dds");
1797 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZInterfaceLIGHT.dds");
1798 break;
1799 case 60: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZCorridor1.dds");
1800 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZCorridor1LIGHT.dds");
1801 break;
1802 case 61: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZRiser1.dds");
1803 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZRiser1LIGHT.dds");
1804 break;
1805 case 62: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZLounge.dds");
1806 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZLoungeLIGHT.dds");
1807 break;
1808 case 63: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZOffice-cap2.dds");
1809 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZOffice-cap2LIGHT.dds");
1810 break;
1811 // Sentry Station YSP
1812 case 64: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZNode-ang45.dds");
1813 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZNode-ang45LIGHT.dds");
1814 break;
1815 case 65: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZCorridor1-ang45.dds");
1816 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZCorridor1-ang45LIGHT.dds");
1817 break;
1818 case 66: wcscpy_s(hullfile, 199, L"textures\\Docks\\Sign-YSP.dds");
1819 wcscpy_s(lightfile, 199, L"textures\\Docks\\Sign-YSP.dds");
1820 break;
1821 case 67: wcscpy_s(hullfile, 199, L"textures\\Docks\\EZPanel1.dds");
1822 wcscpy_s(lightfile, 199, L"textures\\Docks\\EZPanel1LIGHT.dds");
1823 break;
1824 }
1825#ifndef skipDocks
1826 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, hullfile, &viewscreen->m_pddsDockTexture[t], 1)))
1827 {
1828 sprintf_s(msg, sizeof(msg), "Could not load \"%S\" (%i)! (%S)", hullfile, t, Rendering::ErrorString(hr));
1830 }
1831 else
1832 {
1833 sprintf_s(msg, sizeof(msg), "m_pddsDockTexture[%i]", t);
1835 }
1836 if (lightfile[0] != 0)
1837 {
1838 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, lightfile, &viewscreen->m_pddsDockLights[t], 1)))
1839 {
1840 sprintf_s(msg, sizeof(msg), "Could not load \"%S\" (%i)! (%S)", lightfile, t, Rendering::ErrorString(hr));
1842 }
1843 }
1844 else
1845 {
1846 sprintf_s(msg, sizeof(msg), "m_pddsDockLights[%i]", t);
1848 }
1849#else
1850 * instage = -1;
1851#endif
1852 } // instage loop
1853 } // stage ==6
1854 } // stage >=6
1855
1856 if (*stage >= 7)
1857 {
1858 if (*stage > 7)
1859 txtHelper.DrawTextLine(L"Landforms loaded!");
1860 if (*stage == 7)
1861 {
1862 // start at 0
1863
1864 txtHelper.DrawFormattedTextLine(L"Landforms loading (%i/%i)...", *instage + 1, landformtextureC);
1865
1866 if (*instage == landformtextureC) // while less than terraintextureC
1867 {
1868 *instage = -1;
1869 logger->Log("Landforms loaded...");
1870 }
1871 else
1872 {
1873#ifndef skipTerrain
1874 t = *instage;
1875 WCHAR filemsg[199];
1876 swprintf_s(filemsg, 199, L"Textures\\Terrain\\Landform_%02i.png", t);
1877 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsLandform[t], Rendering::DefaultSize)))
1878 {
1879 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", filemsg, Rendering::ErrorString(hr));
1881 }
1882 else
1883 {
1884 sprintf_s(msg, sizeof(msg), "m_pddsLandform[%i]", t);
1886 }
1887 (*instage)++;
1888#else
1889 * instage = -1;
1890#endif
1891 } // instage loop
1892 } // stage==7
1893 } // stage>=7
1894
1895 if (*stage >= 8)
1896 {
1897 if (*stage > 8)
1898 txtHelper.DrawTextLine(L"Runway and road layers loaded!");
1899 if (*stage == 8 && *instage == 0)
1900 {
1901 txtHelper.DrawTextLine(L"Marston Mats loading (1)...");
1902 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\RTS\\Marston1.dds", &viewscreen->m_pddsMarston1, Rendering::DefaultSize, 57, 28)))
1903 {
1904 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\RTS\\Marston1.dds\"! (%S)", Rendering::ErrorString(hr));
1906 }
1907 else
1908 viewscreen->gameclass->AddTrackedResource("m_pddsMarston1"); // managed
1909 *instage = 1;
1910 }
1911 else if (*stage == 8 && *instage == 1)
1912 {
1913 txtHelper.DrawTextLine(L"Runway edge light loading (1)...");
1914 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\RTS\\RunwayEdgeLight.dds", &viewscreen->m_pddsRunwayEdgeLight1, Rendering::DefaultSize)))
1915 {
1916 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\RTS\\RunwayEdgeLight.dds\"! (%S)", Rendering::ErrorString(hr));
1918 }
1919 else
1920 viewscreen->gameclass->AddTrackedResource("m_pddsRunwayEdgeLight1"); // managed
1921 *instage = 2;
1922 }
1923 else if (*stage == 8 && *instage == 2)
1924 {
1925 txtHelper.DrawTextLine(L"Road texture loading (1)...");
1926 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\RTS\\Road.dds", &viewscreen->m_pddsRoad, Rendering::DefaultSize)))
1927 {
1928 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\RTS\\Road.dds\"! (%S)", Rendering::ErrorString(hr));
1930 }
1931 else
1932 viewscreen->gameclass->AddTrackedResource("m_pddsRoad"); // managed
1933 *instage = 3;
1934 }
1935 else if (*stage == 8 && *instage == 3)
1936 {
1937 txtHelper.DrawTextLine(L"Intersection texture loading (1)...");
1938 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\RTS\\Intersection.dds", &viewscreen->m_pddsIntersection, Rendering::DefaultSize)))
1939 {
1940 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\RTS\\Intersection.dds\"! (%S)", Rendering::ErrorString(hr));
1942 }
1943 else
1944 viewscreen->gameclass->AddTrackedResource("m_pddsIntersection"); // managed
1945 *instage = -1;
1946 }
1947 }
1948
1949 if (*stage >= 9)
1950 {
1951 if (*stage > 9)
1952 txtHelper.DrawTextLine(L"Landform transitions loaded!");
1953 if (*stage == 9)
1954 {
1955 // start at 0
1956
1957 txtHelper.DrawFormattedTextLine(L"Landform transitions loading (%i/%i)...", *instage + 1, transitiontextureC);
1958
1959 if (*instage == transitiontextureC) // while less than terraintextureC
1960 {
1961 *instage = -1;
1962 logger->Log("Landform transitions loaded...");
1963 }
1964 else
1965 {
1966#ifndef skipTerrain
1967 t = *instage;
1968 WCHAR filemsg[199];
1969 swprintf_s(filemsg, 199, L"Textures\\Terrain\\Transition_%02i.png", t + 1);
1970 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsTransition[t], Rendering::DefaultSize)))
1971 {
1972 sprintf_s(msg, sizeof(msg), "Could not load \"%S\"! (%S)", filemsg, Rendering::ErrorString(hr));
1974 }
1975 else
1976 {
1977 sprintf_s(msg, sizeof(msg), "m_pddsTransition[%i]", t);
1979 }
1980 (*instage)++;
1981#else
1982 * instage = -1;
1983#endif
1984 } // instage loop
1985 } // stage==9
1986 } // stage>=9
1987
1988 if (*stage >= 10)
1989 {
1990 if (*stage == 10)
1991 {
1992 // start at 0
1993
1994 txtHelper.DrawFormattedTextLine(L"Cloud effects loading (%i/%i)...", *instage, elmoAnimateC);
1995
1996 if (*instage == elmoAnimateC) // while less than elmoAnimateC
1997 {
1998 *instage = -1;
1999 logger->Log("Cloud effects loaded...");
2000 }
2001 else
2002 {
2003 t = *instage;
2004 WCHAR filemsg[199];
2005 swprintf_s(filemsg, 199, L"Textures\\Clouds\\Elmo%i.dds", t + 1);
2006 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsElmo[t], 1)))
2007 {
2008 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Clouds\\Elmo%i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2010 }
2011 else
2012 {
2013 sprintf_s(msg, sizeof(msg), "m_pddsElmo[%i]", t);
2015 }
2016 (*instage)++;
2017 }
2018 }
2019 }
2020
2021 if (*stage >= 11)
2022 {
2023 if (*stage > 11)
2024 txtHelper.DrawTextLine(L"Cloud layers loaded!");
2025 if (*stage == 11 && *instage == 2)
2026 {
2027 txtHelper.DrawTextLine(L"Cloud layers loading (tops)...");
2028 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Clouds\\cloudbase.dds", &viewscreen->m_pddsCloudBaseMap, 1)))
2029 {
2030 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Clouds\\cloudbase.dds\"! (%S)", Rendering::ErrorString(hr));
2032 }
2033 else
2034 viewscreen->gameclass->AddTrackedResource("m_pddsCloudBaseMap"); // managed
2035 *instage = -1;
2036 }
2037 if (*stage == 11 && *instage == 1)
2038 {
2039 txtHelper.DrawTextLine(L"Cloud layers loading (base detail)...");
2040 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Clouds\\clouddetailbelow.dds", &viewscreen->m_pddsCloudDetailBelow, 1)))
2041 {
2042 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Clouds\\clouddetailbelow.dds\"! (%S)", Rendering::ErrorString(hr));
2044 }
2045 else
2046 viewscreen->gameclass->AddTrackedResource("m_pddsCloudDetailBelow"); // managed
2047 *instage = 2;
2048 }
2049 if (*stage == 11 && *instage == 0)
2050 {
2051 txtHelper.DrawTextLine(L"Cloud layers loading (tops detail)...");
2052 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Clouds\\clouddetailabove.dds", &viewscreen->m_pddsCloudDetailAbove, 1)))
2053 {
2054 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Clouds\\clouddetailabove.dds\"! (%S)", Rendering::ErrorString(hr));
2056 }
2057 else
2058 viewscreen->gameclass->AddTrackedResource("m_pddsCloudDetailAbove"); // managed
2059 *instage = 1;
2060 }
2061 }
2062
2063 if (*stage >= 12)
2064 {
2065 if (*stage > 12)
2066 txtHelper.DrawTextLine(L"Holiday effects loaded!");
2067 if (*stage == 12 && *instage == 0)
2068 {
2069 txtHelper.DrawTextLine(L"Holiday effects loading...");
2070 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Holidays\\halloween.dds", &viewscreen->m_pddsHolidayTexture, 1)))
2071 {
2072 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Holidays\\halloween.dds\"! (%S)", Rendering::ErrorString(hr));
2074 }
2075 else
2076 viewscreen->gameclass->AddTrackedResource("m_pddsHolidayTexture"); // managed
2077 *instage = -1;
2078 }
2079 }
2080
2081 if (*stage >= 13)
2082 {
2083 if (*stage > 13)
2084 txtHelper.DrawTextLine(L"Weapons loaded!");
2085 if (*stage == 13)
2086 {
2087 // start at 0
2088
2089 txtHelper.DrawFormattedTextLine(L"Weapons loading (%i/%i)...", *instage, weaponanimateC);
2090
2091 if (*instage == weaponanimateC) // while less than weaponanimateC
2092 {
2093 *instage = -1;
2094 logger->Log("Weapons loaded...");
2095 }
2096 else
2097 {
2098#ifndef skipAnimations
2099 t = *instage;
2100 WCHAR filemsg[199];
2101 swprintf_s(filemsg, 199, L"Textures\\Weapons\\weapon%i.dds", t + 1);
2102 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsWeapon[t], 1)))
2103 {
2104 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Weapons\\weapon%i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2106 }
2107 else
2108 {
2109 sprintf_s(msg, sizeof(msg), "m_pddsWeapon[%i]", t);
2111 }
2112 swprintf_s(filemsg, 199, L"Textures\\Weapons\\Sinker\\sinker%04i.dds", t + 1);
2113 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsSinker[t], 1)))
2114 {
2115 sprintf_s(msg, sizeof(msg), "Could not load \"Weapons\\Sinker\\sinker%04i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2117 }
2118 else
2119 {
2120 sprintf_s(msg, sizeof(msg), "m_pddsSinker[%i]", t);
2122 }
2123 (*instage)++;
2124#else
2125 * instage = -1;
2126#endif
2127 } // instage loop
2128 } // stage==13
2129 } // stage>=13
2130
2131 if (*stage >= 14)
2132 {
2133 if (*stage == 14)
2134 {
2135 txtHelper.DrawTextLine(L"Explosions loading (Blast)...");
2136
2137#ifndef skipAnimations
2138 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Explosions\\blast.dds", &viewscreen->m_pddsBlastX, 1)))
2139 {
2140 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Explosions\\blast.dds\"! (%S)", Rendering::ErrorString(hr));
2142 }
2143 else
2144 viewscreen->gameclass->AddTrackedResource("m_pddsBlastX"); // managed
2145 logger->Log("Explosions (Blast) loaded...");
2146#endif
2147 * instage = -1;
2148 } // stage==14
2149 } // stage>=14
2150
2151 if (*stage >= 15)
2152 {
2153 if (*stage == 15)
2154 {
2155 txtHelper.DrawTextLine(L"Explosions loading (Fuzer)...");
2156
2157#ifndef skipAnimations
2158 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Explosions\\fuzer.dds", &viewscreen->m_pddsFuzerX, 1)))
2159 {
2160 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Explosions\\fuzer.dds\"! (%S)", Rendering::ErrorString(hr));
2162 }
2163 else
2164 viewscreen->gameclass->AddTrackedResource("m_pddsFuzerX"); // managed
2165 logger->Log("Explosions (Fuzer) loaded...");
2166#endif
2167 * instage = -1;
2168 } // stage==15
2169 } // stage>=15
2170
2171 if (*stage >= 16)
2172 {
2173 if (*stage > 16)
2174 txtHelper.DrawTextLine(L"Explosions loaded!");
2175 if (*stage == 16)
2176 {
2177 txtHelper.DrawTextLine(L"Explosions loading (Sinker)...");
2178
2179#ifndef skipAnimations
2180 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Explosions\\sinker.dds", &viewscreen->m_pddsSinkerX, 1)))
2181 {
2182 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Explosions\\sinker.dds\"! (%S)", Rendering::ErrorString(hr));
2184 }
2185 else
2186 viewscreen->gameclass->AddTrackedResource("m_pddsSinkerX"); // managed
2187 logger->Log("Explosions (Sinker) loaded...");
2188#endif
2189 * instage = -1;
2190 } // stage==16
2191 } // stage>=16
2192
2193#ifdef smoketestC
2194 for (t = 0; t < smoketrailC; t++)
2195 {
2196 sprintf_s(msg, sizeof(msg), "Textures\\Animations\\Smoke\\smoketest%04i.png", t + 1);
2197 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, Lmsg, &m_pddsSmoke[t], 1)))
2198 {
2199 sprintf_s(msg, sizeof(msg), "Could not load \"Animations\\Smoke\\smoketest%04i.png\"! (%S)", t + 1, Rendering::ErrorString(hr));
2200 Trace(msg, Logger::Level::Fatal);
2201 }
2202 else
2203 {
2204 sprintf_s(msg, sizeof(msg), "m_pddsSmoke[%i]", t);
2206 }
2207 }
2208#endif
2209
2210 // Retain the loading-stage numbering after retiring the plasma texture.
2211 if (*stage == 17) *instage = -1;
2212
2213 if (*stage >= 18)
2214 {
2215 if (*stage == 18)
2216 {
2217 // start at 0
2218
2219 txtHelper.DrawFormattedTextLine(L"Animations loading (DIHV (%i/%i))...", *instage, dihvanimateC);
2220
2221 if (*instage == dihvanimateC) // while less than dihvanimateC
2222 {
2223 *instage = -1;
2224 logger->Log("Animations (DIHV) loaded...");
2225 }
2226 else
2227 {
2228#ifndef skipAnimations
2229 t = *instage;
2230 WCHAR filemsg[199];
2231 swprintf_s(filemsg, 199, L"Textures\\Animations\\DIHV\\dihvexit%04i.dds", t + 1);
2232 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsDIHV[t], 1)))
2233 {
2234 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Animations\\DIHV\\dihvexit%04i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2236 }
2237 else
2238 {
2239 sprintf_s(msg, sizeof(msg), "m_pddsDIHV[%i]", t);
2241 }
2242 (*instage)++;
2243#else
2244 * instage = -1;
2245#endif
2246 } // instage loop
2247 } // stage==18
2248 } // stage>=18
2249
2250 if (*stage >= 19)
2251 {
2252 if (*stage == 19)
2253 {
2254 // start at 0
2255
2256 txtHelper.DrawFormattedTextLine(L"Animations loading (Caridac (%i/%i))...", *instage, heartanimateC);
2257
2258 if (*instage == heartanimateC) // while less than heartanimateC
2259 {
2260 *instage = -1;
2261 logger->Log("Animations (Cardiac) loaded...");
2262 }
2263 else
2264 {
2265#ifndef skipAnimations
2266 t = *instage;
2267 WCHAR filemsg[199];
2268 swprintf_s(filemsg, 199, L"Textures\\Animations\\Cardiac\\HEART%i.dds", t + 1);
2269 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsHeart[t], 1)))
2270 {
2271 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Animations\\Cardiac\\HEART%i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2273 }
2274 else
2275 {
2276 sprintf_s(msg, sizeof(msg), "m_pddsHeart[%i]", t);
2278 }
2279 (*instage)++;
2280#else
2281 * instage = -1;
2282#endif
2283 } // instage loop
2284 } // stage==19
2285 } // stage>=19
2286
2287 if (*stage >= 20)
2288 {
2289 if (*stage > 20)
2290 txtHelper.DrawTextLine(L"Water normal loaded!");
2291 if (*stage == 20 && *instage == 0)
2292 {
2293 txtHelper.DrawTextLine(L"Water normal loading...");
2294 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Terrain\\Water_Normal.png", &viewscreen->m_pddsWaterNormal, Rendering::DefaultSize)))
2295 {
2296 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Terrain\\Water_Normal.png\"! (%S)", Rendering::ErrorString(hr));
2298 }
2299 else
2300 viewscreen->gameclass->AddTrackedResource("m_pddsWaterNormal"); // managed
2301 *instage = -1;
2302 }
2303 }
2304
2305 if (*stage == 21)
2306 {
2307 *instage = -1;
2308#ifndef skipAnimations
2309 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Colonies\\Refinery\\Flame.dds", &viewscreen->m_pddsFlame, 1)))
2310 {
2311 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Colonies\\Refinery\\Flame.dds\"! (%S)", Rendering::ErrorString(hr));
2313 }
2314 else
2315 viewscreen->gameclass->AddTrackedResource("m_pddsFlame"); // managed
2316#endif
2317 }
2318
2319 if (*stage == 22)
2320 *stage = 23;
2321
2322 if (*stage >= 23)
2323 {
2324 if (*stage == 23)
2325 {
2326 // start at 0
2327
2328 txtHelper.DrawFormattedTextLine(L"Animations loading (Fireworks_1 (%i/%i))...", *instage, firework1C);
2329
2330 if (*instage == firework1C) // while less than firework1C
2331 {
2332 *instage = -1;
2333 logger->Log("Animations (Fireworks 1/3) loaded...");
2334 }
2335 else
2336 {
2337#ifndef skipAnimations
2338 t = *instage;
2339 WCHAR filemsg[199];
2340 swprintf_s(filemsg, 199, L"Textures\\Animations\\Fireworks\\fw1%04i.dds", t + 1);
2341 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsFirework1[t], 1)))
2342 {
2343 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Animations\\Fireworks\\fw1%04i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2345 }
2346 else
2347 {
2348 sprintf_s(msg, sizeof(msg), "m_pddsFirework1[%i]", t);
2350 }
2351 (*instage)++;
2352#else
2353 * instage = -1;
2354#endif
2355 } // instage loop
2356 } // stage==23
2357 } // stage>=23
2358
2359 if (*stage >= 24)
2360 {
2361 if (*stage == 24)
2362 {
2363 // start at 0
2364
2365 txtHelper.DrawFormattedTextLine(L"Animations loading (Fireworks_2 (%i/%i))...", *instage, firework2C);
2366
2367 if (*instage == firework2C) // while less than firework2C
2368 {
2369 *instage = -1;
2370 logger->Log("Animations (Fireworks 2/3) loaded...");
2371 }
2372 else
2373 {
2374#ifndef skipAnimations
2375 t = *instage;
2376 WCHAR filemsg[199];
2377 swprintf_s(filemsg, 199, L"Textures\\Animations\\Fireworks\\fw2%04i.dds", t + 1);
2378 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsFirework2[t], 1)))
2379 {
2380 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Animations\\Fireworks\\fw2%04i.dds\"! (%S)", t + 1, Rendering::ErrorString(hr));
2382 }
2383 else
2384 {
2385 sprintf_s(msg, sizeof(msg), "m_pddsFirework2[%i]", t);
2387 }
2388 (*instage)++;
2389#else
2390 * instage = -1;
2391#endif
2392 } // instage loop
2393 } // stage==24
2394 } // stage>=24
2395
2396 if (*stage >= 25)
2397 {
2398 if (*stage > 25)
2399 txtHelper.DrawTextLine(L"Animations loaded!");
2400 if (*stage == 25)
2401 {
2402 // start at 0
2403
2404 txtHelper.DrawFormattedTextLine(L"Animations loading (Fireworks_3 (%i/%i))...", *instage, firework3C);
2405
2406 if (*instage == firework3C) // while less than firework3C
2407 {
2408 *instage = -1;
2409 logger->Log("Animations (Fireworks 3/3) loaded...");
2410 }
2411 else
2412 {
2413#ifndef skipAnimations
2414 t = *instage;
2415 WCHAR filemsg[199];
2416 swprintf_s(filemsg, 199, L"Textures\\Animations\\Fireworks\\fw3%04i.dds", t + 2);
2417 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, filemsg, &viewscreen->m_pddsFirework3[t], 1)))
2418 {
2419 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Animations\\Fireworks\\fw3%04i.dds\"! (%S)", t + 2, Rendering::ErrorString(hr));
2421 }
2422 else
2423 {
2424 sprintf_s(msg, sizeof(msg), "m_pddsFirework3[%i]", t);
2426 }
2427 (*instage)++;
2428#else
2429 * instage = -1;
2430#endif
2431 } // instage loop
2432 } // stage==25
2433 } // stage>=25
2434
2435 if (*stage >= 26)
2436 {
2437 if (*stage > 26)
2438 txtHelper.DrawTextLine(L"Instruments loaded!");
2439 if (*stage == 26 && *instage == 10)
2440 {
2441 /*txtHelper.DrawTextLine(L"Instruments loading (Arrow)...");
2442 if (FAILED(hr = D3DXCreateTextureFromFileEx(pd3dDevice, L"Textures\\Instruments\\arrow.dds",
2443 Rendering::DefaultSize, Rendering::DefaultSize, 1, 0, Rendering::ImageFormat::R8,
2444 Rendering::ResourcePool::Managed, D3DX_FILTER_NONE,
2445 D3DX_FILTER_NONE, 0, NULL, NULL, &viewscreen->m_pddsArrow)))
2446 {
2447 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Instruments\\arrow.dds\"! (%S)", Rendering::ErrorString(hr));
2448 logger->Log(msg, Logger::Level::Fatal);
2449 }
2450 else
2451 viewscreen->gameclass->AddTrackedResource("m_pddsArrow"); // managed */
2452 *instage = -1;
2453 }
2454 if (*stage == 26 && *instage == 9)
2455 {
2456 txtHelper.DrawTextLine(L"Instruments loading (Interlace)...");
2457 if (FAILED(hr = Rendering::LoadTextureResource(pd3dDevice, Rendering::ClientInstance(), MAKEINTRESOURCE(IDB_BITMAP1), &viewscreen->m_pddsInterlace[0], 1)))
2458 {
2459 sprintf_s(msg, sizeof(msg), "Could not load resource IDB_BITMAP1! (%S)", Rendering::ErrorString(hr));
2461 }
2462 else
2463 viewscreen->gameclass->AddTrackedResource("m_pddsInterlace[0]"); // managed
2464 if (FAILED(hr = Rendering::LoadTextureResource(pd3dDevice, Rendering::ClientInstance(), MAKEINTRESOURCE(IDB_BITMAP2), &viewscreen->m_pddsInterlace[1], 1)))
2465 {
2466 sprintf_s(msg, sizeof(msg), "Could not load resource IDB_BITMAP2! (%S)", Rendering::ErrorString(hr));
2468 }
2469 else
2470 viewscreen->gameclass->AddTrackedResource("m_pddsInterlace[1]"); // managed
2471 *instage = 10;
2472 }
2473 if (*stage == 26 && *instage == 8)
2474 {
2475 txtHelper.DrawTextLine(L"Instruments loading (cracked)...");
2476 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Cockpits\\Cracked.dds", &viewscreen->m_pddsCracked, 1)))
2477 {
2478 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Cockpits\\Cracked.dds\"! (%S)", Rendering::ErrorString(hr));
2480 }
2481 else
2482 viewscreen->gameclass->AddTrackedResource("m_pddsCracked"); // managed */
2483 *instage = 9;
2484 }
2485 if (*stage == 26 && *instage == 7)
2486 {
2487 txtHelper.DrawTextLine(L"Instruments loading (sunglasses)...");
2488 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\Burbank-Sun_02.png", &viewscreen->m_pddsSunglasses, 1)))
2489 {
2490 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\Burbank-Sun_02.png\"! (%S)", Rendering::ErrorString(hr));
2492 }
2493 else
2494 viewscreen->gameclass->AddTrackedResource("m_pddsSunglasses"); // managed
2495 *instage = 8;
2496 }
2497 if (*stage == 26 && *instage == 6)
2498 {
2499 txtHelper.DrawTextLine(L"Instruments loading (binoculars)...");
2500 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\Binoculars.dds", &viewscreen->m_pddsBinoculars, 1)))
2501 {
2502 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\Binoculars.dds\"! (%S)", Rendering::ErrorString(hr));
2504 }
2505 else
2506 viewscreen->gameclass->AddTrackedResource("m_pddsBinoculars"); // managed
2507
2508 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\NightVisionOverlay.png", &viewscreen->m_pddsNightVision, 1)))
2509 {
2510 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\NightVisionOverlay.png\"! (%S)", Rendering::ErrorString(hr));
2512 }
2513 else
2514 viewscreen->gameclass->AddTrackedResource("m_pddsNightVision"); // managed
2515
2516 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\Binoculars-compass.dds", &viewscreen->m_pddsBinocularsCompass, 1)))
2517 {
2518 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\Binoculars-compass.dds\"! (%S)", Rendering::ErrorString(hr));
2520 }
2521 else
2522 viewscreen->gameclass->AddTrackedResource("m_pddsBinocularsCompass"); // managed
2523
2524 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\Binoculars-arrow.dds", &viewscreen->m_pddsBinocularsArrow, 1)))
2525 {
2526 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\Binoculars-arrow.dds\"! (%S)", Rendering::ErrorString(hr));
2528 }
2529 else
2530 viewscreen->gameclass->AddTrackedResource("m_pddsBinocularsArrow"); // managed
2531
2532 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\NightVisionCompass.png", &viewscreen->m_pddsNightVisionCompass, 1)))
2533 {
2534 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\NightVisionCompass.png\"! (%S)", Rendering::ErrorString(hr));
2536 }
2537 else
2538 viewscreen->gameclass->AddTrackedResource("m_pddsNightVisionCompass"); // managed
2539
2540 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\Inventory\\NightVisionArrow.png", &viewscreen->m_pddsNightVisionArrow, 1)))
2541 {
2542 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Inventory\\NightVisionArrow.png\"! (%S)", Rendering::ErrorString(hr));
2544 }
2545 else
2546 viewscreen->gameclass->AddTrackedResource("m_pddsNightVisionArrow"); // managed
2547 *instage = 7;
2548 }
2549 if (*stage == 26 && *instage == 5)
2550 {
2551 *instage = 6;
2552 }
2553 if (*stage == 26 && *instage == 4)
2554 {
2555 *instage = 5;
2556 }
2557 if (*stage == 26 && *instage == 3)
2558 {
2559 *instage = 4;
2560 }
2561 if (*stage == 26 && *instage == 2)
2562 {
2563 *instage = 3;
2564 }
2565 if (*stage == 26 && *instage == 1)
2566 {
2567 *instage = 2;
2568 }
2569 if (*stage == 26 && *instage == 0)
2570 {
2571 *instage = 1;
2572 }
2573 } // stage>=26
2574
2575 if (*stage >= 27)
2576 {
2577 if (*stage > 27)
2578 txtHelper.DrawTextLine(L"Additional effects loaded!");
2579 if (*stage == 27 && *instage >= 3)
2580 *instage = -1; // Bolt geometry and plasma use the native procedural renderer.
2581 if (*stage == 27 && *instage == 2)
2582 {
2583 txtHelper.DrawTextLine(L"Additional effects loading (AA Ramp)...");
2584 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\atmosphere.dds", &viewscreen->m_pddsAtmosphere, 1)))
2585 {
2586 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\atmosphere.dds\"! (%S)", Rendering::ErrorString(hr));
2588 }
2589 else
2590 viewscreen->gameclass->AddTrackedResource("m_pddsAtmosphere"); // managed
2591 *instage = 3;
2592 }
2593 if (*stage == 27 && *instage == 1)
2594 {
2595 txtHelper.DrawTextLine(L"Additional effects loading (Flare)...");
2596 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\pointsprite.dds", &viewscreen->m_pddsStarTexture, Rendering::DefaultSize)))
2597 {
2598 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\pointsprite.dds\"! (%S)", Rendering::ErrorString(hr));
2600 }
2601 else
2602 viewscreen->gameclass->AddTrackedResource("m_pddsStarTexture"); // managed
2603 *instage = 2;
2604 }
2605 if (*stage == 27 && *instage == 0)
2606 {
2607 txtHelper.DrawTextLine(L"Additional effects loading (Font)...");
2608 if (FAILED(hr = Rendering::LoadTexture(pd3dDevice, L"Textures\\fonts\\hull.dds", &viewscreen->m_pddsLetters, Rendering::DefaultSize)))
2609 {
2610 sprintf_s(msg, sizeof(msg), "Could not load \"Textures\\Fonts\\hull.dds\"! (%S)", Rendering::ErrorString(hr));
2612 }
2613 else
2614 viewscreen->gameclass->AddTrackedResource("m_pddsLetters"); // managed
2615 *instage = 1;
2616 }
2617 } // stage>=27
2618
2619 if (*stage == 28)
2620 *stage = 29;
2621
2622 if (*stage >= 29)
2623 {
2624 if (*stage == 29)
2625 {
2626 *instage = -1; // to next stage
2628
2629 if (playerships[0].docked && playerships[0].reference < REF_INANOTHER)
2630 {
2631 logger->Log("Was out of docking area with dock status positive, cleared...");
2632 playerships[0].docked = false;
2633 }
2634 else if (playerships[0].docked)
2635 {
2636 logger->Log("Docking status was nominally docked, proceeding to unlock...");
2637 }
2638 else
2639 {
2640 logger->Log("Docking status was nominally undocked, proceeding to unlock...");
2641 }
2642
2643
2644 logger->Log("Docking status was unlocked successfully...");
2645
2646 } // stage==29
2647 } // stage>=29
2648
2649 if (*stage >= 30)
2650 {
2651 if (*stage > 30)
2652 {
2653 txtHelper.DrawTextLine(L"Initialized ground data!");
2654 auto& game = *viewscreen->gameclass;
2655 if (game.gameGraphicsReady && viewscreen->VolumeCloudsEnabled() &&
2658 {
2659 const auto& progress = viewscreen->cloudVolume.Effect()->Pass().LoadingStatus();
2660 const std::wstring shader(progress.shader.begin(), progress.shader.end());
2661 txtHelper.DrawFormattedTextLine(L"Compiling shaders (%u/%u): %s",
2662 progress.current, progress.total, shader.c_str());
2663 }
2664 else txtHelper.DrawTextLine(game.loadingReadyToContinue ?
2665 L"Shaders ready!" : L"Preparing game graphics...");
2666 if (game.loadingReadyToContinue)
2667 {
2668 txtHelper.DrawTextLine(L"Press SPACE BAR to continue...");
2669 g_bEnabled = true;
2670 }
2671 }
2672
2673 if (*stage == 30)
2674 {
2675 txtHelper.DrawFormattedTextLine(L"Initializing ground data (%.0f to timeout)...", 30.0f - timepassed);
2676
2677 // If below middle of cloud deck, wait for terrain packet
2678 // REF_WINDOWLESS we do NOT currently kick the user out of the simulator bay ... but we want to kick them out of the hangar
2679 // Bill verified 1/22/2022 that we do not load terrain when coming out of the simulator bay which means it needs to be loaded beforehand
2680 if (playerships[0].reference == REF_ONGROUND || playerships[0].reference == REF_APNMODE ||
2681 (playerships[0].reference == REF_INANOTHER && (playerships[playerships[0].inarray].reference == REF_ONGROUND || playerships[playerships[0].inarray].reference == REF_APNMODE)) ||
2682 playerships[0].reference == REF_BUILDING || playerships[0].reference == REF_WINDOWLESS) // unless we add a hook for reference change in addition to aboveClouds and cube we need to do for windowless environment or sim bay
2683 {
2684 if (timepassed == 0.0f)
2685 {
2686 sprintf_s(msg, sizeof(msg), "Built-in packet hold (%f)", RiseMath::Vec3Length(&playerships[0].position));
2687 logger->Log(msg);
2688 }
2689
2691 {
2692 *instage = -1;
2693 logger->Log("Built-in packet hold expired successfully!");
2694 }
2695 else if (!viewscreen->ptrGrid->dataPending)
2696 {
2698
2700
2701 logger->Log("renderer::LoadTextures is RWG now...");
2702 }
2703
2705 if (timepassed > 30.0f)
2706 logger->Log("Built-in packet hold failed after 30 seconds!", Logger::Level::Fatal);
2707 }
2708 else
2709 {
2710 logger->Log("Built-in packet hold was not required...");
2711 *instage = -1;
2712 }
2713 } // stage==30
2714 } // stage>=30
2715
2716 txtHelper.End();
2717
2718 logger->AddToCallStack("renderer::LoadTextures DONE");
2719}
2720
2722{
2723 logger->AddToCallStack("renderer::RenderDocks");
2724
2725 RiseMath::Matrix matrixTemp;
2726 RiseMath::Vector3 result;
2727 RiseMath::Vector3 vieneohit;
2728 RiseMath::Matrix matrixWorld;
2729
2730 // Docks ------------------------------------------------------------------------------------
2733
2734
2735 t = viewscreen->dockTexture - 1;
2736 // Fix those who are beyond clipping plane
2737 result.x = -allobjects[t].matrixWorld._41;
2738 result.y = -allobjects[t].matrixWorld._42;
2739 result.z = -allobjects[t].matrixWorld._43;
2740 float f_temp = RiseMath::Vec3Length(&result);
2741 if (f_temp > cutplaneC)
2742 {
2743 f_temp = cutplaneC / f_temp; // If it is 2x as far, this value is 0.5f
2744
2745 // Scale apparent scale in matrix
2746 RiseMath::MatrixScaling(&matrixTemp, f_temp, f_temp, f_temp);
2747 RiseMath::MatrixMultiply(&allobjects[t].matrixWorld, &matrixTemp, &allobjects[t].matrixWorld);
2748
2749 // Scale location in matrix
2750 RiseMath::Vec3Scale(&result, &result, 1.0f - f_temp);
2751 RiseMath::MatrixTranslation(&matrixTemp, result.x, result.y, result.z);
2752 RiseMath::MatrixMultiply(&allobjects[t].matrixWorld, &allobjects[t].matrixWorld, &matrixTemp);
2753 }
2754
2755
2756 // Ambient light adjustment and disabling of the diffuse light after sunset
2757 RiseMath::Vector4 radiosity = RiseMath::Vector4(0, 0, 0, 0);
2758 if (!playerships[0].isSimulator && viewscreen->ptrWeather->shadow > 0.0f)
2759 {
2760 // Reflection of light from surface (radiosity)
2761 RiseMath::Vec3Scale(&vieneohit, Xsunlight, radiusC); // Where it hits Vieneo
2762 RiseMath::Vec3Subtract(&result, &allobjects[t].position, &vieneohit); // Vector from surface point to this object
2763 RiseMath::Vec3Normalize(&result, &result);
2764 radiosity.x = result.x; radiosity.y = result.y; radiosity.z = -result.z;
2765 radiosity.w = RiseMath::Vec3Dot(&result, Xsunlight); // cos of angle between the two
2766 radiosity.w = 1.0f - radiosity.w; // Compliment, not comparing to surface normal you know
2767 radiosity.w /= powf(RiseMath::Vec3Length(&allobjects[t].position) / radiusC, 2.0f);
2768 }
2769 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Radiosity", &radiosity));
2770
2771
2772 // Adjust diffuse by shadow
2773 RiseMath::Vector4 Sunlight;
2774 Sunlight.x = -viewscreen->sunlight.Direction.x; Sunlight.y = -viewscreen->sunlight.Direction.y; Sunlight.z = -viewscreen->sunlight.Direction.z;
2775 Sunlight.w = viewscreen->ptrWeather->shadow;
2776 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Sunlight", &Sunlight));
2777
2778
2779 pd3dDevice->SetStreamSource(0, polyobjects[1].VB, 0, sizeof(RiseVertexVertex));
2780
2781
2782
2783 short oldtexture = -1;
2784 for (s = 0; s < allobjects[t].components; s++)
2785 {
2787
2788 // Extensions
2789 RiseMath::Vec3Scale(&result, &allobjects[t].componentarray[s].extendby, allobjects[t].componentarray[s].extended);
2790 RiseMath::Vec3Add(&result, &allobjects[t].componentarray[s].nominalxyz, &result);
2791
2792 RiseMath::MatrixTranslation(&matrixTemp, result.x, result.y, result.z);
2793 RiseMath::MatrixMultiply(&matrixWorld, &matrixWorld, &matrixTemp);
2794 RiseMath::MatrixMultiply(&matrixWorld, &matrixWorld, &allobjects[t].matrixWorld);
2795
2796 // RiseMath::MatrixScaling( &matrixTemp, allobjects[t].bound, allobjects[t].bound, allobjects[t].bound );
2797 // RiseMath::MatrixMultiply( &matrixWorld, &matrixTemp, &matrixWorld );
2798
2799 RiseMath::Matrix mWorldViewProj;
2800 if (playerships[0].isSimulator)
2801 mWorldViewProj = matrixWorld * viewscreen->matrixView * viewscreen->matrixProjSim;
2802 else
2803 mWorldViewProj = matrixWorld * viewscreen->matrixLook * viewscreen->matrixProj;
2804 V(viewscreen->gameclass->graphics->g_pEffect->SetMatrix("matWorldViewProj", &mWorldViewProj));
2805 V(viewscreen->gameclass->graphics->g_pEffect->SetMatrix("matWorld", &matrixWorld));
2806
2807 RiseMath::Vector4 clouduv;
2808 // Texture assignment
2809 oldtexture = allobjects[t].componentarray[s].texture;
2811
2812 if (viewscreen->m_pddsDockLights[oldtexture] && allobjects[t].powered)
2813 {
2815 clouduv.y = 1.0f;
2816 }
2817 else
2818 {
2819 clouduv.y = 0.0f;
2820 }
2821
2822 if (allobjects[t].componentarray[s].type == 40 && allobjects[t].powered) // Scrolling signage
2823 {
2824 clouduv.z = allobjects[t].componentarray[s].extended;
2825 }
2826 else
2827 {
2828 clouduv.z = -1.0f;
2829 }
2830 // else if (allobjects[t].componentarray[s].type==3) // transparency
2831 // pd3dDevice->SetRenderState( Rendering::RenderState::ALPHABLENDENABLE, true );
2832
2833
2834 clouduv.w = allobjects[t].componentarray[s].type;
2835 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("clouduv", &clouduv));
2837
2838 pd3dDevice->DrawPrimitive(Rendering::Primitive::TriangleList, allobjects[t].componentarray[s].startvertex, allobjects[t].componentarray[s].primitives);
2839
2840 } // end of component loop
2841
2842 // Restore
2845
2846 // Docks ------------------------------------------------------------------------------------
2847
2848 logger->AddToCallStack("renderer::RenderDocks END");
2849}
2850
2852{
2854 playerships[0].matrixExterior,playerships[0].compare,ourcockpit.power,
2856 RiseMath::Matrix inverseView;
2857 RiseMath::MatrixInverse(&inverseView,nullptr,&viewscreen->matrixLook);
2858 const RiseMath::Vector4 eye(inverseView._41,inverseView._42,inverseView._43,0);
2859 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("ShipSurfaceEye",&eye));
2860 sceneLightMask=UINT32_MAX;
2862}
2863
2865{
2866 const auto selected=ShipSurfaceLights::Select(surfaceLights,bounds,world);
2867 if (selected.mask==sceneLightMask) return;
2868 sceneLightMask=selected.mask;
2869 auto* effect=viewscreen->gameclass->graphics->g_pEffect;
2870 V(effect->SetInt("ShipSurfaceLightCount",int(selected.count)));
2871 if (selected.count)
2872 {
2873 V(effect->SetVectorArray("ShipSurfaceLightPosition",selected.positions.data(),ShipSurfaceLights::MaxSceneLights));
2874 V(effect->SetVectorArray("ShipSurfaceLightDirection",selected.directions.data(),ShipSurfaceLights::MaxSceneLights));
2875 V(effect->SetVectorArray("ShipSurfaceLightColor",selected.colors.data(),ShipSurfaceLights::MaxSceneLights));
2876 }
2877}
2878
2880{
2881 if (sceneLightMask!=0)
2882 V(viewscreen->gameclass->graphics->g_pEffect->SetInt("ShipSurfaceLightCount",0));
2884}
2885
2887 ThrustConeRender::Pass pass, bool attenuateThrust)
2888{
2889 const bool thrustOnly=pass==ThrustConeRender::Pass::AfterClouds;
2890 std::optional<ThrustConeRender::OverlayState> overlay;
2891 RiseMath::Vector3 planetEye;
2892 if (thrustOnly)
2893 {
2894 overlay.emplace(*pd3dDevice);
2895 RiseMath::Matrix inverseLook;
2896 RiseMath::MatrixInverse(&inverseLook,nullptr,&viewscreen->matrixLook);
2897 planetEye=-playerships[0].position+RiseMath::Vector3(inverseLook._41,inverseLook._42,inverseLook._43);
2898 }
2899 logger->AddToCallStack("renderer::RenderShips");
2900
2901 V(pd3dDevice->SetFVF(RISE_FVF_VERTEX2)); // Vehicle materials use both hull and overlay coordinates.
2902
2903 RiseMath::Vector3 result;
2904 RiseMath::Vector3 vieneohit;
2905
2907
2908 // Keep two bounded scopes instead of a query pair for every nearby vehicle.
2909 std::optional<Rendering::ProfileScope11> shipTiming;
2910 shipTiming.emplace("Own ship");
2911 for (t = 0; t < MAX_SCAN; t++) // ships loop
2912 {
2913 if (t == 1) { shipTiming.reset(); shipTiming.emplace("Other ships"); }
2914 // Warp sprites bypass drawflag, so apply the same cloud-deck rejection.
2916 continue;
2917 // DIHV animation
2918 if (!thrustOnly && g_bAboveClouds && playerships[t].type == VehicleType::DIHV && playerships[t].active && playerships[t].dihvAnimate > -1 && playerships[t].dihvAnimate < 64)
2919 {
2920 pd3dDevice->SetFVF(RISE_FVF_NOPSIZE);
2921
2922 // at 100km it is 256... closer than that we all die
2923 float f_temp = 256.0f * 233.0f / playerships[t].distance;
2924 if (f_temp > 256.0f)
2925 f_temp = 256.0f;
2926
2927 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, *reinterpret_cast<DWORD*>(&f_temp));
2928
2933 pd3dDevice->SetRenderState(Rendering::RenderState::ZWRITEENABLE, false); // so it doesn't block sun flare
2934
2935 pd3dDevice->SetTransform(Rendering::TransformSlot::WORLD, &playerships[t].matrixExterior);
2938
2940
2946
2947 pd3dDevice->SetFVF(RISE_FVF_VERTEX2);
2948 }
2949
2950 if (!playerships[t].drawflag || playerships[t].cloaking == 0.0f)
2951 continue;
2952 if (thrustOnly)
2953 {
2954 bool hasCone=false;
2955 for (int c=0;c<playerships[t].components && !hasCone;++c)
2956 hasCone=playerships[t].componentarray[c].visible && ThrustConeRender::IsCone(playerships[t].componentarray[c].type);
2957 if (!hasCone) continue;
2958 }
2959
2960 // Use the same exterior pose and flash phase as the visible emitters.
2961 // Reset each vehicle so ownship lights cannot leak into other draws.
2962 const unsigned lightCount=t==0 ? surfaceLights.count : 0;
2963 sceneLightMask=UINT32_MAX; // Hull upload replaces the compact scene selection.
2964 V(viewscreen->gameclass->graphics->g_pEffect->SetInt("ShipSurfaceLightCount", int(lightCount)));
2965 if (lightCount)
2966 {
2970 }
2971
2972 // Logo state belongs to this vehicle, never to the previous draw.
2973 Rendering::RenderTexture* logoTexture = nullptr;
2974 const int logoOrdinal = playerships[t].logoOrdinal;
2975 if (polyobjects[playerships[t].VB].overlay && logoOrdinal >= 0 &&
2976 static_cast<size_t>(logoOrdinal) < viewscreen->m_pddsLogos.size())
2977 {
2978 logoTexture = viewscreen->m_pddsLogos[logoOrdinal];
2979 }
2980 V(viewscreen->gameclass->graphics->g_pEffect->SetTexture("OverlayMap", logoTexture));
2981
2982 RiseMath::Vector4 features;
2983 features.x = playerships[t].cloaking;
2984 features.y = logoTexture ? 1.0f : 0.0f;
2985 const bool volumeLighting = viewscreen->VolumeCloudsEnabled() &&
2988 features.z = volumeLighting ? 1.f : 0.f; // scattered volumetric cloud light
2989 features.w = playerships[t].type == VehicleType::ARJ_PAX ? 1.0f : 0.0f; // perforated window logo film
2990 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Features", &features));
2991
2992 if (g_bAboveClouds || volumeLighting)
2993 {
2994 // Adjust diffuse by shadow
2995 RiseMath::Vector4 Sunlight;
2996 Sunlight.x = -viewscreen->sunlight.Direction.x; Sunlight.y = -viewscreen->sunlight.Direction.y; Sunlight.z = -viewscreen->sunlight.Direction.z;
2997 Sunlight.w = viewscreen->ptrWeather->shadow;
2998 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Sunlight", &Sunlight));
2999 if (volumeLighting)
3000 {
3001 const auto diffuse = viewscreen->ptrWeather->vehicleAmbient;
3002 const RiseMath::Vector4 scattered(diffuse.r, diffuse.g, diffuse.b, 0);
3003 const float air = 1.f - CloudVolume::Smooth(playerships[0].mslKm / cloudTopsMslC);
3006 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("volumeFog", &fog));
3007 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("ambient", &scattered));
3008 }
3009 }
3010 else if (playerships[t].reference == REF_WINDOWLESS || // in hangar we override the lighting
3011 (playerships[t].reference == REF_INANOTHER && playerships[playerships[t].inarray].reference == REF_WINDOWLESS))
3012 {
3013 RiseMath::Vector4 temp4;
3014 temp4.x = 1.0f;
3015 temp4.y = 1.0f;
3016 temp4.z = 1.0f;
3017 temp4.w = 168.64f;
3018 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("ambient", &temp4));
3019 }
3020 else
3021 {
3022 RiseMath::Vector4 temp4;
3023 temp4.x = viewscreen->alphascreen.r;
3024 temp4.y = viewscreen->alphascreen.g;
3025 temp4.z = viewscreen->alphascreen.b;
3027 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("ambient", &temp4));
3028 }
3029
3030 const RiseMath::Color trimcolor = playerships[t].trimcolor;
3031 RiseMath::Vector4 trimvec = RiseMath::Vector4(trimcolor.r, trimcolor.g, trimcolor.b, 0); // w unused
3032 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Tangent", &trimvec));
3033
3034 //if (playerships[t].distance < (playerships[t].bound * 1000.0f))
3035 {
3036 if (g_bAboveClouds || volumeLighting) // if we are above clouds
3037 {
3038 RiseMath::Vector4 radiosity = RiseMath::Vector4(0, 0, 0, 0);
3039 // Block light from sun by Vieneo
3040 if (viewscreen->ptrWeather->shadow > 0.0f)
3041 {
3042 // radiosity
3043 RiseMath::Vec3Scale(&vieneohit, Xsunlight, radiusC); // Where it hits Vieneo
3044 RiseMath::Vec3Subtract(&result, &playerships[t].position, &vieneohit); // Vector from surface point to this object
3045 RiseMath::Vec3Normalize(&result, &result);
3046 radiosity.x = result.x; radiosity.y = result.y; radiosity.z = result.z;
3047 radiosity.w = fabsf(RiseMath::Vec3Dot(&result, Xsunlight)); // cos of angle between the two
3048 radiosity.w = 1.0f - radiosity.w; // Compliment, not comparing to surface normal ya know
3049 radiosity.w /= powf(RiseMath::Vec3Length(&playerships[t].position) / radiusC, 2.0f);
3050 if (volumeLighting) radiosity.w *= viewscreen->ptrWeather->shadow;
3051 }
3052 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("Radiosity", &radiosity));
3053
3054 V(viewscreen->gameclass->graphics->g_pEffect->BeginPass(5)); // above cloud vehicles
3055 }
3056 else // below clouds
3057 {
3058 V(viewscreen->gameclass->graphics->g_pEffect->BeginPass(4)); // below cloud vehicles
3059 }
3060
3061 V(pd3dDevice->SetStreamSource(0, polyobjects[playerships[t].VB].VB, 0, sizeof(RiseVertex2Vertex)));
3062
3064 {
3066 }
3067
3068 short oldtexture = -1;
3069 for (s = 0; s < playerships[t].components; s++)
3070 {
3071 if (playerships[t].componentarray[s].visible && ThrustConeRender::Includes(pass,playerships[t].componentarray[s].type))
3072 {
3073 RiseMath::Matrix mWorldViewProj;
3074 if (playerships[0].isSimulator)
3076 else
3078 V(viewscreen->gameclass->graphics->g_pEffect->SetMatrix("matWorldViewProj", &mWorldViewProj));
3080
3081
3082 // Texture assignment
3083 if (oldtexture != playerships[t].componentarray[s].texture)
3084 {
3085 oldtexture = playerships[t].componentarray[s].texture;
3086
3088
3089 if (viewscreen->m_pddsShipLights[oldtexture])
3090 {
3092 }
3093 }
3094
3095
3096 bool showlight;
3097 if (playerships[t].componentarray[s].type == 31) // cockpit interior viewed from outside
3098 showlight = playerships[t].domelight && playerships[t].logolight;
3099 else if (playerships[t].componentarray[s].type == 43) // headlights
3100 showlight = (playerships[t].headlight && playerships[t].logolight) ||
3101 (playerships[t].alarm && playerships[t].compare & 0xFFFF);
3102 else if (playerships[t].componentarray[s].type == 44) // brakelights
3103 showlight = (playerships[t].brakelight) ||
3104 (playerships[t].alarm && playerships[t].compare & 0xFFFF);
3105 else
3106 showlight = playerships[t].logolight;
3107
3108 // display control
3109 RiseMath::Vector4 clouduv;
3110 clouduv.x = t == 0 && !playerships[0].isSimulator && playerships[t].componentarray[s].type == 43
3112 if (viewscreen->m_pddsShipLights[oldtexture] && showlight && playerships[t].componentarray[s].useLightMap)
3113 clouduv.y = 1.0f;
3114 else
3115 clouduv.y = 0.0f;
3116 if (playerships[t].componentarray[s].type == 4) // monitor on floating man's arm
3117 clouduv.z = viewscreen->flicker ? 0.9f : 1.0f;
3118 else
3120 clouduv.w = playerships[t].componentarray[s].type;
3121 if (thrustOnly && attenuateThrust)
3122 {
3123 // Same shared 3D medium as signal lights. These compact
3124 // emitters use their component origin for visibility; hull
3125 // depth remains per pixel. Preserve authored cone alpha.
3126 const auto& world=playerships[t].componentarray[s].matWorld;
3127 const auto point=-playerships[0].position+RiseMath::Vector3(world._41,world._42,world._43);
3128 clouduv.z*=CloudVolume::Transmittance({planetEye.x,planetEye.y,planetEye.z},
3129 {point.x,point.y,point.z},viewscreen->ptrWeather->cloudParameters,viewscreen->cloudVolume.Seed());
3130 }
3131 V(viewscreen->gameclass->graphics->g_pEffect->SetVector("clouduv", &clouduv));
3132
3134
3135 const auto batch = FindShipDrawBatch(playerships[t].componentarray, playerships[t].components, unsigned(s));
3137 if (viewscreen->adDiagnostics.Collecting() && logoTexture && size_t(logoOrdinal) < viewscreen->logofiles.size() &&
3138 (!(g_bAboveClouds || volumeLighting) || volumeLighting) && clouduv.w != 57 &&
3139 !(clouduv.w >= 200 && clouduv.w <= 225 && int(clouduv.w) % 5 == 0))
3140 {
3141 AdViewability::Placement placement;
3142 placement.entity = playerships[t].vehicleId;
3144 placement.creative = viewscreen->logofiles[logoOrdinal];
3145 viewscreen->adDiagnostics.RegisterDraw(*pd3dDevice, placement, unsigned(t),
3146 polyobjects[playerships[t].VB].VB->Geometry(), placement.component, batch.primitives,
3147 (g_bAboveClouds || volumeLighting) ? 5 : 4, playerships[t].componentarray[s].matWorld,
3149 }
3150 s = static_cast<short>(batch.last);
3151 }
3152 }
3153
3155
3156 } // End of distance<bound and cloaking>0.0f
3157 } // End of ships loop
3158 shipTiming.reset();
3159
3162
3163 logger->AddToCallStack("renderer::RenderShips DONE");
3164}
3165
3166void renderer::RenderLights(Rendering::RenderDevice* pd3dDevice, const double* f_time)
3167{
3168 logger->AddToCallStack("renderer::RenderLights");
3169
3170 float f_temp;
3171 RiseMath::Vector3 result;
3172 RiseMath::Matrix matrixTemp;
3173 RiseMath::Matrix inverseLook;
3174 RiseMath::MatrixInverse(&inverseLook, nullptr, &viewscreen->matrixLook);
3175 const RiseMath::Vector3 eye(inverseLook._41, inverseLook._42, inverseLook._43);
3176
3177 // Should be able to make a userVB to store all the lights and distant objects (farspher)
3178
3179
3180
3181 // START OF RUNNING LIGHTS SECTION
3182
3184 pd3dDevice->SetFVF(RISE_FVF_NOPSIZE);
3186
3187
3188 for (t = 0; t < MAX_SCAN; t++) // ships loop
3189 {
3190 if (!playerships[t].drawflag)
3191 continue;
3192
3193 RiseMath::Vector3 look;
3195 float alphafog;
3196 if (playerships[0].mslKm < 63.0f)
3197 {
3199 if (alphafog == 0.0f)
3200 continue;
3201 }
3202 else
3203 alphafog = 1.0f;
3205 {
3206 RiseMath::Matrix inverseView;
3207 RiseMath::MatrixInverse(&inverseView, nullptr, &viewscreen->matrixLook);
3208 const auto from = -playerships[0].position + RiseMath::Vector3(inverseView._41, inverseView._42, inverseView._43);
3209 const auto to = -playerships[t].position;
3210 alphafog *= CloudVolume::Transmittance({ from.x,from.y,from.z }, { to.x,to.y,to.z },
3212 if (alphafog < .001f) continue;
3213 }
3214
3215 // normalize
3216 look /= RiseMath::Max(playerships[t].distance, .000001f);
3217
3218 RiseMath::Vector3 theirnorm;
3219 float psize;
3220
3221 pd3dDevice->SetTransform(Rendering::TransformSlot::WORLD, &playerships[t].matrixExterior);
3222
3223 if (playerships[t].distance >= (playerships[t].bound * 1000.0f)) // 38km
3224 {
3225 if (playerships[t].distance < (playerships[t].bound * 10000.0f)) // 380km
3226 {
3227 // Light level should be based on line from (ourpos-theirpos) (dot) xsunlight
3228 // make a black spec, it still shows against white backdrop
3229 // dim as they get further away
3230 const float shadow = viewscreen->ptrWeather->shadow * (1.0f - playerships[t].distance / (playerships[t].bound * 10000.0f));
3231
3232 if (g_bAboveClouds)
3233 tempcolor.r = tempcolor.g = tempcolor.b = shadow;
3234 else
3236 tempcolor.a = alphafog;
3237
3242 // psize=1.0f;
3243 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, 1);//*((DWORD*)&psize) );
3244
3246
3250 }
3251 }
3252 else if (playerships[t].logolight) // power is on
3253 {
3254 float bonehead = 64.0f / powf(RiseMath::Max(playerships[t].distance, .000001f), 0.75f) * viewscreen->gameclass->displayscale * RiseMath::ToRadian(115.0f) / g_fFOV;
3255 f_temp = playerships[t].bound / 0.034726f;
3256 if (f_temp > 2.0f)
3257 f_temp = 2.0f; // limit size, DIHV looked silly
3258 bonehead *= f_temp;
3259
3260 for (s = 0; s < static_cast<short>(polyobjects[playerships[t].VB].effects.size()); s++)
3261 {
3262 bool skip = false;
3264 // Reject the off phase before transforms, texture state or a draw.
3265 if (effect.power != 2.f && !(effect.sequencing & playerships[t].compare)) continue;
3266 if (t == 0 && effect.power == 2.f)
3267 {
3269 const float brightness = ourcockpit.landingLightBrightness[lamp];
3270 if (brightness <= 0) continue;
3271 effect.diffuse *= brightness;
3272 }
3273 if (effect.power == 1.5f) // rotating light
3274 {
3275 if (playerships[t].type == VehicleType::P13)
3276 {
3277 if (!playerships[t].police || !playerships[t].specialight)
3278 skip = true;
3279 }
3280 }
3281 result = effect.normal;
3282
3283 const RiseMath::Color sourceColor = effect.diffuse;
3284 if (!skip)
3285 {
3286 effect.diffuse.r *= alphafog;
3287 effect.diffuse.g *= alphafog;
3288 effect.diffuse.b *= alphafog;
3289 effect.diffuse.a = alphafog;
3291 SignalLightAttenuation::Apply(*pd3dDevice, sourceColor, alphafog, playerships[0].isSimulator);
3292
3293 f_temp = 1.f;
3294 if (effect.power == 2.f) // Only beam lights have an emission direction.
3295 {
3296 RiseMath::Vec3TransformNormal(&theirnorm, &result, &playerships[t].matrixExterior);
3297 RiseMath::Vec3Normalize(&theirnorm, &theirnorm);
3298 f_temp = RiseMath::Vec3Dot(&theirnorm, &look);
3299 if (t == 0)
3300 {
3301 RiseMath::Vector3 lampPosition;
3303 f_temp = ShipSurfaceLights::Facing(lampPosition, theirnorm, eye);
3304 }
3305 }
3306 psize = ShipLightSprites::Size(bonehead, effect.power, f_temp);
3307
3308 // fluctuate based on distance
3309 // psize=256, 0/anything is 0, psize*=1
3310 // psize=4, .988 times 0 to 1 is 0 to .988, psize*= 1.0f to 0.12f
3311 float tempfloat = playerships[t].distance / (playerships[t].bound * 1000.0f);
3312 tempfloat = 1.0f - (tempfloat * 0.5f) + tempfloat * RandomFloat();
3313 psize *= tempfloat;
3314
3315 if (psize > ShipLightSprites::MaxSize)
3317 }
3318
3319 if (!skip && psize >= 4.0f)
3320 {
3321 ShipLightSprites::StrobeGlare glare(*pd3dDevice, sourceColor,
3322 SignalLightAttenuation::EmissionTransmission(alphafog, playerships[0].isSimulator), effect.power == .5f);
3323 if (effect.power == 2.0f) // landing light
3324 {
3325 if (playerships[t].headlight)
3326 {
3327 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, *reinterpret_cast<DWORD*>(&psize));
3329 }
3330 }
3331 else if (effect.sequencing & playerships[t].compare)
3332 {
3333 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, *reinterpret_cast<DWORD*>(&psize));
3335 }
3336 }
3337 }
3338
3339#pragma region Headlight Cones
3340
3341 const float density = viewscreen->ptrPropulsion->staticDensity * playerships[t].cloaking * Clamp(1.0f - (viewscreen->ptrWeather->GetVisibilityKm() / 5.0f), 0, 1);
3342 if (t != 0 && playerships[t].headlight && density > 0
3344 {
3346
3347 // should take in current light level, viz, density
3348 //const float amblevel = powf(1.0f - viewscreen->sunlight.Diffuse.a, 2.0f); // diffuse is 1.0 at high noon
3354
3355 pd3dDevice->SetFVF(RISE_FVF_SKYDOME);
3356 pd3dDevice->SetStreamSource(0, viewscreen->m_avCone, 0, sizeof(RiseSkydomeVertex));
3357 pd3dDevice->SetTexture(0, nullptr);
3359
3360 // Use the same bounded model definitions as surface/rain/cloud lighting.
3361 for (unsigned i = 0; i < polyobjects[playerships[t].VB].landingLightCount; ++i)
3362 {
3363 auto beam = LandingLights::Configure(polyobjects[playerships[t].VB].landingLights[i], playerships[t].type, playerships[t].matrixBase);
3364 beam.extinctionPerKm = 3.912f / RiseMath::Max(.05f, viewscreen->ptrWeather->GetVisibilityKm());
3365 tempcolor = beam.color;
3366 tempcolor.a = density;
3368 {
3369 // Let volumetric cloud scattering replace the fog approximation.
3370 RiseMath::Vector3 source, direction;
3371 RiseMath::Vec3TransformCoord(&source, &beam.origin, &playerships[t].matrixExterior);
3372 source -= playerships[0].position;
3373 RiseMath::Vec3TransformNormal(&direction, &beam.direction, &playerships[t].matrixExterior);
3374 RiseMath::Vec3Normalize(&direction, &direction);
3375 const auto end = source + direction * beam.profile.rangeKm;
3376 tempcolor.a *= CloudVolume::Transmittance({ source.x,source.y,source.z }, { end.x,end.y,end.z },
3378 }
3380
3381 RiseMath::Vector3 right;
3382 RiseMath::Vec3Cross(&right, &beam.direction, &beam.up);
3383 RiseMath::Matrix matrixTemp;
3384 RiseMath::MatrixIdentity(&matrixTemp);
3385 matrixTemp._11 = right.x; matrixTemp._12 = right.y; matrixTemp._13 = right.z;
3386 matrixTemp._21 = beam.up.x; matrixTemp._22 = beam.up.y; matrixTemp._23 = beam.up.z;
3387 matrixTemp._31 = -beam.direction.x; matrixTemp._32 = -beam.direction.y; matrixTemp._33 = -beam.direction.z;
3388 matrixTemp._41 = beam.origin.x; matrixTemp._42 = beam.origin.y; matrixTemp._43 = beam.origin.z;
3389 matrixTemp *= playerships[t].matrixExterior;
3390 pd3dDevice->SetTransform(Rendering::TransformSlot::WORLD, &matrixTemp);
3391 // A bright central lobe and a weak spill share the same
3392 // cutoff and distance profile as the lighting shaders.
3393 for (bool spill : {false, true})
3394 {
3395 RiseSkydomeVertex* vertices = nullptr;
3396 if (FAILED(viewscreen->m_avCone->Lock(0, 0, reinterpret_cast<void**>(&vertices), 0))) continue;
3397 LandingLights::FogMesh(beam, vertices, spill);
3400 }
3401 }
3402
3406
3407 pd3dDevice->SetFVF(RISE_FVF_NOPSIZE);
3409 pd3dDevice->SetTexture(0, viewscreen->m_pddsStarTexture);
3410 }
3411
3412#pragma endregion
3413
3414 }
3415 }
3416
3417
3418
3419 if (g_bAboveClouds)
3420 {
3421 // docks
3422 for (t = 0; t < maxdockC; t++) // matrices for docks
3423 {
3424 if (allobjects[t].distance < (allobjects[t].bound * 1000.0f))
3425 {
3426 if (allobjects[t].powered)
3427 {
3428 // should get darker and smaller further away and brighter outside
3429 f_temp = 64.0f / powf(allobjects[t].distance, 0.75f);
3430 if (f_temp > 256.0f)
3431 f_temp = 256.0f;
3432 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, *((DWORD*)&f_temp));
3433 // pd3dDevice->SetRenderState( Rendering::RenderState::ZFUNC, Rendering::Compare::ALWAYS );
3434 // pd3dDevice->SetTextureStageState( 0, Rendering::TextureState::COLOROP, Rendering::TextureOperation::SELECTARG2 );
3436
3437 for (s = 0; s < (short)polyobjects[1].effects.size(); s++)
3438 {
3439 if (polyobjects[1].effects.at(s).sequencing & allobjects[t].compare)
3440 {
3441 matrixTemp = allobjects[t].matrixWorld;
3442 matrixTemp._41 += polyobjects[1].effects.at(s).position.x;
3443 matrixTemp._42 += polyobjects[1].effects.at(s).position.y;
3444 matrixTemp._43 += polyobjects[1].effects.at(s).position.z;
3445 pd3dDevice->SetTransform(Rendering::TransformSlot::WORLD, &matrixTemp);
3446 pd3dDevice->SetRenderState(Rendering::RenderState::TEXTUREFACTOR, polyobjects[1].effects.at(s).diffuse);
3448 }
3449 }
3451 // pd3dDevice->SetTextureStageState( 0, Rendering::TextureState::COLOROP, Rendering::TextureOperation::MODULATE );
3452 // pd3dDevice->SetRenderState( Rendering::RenderState::ZFUNC, Rendering::Compare::LESSEQUAL );
3453 }
3454 }
3455 else
3456 {
3457 pd3dDevice->SetTransform(Rendering::TransformSlot::WORLD, &allobjects[t].matrixWorld);
3459 RiseMath::Vec3Normalize(&look, &look);
3460
3462
3467 float psize = 16.0f;
3468 pd3dDevice->SetRenderState(Rendering::RenderState::POINTSIZE, *((DWORD*)&psize));
3469
3471
3475 }
3476 }
3477 }
3478 else
3479 {
3480 // pd3dDevice->SetTextureStageState( 0, Rendering::TextureState::COLOROP, Rendering::TextureOperation::MODULATE );
3482
3483 viewscreen->ptrBuildings->RenderLights(pd3dDevice, f_time);
3484 }
3485
3486
3487
3488 // pd3dDevice->SetTextureStageState( 0, Rendering::TextureState::COLOROP, Rendering::TextureOperation::DISABLE );
3492 // pd3dDevice->SetRenderState( Rendering::RenderState::LIGHTING, true ); // return with it off
3496 // END OF RUNNING LIGHTS SECTION
3497
3498 logger->AddToCallStack("renderer::RenderLights END");
3499}
#define V(expression)
SCRIPT_CONTROL SCRIPT_STATE const void DWORD
const GUID MYGUID_NULL
Definition Guids.h:3
float RandomFloat()
constexpr auto Clamp(T1 val, T2 min, T3 max)
@ P13
Definition ServerTypes.h:64
@ ARJ_PAX
Definition ServerTypes.h:70
@ DIHV
Definition ServerTypes.h:62
#define MAX_SCAN
#define maxdockC
@ REF_BUILDING
Definition ServerTypes.h:46
@ REF_INANOTHER
Definition ServerTypes.h:45
@ REF_APNMODE
Definition ServerTypes.h:42
@ REF_ONGROUND
Definition ServerTypes.h:43
@ REF_WINDOWLESS
Definition ServerTypes.h:50
ShipDrawBatch FindShipDrawBatch(const Component *components, unsigned count, unsigned first)
Rendering::CloudRenderer11 * Effect()
InputConfig inputConfigSteer
Definition config.h:38
InputConfig inputConfigLeftToeBrake
Definition config.h:41
InputConfig inputConfigGas
Definition config.h:39
InputConfig inputConfigThrustRight
Definition config.h:36
InputConfig inputConfigBrake
Definition config.h:40
InputConfig inputConfigRoll
Definition config.h:33
InputConfig inputConfigThrustLeft
Definition config.h:35
InputConfig inputConfigYaw
Definition config.h:34
InputConfig inputConfigRightToeBrake
Definition config.h:42
InputConfig inputConfigPitch
Definition config.h:32
float FrameElapsedTime
Definition GameClass.h:116
Config config
Definition GameClass.h:100
void AddTrackedResource(const char *name, Rendering::ResourcePool pool=Rendering::ResourcePool::Managed)
static void TouchFile(const WCHAR *str)
float displayscale
Definition GameClass.h:130
std::unique_ptr< Graphics > graphics
Definition GameClass.h:105
Rendering::RenderMaterial * g_pEffect
Definition Graphics.h:30
void Log(const char *msg, Level level=Info, int errorCode=0)
Definition Logger.cpp:283
void AddToCallStack(const char *msg)
Definition Logger.cpp:355
@ Warn
Definition Logger.h:26
@ Fatal
Definition Logger.h:29
void RegisterDraw(RenderDevice &device, const AdViewability::Placement &placement, unsigned slot, Geometry11 &geometry, unsigned first, unsigned count, unsigned material, const DirectX::XMFLOAT4X4 &world, const DirectX::XMFLOAT4X4 &view, const DirectX::XMFLOAT4X4 &projection, float distanceKm)
const LoadingProgress & LoadingStatus() const
Definition CloudPass11.h:32
HRESULT Lock(UINT offset, UINT bytes, void **output, DWORD flags)
HRESULT DrawPrimitive(Primitive type, UINT first, UINT count)
HRESULT SetStreamSource(UINT stream, RenderBuffer *buffer, UINT offset, UINT stride)
HRESULT SetRenderState(DWORD state, DWORD value)
HRESULT SetFVF(DWORD value)
HRESULT SetTransform(DWORD slot, const RiseMath::Matrix *value)
HRESULT SetTextureStageState(DWORD stage, DWORD state, DWORD value)
HRESULT SetTexture(DWORD stage, RenderTexture *texture)
HRESULT SetSamplerState(DWORD sampler, DWORD state, DWORD value)
HRESULT SetInt(const char *name, int value)
HRESULT SetVectorArray(const char *name, const RiseMath::Vector4 *value, UINT count)
HRESULT SetVector(const char *name, const RiseMath::Vector4 *value)
HRESULT Begin(UINT *count, DWORD flags)
HRESULT BeginPass(UINT pass)
HRESULT SetTexture(const char *name, RenderTexture *value)
HRESULT SetMatrix(const char *name, const RiseMath::Matrix *value)
HRESULT SetTransform(const RiseMath::Matrix *value)
void ResetFrameClock()
Definition Window11.h:57
void SetForegroundColor(Rendering::PackedColor value)
Definition TextHelper.h:11
void SetInsertionPos(int left, int top)
Definition TextHelper.h:10
HRESULT DrawTextLine(const wchar_t *text)
Definition TextHelper.h:12
HRESULT DrawFormattedTextLine(const wchar_t *format,...)
Definition TextHelper.h:17
Rendering::RenderTexture * m_pddsShipTexture[shiptextureC]
Definition Viewscreen.h:289
Rendering::RenderTexture * m_pddsHullDynamicTexture[MAX_SCAN]
Definition Viewscreen.h:320
Rendering::RenderTexture * m_pddsHeart[heartanimateC]
Definition Viewscreen.h:262
Rendering::RenderTexture * m_pddsFlame
Definition Viewscreen.h:263
Rendering::RenderTexture * m_pddsFirework2[firework2C]
Definition Viewscreen.h:255
RiseMath::Matrix matrixProjSim
Definition Viewscreen.h:345
Rendering::RenderTexture * m_pddsSinker[weaponanimateC]
Definition Viewscreen.h:250
Rendering::RenderBuffer * m_avCone
Definition Viewscreen.h:216
CloudVolumeRenderer cloudVolume
Definition Viewscreen.h:396
Rendering::RenderTexture * m_pddsBinoculars
Definition Viewscreen.h:238
Rendering::RenderTexture * m_pddsShipLights[shiptextureC]
Definition Viewscreen.h:290
bool m_bPsize
Definition Viewscreen.h:349
Rendering::RenderTexture * m_pddsWeapon[weaponanimateC]
Definition Viewscreen.h:249
Rendering::RenderTexture * m_pddsDIHV[dihvanimateC]
Definition Viewscreen.h:261
Rendering::RenderTexture * m_pddsDockTexture[docktextureC]
Definition Viewscreen.h:291
Rendering::RenderTexture * m_pddsMarston1
Definition Viewscreen.h:302
Rendering::RenderTexture * m_pddsSinkerX
Definition Viewscreen.h:252
Rendering::RenderTexture * m_pddsInterlace[2]
Definition Viewscreen.h:278
std::vector< std::string > logofiles
Definition Viewscreen.h:308
bool VolumeCloudsEnabled() const
Definition Viewscreen.h:404
GameClass * gameclass
Definition Viewscreen.h:439
Rendering::RenderTexture * m_pddsCloudDetailBelow
Definition Viewscreen.h:237
Rendering::RenderTexture * m_pddsAtmosphere
Definition Viewscreen.h:288
Rendering::RenderTexture * m_pddsNightVisionArrow
Definition Viewscreen.h:243
std::unique_ptr< propulsion > ptrPropulsion
Definition Viewscreen.h:432
Rendering::RenderTexture * m_pddsWaterNormal
Definition Viewscreen.h:300
RiseMath::Matrix matrixView
Definition Viewscreen.h:346
Rendering::RenderTexture * m_pddsWorld2a1
Definition Viewscreen.h:234
Rendering::RenderTexture * m_pddsCloudDetailAbove
Definition Viewscreen.h:236
bool m_bDeviceSupportsVizQuery
Definition Viewscreen.h:349
RiseMath::Matrix matrixLook
Definition Viewscreen.h:346
Rendering::RenderTexture * m_pddsCityTexture[citytextureC]
Definition Viewscreen.h:295
std::unique_ptr< weather > ptrWeather
Definition Viewscreen.h:434
Rendering::RenderBuffer * m_avRunningLights
Definition Viewscreen.h:218
std::unique_ptr< grid > ptrGrid
Definition Viewscreen.h:426
Rendering::RenderTexture * m_pddsNightVision
Definition Viewscreen.h:239
Rendering::RenderTexture * m_pddsStarTexture
Definition Viewscreen.h:246
Rendering::RenderTexture * m_pddsElmo[elmoAnimateC]
Definition Viewscreen.h:257
Rendering::RenderTexture * m_pddsBinocularsCompass
Definition Viewscreen.h:240
Rendering::Light sunlight
Definition Viewscreen.h:328
Rendering::RenderTexture * m_pddsLetters
Definition Viewscreen.h:286
Rendering::RenderTexture * m_pddsNightVisionCompass
Definition Viewscreen.h:242
Rendering::RenderTexture * m_pddsRunwayEdgeLight1
Definition Viewscreen.h:303
Rendering::AdDiagnostics11 adDiagnostics
Definition Viewscreen.h:401
Rendering::RenderTexture * m_pddsRoad
Definition Viewscreen.h:304
short dockTexture
Definition Viewscreen.h:421
Rendering::RenderTexture * m_pddsRTSLights[RTStextureC]
Definition Viewscreen.h:294
RiseMath::Color alphascreen
Definition Viewscreen.h:364
Rendering::RenderSprite * m_spriteVector
Definition Viewscreen.h:325
Rendering::RenderTexture * m_pddsCityLights[citytextureC]
Definition Viewscreen.h:296
Rendering::RenderTexture * m_pddsLandform[landformtextureC]
Definition Viewscreen.h:298
std::unique_ptr< buildings > ptrBuildings
Definition Viewscreen.h:428
Rendering::RenderTexture * m_pddsRTSTexture[RTStextureC]
Definition Viewscreen.h:293
std::vector< Rendering::RenderTexture * > m_pddsLogos
Definition Viewscreen.h:307
Rendering::RenderTexture * m_pddsSunglasses
Definition Viewscreen.h:244
Rendering::RenderTexture * m_pddsBlastX
Definition Viewscreen.h:253
Rendering::RenderTexture * m_pddsFirework1[firework1C]
Definition Viewscreen.h:254
Rendering::RenderTexture * m_pddsIntersection
Definition Viewscreen.h:305
Rendering::RenderTexture * m_pddsCracked
Definition Viewscreen.h:279
Rendering::RenderTexture * m_pddsCloudBaseMap
Definition Viewscreen.h:235
Rendering::RenderTexture * m_pddsHolidayTexture
Definition Viewscreen.h:247
Logger * logger
Definition Viewscreen.h:440
Rendering::RenderTexture * m_pddsBinocularsArrow
Definition Viewscreen.h:241
Rendering::RenderTexture * m_pddsTransition[transitiontextureC]
Definition Viewscreen.h:299
Rendering::RenderTexture * m_pddsSunTexture
Definition Viewscreen.h:245
RiseMath::Matrix matrixProj
Definition Viewscreen.h:345
Rendering::RenderTexture * m_pddsFirework3[firework3C]
Definition Viewscreen.h:256
Rendering::RenderTexture * m_pddsFuzerX
Definition Viewscreen.h:251
Rendering::RenderFont * m_pFont
Definition Viewscreen.h:129
Rendering::RenderTexture * m_pddsDockLights[docktextureC]
Definition Viewscreen.h:292
void RenderLights(Rendering::RenderDevice *pd3dDevice, const double *fTime) const
bool dataReady
Definition grid.h:36
void CalculateCubeAndTcp()
Definition grid.cpp:101
void RequestWholeGrid()
Definition grid.cpp:279
char dataPending
Definition grid.h:39
float staticDensity
Definition propulsion.h:94
void SetSceneShipLights(const GeometryBounds &bounds, const RiseMath::Matrix &world)
void ClearSceneShipLights()
short t
Definition renderer.h:45
ShipSurfaceLights::Frame surfaceLights
Definition renderer.h:39
uint32_t sceneLightMask
Definition renderer.h:40
Logger * logger
Definition renderer.h:38
RiseMath::Color tempcolor
Definition renderer.h:43
void PrepareShipSurfaceLights()
void RenderShips(Rendering::RenderDevice *pd3dDevice, const RiseMath::Vector3 *Xsunlight, ThrustConeRender::Pass pass=ThrustConeRender::Pass::All, bool attenuateThrust=false)
Viewscreen * viewscreen
Definition renderer.h:37
renderer(Viewscreen *ptr)
Definition renderer.cpp:21
void RenderLights(Rendering::RenderDevice *pd3dDevice, const double *fTime)
char msg[199]
Definition renderer.h:42
static float timepassed
Definition renderer.h:48
HRESULT hr
Definition renderer.h:51
void LoadTextures(Rendering::RenderDevice *pd3dDevice, short *stage, short *instage)
Definition renderer.cpp:27
void RenderDocks(Rendering::RenderDevice *pd3dDevice, const RiseMath::Vector3 *Xsunlight)
short s
Definition renderer.h:45
RiseMath::Color vehicleAmbient
Definition weather.h:188
float GetRenderVisibilityKm() const
Definition weather.h:176
float shadow
Definition weather.h:213
CloudVolume::Parameters cloudParameters
Definition weather.h:216
float GetVisibilityKm() const
Definition weather.cpp:1411
float fFogEndHorizon
Definition weather.h:207
DeathType dead
Definition globals.cpp:37
s_network_objects playerships[MAX_SCAN]
Definition globals.cpp:112
bool g_bEnabled
Definition globals.cpp:96
s_universe_object allobjects[maxstarC]
Definition globals.cpp:108
Scockpit ourcockpit
Definition globals.cpp:114
bool g_bAboveClouds
Definition globals.cpp:16
s_polygon_object polyobjects[maxpolyC]
Definition globals.cpp:106
float g_fFOV
Definition globals.cpp:80
#define RTStextureC
Definition globals.h:54
#define RISE_FVF_NOPSIZE
Definition globals.h:124
#define citytextureC
Definition globals.h:53
#define firework1C
Definition globals.h:60
#define firework3C
Definition globals.h:62
#define landformtextureC
Definition globals.h:47
#define radiusC
Definition globals.h:87
#define RISE_FVF_SKYDOME
Definition globals.h:120
#define dihvanimateC
Definition globals.h:63
#define cloudTopsMslC
Definition globals.h:110
#define cutplaneC
Definition globals.h:28
#define weaponanimateC
Definition globals.h:55
#define firework2C
Definition globals.h:61
#define RISE_FVF_VERTEX2
Definition globals.h:119
#define docktextureC
Definition globals.h:51
#define transitiontextureC
Definition globals.h:48
#define shiptextureC
Definition globals.h:49
#define elmoAnimateC
Definition globals.h:56
#define heartanimateC
Definition globals.h:64
float Smooth(float x)
Definition CloudVolume.h:51
float Transmittance(Point from, Point to, const Parameters &params, uint32_t seed=DefaultSeed)
Light Configure(Light light, unsigned char type, const RiseMath::Matrix &modelBase)
constexpr unsigned MaxLights
constexpr unsigned FogVertexCount
void FogMesh(const Light &light, Vertex *output, bool spill)
unsigned NearestLamp(const RiseMath::Vector3 &origin, const std::array< Light, MaxLights > &lights, unsigned count)
constexpr uint32_t INVSRCALPHA
constexpr uint32_t SRCCOLOR
constexpr uint32_t INVSRCCOLOR
constexpr uint32_t ONE
constexpr uint32_t SRCALPHA
constexpr uint32_t LESS
constexpr uint32_t ALWAYS
constexpr uint32_t POINT
constexpr uint32_t NONE
constexpr uint32_t SRCBLEND
constexpr uint32_t POINTSIZE
constexpr uint32_t DESTBLEND
constexpr uint32_t TEXTUREFACTOR
constexpr uint32_t LIGHTING
constexpr uint32_t ZFUNC
constexpr uint32_t ZWRITEENABLE
constexpr uint32_t MIPFILTER
constexpr uint32_t MAGFILTER
constexpr uint32_t MINFILTER
constexpr uint32_t TFACTOR
constexpr uint32_t DIFFUSE
constexpr uint32_t TEXTURE
constexpr uint32_t SELECTARG1
constexpr uint32_t MODULATE
constexpr uint32_t COLOROP
constexpr uint32_t COLORARG1
constexpr uint32_t ALPHAARG2
constexpr uint32_t ALPHAARG1
constexpr uint32_t ALPHAOP
constexpr uint32_t COLORARG2
constexpr uint32_t WORLD
Window11 * ClientHost()
HRESULT LoadTextureResource(RenderDevice *owner, HMODULE module, LPCWSTR id, RenderTexture **result, UINT levels)
const wchar_t * ErrorString(HRESULT code)
constexpr unsigned DefaultSize
HRESULT LoadTexture(RenderDevice *owner, const wchar_t *path, RenderTexture **result, UINT levels=0, UINT width=0, UINT height=0)
HINSTANCE ClientInstance()
auto ToRadian(T value)
Definition ClientMath.h:13
float Vec3Length(const Vector3 *a)
Definition ClientMath.h:95
Vector3 * Vec3Cross(Vector3 *out, const Vector3 *a, const Vector3 *b)
Definition ClientMath.h:105
constexpr auto Min(A first, B second)
Definition ClientMath.h:15
Vector3 * Vec3TransformCoord(Vector3 *out, const Vector3 *a, const Matrix *m)
Definition ClientMath.h:109
Vector3 * Vec3Add(Vector3 *out, const Vector3 *a, const Vector3 *b)
Definition ClientMath.h:96
Matrix * MatrixMultiply(Matrix *out, const Matrix *a, const Matrix *b)
Definition ClientMath.h:116
Vector3 * Vec3Subtract(Vector3 *out, const Vector3 *a, const Vector3 *b)
Definition ClientMath.h:97
Vector3 * Vec3TransformNormal(Vector3 *out, const Vector3 *a, const Matrix *m)
Definition ClientMath.h:107
Matrix * MatrixRotationYawPitchRoll(Matrix *out, float yaw, float pitch, float roll)
Definition ClientMath.h:137
Matrix * MatrixInverse(Matrix *out, float *determinant, const Matrix *a)
Definition ClientMath.h:118
Matrix * MatrixIdentity(Matrix *out)
Definition ClientMath.h:115
float Vec3Dot(const Vector3 *a, const Vector3 *b)
Definition ClientMath.h:93
Matrix * MatrixScaling(Matrix *out, float x, float y, float z)
Definition ClientMath.h:124
Vector3 * Vec3Normalize(Vector3 *out, const Vector3 *a)
Definition ClientMath.h:103
Vector3 * Vec3Scale(Vector3 *out, const Vector3 *a, float scale)
Definition ClientMath.h:98
constexpr auto Max(A first, B second)
Definition ClientMath.h:16
Matrix * MatrixTranslation(Matrix *out, float x, float y, float z)
Definition ClientMath.h:125
void Bind(Rendering::RenderDevice &device, Rendering::RenderTexture *texture)
float Size(float baseSize, float power, float facing)
constexpr float MaxSize
constexpr unsigned MaxLights
Frame Build(const Effects &effects, const RiseMath::Matrix &modelToWorld, unsigned long phase, float power, bool enabled)
constexpr unsigned MaxSceneLights
float Facing(const RiseMath::Vector3 &position, const RiseMath::Vector3 &direction, const RiseMath::Vector3 &eye)
Selection Select(const Frame &frame, const GeometryBounds &local, const RiseMath::Matrix &world)
void Apply(Rendering::RenderDevice &device, const RiseMath::Color &emission, float transmission, bool isSimulator)
float EmissionTransmission(float transmission, bool isSimulator)
bool Includes(Pass pass, int type)
bool IsCone(int type)
constexpr bool AcrossCloudDeck(float observerMslKm, float targetMslKm, float topMslKm=10.f)
#define IDB_BITMAP1
Definition resource.h:35
#define IDB_BITMAP2
Definition resource.h:36
bool forceFeedback
Definition InputConfig.h:16
RiseMath::Vector3 Direction
RiseMath::Color Diffuse
float power
Definition globals.h:599
std::array< float, LandingLights::MaxLights > landingLightBrightness
Definition globals.h:609
std::array< LandingLights::Light, LandingLights::MaxLights > landingLights
Definition globals.h:604
unsigned landingLightCount
Definition globals.h:605
std::array< RiseMath::Vector4, MaxLights > colors
std::array< RiseMath::Vector4, MaxLights > positions
std::array< RiseMath::Vector4, MaxLights > directions
RiseMath::Vector3 normal
Definition globals.h:350
RiseMath::Vector3 position
Definition globals.h:350
unsigned long sequencing
Definition globals.h:352
RiseMath::Color diffuse
Definition globals.h:351
unsigned char primitive
Definition globals.h:349
RiseMath::Matrix matWorld
Definition globals.h:425
RiseMath::Vector3 nominalypr
Definition globals.h:414
unsigned char type
Definition globals.h:403
float speedRetract
Definition globals.h:409
RiseMath::Vector3 position
Definition globals.h:511
unsigned short components
Definition globals.h:551
unsigned long compare
Definition globals.h:514
unsigned char type
Definition globals.h:488
unsigned short vehicleId
Definition globals.h:537
s_mesh_component * componentarray
Definition globals.h:552
unsigned char inarray
Definition globals.h:509
RiseMath::Matrix matrixExterior
Definition globals.h:518
unsigned landingLightCount
Definition globals.h:363
Rendering::RenderBuffer * VB
Definition globals.h:360
std::vector< s_light_effect > effects
Definition globals.h:361
s_mesh_component * componentarray
Definition globals.h:458
RiseMath::Matrix matrixWorld
Definition globals.h:452
RiseMath::Vector3 position
Definition globals.h:454
unsigned short components
Definition globals.h:457
unsigned long compare
Definition globals.h:467