~ubuntu-branches/debian/sid/astromenace/sid

« back to all changes in this revision

Viewing changes to AstroMenaceSource/Menu/Menu_Workshop_Workshop.cpp

  • Committer: Package Import Robot
  • Author(s): Boris Pek, 1
  • Date: 2013-12-19 15:37:09 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131219153709-vs62lyk7ts7o3rf5
Tags: 1.3.2+repack-2
Add patch debian/patches/fix_work_on_intel_videocards.patch:
Mesa developers have enabled GL_ARB_texture_storage for all drivers [1], so
i915 and i965 drivers now claim the support of this OpenGL extension, but
texture storage feature does not actually work there.
.
[1] http://lists.freedesktop.org/archives/mesa-dev/2013-June/041188.html
.
This patch is just workaround to make the game work on intel videocards with
new Mesa. But real problem should be fixed in Mesa.
(Closes: #718680)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/************************************************************************************
2
2
 
3
3
        AstroMenace (Hardcore 3D space shooter with spaceship upgrade possibilities)
4
 
        Copyright © 2006-2012 Michael Kurinnoy, Viewizard
 
4
        Copyright © 2006-2013 Michael Kurinnoy, Viewizard
5
5
 
6
6
 
7
7
        AstroMenace is free software: you can redistribute it and/or modify
55
55
 
56
56
 
57
57
 
58
 
 
59
 
int GetNextSystemStockNum()
60
 
{
61
 
        int Res = CurrentSystemStockNum + 1;
62
 
 
63
 
        if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) if (Res > 4) Res = 1;
64
 
        if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) if (Res > 8) Res = 5;
65
 
        if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) if (Res > 12) Res = 9;
66
 
        if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) if (Res > 16) Res = 13;
67
 
        if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) if (Res > 20) Res = 17;
68
 
 
69
 
//      if (Res > 20) Res = 1;
70
 
        return Res;
71
 
}
72
 
int GetNextSystemStockGroup()
73
 
{
74
 
        if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) return 5;
75
 
        if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) return 9;
76
 
        if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) return 13;
77
 
        if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) return 17;
78
 
        if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) return 1;
79
 
        return 0;
80
 
}
81
 
int GetPrevSystemStockNum()
82
 
{
83
 
        int Res = CurrentSystemStockNum - 1;
84
 
//      if (Res < 1) Res = 20;
85
 
        if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) if (Res < 1) Res = 4;
86
 
        if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) if (Res < 5) Res = 8;
87
 
        if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) if (Res < 9) Res = 12;
88
 
        if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) if (Res < 13) Res = 16;
89
 
        if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) if (Res < 17) Res = 20;
90
 
 
91
 
        return Res;
92
 
}
93
 
int GetPrevSystemStockGroup()
94
 
{
95
 
        if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) return 17;
96
 
        if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) return 1;
97
 
        if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) return 5;
98
 
        if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) return 9;
99
 
        if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) return 13;
 
58
int GetCurrentSustemStockNumBase()
 
59
{
 
60
        switch (CurrentSystemStockNum)
 
61
        {
 
62
                case 1:
 
63
                case 2:
 
64
                case 3:
 
65
                case 4:         return 1;
 
66
 
 
67
                case 5:
 
68
                case 6:
 
69
                case 7:
 
70
                case 8:         return 5;
 
71
 
 
72
                case 9:
 
73
                case 10:
 
74
                case 11:
 
75
                case 12:        return 9;
 
76
 
 
77
                case 13:
 
78
                case 14:
 
79
                case 15:
 
80
                case 16:        return 13;
 
81
 
 
82
                case 17:
 
83
                case 18:
 
84
                case 19:
 
85
                case 20:        return 17;
 
86
 
 
87
                default: fprintf(stderr, "Error in GetCurrentSustemStockNumBase function call, wrong CurrentSystemStockNum.\n"); break;
 
88
        }
 
89
 
100
90
        return 0;
101
91
}
102
92
 
130
120
                case 18:        return "7_system18";
131
121
                case 19:        return "7_system19";
132
122
                case 20:        return "7_system20";
 
123
 
 
124
                default: fprintf(stderr, "Error in GetSystemName function call, wrong Num.\n"); break;
133
125
        }
134
126
 
135
127
        return 0;
172
164
                case 18:        return vw_FindTextureByName("DATA/MENU/system_protect2.tga");
173
165
                case 19:        return vw_FindTextureByName("DATA/MENU/system_protect3.tga");
174
166
                case 20:        return vw_FindTextureByName("DATA/MENU/system_protect4.tga");
 
167
 
 
168
                default: fprintf(stderr, "Error in GetSystemIcon function call, wrong Num.\n"); break;
175
169
        }
176
170
 
177
171
        return 0;
207
201
                case 18:        return 6000;
208
202
                case 19:        return 10000;
209
203
                case 20:        return 15000;
 
204
 
 
205
                default: fprintf(stderr, "Error in GetSystemCost function call, wrong Num.\n"); break;
210
206
        }
211
207
 
212
208
        return 0;
321
317
//------------------------------------------------------------------------------------
322
318
void Workshop_Workshop()
323
319
{
324
 
        RECT SrcRest, DstRest;
325
 
 
326
 
 
327
 
        SetRect(&SrcRest,0,0,256,256);
328
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-256,0,Setup.iAspectRatioWidth/2-256+512,412);
329
 
        vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/back_spot.tga"), true, 0.35f*MenuContentTransp);
 
320
        RECT SrcRect, DstRect;
 
321
 
 
322
 
 
323
        SetRect(&SrcRect,0,0,256,256);
 
324
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-256,0,Setup.iAspectRatioWidth/2-256+512,412);
 
325
        vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/back_spot.tga"), true, 0.35f*MenuContentTransp);
330
326
 
331
327
 
332
328
 
335
331
        vw_Start2DMode(-1,1);
336
332
 
337
333
 
338
 
        SetRect(&SrcRest,0,0,210,600);
339
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-492,50-10,Setup.iAspectRatioWidth/2-492+210,50+600-10);
340
 
        vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/workshop_panel2.tga"), true, MenuContentTransp);
341
 
 
342
 
 
343
 
 
344
 
        // стрелки
345
 
 
346
 
        SetRect(&SrcRest,0,0,74,120);
347
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-461,494,Setup.iAspectRatioWidth/2-461+74,494+120);
348
 
        int MouseX, MouseY;
349
 
        vw_GetMousePos(&MouseX, &MouseY);
350
 
        if  (((DstRest.right-8  >= MouseX)&
351
 
                (DstRest.left+8<= MouseX)&
352
 
                (DstRest.bottom-10 >= MouseY)&
353
 
                (DstRest.top+10<= MouseY))  && !isDialogBoxDrawing())
354
 
        {
355
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
356
 
                {
357
 
                        Audio_PlaySound2D(1,1.0f);
358
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
359
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
360
 
                }
361
 
 
362
 
                CurrentCursorStatus = 1;
363
 
                if (vw_GetWindowLBMouse(true))
364
 
                {
365
 
                        Audio_PlaySound2D(2,1.0f);
366
 
                        CurrentSystemStockNum = GetPrevSystemStockNum();
367
 
                }
368
 
 
369
 
                vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/arrows_on.tga"), true, MenuContentTransp);
370
 
        }
371
 
        else
372
 
        {
373
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
374
 
                {
375
 
                        NeedPlayWorkshopOnButtonSoundX = 0;
376
 
                        NeedPlayWorkshopOnButtonSoundY = 0;
377
 
                }
378
 
 
379
 
                vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/arrows_off.tga"), true, MenuContentTransp);
380
 
        }
381
 
 
382
 
        SetRect(&SrcRest,74,0,148,120);
383
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-461+74,494,Setup.iAspectRatioWidth/2-461+148,494+120);
384
 
        if  (((DstRest.right-8  >= MouseX)&
385
 
                (DstRest.left+8<= MouseX)&
386
 
                (DstRest.bottom-10 >= MouseY)&
387
 
                (DstRest.top+10<= MouseY))  && !isDialogBoxDrawing())
388
 
        {
389
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
390
 
                {
391
 
                        Audio_PlaySound2D(1,1.0f);
392
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
393
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
394
 
                }
395
 
 
396
 
                CurrentCursorStatus = 1;
397
 
                if (vw_GetWindowLBMouse(true))
398
 
                {
399
 
                        Audio_PlaySound2D(2,1.0f);
400
 
                        CurrentSystemStockNum = GetNextSystemStockNum();
401
 
                }
402
 
 
403
 
                vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/arrows_on.tga"), true, MenuContentTransp);
404
 
        }
405
 
        else
406
 
        {
407
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
408
 
                {
409
 
                        NeedPlayWorkshopOnButtonSoundX = 0;
410
 
                        NeedPlayWorkshopOnButtonSoundY = 0;
411
 
                }
412
 
 
413
 
                vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/arrows_off.tga"), true, MenuContentTransp);
414
 
        }
415
 
 
416
 
 
 
334
        SetRect(&SrcRect,0,0,210,600);
 
335
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-492,50-10,Setup.iAspectRatioWidth/2-492+210,50+600-10);
 
336
        vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel2.tga"), true, MenuContentTransp);
417
337
 
418
338
 
419
339
 
420
340
        // выводим иконки систем в магазине, по которым тоже можно кликать
421
341
 
422
 
        SetRect(&SrcRest,0,0,128,128);
423
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-436,50+20+5-5,Setup.iAspectRatioWidth/2-338,50+128-20+5+5);
424
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
425
 
        {
426
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
427
 
                {
428
 
                        Audio_PlaySound2D(1,1.0f);
429
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
430
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
431
 
                }
432
 
 
433
 
                CurrentCursorStatus = 1;
434
 
                if (vw_GetWindowLBMouse(true))
435
 
                {
436
 
                        CurrentSystemStockNum = GetPrevSystemStockNum();
437
 
                        Audio_PlaySound2D(2,1.0f);
438
 
                }
439
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(GetPrevSystemStockNum()), true, MenuContentTransp);
440
 
 
441
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(GetPrevSystemStockNum())));
442
 
                float WScale = 0;
443
 
                if (Size > 128)
444
 
                {
445
 
                        Size = 128;
446
 
                        WScale = -128;
447
 
                }
448
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(GetPrevSystemStockNum())));
449
 
        }
450
 
        else
451
 
        {
452
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
453
 
                {
454
 
                        NeedPlayWorkshopOnButtonSoundX = 0;
455
 
                        NeedPlayWorkshopOnButtonSoundY = 0;
456
 
                }
457
 
 
458
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(GetPrevSystemStockNum()), true, 0.35f*MenuContentTransp);
459
 
 
460
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(GetPrevSystemStockNum())));
461
 
                float WScale = 0;
462
 
                if (Size > 128)
463
 
                {
464
 
                        Size = 128;
465
 
                        WScale = -128;
466
 
                }
467
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, 0.35f*MenuContentTransp, vw_GetText(GetSystemName(GetPrevSystemStockNum())));
468
 
        }
469
 
 
470
 
 
471
 
 
472
 
        SetRect(&SrcRest,0,0,128,128);
473
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-451,55+128+20,Setup.iAspectRatioWidth/2-451+128,55+128+128+20);
474
 
        vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(CurrentSystemStockNum), true, MenuContentTransp);
475
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(CurrentSystemStockNum)));
476
 
                float WScale = 0;
477
 
                if (Size > 128)
478
 
                {
479
 
                        Size = 128;
480
 
                        WScale = -128;
481
 
                }
482
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(CurrentSystemStockNum)));
483
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing()) CurrentCursorStatus = 1;
484
 
 
485
 
 
486
 
 
487
 
 
488
 
        SetRect(&SrcRest,0,0,128,128);
489
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-451+20-5,60+20+256+40-5-5,Setup.iAspectRatioWidth/2-451+128-20+5,60-20+128+256+40-5 +5);
490
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
491
 
        {
492
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
493
 
                {
494
 
                        Audio_PlaySound2D(1,1.0f);
495
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
496
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
497
 
                }
498
 
 
499
 
                CurrentCursorStatus = 1;
500
 
                if (vw_GetWindowLBMouse(true))
501
 
                {
502
 
                        Audio_PlaySound2D(2,1.0f);
503
 
                        CurrentSystemStockNum = GetNextSystemStockNum();
504
 
                }
505
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(GetNextSystemStockNum()), true, MenuContentTransp);
506
 
 
507
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(GetNextSystemStockNum())));
508
 
                float WScale = 0;
509
 
                if (Size > 128)
510
 
                {
511
 
                        Size = 128;
512
 
                        WScale = -128;
513
 
                }
514
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(GetNextSystemStockNum())));
515
 
        }
516
 
        else
517
 
        {
518
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
519
 
                {
520
 
                        NeedPlayWorkshopOnButtonSoundX = 0;
521
 
                        NeedPlayWorkshopOnButtonSoundY = 0;
522
 
                }
523
 
 
524
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(GetNextSystemStockNum()), true, 0.35f*MenuContentTransp);
525
 
 
526
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(GetNextSystemStockNum())));
527
 
                float WScale = 0;
528
 
                if (Size > 128)
529
 
                {
530
 
                        Size = 128;
531
 
                        WScale = -128;
532
 
                }
533
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, 0.35f*MenuContentTransp, vw_GetText(GetSystemName(GetNextSystemStockNum())));
534
 
        }
535
 
 
536
 
        vw_DrawFont(Setup.iAspectRatioWidth/2-475, 630, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_System_Stock"));
537
 
 
538
 
 
539
 
 
540
 
 
541
 
 
542
 
 
543
 
 
544
 
 
545
 
 
546
 
 
547
 
 
548
 
 
549
 
 
550
 
        SetRect(&SrcRest,0,0,210,600);
551
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+282,50-10,Setup.iAspectRatioWidth/2+492,50+600-10);
552
 
        vw_DrawTransparent(&DstRest, &SrcRest, vw_FindTextureByName("DATA/MENU/workshop_panel2+.tga"), true, MenuContentTransp);
 
342
        float Current = 0.4f;
 
343
 
 
344
        SetRect(&SrcRect,0,0,128,128);
 
345
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,60,Setup.iAspectRatioWidth/2-451+128,60+128);
 
346
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
 
347
        {
 
348
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
 
349
                {
 
350
                        Audio_PlaySound2D(1,1.0f);
 
351
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
352
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
 
353
                }
 
354
 
 
355
                CurrentCursorStatus = 1;
 
356
                if (vw_GetWindowLBMouse(true))
 
357
                {
 
358
                        CurrentSystemStockNum = GetCurrentSustemStockNumBase();
 
359
                        Audio_PlaySound2D(2,1.0f);
 
360
                }
 
361
 
 
362
                Current = 0.7f;
 
363
        }
 
364
        else
 
365
        {
 
366
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
 
367
                {
 
368
                        NeedPlayWorkshopOnButtonSoundX = 0;
 
369
                        NeedPlayWorkshopOnButtonSoundY = 0;
 
370
                }
 
371
        }
 
372
        if (CurrentSystemStockNum == GetCurrentSustemStockNumBase())
 
373
        {
 
374
                Current = 1.0f;
 
375
        }
 
376
        vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetCurrentSustemStockNumBase()), true, MenuContentTransp*Current);
 
377
        int Size = vw_FontSize(vw_GetText(GetSystemName(GetCurrentSustemStockNumBase())));
 
378
        float WScale = 0;
 
379
        if (Size > 128)
 
380
        {
 
381
                Size = 128;
 
382
                WScale = -128;
 
383
        }
 
384
        vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f, 1.0f, 1.0f, MenuContentTransp*Current, vw_GetText(GetSystemName(GetCurrentSustemStockNumBase())));
 
385
 
 
386
 
 
387
 
 
388
 
 
389
        Current = 0.4f;
 
390
 
 
391
        SetRect(&SrcRect,0,0,128,128);
 
392
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,200,Setup.iAspectRatioWidth/2-451+128,200+128);
 
393
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
 
394
        {
 
395
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
 
396
                {
 
397
                        Audio_PlaySound2D(1,1.0f);
 
398
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
399
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
 
400
                }
 
401
 
 
402
                CurrentCursorStatus = 1;
 
403
                if (vw_GetWindowLBMouse(true))
 
404
                {
 
405
                        CurrentSystemStockNum = GetCurrentSustemStockNumBase()+1;
 
406
                        Audio_PlaySound2D(2,1.0f);
 
407
                }
 
408
 
 
409
                Current = 0.7f;
 
410
        }
 
411
        else
 
412
        {
 
413
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
 
414
                {
 
415
                        NeedPlayWorkshopOnButtonSoundX = 0;
 
416
                        NeedPlayWorkshopOnButtonSoundY = 0;
 
417
                }
 
418
        }
 
419
        if (CurrentSystemStockNum == GetCurrentSustemStockNumBase()+1)
 
420
        {
 
421
                Current = 1.0f;
 
422
        }
 
423
        vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetCurrentSustemStockNumBase()+1), true, MenuContentTransp*Current);
 
424
        Size = vw_FontSize(vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+1)));
 
425
        WScale = 0;
 
426
        if (Size > 128)
 
427
        {
 
428
                Size = 128;
 
429
                WScale = -128;
 
430
        }
 
431
        vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f, 1.0f, 1.0f, MenuContentTransp*Current, vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+1)));
 
432
 
 
433
 
 
434
 
 
435
 
 
436
        Current = 0.4f;
 
437
 
 
438
        SetRect(&SrcRect,0,0,128,128);
 
439
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,340,Setup.iAspectRatioWidth/2-451+128,340+128);
 
440
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
 
441
        {
 
442
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
 
443
                {
 
444
                        Audio_PlaySound2D(1,1.0f);
 
445
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
446
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
 
447
                }
 
448
 
 
449
                CurrentCursorStatus = 1;
 
450
                if (vw_GetWindowLBMouse(true))
 
451
                {
 
452
                        CurrentSystemStockNum = GetCurrentSustemStockNumBase()+2;
 
453
                        Audio_PlaySound2D(2,1.0f);
 
454
                }
 
455
 
 
456
                Current = 0.7f;
 
457
        }
 
458
        else
 
459
        {
 
460
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
 
461
                {
 
462
                        NeedPlayWorkshopOnButtonSoundX = 0;
 
463
                        NeedPlayWorkshopOnButtonSoundY = 0;
 
464
                }
 
465
        }
 
466
        if (CurrentSystemStockNum == GetCurrentSustemStockNumBase()+2)
 
467
        {
 
468
                Current = 1.0f;
 
469
        }
 
470
        vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetCurrentSustemStockNumBase()+2), true, MenuContentTransp*Current);
 
471
        Size = vw_FontSize(vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+2)));
 
472
        WScale = 0;
 
473
        if (Size > 128)
 
474
        {
 
475
                Size = 128;
 
476
                WScale = -128;
 
477
        }
 
478
        vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f, 1.0f, 1.0f, MenuContentTransp*Current, vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+2)));
 
479
 
 
480
 
 
481
 
 
482
 
 
483
        Current = 0.4f;
 
484
 
 
485
        SetRect(&SrcRect,0,0,128,128);
 
486
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,610-128,Setup.iAspectRatioWidth/2-451+128,610);
 
487
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
 
488
        {
 
489
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
 
490
                {
 
491
                        Audio_PlaySound2D(1,1.0f);
 
492
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
493
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
 
494
                }
 
495
 
 
496
                CurrentCursorStatus = 1;
 
497
                if (vw_GetWindowLBMouse(true))
 
498
                {
 
499
                        CurrentSystemStockNum = GetCurrentSustemStockNumBase()+3;
 
500
                        Audio_PlaySound2D(2,1.0f);
 
501
                }
 
502
 
 
503
                Current = 0.7f;
 
504
        }
 
505
        else
 
506
        {
 
507
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
 
508
                {
 
509
                        NeedPlayWorkshopOnButtonSoundX = 0;
 
510
                        NeedPlayWorkshopOnButtonSoundY = 0;
 
511
                }
 
512
        }
 
513
        if (CurrentSystemStockNum == GetCurrentSustemStockNumBase()+3)
 
514
        {
 
515
                Current = 1.0f;
 
516
        }
 
517
        vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetCurrentSustemStockNumBase()+3), true, MenuContentTransp*Current);
 
518
        Size = vw_FontSize(vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+3)));
 
519
        WScale = 0;
 
520
        if (Size > 128)
 
521
        {
 
522
                Size = 128;
 
523
                WScale = -128;
 
524
        }
 
525
        vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f, 1.0f, 1.0f, MenuContentTransp*Current, vw_GetText(GetSystemName(GetCurrentSustemStockNumBase()+3)));
 
526
 
 
527
 
 
528
 
 
529
        vw_SetFontSize(24);
 
530
        vw_SetFontOffsetY(2);
 
531
        vw_DrawFont(Setup.iAspectRatioWidth/2-475, 630, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_System_Stock"));
 
532
        vw_SetFontSize(Setup.FontSize);
 
533
        vw_SetFontOffsetY(8 - ceil(Setup.FontSize/2.0f) + 2);
 
534
 
 
535
 
 
536
 
 
537
 
 
538
 
 
539
 
 
540
 
 
541
 
 
542
 
 
543
 
 
544
 
 
545
 
 
546
        SetRect(&SrcRect,0,0,210,600);
 
547
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+282,50-10,Setup.iAspectRatioWidth/2+492,50+600-10);
 
548
        vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel2+.tga"), true, MenuContentTransp);
553
549
 
554
550
 
555
551
 
606
602
 
607
603
 
608
604
        // сбор данных
609
 
        float Current = 0.5f;
 
605
        Current = 0.5f;
610
606
        int Cost = 0;
611
607
        bool CanSell = false;
612
608
        bool CanBuy = true;
613
609
 
614
610
        // Engine
615
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100);
 
611
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100);
616
612
 
617
613
        if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4)
618
614
        {
632
628
 
633
629
 
634
630
        // Power
635
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100);
 
631
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100);
636
632
 
637
633
        if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8)
638
634
        {
651
647
        }
652
648
 
653
649
        // Target
654
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100);
 
650
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100);
655
651
 
656
652
        if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12)
657
653
        {
671
667
 
672
668
 
673
669
        // Mech
674
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100);
 
670
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100);
675
671
        if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16)
676
672
        {
677
673
                if (Setup.Profile[CurrentProfile].TargetingMechanicSystem != 0)
689
685
        }
690
686
 
691
687
        // Protect
692
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100);
 
688
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100);
693
689
        if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20)
694
690
        {
695
691
                if (Setup.Profile[CurrentProfile].AdvancedProtectionSystem != 0)
712
708
 
713
709
 
714
710
        // Engine
715
 
        SetRect(&SrcRest,0,0,128,128);
716
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100);
 
711
        SetRect(&SrcRect,0,0,128,128);
 
712
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100);
717
713
        Current = 0.5f;
718
714
        float ColorR, ColorG, ColorB;
719
715
        ColorR = ColorG = ColorB = 1.0f;
739
735
                Current = 1.0f;
740
736
        }
741
737
 
742
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
 
738
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
743
739
        {
744
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
 
740
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
745
741
                {
746
742
                        Audio_PlaySound2D(1,1.0f);
747
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
748
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
 
743
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
744
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
749
745
                }
750
746
 
751
747
                Current = 1.0f;
758
754
        }
759
755
        else
760
756
        {
761
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
 
757
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
762
758
                {
763
759
                        NeedPlayWorkshopOnButtonSoundX = 0;
764
760
                        NeedPlayWorkshopOnButtonSoundY = 0;
766
762
        }
767
763
        if (Setup.Profile[CurrentProfile].EngineSystem <= 0)
768
764
        {
769
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(-4), true, Current*MenuContentTransp);
 
765
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-4), true, Current*MenuContentTransp);
770
766
 
771
 
                int Size = vw_FontSize(vw_GetText("3_empty"));
772
 
                float WScale = 0;
 
767
                Size = vw_FontSize(vw_GetText("3_empty"));
 
768
                WScale = 0;
773
769
                if (Size > 128)
774
770
                {
775
771
                        Size = 128;
776
772
                        WScale = -128;
777
773
                }
778
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
 
774
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
779
775
 
780
776
                Size = vw_FontSize(vw_GetText("4_Spaceship_Engine"));
781
777
                WScale = 0;
784
780
                        Size = 128;
785
781
                        WScale = -128;
786
782
                }
787
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Spaceship_Engine"));
 
783
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Spaceship_Engine"));
788
784
        }
789
785
        else
790
786
        {
791
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(Setup.Profile[CurrentProfile].EngineSystem), true, Current*MenuContentTransp);
 
787
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].EngineSystem), true, Current*MenuContentTransp);
792
788
 
793
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem)));
794
 
                float WScale = 0;
 
789
                Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem)));
 
790
                WScale = 0;
795
791
                if (Size > 128)
796
792
                {
797
793
                        Size = 128;
798
794
                        WScale = -128;
799
795
                }
800
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem)));
 
796
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem)));
801
797
        }
802
798
 
803
799
 
804
800
        // Power
805
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100);
 
801
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100);
806
802
        ColorR = ColorG = ColorB = 1.0f;
807
803
 
808
804
        if (NeedMoreEnergy)
823
819
                Current = 1.0f;
824
820
        }
825
821
 
826
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
 
822
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
827
823
        {
828
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
 
824
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
829
825
                {
830
826
                        Audio_PlaySound2D(1,1.0f);
831
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
832
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
 
827
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
828
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
833
829
                }
834
830
 
835
831
                Current = 1.0f;
842
838
        }
843
839
        else
844
840
        {
845
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
 
841
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
846
842
                {
847
843
                        NeedPlayWorkshopOnButtonSoundX = 0;
848
844
                        NeedPlayWorkshopOnButtonSoundY = 0;
851
847
 
852
848
        if (Setup.Profile[CurrentProfile].PowerSystem <= 0)
853
849
        {
854
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(-2), true, Current*MenuContentTransp);
 
850
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-2), true, Current*MenuContentTransp);
855
851
 
856
 
                int Size = vw_FontSize(vw_GetText("3_empty"));
857
 
                float WScale = 0;
 
852
                Size = vw_FontSize(vw_GetText("3_empty"));
 
853
                WScale = 0;
858
854
                if (Size > 128)
859
855
                {
860
856
                        Size = 128;
861
857
                        WScale = -128;
862
858
                }
863
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
 
859
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
864
860
 
865
861
                Size = vw_FontSize(vw_GetText("4_Power_Source"));
866
862
                WScale = 0;
869
865
                        Size = 128;
870
866
                        WScale = -128;
871
867
                }
872
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Power_Source"));
 
868
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Power_Source"));
873
869
        }
874
870
        else
875
871
        {
876
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(Setup.Profile[CurrentProfile].PowerSystem+4), true, Current*MenuContentTransp);
 
872
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].PowerSystem+4), true, Current*MenuContentTransp);
877
873
 
878
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4)));
879
 
                float WScale = 0;
 
874
                Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4)));
 
875
                WScale = 0;
880
876
                if (Size > 128)
881
877
                {
882
878
                        Size = 128;
883
879
                        WScale = -128;
884
880
                }
885
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4)));
 
881
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4)));
886
882
        }
887
883
 
888
884
 
889
885
 
890
886
        // Target
891
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100);
 
887
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100);
892
888
        ColorR = ColorG = ColorB = 1.0f;
893
889
 
894
890
        Current = 0.5f;
901
897
                Current = 1.0f;
902
898
        }
903
899
 
904
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
 
900
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
905
901
        {
906
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
 
902
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
907
903
                {
908
904
                        Audio_PlaySound2D(1,1.0f);
909
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
910
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
 
905
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
906
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
911
907
                }
912
908
 
913
909
                Current = 1.0f;
920
916
        }
921
917
        else
922
918
        {
923
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
 
919
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
924
920
                {
925
921
                        NeedPlayWorkshopOnButtonSoundX = 0;
926
922
                        NeedPlayWorkshopOnButtonSoundY = 0;
929
925
 
930
926
        if (Setup.Profile[CurrentProfile].TargetingSystem <= 0)
931
927
        {
932
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(-1), true, Current*MenuContentTransp);
 
928
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-1), true, Current*MenuContentTransp);
933
929
 
934
 
                int Size = vw_FontSize(vw_GetText("3_empty"));
935
 
                float WScale = 0;
 
930
                Size = vw_FontSize(vw_GetText("3_empty"));
 
931
                WScale = 0;
936
932
                if (Size > 128)
937
933
                {
938
934
                        Size = 128;
939
935
                        WScale = -128;
940
936
                }
941
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
 
937
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
942
938
 
943
939
                Size = vw_FontSize(vw_GetText("4_Optical_Computer"));
944
940
                WScale = 0;
947
943
                        Size = 128;
948
944
                        WScale = -128;
949
945
                }
950
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Optical_Computer"));
 
946
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Optical_Computer"));
951
947
        }
952
948
        else
953
949
        {
954
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingSystem+8), true, Current*MenuContentTransp);
 
950
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingSystem+8), true, Current*MenuContentTransp);
955
951
 
956
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8)));
957
 
                float WScale = 0;
 
952
                Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8)));
 
953
                WScale = 0;
958
954
                if (Size > 128)
959
955
                {
960
956
                        Size = 128;
961
957
                        WScale = -128;
962
958
                }
963
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8)));
 
959
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8)));
964
960
        }
965
961
 
966
962
 
967
963
 
968
964
        // Mech
969
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100);
 
965
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100);
970
966
        ColorR = ColorG = ColorB = 1.0f;
971
967
 
972
968
        Current = 0.5f;
979
975
                Current = 1.0f;
980
976
        }
981
977
 
982
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
 
978
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
983
979
        {
984
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
 
980
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
985
981
                {
986
982
                        Audio_PlaySound2D(1,1.0f);
987
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
988
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
 
983
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
984
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
989
985
                }
990
986
 
991
987
                Current = 1.0f;
998
994
        }
999
995
        else
1000
996
        {
1001
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
 
997
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
1002
998
                {
1003
999
                        NeedPlayWorkshopOnButtonSoundX = 0;
1004
1000
                        NeedPlayWorkshopOnButtonSoundY = 0;
1007
1003
 
1008
1004
        if (Setup.Profile[CurrentProfile].TargetingMechanicSystem <= 0)
1009
1005
        {
1010
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(-3), true, Current*MenuContentTransp);
 
1006
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-3), true, Current*MenuContentTransp);
1011
1007
 
1012
 
                int Size = vw_FontSize(vw_GetText("3_empty"));
1013
 
                float WScale = 0;
 
1008
                Size = vw_FontSize(vw_GetText("3_empty"));
 
1009
                WScale = 0;
1014
1010
                if (Size > 128)
1015
1011
                {
1016
1012
                        Size = 128;
1017
1013
                        WScale = -128;
1018
1014
                }
1019
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
 
1015
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
1020
1016
 
1021
1017
                Size = vw_FontSize(vw_GetText("4_Targeting_System"));
1022
1018
                WScale = 0;
1025
1021
                        Size = 128;
1026
1022
                        WScale = -128;
1027
1023
                }
1028
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Targeting_System"));
 
1024
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Targeting_System"));
1029
1025
        }
1030
1026
        else
1031
1027
        {
1032
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12), true, Current*MenuContentTransp);
 
1028
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12), true, Current*MenuContentTransp);
1033
1029
 
1034
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12)));
1035
 
                float WScale = 0;
 
1030
                Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12)));
 
1031
                WScale = 0;
1036
1032
                if (Size > 128)
1037
1033
                {
1038
1034
                        Size = 128;
1039
1035
                        WScale = -128;
1040
1036
                }
1041
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12)));
 
1037
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12)));
1042
1038
        }
1043
1039
 
1044
1040
 
1045
1041
 
1046
1042
        // Protect
1047
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100);
 
1043
        SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100);
1048
1044
        ColorR = ColorG = ColorB = 1.0f;
1049
1045
 
1050
1046
        if (NeedMoreEnergy && Setup.Profile[CurrentProfile].AdvancedProtectionSystem != 0)
1065
1061
                Current = 1.0f;
1066
1062
        }
1067
1063
 
1068
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing())
 
1064
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing())
1069
1065
        {
1070
 
                if (NeedPlayWorkshopOnButtonSoundX != DstRest.left || NeedPlayWorkshopOnButtonSoundY != DstRest.top)
 
1066
                if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top)
1071
1067
                {
1072
1068
                        Audio_PlaySound2D(1,1.0f);
1073
 
                        NeedPlayWorkshopOnButtonSoundX = DstRest.left;
1074
 
                        NeedPlayWorkshopOnButtonSoundY = DstRest.top;
 
1069
                        NeedPlayWorkshopOnButtonSoundX = DstRect.left;
 
1070
                        NeedPlayWorkshopOnButtonSoundY = DstRect.top;
1075
1071
                }
1076
1072
 
1077
1073
                Current = 1.0f;
1084
1080
        }
1085
1081
        else
1086
1082
        {
1087
 
                if (NeedPlayWorkshopOnButtonSoundX == DstRest.left && NeedPlayWorkshopOnButtonSoundY == DstRest.top)
 
1083
                if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top)
1088
1084
                {
1089
1085
                        NeedPlayWorkshopOnButtonSoundX = 0;
1090
1086
                        NeedPlayWorkshopOnButtonSoundY = 0;
1093
1089
 
1094
1090
        if (Setup.Profile[CurrentProfile].AdvancedProtectionSystem <= 0)
1095
1091
        {
1096
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(0), true, Current*MenuContentTransp);
 
1092
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(0), true, Current*MenuContentTransp);
1097
1093
 
1098
 
                int Size = vw_FontSize(vw_GetText("3_empty"));
1099
 
                float WScale = 0;
 
1094
                Size = vw_FontSize(vw_GetText("3_empty"));
 
1095
                WScale = 0;
1100
1096
                if (Size > 128)
1101
1097
                {
1102
1098
                        Size = 128;
1103
1099
                        WScale = -128;
1104
1100
                }
1105
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
 
1101
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty"));
1106
1102
 
1107
1103
                Size = vw_FontSize(vw_GetText("4_Advanced_System"));
1108
1104
                WScale = 0;
1111
1107
                        Size = 128;
1112
1108
                        WScale = -128;
1113
1109
                }
1114
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Advanced_System"));
 
1110
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Advanced_System"));
1115
1111
 
1116
1112
        }
1117
1113
        else
1118
1114
        {
1119
 
                vw_DrawTransparent(&DstRest, &SrcRest, GetSystemIcon(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16), true, Current*MenuContentTransp);
 
1115
                vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16), true, Current*MenuContentTransp);
1120
1116
 
1121
 
                int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16)));
1122
 
                float WScale = 0;
 
1117
                Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16)));
 
1118
                WScale = 0;
1123
1119
                if (Size > 128)
1124
1120
                {
1125
1121
                        Size = 128;
1126
1122
                        WScale = -128;
1127
1123
                }
1128
 
                vw_DrawFont(DstRest.left+(DstRest.right-DstRest.left-Size)/2, DstRest.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16)));
 
1124
                vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16)));
1129
1125
        }
1130
1126
 
1131
1127
 
1132
1128
 
1133
 
 
1134
 
        vw_DrawFont(Setup.iAspectRatioWidth/2+475-vw_FontSize(vw_GetText("7_Installed_Systems"))*1.5f, 630, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_Installed_Systems"));
 
1129
        vw_SetFontSize(24);
 
1130
        vw_SetFontOffsetY(2);
 
1131
        vw_DrawFont(Setup.iAspectRatioWidth/2+475-vw_FontSize(vw_GetText("7_Installed_Systems")), 630, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_Installed_Systems"));
 
1132
        vw_SetFontSize(Setup.FontSize);
 
1133
        vw_SetFontOffsetY(8 - ceil(Setup.FontSize/2.0f) + 2);
1135
1134
 
1136
1135
        // текущая система
1137
1136
        vw_DrawFont(Setup.iAspectRatioWidth/2-250, 430, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, vw_GetText("7_Selected_System"));
1175
1174
                BuyCurrentSystem();
1176
1175
        }
1177
1176
        // покупка, если 2 раза кликнули на иконку текущей системы
1178
 
        SetRect(&DstRest,Setup.iAspectRatioWidth/2-451,55+128+20,Setup.iAspectRatioWidth/2-451+128,55+128+128+20);
1179
 
        if (vw_OnRect(&DstRest) && !isDialogBoxDrawing() && CanBuy)
 
1177
        SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,55+128+20,Setup.iAspectRatioWidth/2-451+128,55+128+128+20);
 
1178
        if (vw_OnRect(&DstRect) && !isDialogBoxDrawing() && CanBuy)
1180
1179
                if (vw_GetWindowLBDoubleMouse(true))
1181
1180
                        BuyCurrentSystem();
1182
1181
 
1189
1188
 
1190
1189
 
1191
1190
        // вывод информации
1192
 
        int SizeI = (Setup.iAspectRatioWidth-vw_FontSize("%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money)*1.25f)/2;
 
1191
        vw_SetFontSize(20);
 
1192
        vw_SetFontOffsetY(2);
 
1193
        int SizeI = (Setup.iAspectRatioWidth-vw_FontSize("%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money))/2;
1193
1194
        if (CanBuy)
1194
 
                vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,1.0f,0.0f, MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money);
 
1195
                vw_DrawFont(SizeI, 630, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money);
1195
1196
        else
1196
 
                vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money);
1197
 
 
 
1197
                vw_DrawFont(SizeI, 630, 0, 0, 1.0f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money);
 
1198
        vw_SetFontSize(Setup.FontSize);
 
1199
        vw_SetFontOffsetY(8 - ceil(Setup.FontSize/2.0f) + 2);
1198
1200
}
1199
1201