Documented -DREGULAR_EDITION
Disabled the sound printfs for now.
This commit is contained in:
parent
47dfa780d5
commit
ea23e5a1bb
5 changed files with 37 additions and 27 deletions
3
README
3
README
|
@ -43,6 +43,9 @@ can just use unzip to extract the files from the .exe), add -DALIEN_DEMO to
|
||||||
CFLAGS (the one that's uncommented). Rename all game files lowercase.
|
CFLAGS (the one that's uncommented). Rename all game files lowercase.
|
||||||
Be sure to install the latest OpenAL (http://www.openal.org) CVS.
|
Be sure to install the latest OpenAL (http://www.openal.org) CVS.
|
||||||
|
|
||||||
|
If you have the regular edition, add -DREGULAR_EDITION to CFLAGS.
|
||||||
|
|
||||||
|
|
||||||
relnev:~/avp/AvP Demo 3 - Alien$ ls
|
relnev:~/avp/AvP Demo 3 - Alien$ ls
|
||||||
aenglish.txt alienavp_huds/ alienfastfile/ avp_rifs/
|
aenglish.txt alienavp_huds/ alienfastfile/ avp_rifs/
|
||||||
relnev:~/avp/Gold Edition$ ls
|
relnev:~/avp/Gold Edition$ ls
|
||||||
|
|
|
@ -511,8 +511,10 @@ void Sound_Play(SOUNDINDEX soundNumber, char *format, ...)
|
||||||
if(loop) ActiveSounds[newIndex].loop = 1;
|
if(loop) ActiveSounds[newIndex].loop = 1;
|
||||||
else ActiveSounds[newIndex].loop = 0;
|
else ActiveSounds[newIndex].loop = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
printf("Play: new = %d. num = %d, p = %d, v = %d, pi = %d, l = %d, mi = %d, rev = %d\n", newIndex, soundNumber, priority, volume, pitch, loop, marine_ignore, reverb_off);
|
printf("Play: new = %d. num = %d, p = %d, v = %d, pi = %d, l = %d, mi = %d, rev = %d\n", newIndex, soundNumber, priority, volume, pitch, loop, marine_ignore, reverb_off);
|
||||||
printf("Play: %d %d %s l:%d\n", newIndex, soundNumber, GameSounds[soundNumber].wavName, loop);
|
printf("Play: %d %d %s l:%d\n", newIndex, soundNumber, GameSounds[soundNumber].wavName, loop);
|
||||||
|
*/
|
||||||
|
|
||||||
if(worldPosn)
|
if(worldPosn)
|
||||||
{
|
{
|
||||||
|
@ -588,9 +590,9 @@ void Sound_Stop(int activeSoundNumber)
|
||||||
/* stop the sound: it may have already stopped, of course, but never mind */
|
/* stop the sound: it may have already stopped, of course, but never mind */
|
||||||
|
|
||||||
PlatStopSound(activeSoundNumber);
|
PlatStopSound(activeSoundNumber);
|
||||||
|
/*
|
||||||
printf("Stop: %d %d %s\n", activeSoundNumber, soundNo, GameSounds[soundNo].wavName);
|
printf("Stop: %d %d %s\n", activeSoundNumber, soundNo, GameSounds[soundNo].wavName);
|
||||||
|
*/
|
||||||
/* release the active sound slot */
|
/* release the active sound slot */
|
||||||
buf = ActiveSounds[activeSoundNumber].ds3DBufferP;
|
buf = ActiveSounds[activeSoundNumber].ds3DBufferP;
|
||||||
ActiveSounds[activeSoundNumber] = BlankActiveSound;
|
ActiveSounds[activeSoundNumber] = BlankActiveSound;
|
||||||
|
|
|
@ -574,7 +574,7 @@ void InitNPCs(RIFFHANDLE h)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* i believe this was added for the gold edition */
|
/* i believe this was added for the gold edition */
|
||||||
#if !(PREDATOR_DEMO||MARINE_DEMO||ALIEN_DEMO)//||REGULAR_EDITION /* TODO */
|
#if !(PREDATOR_DEMO||MARINE_DEMO||ALIEN_DEMO||REGULAR_EDITION)
|
||||||
if(AvP.PlayerType==I_Marine || Load_HNPC[HNPC_Marine])
|
if(AvP.PlayerType==I_Marine || Load_HNPC[HNPC_Marine])
|
||||||
{
|
{
|
||||||
//need to load the mdisk hierarchy
|
//need to load the mdisk hierarchy
|
||||||
|
|
43
src/openal.c
43
src/openal.c
|
@ -413,11 +413,15 @@ int PlatPlaySound(int activeIndex)
|
||||||
alSourcePlay (ActiveSounds[activeIndex].ds3DBufferP);
|
alSourcePlay (ActiveSounds[activeIndex].ds3DBufferP);
|
||||||
|
|
||||||
if (ActiveSounds[activeIndex].loop) {
|
if (ActiveSounds[activeIndex].loop) {
|
||||||
|
/*
|
||||||
printf("Playing sound %i %s looping in slot %i\n",
|
printf("Playing sound %i %s looping in slot %i\n",
|
||||||
si, GameSounds[si].wavName, activeIndex);
|
si, GameSounds[si].wavName, activeIndex);
|
||||||
|
*/
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
printf("Playing sound %i %s once in slot %i\n",
|
printf("Playing sound %i %s once in slot %i\n",
|
||||||
si, GameSounds[si].wavName, activeIndex);
|
si, GameSounds[si].wavName, activeIndex);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +430,7 @@ int PlatPlaySound(int activeIndex)
|
||||||
|
|
||||||
void PlatStopSound(int activeIndex)
|
void PlatStopSound(int activeIndex)
|
||||||
{
|
{
|
||||||
printf("PlatStopSound(%d)\n", activeIndex);
|
/* printf("PlatStopSound(%d)\n", activeIndex); */
|
||||||
|
|
||||||
// if (ActiveSounds[activeIndex].paused)
|
// if (ActiveSounds[activeIndex].paused)
|
||||||
// alSourcePause (ActiveSounds[activeIndex].ds3DBufferP);
|
// alSourcePause (ActiveSounds[activeIndex].ds3DBufferP);
|
||||||
|
@ -490,18 +494,18 @@ int PlatChangeSoundPitch(int activeIndex, int pitch)
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveSounds[activeIndex].pitch = pitch;
|
ActiveSounds[activeIndex].pitch = pitch;
|
||||||
|
/*
|
||||||
printf("NEWFREQ PlatChangeSoundPitch(%d, %d) = %f\n", activeIndex, pitch, (double)frequency / (double)GameSounds[ActiveSounds[activeIndex].soundIndex].dsFrequency);
|
printf("NEWFREQ PlatChangeSoundPitch(%d, %d) = %f\n", activeIndex, pitch, (double)frequency / (double)GameSounds[ActiveSounds[activeIndex].soundIndex].dsFrequency);
|
||||||
|
*/
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PlatSoundHasStopped(int activeIndex)
|
int PlatSoundHasStopped(int activeIndex)
|
||||||
{
|
{
|
||||||
ALint val;
|
ALint val;
|
||||||
|
/*
|
||||||
printf("PlatSoundHasStopped(%d)\n", activeIndex);
|
printf("PlatSoundHasStopped(%d)\n", activeIndex);
|
||||||
|
*/
|
||||||
alGetSourceiv (ActiveSounds[activeIndex].ds3DBufferP,
|
alGetSourceiv (ActiveSounds[activeIndex].ds3DBufferP,
|
||||||
AL_SOURCE_STATE, &val);
|
AL_SOURCE_STATE, &val);
|
||||||
|
|
||||||
|
@ -577,9 +581,9 @@ int PlatDo3dSound(int activeIndex)
|
||||||
newVolume = VOLUME_MAX;
|
newVolume = VOLUME_MAX;
|
||||||
if (newVolume < VOLUME_MIN)
|
if (newVolume < VOLUME_MIN)
|
||||||
newVolume = VOLUME_MIN;
|
newVolume = VOLUME_MIN;
|
||||||
|
/*
|
||||||
printf("PlatDo3dSound: idx = %d, volume = %d, distance = %d\n", activeIndex, newVolume, distance);
|
printf("PlatDo3dSound: idx = %d, volume = %d, distance = %d\n", activeIndex, newVolume, distance);
|
||||||
|
*/
|
||||||
if (PlatChangeSoundVolume (activeIndex, newVolume) == SOUND_PLATFORMERROR) {
|
if (PlatChangeSoundVolume (activeIndex, newVolume) == SOUND_PLATFORMERROR) {
|
||||||
return SOUND_PLATFORMERROR;
|
return SOUND_PLATFORMERROR;
|
||||||
}
|
}
|
||||||
|
@ -595,8 +599,9 @@ int PlatDo3dSound(int activeIndex)
|
||||||
ActiveSounds[activeIndex].PropSetP_pos[2] = (ALfloat)relativePosn.vz / (ALfloat)distance;
|
ActiveSounds[activeIndex].PropSetP_pos[2] = (ALfloat)relativePosn.vz / (ALfloat)distance;
|
||||||
|
|
||||||
alSourcefv (ActiveSounds[activeIndex].ds3DBufferP, AL_POSITION, ActiveSounds[activeIndex].PropSetP_pos);
|
alSourcefv (ActiveSounds[activeIndex].ds3DBufferP, AL_POSITION, ActiveSounds[activeIndex].PropSetP_pos);
|
||||||
|
/*
|
||||||
printf("Sound : (%f, %f, %f) [%d] [%d,%d]\n", ActiveSounds[activeIndex].PropSetP_pos[0], ActiveSounds[activeIndex].PropSetP_pos[1], ActiveSounds[activeIndex].PropSetP_pos[2], activeIndex, ActiveSounds[activeIndex].threedeedata.inner_range, ActiveSounds[activeIndex].threedeedata.outer_range);
|
printf("Sound : (%f, %f, %f) [%d] [%d,%d]\n", ActiveSounds[activeIndex].PropSetP_pos[0], ActiveSounds[activeIndex].PropSetP_pos[1], ActiveSounds[activeIndex].PropSetP_pos[2], activeIndex, ActiveSounds[activeIndex].threedeedata.inner_range, ActiveSounds[activeIndex].threedeedata.outer_range);
|
||||||
|
*/
|
||||||
ActiveSounds[activeIndex].PropSetP_vel[0] =
|
ActiveSounds[activeIndex].PropSetP_vel[0] =
|
||||||
ActiveSounds[activeIndex].threedeedata.velocity.vx;
|
ActiveSounds[activeIndex].threedeedata.velocity.vx;
|
||||||
ActiveSounds[activeIndex].PropSetP_vel[1] =
|
ActiveSounds[activeIndex].PropSetP_vel[1] =
|
||||||
|
@ -652,9 +657,9 @@ void PlatUpdatePlayer()
|
||||||
pos[1] = Global_VDB_Ptr->VDB_World.vy; // 10000.0;
|
pos[1] = Global_VDB_Ptr->VDB_World.vy; // 10000.0;
|
||||||
pos[2] = Global_VDB_Ptr->VDB_World.vz; // 10000.0;
|
pos[2] = Global_VDB_Ptr->VDB_World.vz; // 10000.0;
|
||||||
|
|
||||||
|
/*
|
||||||
printf("Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5]);
|
printf("Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5]);
|
||||||
|
*/
|
||||||
// fixme: add reverb check
|
// fixme: add reverb check
|
||||||
alListenerfv (AL_ORIENTATION, or);
|
alListenerfv (AL_ORIENTATION, or);
|
||||||
// alListenerfv (AL_VELOCITY, vel);
|
// alListenerfv (AL_VELOCITY, vel);
|
||||||
|
@ -728,7 +733,7 @@ void UpdateSoundFrequencies()
|
||||||
extern int TimeScale;
|
extern int TimeScale;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("FREQ UpdateSoundFreqncies()\n");
|
/* printf("FREQ UpdateSoundFreqncies()\n"); */
|
||||||
|
|
||||||
if (!SoundSwitchedOn)
|
if (!SoundSwitchedOn)
|
||||||
return;
|
return;
|
||||||
|
@ -738,10 +743,10 @@ void UpdateSoundFrequencies()
|
||||||
|
|
||||||
if (gameIndex == SID_NOSOUND)
|
if (gameIndex == SID_NOSOUND)
|
||||||
continue;
|
continue;
|
||||||
|
/*
|
||||||
if (TimeScale != ONE_FIXED)
|
if (TimeScale != ONE_FIXED)
|
||||||
printf("NEWFREQ UpdateSoundFreqncies %d, f = %d\n", i, MUL_FIXED(GameSounds[gameIndex].dsFrequency,TimeScale));
|
printf("NEWFREQ UpdateSoundFreqncies %d, f = %d\n", i, MUL_FIXED(GameSounds[gameIndex].dsFrequency,TimeScale));
|
||||||
|
*/
|
||||||
/* TODO: huh? */
|
/* TODO: huh? */
|
||||||
if (ActiveSounds[i].pitch != GameSounds[gameIndex].pitch)
|
if (ActiveSounds[i].pitch != GameSounds[gameIndex].pitch)
|
||||||
PlatChangeSoundPitch(i,ActiveSounds[i].pitch);
|
PlatChangeSoundPitch(i,ActiveSounds[i].pitch);
|
||||||
|
@ -758,9 +763,9 @@ int LoadWavFile(int soundNum, char * wavFileName)
|
||||||
ALsizei size, freq, bits;
|
ALsizei size, freq, bits;
|
||||||
ALenum format;
|
ALenum format;
|
||||||
ALvoid *data;
|
ALvoid *data;
|
||||||
|
/*
|
||||||
printf("LoadWavFile(%d, %s) - sound\n", soundNum, wavFileName);
|
printf("LoadWavFile(%d, %s) - sound\n", soundNum, wavFileName);
|
||||||
|
*/
|
||||||
alutLoadWAV (wavFileName, &data, &format, &size, &bits, &freq);
|
alutLoadWAV (wavFileName, &data, &format, &size, &bits, &freq);
|
||||||
alGenBuffers (1, &(GameSounds[soundNum].dsBufferP));
|
alGenBuffers (1, &(GameSounds[soundNum].dsBufferP));
|
||||||
alBufferData (GameSounds[soundNum].dsBufferP, format, data, size, freq);
|
alBufferData (GameSounds[soundNum].dsBufferP, format, data, size, freq);
|
||||||
|
@ -797,15 +802,15 @@ unsigned char *ExtractWavFile(int soundIndex, unsigned char *bufferPtr)
|
||||||
ALuint rsize;
|
ALuint rsize;
|
||||||
int slen;
|
int slen;
|
||||||
|
|
||||||
printf("ExtractWavFile(%d, %p)\n", soundIndex, bufferPtr);
|
/* printf("ExtractWavFile(%d, %p)\n", soundIndex, bufferPtr); */
|
||||||
|
|
||||||
slen = strlen (bufferPtr) + 1;
|
slen = strlen (bufferPtr) + 1;
|
||||||
GameSounds[soundIndex].wavName = (char *)AllocateMem (slen);
|
GameSounds[soundIndex].wavName = (char *)AllocateMem (slen);
|
||||||
strcpy (GameSounds[soundIndex].wavName, bufferPtr);
|
strcpy (GameSounds[soundIndex].wavName, bufferPtr);
|
||||||
bufferPtr += slen;
|
bufferPtr += slen;
|
||||||
|
/*
|
||||||
printf("Loaded %s\n", GameSounds[soundIndex].wavName);
|
printf("Loaded %s\n", GameSounds[soundIndex].wavName);
|
||||||
|
*/
|
||||||
#if 1 /* TODO: replace with own routine later */
|
#if 1 /* TODO: replace with own routine later */
|
||||||
if (acLoadWAV (bufferPtr, &rsize, &udata, &rfmt,
|
if (acLoadWAV (bufferPtr, &rsize, &udata, &rfmt,
|
||||||
&rchan, &rfreq) == NULL) {
|
&rchan, &rfreq) == NULL) {
|
||||||
|
@ -866,7 +871,7 @@ int LoadWavFromFastFile(int soundNum, char * wavFileName)
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned int len = 0;
|
unsigned int len = 0;
|
||||||
|
|
||||||
printf("LoadWavFromFastFile(%d, %s)\n", soundNum, wavFileName);
|
/* printf("LoadWavFromFastFile(%d, %s)\n", soundNum, wavFileName); */
|
||||||
|
|
||||||
if ((fp = ffopen (wavFileName, "rb")) != NULL) {
|
if ((fp = ffopen (wavFileName, "rb")) != NULL) {
|
||||||
ffseek (fp, 0, SEEK_END);
|
ffseek (fp, 0, SEEK_END);
|
||||||
|
|
10
src/stubs.c
10
src/stubs.c
|
@ -296,20 +296,20 @@ void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* outpu
|
||||||
|
|
||||||
void RenderKeyConfigRectangle(int alpha)
|
void RenderKeyConfigRectangle(int alpha)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
void Hardware_RenderKeyConfigRectangle(int alpha);
|
void Hardware_RenderKeyConfigRectangle(int alpha);
|
||||||
Hardware_RenderKeyConfigRectangle(alpha);
|
Hardware_RenderKeyConfigRectangle(alpha);
|
||||||
*/
|
/*
|
||||||
fprintf(stderr, "RenderKeyConfigRectangle(%d)\n", alpha);
|
fprintf(stderr, "RenderKeyConfigRectangle(%d)\n", alpha);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderHighlightRectangle(int x1,int y1,int x2,int y2, int r, int g, int b)
|
void RenderHighlightRectangle(int x1,int y1,int x2,int y2, int r, int g, int b)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b);
|
void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b);
|
||||||
Hardware_RenderHighlightRectangle(x1, y1, x2, y2, r, g, b);
|
Hardware_RenderHighlightRectangle(x1, y1, x2, y2, r, g, b);
|
||||||
*/
|
/*
|
||||||
fprintf(stderr, "RenderHighlightRectangle(%d, %d, %d, %d, %d, %d, %d)\n", x1, y1, x2, y2, r, g, b);
|
fprintf(stderr, "RenderHighlightRectangle(%d, %d, %d, %d, %d, %d, %d)\n", x1, y1, x2, y2, r, g, b);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
int LengthOfMenuText(char *textPtr)
|
int LengthOfMenuText(char *textPtr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue