Skip to content

Commit 230758e

Browse files
committed
syndwarsfx: Remade research_allow_weapons_in_cryo()
Also slightly improved some functions.
1 parent 6e542d7 commit 230758e

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/fepause.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,17 +638,17 @@ TbBool pause_screen_handle(void)
638638

639639
if (affected == &startscr_samplevol)
640640
{
641-
SetSoundMasterVolume(127 * startscr_samplevol / STARTSCR_VOLUME_MAX);
641+
sfx_apply_samplevol();
642642
if (!IsSamplePlaying(0, 80, 0))
643-
play_sample_using_heap(0, 80, FULL_VOL, EQUL_PAN, NORM_PTCH, LOOP_NO, 1u);
643+
play_sample_using_heap(0, 80, FULL_VOL, EQUL_PAN, NORM_PTCH, LOOP_NO, 1);
644644
}
645645
else if (affected == &startscr_midivol)
646646
{
647-
SetMusicMasterVolume(127 * startscr_midivol / STARTSCR_VOLUME_MAX);
647+
sfx_apply_midivol();
648648
}
649649
else if (affected == &startscr_cdvolume)
650650
{
651-
SetCDVolume(70 * (127 * startscr_cdvolume / STARTSCR_VOLUME_MAX) / 100);
651+
sfx_apply_cdvolume();
652652
}
653653
else if (affected == &ingame.DetailLevel)
654654
{

src/feresearch.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "guitext.h"
3636
#include "keyboard.h"
3737
#include "purpldrw.h"
38+
#include "player.h"
3839
#include "weapon.h"
3940
#include "research.h"
4041
#include "swlog.h"
@@ -89,8 +90,21 @@ TbBool research_cybmod_daily_progress(void)
8990
*/
9091
void research_allow_weapons_in_cryo(void)
9192
{
93+
#if 0
9294
asm volatile ("call ASM_research_allow_weapons_in_cryo\n"
9395
: : : "eax" );
96+
#endif
97+
short plagent;
98+
WeaponType wtype;
99+
100+
for (plagent = 0; plagent < AGENTS_SQUAD_MAX_COUNT; plagent++)
101+
{
102+
for (wtype = WEP_NULL + 1; wtype < WEP_TYPES_COUNT; wtype++)
103+
{
104+
if (weapons_has_weapon(cryo_agents.Weapons[plagent], wtype) && !is_research_weapon_completed(wtype))
105+
research_weapon_allow(wtype);
106+
}
107+
}
94108
}
95109

96110
void forward_research_progress_after_mission(int num_days)

src/hud_panel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ int count_weapons_in_flags(int *p_ncarr_below, int *p_ncarr_above, ulong weapons
788788
ncarr_below = 0;
789789
wepflags = weapons_carried;
790790

791-
for (nwtype = 1; nwtype < WEP_TYPES_COUNT; nwtype++, wepflags >>= 1)
791+
for (nwtype = WEP_NULL + 1; nwtype < WEP_TYPES_COUNT; nwtype++, wepflags >>= 1)
792792
{
793793
if (wepflags == 0)
794794
break;

0 commit comments

Comments
 (0)