7
7
#include "game/health.h"
8
8
#include "specific/game.h"
9
9
#include "specific/output.h"
10
+ #include "mod.h"
10
11
#include "util.h"
11
12
12
13
int32_t __cdecl DrawPhaseCinematic ()
@@ -656,18 +657,7 @@ void __cdecl DrawLara(ITEM_INFO* item)
656
657
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_R ], clip );
657
658
658
659
if (Lara .right_arm .flash_gun ) {
659
- saved_matrix ._00 = PhdMatrixPtr -> _00 ;
660
- saved_matrix ._01 = PhdMatrixPtr -> _01 ;
661
- saved_matrix ._02 = PhdMatrixPtr -> _02 ;
662
- saved_matrix ._03 = PhdMatrixPtr -> _03 ;
663
- saved_matrix ._10 = PhdMatrixPtr -> _10 ;
664
- saved_matrix ._11 = PhdMatrixPtr -> _11 ;
665
- saved_matrix ._12 = PhdMatrixPtr -> _12 ;
666
- saved_matrix ._13 = PhdMatrixPtr -> _13 ;
667
- saved_matrix ._20 = PhdMatrixPtr -> _20 ;
668
- saved_matrix ._21 = PhdMatrixPtr -> _21 ;
669
- saved_matrix ._22 = PhdMatrixPtr -> _22 ;
670
- saved_matrix ._23 = PhdMatrixPtr -> _23 ;
660
+ saved_matrix = * PhdMatrixPtr ;
671
661
}
672
662
673
663
phd_PopMatrix ();
@@ -705,18 +695,7 @@ void __cdecl DrawLara(ITEM_INFO* item)
705
695
DrawGunFlash (fire_arms , clip );
706
696
}
707
697
if (Lara .right_arm .flash_gun ) {
708
- PhdMatrixPtr -> _00 = saved_matrix ._00 ;
709
- PhdMatrixPtr -> _01 = saved_matrix ._01 ;
710
- PhdMatrixPtr -> _02 = saved_matrix ._02 ;
711
- PhdMatrixPtr -> _03 = saved_matrix ._03 ;
712
- PhdMatrixPtr -> _10 = saved_matrix ._10 ;
713
- PhdMatrixPtr -> _11 = saved_matrix ._11 ;
714
- PhdMatrixPtr -> _12 = saved_matrix ._12 ;
715
- PhdMatrixPtr -> _13 = saved_matrix ._13 ;
716
- PhdMatrixPtr -> _20 = saved_matrix ._20 ;
717
- PhdMatrixPtr -> _21 = saved_matrix ._21 ;
718
- PhdMatrixPtr -> _22 = saved_matrix ._22 ;
719
- PhdMatrixPtr -> _23 = saved_matrix ._23 ;
698
+ * PhdMatrixPtr = saved_matrix ;
720
699
DrawGunFlash (fire_arms , clip );
721
700
}
722
701
@@ -740,6 +719,10 @@ void __cdecl DrawLara(ITEM_INFO* item)
740
719
phd_RotYXZpack (packed_rotation [LM_HAND_R ]);
741
720
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_R ], clip );
742
721
722
+ if (Tomb1MConfig .enable_shotgun_flash && Lara .right_arm .flash_gun ) {
723
+ saved_matrix = * PhdMatrixPtr ;
724
+ }
725
+
743
726
phd_PopMatrix ();
744
727
745
728
phd_PushMatrix ();
@@ -758,6 +741,11 @@ void __cdecl DrawLara(ITEM_INFO* item)
758
741
phd_RotYXZpack (packed_rotation [LM_HAND_L ]);
759
742
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_L ], clip );
760
743
744
+ if (Tomb1MConfig .enable_shotgun_flash && Lara .right_arm .flash_gun ) {
745
+ * PhdMatrixPtr = saved_matrix ;
746
+ DrawGunFlash (fire_arms , clip );
747
+ }
748
+
761
749
phd_PopMatrix ();
762
750
break ;
763
751
}
@@ -772,27 +760,37 @@ void __cdecl DrawLara(ITEM_INFO* item)
772
760
773
761
void __cdecl DrawGunFlash (int32_t weapon_type , int32_t clip )
774
762
{
775
- int light ;
776
- int g_len ;
763
+ int32_t light ;
764
+ int32_t len ;
765
+ int32_t off ;
777
766
778
767
switch (weapon_type ) {
779
768
case LGT_MAGNUMS :
780
769
light = 16 * 256 ;
781
- g_len = 155 ;
770
+ len = 155 ;
771
+ off = 55 ;
782
772
break ;
783
773
784
774
case LGT_UZIS :
785
775
light = 10 * 256 ;
786
- g_len = 180 ;
776
+ len = 180 ;
777
+ off = 55 ;
787
778
break ;
788
779
789
780
default :
790
781
light = 20 * 256 ;
791
- g_len = 155 ;
782
+ len = 155 ;
783
+ off = 55 ;
792
784
break ;
793
785
}
794
786
795
- phd_TranslateRel (0 , g_len , 55 );
787
+ if (Tomb1MConfig .enable_shotgun_flash && weapon_type == LGT_SHOTGUN ) {
788
+ light = 10 * 256 ;
789
+ len = 285 ;
790
+ off = 0 ;
791
+ }
792
+
793
+ phd_TranslateRel (0 , len , off );
796
794
phd_RotYXZ (0 , -90 * ONE_DEGREE , (PHD_ANGLE )(GetRandomDraw () * 2 ));
797
795
S_CalculateStaticLight (light );
798
796
phd_PutPolygons (Meshes [Objects [O_GUN_FLASH ].mesh_index ], clip );
@@ -980,18 +978,7 @@ void __cdecl DrawLaraInt(
980
978
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_R ], clip );
981
979
982
980
if (Lara .right_arm .flash_gun ) {
983
- saved_matrix ._00 = PhdMatrixPtr -> _00 ;
984
- saved_matrix ._01 = PhdMatrixPtr -> _01 ;
985
- saved_matrix ._02 = PhdMatrixPtr -> _02 ;
986
- saved_matrix ._03 = PhdMatrixPtr -> _03 ;
987
- saved_matrix ._10 = PhdMatrixPtr -> _10 ;
988
- saved_matrix ._11 = PhdMatrixPtr -> _11 ;
989
- saved_matrix ._12 = PhdMatrixPtr -> _12 ;
990
- saved_matrix ._13 = PhdMatrixPtr -> _13 ;
991
- saved_matrix ._20 = PhdMatrixPtr -> _20 ;
992
- saved_matrix ._21 = PhdMatrixPtr -> _21 ;
993
- saved_matrix ._22 = PhdMatrixPtr -> _22 ;
994
- saved_matrix ._23 = PhdMatrixPtr -> _23 ;
981
+ saved_matrix = * PhdMatrixPtr ;
995
982
}
996
983
997
984
phd_PopMatrix_I ();
@@ -1021,18 +1008,7 @@ void __cdecl DrawLaraInt(
1021
1008
}
1022
1009
1023
1010
if (Lara .right_arm .flash_gun ) {
1024
- PhdMatrixPtr -> _00 = saved_matrix ._00 ;
1025
- PhdMatrixPtr -> _01 = saved_matrix ._01 ;
1026
- PhdMatrixPtr -> _02 = saved_matrix ._02 ;
1027
- PhdMatrixPtr -> _03 = saved_matrix ._03 ;
1028
- PhdMatrixPtr -> _10 = saved_matrix ._10 ;
1029
- PhdMatrixPtr -> _11 = saved_matrix ._11 ;
1030
- PhdMatrixPtr -> _12 = saved_matrix ._12 ;
1031
- PhdMatrixPtr -> _13 = saved_matrix ._13 ;
1032
- PhdMatrixPtr -> _20 = saved_matrix ._20 ;
1033
- PhdMatrixPtr -> _21 = saved_matrix ._21 ;
1034
- PhdMatrixPtr -> _22 = saved_matrix ._22 ;
1035
- PhdMatrixPtr -> _23 = saved_matrix ._23 ;
1011
+ * PhdMatrixPtr = saved_matrix ;
1036
1012
DrawGunFlash (fire_arms , clip );
1037
1013
}
1038
1014
@@ -1057,6 +1033,10 @@ void __cdecl DrawLaraInt(
1057
1033
phd_RotYXZpack (packed_rotation1 [LM_HAND_R ]);
1058
1034
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_R ], clip );
1059
1035
1036
+ if (Tomb1MConfig .enable_shotgun_flash && Lara .right_arm .flash_gun ) {
1037
+ saved_matrix = * PhdMatrixPtr ;
1038
+ }
1039
+
1060
1040
phd_PopMatrix ();
1061
1041
1062
1042
phd_PushMatrix ();
@@ -1075,6 +1055,11 @@ void __cdecl DrawLaraInt(
1075
1055
phd_RotYXZpack (packed_rotation1 [LM_HAND_L ]);
1076
1056
phd_PutPolygons (Lara .mesh_ptrs [LM_HAND_L ], clip );
1077
1057
1058
+ if (Tomb1MConfig .enable_shotgun_flash && Lara .right_arm .flash_gun ) {
1059
+ * PhdMatrixPtr = saved_matrix ;
1060
+ DrawGunFlash (fire_arms , clip );
1061
+ }
1062
+
1078
1063
phd_PopMatrix_I ();
1079
1064
break ;
1080
1065
}
0 commit comments