-
Notifications
You must be signed in to change notification settings - Fork 0
/
display.c
5588 lines (4639 loc) · 190 KB
/
display.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "config.h"
#include "allegro.h"
#include <math.h>
#include <string.h>
#include "globvars.h"
#include "palette.h"
#define IN_DISPLAY_C
#include "display.h"
#undef IN_DISPLAY_C
#include "game.h"
#include "stuff.h"
#include "message.h"
#include "text.h"
#define SCAN_SIZE 50
#define TRANS_TABLE color_map = &trans_table;
#define ALPHA_TABLE color_map = &alpha_table;
BITMAP *display [3];
extern COLOR_MAP trans_table;
extern COLOR_MAP alpha_table;
// in palette.c
//#define SCREENSHOT
#ifdef SCREENSHOT
extern RGB palet [256];
#include "string.h"
#endif
//RLE_SPRITE *RLE_bubble [RLE_BUBBLES];
extern volatile int frames_per_second;
extern int slacktime;
extern int long_slacktime_store;
void draw_player(int d, int p);
int get_player_sprite(int p);
void draw_bullets(int d, int p);
void draw_a_bullet(int d, int b);
//void draw_bullets(int d, int p);
void pline(BITMAP *bmp, int x1, int y1, int x2, int y2, int colour);
void draw_stars(int d, int p, char motion);
void poly4(BITMAP *target, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int col);
void print_number(int x, int y, int n);
void draw_clouds(int d, int p);
void draw_a_cloud(int d, int c);
void draw_HUD(int d, int p);
void draw_overscan(int x, int y);
void draw_trail_line(BITMAP* bmp, int x, int y, int size);
void draw_worm_trail_line(BITMAP* bmp, int x, int y, int size);
void draw_rocket_trail_line(BITMAP* bmp, int x, int y, int size);
//void draw_shield_circle(BITMAP* bmp, int x, int y, int size);
void draw_pshield_circle(BITMAP *bmp, int x, int y, int strength);
void detect_player_collision(int p);
char check_pixel(int x, int y);
void run_display(int draw_everything, int star_motion);
void draw_ships(int d, int p);
void draw_a_ship(int d, int a, int e, int p);
void draw_a_wship(int a, int e, int d, int p, int x, int y);
void draw_edrive(int d, int x, int y, int angle, int dist, int size, int reduce, int randsize, int col);
void draw_a_turret(int d, int a, int e, int t, int p, int x, int y);
void draw_other_player(int d, int p, int op);
void draw_player_shield(int d, int p, int x, int y, int angle_draw);
void draw_final_details(void);
void draw_hitpulses(int d, int p, int type, int x, int y, int bitshift, int col);
void display_message_header(int i, int x, int y);
void draw_convoys(int d, int p);
void draw_a_convoy(int d, int cv, int p);
int points [8];
int scanner [SCAN_SIZE] [SCAN_SIZE];
RLE_SPRITE *circle_in [CIRCLES];
RLE_SPRITE *circle_out [CIRCLES];
RLE_SPRITE *circle_hurt [CIRCLES];
RLE_SPRITE *circle_white [CIRCLES];
RLE_SPRITE *circle_grey [CIRCLES];
//RLE_SPRITE *RLE_bcircle [3] [RLE_BCIRCLES];
//RLE_SPRITE *RLE_wcircle [3] [RLE_BCIRCLES];
RLE_SPRITE *RLE_ccircle_basic [3] [RLE_CCIRCLES];
RLE_SPRITE *RLE_ccircle_3cols [3] [RLE_CCIRCLES];
RLE_SPRITE *RLE_ccircle_2cols [3] [RLE_CCIRCLES];
RLE_SPRITE *RLE_small_shock [3] [SMALL_SHOCK_TIME];
RLE_SPRITE *RLE_large_shock [3] [LARGE_SHOCK_TIME];
RLE_SPRITE *RLE_huge_shock [3] [HUGE_SHOCK_TIME];
RLE_SPRITE *RLE_player [PLAYER_RLES];
RLE_SPRITE *RLE_scircle [4] [RLE_SCIRCLES];
RLE_SPRITE *RLE_xcircle [3] [RLE_XCIRCLES];
RLE_SPRITE* damage_sprite [NO_DSPRITES] [DAMAGE_COLS];
extern struct BMP_STRUCT ship_collision_mask [NO_SHIP_TYPES]; // defined in display_init.c
void draw_circle_in(int d, int x, int y, int size, char hurt);
void draw_circle_out(int d, int x, int y, int size);
void draw_circle_white(int d, int x, int y, int size);
void draw_circle_grey(int d, int x, int y, int size);
void ccircle(int d, int x, int y, int size, int colour);
void ccircle3(int d, int x, int y, int size, int colour);
void ccircle2(int d, int x, int y, int size, int colour);
void ccircle3_bmp(BITMAP *bmp, int x, int y, int size, int colour);
void ccircle2_bmp(BITMAP *bmp, int x, int y, int size, int colour);
extern volatile unsigned char ticked;
#ifdef SHOW_GRAPHS
int graph_slack [200];
int graph_slack_pos;
int graph_fps [200];
int graph_fps_pos;
#endif
extern FONT* gfont;
extern FONT* small_font;
struct BMP_STRUCT wship_sprite [WSHIP_SPRITES] [WSHIP_ROTATIONS];
struct BMP_STRUCT turret_sprite [TURRET_SPRITES] [TURRET_ROTATIONS];
// these two are externed in both display.c and briefing.c
struct BMP_STRUCT fighter_sprite [FIGHTER_SPRITES] [FIGHTER_ROTATIONS];
struct BMP_STRUCT player_sprite [PLAYER_SPRITES] [PLAYER_ROTATIONS];
struct BMP_STRUCT spulse_sprite [SHIELD_TYPES] [SHIELD_FRAMES] [SHIELD_ROTATIONS];
struct BMP_STRUCT missile_sprite [MISSILE_SPRITES] [MISSILE_ROTATIONS];
//struct BMP_STRUCT shield_sprite [SHIELD_SPRITES] [
int trans_col [3] [4] =
{
{TRANS_RED1, TRANS_RED2, TRANS_RED3, TRANS_YELLOW4},
{TRANS_GREEN1, TRANS_GREEN2, TRANS_GREEN3, TRANS_GREEN4},
{TRANS_BLUE1, TRANS_BLUE2, TRANS_BLUE3, TRANS_BLUE4}
};
int camera_angle;
float camera_angle_rad;
//char camera_fix;
//BITMAP *interlude_screen;
/*
Call when you want the display updated.
Uses buffering: everything is drawn to the display bitmap, then the display bitmap is blitted to the screen
in one go.
*/
void run_display(int draw_everything, int star_motion)
{
if (!draw_everything)
{
return;
}
if (arena.only_player != -1) // i.e. there is only one player
{
camera_angle = player[0].angle;
if (arena.camera_fix)
{
camera_angle = -ANGLE_4;
/* player[0].camera_x = 400 - xpart(player[0].angle, 200);
player[0].camera_y = 300 - ypart(player[0].angle, 200);*/
}
camera_angle_rad = angle_to_radians(camera_angle);
clear_to_color(display [0], COL_STAR1);
draw_stars(0, arena.only_player, star_motion);
draw_ships(0, arena.only_player);
if (player[arena.only_player].alive)
{
if (arena.camera_fix)
draw_other_player(0, 0, 0); // this draws player[0] as if they were the other player.
else
draw_player(0, arena.only_player);
}
draw_bullets(0, arena.only_player);
draw_clouds(0, arena.only_player);
draw_convoys(0, arena.only_player);
draw_HUD(0, arena.only_player);
draw_overscan(640, 440);
}
else
{
camera_angle = player[0].angle;
camera_angle_rad = angle_to_radians(camera_angle);
clear_to_color(display [0], COL_STAR1);
draw_stars(1, 0, star_motion);
draw_ships(1, 0);
if (player[1].alive)
draw_other_player(1, 0, 1);
if (player[0].alive)
draw_player(1, 0);
// if (PP.alive)
// draw_player();
draw_bullets(1, 0);
// if (PP.alive)
// detect_player_collision(0);
draw_clouds(1, 0);
draw_HUD(1, 0);
// draw_HUD for a p must come after draw_ships for that p and before draw_ships for other p
// because of stored_angle value
camera_angle = player[1].angle;
camera_angle_rad = angle_to_radians(camera_angle);
draw_stars(2, 1, star_motion);
draw_ships(2, 1);
if (player[0].alive)
draw_other_player(2, 1, 0);
if (player[1].alive)
draw_player(2, 1);
// if (PP.alive)
// draw_player();
draw_bullets(2, 1);
// if (PP.alive)
// detect_player_collision(0);
draw_clouds(2, 1);
draw_HUD(2, 1);
}
draw_final_details(); // just draws ships left and the central line and overscan for 2-player
//#ifdef DEBUG_DISPLAY
//#define FPS_DISPLAY
#ifdef FPS_DISPLAY
textprintf_ex(display[0], small_font, 1, 562, -1, -1, "%i, %i", player[0].x>>10, player[0].y>>10);
textprintf_ex(display[0], small_font, 1, 575, -1, -1, "fps %i", frames_per_second);
textprintf_ex(display[0], small_font, 1, 587, -1, -1, "slack %i", slacktime);
textprintf_ex(display[0], small_font, 150, 487, -1, -1, "ad %i", player[0].rocket_burst);
#endif
// textprintf_ex(display[0], small_font, 1, 375, -1, -1, "%i", player[0].rocket_burst);
// textprintf_ex(display[0], small_font, 10, 270, -1, -1, "threat %i ws%i f%i", arena.threat, arena.wship_threat, arena.fighter_threat);
//#endif
if (arena.game_over > 0)
{
textprintf_centre_ex(display[0], small_font, 400, 300, COL_WHITE, -1, "G A M E O V E R");
}
if (arena.mission_over > 0)
{
textprintf_centre_ex(display[0], small_font, 400, 300, COL_WHITE, -1, "M I S S I O N O V E R");
}
if (arena.all_wships_lost > 0)
{
textprintf_centre_ex(display[0], small_font, 400, 280, COL_WHITE, -1, "A L L W A R S H I P S L O S T");
textprintf_centre_ex(display[0], small_font, 400, 320, COL_WHITE, -1, "M I S S I O N O V E R");
}
blit(display[0], screen, 0, 0, 0, 0, 800, 600);
#ifdef SCREENSHOT
static int scrs = 0;
static int sshot_counter = 0;
char sfile [20];
char istr [20];
if (sshot_counter > 0)
sshot_counter --;
if (key [KEY_F1] && sshot_counter <= 0)
{
BITMAP *scrshot_bmp;
scrshot_bmp = create_bitmap(640, 480);
blit(screen, scrshot_bmp, 0,0,0,0,640,480);
strcpy(sfile, "scr");
strcat(sfile, itoa(scrs, istr, 10));
strcat(sfile, ".bmp");
save_bitmap(sfile, scrshot_bmp, palet);
clear_to_color(screen, COL_WHITE);
scrs ++;
sshot_counter = 15;
destroy_bitmap(scrshot_bmp);
}
#endif
}
void get_interlude_background(void)
{
run_display(1, 0);
// blit(display[0], interlude_screen, 0,0,0,0,640,480);
}
int get_player_sprite(int p)
{
int sprite = PLAYER_SPRITE_1_1;
if (PP.recycle > 2)
sprite = PLAYER_SPRITE_2_1;
if (PP.recycle > 6)
sprite = PLAYER_SPRITE_3_1;
if (PP.drive [0] > 0)
sprite ++;
if (PP.drive [0] > 5)
sprite ++;
return sprite;
}
void draw_player(int d, int p)
{
int sprite;
sprite = get_player_sprite(p);
draw_sprite(display[d], player_sprite [sprite] [0].sprite, PP.camera_x - player_sprite [sprite] [0].x [0], PP.camera_y - player_sprite [sprite] [0].y [0]);
if (PP.drive [0] > 0)
draw_edrive(d, PP.camera_x, PP.camera_y + 4, 0, 3 + (PP.drive[0]>>2), 2 + (PP.drive[0]>>2), 1, 2, 0);
if (PP.drive [1] > 0)
draw_edrive(d, PP.camera_x, PP.camera_y - 9, -ANGLE_2, 2 + (PP.drive[1]>>2), 2 + (PP.drive[1]>>2), 1, 2, 0);
if (PP.drive [2] > 0)
draw_edrive(d, PP.camera_x + 7, PP.camera_y, -ANGLE_4, 3 + (PP.drive[2]>>2), 2 + (PP.drive[2]>>2), 1, 2, 0);
if (PP.drive [3] > 0)
draw_edrive(d, PP.camera_x - 7, PP.camera_y, ANGLE_4, 3 + (PP.drive[3]>>2), 2 + (PP.drive[3]>>2), 1, 2, 0);
if (PP.mflash [0] > 0)
ccircle2(d, PP.camera_x - 3, PP.camera_y - 8, PP.mflash [0], 0);
if (PP.mflash [1] > 0)
ccircle2(d, PP.camera_x + 3, PP.camera_y - 8, PP.mflash [1], 0);
draw_player_shield(d, p, PP.camera_x, PP.camera_y, 0);
// print_number(300, 300, PP.weapon_charge [1]);
// print_number(300, 320, PP.weapon_target [1] [0]);
/*
if (PP.drive > 5)
{
sprite = PLAYER_RLE_BASE_2;
y = 0;
}
if (PP.drive > 9)
{
sprite = PLAYER_RLE_BASE_3;
y = 1;
}
draw_rle_sprite(display[d], RLE_player [sprite], 320 - 12, 360 - 10);
int sprite2 = PLAYER_RLE_SIDE_L1;
if (PP.flap [0] > 5)
sprite2 = PLAYER_RLE_SIDE_L2;
if (PP.flap [0] > 9)
sprite2 = PLAYER_RLE_SIDE_L3;
draw_rle_sprite(display[d], RLE_player [sprite2], 320 - 15, 360 + y);
sprite2 = PLAYER_RLE_SIDE_R1;
if (PP.flap [1] > 5)
sprite2 = PLAYER_RLE_SIDE_R2;
if (PP.flap [1] > 9)
sprite2 = PLAYER_RLE_SIDE_R3;
draw_rle_sprite(display[d], RLE_player [sprite2], 320 + 9, 360 + y);
int size;
int drive = PP.drive;
int col = 0;
if (PP.upgrade [U_AGILITY] == 2)
col = 2;
if (drive > 10)
drive = 10;
if (drive > 0)
{
size = (drive>>1) + grand(4);
if (PP.upgrade [U_AGILITY] == 1)
ccircle3(d, 320, 360 + 8, size, col);
else
ccircle2(d, 320, 360 + 8, size, col);
size -= 2 + grand(3);
if (size > 0)
ccircle(d, 320, 360 + 6, size, col);
if (drive > 5)
{
if (PP.upgrade [U_AGILITY] == 1)
ccircle3(d, 320, 360 + 10 + grand(3), size, col);
else
ccircle2(d, 320, 360 + 10 + grand(3), size, col);
if (drive > 8 && size > 2)
{
if (PP.upgrade [U_AGILITY] == 1)
ccircle3(d, 320, 360 + 14 + grand(3), size - 2, col);
else
ccircle2(d, 320, 360 + 14 + grand(3), size - 2, col);
}
}
}
// draw_rle_sprite(display, RLE_player [PLAYER_RLE_BASE], 320 - 12, 360 - 4);
int anim;*/
/*
if (PP.recycle == 10)
anim = 1;
if (PP.recycle == 9)
anim = 2;
if (PP.recycle == 8)
anim = 3;
if (PP.recycle < 8)
anim = PP.recycle >> 1;
if (anim > 3) anim = 3;
draw_rle_sprite(display[d], RLE_player [PLAYER_RLE_FRONT_1 + anim], 320 - 5, 360 - 11);
*/
/* if (PP.recycle > 0)
{
int ccol = 0;
if (PP.upgrade [U_POWER] == 2)
ccol = 2;
ccircle(d, 320 - 3, 360 - 10 + anim, PP.recycle >> 1, ccol);
ccircle(d, 320 + 3, 360 - 10 + anim, PP.recycle >> 1, ccol);
ccircle2(d, 320 - 3, 360 - 10 + anim, PP.recycle >> 0, ccol);
ccircle2(d, 320 + 3, 360 - 10 + anim, PP.recycle >> 0, ccol);
}*/
/*
rectfill(display[d], 320 - 2, 360 - 4, 320 + 2, 360 + 1, COL_4); // prepares player sprite for collision detection later
hline(display[d], 320 - 1, 360 - 5, 320 + 1, COL_4);
hline(display[d], 320 - 1, 360 + 2, 320 + 1, COL_4);
*/
}
/*
void detect_player_collision(int p)
{
// return;
int x = 320;
int y = 360;
if (check_pixel(x - 1, y + 2)
|| check_pixel(x, y + 2)
|| check_pixel(x + 1, y + 2)
|| check_pixel(x - 2, y + 1)
|| check_pixel(x + 2, y + 1)
|| check_pixel(x - 2, y + 0)
|| check_pixel(x + 2, y + 0)
|| check_pixel(x - 2, y - 1)
|| check_pixel(x + 2, y - 1)
|| check_pixel(x - 2, y - 2)
|| check_pixel(x + 2, y - 2)
|| check_pixel(x - 2, y - 3)
|| check_pixel(x + 2, y - 3)
|| check_pixel(x - 2, y - 4)
|| check_pixel(x + 2, y - 4)
|| check_pixel(x - 1, y - 5)
|| check_pixel(x, y - 5)
|| check_pixel(x + 1, y - 5)
|| check_pixel(x, y - 4)
|| check_pixel(x, y - 3)
|| check_pixel(x, y - 2)
|| check_pixel(x, y - 1)
|| check_pixel(x, y - 0)
|| check_pixel(x, y + 1)
)
{
player_hit(p, 0);
}
rectfill(display[d], 320 - 2, 360 - 4, 320 + 2, 360 + 1, COL_14);
hline(display, 320 - 1, 360 - 5, 320 + 1, COL_14);
hline(display, 320 - 1, 360 + 2, 320 + 1, COL_14);
return;
}
*/
void draw_other_player(int d, int p, int op)
{
if (player[op].x < PP.x - (600 << 10) || player[op].x > PP.x + (600 << 10)
|| player[op].y < PP.y - (600 << 10) || player[op].y > PP.y + (600 << 10))
return;
int sprite;
sprite = get_player_sprite(op);
float angle = atan2(player[op].y - PP.y, player[op].x - PP.x) - (PI/2) - angle_to_radians(camera_angle);
int dist = hypot(player[op].y - PP.y, player[op].x - PP.x);
int x = PP.camera_x + cos(angle) * (dist >> 10);
int y = PP.camera_y + sin(angle) * (dist >> 10);
int sprite_angle;
int sprite_angle_flip = 0;
int angle_draw;
// int fsprite;
// int ldrive_size, rdrive_size, reduce, randsize;
angle_draw = player[op].angle - camera_angle;
angle_draw &= ANGLE_MASK;
sprite_angle = ((angle_draw) >> PLAYER_ROTATION_BITSHIFT) & PLAYER_FULL_MASK;
sprite_angle_flip = 0;
// ldrive_size = EE.engine1 / 30;
// rdrive_size = EE.engine2 / 30;
if (sprite_angle >= PLAYER_ROTATIONS)
{
if (sprite_angle >= PLAYER_ROTATIONS * 3)
{
sprite_angle_flip = (PLAYER_ROTATIONS * 4) - sprite_angle - 1;
sprite_angle_flip &= PLAYER_ROTATION_MASK;
draw_sprite_h_flip(display[d], player_sprite [sprite] [sprite_angle_flip].sprite, x - (player_sprite [sprite] [sprite_angle_flip].sprite->w - player_sprite [sprite] [sprite_angle_flip].x [0]), y - player_sprite [sprite] [sprite_angle_flip].y [0]);
/* draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y + fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, rdrive_size, 2, 3, 0); // RH drive
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y + fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, ldrive_size, 2, 3, 0); // LH drive*/
}
else
{
if (sprite_angle >= PLAYER_ROTATIONS * 2)
{
sprite_angle_flip = sprite_angle - (PLAYER_ROTATIONS * 2);
sprite_angle_flip &= PLAYER_ROTATION_MASK;
draw_sprite_vh_flip(display[d], player_sprite [sprite] [sprite_angle_flip].sprite, x - (player_sprite [sprite] [sprite_angle_flip].sprite->w - player_sprite [sprite] [sprite_angle_flip].x [0]), y - (player_sprite [sprite] [sprite_angle_flip].sprite->h - player_sprite [sprite] [sprite_angle_flip].y [0]));
/* draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, rdrive_size, 2, 3, 0); // RH drive
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, ldrive_size, 2, 3, 0); // LH drive*/
}
else
{
sprite_angle_flip = (PLAYER_ROTATIONS * 2) - sprite_angle - 1;
sprite_angle_flip &= PLAYER_ROTATION_MASK;
draw_sprite_v_flip(display[d], player_sprite [sprite] [sprite_angle_flip].sprite, x - player_sprite [sprite] [sprite_angle_flip].x [0], y - (player_sprite [sprite] [sprite_angle_flip].sprite->h - player_sprite [sprite] [sprite_angle_flip].y [0]));
/* draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, rdrive_size, 2, 3, 0); // RH drive
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, ldrive_size, 2, 3, 0); // LH drive*/
}
}
}
else
{
sprite_angle &= PLAYER_ROTATION_MASK;
draw_sprite(display[d], player_sprite [sprite] [sprite_angle].sprite, x - player_sprite [sprite] [sprite_angle].x [0], y - player_sprite [sprite] [sprite_angle].y [0]);
/* draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [2], y + fighter_sprite [fsprite] [sprite_angle].y [2],
angle_draw, rdrive_size, 2, 3, 0); // RH drive
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [1], y + fighter_sprite [fsprite] [sprite_angle].y [1],
angle_draw, ldrive_size, 2, 3, 0); // LH drive*/
}
if (player[op].drive [0] > 0)
draw_edrive(d, x + xpart(angle_draw + ANGLE_4, 4), y + ypart(angle_draw + ANGLE_4, 4), angle_draw, 3 + (player[op].drive[0]>>2), 2 + (player[op].drive[0]>>2), 1, 2, 0);
if (player[op].drive [1] > 0)
draw_edrive(d, x + xpart(angle_draw - ANGLE_4, 9), y + ypart(angle_draw - ANGLE_4, 9), angle_draw - ANGLE_2, 2 + (player[op].drive[1]>>2), 2 + (player[op].drive[1]>>2), 1, 2, 0);
if (player[op].drive [2] > 0)
draw_edrive(d, x + xpart(angle_draw, 7), y + ypart(angle_draw, 7), angle_draw - ANGLE_4, 2 + (player[op].drive[2]>>2), 2 + (player[op].drive[2]>>2), 1, 2, 0);
if (player[op].drive [3] > 0)
draw_edrive(d, x + xpart(angle_draw - ANGLE_2, 7), y + ypart(angle_draw - ANGLE_2, 7), angle_draw + ANGLE_4, 2 + (player[op].drive[3]>>2), 2 + (player[op].drive[3]>>2), 1, 2, 0);
if (player[op].mflash [0] > 0)
ccircle2(d, x + xpart(angle_draw - ANGLE_4 - ANGLE_16, 9), y + ypart(angle_draw - ANGLE_4 - ANGLE_16, 9), player[op].mflash [0], 0);
if (player[op].mflash [1] > 0)
ccircle2(d, x + xpart(angle_draw - ANGLE_4 + ANGLE_16, 9), y + ypart(angle_draw - ANGLE_4 + ANGLE_16, 9), player[op].mflash [1], 0);
draw_player_shield(d, op, x, y, angle_draw);
// draw_edrive(d, x, y, angle_draw, player[op].drive >> 1, 2, 2, 0);
// vline(display[d], x, y - 15, y + 15, COL_7);
// hline(display[d], x - 15, y, x + 15, COL_7);
}
void draw_player_shield(int d, int p, int x, int y, int angle_draw)
{
int pangle, pdist, ptype, pframe, i, draw_angle;
ptype = SHIELD_FIGHTER;
for (i = 0; i < PULSE; i ++)
{
if (PP.spulse_time [i] > 0)
{
pangle = ((PP.spulse_angle [i] + angle_draw + ANGLE_4) >> SHIELD_ROTATION_BITSHIFT) & SHIELD_FULL_MASK;
// pangle = ((EE.spulse_angle [i] + angle_draw) ) & SHIELD_FULL_MASK;
draw_angle = PP.spulse_angle [i] + angle_draw;
pdist = PP.spulse_dist [i] + 10;
pframe = 0;
if (PP.spulse_time [i] < 90)
pframe = 1;
if (PP.spulse_time [i] < 60)
pframe = 2;
if (PP.spulse_time [i] < 30)
pframe = 3;
draw_trans_sprite(display[d], spulse_sprite [ptype] [pframe] [pangle].sprite, x + xpart(draw_angle, pdist) - spulse_sprite [ptype] [pframe] [pangle].x [0], y + ypart(draw_angle, pdist) - spulse_sprite [ptype] [pframe] [pangle].y [0]);
// draw_trans_sprite(display[d], spulse_sprite [ptype] [pframe] [pangle].sprite, x - spulse_sprite [ptype] [pframe] [pangle].x [0], y - spulse_sprite [ptype] [pframe] [pangle].y [0]);
}
}
}
char check_pixel(int x, int y)
{
int pix = getpixel(display[0], x, y);
if (pix == COL_14 || pix >= TRANS_YELLOW4)
return 1;
return 0;
}
void draw_convoys(int d, int p)
{
return;
#define SHOW_RUNNING_SCRIPTS
#ifdef SHOW_RUNNING_SCRIPTS
int r;
extern int running_script [16];
for (r = 0; r < 16; r ++)
{
textprintf_ex(display[d], small_font, 10, 150 + r*12, -1, -1, "%i, %i", r, running_script [r]);
}
#endif
int cv;
for (cv = 0; cv < NO_CONVOYS; cv ++)
{
if (convoy[cv].active < 1)
continue;
if (convoy[cv].x < PP.x - (600 << 10) || convoy[cv].x > PP.x + (600 << 10)
|| convoy[cv].y < PP.y - (600 << 10) || convoy[cv].y > PP.y + (600 << 10))
continue;
draw_a_convoy(d, cv, p);
}
int i, a, col;
for (a = 0; a < 2; a ++)
{
for (i = 0; i < NO_SHIP_TYPES; i ++)
{
col = COL_BOX4;
if (i == SHIP_BOMBER)
col = COL_EBOX4;
textprintf_ex(display[d], small_font, 80 + a * 20, 110 + i*12, col, -1, "%i/%i", arena.srecord [0] [a] [i], arena.srecord [1] [a] [i]);
}
}
}
void draw_a_convoy(int d, int cv, int p)
{
// int turret_angle_draw;
float angle = atan2(convoy[cv].y - PP.y, convoy[cv].x - PP.x) - (PI/2) - angle_to_radians(camera_angle);
int dist = hypot(convoy[cv].y - PP.y, convoy[cv].x - PP.x);
int x = PP.camera_x + cos(angle) * (dist >> 10);
int y = PP.camera_y + sin(angle) * (dist >> 10);
int angle_draw;
angle_draw = convoy[cv].angle - camera_angle - ANGLE_4;
angle_draw &= ANGLE_MASK;
circle(display[d], x, y, 36, COL_F1 + TRANS_RED1);
pline(display[d], x + xpart(angle_draw, 30), y + ypart(angle_draw, 30),
x + xpart(angle_draw, 50), y + ypart(angle_draw, 50), COL_F1 + TRANS_RED1);
textprintf_ex(display[d], small_font, x + 50, y - 20, -1, -1, "%i %i, %i: %i", cv, (int) hypot(convoy[cv].y_speed, convoy[cv].x_speed), convoy[cv].throttle, convoy[cv].can_turn);
// textprintf_ex(display[d], font, x + 50, y - 20, -1, -1, "%i, %i, %i, %i", convoy[cv].x_speed, convoy[cv].y_speed, convoy[cv].approach_convoy, convoy[cv].throttle);
// textprintf_ex(display[d], font, x + 20, y, -1, -1, "%i, %i", convoy[cv].turning, convoy[cv].turn_count);
// textprintf_ex(display[d], font, x + 20, y, -1, -1, "%i, %i", convoy[cv].turning, convoy[cv].turn_count);
// textprintf_ex(display[d], font, x + 20, y - 20, -1, -1, "%i", (int) hypot(convoy[cv].y - convoy[cv].target_y, convoy[cv].x - convoy[cv].target_x));
// textprintf_ex(display[d], font, x, y + 20, -1, -1, "%i, %i", convoy[cv].x_speed, convoy[cv].y_speed);
angle = atan2(convoy[cv].target_y - PP.y, convoy[cv].target_x - PP.x) - (PI/2) - camera_angle_rad;
dist = hypot(convoy[cv].target_y - PP.y, convoy[cv].target_x - PP.x);
x = PP.camera_x + cos(angle) * (dist >> 10);
y = PP.camera_y + sin(angle) * (dist >> 10);
// circle(display[d], x, y, 16, COL_E5);
}
void draw_ships(int d, int p)
{
int a, e;
for (a = 0; a < NO_TEAMS; a ++)
{
for (e = 0; e < NO_SHIPS; e ++)
{
if (EE.type == SHIP_NONE
|| eclass[EE.type].ship_class == ECLASS_FIGHTER)
continue;
if (EE.x < PP.x - (700 << 10) || EE.x > PP.x + (700 << 10)
|| EE.y < PP.y - (600 << 10) || EE.y > PP.y + (600 << 10))
continue;
draw_a_ship(d, a, e, p);
}
}
for (a = 0; a < NO_TEAMS; a ++)
{
for (e = 0; e < NO_SHIPS; e ++)
{
if (EE.type == SHIP_NONE
|| eclass[EE.type].ship_class == ECLASS_WSHIP)
continue;
if (EE.x < PP.x - (700 << 10) || EE.x > PP.x + (700 << 10)
|| EE.y < PP.y - (600 << 10) || EE.y > PP.y + (600 << 10))
continue;
draw_a_ship(d, a, e, p);
}
}
}
void draw_a_ship(int d, int a, int e, int p)
{
// int turret_angle_draw;
float angle = atan2(EE.y - PP.y, EE.x - PP.x);// - (PI/2) - angle_to_radians(PP.angle);
EE.stored_angle = radians_to_angle(angle);
angle -= (PI/2) + camera_angle_rad;
int dist = hypot(EE.y - PP.y, EE.x - PP.x);
EE.stored_dist = dist;
int x = PP.camera_x + cos(angle) * (dist >> 10);
int y = PP.camera_y + sin(angle) * (dist >> 10);
// int angle_draw = ((radians_to_angle(angle) - PP.angle) >> 2) & 255;
// int angle_draw = ((EE.angle - PP.angle - ANGLE_4) >> WSHIP_ROTATION_BITSHIFT);
// int angle_draw = ((EE.angle - PP.angle) >> WSHIP_ROTATION_BITSHIFT) & WSHIP_FULL_MASK;
int sprite_angle;
int sprite_angle_flip = 0;
int angle_draw = 0;
int engine_dist;
int fsprite;
int i;
int dcol = 0;
// int xa, ya;
// int xa, ya, xb, yb;
int ldrive_size, rdrive_size;
switch(EE.type)
{
case SHIP_FIGHTER: // single-engine fighters
case SHIP_EINT:
dcol = 1;
case SHIP_FIGHTER_FRIEND:
// circle(display[d], x, y, 10, 14);
angle_draw = EE.angle - camera_angle;
angle_draw &= ANGLE_MASK;
sprite_angle = ((angle_draw) >> FIGHTER_ROTATION_BITSHIFT) & FIGHTER_FULL_MASK;
sprite_angle_flip = 0;
fsprite = EE.sprite;
// fsprite = FIGHTER_SPRITE_BASIC_1;
ldrive_size = (EE.engine [0] / 10) + 1;
rdrive_size = (EE.engine [1] / 10) + 1;
if (sprite_angle >= FIGHTER_ROTATIONS)
{
if (sprite_angle >= FIGHTER_ROTATIONS * 3)
{
sprite_angle_flip = (FIGHTER_ROTATIONS * 4) - sprite_angle - 1;
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
// draw_sprite_h_flip(display[d], FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].sprite, x - FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].x, y - FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].y);
draw_sprite_h_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->w - fighter_sprite [fsprite] [sprite_angle_flip].x [0]), y - fighter_sprite [fsprite] [sprite_angle_flip].y [0]);
//ccircle2(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y + fighter_sprite [fsprite] [sprite_angle_flip].y [1], 2 + grand(3), 0);
if (EE.engine_power > 0)
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y + fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
// draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y + fighter_sprite [fsprite] [sprite_angle_flip].y [2],
// angle_draw, 2 + ldrive_size, ldrive_size, 2, 3, 0); // LH drive
}
else
{
if (sprite_angle >= FIGHTER_ROTATIONS * 2)
{
sprite_angle_flip = sprite_angle - (FIGHTER_ROTATIONS * 2);
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
draw_sprite_vh_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->w - fighter_sprite [fsprite] [sprite_angle_flip].x [0]), y - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->h - fighter_sprite [fsprite] [sprite_angle_flip].y [0]));
// draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
// angle_draw, 2 + rdrive_size, rdrive_size, 2, 3, 0); // RH drive
if (EE.engine_power > 0)
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
else
{
sprite_angle_flip = (FIGHTER_ROTATIONS * 2) - sprite_angle - 1;
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
draw_sprite_v_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - fighter_sprite [fsprite] [sprite_angle_flip].x [0], y - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->h - fighter_sprite [fsprite] [sprite_angle_flip].y [0]));
if (EE.engine_power > 0)
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
// draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
// angle_draw, 2 + ldrive_size, ldrive_size, 2, 3, 0); // LH drive
}
}
}
else
{
sprite_angle &= FIGHTER_ROTATION_MASK;
draw_sprite(display[d], fighter_sprite [fsprite] [sprite_angle].sprite, x - fighter_sprite [fsprite] [sprite_angle].x [0], y - fighter_sprite [fsprite] [sprite_angle].y [0]);
// draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [2], y + fighter_sprite [fsprite] [sprite_angle].y [2],
// angle_draw, 2 + rdrive_size, rdrive_size, 2, 3, 0); // RH drive
if (EE.engine_power > 0)
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [1], y + fighter_sprite [fsprite] [sprite_angle].y [1],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
/*
DRIVE indexes alternate!
*/
engine_dist = EE.sprite - FIGHTER_SPRITE_BASIC_1;
/* xa = x + xpart(angle_draw + ANGLE_4, 13) + xpart(angle_draw + ANGLE_2, 7 + engine_dist);
ya = y + ypart(angle_draw + ANGLE_4, 13) + ypart(angle_draw + ANGLE_2, 7 + engine_dist);
ccircle2(d, xa, ya, 2 + grand(3), 0);
xa = x + xpart(angle_draw + ANGLE_4, 13) + xpart(angle_draw, 7 + engine_dist);
ya = y + ypart(angle_draw + ANGLE_4, 13) + ypart(angle_draw, 7 + engine_dist);
ccircle2(d, xa, ya, 2 + grand(3), 0);*/
// ccircle2(d, x + fighter_sprite [fsprite] [sprite_angle].x [1] - fighter_sprite [fsprite] [sprite_angle].x [0], y + fighter_sprite [fsprite] [sprite_angle].y [1] - fighter_sprite [fsprite] [sprite_angle].y [0], 2 + grand(3), 0);
// vline(display[d], x, 0, 480, 12);
// hline(display,[d] 0, y, 640, 12);
// line(display[0], x + xpart(EE.target_angle-PP.angle-ANGLE_4, 200), y + ypart(EE.target_angle-PP.angle-ANGLE_4, 200), x, y, COL_BOX4);
break;
case SHIP_BOMBER: // 2-engine fighters
case SHIP_ESCOUT:
dcol = 1;
// put fall-through friendly fighters here so dcol == 0
// circle(display[d], x, y, 10, 14);
// circle(display[d], x, y, 10, 14);
angle_draw = EE.angle - camera_angle;
angle_draw &= ANGLE_MASK;
sprite_angle = ((angle_draw) >> FIGHTER_ROTATION_BITSHIFT) & FIGHTER_FULL_MASK;
sprite_angle_flip = 0;
fsprite = EE.sprite;
ldrive_size = EE.engine [0] / 5;
rdrive_size = EE.engine [1] / 5;
if (sprite_angle >= FIGHTER_ROTATIONS)
{
if (sprite_angle >= FIGHTER_ROTATIONS * 3)
{
sprite_angle_flip = (FIGHTER_ROTATIONS * 4) - sprite_angle - 1;
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
// draw_sprite_h_flip(display[d], FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].sprite, x - FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].x, y - FIGHTER_sprite [FIGHTER_SPRITE_BASIC] [sprite_angle_flip].y);
draw_sprite_h_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->w - fighter_sprite [fsprite] [sprite_angle_flip].x [0]), y - fighter_sprite [fsprite] [sprite_angle_flip].y [0]);
//ccircle2(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y + fighter_sprite [fsprite] [sprite_angle_flip].y [1], 2 + grand(3), 0);
if (EE.engine_power > 0)
{
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y + fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y + fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
}
else
{
if (sprite_angle >= FIGHTER_ROTATIONS * 2)
{
sprite_angle_flip = sprite_angle - (FIGHTER_ROTATIONS * 2);
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
draw_sprite_vh_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->w - fighter_sprite [fsprite] [sprite_angle_flip].x [0]), y - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->h - fighter_sprite [fsprite] [sprite_angle_flip].y [0]));
if (EE.engine_power > 0)
{
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
draw_edrive(d, x - fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
}
else
{
sprite_angle_flip = (FIGHTER_ROTATIONS * 2) - sprite_angle - 1;
sprite_angle_flip &= FIGHTER_ROTATION_MASK;
draw_sprite_v_flip(display[d], fighter_sprite [fsprite] [sprite_angle_flip].sprite, x - fighter_sprite [fsprite] [sprite_angle_flip].x [0], y - (fighter_sprite [fsprite] [sprite_angle_flip].sprite->h - fighter_sprite [fsprite] [sprite_angle_flip].y [0]));
if (EE.engine_power > 0)
{
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [1], y - fighter_sprite [fsprite] [sprite_angle_flip].y [1],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle_flip].x [2], y - fighter_sprite [fsprite] [sprite_angle_flip].y [2],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
}
}
}
else
{
sprite_angle &= FIGHTER_ROTATION_MASK;
draw_sprite(display[d], fighter_sprite [fsprite] [sprite_angle].sprite, x - fighter_sprite [fsprite] [sprite_angle].x [0], y - fighter_sprite [fsprite] [sprite_angle].y [0]);
if (EE.engine_power > 0)
{
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [2], y + fighter_sprite [fsprite] [sprite_angle].y [2],
angle_draw, 0 + rdrive_size, rdrive_size, 2, 3, dcol); // RH drive
draw_edrive(d, x + fighter_sprite [fsprite] [sprite_angle].x [1], y + fighter_sprite [fsprite] [sprite_angle].y [1],
angle_draw, 0 + ldrive_size, ldrive_size, 2, 3, dcol); // LH drive
}
}