More-accurate PixTone.cpp variable arrangement
Also added the Linux port's optimisation, for anyone that's curious
This commit is contained in:
parent
5abf8a8878
commit
10a014dabd
1 changed files with 17 additions and 11 deletions
|
@ -6,11 +6,13 @@
|
|||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
static signed char gWaveModelTable[6][0x100];
|
||||
signed char gWaveModelTable[6][0x100];
|
||||
|
||||
void MakeWaveTables(void)
|
||||
{
|
||||
int i, a;
|
||||
int i;
|
||||
|
||||
int a;
|
||||
|
||||
// Sine wave
|
||||
for (i = 0; i < 0x100; ++i)
|
||||
|
@ -59,24 +61,28 @@ void MakeWaveTables(void)
|
|||
gWaveModelTable[5][i] = (signed char)(rand() & 0xFF) / 2;
|
||||
}
|
||||
|
||||
//BOOL wave_tables_made;
|
||||
|
||||
BOOL MakePixelWaveData(const PIXTONEPARAMETER *ptp, unsigned char *pData)
|
||||
{
|
||||
int i;
|
||||
double dEnvelope;
|
||||
int a, b, c, d;
|
||||
|
||||
double dPitch;
|
||||
double dMain;
|
||||
double dVolume;
|
||||
double d1;
|
||||
double d2;
|
||||
double d3;
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
int d;
|
||||
|
||||
double dEnvelope;
|
||||
signed char envelopeTable[0x100];
|
||||
|
||||
double d1, d2, d3;
|
||||
|
||||
// The Linux port added a cute optimisation here, where MakeWaveTables is only called once during the game's execution
|
||||
//if (wave_tables_made != TRUE)
|
||||
//{
|
||||
MakeWaveTables();
|
||||
// wave_tables_made = TRUE;
|
||||
//}
|
||||
|
||||
memset(envelopeTable, 0, sizeof(envelopeTable));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue