This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
#include "Terrain.h"
#include "Skybox.h"
#include "Skeleton.h"
-#include "Models.h"
+#include "Models.h"
#include "Lights.h"
#include "Person.h"
#include "Constants.h"
extern GLuint rabbittexture;
-class Game
+class Game
{
public:
int musicselected;
int change;
Game();
- ~Game() {
+ ~Game() {
for(int i=0;i<10;i++){
if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] );
}
if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound;
if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound;
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE);
+ PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
FSOUND_SetVolume(channels[whichsoundplay], 256);
- FSOUND_SetPaused(channels[whichsoundplay], FALSE);
+ FSOUND_SetPaused(channels[whichsoundplay], false);
}
}
}
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "Game.h"
+#include "Game.h"
extern float screenwidth,screenheight;
extern float viewdistance;
extern XYZ viewer;
extern FSOUND_STREAM * strm[20];
-extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
Game::TextureList Game::textures;
FSOUND_3D_SetDopplerFactor(0);
FSOUND_SetSFXMasterVolume((int)(volume*255));
-
+
samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
samp[landsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f);
samp[jumpsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:jump.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f);
samp[hawksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:hawk.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f);
samp[whooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:whoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f);
FSOUND_Sample_SetMode(samp[whooshsound], FSOUND_LOOP_NORMAL);
samp[landsound1] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f);
samp[landsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f);
samp[breaksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:broken.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f);
samp[lowwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Lowwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f);
samp[midwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:midwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f);
samp[highwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:highwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f);
samp[movewhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:movewhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f);
samp[heavyimpactsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:heavyimpact.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f);
samp[whooshhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Whooshhit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f);
samp[thudsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:thud.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f);
samp[alarmsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:alarm.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f);
samp[breaksound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:break.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f);
samp[knifedrawsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifedraw.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
FSOUND_Sample_SetMinMaxDistance(samp[knifedrawsound], 8.0f, 2000.0f);
FSOUND_Sample_SetMinMaxDistance(samp[snowskidsound], 8.0f, 2000.0f);
samp[bushrustle] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bushrustle.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f);
samp[clank1sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
FSOUND_Sample_SetMinMaxDistance(samp[clank1sound], 8.0f, 2000.0f);
FSOUND_Sample_SetMinMaxDistance(samp[clank4sound], 8.0f, 2000.0f);
samp[consolesuccesssound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolesuccess.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f);
samp[consolefailsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolefail.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f);
samp[metalhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:MetalHit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
FSOUND_Sample_SetMinMaxDistance(samp[metalhitsound], 8.0f, 2000.0f);
unsigned char fileNamep[256];
CopyCStringToPascal(fileName,fileNamep);
//Load Image
- upload_image( fileNamep ,hasalpha);
+ upload_image( fileNamep ,hasalpha);
// std::string fname(fileName);
// std::transform(fname.begin(), fname.end(), tolower);
unsigned char fileNamep[256];
CopyCStringToPascal(fileName,fileNamep);
//Load Image
- upload_image( fileNamep ,0);
- //LoadTGA( fileName );
+ upload_image( fileNamep ,0);
+ //LoadTGA( fileName );
// std::string fname(fileName);
// std::transform(fname.begin(), fname.end(), tolower);
//Load Image
float temptexdetail=texdetail;
texdetail=1;
- //upload_image( fileName );
- //LoadTGA( fileName );
+ //upload_image( fileName );
+ //LoadTGA( fileName );
//Load Image
unsigned char fileNamep[256];
CopyCStringToPascal(fileName,fileNamep);
//Load Image
- upload_image( fileNamep ,0);
+ upload_image( fileNamep ,0);
texdetail=temptexdetail;
//Is it valid?
LOGFUNC;
- //upload_image( fileName );
- //LoadTGA( fileName );
+ //upload_image( fileName );
+ //LoadTGA( fileName );
//Load Image
unsigned char fileNamep[256];
CopyCStringToPascal(fileName,fileNamep);
//Load Image
bool opened;
- opened=upload_image( fileNamep ,1);
+ opened=upload_image( fileNamep ,1);
float alphanum;
//Is it valid?
gluPerspective(fov,(GLfloat)screenwidth/(GLfloat)screenheight,pnear,viewdistance);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
}
-void Game::LoadingScreen()
+void Game::LoadingScreen()
{
static float loadprogress,minprogress,maxprogress;
static AbsoluteTime time = {0,0};
//glScalef(.25,.25,.25);
glBegin(GL_QUADS);
glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3);
- glVertex3f(-1, -1, 0.0f);
+ glVertex3f(-1, -1, 0.0f);
glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3);
- glVertex3f(1, -1, 0.0f);
+ glVertex3f(1, -1, 0.0f);
glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3);
glVertex3f(1, 1, 0.0f);
glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3);
- glVertex3f(-1, 1, 0.0f);
+ glVertex3f(-1, 1, 0.0f);
glEnd();
glPopMatrix();
glEnable(GL_BLEND);
//glScalef(.25,.25,.25);
glBegin(GL_QUADS);
glTexCoord2f(.4+loadprogress/100,0+loadprogress/100);
- glVertex3f(-1, -1, 0.0f);
+ glVertex3f(-1, -1, 0.0f);
glTexCoord2f(.4+loadprogress/100,0+loadprogress/100);
- glVertex3f(1, -1, 0.0f);
+ glVertex3f(1, -1, 0.0f);
glTexCoord2f(.4+loadprogress/100,1+loadprogress/100);
glVertex3f(1, 1, 0.0f);
glTexCoord2f(.4+loadprogress/100,1+loadprogress/100);
- glVertex3f(-1, 1, 0.0f);
+ glVertex3f(-1, 1, 0.0f);
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_2D);
//glScalef(.25,.25,.25);
glBegin(GL_QUADS);
glTexCoord2f(0+.5,0+.5);
- glVertex3f(-1, -1, 0.0f);
+ glVertex3f(-1, -1, 0.0f);
glTexCoord2f(1+.5,0+.5);
- glVertex3f(1, -1, 0.0f);
+ glVertex3f(1, -1, 0.0f);
glTexCoord2f(1+.5,1+.5);
glVertex3f(1, 1, 0.0f);
glTexCoord2f(0+.5,1+.5);
- glVertex3f(-1, 1, 0.0f);
+ glVertex3f(-1, 1, 0.0f);
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_2D);
//glScalef(.25,.25,.25);
glBegin(GL_QUADS);
glTexCoord2f(0+.2,0+.8);
- glVertex3f(-1, -1, 0.0f);
+ glVertex3f(-1, -1, 0.0f);
glTexCoord2f(1+.2,0+.8);
- glVertex3f(1, -1, 0.0f);
+ glVertex3f(1, -1, 0.0f);
glTexCoord2f(1+.2,1+.8);
glVertex3f(1, 1, 0.0f);
glTexCoord2f(0+.2,1+.8);
- glVertex3f(-1, 1, 0.0f);
+ glVertex3f(-1, 1, 0.0f);
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glColor4f(flashr,flashg,flashb,flashamount);
glBegin(GL_QUADS);
- glVertex3f(0, 0, 0.0f);
- glVertex3f(256, 0, 0.0f);
+ glVertex3f(0, 0, 0.0f);
+ glVertex3f(256, 0, 0.0f);
glVertex3f(256, 256, 0.0f);
- glVertex3f(0, 256, 0.0f);
+ glVertex3f(0, 256, 0.0f);
glEnd();
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glPopMatrix(); // Restore The Old Projection Matrix
glEnable(GL_CULL_FACE);
glDisable(GL_BLEND);
glDepthMask(1);
- }
+ }
swap_gl_buffers();
loadscreencolor=0;
}
}
-void Game::FadeLoadingScreen(float howmuch)
+void Game::FadeLoadingScreen(float howmuch)
{
static float loadprogress,minprogress,maxprogress;
//glScalef(.25,.25,.25);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
- glVertex3f(-1, -1, 0.0f);
+ glVertex3f(-1, -1, 0.0f);
glTexCoord2f(1,0);
- glVertex3f(1, -1, 0.0f);
+ glVertex3f(1, -1, 0.0f);
glTexCoord2f(1,1);
glVertex3f(1, 1, 0.0f);
glTexCoord2f(0,1);
- glVertex3f(-1, 1, 0.0f);
+ glVertex3f(-1, 1, 0.0f);
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_2D);
}
-void Game::InitGame()
+void Game::InitGame()
{
#if PLATFORM_MACOSX
ProcessSerialNumber PSN;
output = FSOUND_OUTPUT_NOSOUND;
FSOUND_SetOutput(output);
- if ((rc = FSOUND_Init(44100, 32, 0)) == FALSE)
+ if ((rc = FSOUND_Init(44100, 32, 0)) == false)
{
// if we tried ALSA and failed, fall back to OSS.
if ( (output == FSOUND_OUTPUT_ALSA) && (!cmdline("forcealsa")) )
}
}
- if (rc == FALSE)
+ if (rc == false)
{
FSOUND_Close();
output = FSOUND_OUTPUT_NOSOUND; // we tried! just do silence.
FSOUND_SetSFXMasterVolume((int)(volume*255));
strm[stream_music3] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music3.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_music3], FSOUND_LOOP_NORMAL);
if(musictoggle){
-// PlaySoundEx( stream_music3, strm[stream_music3], NULL, TRUE);
- PlayStreamEx(stream_music3, strm[stream_music3], 0, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+// PlaySoundEx( stream_music3, strm[stream_music3], NULL, true);
+ PlayStreamEx(stream_music3, strm[stream_music3], 0, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
}
if(ambientsound){
strm[stream_wind] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:wind.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_wind], FSOUND_LOOP_NORMAL);
FadeLoadingScreen(30);
strm[stream_desertambient] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:desertambient.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_desertambient], FSOUND_LOOP_NORMAL);
}
FadeLoadingScreen(40);
samp[firestartsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:firestart.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
strm[stream_firesound] = FSOUND_Stream_Open(":Data:Sounds:fire.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f);
FSOUND_Stream_SetMode(strm[stream_firesound], FSOUND_LOOP_NORMAL);
FadeLoadingScreen(50);
samp[fireendsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:fireend.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
//if(musictoggle){
strm[stream_music1grass] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1grass.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_music1grass], FSOUND_LOOP_NORMAL);
strm[stream_music1snow] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1snow.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_music1snow], FSOUND_LOOP_NORMAL);
FadeLoadingScreen(60);
strm[stream_music1desert] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1desert.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_music1desert], FSOUND_LOOP_NORMAL);
FadeLoadingScreen(80);
strm[stream_music2] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music2.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;}
-// FSOUND_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f);
+// FSOUND_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f);
FSOUND_Stream_SetMode(strm[stream_music2], FSOUND_LOOP_NORMAL);
//}
newscreenwidth=screenwidth;
newscreenheight=screenheight;
-
-
+
+
/*
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
}
-void Game::LoadStuff()
+void Game::LoadStuff()
{
static float temptexdetail;
static float viewdistdetail;
- static int i,j,texsize;
+ static int i,j,texsize;
float megascale =1;
LOGFUNC;
visibleloading=1;
/*musicvolume[3]=512;
- PlaySoundEx( music4, samp[music4], NULL, TRUE);
- FSOUND_SetPaused(channels[music4], FALSE);
+ PlaySoundEx( music4, samp[music4], NULL, true);
+ FSOUND_SetPaused(channels[music4], false);
FSOUND_SetVolume(channels[music4], 512);
*/
loadtime=0;
text.BuildFont();
texdetail=temptexdetail;
- numsounds=71;
+ numsounds=71;
viewdistdetail=2;
viewdistance=50*megascale*viewdistdetail;
for(i=0;i<player[0].skeleton.num_joints;i++){
for(j=0;j<animation[knifesneakattackanim].numframes;j++){
animation[knifesneakattackanim].position[i][j]+=moveamount;
- }
+ }
}
loadscreencolor=4;
for(i=0;i<player[0].skeleton.num_joints;i++){
for(j=0;j<animation[knifesneakattackedanim].numframes;j++){
animation[knifesneakattackedanim].position[i][j]+=moveamount;
- }
+ }
}
loadscreencolor=4;
for(i=0;i<player[0].skeleton.num_joints;i++){
for(j=0;j<animation[swordsneakattackanim].numframes;j++){
animation[swordsneakattackanim].position[i][j]+=moveamount;
- }
+ }
}
loadscreencolor=4;
LoadingScreen();
for(j=0;j<animation[swordsneakattackanim].numframes;j++){
animation[swordsneakattackanim].weapontarget[j]+=moveamount;
- }
+ }
loadscreencolor=4;
LoadingScreen();
for(i=0;i<player[0].skeleton.num_joints;i++){
for(j=0;j<animation[swordsneakattackedanim].numframes;j++){
animation[swordsneakattackedanim].position[i][j]+=moveamount;
- }
+ }
}
/*
for(i=0;i<player[0].skeleton.num_joints;i++){
for(j=0;j<animation[sleepanim].numframes;j++){
animation[sleepanim].position[i][j]=DoRotation(animation[sleepanim].position[i][j],0,180,0);
- }
+ }
}
*/
loadscreencolor=4;
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0);
}
//}
LoadSounds();
- /*PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ /*PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
*/
if(targetlevel!=7){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
}
stillloading=0;
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
extern int accountcampaignchoices[10][5000];
/********************> Tick() <*****/
extern FSOUND_STREAM * strm[20];
-extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
extern void ScreenShot(const char * fname);
mkdir("Screenshots", S_IRWXU);
ScreenShot(temp/*"Screenshots\\Screenshot.png"*/);
- /*FSSpec MAC_file;
- GraphicsExportComponent QT_exporter;
+ /*FSSpec MAC_file;
+ GraphicsExportComponent QT_exporter;
OSErr MAC_error_code;
CGrafPtr MAC_currentPort;
GDHandle MAC_currentDevice;
unsigned char* MAC_pixels;
Rect MAC_picture_rectangle;
- GWorldPtr MAC_offscreen_graphics_port;
+ GWorldPtr MAC_offscreen_graphics_port;
static int numscreenshots=0;
// Get the GWorld
- GWorldPtr MAC_gWorld = (CGrafPtr) FrontWindow();
+ GWorldPtr MAC_gWorld = (CGrafPtr) FrontWindow();
//assert(MAC_gWorld != NULL);
// Allocate memory for loading image
}
// Get GWorld
- ::GetGWorld(&MAC_currentPort, &MAC_currentDevice);
+ ::GetGWorld(&MAC_currentPort, &MAC_currentDevice);
// Make a picture Rectangle
MAC_picture_rectangle.left = 0;
MAC_picture_rectangle.right = screenwidth;
MAC_picture_rectangle.top = 0;
- MAC_picture_rectangle.bottom = screenheight;
+ MAC_picture_rectangle.bottom = screenheight;
// Create new offscreen GWorld
MAC_error_code = ::QTNewGWorldFromPtr (&MAC_offscreen_graphics_port, k32ARGBPixelFormat, &MAC_picture_rectangle, NULL, NULL, 0, (char *) MAC_pixels, screenwidth * 4);
if (MAC_error_code) {
- ::SetGWorld(MAC_currentPort, MAC_currentDevice);
+ ::SetGWorld(MAC_currentPort, MAC_currentDevice);
delete MAC_pixels;
//UTIL_Error("Could not create offscreen GWorld. ");
return;
}
// Copy OpenGL Context to new GWorld
- glReadBuffer(GL_FRONT);
+ glReadBuffer(GL_FRONT);
glReadPixels(0,0,screenwidth,screenheight,GL_RGBA,GL_UNSIGNED_BYTE,MAC_pixels);
// Swizzle texture
int dst_index;
unsigned char temp;
for (int horz = 0; horz < screenwidth; ++horz)
- for (vert = 0; vert < screenheight / 2; ++vert) {
+ for (vert = 0; vert < screenheight / 2; ++vert) {
src_index = (screenwidth * vert + horz) * 4;
dst_index = (screenwidth * (screenheight - vert - 1) + horz) * 4;
// Export the Gworld
MAC_error_code = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypeBMP, &QT_exporter);
if (MAC_error_code) {
- //UTIL_Warning("Unable to export screenshot.");
- ::SetGWorld(MAC_currentPort, MAC_currentDevice);
+ //UTIL_Warning("Unable to export screenshot.");
+ ::SetGWorld(MAC_currentPort, MAC_currentDevice);
::DisposeGWorld(MAC_offscreen_graphics_port);
delete MAC_pixels;
return;
- }
+ }
MAC_error_code = GraphicsExportSetInputGWorld(QT_exporter,MAC_offscreen_graphics_port);
if (MAC_error_code) {
delete MAC_pixels;
//UTIL_Warning("Unable to export screenshot.");
return;
- }
+ }
MAC_error_code = GraphicsExportSetOutputFile(QT_exporter,&MAC_file);
if (MAC_error_code) {
::CloseComponent(QT_exporter);
- ::SetGWorld(MAC_currentPort, MAC_currentDevice);
+ ::SetGWorld(MAC_currentPort, MAC_currentDevice);
::DisposeGWorld(MAC_offscreen_graphics_port);
delete MAC_pixels;
//UTIL_Warning("Unable to export screenshot.");
return;
- }
+ }
MAC_error_code = GraphicsExportDoExport(QT_exporter,NULL);
if (MAC_error_code) {
::CloseComponent(QT_exporter);
- ::SetGWorld(MAC_currentPort, MAC_currentDevice);
+ ::SetGWorld(MAC_currentPort, MAC_currentDevice);
::DisposeGWorld(MAC_offscreen_graphics_port);
delete MAC_pixels;
//UTIL_Warning("Unable to export screenshot.");
return;
- }
+ }
::CloseComponent(QT_exporter);
::SetGWorld(MAC_currentPort, MAC_currentDevice);
-void Game::SetUpLighting(){
+void Game::SetUpLighting(){
if(environment==snowyenvironment){
light.color[0]=.65;
light.color[1]=.65;
light.color[2]=.7;
light.ambient[0]=.4;
light.ambient[1]=.4;
- light.ambient[2]=.44;
+ light.ambient[2]=.44;
}
if(environment==desertenvironment){
light.color[0]=.95;
light.color[2]=.95;
light.ambient[0]=.4;
light.ambient[1]=.35;
- light.ambient[2]=.3;
+ light.ambient[2]=.3;
}
if(environment==grassyenvironment){
light.color[2]=1;
light.ambient[0]=.4;
light.ambient[1]=.4;
- light.ambient[2]=.44;
+ light.ambient[2]=.44;
}
if(!skyboxtexture){
light.color[0]=1;
light.color[2]=1;
light.ambient[0]=.4;
light.ambient[1]=.4;
- light.ambient[2]=.4;
+ light.ambient[2]=.4;
}
float average;
average=(skyboxlightr+skyboxlightg+skyboxlightb)/3;
light.color[2]*=(skyboxlightb+average)/2;
light.ambient[0]=light.ambient[0]*(skyboxlightr+average)/2*1;
light.ambient[1]=light.ambient[1]*(skyboxlightg+average)/2*1;
- light.ambient[2]=light.ambient[2]*(skyboxlightb+average)/2*1;
+ light.ambient[2]=light.ambient[2]*(skyboxlightb+average)/2*1;
/*
light.ambient[0]=0;
light.ambient[1]=0;
if(objects.type[i]!=treeleavestype&&objects.type[i]!=bushtype&&objects.type[i]!=firetype){
colviewer=startpoint;
coltarget=endpoint;
- if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)return i;
+ if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)return i;
}
}
}
if(objects.type[what]!=treeleavestype&&objects.type[what]!=bushtype&&objects.type[what]!=firetype){
colviewer=startpoint;
coltarget=endpoint;
- if(objects.model[what].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[what],&objects.rotation[what])!=-1)return i;
+ if(objects.model[what].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[what],&objects.rotation[what])!=-1)return i;
}
}
}
return -1;
}
-void Game::Setenvironment(int which)
+void Game::Setenvironment(int which)
{
LOGFUNC;
float temptexdetail;
environment=which;
/*
- FSOUND_SetPaused(channels[music1snow], TRUE);
- FSOUND_SetPaused(channels[music1grass], TRUE);
- FSOUND_SetPaused(channels[music1desert], TRUE);
- FSOUND_SetPaused(channels[wind], TRUE);
- FSOUND_SetPaused(channels[desertambient], TRUE);
+ FSOUND_SetPaused(channels[music1snow], true);
+ FSOUND_SetPaused(channels[music1grass], true);
+ FSOUND_SetPaused(channels[music1desert], true);
+ FSOUND_SetPaused(channels[wind], true);
+ FSOUND_SetPaused(channels[desertambient], true);
*/
- FSOUND_SetPaused(channels[stream_music1snow], TRUE);
- FSOUND_SetPaused(channels[stream_music1grass], TRUE);
- FSOUND_SetPaused(channels[stream_music1desert], TRUE);
- FSOUND_SetPaused(channels[stream_wind], TRUE);
- FSOUND_SetPaused(channels[stream_desertambient], TRUE);
+ FSOUND_SetPaused(channels[stream_music1snow], true);
+ FSOUND_SetPaused(channels[stream_music1grass], true);
+ FSOUND_SetPaused(channels[stream_music1desert], true);
+ FSOUND_SetPaused(channels[stream_wind], true);
+ FSOUND_SetPaused(channels[stream_desertambient], true);
if(environment==snowyenvironment){
windvector=0;
windvector.z=3;
if(ambientsound){
- //PlaySoundEx( wind, samp[wind], NULL, TRUE);
- PlayStreamEx(stream_wind, strm[stream_wind], 0, TRUE);
- FSOUND_SetPaused(channels[stream_wind], FALSE);
+ //PlaySoundEx( wind, samp[wind], NULL, true);
+ PlayStreamEx(stream_wind, strm[stream_wind], 0, true);
+ FSOUND_SetPaused(channels[stream_wind], false);
FSOUND_SetVolume(channels[stream_wind], 256);
}
samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
LoadTexture(":Data:Textures:snow.jpg",&terraintexture,1,0);
if(ambientsound){
- //PlaySoundEx( desertambient, samp[desertambient], NULL, TRUE);
- PlayStreamEx( stream_desertambient, strm[stream_desertambient], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_desertambient], FALSE);
+ //PlaySoundEx( desertambient, samp[desertambient], NULL, true);
+ PlayStreamEx( stream_desertambient, strm[stream_desertambient], NULL, true);
+ FSOUND_SetPaused(channels[stream_desertambient], false);
FSOUND_SetVolume(channels[stream_desertambient], 256);
}
samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
LoadTexture(":Data:Textures:sand.jpg",&terraintexture,1,0);
LoadTexture(":Data:Textures:grassbox.jpg",&objects.boxtextureptr,1,0);
if(ambientsound){
- PlayStreamEx( stream_wind, strm[stream_wind], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_wind], FALSE);
+ PlayStreamEx( stream_wind, strm[stream_wind], NULL, true);
+ FSOUND_SetPaused(channels[stream_wind], false);
FSOUND_SetVolume(channels[stream_wind], 100);
}
samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepgrass2.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0);
samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
- FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f);
+ FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f);
LoadTexture(":Data:Textures:grassdirt.jpg",&terraintexture,1,0);
}
-void Game::Loadlevel(int which){
+void Game::Loadlevel(int which){
stealthloading=0;
if(which==0)Loadlevel((char *)":Data:Maps:map1");
char temp2[100];
strcpy(temp2,(const char *)string);
-strcat((char *)temp2,(const char *)"Lugaru");
+strcat((char *)temp2,(const char *)"Lugaru");
sprintf (temp, "%d",strlen((char *)temp2));
-strcat((char *)temp2,temp);
+strcat((char *)temp2,temp);
MD5 context;
unsigned int len = strlen ( (char *)temp2);
-void Game::Loadlevel(char *name){
+void Game::Loadlevel(char *name){
int i,j,k,l,m;
static int oldlevel;
int templength;
if(!firstload){
oldlevel=50;
}
- FSOUND_SetPaused(channels[whooshsound], TRUE);
- FSOUND_SetPaused(channels[stream_firesound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], true);
+ FSOUND_SetPaused(channels[stream_firesound], true);
int mapvers;
FILE *tfile;
tfile=fopen( name, "rb" );
if(tfile)
{
- FSOUND_SetPaused(channels[stream_firesound], TRUE);
+ FSOUND_SetPaused(channels[stream_firesound], true);
scoreadded=0;
changedelay=0;
if(console)
{
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
freeze=0;
console=0;
}
for(m=0;m<templength;m++){
funpackf(tfile, "Bb", &dialoguename[k][l][m]);
if(dialoguename[k][l][m]=='\0'){
- break;
+ break;
}
}
funpackf(tfile, "Bf Bf Bf", &dialoguecamera[k][l].x, &dialoguecamera[k][l].y, &dialoguecamera[k][l].z);
for(l=0;l<templength;l++)
funpackf(tfile, "Bb", &player[0].clothes[k][l]);
player[0].clothes[k][templength]='\0';
- funpackf(tfile, "Bf Bf Bf", &player[0].clothestintr[k], &player[0].clothestintg[k], &player[0].clothestintb[k]);
+ funpackf(tfile, "Bf Bf Bf", &player[0].clothestintr[k], &player[0].clothestintg[k], &player[0].clothestintb[k]);
}
}
objects.center=0;
for(i=0;i<objects.numobjects;i++)
{
- objects.center+=objects.position[i];
+ objects.center+=objects.position[i];
}
objects.center/=objects.numobjects;
}
}
objects.radius=fast_sqrt(maxdistance);
- }
+ }
if(visibleloading){loadscreencolor=4; LoadingScreen();}
//mapcenter=objects.center;
for(l=0;l<templength;l++)
funpackf(tfile, "Bb", &player[i-howmanyremoved].clothes[k][l]);
player[i-howmanyremoved].clothes[k][templength]='\0';
- funpackf(tfile, "Bf Bf Bf", &player[i-howmanyremoved].clothestintr[k], &player[i-howmanyremoved].clothestintg[k], &player[i-howmanyremoved].clothestintb[k]);
+ funpackf(tfile, "Bf Bf Bf", &player[i-howmanyremoved].clothestintr[k], &player[i-howmanyremoved].clothestintg[k], &player[i-howmanyremoved].clothestintb[k]);
}
}
}
if(i==0||player[i].scale<0)player[i].scale=.23;
player[i].damagetolerance=300;
- }
+ }
if(visibleloading){loadscreencolor=4; LoadingScreen();}
if(cellophane)
}
/* for(i=0;i<32;i++){
- //if(i<16||i>20)
+ //if(i<16||i>20)
FSOUND_StopSound(i);
}
*/
{
if(ambientsound)
{
- PlayStreamEx(stream_wind, strm[stream_wind], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_wind], FALSE);
+ PlayStreamEx(stream_wind, strm[stream_wind], NULL, true);
+ FSOUND_SetPaused(channels[stream_wind], false);
FSOUND_SetVolume(channels[stream_wind], 256);
}
}
if(ambientsound)
{
//PlaySoundEx(desertambient,
- // samp[desertambient], NULL, TRUE);
+ // samp[desertambient], NULL, true);
PlayStreamEx(stream_desertambient,
- strm[stream_desertambient], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_desertambient], FALSE);
+ strm[stream_desertambient], NULL, true);
+ FSOUND_SetPaused(channels[stream_desertambient], false);
FSOUND_SetVolume(channels[stream_desertambient], 256);
}
}
{
if(ambientsound)
{
- //PlaySoundEx(wind, samp[wind], NULL, TRUE);
- PlayStreamEx(stream_wind, strm[stream_wind], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_wind], FALSE);
+ //PlaySoundEx(wind, samp[wind], NULL, true);
+ PlayStreamEx(stream_wind, strm[stream_wind], NULL, true);
+ FSOUND_SetPaused(channels[stream_wind], false);
FSOUND_SetVolume(channels[stream_wind], 100);
}
}
visibleloading=0;
}
-void Game::Tick()
+void Game::Tick()
{
static int i,k,j,l,m;
static XYZ facing,flatfacing,absflatfacing;
if(newnetmessages){
newnetmessages=0;
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
for(k=14;k>=2;k--){
for(j=0;j<255;j++){
if(!stealthloading){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
campaign=1;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[music3], TRUE);
+ FSOUND_SetPaused(channels[music3], true);
stealthloading=0;*/
}
if(mainmenu&&musictoggle){
if(mainmenu==1||mainmenu==2||mainmenu==100){
FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
- FSOUND_SetPaused(channels[music1], TRUE);
+ FSOUND_SetPaused(channels[music1], true);
}
}
if(!mainmenu){
- FSOUND_SetPaused(channels[stream_music3], TRUE);
- FSOUND_SetPaused(channels[music1], FALSE);
+ FSOUND_SetPaused(channels[stream_music3], true);
+ FSOUND_SetPaused(channels[music1], false);
}
}
if(mainmenu==3){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
opstream << "\nChat key:\n";
opstream << KeyToChar(chatkey);
opstream.close();
- }
+ }
if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==10||mainmenu==11||mainmenu==100){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
flashb=0;
flashamount=1;
flashdelay=1;
- }
+ }
if(mainmenu==3&&gameon)mainmenu=2;
if(mainmenu==3&&!gameon)mainmenu=1;
if(mainmenu==5&&gameon)mainmenu=2;
if(IsKeyDown(theKeyMap, MAC_TAB_KEY)&&!minimaptogglekeydown&&tutoriallevel){
if(tutorialstage!=51)
tutorialstagetime=tutorialmaxtime;
- PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, TRUE);
+ PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true);
FSOUND_SetVolume(channels[consolefailsound], 128);
- FSOUND_SetPaused(channels[consolefailsound], FALSE);
+ FSOUND_SetPaused(channels[consolefailsound], false);
minimaptogglekeydown=1;
}
if(!IsKeyDown(theKeyMap, MAC_TAB_KEY)){
if(!gameon){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
}
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[music3], TRUE); */
+ FSOUND_SetPaused(channels[music3], true); */
}
else
{
//resume
mainmenu=0;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
- FSOUND_SetPaused(channels[music1], FALSE);
+ FSOUND_SetPaused(channels[stream_music3], true);
+ FSOUND_SetPaused(channels[music1], false);
}
}
if(Button()&&!oldbutton&&selected==2){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
//options
- mainmenu=3;
+ mainmenu=3;
if(newdetail>2)newdetail=detail;
if(newdetail<0)newdetail=detail;
if(newscreenwidth>3000)newscreenwidth=screenwidth;
if(newscreenwidth<0)newscreenwidth=screenwidth;
if(newscreenheight>3000)newscreenheight=screenheight;
- if(newscreenheight<0)newscreenheight=screenheight;
+ if(newscreenheight<0)newscreenheight=screenheight;
}
if(Button()&&!oldbutton&&selected==3){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(!gameon){
//quit
tryquit=1;
- if(registered)FSOUND_SetPaused(channels[stream_music3], TRUE);
+ if(registered)FSOUND_SetPaused(channels[stream_music3], true);
}
else{
//end game
if(Button()&&!oldbutton&&selected!=-1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
}
if(Button()&&!oldbutton&&selected==0){
#if USE_SDL
musictoggle=1-musictoggle;
if(!musictoggle){
- FSOUND_SetPaused(channels[music1], TRUE);
- FSOUND_SetPaused(channels[stream_music2], TRUE);
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[music1], true);
+ FSOUND_SetPaused(channels[stream_music2], true);
+ FSOUND_SetPaused(channels[stream_music3], true);
for(i=0;i<4;i++){
oldmusicvolume[i]=0;
}
if(musictoggle){
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
- FSOUND_SetVolume(channels[stream_music3], 256);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
+ FSOUND_SetVolume(channels[stream_music3], 256);
}
}
if(Button()&&!oldbutton&&selected==9){
if(Button()&&!oldbutton&&selected==7){
/*float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
*/
flashr=1;
flashg=0;
//options
- mainmenu=4;
+ mainmenu=4;
keyselect=-1;
}
if(Button()&&!oldbutton&&selected==8){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected!=-1&&keyselect==-1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
}
if(Button()&&!oldbutton&&selected<9&&keyselect==-1){
keyselect=selected;
if(i!=MAC_ESCAPE_KEY&&(strcmp(KeyToChar(i),"unknown")||(buttons[0]&&!oldbuttons[0]&&!oldbutton)||(buttons[1]&&!oldbuttons[1]&&!oldbutton))){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
int keynum;
keynum=i;
if(Button()&&!oldbutton&&selected==9){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(mainmenu==5){
if(accountcampaignchoicesmade[accountactive]>8&&!registered){
- FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ FSOUND_SetFrequency(FSOUND_ALL, 0.001);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
gameon=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
endgame=0;
}
- if(Button()&&!oldbutton&&selected==1){
+ if(Button()&&!oldbutton&&selected==1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
}
- if(Button()&&!oldbutton&&selected-7>=accountcampaignchoicesmade[accountactive]){//selected>=7&&(selected-7<=campaignnumchoices)){
+ if(Button()&&!oldbutton&&selected-7>=accountcampaignchoicesmade[accountactive]){//selected>=7&&(selected-7<=campaignnumchoices)){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
campaign=1;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
}
if(Button()&&!oldbutton&&selected==4){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==5){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==3){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==2){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
else oldbutton=0;
}
if(mainmenu==9){
- if(Button()&&!oldbutton&&selected<numchallengelevels&&selected>=0&&selected<=accountprogress[accountactive]){
+ if(Button()&&!oldbutton&&selected<numchallengelevels&&selected>=0&&selected<=accountprogress[accountactive]){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
}
if(Button()&&!oldbutton&&selected==numchallengelevels){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
else oldbutton=0;
}
if(mainmenu==11){
- if(Button()&&!oldbutton&&selected<numchallengelevels&&selected>=0&&selected<=accountprogress[accountactive]){
+ if(Button()&&!oldbutton&&selected<numchallengelevels&&selected>=0&&selected<=accountprogress[accountactive]){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
}
if(Button()&&!oldbutton&&selected==numchallengelevels){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==3){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(tryquit)quit=1;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
quit=1;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
tryquit=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected!=-1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
}
if(Button()&&!oldbutton&&selected==1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected==2){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected!=-1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
}
if(Button()&&!oldbutton&&selected==0&&numaccounts<8){
entername=1;
if(Button()&&!oldbutton&&selected==numaccounts+1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(Button()&&!oldbutton&&selected!=-1){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
if(selected==0)accountdifficulty[accountactive]=0;
if(selected==1)accountdifficulty[accountactive]=1;
if(selected==2)accountdifficulty[accountactive]=2;
- mainmenu=5;
+ mainmenu=5;
flashr=1;
flashg=0;
loaddistrib=0;
}
}
- FSOUND_SetFrequency(channels[stream_music3], 22050);
+ FSOUND_SetFrequency(channels[stream_music3], 22050);
if(entername||mainmenu==13||mainmenu==14){
for(i=0;i<140;i++){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
for(j=0;j<255;j++){
displaytext[0][j]=' ';
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
for(j=0;j<255;j++){
displaytext[0][j]=' ';
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
for(j=0;j<255;j++){
displaytext[0][j]=' ';
}
}
- if(!mainmenu){
+ if(!mainmenu){
if(hostile==1)hostiletime+=multiplier;
else hostiletime=0;
if(!winfreeze)leveltime+=multiplier;
archiveselected=0;
donesomething=0;
if(Compare(consoletext[0],"quit ",0,4)||Compare(consoletext[0],"exit ",0,4)){
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
donesomething=1;
tryquit=1;
}
consoleselected=0;
}
}
- else
+ else
{
donesomething=1;
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
if(consolechars[0]>0){
for(k=14;k>=1;k--){
else
{
donesomething=1;
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
if(consolechars[0]>0){
for(k=14;k>=1;k--){
}
mapname[consolechars[0]-5+11]='\0';
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
int mapvers;
mapvers=12;
fpackf(tfile, "Bi",templength);
for(m=0;m<templength;m++){
fpackf(tfile, "Bb", dialoguename[k][l][m]);
- if(dialoguename[k][l][m]=='\0')break;
+ if(dialoguename[k][l][m]=='\0')break;
}
fpackf(tfile, "Bf Bf Bf", dialoguecamera[k][l].x, dialoguecamera[k][l].y, dialoguecamera[k][l].z);
fpackf(tfile, "Bi", templength);
for(l=0;l<templength;l++)
fpackf(tfile, "Bb", player[0].clothes[k][l]);
- fpackf(tfile, "Bf Bf Bf", player[0].clothestintr[k], player[0].clothestintg[k], player[0].clothestintb[k]);
+ fpackf(tfile, "Bf Bf Bf", player[0].clothestintr[k], player[0].clothestintg[k], player[0].clothestintb[k]);
}
fpackf(tfile, "Bi", environment);
fpackf(tfile, "Bi", templength);
for(l=0;l<templength;l++)
fpackf(tfile, "Bb", player[j].clothes[k][l]);
- fpackf(tfile, "Bf Bf Bf", player[j].clothestintr[k], player[j].clothestintg[k], player[j].clothestintb[k]);
+ fpackf(tfile, "Bf Bf Bf", player[j].clothestintr[k], player[j].clothestintg[k], player[j].clothestintb[k]);
}
}
for(k=0;k<player[0].numclothes;k++){
int templength;
templength=strlen(player[0].clothes[k]);
- fwrite( &templength,1,sizeof(int),tfile);
+ fwrite( &templength,1,sizeof(int),tfile);
for(l=0;l<templength;l++)
fwrite( &player[0].clothes[k][l],1,sizeof(char),tfile);
- fwrite( &player[0].clothestintr[k],1,sizeof(float),tfile);
- fwrite( &player[0].clothestintg[k],1,sizeof(float),tfile);
- fwrite( &player[0].clothestintb[k],1,sizeof(float),tfile);
+ fwrite( &player[0].clothestintr[k],1,sizeof(float),tfile);
+ fwrite( &player[0].clothestintg[k],1,sizeof(float),tfile);
+ fwrite( &player[0].clothestintb[k],1,sizeof(float),tfile);
}
fwrite( &environment, 1, sizeof(int), tfile );
for(k=0;k<player[j].numclothes;k++){
int templength;
templength=strlen(player[j].clothes[k]);
- fwrite( &templength,1,sizeof(int),tfile);
+ fwrite( &templength,1,sizeof(int),tfile);
for(l=0;l<templength;l++)
fwrite( &player[j].clothes[k][l],1,sizeof(char),tfile);
- fwrite( &player[j].clothestintr[k],1,sizeof(float),tfile);
- fwrite( &player[j].clothestintg[k],1,sizeof(float),tfile);
- fwrite( &player[j].clothestintb[k],1,sizeof(float),tfile);
+ fwrite( &player[j].clothestintr[k],1,sizeof(float),tfile);
+ fwrite( &player[j].clothestintg[k],1,sizeof(float),tfile);
+ fwrite( &player[j].clothestintb[k],1,sizeof(float),tfile);
}
}
fwrite( &numpathpoints, 1, sizeof(int), tfile );
}
mapname[consolechars[0]-5+11]='\0';
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
FILE *tfile;
tfile=fopen( mapname, "wb" );
if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound;
if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound;
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE);
+ PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
FSOUND_SetVolume(channels[whichsoundplay], 256);
- FSOUND_SetPaused(channels[whichsoundplay], FALSE);
+ FSOUND_SetPaused(channels[whichsoundplay], false);
//}
}
}
else terrain.DoLighting();
*/
donesomething=1;
- }
+ }
if(Compare(consoletext[0],"sky light ",0,9)||Compare(consoletext[0],"Sky Light ",0,9)){
int startpoint;
else terrain.DoLighting();
*/
donesomething=1;
- }
+ }
if(Compare(consoletext[0],"skybox ",0,6)||Compare(consoletext[0],"Skybox ",0,6)){
skyboxtexture=1-skyboxtexture;
consoleselected=0;
if(!donesomething){
- PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, TRUE);
+ PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true);
FSOUND_SetVolume(channels[consolefailsound], 256);
- FSOUND_SetPaused(channels[consolefailsound], FALSE);
+ FSOUND_SetPaused(channels[consolefailsound], false);
}
}
}
static int oldwinfreeze;
if(winfreeze&&!oldwinfreeze){
FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
}
if(winfreeze==0)oldwinfreeze=winfreeze;
else oldwinfreeze++;
int realdialoguetype;
bool special;
if(dialoguetype[i]>49){
- realdialoguetype=dialoguetype[i]-50;
+ realdialoguetype=dialoguetype[i]-50;
special=1;
}
else if(dialoguetype[i]>39){
- realdialoguetype=dialoguetype[i]-40;
+ realdialoguetype=dialoguetype[i]-40;
special=1;
}
else if(dialoguetype[i]>29){
- realdialoguetype=dialoguetype[i]-30;
+ realdialoguetype=dialoguetype[i]-30;
special=1;
}
else if(dialoguetype[i]>19){
- realdialoguetype=dialoguetype[i]-20;
+ realdialoguetype=dialoguetype[i]-20;
special=1;
}
else if(dialoguetype[i]>9){
- realdialoguetype=dialoguetype[i]-10;
+ realdialoguetype=dialoguetype[i]-10;
special=1;
}
else {
if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound;
if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound;
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE);
+ PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
FSOUND_SetVolume(channels[whichsoundplay], 256);
- FSOUND_SetPaused(channels[whichsoundplay], FALSE);
+ FSOUND_SetPaused(channels[whichsoundplay], false);
}
if(IsKeyDown(theKeyMap, attackkey))oldbuttondialogue=1;
}
hotspotsprite+=hotspot[i];
sprites.MakeSprite(breathsprite, hotspotsprite, hotspotsprite*0, 1,0.5,0, 7, 0.4);
hotspotvisual[i]+=0.1/hotspotsize[i]/hotspotsize[i]/hotspotsize[i];
- }
+ }
}
for(i=0;i<numhotspots;i++){
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
+ FSOUND_SetPaused(channels[fireendsound], false);
for(i=0;i<player[1].skeleton.num_joints;i++){
if(Random()%2==0){
weapons.owner[1]=0;
player[0].weaponactive=0;
player[0].num_weapons=1;
- player[0].weaponids[0]=1;
+ player[0].weaponids[0]=1;
player[1].weaponactive=0;
player[1].num_weapons=1;
- player[1].weaponids[0]=0;
+ player[1].weaponids[0]=0;
weapons.numweapons++;
}
weapons.owner[1]=0;
player[0].weaponactive=0;
player[0].num_weapons=1;
- player[0].weaponids[0]=1;
+ player[0].weaponids[0]=1;
player[1].weaponactive=0;
player[1].num_weapons=1;
player[1].weaponids[0]=0;
player[1].num_weapons=0;
player[0].weaponactive=0;
player[0].num_weapons=1;
- player[0].weaponids[0]=0;
+ player[0].weaponids[0]=0;
weapons.type[0]=knife;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
+ FSOUND_SetPaused(channels[fireendsound], false);
for(i=0;i<player[1].skeleton.num_joints;i++){
if(Random()%2==0){
if(tutorialstagetime==tutorialmaxtime-3){
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
}
if(tutorialsuccess>=1){
if(tutoriallevel!=1){
if(bonustime==0&&bonus!=solidhit&&bonus!=spinecrusher&&bonus!=tracheotomy&&bonus!=backstab&&bonusvalue>10){
- PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE);
+ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true);
FSOUND_SetVolume(channels[consolesuccesssound], 256);
- FSOUND_SetPaused(channels[consolesuccesssound], FALSE);
+ FSOUND_SetPaused(channels[consolesuccesssound], false);
}
}
else
if(bonustime==0){
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
+ FSOUND_SetPaused(channels[fireendsound], false);
}
if(bonustime==0){
if(bonus!=solidhit&&bonus!=twoxcombo&&bonus!=threexcombo&&bonus!=fourxcombo&&bonus!=megacombo)bonusnum[bonus]++;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 256);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
- if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
+ if(k==0)FSOUND_SetPaused(channels[whooshsound], true);
lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0);
player[k].rotation=-asin(0-lowpointtarget.x);
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 256);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
- if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
+ if(k==0)FSOUND_SetPaused(channels[whooshsound], true);
lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0);
player[k].rotation=-asin(0-lowpointtarget.x);
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 256);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
- if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
+ if(k==0)FSOUND_SetPaused(channels[whooshsound], true);
lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0);
player[k].rotation=-asin(0-lowpointtarget.x);
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 256);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
- if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
+ if(k==0)FSOUND_SetPaused(channels[whooshsound], true);
lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0);
player[k].rotation=-asin(0-lowpointtarget.x);
if(player[k].targetanimation==jumpupanim){player[k].jumppower=-4;player[k].targetanimation=player[k].getIdle();}
player[k].target=0;
- player[k].targetframe=0;
+ player[k].targetframe=0;
player[k].onterrain=1;
if(player[k].id==0){
- FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], true);
FSOUND_SetVolume(channels[whooshsound], 0);
}
vel[0]=player[k].velocity.x;
vel[1]=player[k].velocity.y;
vel[2]=player[k].velocity.z;
- PlaySoundEx( landsound, samp[landsound], NULL, TRUE);
+ PlaySoundEx( landsound, samp[landsound], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel);
FSOUND_SetVolume(channels[landsound], 128);
- FSOUND_SetPaused(channels[landsound], FALSE);
+ FSOUND_SetPaused(channels[landsound], false);
if(k==0){
envsound[numenvsounds]=player[k].coords;
envsoundvol[numenvsounds]=16;
}
}
- }
+ }
}
}
if(tempcollide&&terrain.patchobjectnum[player[k].whichpatchx][player[k].whichpatchz]&&(/*player[k].jumptogglekeydown*/1==1||player[k].aitype!=playercontrolled))
lowpoint.y+=1.35;
if(objects.type[i]!=rocktype)
if(player[k].SphereCheck(&lowpoint, 1.33, &colpoint, &objects.position[i], &objects.rotation[i], &objects.model[i])!=-1){
- if(player[k].targetanimation!=jumpupanim&&player[k].targetanimation!=jumpdownanim&&player[k].onterrain)player[k].avoidcollided=1;
+ if(player[k].targetanimation!=jumpupanim&&player[k].targetanimation!=jumpdownanim&&player[k].onterrain)player[k].avoidcollided=1;
player[k].coords=lowpoint;
player[k].coords.y-=1.35;
- player[k].collide=1;
+ player[k].collide=1;
if((player[k].grabdelay<=0||player[k].aitype!=playercontrolled)&&((/*(player[k].isRun()||player[k].targetanimation==sneakanim||player[k].targetanimation==walkanim)&&*/player[k].currentanimation!=climbanim&&player[k].currentanimation!=hanganim&&!player[k].isWallJump())||player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim)){
lowpoint=player[k].coords;
player[k].coords.y=lowpointtarget.y-.07;
player[k].currentoffset=(flatfacing-player[k].coords)/player[k].scale;
- if(j>10||!player[k].isRun()){
+ if(j>10||!player[k].isRun()){
if(player[k].targetanimation==jumpdownanim||player[k].targetanimation==jumpupanim){
- if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(k==0)FSOUND_SetPaused(channels[whooshsound], true);
}
float gLoc[3];
float vel[3];
vel[0]=player[k].velocity.x;
vel[1]=player[k].velocity.y;
vel[2]=player[k].velocity.z;
- PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE);
+ PlaySoundEx( jumpsound, samp[jumpsound], NULL, true);
FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel);
FSOUND_SetVolume(channels[jumpsound], 128);
- FSOUND_SetPaused(channels[jumpsound], FALSE);
+ FSOUND_SetPaused(channels[jumpsound], false);
lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0);
player[k].rotation=-asin(0-lowpointtarget.x);
//player[k].currentanimation=hanganim;
player[k].targetanimation=hanganim;
player[k].jumppower=0;
- }
+ }
}
j=100;
}
vel[1]=player[k].velocity.y;
vel[2]=player[k].velocity.z;
if(k==0){
- PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE);
+ PlaySoundEx( whooshsound, samp[whooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshsound], 128);
- FSOUND_SetPaused(channels[whooshsound], FALSE);
+ FSOUND_SetPaused(channels[whooshsound], false);
}
}
player[k].velocity.y+=gravity;
static bool endkeydown;
if(indialogue!=-1){
cameramode=1;
- if(directing){
+ if(directing){
facing=0;
facing.z=-1;
if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound;
if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound;
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE);
+ PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
FSOUND_SetVolume(channels[whichsoundplay], 256);
- FSOUND_SetPaused(channels[whichsoundplay], FALSE);
+ FSOUND_SetPaused(channels[whichsoundplay], false);
}
}
cameramode=0;
}
}
- if(!directing){
- FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(!directing){
+ FSOUND_SetPaused(channels[whooshsound], true);
viewer=dialoguecamera[whichdialogue][indialogue];
if(viewer.y<terrain.getHeight(viewer.x,viewer.z)+.1){
viewer.y=terrain.getHeight(viewer.x,viewer.z)+.1;
- }
+ }
rotation=dialoguecamerarotation[whichdialogue][indialogue];
rotation2=dialoguecamerarotation2[whichdialogue][indialogue];
if(dialoguetime>0.5)
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
if(dialogueboxsound[whichdialogue][indialogue]==-6)whichsoundplay=alarmsound;
if(dialogueboxsound[whichdialogue][indialogue]!=-5){
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE);
+ PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
FSOUND_SetVolume(channels[whichsoundplay], 256);
- FSOUND_SetPaused(channels[whichsoundplay], FALSE);
+ FSOUND_SetPaused(channels[whichsoundplay], false);
}
if(dialogueboxsound[whichdialogue][indialogue]==-5){
hotspot[numhotspots]=player[0].coords;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( hawksound, samp[hawksound], NULL, TRUE);
+ PlaySoundEx( hawksound, samp[hawksound], NULL, true);
FSOUND_3D_SetAttributes(channels[hawksound], gLoc, vel);
FSOUND_SetVolume(channels[hawksound], 128);
- FSOUND_SetPaused(channels[hawksound], FALSE);
+ FSOUND_SetPaused(channels[hawksound], false);
hawkcalldelay=16+abs(Random()%8);
}
for(j=0;j<objects.numobjects;j++){
if(objects.type[j]==treetrunktype)
if(findDistancefast(&objects.position[i],&objects.position[j])<.5)
- objects.scale[i]=objects.scale[j];
+ objects.scale[i]=objects.scale[j];
}
}
}*/
}
}
- if(closest!=-1){
+ if(closest!=-1){
XYZ headspurtdirection;
int i = player[closest].skeleton.jointlabels[head];
for(k=0;k<player[closest].skeleton.num_joints; k++){
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( splattersound, samp[splattersound], NULL, TRUE);
+ PlaySoundEx( splattersound, samp[splattersound], NULL, true);
FSOUND_3D_SetAttributes(channels[splattersound], gLoc, vel);
FSOUND_SetVolume(channels[splattersound], 256);
- FSOUND_SetPaused(channels[splattersound], FALSE);
+ FSOUND_SetPaused(channels[splattersound], false);
- PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE);
+ PlaySoundEx( breaksound2, samp[breaksound2], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel);
FSOUND_SetVolume(channels[breaksound2], 100);
- FSOUND_SetPaused(channels[breaksound2], FALSE);
+ FSOUND_SetPaused(channels[breaksound2], false);
if(player[closest].skeleton.free==2)player[closest].skeleton.free=0;
player[closest].RagDoll(0);
}
}
- if(closest!=-1){
+ if(closest!=-1){
float gLoc[3];
float vel[3];
gLoc[0]=blah.x;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( splattersound, samp[splattersound], NULL, TRUE);
+ PlaySoundEx( splattersound, samp[splattersound], NULL, true);
FSOUND_3D_SetAttributes(channels[splattersound], gLoc, vel);
FSOUND_SetVolume(channels[splattersound], 256);
- FSOUND_SetPaused(channels[splattersound], FALSE);
+ FSOUND_SetPaused(channels[splattersound], false);
- PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE);
+ PlaySoundEx( breaksound2, samp[breaksound2], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel);
FSOUND_SetVolume(channels[breaksound2], 600);
- FSOUND_SetPaused(channels[breaksound2], FALSE);
+ FSOUND_SetPaused(channels[breaksound2], false);
for(i=0;i<player[closest].skeleton.num_joints; i++){
if(!player[closest].skeleton.free)flatvelocity2=player[closest].velocity;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_SetPaused(channels[stream_firesound], TRUE);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_SetPaused(channels[stream_firesound], true);
}
slomotogglekeydown=1;
}
if(IsKeyDown(theKeyMap, MAC_M_KEY)&&!drawmodetogglekeydown&&!IsKeyDown(theKeyMap, MAC_SHIFT_KEY)&&editorenabled&&debugmode){
//drawmode++;
//if(drawmode>2)drawmode=0;
- if(objects.numobjects<max_objects-1){
+ if(objects.numobjects<max_objects-1){
XYZ boxcoords;
boxcoords.x=player[0].coords.x;
boxcoords.z=player[0].coords.z;
closest=i;
}
}
- if(closestdist>0&&closest>=0)objects.DeleteObject(closest);
+ if(closestdist>0&&closest>=0)objects.DeleteObject(closest);
drawmodetogglekeydown=1;
}
vel[0]=player[0].velocity.x;
vel[1]=player[0].velocity.y;
vel[2]=player[0].velocity.z;
- PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE);
+ PlaySoundEx( whooshsound, samp[whooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshsound], 128);
- FSOUND_SetPaused(channels[whooshsound], FALSE);
- //FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], false);
+ //FSOUND_SetPaused(channels[whooshsound], true);
texturesizetogglekeydown=1;
}
for(i=0;i<numplayers;i++){
if(i==k)i++;
if(!player[k].hasvictim)
- if((k==0||i==0)&&i!=k&&i<numplayers&&k<numplayers&&animation[player[k].targetanimation].attack!=reversal){
+ if((k==0||i==0)&&i!=k&&i<numplayers&&k<numplayers&&animation[player[k].targetanimation].attack!=reversal){
if(findDistancefast(&player[k].coords,&player[i].coords)<4.5&&!player[i].skeleton.free&&player[i].howactive<typedead1&&player[i].targetanimation!=jumpreversedanim&&player[i].targetanimation!=rabbitkickreversedanim&&player[i].targetanimation!=rabbitkickanim&&player[k].targetanimation!=rabbitkickanim&&player[i].targetanimation!=getupfrombackanim&&(player[i].targetanimation!=staggerbackhighanim&&(player[i].targetanimation!=staggerbackhardanim||animation[staggerbackhardanim].label[player[i].targetframe]==6))&&player[i].targetanimation!=jumpdownanim&&player[i].targetanimation!=jumpupanim&&player[i].targetanimation!=getupfromfrontanim){
player[k].victim=&player[i];
player[k].hasvictim=1;
if(numplayers>1)
for(i=0;i<numplayers;i++){
if(i==k)i++;
- if((playerrealattackkeydown||player[i].dead||!hasstaff)&&(k==0||i==0)&&i!=k&&i<numplayers&&k<numplayers&&animation[player[k].targetanimation].attack==neutral&&k==0){
+ if((playerrealattackkeydown||player[i].dead||!hasstaff)&&(k==0||i==0)&&i!=k&&i<numplayers&&k<numplayers&&animation[player[k].targetanimation].attack==neutral&&k==0){
if(!player[i].dead||!realthreat||(player[k].weaponactive==-1&&player[k].crouchkeydown))
if(player[i].skeleton.free)
if(findDistancefast(&player[k].coords,&player[i].coords)<3.5*(player[k].scale*5)*(player[k].scale*5)&&(player[i].dead||player[i].skeleton.longdead>1000||player[k].isRun()||(hasstaff)||(player[k].weaponactive!=-1&&player[i].skeleton.free&&(player[i].skeleton.longdead>2000||player[i].damage>player[i].damagetolerance/8||player[i].bloodloss>player[i].damagetolerance/2)&&findDistancefast(&player[k].coords,&player[i].coords)<1.5*(player[k].scale*5)*(player[k].scale*5)))){
if(player[i].onfire||player[k].onfire){
if(!player[i].onfire)player[i].CatchFire();
if(!player[k].onfire)player[k].CatchFire();
- }
+ }
}
tempcoords1=player[i].coords;
collisionradius=1.2*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5);
if(player[0].hasvictim)
if(player[0].targetanimation==rabbitkickanim&&(k==0||i==0)&&!player[0].victim->skeleton.free)collisionradius=3;
- if((!player[i].skeleton.oldfree||!player[k].skeleton.oldfree)&&(findDistancefast(&tempcoords1,&tempcoords2)<collisionradius||findDistancefast(&player[i].coords,&player[k].coords)<collisionradius)){
+ if((!player[i].skeleton.oldfree||!player[k].skeleton.oldfree)&&(findDistancefast(&tempcoords1,&tempcoords2)<collisionradius||findDistancefast(&player[i].coords,&player[k].coords)<collisionradius)){
if(k==0)
if(player[k].targetanimation==jumpdownanim&&!player[k].skeleton.oldfree&&!player[k].skeleton.free&&player[i].skeleton.oldfree&&player[i].skeleton.free&&player[i].dead&&player[k].lastcollide<=0&&abs(player[i].coords.y-player[k].coords.y)<.2&&findDistancefast(&player[k].coords,&player[i].coords)<.7*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5)){
player[k].coords.y=player[i].coords.y;
player[i].DoDamage(20);
if(k==0)camerashake+=.3;
player[i].skeleton.longdead=0;
- player[k].lastcollide=1;
+ player[k].lastcollide=1;
}
if(i==0)
if(player[i].targetanimation==jumpdownanim&&!player[i].skeleton.oldfree&&!player[i].skeleton.free&&player[k].skeleton.oldfree&&player[k].skeleton.free&&player[k].dead&&player[i].lastcollide<=0&&abs(player[i].coords.y-player[k].coords.y)<.2&&findDistancefast(&player[k].coords,&player[i].coords)<.7*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5)){
player[k].DoDamage(20);
if(i==0)camerashake+=.3;
player[k].skeleton.longdead=0;
- player[i].lastcollide=1;
+ player[i].lastcollide=1;
}
- if((player[i].skeleton.oldfree==1&&findLengthfast(&player[i].velocity)>1)||(player[k].skeleton.oldfree==1&&findLengthfast(&player[k].velocity)>1)||(player[i].skeleton.oldfree==0&&player[k].skeleton.oldfree==0)){
+ if((player[i].skeleton.oldfree==1&&findLengthfast(&player[i].velocity)>1)||(player[k].skeleton.oldfree==1&&findLengthfast(&player[k].velocity)>1)||(player[i].skeleton.oldfree==0&&player[k].skeleton.oldfree==0)){
rotatetarget=player[k].velocity-player[i].velocity;
if(((player[i].targetanimation!=getupfrombackanim&&player[i].targetanimation!=getupfromfrontanim)||player[i].skeleton.free)&&((player[k].targetanimation!=getupfrombackanim&&player[k].targetanimation!=getupfromfrontanim)||player[k].skeleton.free))
if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree))){
vel[1]=player[i].velocity.y;
vel[2]=player[i].velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 256);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
//player[i].velocity=player[k].velocity;
//player[k].velocity=player[i].velocity;
player[k].velocity.y=player[i].velocity.y;
player[i].DoDamage(20);
player[i].RagDoll(0);
- player[k].lastcollide=1;
+ player[k].lastcollide=1;
if(k==0){
bonus=AboveBonus;
bonustime=0;
//player[k].velocity.y-=10;
player[i].velocity.y=player[k].velocity.y;
player[k].DoDamage(20);
- player[k].RagDoll(0);
- player[i].lastcollide=1;
+ player[k].RagDoll(0);
+ player[i].lastcollide=1;
if(i==0){
bonus=AboveBonus;
bonustime=0;
/*
if(IsKeyDown(theKeyMap, MAC_Z_KEY)){
//Respawn
- FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], true);
changedelay=0;
for(k=0;k<numplayers;k++){
player[k].dead=0;
//if(!player[0].crouchkeydown)player[0].crouchkeydown=IsKeyDown(theKeyMap, MAC_CONTROL_KEY);
- for(int i=0;i<numplayers;i++){
+ for(int i=0;i<numplayers;i++){
if(!player[i].skeleton.free){
oldtargetrotation=player[i].targetrotation;
if(i==0&&indialogue==-1){
player[0].lookrotation=-rotation;
player[i].targetheadrotation=rotation;
- player[i].targetheadrotation2=rotation2;
+ player[i].targetheadrotation2=rotation2;
}
if(i!=0&&player[i].aitype==playercontrolled&&indialogue==-1){
if(!animation[player[i].targetanimation].attack&&player[i].targetanimation!=staggerbackhighanim&&player[i].targetanimation!=staggerbackhardanim&&player[i].targetanimation!=crouchremoveknifeanim&&player[i].targetanimation!=removeknifeanim&&player[i].targetanimation!=backhandspringanim&&player[i].targetanimation!=dodgebackanim&&player[i].targetanimation!=walljumprightkickanim&&player[i].targetanimation!=walljumpleftkickanim){
facing=DoRotation(facing,0,0-player[i].lookrotation,0);
player[i].targetheadrotation=player[i].lookrotation;
- player[i].targetheadrotation2=player[i].lookrotation2;
+ player[i].targetheadrotation2=player[i].lookrotation2;
}
if(indialogue!=-1){
rotatetarget=participantfacing[whichdialogue][indialogue][i];
}
}
}
- }
+ }
if(player[i].aitype==attacktypecutoff&&musictype!=2){
if(player[i].creature!=wolftype){
player[i].stunned=.6;
if(player[i].waypoint>player[i].numwaypoints-1)player[i].waypoint=0;
}
- }
+ }
if(player[i].numwaypoints>1&&player[i].howactive==typeactive&&player[i].pausetime<=0)player[i].forwardkeydown=1;
else player[i].forwardkeydown=0;
else player[i].targetrotation-=90;
}
}
- }
+ }
if(player[i].collided<1||player[i].targetanimation!=jumpupanim)player[i].jumpkeydown=0;
if((player[i].collided>.8&&player[i].jumppower>=5))player[i].jumpkeydown=1;
player[i].howactive=typeactive;
}
- }
+ }
if(player[i].howactive<typesleeping&&((tutoriallevel!=1||cananger)&&hostile)&&!player[0].dead&&findDistancefast(&player[i].coords,&player[0].coords)<400&&player[i].occluded<25){
if(findDistancefast(&player[i].coords,&player[0].coords)<12&&animation[player[0].targetanimation].height!=lowheight&&!editorenabled)
if((-1==checkcollide(DoRotation(player[i].skeleton.joints[player[i].skeleton.jointlabels[head]].position,0,player[i].rotation,0)*player[i].scale+player[i].coords,DoRotation(player[j].skeleton.joints[player[j].skeleton.jointlabels[head]].position,0,player[j].rotation,0)*player[j].scale+player[j].coords)&&!player[j].isWallJump())||(player[j].targetanimation==hanganim&&normaldotproduct(player[j].facing,player[i].coords-player[j].coords)<0)){
player[i].lastseentime-=.2;
if(j==0&&animation[player[j].targetanimation].height==lowheight)player[i].lastseentime-=.4;
- else player[i].lastseentime-=.6;
+ else player[i].lastseentime-=.6;
}
if(player[i].lastseentime<=0){
player[i].aitype=searchtype;
}
numseen++;
}
- }
+ }
if(player[i].aitype==searchtype){
player[i].aiupdatedelay-=multiplier;
}
else player[i].laststanding=j;
}
- }
+ }
if(player[i].aiupdatedelay<0){
rotatetarget=player[i].lastseen-player[i].coords;
Normalise(&rotatetarget);
if(rotatetarget.z<0)player[i].targetrotation=180-player[i].targetrotation;
player[i].lookrotation=player[i].targetrotation;
player[i].aiupdatedelay=.05;
- player[i].forwardkeydown=1;
+ player[i].forwardkeydown=1;
if(findDistancefastflat(&player[i].coords,&player[player[i].ally].coords)<3){
player[i].aitype=searchtype;
if(player[i].ally<0||player[i].weaponactive!=-1||player[i].lastchecktime<=0){
player[i].aitype=attacktypecutoff;
player[i].lastseentime=1;
- }
+ }
if(!player[0].dead)
if(player[i].ally>=0){
if(weapons.owner[player[i].ally]!=-1||findDistancefast(&player[i].coords,&weapons.position[player[i].ally])>16){
if(rotatetarget.z<0)player[i].targetrotation=180-player[i].targetrotation;
player[i].lookrotation=player[i].targetrotation;
player[i].aiupdatedelay=.05;
- player[i].forwardkeydown=1;
+ player[i].forwardkeydown=1;
if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8){
player[i].rightkeydown=0;
player[i].attackkeydown=0;
player[i].throwkeydown=1;
- player[i].crouchkeydown=0;
+ player[i].crouchkeydown=0;
if(player[i].targetanimation!=crouchremoveknifeanim&&player[i].targetanimation!=removeknifeanim)player[i].throwtogglekeydown=0;
player[i].drawkeydown=0;
}
player[i].lastpathfindpoint2=-1;
player[i].lastpathfindpoint3=-1;
player[i].lastpathfindpoint4=-1;
- }
+ }
if(player[i].aiupdatedelay<0&&!animation[player[i].targetanimation].attack&&player[i].targetanimation!=staggerbackhighanim&&player[i].targetanimation!=staggerbackhardanim&&player[i].targetanimation!=backhandspringanim&&player[i].targetanimation!=dodgebackanim){
if(player[i].weaponactive==-1&&player[i].num_weapons>0)player[i].drawkeydown=Random()%2;
else player[i].drawkeydown=0;
vel[1]=player[i].velocity.y;
vel[2]=player[i].velocity.z;
if(weapons.type[j]!=staff){
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
player[i].weaponactive=0;
vel[1]=player[i].velocity.y;
vel[2]=player[i].velocity.z;
if(weapons.type[k]!=staff){
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
player[i].weaponactive=0;
}
if(!fleshstuck){
if(weapons.type[k]!=staff){
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
}
if(fleshstuck){
- PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE);
+ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabremovesound], 128);
- FSOUND_SetPaused(channels[fleshstabremovesound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabremovesound], false);
}
player[i].weaponactive=0;
player[i].victim=&player[j];
XYZ aim;
weapons.owner[player[i].weaponids[0]]=-1;
- aim=player[i].victim->coords+DoRotation(player[i].victim->skeleton.joints[player[i].victim->skeleton.jointlabels[abdomen]].position,0,player[i].victim->rotation,0)*player[i].victim->scale+player[i].victim->velocity*findDistance(&player[i].victim->coords,&player[i].coords)/50-(player[i].coords+DoRotation(player[i].skeleton.joints[player[i].skeleton.jointlabels[righthand]].position,0,player[i].rotation,0)*player[i].scale);
+ aim=player[i].victim->coords+DoRotation(player[i].victim->skeleton.joints[player[i].victim->skeleton.jointlabels[abdomen]].position,0,player[i].victim->rotation,0)*player[i].victim->scale+player[i].victim->velocity*findDistance(&player[i].victim->coords,&player[i].coords)/50-(player[i].coords+DoRotation(player[i].skeleton.joints[player[i].skeleton.jointlabels[righthand]].position,0,player[i].rotation,0)*player[i].scale);
Normalise(&aim);
aim=DoRotation(aim,(float)abs(Random()%30)-15,(float)abs(Random()%30)-15,0);
player[i].weaponids[0]=player[i].weaponids[player[i].num_weapons];
}
player[i].weaponactive=-1;
- }
+ }
}
}
}
player[i].target=0;
player[i].drawtogglekeydown=1;
}
- }
+ }
}
if(player[i].isCrouch()&&weapons.bloody[player[i].weaponids[player[i].weaponactive]]&&bloodtoggle&&player[i].onterrain&&player[i].num_weapons&&player[i].weaponactive!=-1&&player[i].attackkeydown){
if(weapons.bloody[player[i].weaponids[player[i].weaponactive]]&&player[i].onterrain&&bloodtoggle&&musictype!=stream_music2){
if(target>=0)player[target].Reverse();
player[i].highreversaldelay=.5;
- if(player[i].isCrouch()){
+ if(player[i].isCrouch()){
if(!player[i].wasCrouch()){
player[i].currentanimation=player[i].getCrouch();
player[i].currentframe=0;
vel[2]=player[i].velocity.z;
if(i==0){
- PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE);
+ PlaySoundEx( whooshsound, samp[whooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshsound], 128);
- FSOUND_SetPaused(channels[whooshsound], FALSE);
+ FSOUND_SetPaused(channels[whooshsound], false);
}
- PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE);
+ PlaySoundEx( jumpsound, samp[jumpsound], NULL, true);
FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel);
FSOUND_SetVolume(channels[jumpsound], 128);
- FSOUND_SetPaused(channels[jumpsound], FALSE);
- }
+ FSOUND_SetPaused(channels[jumpsound], false);
+ }
if((player[i].isIdle())&&player[i].jumppower>1){
player[i].targetanimation=player[i].getLanding();
player[i].landhard=0;
player[i].targetframe=2;
player[i].jumpstart=1;
player[i].tempdeltav=deltav;
- }
+ }
if(player[i].targetanimation==jumpupanim&&(((!floatjump&&!editorenabled)||!debugmode)||player[i].aitype!=playercontrolled)){
if(player[i].jumppower>multiplier*6){
player[i].velocity.y+=multiplier*6;
player[i].jumppower=0;
}
}
- if(((floatjump||editorenabled)&&debugmode)&&i==0)player[i].velocity.y+=multiplier*30;
+ if(((floatjump||editorenabled)&&debugmode)&&i==0)player[i].velocity.y+=multiplier*30;
}
if(!movekey){
FSOUND_StopSound(FSOUND_ALL); // hack...OpenAL renderer isn't stopping music after tutorial goes to level menu...
FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
gameon=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
+ FSOUND_SetPaused(channels[fireendsound], false);
player[0].coords=(oldtemp+oldtemp2)/2;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
+ FSOUND_SetPaused(channels[fireendsound], false);
for(int i=0;i<player[1].skeleton.num_joints;i++){
if(Random()%2==0){
facing=0;
facing.z=-1;
-
+
facing=DoRotation(facing,-rotation2,0,0);
facing=DoRotation(facing,0,0-rotation,0);
-
-
+
+
static float ori[6];
ori[0] = -facing.x;
ori[1] = facing.y;
}
}
-void Game::TickOnce(){
+void Game::TickOnce(){
//if(!console){
if(!mainmenu)
if(directing||indialogue==-1){
}
if(mainmenu)rotation+=multiplier*5;
if(!mainmenu&&!indemo&&!registered){
- FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ FSOUND_SetFrequency(FSOUND_ALL, 0.001);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
gameon=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
}
if(tryquit==1&&!registered&&mainmenu!=12){
- FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ FSOUND_SetFrequency(FSOUND_ALL, 0.001);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
gameon=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
//}
}
-void Game::TickOnceAfter(){
+void Game::TickOnceAfter(){
static XYZ colviewer;
static XYZ coltarget;
static XYZ target;
musicvolume[0]=0;
musicvolume[1]=0;
musicvolume[3]=0;
- }
+ }
- if(musictoggle){
+ if(musictoggle){
if(musictype!=oldmusictype&&musictype==stream_music2){
static float gLoc[3];
static float vel[3];
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( alarmsound, samp[alarmsound], NULL, TRUE);
+ PlaySoundEx( alarmsound, samp[alarmsound], NULL, true);
FSOUND_SetVolume(channels[alarmsound], 512);
- FSOUND_SetPaused(channels[alarmsound], FALSE);
+ FSOUND_SetPaused(channels[alarmsound], false);
}
}
if(musicvolume[2]>128&&!loading&&!mainmenu)musicvolume[2]=128;
- if(musictoggle){
+ if(musictoggle){
if(musicvolume[0]>0&&oldmusicvolume[0]<=0){
- PlayStreamEx( music1, strm[music1], NULL, TRUE);
- FSOUND_SetPaused(channels[music1], FALSE);
+ PlayStreamEx( music1, strm[music1], NULL, true);
+ FSOUND_SetPaused(channels[music1], false);
}
if(musicvolume[1]>0&&oldmusicvolume[1]<=0){
- PlayStreamEx( stream_music2, strm[stream_music2], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music2], FALSE);
+ PlayStreamEx( stream_music2, strm[stream_music2], NULL, true);
+ FSOUND_SetPaused(channels[stream_music2], false);
}
if(musicvolume[2]>0&&oldmusicvolume[2]<=0){
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
}
}
- if(!musictoggle){
- FSOUND_SetPaused(channels[music1], TRUE);
- FSOUND_SetPaused(channels[stream_music2], TRUE);
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ if(!musictoggle){
+ FSOUND_SetPaused(channels[music1], true);
+ FSOUND_SetPaused(channels[stream_music2], true);
+ FSOUND_SetPaused(channels[stream_music3], true);
for(i=0;i<4;i++){
oldmusicvolume[i]=0;
}
}
- if(musictoggle){
+ if(musictoggle){
if(musicvolume[0]<=0&&oldmusicvolume[0]>0){
- FSOUND_SetPaused(channels[music1], TRUE);
+ FSOUND_SetPaused(channels[music1], true);
}
if(musicvolume[1]<=0&&oldmusicvolume[1]>0){
- FSOUND_SetPaused(channels[stream_music2], TRUE);
+ FSOUND_SetPaused(channels[stream_music2], true);
}
if(musicvolume[2]<=0&&oldmusicvolume[2]>0){
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
}
if(musicvolume[0]!=oldmusicvolume[0]){
int numalarmed=0;
if(numplayers>1)
- for(i=1;i<numplayers;i++){
+ for(i=1;i<numplayers;i++){
if(!player[i].dead&&player[i].aitype==attacktypecutoff&&player[i].surprised<=0)numalarmed++;
}
if(numalarmed>maxalarmed)maxalarmed=numalarmed;
- if(changedelay<=0&&!loading&&!editorenabled&&gameon&&!tutoriallevel&&changedelay!=-999&&!won){
+ if(changedelay<=0&&!loading&&!editorenabled&&gameon&&!tutoriallevel&&changedelay!=-999&&!won){
if(player[0].dead&&changedelay<=0){
changedelay=1;
targetlevel=whichlevel;
}
alldead=1;
if(numplayers>1)
- for(i=1;i<numplayers;i++){
+ for(i=1;i<numplayers;i++){
if(!player[i].dead&&player[i].howactive<typedead1)alldead=0;
}
won=1;
if(!debugmode){
if(bonustotal-startbonustotal>accounthighscore[accountactive][whichlevel])accounthighscore[accountactive][whichlevel]=bonustotal-startbonustotal;
- if(accountfasttime[accountactive][whichlevel]==0||leveltime<accountfasttime[accountactive][whichlevel])accountfasttime[accountactive][whichlevel]=leveltime;
+ if(accountfasttime[accountactive][whichlevel]==0||leveltime<accountfasttime[accountactive][whichlevel])accountfasttime[accountactive][whichlevel]=leveltime;
}
if(accountprogress[accountactive]<whichlevel+1)accountprogress[accountactive]=whichlevel+1;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
if(!player[0].dead&&targetlevel!=whichlevel){
startbonustotal=bonustotal;
if(!player[0].dead)Loadlevel(targetlevel);
if(player[0].dead)Loadlevel(whichlevel);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
loading=3;
}
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
for(i=0;i<255;i++){
mapname[i]='\0';
strcat(mapname,campaignmapname[levelorder[accountcampaignchoicesmade[accountactive]]]);//[campaignchoicewhich[whichchoice]]);
Loadlevel(mapname);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
loading=3;
}
if(changedelay<=-999&&whichlevel!=-2&&!loading&&(player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(killhotspot))&&!winfreeze)loading=1;
if((player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(windialogue)||(killhotspot))&&changedelay<=0){
if(accountprogress[accountactive]>3&&!registered){
- FSOUND_SetFrequency(FSOUND_ALL, 0.001);
- PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE);
- FSOUND_SetPaused(channels[stream_music3], FALSE);
+ FSOUND_SetFrequency(FSOUND_ALL, 0.001);
+ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true);
+ FSOUND_SetPaused(channels[stream_music3], false);
FSOUND_SetVolume(channels[stream_music3], 256);
gameon=0;
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
if(!stealthloading){
float gLoc[3]={0,0,0};
float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
+ FSOUND_SetPaused(channels[firestartsound], false);
+ FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
flashr=1;
flashg=0;
campaign=1;
mainmenu=0;
gameon=1;
- FSOUND_SetPaused(channels[stream_music3], TRUE);
+ FSOUND_SetPaused(channels[stream_music3], true);
stealthloading=0;
}
target.y+=.1;
if(player[0].skeleton.free){
for(i=0;i<player[0].skeleton.num_joints;i++){
- if(player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y>target.y)
+ if(player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y>target.y)
target.y=player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y;
}
target.y+=.1;
i=terrain.patchobjects[player[0].whichpatchx][player[0].whichpatchz][j];
colviewer=viewer;
coltarget=cameraloc;
- if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col;
+ if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col;
}
if(terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz])
for(j=0;j<terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz];j++){
i=terrain.patchobjects[player[0].whichpatchx][player[0].whichpatchz][j];
colviewer=viewer;
coltarget=cameraloc;
- if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col;
+ if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col;
}
if(terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz])
for(j=0;j<terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz];j++){
struct dirent *dent;
while ((dent = readdir(dirp)) != NULL)
{
- if (stricmp(dent->d_name, ptr) == 0)
+ if (strcasecmp(dent->d_name, ptr) == 0)
{
strcpy(ptr, dent->d_name); /* found a match. Overwrite with this case. */
closedir(dirp);
#include <vld.h>
#endif
-#include "Game.h"
-
#ifndef USE_DEVIL
# ifdef WIN32
# define USE_DEVIL
#include "IL/il.h"
#include "IL/ilu.h"
#include "IL/ilut.h"
+ #include "Game.h"
#else
- // just use libpng and libjpg directly; it's lighter-weight and easier
- // to manage the dependencies on Linux...
- extern "C" {
- #include "png.h"
- #include "jpeglib.h"
- }
+
+ #include <zlib.h>
+ #include <png.h>
+ #include <jpeglib.h>
+ #include "Game.h"
static bool load_image(const char * fname, TGAImageRec & tex);
static bool load_png(const char * fname, TGAImageRec & tex);
static bool load_jpg(const char * fname, TGAImageRec & tex);
char *arg = _argv[i];
while (*arg == '-')
arg++;
- if (stricmp(arg, cmd) == 0)
+ if (strcasecmp(arg, cmd) == 0)
return true;
}
char *retval;
char *envr;
- char *ptr = strrchr(argv0, '/');
+ char *ptr = strrchr((char *)argv0, '/');
if (strchr(argv0, '/'))
{
retval = strdup(argv0);
#if !USE_DEVIL
static bool load_image(const char *file_name, TGAImageRec &tex)
{
- char *ptr = strrchr(file_name, '.');
+ char *ptr = strrchr((char *)file_name, '.');
if (ptr)
{
- if (stricmp(ptr+1, "png") == 0)
+ if (strcasecmp(ptr+1, "png") == 0)
return load_png(file_name, tex);
- else if (stricmp(ptr+1, "jpg") == 0)
+ else if (strcasecmp(ptr+1, "jpg") == 0)
return load_jpg(file_name, tex);
}
static bool save_image(const char *file_name)
{
- char *ptr = strrchr(file_name, '.');
+ char *ptr = strrchr((char *)file_name, '.');
if (ptr)
{
- if (stricmp(ptr+1, "png") == 0)
+ if (strcasecmp(ptr+1, "png") == 0)
return save_png(file_name);
}
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
extern bool gamestarted;
extern FSOUND_STREAM * strm[20];
-extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
void Person::CheckKick(){
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
victim->RagDoll(0);
relative=velocity;
velocity=facing*-10;
velocity.y=5;
skeleton.free=0;
- if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], false);
//if(victim->damage>victim->damagetolerance){
if(id==0){
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
+ FSOUND_SetPaused(channels[firestartsound], false);
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- //PlaySoundEx( firesound, samp[firesound], NULL, TRUE);
- PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, TRUE);
+ //PlaySoundEx( firesound, samp[firesound], NULL, true);
+ PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, true);
FSOUND_3D_SetAttributes(channels[stream_firesound], gLoc, vel);
FSOUND_SetVolume(channels[stream_firesound], 256);
- FSOUND_SetPaused(channels[stream_firesound], FALSE);
+ FSOUND_SetPaused(channels[stream_firesound], false);
flamedelay=0;
if(!skeleton.free){
sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
- }
+ }
}
if(Random()%2==0)
for(int i=0;i<3;i++){
}
if(whichsound!=-1){
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 512);
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
if(!skeleton.free){
sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
- }
+ }
}
}
int offsetx=0,offsety=0;
if(i>endx)endx=i;
if(j>endy)endy=j;
}
- }
+ }
}
if(creature==wolftype)
for(i=0;i<512;i++){
if(i>endx)endx=i;
if(j>endy)endy=j;
}
- }
+ }
}
startx+=offsetx;
bloodloss+=bleeding*3;
if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodloss<damagetolerance&&creature==rabbittype){
- if(abs(Random()%2)==0){aitype=gethelptype;
+ if(abs(Random()%2)==0){aitype=gethelptype;
lastseentime=12;
}
else aitype=attacktypecutoff;
if(!skeleton.free){
sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
- }
+ }
}
}
int offsetx=0,offsety=0;
if(i>endx)endx=i;
if(j>endy)endy=j;
}
- }
+ }
}
if(creature==wolftype)
for(i=0;i<512;i++){
if(i>endx)endx=i;
if(j>endy)endy=j;
}
- }
+ }
}
startx+=offsetx;
endx+=offsetx;
bloodloss+=bleeding*3;
if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodloss<damagetolerance&&creature==rabbittype){
- if(abs(Random()%2)==0){aitype=gethelptype;
+ if(abs(Random()%2)==0){aitype=gethelptype;
lastseentime=12;
}
else aitype=attacktypecutoff;
if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
- PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE);
+ PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true);
FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel);
FSOUND_SetVolume(channels[swordstaffsound], 512);
- FSOUND_SetPaused(channels[swordstaffsound], FALSE);
+ FSOUND_SetPaused(channels[swordstaffsound], false);
}
else{
- PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);
+ FSOUND_SetPaused(channels[metalhitsound], false);
}
}
XYZ aim;
- /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);*/
+ FSOUND_SetPaused(channels[metalhitsound], false);*/
}
if(abs(Random()%20)==0){
if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
- PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE);
+ PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true);
FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel);
FSOUND_SetVolume(channels[swordstaffsound], 512);
- FSOUND_SetPaused(channels[swordstaffsound], FALSE);
+ FSOUND_SetPaused(channels[swordstaffsound], false);
}
else{
- PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);
+ FSOUND_SetPaused(channels[metalhitsound], false);
}
}
}
- /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);*/
+ FSOUND_SetPaused(channels[metalhitsound], false);*/
}
}
if(hasvictim)
if(aitype==passivetype&&damage<damagetolerance&&((tutoriallevel!=1||cananger)&&hostile))aitype=attacktypecutoff;
if(tutoriallevel!=1&&aitype!=playercontrolled&&damage<damagetolerance&&damage>damagetolerance*2/3&&creature==rabbittype){
- if(abs(Random()%2)==0){aitype=gethelptype;
+ if(abs(Random()%2)==0){aitype=gethelptype;
lastseentime=12;
}
else aitype=attacktypecutoff;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( splattersound, samp[splattersound], NULL, TRUE);
+ PlaySoundEx( splattersound, samp[splattersound], NULL, true);
FSOUND_3D_SetAttributes(channels[splattersound], gLoc, vel);
FSOUND_SetVolume(channels[splattersound], 256);
- FSOUND_SetPaused(channels[splattersound], FALSE);
+ FSOUND_SetPaused(channels[splattersound], false);
skeleton.free=2;
DoDamage(10000);
if(!dead&&creature==wolftype){
bonus=Wolfbonus;
bonustime=0;
- bonusvalue=300;
+ bonusvalue=300;
}
dead=2;
coords=20;
}
if(whichsound!=-1){
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 512);
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
speechdelay=.3;
/*
-HitStruct Person::BulletCollideWithPlayer(XYZ start, XYZ end){
+HitStruct Person::BulletCollideWithPlayer(XYZ start, XYZ end){
float damage=20;
XYZ tempbulletloc[2];
XYZ collisionpoint;
return hitstruct;
}
*/
-void Person::DoAnimations(){
+void Person::DoAnimations(){
if(!skeleton.free){
int i = 0;
static float oldtarget;
if(isIdle()&¤tanimation!=getIdle())normalsupdatedelay=0;
if(targetanimation==tempanim||currentanimation==tempanim){
- animation[tempanim]=tempanimation;
+ animation[tempanim]=tempanimation;
}
if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){
float gLoc[3];
FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5);
}
- if(((velocity.y<-15)||(crouchkeydown&&velocity.y<-8))&&abs(velocity.y)*4>fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1;
+ if(((velocity.y<-15)||(crouchkeydown&&velocity.y<-8))&&abs(velocity.y)*4>fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1;
if(!crouchkeydown&&velocity.y>=-15)landhard=0;
}
if((currentanimation==jumpupanim||targetanimation==jumpdownanim)/*&&velocity.y<40*/&&!isFlip()&&(!isLanding()&&!isLandhard())&&((crouchkeydown&&!crouchtogglekeydown))){
crouchtogglekeydown=0;
if(aitype==playercontrolled)feint=0;
}
- else
+ else
{
if(!crouchtogglekeydown&&animation[targetanimation].attack==reversed&&aitype==playercontrolled&&(escapednum<2||reversaltrain))feint=1;
if(!isFlip())crouchtogglekeydown=1;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE);
+ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel);
FSOUND_SetVolume(channels[fireendsound], 256);
- FSOUND_SetPaused(channels[fireendsound], FALSE);
- FSOUND_SetPaused(channels[stream_firesound], TRUE);
+ FSOUND_SetPaused(channels[fireendsound], false);
+ FSOUND_SetPaused(channels[stream_firesound], true);
deathbleeding=0;
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(1/victim->armorhead,210);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
}
if(weaponactive!=-1){
float gLoc[3];
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
}
drawtogglekeydown=1;
FootLand(0,1);
}
- }
+ }
if(terrain.getOpacity(coords.x,coords.z)>=.2){
if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3;
else whichsound=footstepsound4;
- }
+ }
}
if(!onterrain){
if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3;
else if(animation[targetanimation].label[targetframe]==4)whichsound=knifeswishsound;
if(animation[targetanimation].label[targetframe]==8&&tutoriallevel!=1)whichsound=landsound2;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(whichsound!=knifeswishsound)FSOUND_SetVolume(channels[whichsound], 128);
if(whichsound!=knifeswishsound&&(targetanimation==staffhitanim||targetanimation==staffgroundsmashanim||targetanimation==staffspinhitanim))FSOUND_SetVolume(channels[whichsound], 256);
if(whichsound==knifeswishsound)FSOUND_SetVolume(channels[whichsound], 512);
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
if(id==0)
if(whichsound==footstepsound||whichsound==footstepsound2||whichsound==footstepsound3||whichsound==footstepsound4){
if(animation[targetanimation].label[targetframe]==3){
whichsound--;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 128);
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
//if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2;
if(whichsound!=-1){
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 512);
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
- if((!wasLanding()&&!wasLandhard())&¤tanimation!=getIdle()&&(isLanding()||isLandhard())){
+ if((!wasLanding()&&!wasLandhard())&¤tanimation!=getIdle()&&(isLanding()||isLandhard())){
FootLand(0,1);
FootLand(1,1);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
weaponactive=0;
}
if(!fleshstuck){
if(weapons.type[i]!=staff){
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
}
if(fleshstuck){
- PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE);
+ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabremovesound], 128);
- FSOUND_SetPaused(channels[fleshstabremovesound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabremovesound], false);
}
weaponactive=0;
if(weapons.owner[i]!=-1){
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
}
if(weaponactive!=-1){
float gLoc[3];
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
}
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE);
+ PlaySoundEx( jumpsound, samp[jumpsound], NULL, true);
FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel);
FSOUND_SetVolume(channels[jumpsound], 128);
- FSOUND_SetPaused(channels[jumpsound], FALSE);
+ FSOUND_SetPaused(channels[jumpsound], false);
}
float closestdist;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE);
+ PlaySoundEx( jumpsound, samp[jumpsound], NULL, true);
FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel);
FSOUND_SetVolume(channels[jumpsound], 128);
- FSOUND_SetPaused(channels[jumpsound], FALSE);
+ FSOUND_SetPaused(channels[jumpsound], false);
}
}
}
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhead,175);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE);
+ PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshhitsound], 512);
- FSOUND_SetPaused(channels[whooshhitsound], FALSE);
+ FSOUND_SetPaused(channels[whooshhitsound], false);
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2,175);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 160);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhead,175);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 160);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhead,175);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE);
+ PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshhitsound], 512);
- FSOUND_SetPaused(channels[whooshhitsound], FALSE);
+ FSOUND_SetPaused(channels[whooshhitsound], false);
victim->RagDoll(0);
XYZ relative;
relative=victim->coords-coords;
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- /*PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ /*PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
*/
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 128);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
victim->skeleton.longdead=0;
victim->skeleton.free=1;
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
XYZ relative;
relative=victim->coords-coords;
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( thudsound, samp[thudsound], NULL, TRUE);
+ PlaySoundEx( thudsound, samp[thudsound], NULL, true);
FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel);
FSOUND_SetVolume(channels[thudsound], 400);
- FSOUND_SetPaused(channels[thudsound], FALSE);
+ FSOUND_SetPaused(channels[thudsound], false);
}
victim->skeleton.longdead=0;
if(!hasvictim){
terrain.MakeDecal(blooddecalfast,(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2),.08,.6,Random()%360);
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
}
if(victim&&hasvictim){
victim->skeleton.joints[i].locked=0;
//victim->skeleton.joints[i].velocity=0;
}
- PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE);
+ PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabsound], 128);
- FSOUND_SetPaused(channels[fleshstabsound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabsound], false);
}
if(whichtri!=-1||weapons.bloody[weaponids[weaponactive]]){
}
if(whichtri==-1){
hasvictim=0;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
}
}
}
vel[1]=velocity.y;
vel[2]=velocity.z;
if(!hasvictim){
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
if(victim&&hasvictim){
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
- PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE);
+ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabremovesound], 128);
- FSOUND_SetPaused(channels[fleshstabremovesound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabremovesound], false);
footvel=0;
footpoint=(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2);
for(i=0;i<victim->skeleton.num_joints;i++){
victim->skeleton.joints[i].velchange=0;
- victim->skeleton.joints[i].locked=0;
+ victim->skeleton.joints[i].locked=0;
//victim->skeleton.joints[i].velocity=0;
}
if(!hasvictim&&onterrain){
weapons.bloody[weaponids[weaponactive]]=0;
weapons.blooddrip[weaponids[weaponactive]]=0;
- }
+ }
}
if(targetanimation==upunchanim&&animation[targetanimation].label[currentframe]==5){
//if(!victim->isIdle()||victim->damage>victim->damagetolerance-60){
if(1==1){
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
}
else {
if(tutoriallevel!=1){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 256);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
}
//if(!victim->isIdle()||victim->damage>victim->damagetolerance-60){
if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height!=lowheight){
if(tutoriallevel!=1){
- PlaySoundEx( thudsound, samp[thudsound], NULL, TRUE);
+ PlaySoundEx( thudsound, samp[thudsound], NULL, true);
FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel);
FSOUND_SetVolume(channels[thudsound], 512);
- FSOUND_SetPaused(channels[thudsound], FALSE);
+ FSOUND_SetPaused(channels[thudsound], false);
}
}
else if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height==lowheight){
if(tutoriallevel!=1){
- PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE);
+ PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshhitsound], 512);
- FSOUND_SetPaused(channels[whooshhitsound], FALSE);
+ FSOUND_SetPaused(channels[whooshhitsound], false);
}
}
else {
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 256);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
- }
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
+ }
}
if(victim->damage>victim->damagetolerance-60||normaldotproduct(victim->facing,victim->coords-coords)>0||animation[victim->targetanimation].height==lowheight)
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 256);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
Puff(righthand);
}
if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
- PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE);
+ PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true);
FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel);
FSOUND_SetVolume(channels[swordstaffsound], 512);
- FSOUND_SetPaused(channels[swordstaffsound], FALSE);
+ FSOUND_SetPaused(channels[swordstaffsound], false);
}
else{
- PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);
+ FSOUND_SetPaused(channels[metalhitsound], false);
}
}
escapednum=0;
XYZ aim;
weapons.owner[weaponids[0]]=-1;
- aim=victim->coords+DoRotation(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position,0,victim->rotation,0)*victim->scale+victim->velocity*findDistance(&victim->coords,&coords)/50-(coords+DoRotation(skeleton.joints[skeleton.jointlabels[righthand]].position,0,rotation,0)*scale);
+ aim=victim->coords+DoRotation(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position,0,victim->rotation,0)*victim->scale+victim->velocity*findDistance(&victim->coords,&coords)/50-(coords+DoRotation(skeleton.joints[skeleton.jointlabels[righthand]].position,0,rotation,0)*scale);
Normalise(&aim);
/*if(victim->targetanimation==jumpupanim||victim->targetanimation==jumpdownanim){
aim=DoRotation(aim,(float)abs(Random()%15)-7,(float)abs(Random()%15)-7,0);
weaponids[0]=weaponids[num_weapons];
}
weaponactive=-1;
- }
+ }
}
if(targetanimation==knifeslashstartanim&&animation[targetanimation].label[currentframe]==5){
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE);
+ PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
FSOUND_SetVolume(channels[knifeslicesound], 512);
- FSOUND_SetPaused(channels[knifeslicesound], FALSE);
+ FSOUND_SetPaused(channels[knifeslicesound], false);
}
//victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200;
if(animation[victim->targetanimation].attack&&(victim->aitype!=playercontrolled||victim->targetanimation==knifeslashstartanim)&&(victim->creature==rabbittype||victim->deathbleeding<=0)){
if(tutoriallevel!=1)if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1;
if(tutoriallevel!=1)weapons.blooddrip[weaponids[weaponactive]]+=3;
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
if(skeleton.free){
footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords;
}
if(!skeleton.free){
footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
- }
+ }
if(tutoriallevel!=1){
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3);
footvel=DoRotation(facing,0,90,0)*.8;
bonustime=0;
bonusvalue=40;
}
- escapednum=0;
+ escapednum=0;
if(tutoriallevel!=1){
if(normaldotproduct(victim->facing,victim->coords-coords)<0)victim->DoBloodBig(2/victim->armorhigh,190);
else victim->DoBloodBig(2/victim->armorhigh,185);
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( swordslicesound, samp[swordslicesound], NULL, TRUE);
+ PlaySoundEx( swordslicesound, samp[swordslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[swordslicesound], gLoc, vel);
FSOUND_SetVolume(channels[swordslicesound], 512);
- FSOUND_SetPaused(channels[swordslicesound], FALSE);
+ FSOUND_SetPaused(channels[swordslicesound], false);
}
//victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200;
//if(animation[victim->targetanimation].attack){
//victim->bloodloss+=100*(6.5-findDistancefast(&coords,&victim->coords));
victim->DoDamage(damagemult*0);
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
if(skeleton.free){
footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords;
}
if(!skeleton.free){
footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
- }
+ }
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=DoRotation(facing,0,90,0)*.8;
footvel.y-=.3;
if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250;
- PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE);
+ PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true);
FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel);
FSOUND_SetVolume(channels[swordstaffsound], 512);
- FSOUND_SetPaused(channels[swordstaffsound], FALSE);
+ FSOUND_SetPaused(channels[swordstaffsound], false);
}
else{
- PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);
+ FSOUND_SetPaused(channels[metalhitsound], false);
}
}
player[i].wentforweapon=0;
}
- /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE);
+ /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel);
FSOUND_SetVolume(channels[metalhitsound], 512);
- FSOUND_SetPaused(channels[metalhitsound], FALSE);*/
+ FSOUND_SetPaused(channels[metalhitsound], false);*/
}
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, TRUE);
+ PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true);
FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel);
FSOUND_SetVolume(channels[staffheadsound], 256);
- FSOUND_SetPaused(channels[staffheadsound], FALSE);
+ FSOUND_SetPaused(channels[staffheadsound], false);
}
victim->RagDoll(0);
XYZ relative;
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, TRUE);
+ PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true);
FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel);
FSOUND_SetVolume(channels[staffheadsound], 256);
- FSOUND_SetPaused(channels[staffheadsound], FALSE);
+ FSOUND_SetPaused(channels[staffheadsound], false);
}
victim->RagDoll(0);
XYZ relative;
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( staffbodysound, samp[staffbodysound], NULL, TRUE);
+ PlaySoundEx( staffbodysound, samp[staffbodysound], NULL, true);
FSOUND_3D_SetAttributes(channels[staffbodysound], gLoc, vel);
FSOUND_SetVolume(channels[staffbodysound], 256);
- FSOUND_SetPaused(channels[staffbodysound], FALSE);
+ FSOUND_SetPaused(channels[staffbodysound], false);
}
victim->skeleton.longdead=0;
victim->skeleton.free=1;
for(i=0;i<victim->skeleton.num_joints;i++){
victim->skeleton.joints[i].velchange=0;
- victim->skeleton.joints[i].locked=0;
+ victim->skeleton.joints[i].locked=0;
//victim->skeleton.joints[i].velocity=0;
}
}
victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
victim->Puff(head);
victim->DoDamage(damagemult*100/victim->protectionhead);
if(victim->howactive==typesleeping)victim->DoDamage(damagemult*150/victim->protectionhead);
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhead,175);
}
victim->targetrotation=targetrotation+180;
victim->target=0;
if(tutoriallevel!=1){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
victim->Puff(abdomen);
victim->DoDamage(damagemult*30/victim->protectionhigh);
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhigh,170);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
XYZ relative;
relative=victim->coords-coords;
victim->targetrotation=targetrotation+180;
victim->target=0;
if(tutoriallevel!=1){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
victim->Puff(abdomen);
victim->DoDamage(damagemult*30/victim->protectionlow);
}
}
- }
+ }
if(animation[targetanimation].attack==reversal&&(!victim->feint||(victim->lastattack==victim->lastattack2&&victim->lastattack2==victim->lastattack3&&Random()%2)||targetanimation==knifefollowanim)){
if(targetanimation==spinkickreversalanim&&animation[targetanimation].label[currentframe]==7){
escapednum=0;
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
if(creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhigh,170);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE);
+ PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel);
FSOUND_SetVolume(channels[whooshhitsound], 128);
- FSOUND_SetPaused(channels[whooshhitsound], FALSE);
+ FSOUND_SetPaused(channels[whooshhitsound], false);
victim->RagDoll(0);
XYZ relative;
relative=victim->coords-oldcoords;
}
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
victim->RagDoll(0);
if(id==0){
vel[2]=velocity.z;
if(weaponactive!=-1){
victim->DoBloodBig(2/victim->armorhigh,225);
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE);
+ PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
FSOUND_SetVolume(channels[knifeslicesound], 512);
- FSOUND_SetPaused(channels[knifeslicesound], FALSE);
+ FSOUND_SetPaused(channels[knifeslicesound], false);
if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1;
weapons.blooddrip[weaponids[weaponactive]]+=3;
}
if(weaponactive==-1&&creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhigh,175);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
victim->DoBloodBig(2,225);
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE);
+ PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
FSOUND_SetVolume(channels[knifeslicesound], 512);
- FSOUND_SetPaused(channels[knifeslicesound], FALSE);
+ FSOUND_SetPaused(channels[knifeslicesound], false);
if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1;
weapons.blooddrip[weaponids[weaponactive]]+=3;
}*/
vel[1]=velocity.y;
vel[2]=velocity.z;
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
victim->RagDoll(0);
XYZ relative;
vel[2]=velocity.z;
if(weaponactive!=-1){
victim->DoBloodBig(200,225);
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE);
+ PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
FSOUND_SetVolume(channels[knifeslicesound], 512);
- FSOUND_SetPaused(channels[knifeslicesound], FALSE);
+ FSOUND_SetPaused(channels[knifeslicesound], false);
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
weapons.blooddrip[weaponids[weaponactive]]+=5;
}
if(creature==wolftype&&weaponactive==-1){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2,175);
}
bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
*/
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
bonustime=0;
bonusvalue=40;
}
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE);
+ PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabsound], 512);
- FSOUND_SetPaused(channels[fleshstabsound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabsound], false);
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
weapons.blooddrip[weaponids[weaponactive]]+=5;
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE);
+ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabremovesound], 512);
- FSOUND_SetPaused(channels[fleshstabremovesound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabremovesound], false);
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
weapons.blooddrip[weaponids[weaponactive]]+=5;
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
escapednum=0;
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
footpoint=(weapons.tippoint[weaponids[0]]+weapons.position[weaponids[0]])/2;
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE);
+ PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabsound], 512);
- FSOUND_SetPaused(channels[fleshstabsound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabsound], false);
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
weapons.blooddrip[weaponids[weaponactive]]+=5;
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE);
+ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabremovesound], 512);
- FSOUND_SetPaused(channels[fleshstabremovesound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabremovesound], false);
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
weapons.blooddrip[weaponids[weaponactive]]+=5;
- XYZ footvel,footpoint;
+ XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
vel[2]=velocity.z;
if(weaponactive==-1){
if(tutoriallevel!=1){
- PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE);
+ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel);
FSOUND_SetVolume(channels[heavyimpactsound], 128);
- FSOUND_SetPaused(channels[heavyimpactsound], FALSE);
+ FSOUND_SetPaused(channels[heavyimpactsound], false);
}
}
bool doslice;
if(doslice){
if(weaponactive!=-1){
victim->DoBloodBig(2/victim->armorhead,225);
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE);
+ PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
FSOUND_SetVolume(channels[knifeslicesound], 512);
- FSOUND_SetPaused(channels[knifeslicesound], FALSE);
+ FSOUND_SetPaused(channels[knifeslicesound], false);
if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1;
weapons.blooddrip[weaponids[weaponactive]]+=3;
}
- if(weaponactive==-1&&creature==wolftype){
- PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE);
+ if(weaponactive==-1&&creature==wolftype){
+ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true);
FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel);
FSOUND_SetVolume(channels[clawslicesound], 128);
- FSOUND_SetPaused(channels[clawslicesound], FALSE);
+ FSOUND_SetPaused(channels[clawslicesound], false);
victim->spurt=1;
victim->DoBloodBig(2/victim->armorhead,175);
}
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 128);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
}
if(currentanimation==staggerbackhighanim){
targetanimation=getIdle();
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
}
if(weaponactive!=-1){
float gLoc[3];
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
}
}
if(currentanimation==rollanim){
targetframe=3;
velocity=facing*-8;
velocity.y=4;
- if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], false);
}
if(targetanimation==walljumprightanim){
targetanimation=rightflipanim;
velocity=facing*8;
velocity.y=4;
}
- if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], false);
}
if(targetanimation==walljumpleftanim){
if(attackkeydown){
velocity=DoRotation(facing,0,-30,0)*-8;
velocity.y=4;
}
- if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], false);
}
if(targetanimation==sneakattackanim){
float ycoords=oldcoords.y;
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( landsound, samp[landsound], NULL, TRUE);
+ PlaySoundEx( landsound, samp[landsound], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel);
FSOUND_SetVolume(channels[landsound], 128);
- FSOUND_SetPaused(channels[landsound], FALSE);
+ FSOUND_SetPaused(channels[landsound], false);
if(currentanimation==upunchreversedanim||currentanimation==swordslashreversedanim){
targetanimation=rollanim;
escapednum++;
targetanimation=rollanim;
coords+=facing;
- if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], true);
}
lastfeint=0;
}
escapednum++;
targetanimation=rollanim;
coords+=facing*2;
- if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], true);
}
lastfeint=0;
}
targetanimation=jumpdownanim;
}
}
- if(!skeleton.free){
+ if(!skeleton.free){
oldtarget=target;
if(!transspeed&&animation[targetanimation].attack!=2&&animation[targetanimation].attack!=3){
if(!isRun()||!wasRun()){
if(currentanimation!=oldcurrentanimation||targetanimation!=oldtargetanimation||((currentframe!=oldcurrentframe||targetframe!=oldtargetframe)&&!calcrot)){
//Old rotates
for(i=0;i<skeleton.num_joints;i++){
- skeleton.joints[i].position=animation[currentanimation].position[i][currentframe];
+ skeleton.joints[i].position=animation[currentanimation].position[i][currentframe];
}
skeleton.FindForwards();
//New rotates
for(i=0;i<skeleton.num_joints;i++){
- skeleton.joints[i].position=animation[targetanimation].position[i][targetframe];
+ skeleton.joints[i].position=animation[targetanimation].position[i][targetframe];
}
skeleton.FindForwards();
//skeleton.DoConstraints();
}
-void Person::DoStuff(){
+void Person::DoStuff(){
static XYZ terrainnormal;
static XYZ flatfacing;
static XYZ flatvelocity;
if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2;
if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
- sprites.MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
+ sprites.MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
}
if(bleeding>0){
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
if(skeleton.free)sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- }
+ }
}
/*if(id==0){
bloodloss+=deathbleeding*40;
bloodloss+=deathbleeding*multiplier*80;
deathbleeding-=multiplier*1.6;
//if(id==0)deathbleeding-=multiplier*.2;
- if(deathbleeding<0)deathbleeding=0;
+ if(deathbleeding<0)deathbleeding=0;
if(bloodloss>damagetolerance&&animation[targetanimation].attack==neutral){
if(weaponactive!=-1){
weapons.owner[weaponids[0]]=-1;
if(!dead&&creature==wolftype){
bonus=Wolfbonus;
bonustime=0;
- bonusvalue=300;
+ bonusvalue=300;
}
dead=2;
if(targetanimation==knifefollowedanim&&!skeleton.free){
if(!skeleton.free)footpoint=DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords;
if(skeleton.free)footpoint=((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2)*scale+coords;
if(targetanimation==sleepanim)footvel=DoRotation(footvel,0,90,0);
- sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
+ sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
}
}
}
}
}
- if(creature==wolftype){
+ if(creature==wolftype){
twitchdelay2-=multiplier*1.5;
if(tailmorphend!=0)
if((isRun()||targetanimation==jumpupanim||targetanimation==jumpdownanim||targetanimation==backflipanim)&&!skeleton.free){
if(creature==wolftype){
bonus=Wolfbonus;
bonustime=0;
- bonusvalue=300;
+ bonusvalue=300;
}
RagDoll(0);
/*
if(bloodloss<damagetolerance)
for(i=0;i<skeleton.num_joints;i++){
- skeleton.joints[i].velocity*=1.5;
+ skeleton.joints[i].velocity*=1.5;
}*/
}
skeleton.free=1;
damage-=20;
for(i=0;i<skeleton.num_joints;i++){
- skeleton.joints[i].velocity=0;
+ skeleton.joints[i].velocity=0;
}
}
if(permanentdamage>damagetolerance&&dead!=2){
if(!dead&&creature==wolftype){
bonus=Wolfbonus;
bonustime=0;
- bonusvalue=300;
+ bonusvalue=300;
}
if(id!=0&&unconscioustime<.1&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=FinishedBonus||bonustime>1)&&bloodloss<damagetolerance){
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( breaksound, samp[breaksound], NULL, TRUE);
+ PlaySoundEx( breaksound, samp[breaksound], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound], gLoc, vel);
FSOUND_SetVolume(channels[breaksound], 512);
- FSOUND_SetPaused(channels[breaksound], FALSE);
+ FSOUND_SetPaused(channels[breaksound], false);
/*if(id==0||findDistancefast(&coords,&viewer)<50){
slomo=1;
slomodelay=.2;
}
if(skeleton.free==1){
- if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], true);
if(!dead){
//If knocked over, open hands and close mouth
skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier;
if(skeleton.longdead>2000){
if(skeleton.longdead>6000){
- if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], true);
skeleton.free=3;
DrawSkeleton();
skeleton.free=2;
if(objects.type[i]!=treeleavestype&&objects.type[i]!=bushtype&&objects.type[i]!=firetype){
colviewer=startpoint;
coltarget=endpoint;
- if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)canrecover=0;
+ if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)canrecover=0;
}
}
if(canrecover){
if(findLength(&average)<10&&!dead&&skeleton.free){
skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier;
if(skeleton.longdead>(damage+500)*1.5){
- if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE);
+ if(id==0)FSOUND_SetPaused(channels[whooshsound], true);
skeleton.free=0;
velocity=0;
XYZ middle;
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE);
+ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true);
FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel);
FSOUND_SetVolume(channels[movewhooshsound], 128);
- FSOUND_SetPaused(channels[movewhooshsound], FALSE);
+ FSOUND_SetPaused(channels[movewhooshsound], false);
currentanimation=targetanimation;
currentframe=targetframe-1;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
+ FSOUND_SetPaused(channels[firestartsound], false);
}
objects.onfire[i]=1;
}
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
+ FSOUND_SetPaused(channels[firestartsound], false);
}
objects.onfire[i]=1;
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( bushrustle, samp[bushrustle], NULL, TRUE);
+ PlaySoundEx( bushrustle, samp[bushrustle], NULL, true);
FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel);
FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity));
- FSOUND_SetPaused(channels[bushrustle], FALSE);
+ FSOUND_SetPaused(channels[bushrustle], false);
if(id==0){
envsound[numenvsounds]=coords;
}
}
objects.rotx[i]+=velocity.x*multiplier*6;
- objects.roty[i]+=velocity.z*multiplier*6;
+ objects.roty[i]+=velocity.z*multiplier*6;
objects.messedwith[i]=.5;
}
XYZ tempcoord;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE);
+ PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], FALSE);
+ FSOUND_SetPaused(channels[firestartsound], false);
objects.onfire[i]=1;
}
}*/
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( bushrustle, samp[bushrustle], NULL, TRUE);
+ PlaySoundEx( bushrustle, samp[bushrustle], NULL, true);
FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel);
FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity));
- FSOUND_SetPaused(channels[bushrustle], FALSE);
+ FSOUND_SetPaused(channels[bushrustle], false);
if(id==0){
envsound[numenvsounds]=coords;
}
}
objects.messedwith[i]=.5;
- }
+ }
}
}
- if(!skeleton.free){
+ if(!skeleton.free){
bool play;
play=0;
if((stunned>0||surprised>0)&&numplayers>2&&aitype!=passivetype)play=1;
//if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2;
if(whichsound!=-1){
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 512);
- FSOUND_SetPaused(channels[whichsound], FALSE);
- }
- }
+ FSOUND_SetPaused(channels[whichsound], false);
+ }
+ }
if(targetanimation==staggerbackhighanim)staggerdelay=1;
if(targetanimation==staggerbackhardanim)staggerdelay=1;
}
}
/*
- if(speechdelay>.25){
+ if(speechdelay>.25){
if(headmorphend!=2)headmorphness=0;
headmorphend=2;
targetheadmorphness=1;
//if(!creature==wolftype||targetanimation==rabbitkickanim)
if(targetanimation==rabbittackleanim){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*65*scale){
velocity/=velspeed;
velspeed=speed*65*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}
if(targetanimation!=rabbitrunninganim&&targetanimation!=wolfrunninganim){
if(isRun()||targetanimation==rabbitkickanim){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*45*scale){
velocity/=velspeed;
velspeed=speed*45*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed<speed*30*scale)velspeed=speed*30*scale;
velocity=flatfacing*velspeed;
}
}
else if(isRun()){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(creature==rabbittype){
if(velspeed>speed*55*scale){
velocity/=velspeed;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}
/*if(creature==wolftype)
if(isRun()){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*55*scale){
velocity/=velspeed;
velspeed=speed*55*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}*/
if(targetanimation==rollanim&&animation[targetanimation].label[targetframe]!=6){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*45*scale){
velocity/=velspeed;
velspeed=speed*45*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}
/*if(currentanimation==rollanim&&(isCrouch()||isIdle())){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*25*scale){
velocity/=velspeed;
velspeed=speed*25*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}*/
if(targetanimation==sneakanim||targetanimation==walkanim){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*12*scale){
velocity/=velspeed;
velspeed=speed*12*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}
if((targetanimation==fightidleanim||targetanimation==knifefightidleanim)&&(currentanimation==bounceidleanim||currentanimation==hurtidleanim)){
velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*2*scale){
velocity/=velspeed;
velspeed=speed*2*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed;
}
if((targetanimation==bounceidleanim||currentanimation==hurtidleanim)&&(currentanimation==fightidleanim||currentanimation==knifefightidleanim)){
velocity-=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*2*scale){
velocity/=velspeed;
velspeed=speed*2*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed*-1;
}
if(targetanimation==fightsidestep){
velocity+=DoRotation(facing*multiplier*speed*700*scale,0,-90,0);
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*12*scale){
velocity/=velspeed;
velspeed=speed*12*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=DoRotation(flatfacing*velspeed,0,-90,0);
}
if(targetanimation==backhandspringanim){
//coords-=facing*multiplier*50*scale;
velocity+=facing*multiplier*speed*700*scale*-1;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*50*scale){
velocity/=velspeed;
velspeed=speed*50*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed*-1;
}
if(targetanimation==dodgebackanim){
//coords-=facing*multiplier*50*scale;
velocity+=facing*multiplier*speed*700*scale*-1;
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
if(velspeed>speed*60*scale){
velocity/=velspeed;
velspeed=speed*60*scale;
}
velocity.y+=gravity*multiplier*20;
ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity=flatfacing*velspeed*-1;
}
if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
}
if(targetanimation==jumpupanim){jumppower=-4;targetanimation=getIdle();}
target=0;
- targetframe=0;
+ targetframe=0;
onterrain=1;
if(id==0){
- FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], true);
FSOUND_SetVolume(channels[whooshsound], 0);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( landsound, samp[landsound], NULL, TRUE);
+ PlaySoundEx( landsound, samp[landsound], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel);
FSOUND_SetVolume(channels[landsound], 128);
- FSOUND_SetPaused(channels[landsound], FALSE);
+ FSOUND_SetPaused(channels[landsound], false);
if(id==0){
envsound[numenvsounds]=coords;
if(isIdle()||targetanimation==drawrightanim||targetanimation==drawleftanim||targetanimation==crouchdrawrightanim||targetanimation==crouchstabanim||targetanimation==swordgroundstabanim||isStop()||targetanimation==removeknifeanim||targetanimation==crouchremoveknifeanim||isLanding()||isCrouch()||animation[targetanimation].attack||(targetanimation==rollanim&&animation[targetanimation].label[targetframe]==6)){
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity.y=0;
if(velspeed<multiplier*300*scale){
velocity=0;
}
if(isLandhard()){
- velspeed=findLength(&velocity);
+ velspeed=findLength(&velocity);
velocity.y=0;
if(velspeed<multiplier*600*scale){
velocity=0;
vel[1]=velocity.y;
vel[2]=velocity.z;
if(!onterrain||environment==grassyenvironment){
- PlaySoundEx( skidsound, samp[skidsound], NULL, TRUE);
+ PlaySoundEx( skidsound, samp[skidsound], NULL, true);
FSOUND_3D_SetAttributes(channels[skidsound], gLoc, vel);
FSOUND_SetVolume(channels[skidsound], 128*velspeed/10);
- FSOUND_SetPaused(channels[skidsound], FALSE);
+ FSOUND_SetPaused(channels[skidsound], false);
}
else {
- PlaySoundEx( snowskidsound, samp[snowskidsound], NULL, TRUE);
+ PlaySoundEx( snowskidsound, samp[snowskidsound], NULL, true);
FSOUND_3D_SetAttributes(channels[snowskidsound], gLoc, vel);
FSOUND_SetVolume(channels[snowskidsound], 128*velspeed/10);
- FSOUND_SetPaused(channels[snowskidsound], FALSE);
+ FSOUND_SetPaused(channels[snowskidsound], false);
}
}
coords=victim->coords;
}
}
- skeleton.oldfree=skeleton.free;
+ skeleton.oldfree=skeleton.free;
XYZ midterrain;
midterrain=0;
int Person::DrawSkeleton(){
int oldplayerdetail;
- if((frustum.SphereInFrustum(coords.x,coords.y+scale*3,coords.z,scale*8)&&findDistancefast(&viewer,&coords)<viewdistance*viewdistance)||skeleton.free==3){
+ if((frustum.SphereInFrustum(coords.x,coords.y+scale*3,coords.z,scale*8)&&findDistancefast(&viewer,&coords)<viewdistance*viewdistance)||skeleton.free==3){
if(onterrain&&(isIdle()||isCrouch()||wasIdle()||wasCrouch())&&!skeleton.free){
calcrot=1;
}
if(num_weapons>0){
for(k=0;k<num_weapons;k++){
i=weaponids[k];
- if(weaponactive==k){
+ if(weaponactive==k){
if(weapons.type[i]!=staff){
for(j=0;j<skeleton.num_muscles;j++){
if((skeleton.muscles[j].parent1->label==righthand||skeleton.muscles[j].parent2->label==righthand)&&skeleton.muscles[j].numvertices>0){
}*/
}
}
- if(weaponactive!=k&&weaponstuck!=k){
+ if(weaponactive!=k&&weaponstuck!=k){
if(weapons.type[i]==knife)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[righthip]].position-skeleton.joints[skeleton.jointlabels[lefthip]].position)*.1+(skeleton.joints[skeleton.jointlabels[rightshoulder]].position-skeleton.joints[skeleton.jointlabels[leftshoulder]].position)*.35;
if(weapons.type[i]==sword)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33;
if(weapons.type[i]==staff)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33;
}
}
}
- if(weaponstuck==k){
+ if(weaponstuck==k){
if(weaponstuckwhere==0)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5-skeleton.forward*.8;
else weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5+skeleton.forward*.8;
for(j=0;j<skeleton.num_muscles;j++){
weapons.rotation3[i]=0;
weapons.smallrotation[i]=-90;
weapons.smallrotation2[i]=0;
- if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
+ if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
}
if((currentanimation==knifeslashreversalanim&&targetanimation==knifeslashreversalanim)||(currentanimation==knifeslashreversedanim&&targetanimation==knifeslashreversedanim)){
XYZ temppoint1,temppoint2,tempforward;
weapons.rotation3[i]=0;
weapons.smallrotation[i]=90;
weapons.smallrotation2[i]=0;
- if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
+ if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
}
if(targetanimation==knifethrowanim){
weapons.smallrotation[i]=90;
weapons.rotation3[i]=0;
weapons.smallrotation[i]=90;
weapons.smallrotation2[i]=0;
- if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
+ if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
}
}
if(weapons.type[i]==staff){
weapons.rotation3[i]=0;
weapons.smallrotation[i]=90;
weapons.smallrotation2[i]=0;
- if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
+ if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i];
}
}
}
if(targetanimation==jumpupanim){jumppower=-4;targetanimation=getIdle();}
target=0;
- targetframe=0;
+ targetframe=0;
onterrain=1;
if(id==0){
- FSOUND_SetPaused(channels[whooshsound], TRUE);
+ FSOUND_SetPaused(channels[whooshsound], true);
FSOUND_SetVolume(channels[whooshsound], 0);
}
vel[0]=velocity.x;
vel[1]=velocity.y;
vel[2]=velocity.z;
- PlaySoundEx( landsound, samp[landsound], NULL, TRUE);
+ PlaySoundEx( landsound, samp[landsound], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel);
FSOUND_SetVolume(channels[landsound], 128);
- FSOUND_SetPaused(channels[landsound], FALSE);
+ FSOUND_SetPaused(channels[landsound], false);
if(id==0){
envsound[numenvsounds]=coords;
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
#include "Game.h"
extern Game * pgame;
extern bool visibleloading;
-extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
void dealloc2(void* param){
free(param);
objects.SphereCheckPossible(&terrainlight, 1);
/*
for(i=0; i<num_joints; i++){
- oldpos[i]=joints[i].position;
+ oldpos[i]=joints[i].position;
}*/
//Add velocity
//if(!isnormal(joints[i].velocity.x)||!isnormal(joints[i].velocity.y)||!isnormal(joints[i].velocity.z))joints[i].velocity=0;
joints[i].position=joints[i].position+joints[i].velocity*multiplier;
groundlevel=.15;
- if(joints[i].label==head)groundlevel=.8;
- if(joints[i].label==righthand||joints[i].label==rightwrist||joints[i].label==rightelbow)groundlevel=.2;
- if(joints[i].label==lefthand||joints[i].label==leftwrist||joints[i].label==leftelbow)groundlevel=.2;
+ if(joints[i].label==head)groundlevel=.8;
+ if(joints[i].label==righthand||joints[i].label==rightwrist||joints[i].label==rightelbow)groundlevel=.2;
+ if(joints[i].label==lefthand||joints[i].label==leftwrist||joints[i].label==leftelbow)groundlevel=.2;
joints[i].position.y-=groundlevel;
//if(!joints[i].locked&&!broken)joints[i].velocity+=joints[i].velchange*multiplier*10*(500-longdead)/500;
joints[i].oldvelocity=joints[i].velocity;
vel[0]=joints[jointlabels[head]].velocity.x;
vel[1]=joints[jointlabels[head]].velocity.y;
vel[2]=joints[jointlabels[head]].velocity.z;
- PlaySoundEx( landsound1, samp[landsound1], NULL, TRUE);
+ PlaySoundEx( landsound1, samp[landsound1], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel);
FSOUND_SetVolume(channels[landsound1], 128);
- FSOUND_SetPaused(channels[landsound1], FALSE);
+ FSOUND_SetPaused(channels[landsound1], false);
breaking=1;
}
vel[0]=joints[jointlabels[head]].velocity.x;
vel[1]=joints[jointlabels[head]].velocity.y;
vel[2]=joints[jointlabels[head]].velocity.z;
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1;
vel[0]=joints[jointlabels[head]].velocity.x;
vel[1]=joints[jointlabels[head]].velocity.y;
vel[2]=joints[jointlabels[head]].velocity.z;
- PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE);
+ PlaySoundEx( breaksound2, samp[breaksound2], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel);
FSOUND_SetVolume(channels[breaksound2], 300);
- FSOUND_SetPaused(channels[breaksound2], FALSE);
+ FSOUND_SetPaused(channels[breaksound2], false);
envsound[numenvsounds]=*coords;
envsoundvol[numenvsounds]=64;
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
if(tutoriallevel!=1||id==0){
- PlaySoundEx( landsound1, samp[landsound1], NULL, TRUE);
+ PlaySoundEx( landsound1, samp[landsound1], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel);
FSOUND_SetVolume(channels[landsound1], 128);
- FSOUND_SetPaused(channels[landsound1], FALSE);
+ FSOUND_SetPaused(channels[landsound1], false);
}
breaking=1;
}
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
if(tutoriallevel!=1||id==0){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
}
vel[0]=joints[i].velocity.x;
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
- PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE);
+ PlaySoundEx( breaksound2, samp[breaksound2], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel);
FSOUND_SetVolume(channels[breaksound2], 300);
- FSOUND_SetPaused(channels[breaksound2], FALSE);
+ FSOUND_SetPaused(channels[breaksound2], false);
envsound[numenvsounds]=*coords;
envsoundvol[numenvsounds]=64;
if(findLengthfast(&bounceness)>2500){
Normalise(&bounceness);
bounceness=bounceness*50;
- }
+ }
joints[i].velocity+=bounceness*elasticity;
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
if(tutoriallevel!=1||id==0){
- PlaySoundEx( landsound1, samp[landsound1], NULL, TRUE);
+ PlaySoundEx( landsound1, samp[landsound1], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel);
FSOUND_SetVolume(channels[landsound1], 128);
- FSOUND_SetPaused(channels[landsound1], FALSE);
+ FSOUND_SetPaused(channels[landsound1], false);
}
breaking=1;
}
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
if(tutoriallevel!=1||id==0){
- PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE);
+ PlaySoundEx( landsound2, samp[landsound2], NULL, true);
FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel);
FSOUND_SetVolume(channels[landsound2], 128);
- FSOUND_SetPaused(channels[landsound2], FALSE);
+ FSOUND_SetPaused(channels[landsound2], false);
}
}
vel[0]=joints[i].velocity.x;
vel[1]=joints[i].velocity.y;
vel[2]=joints[i].velocity.z;
- PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE);
+ PlaySoundEx( breaksound2, samp[breaksound2], NULL, true);
FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel);
FSOUND_SetVolume(channels[breaksound2], 300);
- FSOUND_SetPaused(channels[breaksound2], FALSE);
+ FSOUND_SetPaused(channels[breaksound2], false);
envsound[numenvsounds]=*coords;
envsoundvol[numenvsounds]=64;
for(i=0; i<num_joints; i++){
groundlevel=.15;
- if(joints[i].label==head)groundlevel=.8;
- if(joints[i].label==righthand||joints[i].label==rightwrist||joints[i].label==rightelbow)groundlevel=.2;
- if(joints[i].label==lefthand||joints[i].label==leftwrist||joints[i].label==leftelbow)groundlevel=.2;
+ if(joints[i].label==head)groundlevel=.8;
+ if(joints[i].label==righthand||joints[i].label==rightwrist||joints[i].label==rightelbow)groundlevel=.2;
+ if(joints[i].label==lefthand||joints[i].label==leftwrist||joints[i].label==leftelbow)groundlevel=.2;
joints[i].position.y+=groundlevel;
joints[i].mass=1;
if(joints[i].label==lefthip||joints[i].label==leftknee||joints[i].label==leftankle||joints[i].label==righthip||joints[i].label==rightknee||joints[i].label==rightankle)joints[i].mass=2;
glVertex3f(muscles[i].parent1->position.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z);
glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z);
}
- }
+ }
glEnd();
if(muscleview!=2){
joints[whichjoint].parent=&joints[which];
joints[whichjoint].hasparent=1;
joints[whichjoint].length=findDistance(&joints[whichjoint].position,&joints[whichjoint].parent->position);
- }
+ }
}
}
funpackf(tfile, "Bf Bf Bf", &weapontarget[i].x,&weapontarget[i].y,&weapontarget[i].z);
}
- fclose(tfile);
+ fclose(tfile);
}
startoffset=0;
funpackf(tfile, "Bi", &lowforwardjoints[j]);
}
for(j=0;j<num_muscles;j++){
- for(i=0;i<muscles[j].numvertices;i++){
- for(int k=0;k<num_models;k++){
+ for(i=0;i<muscles[j].numvertices;i++){
+ for(int k=0;k<num_models;k++){
if(muscles[j].numvertices&&muscles[j].vertices[i]<model[k].vertexNum)model[k].owner[muscles[j].vertices[i]]=j;
}
}
model[k].CalculateNormals(0);
}
}
- fclose(tfile);
+ fclose(tfile);
tfile=fopen( lowfilename, "rb" );
if(1){
}
lSize=sizeof(int);
for(j=0;j<num_muscles;j++){
- for(i=0;i<muscles[j].numverticeslow;i++){
+ for(i=0;i<muscles[j].numverticeslow;i++){
if(muscles[j].numverticeslow&&muscles[j].verticeslow[i]<modellow.vertexNum)modellow.owner[muscles[j].verticeslow[i]]=j;
}
}
}
lSize=sizeof(int);
for(j=0;j<num_muscles;j++){
- for(i=0;i<muscles[j].numverticesclothes;i++){
+ for(i=0;i<muscles[j].numverticesclothes;i++){
if(muscles[j].numverticesclothes&&muscles[j].verticesclothes[i]<modelclothes.vertexNum)modelclothes.owner[muscles[j].verticesclothes[i]]=j;
}
}
}
modelclothes.CalculateNormals(0);
}
- fclose(tfile);
+ fclose(tfile);
for(i=0;i<num_joints;i++){
for(j=0;j<num_joints;j++){
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
extern float bonustime;
extern int tutoriallevel;
extern int numthrowkill;
-extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
-void Weapons::DoStuff(){
+void Weapons::DoStuff(){
static int i,whichpatchx,whichpatchz,j,k,whichhit,m;
static XYZ start,end,colpoint,normalrot,footvel,footpoint;
static XYZ terrainnormal;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( staffbreaksound, samp[staffbreaksound], NULL, TRUE);
+ PlaySoundEx( staffbreaksound, samp[staffbreaksound], NULL, true);
FSOUND_3D_SetAttributes(channels[staffbreaksound], gLoc, vel);
FSOUND_SetVolume(channels[staffbreaksound], 256);
- FSOUND_SetPaused(channels[staffbreaksound], FALSE);
+ FSOUND_SetPaused(channels[staffbreaksound], false);
XYZ tempvel;
XYZ speed;
//speed=(tippoint[i]-oldtippoint[i])/multiplier/6;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
bloody[i]=0;
- sprites.MakeSprite(cloudimpactsprite, position[i],velocity[i], 1,1,1, .8, .3);
+ sprites.MakeSprite(cloudimpactsprite, position[i],velocity[i], 1,1,1, .8, .3);
}
else {
physics[i]=1;
tippoint[i]-=velocity[i]*multiplier;
tipvelocity[i]=velocity[i];
}
- }
+ }
}
}
if(velocity[i].x||velocity[i].y||velocity[i].z)
for(j=0;j<numplayers;j++){
footvel=0;
- footpoint=DoRotation((player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].position+player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].position)/2,0,player[j].rotation,0)*player[j].scale+player[j].coords;
+ footpoint=DoRotation((player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].position+player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].position)/2,0,player[j].rotation,0)*player[j].scale+player[j].coords;
if(owner[i]==-1&&findDistancefastflat(&position[i],&player[j].coords)<1.5&&findDistancefast(&position[i],&player[j].coords)<4&&player[j].weaponstuck==-1&&!player[j].skeleton.free&&j!=oldowner[i]){
if((player[j].aitype!=attacktypecutoff||abs(Random()%6)==0||(player[j].targetanimation!=backhandspringanim&&player[j].targetanimation!=rollanim&&player[j].targetanimation!=flipanim&&Random()%2==0))&&!missed[i]){
bool caught=0;
vel[0]=player[j].velocity.x;
vel[1]=player[j].velocity.y;
vel[2]=player[j].velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE);
+ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
FSOUND_SetVolume(channels[knifedrawsound], 128);
- FSOUND_SetPaused(channels[knifedrawsound], FALSE);
+ FSOUND_SetPaused(channels[knifedrawsound], false);
player[j].weaponactive=0;
player[j].targetanimation=removeknifeanim;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE);
+ PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true);
FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel);
FSOUND_SetVolume(channels[fleshstabsound], 128);
- FSOUND_SetPaused(channels[fleshstabsound], FALSE);
+ FSOUND_SetPaused(channels[fleshstabsound], false);
if(animation[player[0].targetanimation].height==highheight){
bonus=ninja;
}
}
else missed[i]=1;
- }
+ }
}
if(position[i].y<terrain.getHeight(position[i].x,position[i].z)){
if(terrain.getOpacity(position[i].x,position[i].z)<.2){
glRotatef(-rotation3[i],0,1,0);
glRotatef(smallrotation[i],1,0,0);
glRotatef(smallrotation2[i],0,1,0);
- glTranslatef(0,0,1);
+ glTranslatef(0,0,1);
glGetFloatv(GL_MODELVIEW_MATRIX,M);
tippoint[i].x=M[12];
tippoint[i].y=M[13];
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE);
+ PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true);
FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel);
FSOUND_SetVolume(channels[knifesheathesound], 128);
- FSOUND_SetPaused(channels[knifesheathesound], FALSE);
+ FSOUND_SetPaused(channels[knifesheathesound], false);
XYZ terrainlight;
terrainlight=terrain.getLighting(position[i].x,position[i].z);
hitsomething[i]=1;
position[i]+=(colpoint-tippoint[i])+diff*.05;
- tippoint[i]=colpoint+diff*.05;
+ tippoint[i]=colpoint+diff*.05;
oldposition[i]=position[i];
oldtippoint[i]=tippoint[i];
}
hitsomething[i]=1;
tippoint[i]+=(colpoint-position[i])+diff*.05;
- position[i]=colpoint+diff*.05;
+ position[i]=colpoint+diff*.05;
oldtippoint[i]=tippoint[i];
oldposition[i]=tippoint[i];
}
whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]);
if(whichhit!=-1){
hitsomething[i]=1;
- position[i]=colpoint;
+ position[i]=colpoint;
terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1;
ReflectVector(&velocity[i],&terrainnormal);
position[i]+=terrainnormal*.002;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
start=oldtippoint[i];
whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]);
if(whichhit!=-1){
hitsomething[i]=1;
- tippoint[i]=colpoint;
+ tippoint[i]=colpoint;
terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1;
ReflectVector(&tipvelocity[i],&terrainnormal);
tippoint[i]+=terrainnormal*.002;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]);
if(whichhit!=-1){
hitsomething[i]=1;
- mid=colpoint;
+ mid=colpoint;
terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1;
ReflectVector(&velocity[i],&terrainnormal);
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
position[i]+=(mid-oldmid2)*(20/(1+(float)m*10));
}
whichhit=objects.model[k].LineCheck(&start,&end,&colpoint,&objects.position[k],&objects.rotation[k]);
if(whichhit!=-1){
hitsomething[i]=1;
- mid=colpoint;
+ mid=colpoint;
terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1;
ReflectVector(&tipvelocity[i],&terrainnormal);
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
tippoint[i]+=(mid-oldmid2)*(20/(1+(float)m*10));
}
closestswordpoint=colpoint;
velocity[i]+=(closestpoint-closestswordpoint);
tipvelocity[i]+=(closestpoint-closestswordpoint);
- position[i]+=(closestpoint-closestswordpoint);
+ position[i]+=(closestpoint-closestswordpoint);
tippoint[i]+=(closestpoint-closestswordpoint);
}
}
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
if(terrain.getOpacity(position[i].x,position[i].z)<.2){
XYZ terrainlight;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)<.2){
XYZ terrainlight;
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
position[i]+=(mid-oldmid)*20;
}
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
tippoint[i]+=(mid-oldmid)*20;
}
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}
vel[0]=0;
vel[1]=0;
vel[2]=0;
- PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE);
+ PlaySoundEx( whichsound, samp[whichsound], NULL, true);
FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel);
if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness));
else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness));
- FSOUND_SetPaused(channels[whichsound], FALSE);
+ FSOUND_SetPaused(channels[whichsound], false);
}
}*/
}
//velocity[i]=(position[i]-oldposition[i])/multiplier;
- //tipvelocity[i]==(tippoint[i-+oldtippoint[i])/multiplier;
+ //tipvelocity[i]==(tippoint[i-+oldtippoint[i])/multiplier;
if(freetime[i]>.4){
velocity[i]=0;
tipvelocity[i]=0;
if(bloodtoggle){
bloodvel=0;
sprites.MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1);
- }
+ }
}
}
if(onfire[i]){
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glPushMatrix();
glColor4f(terrainlight.x,terrainlight.y,terrainlight.z,j/drawhowmany[i]);
- if(owner[i]!=-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])-.02+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i]));
- if(owner[i]==-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i]));
+ if(owner[i]!=-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])-.02+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i]));
+ if(owner[i]==-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i]));
//glTranslatef(position[i].x,position[i].y-.02,position[i].z);
glRotatef(bigrotation[i]*(((float)(j))/drawhowmany[i])+lastdrawnbigrotation[i]*(1-((float)(j))/drawhowmany[i]),0,1,0);
glRotatef(bigtilt2[i]*(((float)(j))/drawhowmany[i])+lastdrawnbigtilt2[i]*(1-((float)(j))/drawhowmany[i]),1,0,0);
if(type[i]==knife)
{
- glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHTING);
if(!bloody[i]||!bloodtoggle)throwingknifemodel.drawdifftex(knifetextureptr);
if(bloodtoggle)
{
}
if(type[i]==sword)
{
- glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHTING);
if(!bloody[i]||!bloodtoggle)swordmodel.drawdifftex(swordtextureptr);
if(bloodtoggle)
{
}
if(type[i]==staff)
{
- glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHTING);
staffmodel.drawdifftex(stafftextureptr);
}
glRotatef(-rotation3[i],0,1,0);
glRotatef(smallrotation[i],1,0,0);
glRotatef(smallrotation2[i],0,1,0);
- glTranslatef(0,0,length[i]);
+ glTranslatef(0,0,length[i]);
glGetFloatv(GL_MODELVIEW_MATRIX,M);
tippoint[i].x=M[12];
tippoint[i].y=M[13];
unsigned short CharToKey(char* which)
{
// alphabetic keys
- if(!stricmp(which,"a")){
+ if(!strcasecmp(which,"a")){
return MAC_A_KEY;
}
- if(!stricmp(which,"b")){
+ if(!strcasecmp(which,"b")){
return MAC_B_KEY;
}
- if(!stricmp(which,"c")){
+ if(!strcasecmp(which,"c")){
return MAC_C_KEY;
}
- if(!stricmp(which,"d")){
+ if(!strcasecmp(which,"d")){
return MAC_D_KEY;
}
- if(!stricmp(which,"e")){
+ if(!strcasecmp(which,"e")){
return MAC_E_KEY;
}
- if(!stricmp(which,"f")){
+ if(!strcasecmp(which,"f")){
return MAC_F_KEY;
}
- if(!stricmp(which,"g")){
+ if(!strcasecmp(which,"g")){
return MAC_G_KEY;
}
- if(!stricmp(which,"h")){
+ if(!strcasecmp(which,"h")){
return MAC_H_KEY;
}
- if(!stricmp(which,"i")){
+ if(!strcasecmp(which,"i")){
return MAC_I_KEY;
}
- if(!stricmp(which,"j")){
+ if(!strcasecmp(which,"j")){
return MAC_J_KEY;
}
- if(!stricmp(which,"k")){
+ if(!strcasecmp(which,"k")){
return MAC_K_KEY;
}
- if(!stricmp(which,"l")){
+ if(!strcasecmp(which,"l")){
return MAC_L_KEY;
}
- if(!stricmp(which,"m")){
+ if(!strcasecmp(which,"m")){
return MAC_M_KEY;
}
- if(!stricmp(which,"n")){
+ if(!strcasecmp(which,"n")){
return MAC_N_KEY;
}
- if(!stricmp(which,"o")){
+ if(!strcasecmp(which,"o")){
return MAC_O_KEY;
}
- if(!stricmp(which,"p")){
+ if(!strcasecmp(which,"p")){
return MAC_P_KEY;
}
- if(!stricmp(which,"q")){
+ if(!strcasecmp(which,"q")){
return MAC_Q_KEY;
}
- if(!stricmp(which,"r")){
+ if(!strcasecmp(which,"r")){
return MAC_R_KEY;
}
- if(!stricmp(which,"s")){
+ if(!strcasecmp(which,"s")){
return MAC_S_KEY;
}
- if(!stricmp(which,"t")){
+ if(!strcasecmp(which,"t")){
return MAC_T_KEY;
}
- if(!stricmp(which,"u")){
+ if(!strcasecmp(which,"u")){
return MAC_U_KEY;
}
- if(!stricmp(which,"v")){
+ if(!strcasecmp(which,"v")){
return MAC_V_KEY;
}
- if(!stricmp(which,"w")){
+ if(!strcasecmp(which,"w")){
return MAC_W_KEY;
}
- if(!stricmp(which,"x")){
+ if(!strcasecmp(which,"x")){
return MAC_X_KEY;
}
- if(!stricmp(which,"y")){
+ if(!strcasecmp(which,"y")){
return MAC_Y_KEY;
}
- if(!stricmp(which,"z")){
+ if(!strcasecmp(which,"z")){
return MAC_Z_KEY;
}
// keypad keys
- if(!stricmp(which,"KP0")){
+ if(!strcasecmp(which,"KP0")){
return MAC_NUMPAD_0_KEY;
}
- if(!stricmp(which,"KP1")){
+ if(!strcasecmp(which,"KP1")){
return MAC_NUMPAD_1_KEY;
}
- if(!stricmp(which,"KP2")){
+ if(!strcasecmp(which,"KP2")){
return MAC_NUMPAD_2_KEY;
}
- if(!stricmp(which,"KP3")){
+ if(!strcasecmp(which,"KP3")){
return MAC_NUMPAD_3_KEY;
}
- if(!stricmp(which,"KP4")){
+ if(!strcasecmp(which,"KP4")){
return MAC_NUMPAD_4_KEY;
}
- if(!stricmp(which,"KP5")){
+ if(!strcasecmp(which,"KP5")){
return MAC_NUMPAD_5_KEY;
}
- if(!stricmp(which,"KP6")){
+ if(!strcasecmp(which,"KP6")){
return MAC_NUMPAD_6_KEY;
}
- if(!stricmp(which,"KP7")){
+ if(!strcasecmp(which,"KP7")){
return MAC_NUMPAD_7_KEY;
}
- if(!stricmp(which,"KP8")){
+ if(!strcasecmp(which,"KP8")){
return MAC_NUMPAD_8_KEY;
}
- if(!stricmp(which,"KP9")){
+ if(!strcasecmp(which,"KP9")){
return MAC_NUMPAD_9_KEY;
}
// enter
- if(!stricmp(which,"enter")){
+ if(!strcasecmp(which,"enter")){
return MAC_ENTER_KEY;
}
// number keys
- if(!stricmp(which,"0")){
+ if(!strcasecmp(which,"0")){
return MAC_0_KEY;
}
- if(!stricmp(which,"1")){
+ if(!strcasecmp(which,"1")){
return MAC_1_KEY;
}
- if(!stricmp(which,"2")){
+ if(!strcasecmp(which,"2")){
return MAC_2_KEY;
}
- if(!stricmp(which,"3")){
+ if(!strcasecmp(which,"3")){
return MAC_3_KEY;
}
- if(!stricmp(which,"4")){
+ if(!strcasecmp(which,"4")){
return MAC_4_KEY;
}
- if(!stricmp(which,"5")){
+ if(!strcasecmp(which,"5")){
return MAC_5_KEY;
}
- if(!stricmp(which,"6")){
+ if(!strcasecmp(which,"6")){
return MAC_6_KEY;
}
- if(!stricmp(which,"7")){
+ if(!strcasecmp(which,"7")){
return MAC_7_KEY;
}
- if(!stricmp(which,"8")){
+ if(!strcasecmp(which,"8")){
return MAC_8_KEY;
}
- if(!stricmp(which,"9")){
+ if(!strcasecmp(which,"9")){
return MAC_9_KEY;
}
// function keys
- if(!stricmp(which,"F1")){
+ if(!strcasecmp(which,"F1")){
return MAC_F1_KEY;
}
- if(!stricmp(which,"F2")){
+ if(!strcasecmp(which,"F2")){
return MAC_F2_KEY;
}
- if(!stricmp(which,"F3")){
+ if(!strcasecmp(which,"F3")){
return MAC_F3_KEY;
}
- if(!stricmp(which,"F4")){
+ if(!strcasecmp(which,"F4")){
return MAC_F4_KEY;
}
- if(!stricmp(which,"F5")){
+ if(!strcasecmp(which,"F5")){
return MAC_F5_KEY;
}
- if(!stricmp(which,"F6")){
+ if(!strcasecmp(which,"F6")){
return MAC_F6_KEY;
}
- if(!stricmp(which,"F7")){
+ if(!strcasecmp(which,"F7")){
return MAC_F7_KEY;
}
- if(!stricmp(which,"F8")){
+ if(!strcasecmp(which,"F8")){
return MAC_F8_KEY;
}
- if(!stricmp(which,"F9")){
+ if(!strcasecmp(which,"F9")){
return MAC_F9_KEY;
}
- if(!stricmp(which,"F10")){
+ if(!strcasecmp(which,"F10")){
return MAC_F10_KEY;
}
- if(!stricmp(which,"F11")){
+ if(!strcasecmp(which,"F11")){
return MAC_F11_KEY;
}
- if(!stricmp(which,"F12")){
+ if(!strcasecmp(which,"F12")){
return MAC_F12_KEY;
}
// escape
- if(!stricmp(which,"escape")){
+ if(!strcasecmp(which,"escape")){
return MAC_ESCAPE_KEY;
}
- if(!stricmp(which,"backspace")){
+ if(!strcasecmp(which,"backspace")){
return MAC_DELETE_KEY;
}
- if(!stricmp(which,"tab")){
+ if(!strcasecmp(which,"tab")){
return MAC_TAB_KEY;
}
- if(!stricmp(which,"`")){
+ if(!strcasecmp(which,"`")){
return MAC_TILDE_KEY;
}
- if(!stricmp(which,"caps_lock")){
+ if(!strcasecmp(which,"caps_lock")){
return MAC_CAPS_LOCK_KEY;
}
// if(which==){
// return "";
// }
- if(!stricmp(which,"command")){
+ if(!strcasecmp(which,"command")){
return MAC_COMMAND_KEY;
}
- if(!stricmp(which,"option")){
+ if(!strcasecmp(which,"option")){
return MAC_OPTION_KEY;
}
- if(!stricmp(which,"delete")){
+ if(!strcasecmp(which,"delete")){
return MAC_DEL_KEY;
}
- if(!stricmp(which,"insert")){
+ if(!strcasecmp(which,"insert")){
return MAC_INSERT_KEY;
}
- if(!stricmp(which,"home")){
+ if(!strcasecmp(which,"home")){
return MAC_HOME_KEY;
}
- if(!stricmp(which,"end")){
+ if(!strcasecmp(which,"end")){
return MAC_END_KEY;
}
- if(!stricmp(which,"page_up")){
+ if(!strcasecmp(which,"page_up")){
return MAC_PAGE_UP_KEY;
}
- if(!stricmp(which,"page_down")){
+ if(!strcasecmp(which,"page_down")){
return MAC_PAGE_DOWN_KEY;
}
- if(!stricmp(which,"clear")){
+ if(!strcasecmp(which,"clear")){
return MAC_NUMPAD_CLEAR_KEY;
}
- if(!stricmp(which,"control")){
+ if(!strcasecmp(which,"control")){
return MAC_CONTROL_KEY;
}
- if(!stricmp(which,"return")){
+ if(!strcasecmp(which,"return")){
return MAC_RETURN_KEY;
}
- if(!stricmp(which,"space")){
+ if(!strcasecmp(which,"space")){
return MAC_SPACE_KEY;
}
- if(!stricmp(which,"shift")){
+ if(!strcasecmp(which,"shift")){
return MAC_SHIFT_KEY;
}
- if(!stricmp(which,"uparrow")){
+ if(!strcasecmp(which,"uparrow")){
return MAC_ARROW_UP_KEY;
}
- if(!stricmp(which,"downarrow")){
+ if(!strcasecmp(which,"downarrow")){
return MAC_ARROW_DOWN_KEY;
}
- if(!stricmp(which,"leftarrow")){
+ if(!strcasecmp(which,"leftarrow")){
return MAC_ARROW_LEFT_KEY;
}
- if(!stricmp(which,"rightarrow")){
+ if(!strcasecmp(which,"rightarrow")){
return MAC_ARROW_RIGHT_KEY;
}
- if(!stricmp(which,"mouse1")){
+ if(!strcasecmp(which,"mouse1")){
return MAC_MOUSEBUTTON1;
}
- if(!stricmp(which,"mouse2")){
+ if(!strcasecmp(which,"mouse2")){
return MAC_MOUSEBUTTON2;
}
- if(!stricmp(which,"+")){
+ if(!strcasecmp(which,"+")){
return MAC_NUMPAD_PLUS_KEY;
}
- if(!stricmp(which,"*")){
+ if(!strcasecmp(which,"*")){
return MAC_NUMPAD_ASTERISK_KEY;
}
- if(!stricmp(which,"/")){
+ if(!strcasecmp(which,"/")){
return MAC_SLASH_KEY;
}
- if(!stricmp(which,"\\")){
+ if(!strcasecmp(which,"\\")){
return MAC_BACKSLASH_KEY;
}
- if(!stricmp(which,"[")){
+ if(!strcasecmp(which,"[")){
return MAC_LEFTBRACKET_KEY;
}
- if(!stricmp(which,"]")){
+ if(!strcasecmp(which,"]")){
return MAC_RIGHTBRACKET_KEY;
}
- if(!stricmp(which,".")){
+ if(!strcasecmp(which,".")){
return MAC_PERIOD_KEY;
}
- if(!stricmp(which,",")){
+ if(!strcasecmp(which,",")){
return MAC_COMMA_KEY;
}
- if(!stricmp(which,"\"")){
+ if(!strcasecmp(which,"\"")){
return MAC_APOSTROPHE_KEY;
}
- if(!stricmp(which,";")){
+ if(!strcasecmp(which,";")){
return MAC_SEMICOLON_KEY;
}
return UNKNOWN_KEY;
#ifndef WIN32
#if PLATFORM_UNIX
#define GL_GLEXT_PROTOTYPES
- #include "gl.h"
- #include "glu.h"
- #include "glext.h"
+ #include "GL/gl.h"
+ #include "GL/glu.h"
+ #include "GL/glext.h"
#else
- #include <gl.h>
- #include <glu.h>
- #include <glext.h>
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+ #include <GL/glext.h>
#endif
#else
#define WIN32_LEAN_AND_MEAN
signed char F_API OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel)
{
- if (!initialized) return FALSE;
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if (!initialized) return false;
+ if ((channel < 0) || (channel >= num_channels)) return false;
if (pos != NULL)
set_channel_position(channel, pos[0], pos[1], -pos[2]);
// we ignore velocity, since doppler's broken in the Linux AL at the moment...
- return TRUE;
+ return true;
}
void F_API OPENAL_3D_SetDopplerFactor(float scale)
signed char F_API OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags)
{
- if (initialized) return FALSE;
- if (maxsoftwarechannels == 0) return FALSE;
+ if (initialized) return false;
+ if (maxsoftwarechannels == 0) return false;
if (flags != 0) // unsupported.
- return FALSE;
+ return false;
if (!lookup_all_alsyms("./openal.so")) // !!! FIXME: linux specific lib name
{
if (!lookup_all_alsyms("openal.so.1")) // !!! FIXME: linux specific lib name
{
if (!lookup_all_alsyms("openal.so")) // !!! FIXME: linux specific lib name
- return FALSE;
+ return false;
}
}
ALCdevice *dev = alcOpenDevice(NULL);
if (!dev)
- return FALSE;
+ return false;
ALint caps[] = { ALC_FREQUENCY, mixrate, 0 };
ALCcontext *ctx = alcCreateContext(dev, caps);
if (!ctx)
{
alcCloseDevice(dev);
- return FALSE;
+ return false;
}
alcMakeContextCurrent(ctx);
alGenSources(1, &channels[i].sid); // !!! FIXME: verify this didn't fail!
initialized = true;
- return TRUE;
+ return true;
}
void F_API OPENAL_Close()
signed char F_API OPENAL_GetPaused(int channel)
{
- if (!initialized) return FALSE;
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if (!initialized) return false;
+ if ((channel < 0) || (channel >= num_channels)) return false;
if (channels[channel].startpaused)
- return(TRUE);
+ return(true);
ALint state = 0;
alGetSourceiv(channels[channel].sid, AL_SOURCE_STATE, &state);
- return((state == AL_PAUSED) ? TRUE : FALSE);
+ return((state == AL_PAUSED) ? true : false);
}
unsigned int F_API OPENAL_GetLoopMode(int channel)
signed char F_API OPENAL_IsPlaying(int channel)
{
- if (!initialized) return FALSE;
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if (!initialized) return false;
+ if ((channel < 0) || (channel >= num_channels)) return false;
ALint state = 0;
alGetSourceiv(channels[channel].sid, AL_SOURCE_STATE, &state);
- return((state == AL_PLAYING) ? TRUE : FALSE);
+ return((state == AL_PLAYING) ? true : false);
}
int F_API OPENAL_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused)
signed char F_API OPENAL_Sample_SetMode(FSOUND_SAMPLE *sptr, unsigned int mode)
{
- if (!initialized) return FALSE;
- if ((mode != FSOUND_LOOP_NORMAL) && (mode != FSOUND_LOOP_OFF)) return FALSE;
- if (!sptr) return FALSE;
+ if (!initialized) return false;
+ if ((mode != FSOUND_LOOP_NORMAL) && (mode != FSOUND_LOOP_OFF)) return false;
+ if (!sptr) return false;
sptr->mode = mode;
- return TRUE;
+ return true;
}
signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float mindist, float maxdist)
{
- if (!initialized) return FALSE;
- if (sptr == NULL) return FALSE;
+ if (!initialized) return false;
+ if (sptr == NULL) return false;
sptr->min_distance = mindist;
// we ignore maxdist. It's not really important to this game, and the
// FMOD docs suggest that it's worthless anyhow.
signed char F_API OPENAL_SetFrequency(int channel, int freq)
{
- if (!initialized) return FALSE;
+ if (!initialized) return false;
if (channel == FSOUND_ALL)
{
for (int i = 0; i < num_channels; i++)
OPENAL_SetFrequency(i, freq);
- return TRUE;
+ return true;
}
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if ((channel < 0) || (channel >= num_channels)) return false;
if (freq == 8012) // hack
alSourcef(channels[channel].sid, AL_PITCH, 8012.0f / 44100.0f);
else
alSourcef(channels[channel].sid, AL_PITCH, 1.0f);
- return TRUE;
+ return true;
}
signed char F_API OPENAL_SetVolume(int channel, int vol)
{
- if (!initialized) return FALSE;
+ if (!initialized) return false;
if (channel == FSOUND_ALL)
{
for (int i = 0; i < num_channels; i++)
OPENAL_SetVolume(i, vol);
- return TRUE;
+ return true;
}
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if ((channel < 0) || (channel >= num_channels)) return false;
if (vol < 0) vol = 0;
else if (vol > 255) vol = 255;
ALfloat gain = ((ALfloat) vol) / 255.0f;
alSourcef(channels[channel].sid, AL_GAIN, gain);
- return TRUE;
+ return true;
}
signed char F_API OPENAL_SetPaused(int channel, signed char paused)
{
- if (!initialized) return FALSE;
+ if (!initialized) return false;
if (channel == FSOUND_ALL)
{
for (int i = 0; i < num_channels; i++)
OPENAL_SetPaused(i, paused);
- return TRUE;
+ return true;
}
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if ((channel < 0) || (channel >= num_channels)) return false;
ALint state = 0;
if (channels[channel].startpaused)
alSourcePlay(channels[channel].sid);
channels[channel].startpaused = false;
}
- return TRUE;
+ return true;
}
void F_API OPENAL_SetSFXMasterVolume(int volume)
signed char F_API OPENAL_StopSound(int channel)
{
- if (!initialized) return FALSE;
+ if (!initialized) return false;
if (channel == FSOUND_ALL)
{
for (int i = 0; i < num_channels; i++)
OPENAL_StopSound(i);
- return TRUE;
+ return true;
}
- if ((channel < 0) || (channel >= num_channels)) return FALSE;
+ if ((channel < 0) || (channel >= num_channels)) return false;
alSourceStop(channels[channel].sid);
channels[channel].startpaused = false;
- return TRUE;
+ return true;
}
FSOUND_STREAM * F_API OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length)
signed char F_API OPENAL_Stream_Stop(FSOUND_STREAM *stream)
{
- if (!initialized) return FALSE;
+ if (!initialized) return false;
for (int i = 0; i < num_channels; i++)
{
if (channels[i].sample == (FSOUND_SAMPLE *) stream)
channels[i].startpaused = false;
}
}
- return TRUE;
+ return true;
}
signed char F_API OPENAL_Stream_SetMode(FSOUND_STREAM *stream, unsigned int mode)
signed char F_API OPENAL_SetOutput(int outputtype)
{
- return TRUE;
+ return true;
}
#endif