Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions src/SB/Game/zCombo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "xTextAsset.h"
#include "zGlobals.h"
#include "zTextBox.h"
#include "zUIFont.h"

extern const char zCombo_Strings[];
extern const F32 zCombo_float_zero;
Expand All @@ -29,19 +30,23 @@ struct widget_chunk : xBase
xhud::text_widget w;
};

extern widget_chunk* comboHUD;
/* .bss */
static xVec3 sUnderCamPos;
static xtextbox * sHideText[5];

extern zComboReward comboReward[16];

extern S32 zCombo_int32_1; // probably comboPending
extern S32 zCombo_int32_2; // probably comboLastCounter
extern S32 zCombo_int32_3; // probably comboCounter
/* .sbss */
static widget_chunk* comboHUD;
static zUIFont* sHideUIF[1];
static S32 comboPending;
static S32 comboLastCounter;
static S32 comboCounter;
static F32 comboTimer;

extern F32 zCombo_float32_1; // probably comboMaxTime
extern F32 zCombo_float32_3; // probably comboTimer
/* .sdata */
static F32 comboMaxTime = 1.0f;
static F32 comboDisplayTime = 2.0f;

extern xBase* sHideText[5];
extern xBase* sHideUIF[1];
extern zComboReward comboReward[16];

void fillCombo(zComboReward* reward)
{
Expand Down Expand Up @@ -80,6 +85,23 @@ void fillCombo(zComboReward* reward)
reward->rewardNum = j;
}

void zCombo_Add(S32 arg0)
{
if (comboTimer < 0.0f)
{
comboTimer = comboMaxTime;
comboPending = arg0 - 1;
return;
}
comboTimer = comboMaxTime;
comboCounter += arg0;
if ((S32) comboPending != 0)
{
comboCounter += comboPending;
comboPending = 0;
}
}

#if 0
// Can't get the floating point instructions to go in the right order
// the zCombo_float32_3 = zCombo_float_minusone always gets lifted to the
Expand Down