From: Côme Chilliet Date: Thu, 22 Dec 2016 20:04:26 +0000 (+0100) Subject: Fixed warnings, removed unused attributes, broken audio output setting, and so on X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=cd451341c5ee01374268559885871ca9d454cbd0;p=lugaru.git Fixed warnings, removed unused attributes, broken audio output setting, and so on --- diff --git a/Source/Animation/Skeleton.cpp b/Source/Animation/Skeleton.cpp index 191f3cf..8e5cb0c 100644 --- a/Source/Animation/Skeleton.cpp +++ b/Source/Animation/Skeleton.cpp @@ -111,7 +111,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) XYZ bounceness; const int numrepeats = 3; float groundlevel = .15; - int k, m; + int m; unsigned i; XYZ temp; XYZ terrainnormal; @@ -323,8 +323,8 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) } if (terrain.patchobjectnum[whichpatchx][whichpatchz]) for (m = 0; m < terrain.patchobjectnum[whichpatchx][whichpatchz]; m++) { - k = terrain.patchobjects[whichpatchx][whichpatchz][m]; - if (k < Object::objects.size() && k >= 0) + unsigned int k = terrain.patchobjects[whichpatchx][whichpatchz][m]; + if (k < Object::objects.size()) { if (Object::objects[k]->possible) { friction = Object::objects[k]->friction; XYZ start = joints[i].realoldposition; @@ -400,6 +400,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) broken = 1; } } + } } joints[i].realoldposition = joints[i].position * (*scale) + *coords; } @@ -409,13 +410,13 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) if (terrain.patchobjectnum[whichpatchx][whichpatchz]) for (m = 0; m < terrain.patchobjectnum[whichpatchx][whichpatchz]; m++) { - k = terrain.patchobjects[whichpatchx][whichpatchz][m]; + unsigned int k = terrain.patchobjects[whichpatchx][whichpatchz][m]; if (Object::objects[k]->possible) { for (i = 0; i < 26; i++) { //Make this less stupid XYZ start = joints[jointlabels[whichjointstartarray[i]]].position * (*scale) + *coords; XYZ end = joints[jointlabels[whichjointendarray[i]]].position * (*scale) + *coords; - whichhit = Object::objects[k]->model.LineCheckSlidePossible(&start, &end, &temp, &Object::objects[k]->position, &Object::objects[k]->yaw); + whichhit = Object::objects[k]->model.LineCheckSlidePossible(&start, &end, &Object::objects[k]->position, &Object::objects[k]->yaw); if (whichhit != -1) { joints[jointlabels[whichjointendarray[i]]].position = (end - *coords) / (*scale); for (unsigned j = 0; j < muscles.size(); j++) { @@ -636,7 +637,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil model[i].CalculateNormals(0); } - drawmodel.load(modelfilename, 0); + drawmodel.load(modelfilename); drawmodel.Rotate(180, 0, 0); drawmodel.Scale(.04, .04, .04); drawmodel.FlipTexCoords(); @@ -651,7 +652,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil modellow.Scale(.04, .04, .04); modellow.CalculateNormals(0); - drawmodellow.load(modellowfilename, 0); + drawmodellow.load(modellowfilename); drawmodellow.Rotate(180, 0, 0); drawmodellow.Scale(.04, .04, .04); drawmodellow.FlipTexCoords(); @@ -667,7 +668,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil modelclothes.Scale(.041, .04, .041); modelclothes.CalculateNormals(0); - drawmodelclothes.load(modelclothesfilename, 0); + drawmodelclothes.load(modelclothesfilename); drawmodelclothes.Rotate(180, 0, 0); drawmodelclothes.Scale(.04, .04, .04); drawmodelclothes.FlipTexCoords(); diff --git a/Source/Audio/Sounds.cpp b/Source/Audio/Sounds.cpp index 063e0c8..94989a1 100644 --- a/Source/Audio/Sounds.cpp +++ b/Source/Audio/Sounds.cpp @@ -85,7 +85,7 @@ void addEnvSound(XYZ coords, float vol, float life) void emit_sound_at(int soundid, const XYZ &pos, float vol) { PlaySoundEx (soundid, samp[soundid], NULL, true); - OPENAL_3D_SetAttributes_ (channels[soundid], pos, NULL); + OPENAL_3D_SetAttributes_ (channels[soundid], pos); OPENAL_SetVolume (channels[soundid], vol); OPENAL_SetPaused (channels[soundid], false); } @@ -100,7 +100,7 @@ void emit_sound_np(int soundid, float vol) void emit_stream_at(int soundid, const XYZ &pos, float vol) { PlayStreamEx (soundid, samp[soundid], NULL, true); - OPENAL_3D_SetAttributes_ (channels[soundid], pos, NULL); + OPENAL_3D_SetAttributes_ (channels[soundid], pos); OPENAL_SetVolume (channels[soundid], vol); OPENAL_SetPaused (channels[soundid], false); } diff --git a/Source/Audio/openal_wrapper.cpp b/Source/Audio/openal_wrapper.cpp index 84cfd8d..10c86b9 100644 --- a/Source/Audio/openal_wrapper.cpp +++ b/Source/Audio/openal_wrapper.cpp @@ -79,7 +79,7 @@ static void set_channel_position(const int channel, const float x, } -AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz) +AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *, float fx, float fy, float fz, float tx, float ty, float tz) { if (!initialized) return; @@ -90,7 +90,7 @@ AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, listener_position[2] = -pos[2]; } - ALfloat vec[6] = { fx, fy, -fz, tz, ty, -tz }; + ALfloat vec[6] = { fx, fy, -fz, tx, ty, -tz }; alListenerfv(AL_ORIENTATION, vec); // we ignore velocity, since doppler's broken in the Linux AL at the moment... @@ -102,7 +102,7 @@ AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, } } -AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel) +AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos) { if (!initialized) return false; @@ -117,7 +117,7 @@ AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos, const return true; } -AL_API signed char OPENAL_3D_SetAttributes_(int channel, const XYZ &pos, const float *vel) +AL_API signed char OPENAL_3D_SetAttributes_(int channel, const XYZ &pos) { if (!initialized) return false; @@ -566,11 +566,6 @@ AL_API void OPENAL_Update() alcProcessContext(alcGetCurrentContext()); } -AL_API signed char OPENAL_SetOutput(int outputtype) -{ - return true; -} - extern int channels[]; extern "C" void PlaySoundEx(int chan, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) diff --git a/Source/Audio/openal_wrapper.hpp b/Source/Audio/openal_wrapper.hpp index 300bec2..2149732 100644 --- a/Source/Audio/openal_wrapper.hpp +++ b/Source/Audio/openal_wrapper.hpp @@ -73,12 +73,6 @@ typedef struct OPENAL_SAMPLE OPENAL_SAMPLE; typedef OPENAL_SAMPLE OPENAL_STREAM; typedef struct OPENAL_DSPUNIT OPENAL_DSPUNIT; -enum OPENAL_OUTPUTTYPES { - OPENAL_OUTPUT_NOSOUND, /* NoSound driver, all calls to this succeed but do nothing. */ - OPENAL_OUTPUT_OSS, /* Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */ - OPENAL_OUTPUT_ALSA, /* Linux Alsa driver. */ -}; - #define OPENAL_LOOP_OFF 0x00000001 /* For non looping samples. */ #define OPENAL_LOOP_NORMAL 0x00000002 /* For forward looping samples. */ #define OPENAL_HW3D 0x00001000 /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */ @@ -94,8 +88,8 @@ extern "C" { #define AL_API AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz); - AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel); - AL_API signed char OPENAL_3D_SetAttributes_(int channel, const XYZ &pos, const float *vel); + AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos); + AL_API signed char OPENAL_3D_SetAttributes_(int channel, const XYZ &pos); AL_API signed char OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags); AL_API void OPENAL_Close(); AL_API OPENAL_SAMPLE *OPENAL_Sample_Load(int index, const char *name_or_data, unsigned int mode, int offset, int length); @@ -107,7 +101,6 @@ extern "C" { AL_API signed char OPENAL_StopSound(int channel); AL_API signed char OPENAL_Stream_SetMode(OPENAL_STREAM *stream, unsigned int mode); AL_API void OPENAL_Update(); - AL_API signed char OPENAL_SetOutput(int outputtype); void PlaySoundEx(int chan, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); void PlayStreamEx(int chan, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); diff --git a/Source/Devtools/ConsoleCmds.cpp b/Source/Devtools/ConsoleCmds.cpp index 1453364..f69984b 100644 --- a/Source/Devtools/ConsoleCmds.cpp +++ b/Source/Devtools/ConsoleCmds.cpp @@ -128,7 +128,7 @@ static void set_metal(int pnum, const char *args) Person::players[pnum]->metallow = low; } -static void set_noclothes(int pnum, const char *args) +static void set_noclothes(int pnum, const char*) { Person::players[pnum]->numclothes = 0; Person::players[pnum]->skeleton.drawmodel.textureptr.load( @@ -156,7 +156,7 @@ static void set_clothes(int pnum, const char *args) /* Console commands themselves */ -void ch_quit(const char *args) +void ch_quit(const char *) { tryquit = 1; } @@ -211,9 +211,10 @@ void ch_save(const char *args) fpackf(tfile, "Bi", Object::objects.size()); - for (int k = 0; k < Object::objects.size(); k++) + for (unsigned int k = 0; k < Object::objects.size(); k++) { fpackf(tfile, "Bi Bf Bf Bf Bf Bf Bf", Object::objects[k]->type, Object::objects[k]->yaw, Object::objects[k]->pitch, Object::objects[k]->position.x, Object::objects[k]->position.y, Object::objects[k]->position.z, Object::objects[k]->scale); + } fpackf(tfile, "Bi", Hotspot::hotspots.size()); for (unsigned i = 0; i < Hotspot::hotspots.size(); i++) { @@ -295,7 +296,7 @@ void ch_save(const char *args) fclose(tfile); } -void ch_cellar(const char *args) +void ch_cellar(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Furdarko.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } @@ -383,7 +384,7 @@ void ch_armornear(const char *args) set_armor(closest, args); } -void ch_protectionreset(const char *args) +void ch_protectionreset(const char *) { set_protection(0, "1 1 1"); set_armor(0, "1 1 1"); @@ -418,13 +419,13 @@ void ch_clothesnear(const char *args) set_clothes(closest, args); } -void ch_belt(const char *args) +void ch_belt(const char *) { Person::players[0]->skeleton.clothes = !Person::players[0]->skeleton.clothes; } -void ch_cellophane(const char *args) +void ch_cellophane(const char *) { cellophane = !cellophane; float mul = (cellophane ? 0 : 1); @@ -437,7 +438,7 @@ void ch_cellophane(const char *args) } } -void ch_funnybunny(const char *args) +void ch_funnybunny(const char *) { Person::players[0]->creature = rabbittype; Person::players[0]->skeletonLoad(true); @@ -447,7 +448,7 @@ void ch_funnybunny(const char *args) set_proportion(0, "1 1 1 1"); } -void ch_wolfie(const char *args) +void ch_wolfie(const char *) { Person::players[0]->creature = wolftype; Person::players[0]->skeletonLoad(); @@ -460,42 +461,42 @@ void ch_wolfieisgod(const char *args) ch_wolfie(args); } -void ch_wolf(const char *args) +void ch_wolf(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Wolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_snowwolf(const char *args) +void ch_snowwolf(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/SnowWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_darkwolf(const char *args) +void ch_darkwolf(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/DarkWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_lizardwolf(const char *args) +void ch_lizardwolf(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/LizardWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_white(const char *args) +void ch_white(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_brown(const char *args) +void ch_brown(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur3.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_black(const char *args) +void ch_black(const char *) { Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur2.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_sizemin(const char *args) +void ch_sizemin(const char *) { for (unsigned i = 1; i < Person::players.size(); i++) if (Person::players[i]->scale < 0.8 * 0.2) @@ -577,43 +578,43 @@ void ch_fixtype(const char *args) Dialog::dialogs[0].type = dlg; } -void ch_fixrotation(const char *args) +void ch_fixrotation(const char *) { int playerId = Dialog::currentScene().participantfocus; Dialog::currentDialog().participantyaw[playerId] = Person::players[playerId]->yaw; } -void ch_ddialogue(const char *args) +void ch_ddialogue(const char *) { if (!Dialog::dialogs.empty()) { Dialog::dialogs.pop_back(); } } -void ch_dhs(const char *args) +void ch_dhs(const char *) { if (!Hotspot::hotspots.empty()) { Hotspot::hotspots.pop_back(); } } -void ch_immobile(const char *args) +void ch_immobile(const char *) { Person::players[0]->immobile = 1; } -void ch_allimmobile(const char *args) +void ch_allimmobile(const char *) { for (unsigned i = 1; i < Person::players.size(); i++) Person::players[i]->immobile = 1; } -void ch_mobile(const char *args) +void ch_mobile(const char *) { Person::players[0]->immobile = 0; } -void ch_default(const char *args) +void ch_default(const char *) { Person::players[0]->armorhead = 1; Person::players[0]->armorhigh = 1; @@ -663,22 +664,22 @@ void ch_play(const char *args) Dialog::currentDialog().play(); } -void ch_mapkilleveryone(const char *args) +void ch_mapkilleveryone(const char *) { maptype = mapkilleveryone; } -void ch_mapkillmost(const char *args) +void ch_mapkillmost(const char *) { maptype = mapkillmost; } -void ch_mapkillsomeone(const char *args) +void ch_mapkillsomeone(const char *) { maptype = mapkillsomeone; } -void ch_mapgosomewhere(const char *args) +void ch_mapgosomewhere(const char *) { maptype = mapgosomewhere; } @@ -729,7 +730,7 @@ void ch_skylight(const char *args) Object::DoShadows(); } -void ch_skybox(const char *args) +void ch_skybox(const char*) { skyboxtexture = !skyboxtexture; diff --git a/Source/Environment/Terrain.cpp b/Source/Environment/Terrain.cpp index e85b71f..9c8b96a 100644 --- a/Source/Environment/Terrain.cpp +++ b/Source/Environment/Terrain.cpp @@ -770,7 +770,7 @@ void Terrain::drawpatchother(int whichx, int whichy, float opacity) glDisableClientState(GL_TEXTURE_COORD_ARRAY); } -void Terrain::drawpatchotherother(int whichx, int whichy, float opacity) +void Terrain::drawpatchotherother(int whichx, int whichy) { glEnable(GL_BLEND); UpdateTransparencyotherother(whichx, whichy); @@ -983,7 +983,7 @@ void Terrain::draw(int layer) if (layer == 1 && textureness[i][j] != allfirst) drawpatchother(i, j, opacity); if (layer == 2 && textureness[i][j] != allfirst) - drawpatchotherother(i, j, opacity); + drawpatchotherother(i, j); } glPopMatrix(); } diff --git a/Source/Environment/Terrain.hpp b/Source/Environment/Terrain.hpp index 444a47b..f6525c4 100644 --- a/Source/Environment/Terrain.hpp +++ b/Source/Environment/Terrain.hpp @@ -68,7 +68,7 @@ public: short size; int patchobjectnum[subdivision][subdivision]; - int patchobjects[subdivision][subdivision][300]; + unsigned int patchobjects[subdivision][subdivision][300]; float scale; int type; @@ -124,7 +124,7 @@ public: private: void drawpatch(int whichx, int whichy, float opacity); void drawpatchother(int whichx, int whichy, float opacity); - void drawpatchotherother(int whichx, int whichy, float opacity); + void drawpatchotherother(int whichx, int whichy); void UpdateTransparency(int whichx, int whichy); void UpdateTransparencyother(int whichx, int whichy); void UpdateTransparencyotherother(int whichx, int whichy); diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 73673ee..37593a1 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -68,7 +68,7 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; -void LOG(const std::string &fmt, ...) +void LOG(const std::string &, ...) { // !!! FIXME: write me. } @@ -123,7 +123,7 @@ void Game::deleteGame() -void LoadSave(const std::string& fileName, GLuint *textureid, bool mipmap, GLubyte *array, int *skinsize) +void LoadSave(const std::string& fileName, GLubyte *array) { LOGFUNC; @@ -554,33 +554,7 @@ void Game::InitGame() LOG("Initializing sound system..."); -#if PLATFORM_LINUX - unsigned char rc = 0; - int output = OPENAL_OUTPUT_ALSA; // Try alsa first... - if (commandLineOptions[SOUND]) { - output = commandLineOptions[SOUND].last()->type(); // ...but let user override that. - } - - OPENAL_SetOutput(output); - if ((rc = OPENAL_Init(44100, 32, 0)) == false) { - // if we tried ALSA and failed, fall back to OSS. - if ( (output == OPENAL_OUTPUT_ALSA) && (commandLineOptions[SOUND].last()->type() != OPENAL_OUTPUT_ALSA) ) { - OPENAL_Close(); - output = OPENAL_OUTPUT_OSS; - OPENAL_SetOutput(output); - rc = OPENAL_Init(44100, 32, 0); - } - } - - if (rc == false) { - OPENAL_Close(); - output = OPENAL_OUTPUT_NOSOUND; // we tried! just do silence. - OPENAL_SetOutput(output); - rc = OPENAL_Init(44100, 32, 0); - } -#else OPENAL_Init(44100, 32, 0); -#endif OPENAL_SetSFXMasterVolume((int)(volume * 255)); loadAllSounds(); @@ -692,14 +666,14 @@ void Game::LoadStuff() Weapon::lightbloodswordtextureptr.load("Textures/SwordBloodLight.jpg", 1); Weapon::stafftextureptr.load("Textures/Staff.jpg", 1); - Weapon::throwingknifemodel.load("Models/ThrowingKnife.solid", 1); + Weapon::throwingknifemodel.load("Models/ThrowingKnife.solid"); Weapon::throwingknifemodel.Scale(.001, .001, .001); Weapon::throwingknifemodel.Rotate(90, 0, 0); Weapon::throwingknifemodel.Rotate(0, 90, 0); Weapon::throwingknifemodel.flat = 0; Weapon::throwingknifemodel.CalculateNormals(1); - Weapon::swordmodel.load("Models/Sword.solid", 1); + Weapon::swordmodel.load("Models/Sword.solid"); Weapon::swordmodel.Scale(.001, .001, .001); Weapon::swordmodel.Rotate(90, 0, 0); Weapon::swordmodel.Rotate(0, 90, 0); @@ -707,7 +681,7 @@ void Game::LoadStuff() Weapon::swordmodel.flat = 1; Weapon::swordmodel.CalculateNormals(1); - Weapon::staffmodel.load("Models/Staff.solid", 1); + Weapon::staffmodel.load("Models/Staff.solid"); Weapon::staffmodel.Scale(.005, .005, .005); Weapon::staffmodel.Rotate(90, 0, 0); Weapon::staffmodel.Rotate(0, 90, 0); @@ -770,7 +744,7 @@ void Game::LoadStuff() viewer.x = terrain.size / 2 * terrain.scale; viewer.z = terrain.size / 2 * terrain.scale; - hawk.load("Models/Hawk.solid", 1); + hawk.load("Models/Hawk.solid"); hawk.Scale(.03, .03, .03); hawk.Rotate(90, 1, 1); hawk.CalculateNormals(0); @@ -779,20 +753,20 @@ void Game::LoadStuff() hawkcoords.z = terrain.size / 2 * terrain.scale - 5 - 7; hawkcoords.y = terrain.getHeight(hawkcoords.x, hawkcoords.z) + 25; - eye.load("Models/Eye.solid", 1); + eye.load("Models/Eye.solid"); eye.Scale(.03, .03, .03); eye.CalculateNormals(0); - cornea.load("Models/Cornea.solid", 1); + cornea.load("Models/Cornea.solid"); cornea.Scale(.03, .03, .03); cornea.CalculateNormals(0); - iris.load("Models/Iris.solid", 1); + iris.load("Models/Iris.solid"); iris.Scale(.03, .03, .03); iris.CalculateNormals(0); - LoadSave("Textures/BloodFur.png", 0, 1, &bloodText[0], 0); - LoadSave("Textures/WolfBloodFur.png", 0, 1, &wolfbloodText[0], 0); + LoadSave("Textures/BloodFur.png", &bloodText[0]); + LoadSave("Textures/WolfBloodFur.png", &wolfbloodText[0]); oldenvironment = -4; diff --git a/Source/Graphic/Models.cpp b/Source/Graphic/Models.cpp index f58962c..0c403c2 100644 --- a/Source/Graphic/Models.cpp +++ b/Source/Graphic/Models.cpp @@ -103,7 +103,7 @@ int Model::LineCheckPossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) return firstintersecting; } -int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate) +int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *move, float *rotate) { static int j; static float distance; @@ -463,7 +463,7 @@ bool Model::loadnotex(const std::string& filename) } -bool Model::load(const std::string& filename, bool texture) +bool Model::load(const std::string& filename) { FILE *tfile; long i; @@ -536,7 +536,7 @@ bool Model::load(const std::string& filename, bool texture) return true; } -bool Model::loaddecal(const std::string& filename, bool texture ) +bool Model::loaddecal(const std::string& filename) { FILE *tfile; long i, j; diff --git a/Source/Graphic/Models.hpp b/Source/Graphic/Models.hpp index 27f3c7d..de4526e 100644 --- a/Source/Graphic/Models.hpp +++ b/Source/Graphic/Models.hpp @@ -119,14 +119,14 @@ public: int SphereCheckPossible(XYZ *p1, float radius, XYZ *move, float *rotate); int LineCheck(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate); int LineCheckPossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate); - int LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate); + int LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *move, float *rotate); void UpdateVertexArray(); void UpdateVertexArrayNoTex(); void UpdateVertexArrayNoTexNoNorm(); bool loadnotex(const std::string& filename); bool loadraw(const std::string& filename); - bool load(const std::string& filename, bool texture); - bool loaddecal(const std::string& filename, bool texture); + bool load(const std::string& filename); + bool loaddecal(const std::string& filename); void Scale(float xscale, float yscale, float zscale); void FlipTexCoords(); void UniformTexCoords(); diff --git a/Source/Menu/Menu.cpp b/Source/Menu/Menu.cpp index 4c4abfa..349ff67 100644 --- a/Source/Menu/Menu.cpp +++ b/Source/Menu/Menu.cpp @@ -905,7 +905,7 @@ void Menu::Tick() } -int setKeySelected_thread(void* data) +int setKeySelected_thread(void*) { using namespace Game; int scancode = -1; diff --git a/Source/Objects/Object.cpp b/Source/Objects/Object.cpp index c91e5d8..06665de 100644 --- a/Source/Objects/Object.cpp +++ b/Source/Objects/Object.cpp @@ -80,35 +80,35 @@ Object::Object(object_type _type, XYZ _position, float _yaw, float _pitch, float switch(type) { case boxtype: - model.loaddecal("Models/Box.solid", 0); + model.loaddecal("Models/Box.solid"); friction = 1.5; break; case cooltype: - model.loaddecal("Models/Cool.solid", 0); + model.loaddecal("Models/Cool.solid"); friction = 1.5; break; case walltype: - model.loaddecal("Models/Wall.solid", 0); + model.loaddecal("Models/Wall.solid"); friction = 1.5; break; case tunneltype: - model.loaddecal("Models/Tunnel.solid", 0); + model.loaddecal("Models/Tunnel.solid"); friction = 1.5; break; case chimneytype: - model.loaddecal("Models/Chimney.solid", 0); + model.loaddecal("Models/Chimney.solid"); friction = 1.5; break; case spiketype: - model.load("Models/Spike.solid", 0); + model.load("Models/Spike.solid"); friction = .4; break; case weirdtype: - model.loaddecal("Models/Weird.solid", 0); + model.loaddecal("Models/Weird.solid"); friction = 1.5; break; case rocktype: - model.loaddecal("Models/Rock.solid", 0); + model.loaddecal("Models/Rock.solid"); if (scale > .5) { friction = 1.5; } else { @@ -116,20 +116,20 @@ Object::Object(object_type _type, XYZ _position, float _yaw, float _pitch, float } break; case treetrunktype: - model.load("Models/TreeTrunk.solid", 0); + model.load("Models/TreeTrunk.solid"); friction = .4; break; case treeleavestype: scale += fabs((float)(Random() % 100) / 900) * scale; - model.load("Models/Leaves.solid", 0); + model.load("Models/Leaves.solid"); friction = 0; break; case bushtype: position.y = terrain.getHeight(position.x, position.z) - .3; - model.load("Models/Bush.solid", 0); + model.load("Models/Bush.solid"); break; case platformtype: - model.loaddecal("Models/Platform.solid", 0); + model.loaddecal("Models/Platform.solid"); model.Rotate(90, 0, 0); friction = 1.5; break; diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 063f40f..a500e2a 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -1945,7 +1945,7 @@ void Person::DoAnimations() vel[2] = velocity.z; if (id == 0) { - OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); + OPENAL_3D_SetAttributes(channels[whooshsound], gLoc); OPENAL_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)) @@ -4290,7 +4290,7 @@ void Person::DoStuff() static XYZ flatfacing; static XYZ flatvelocity; static float flatvelspeed; - static int i, l; + static int l; static int bloodsize; static int startx, starty, endx, endy; static GLubyte color; @@ -4382,7 +4382,7 @@ void Person::DoStuff() vel[2] = velocity.z; if (id == 0) { - OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); + OPENAL_3D_SetAttributes(channels[whooshsound], gLoc); OPENAL_SetVolume(channels[whooshsound], 64 * findLength(&velocity) / 5); } } @@ -4540,7 +4540,7 @@ void Person::DoStuff() if (endy < starty) endy = starty; - for (i = startx; i < endx; i++) { + for (int i = startx; i < endx; i++) { for (int j = starty; j < endy; j++) { if (Random() % 2 == 0) { color = Random() % 85 + 170; @@ -4806,8 +4806,9 @@ void Person::DoStuff() } } - if (dead != 1) + if (dead != 1) { unconscioustime = 0; + } if (dead == 1 || howactive == typesleeping) { unconscioustime += multiplier; @@ -4908,13 +4909,12 @@ void Person::DoStuff() damage += 20; } - if (!dead) + if (!dead) { damage -= multiplier * 13; - if (!dead) permanentdamage -= multiplier * 4; - if (isIdle() || isCrouch()) { - if (!dead) + if (isIdle() || isCrouch()) { permanentdamage -= multiplier * 4; + } } if (damage < 0) damage = 0; @@ -5088,7 +5088,7 @@ void Person::DoStuff() canrecover = 0; if (velocity.y < -30) canrecover = 0; - for (i = 0; i < Object::objects.size(); i++) { + for (unsigned int i = 0; i < Object::objects.size(); i++) { if (Object::objects[i]->type != treeleavestype && Object::objects[i]->type != bushtype && Object::objects[i]->type != firetype) { colviewer = startpoint; coltarget = endpoint; @@ -5280,7 +5280,7 @@ void Person::DoStuff() if (aitype != passivetype || skeleton.free == 1) if (findLengthfast(&velocity) > .1) - for (i = 0; i < Object::objects.size(); i++) { + for (unsigned int i = 0; i < Object::objects.size(); i++) { if (Object::objects[i]->type == firetype) if (distsqflat(&coords, &Object::objects[i]->position) < Object::objects[i]->scale*Object::objects[i]->scale * 12 && distsq(&coords, &Object::objects[i]->position) < Object::objects[i]->scale*Object::objects[i]->scale * 49) { if (onfire) { @@ -5433,8 +5433,8 @@ void Person::DoStuff() play = 0; if (play && aitype != playercontrolled) { int whichsound = -1; - i = abs(Random() % 4); if (speechdelay <= 0) { + unsigned int i = abs(Random() % 4); if (creature == rabbittype) { if (i == 0) whichsound = rabbitchitter; @@ -6861,12 +6861,12 @@ int Person::SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate, int findPathDist(int start, int end) { - int smallestcount, connected; + int connected; int closest; - smallestcount = 1000; + unsigned int smallestcount = 1000; for (char i = 0; i < 50; i++) { - unsigned count = 0; + unsigned int count = 0; int last = start; int last2 = -1; int last3 = -1; @@ -6897,8 +6897,9 @@ int findPathDist(int start, int end) last = closest; count++; } - if (count < smallestcount) + if (count < smallestcount) { smallestcount = count; + } } return smallestcount; } diff --git a/Source/main.cpp b/Source/main.cpp index 1ee05a5..79c139f 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -577,9 +577,7 @@ const option::Descriptor usage[] = {FULLSCREEN, 0, "w", "windowed", option::Arg::None, " -w, --windowed Start the game in windowed mode (default)." }, {NOMOUSEGRAB, 1, "", "nomousegrab", option::Arg::None, " --nomousegrab Disable mousegrab." }, {NOMOUSEGRAB, 0, "", "mousegrab", option::Arg::None, " --mousegrab Enable mousegrab (default)." }, - {SOUND, OPENAL_OUTPUT_NOSOUND, "", "nosound", option::Arg::None, " --nosound Disable sound." }, - {SOUND, OPENAL_OUTPUT_ALSA, "", "force-alsa", option::Arg::None, " --force-alsa Force use of ALSA back-end." }, - {SOUND, OPENAL_OUTPUT_OSS, "", "force-oss", option::Arg::None, " --force-oss Force use of OSS back-end." }, + {SOUND, 1, "", "nosound", option::Arg::None, " --nosound Disable sound." }, {OPENALINFO, 0, "", "openal-info", option::Arg::None, " --openal-info Print info about OpenAL at launch." }, {SHOWRESOLUTIONS, 0, "", "showresolutions", option::Arg::None, " --showresolutions List the resolutions found by SDL at launch." }, {DEVTOOLS, 0, "d", "devtools", option::Arg::None, " -d, --devtools Enable dev tools: console, level editor and debug info." },