2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
5 This file is part of Lugaru.
7 Lugaru is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 Lugaru is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
23 #include "Animation/Animation.hpp"
24 #include "Audio/openal_wrapper.hpp"
25 #include "Graphic/Texture.hpp"
26 #include "Menu/Menu.hpp"
27 #include "Utils/Folders.hpp"
29 extern float screenwidth, screenheight;
30 extern float viewdistance;
32 extern float fadestart;
33 extern float texscale;
36 extern Terrain terrain;
37 extern int kTextureSize;
38 extern float texdetail;
39 extern float realtexdetail;
42 extern bool cellophane;
43 extern GLubyte bloodText[512 * 512 * 3];
44 extern GLubyte wolfbloodText[512 * 512 * 3];
45 extern bool ismotionblur;
46 extern bool trilinear;
47 extern bool musictoggle;
48 extern int environment;
49 extern bool ambientsound;
50 extern float multiplier;
51 extern int netdatanew;
53 extern bool stillloading;
55 extern bool visibleloading;
56 extern float flashamount, flashr, flashg, flashb;
57 extern int flashdelay;
58 extern int whichjointstartarray[26];
59 extern int whichjointendarray[26];
60 extern float slomospeed;
61 extern bool gamestarted;
63 extern float accountcampaignhighscore[10];
64 extern float accountcampaignfasttime[10];
65 extern float accountcampaignscore[10];
66 extern float accountcampaigntime[10];
68 extern int accountcampaignchoicesmade[10];
69 extern int accountcampaignchoices[10][5000];
71 void LOG(const std::string &fmt, ...)
73 // !!! FIXME: write me.
80 if (Game::endgame == 2) {
81 Account::active().endGame();
85 Account::saveFile(Folders::getUserSavePath());
89 LOG("Shutting down sound system...");
91 OPENAL_StopSound(OPENAL_ALL);
93 // this is causing problems on Linux, but we'll force an _exit() a little
94 // later in the shutdown process. --ryan.
97 for (int i = 0; i < sounds_count; ++i) {
98 OPENAL_Sample_Free(samp[i]);
108 skybox = new SkyBox();
111 void Game::deleteGame()
118 glDeleteTextures(1, &screentexture);
119 glDeleteTextures(1, &screentexture2);
126 void LoadSave(const std::string& fileName, GLuint *textureid, bool mipmap, GLubyte *array, int *skinsize)
130 LOG(std::string("Loading (S)...") + fileName);
133 float temptexdetail = texdetail;
138 if (!load_image(Folders::getResourcePath(fileName).c_str(), texture)) {
139 texdetail = temptexdetail;
142 texdetail = temptexdetail;
144 int bytesPerPixel = texture.bpp / 8;
147 for (int i = 0; i < (int)(texture.sizeY * texture.sizeX * bytesPerPixel); i++) {
148 if ((i + 1) % 4 || bytesPerPixel == 3) {
149 array[tempnum] = texture.data[i];
157 //***************> ResizeGLScene() <******/
158 GLvoid Game::ReSizeGLScene(float fov, float pnear)
160 if (screenheight == 0) {
164 glViewport(0, 0, screenwidth, screenheight);
166 glMatrixMode(GL_PROJECTION);
169 gluPerspective(fov, (GLfloat)screenwidth / (GLfloat)screenheight, pnear, viewdistance);
171 glMatrixMode(GL_MODELVIEW);
175 void Game::LoadingScreen()
177 static float loadprogress;
178 static AbsoluteTime frametime = {0, 0};
179 AbsoluteTime currTime = UpTime ();
180 double deltaTime = (float) AbsoluteDeltaToDuration (currTime, frametime);
182 if (0 > deltaTime) // if negative microseconds
183 deltaTime /= -1000000.0;
184 else // else milliseconds
187 multiplier = deltaTime;
188 if (multiplier < .001)
192 if (multiplier > .05) {
193 frametime = currTime; // reset for next time interval
197 glClearColor(0, 0, 0, 1);
198 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
201 loadtime += multiplier * 4;
203 loadprogress = loadtime;
204 if (loadprogress > 100)
209 glEnable(GL_TEXTURE_2D);
210 loadscreentexture.bind();
211 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
212 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
213 glDisable(GL_DEPTH_TEST);
214 glDisable(GL_CULL_FACE);
215 glDisable(GL_LIGHTING);
217 glMatrixMode(GL_PROJECTION);
220 glOrtho(0, screenwidth, 0, screenheight, -100, 100);
221 glMatrixMode(GL_MODELVIEW);
224 glTranslatef(screenwidth / 2, screenheight / 2, 0);
225 glScalef((float)screenwidth / 2, (float)screenheight / 2, 1);
226 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
228 glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, 1);
231 glTexCoord2f(.1 - loadprogress / 100, 0 + loadprogress / 100 + .3);
232 glVertex3f(-1, -1, 0.0f);
233 glTexCoord2f(.1 - loadprogress / 100, 0 + loadprogress / 100 + .3);
234 glVertex3f(1, -1, 0.0f);
235 glTexCoord2f(.1 - loadprogress / 100, 1 + loadprogress / 100 + .3);
236 glVertex3f(1, 1, 0.0f);
237 glTexCoord2f(.1 - loadprogress / 100, 1 + loadprogress / 100 + .3);
238 glVertex3f(-1, 1, 0.0f);
244 glTexCoord2f(.4 + loadprogress / 100, 0 + loadprogress / 100);
245 glVertex3f(-1, -1, 0.0f);
246 glTexCoord2f(.4 + loadprogress / 100, 0 + loadprogress / 100);
247 glVertex3f(1, -1, 0.0f);
248 glTexCoord2f(.4 + loadprogress / 100, 1 + loadprogress / 100);
249 glVertex3f(1, 1, 0.0f);
250 glTexCoord2f(.4 + loadprogress / 100, 1 + loadprogress / 100);
251 glVertex3f(-1, 1, 0.0f);
254 glDisable(GL_TEXTURE_2D);
255 glMatrixMode(GL_PROJECTION);
257 glMatrixMode(GL_MODELVIEW);
262 glEnable(GL_TEXTURE_2D);
263 loadscreentexture.bind();
264 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
265 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
266 glDisable(GL_DEPTH_TEST);
267 glDisable(GL_CULL_FACE);
268 glDisable(GL_LIGHTING);
270 glMatrixMode(GL_PROJECTION);
273 glOrtho(0, screenwidth, 0, screenheight, -100, 100);
274 glMatrixMode(GL_MODELVIEW);
277 glTranslatef(screenwidth / 2, screenheight / 2, 0);
278 glScalef((float)screenwidth / 2 * (1.5 - (loadprogress) / 200), (float)screenheight / 2 * (1.5 - (loadprogress) / 200), 1);
279 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
281 glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, 1);
284 glTexCoord2f(0 + .5, 0 + .5);
285 glVertex3f(-1, -1, 0.0f);
286 glTexCoord2f(1 + .5, 0 + .5);
287 glVertex3f(1, -1, 0.0f);
288 glTexCoord2f(1 + .5, 1 + .5);
289 glVertex3f(1, 1, 0.0f);
290 glTexCoord2f(0 + .5, 1 + .5);
291 glVertex3f(-1, 1, 0.0f);
294 glDisable(GL_TEXTURE_2D);
295 glMatrixMode(GL_PROJECTION);
297 glMatrixMode(GL_MODELVIEW);
302 glEnable(GL_TEXTURE_2D);
303 loadscreentexture.bind();
304 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
305 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
306 glDisable(GL_DEPTH_TEST);
307 glDisable(GL_CULL_FACE);
308 glDisable(GL_LIGHTING);
310 glMatrixMode(GL_PROJECTION);
313 glOrtho(0, screenwidth, 0, screenheight, -100, 100);
314 glMatrixMode(GL_MODELVIEW);
317 glTranslatef(screenwidth / 2, screenheight / 2, 0);
318 glScalef((float)screenwidth / 2 * (100 + loadprogress) / 100, (float)screenheight / 2 * (100 + loadprogress) / 100, 1);
319 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
321 glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, .4);
324 glTexCoord2f(0 + .2, 0 + .8);
325 glVertex3f(-1, -1, 0.0f);
326 glTexCoord2f(1 + .2, 0 + .8);
327 glVertex3f(1, -1, 0.0f);
328 glTexCoord2f(1 + .2, 1 + .8);
329 glVertex3f(1, 1, 0.0f);
330 glTexCoord2f(0 + .2, 1 + .8);
331 glVertex3f(-1, 1, 0.0f);
334 glDisable(GL_TEXTURE_2D);
335 glMatrixMode(GL_PROJECTION);
337 glMatrixMode(GL_MODELVIEW);
344 if (flashamount > 0) {
348 flashamount -= multiplier;
352 glDisable(GL_DEPTH_TEST);
353 glDisable(GL_CULL_FACE);
354 glDisable(GL_LIGHTING);
355 glDisable(GL_TEXTURE_2D);
357 glMatrixMode(GL_PROJECTION);
360 glOrtho(0, screenwidth, 0, screenheight, -100, 100);
361 glMatrixMode(GL_MODELVIEW);
364 glScalef(screenwidth, screenheight, 1);
365 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
367 glColor4f(flashr, flashg, flashb, flashamount);
369 glVertex3f(0, 0, 0.0f);
370 glVertex3f(256, 0, 0.0f);
371 glVertex3f(256, 256, 0.0f);
372 glVertex3f(0, 256, 0.0f);
374 glMatrixMode(GL_PROJECTION);
376 glMatrixMode(GL_MODELVIEW);
378 glEnable(GL_DEPTH_TEST);
379 glEnable(GL_CULL_FACE);
388 void FadeLoadingScreen(float howmuch)
390 static float loadprogress;
394 glClearColor(0, 0, 0, 1);
395 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
397 loadprogress = howmuch;
401 glDisable(GL_TEXTURE_2D);
402 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
403 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
404 glDisable(GL_DEPTH_TEST);
405 glDisable(GL_CULL_FACE);
406 glDisable(GL_LIGHTING);
408 glMatrixMode(GL_PROJECTION);
411 glOrtho(0, screenwidth, 0, screenheight, -100, 100);
412 glMatrixMode(GL_MODELVIEW);
415 glTranslatef(screenwidth / 2, screenheight / 2, 0);
416 glScalef((float)screenwidth / 2, (float)screenheight / 2, 1);
417 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
419 glColor4f(loadprogress / 100, 0, 0, 1);
423 glVertex3f(-1, -1, 0.0f);
425 glVertex3f(1, -1, 0.0f);
427 glVertex3f(1, 1, 0.0f);
429 glVertex3f(-1, 1, 0.0f);
432 glDisable(GL_TEXTURE_2D);
433 glMatrixMode(GL_PROJECTION);
435 glMatrixMode(GL_MODELVIEW);
443 void Game::InitGame()
447 numchallengelevels = 14;
449 Account::loadFile(Folders::getUserSavePath());
451 whichjointstartarray[0] = righthip;
452 whichjointendarray[0] = rightfoot;
454 whichjointstartarray[1] = righthip;
455 whichjointendarray[1] = rightankle;
457 whichjointstartarray[2] = righthip;
458 whichjointendarray[2] = rightknee;
460 whichjointstartarray[3] = rightknee;
461 whichjointendarray[3] = rightankle;
463 whichjointstartarray[4] = rightankle;
464 whichjointendarray[4] = rightfoot;
466 whichjointstartarray[5] = lefthip;
467 whichjointendarray[5] = leftfoot;
469 whichjointstartarray[6] = lefthip;
470 whichjointendarray[6] = leftankle;
472 whichjointstartarray[7] = lefthip;
473 whichjointendarray[7] = leftknee;
475 whichjointstartarray[8] = leftknee;
476 whichjointendarray[8] = leftankle;
478 whichjointstartarray[9] = leftankle;
479 whichjointendarray[9] = leftfoot;
481 whichjointstartarray[10] = abdomen;
482 whichjointendarray[10] = rightshoulder;
484 whichjointstartarray[11] = abdomen;
485 whichjointendarray[11] = rightelbow;
487 whichjointstartarray[12] = abdomen;
488 whichjointendarray[12] = rightwrist;
490 whichjointstartarray[13] = abdomen;
491 whichjointendarray[13] = righthand;
493 whichjointstartarray[14] = rightshoulder;
494 whichjointendarray[14] = rightelbow;
496 whichjointstartarray[15] = rightelbow;
497 whichjointendarray[15] = rightwrist;
499 whichjointstartarray[16] = rightwrist;
500 whichjointendarray[16] = righthand;
502 whichjointstartarray[17] = abdomen;
503 whichjointendarray[17] = leftshoulder;
505 whichjointstartarray[18] = abdomen;
506 whichjointendarray[18] = leftelbow;
508 whichjointstartarray[19] = abdomen;
509 whichjointendarray[19] = leftwrist;
511 whichjointstartarray[20] = abdomen;
512 whichjointendarray[20] = lefthand;
514 whichjointstartarray[21] = leftshoulder;
515 whichjointendarray[21] = leftelbow;
517 whichjointstartarray[22] = leftelbow;
518 whichjointendarray[22] = leftwrist;
520 whichjointstartarray[23] = leftwrist;
521 whichjointendarray[23] = lefthand;
523 whichjointstartarray[24] = abdomen;
524 whichjointendarray[24] = neck;
526 whichjointstartarray[25] = neck;
527 whichjointendarray[25] = head;
529 FadeLoadingScreen(0);
533 int temptexdetail = texdetail;
535 text->LoadFontTexture("Textures/Font.png");
537 texdetail = temptexdetail;
539 FadeLoadingScreen(10);
551 LOG("Initializing sound system...");
554 unsigned char rc = 0;
555 int output = OPENAL_OUTPUT_ALSA; // Try alsa first...
556 if (commandLineOptions[SOUND]) {
557 output = commandLineOptions[SOUND].last()->type(); // ...but let user override that.
560 OPENAL_SetOutput(output);
561 if ((rc = OPENAL_Init(44100, 32, 0)) == false) {
562 // if we tried ALSA and failed, fall back to OSS.
563 if ( (output == OPENAL_OUTPUT_ALSA) && (commandLineOptions[SOUND].last()->type() != OPENAL_OUTPUT_ALSA) ) {
565 output = OPENAL_OUTPUT_OSS;
566 OPENAL_SetOutput(output);
567 rc = OPENAL_Init(44100, 32, 0);
573 output = OPENAL_OUTPUT_NOSOUND; // we tried! just do silence.
574 OPENAL_SetOutput(output);
575 rc = OPENAL_Init(44100, 32, 0);
578 OPENAL_Init(44100, 32, 0);
581 OPENAL_SetSFXMasterVolume((int)(volume * 255));
585 emit_stream_np(stream_menutheme);
587 cursortexture.load("Textures/Cursor.png", 0);
589 Mapcircletexture.load("Textures/MapCircle.png", 0);
590 Mapboxtexture.load("Textures/MapBox.png", 0);
591 Maparrowtexture.load("Textures/MapArrow.png", 0);
593 temptexdetail = texdetail;
596 Mainmenuitems[0].load("Textures/Lugaru.png", 0);
597 Mainmenuitems[1].load("Textures/NewGame.png", 0);
598 Mainmenuitems[2].load("Textures/Options.png", 0);
599 Mainmenuitems[3].load("Textures/Quit.png", 0);
600 Mainmenuitems[4].load("Textures/Eyelid.png", 0);
601 Mainmenuitems[5].load("Textures/Resume.png", 0);
602 Mainmenuitems[6].load("Textures/EndGame.png", 0);
604 texdetail = temptexdetail;
606 FadeLoadingScreen(95);
616 newscreenwidth = screenwidth;
617 newscreenheight = screenheight;
621 Animation::loadAll();
625 void Game::LoadScreenTexture()
627 glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
629 if (!Game::screentexture)
630 glGenTextures( 1, &Game::screentexture );
631 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
634 glEnable(GL_TEXTURE_2D);
635 glBindTexture( GL_TEXTURE_2D, Game::screentexture);
636 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
637 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
639 glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0);
642 //TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.hpp
643 void Game::LoadStuff()
645 static float temptexdetail;
646 static float viewdistdetail;
655 visibleloading = 0; //don't use loadscreentexture yet
656 loadscreentexture.load("Textures/Fire.jpg", 1);
659 temptexdetail = texdetail;
661 text->LoadFontTexture("Textures/Font.png");
663 texdetail = temptexdetail;
666 viewdistance = 50 * megascale * viewdistdetail;
671 } else if (detail == 1) {
679 realtexdetail = texdetail;
681 LOG("Loading weapon data...");
683 Weapon::knifetextureptr.load("Textures/Knife.png", 0);
684 Weapon::bloodknifetextureptr.load("Textures/BloodKnife.png", 0);
685 Weapon::lightbloodknifetextureptr.load("Textures/BloodKnifeLight.png", 0);
686 Weapon::swordtextureptr.load("Textures/Sword.jpg", 1);
687 Weapon::bloodswordtextureptr.load("Textures/SwordBlood.jpg", 1);
688 Weapon::lightbloodswordtextureptr.load("Textures/SwordBloodLight.jpg", 1);
689 Weapon::stafftextureptr.load("Textures/Staff.jpg", 1);
691 Weapon::throwingknifemodel.load("Models/ThrowingKnife.solid", 1);
692 Weapon::throwingknifemodel.Scale(.001, .001, .001);
693 Weapon::throwingknifemodel.Rotate(90, 0, 0);
694 Weapon::throwingknifemodel.Rotate(0, 90, 0);
695 Weapon::throwingknifemodel.flat = 0;
696 Weapon::throwingknifemodel.CalculateNormals(1);
698 Weapon::swordmodel.load("Models/Sword.solid", 1);
699 Weapon::swordmodel.Scale(.001, .001, .001);
700 Weapon::swordmodel.Rotate(90, 0, 0);
701 Weapon::swordmodel.Rotate(0, 90, 0);
702 Weapon::swordmodel.Rotate(0, 0, 90);
703 Weapon::swordmodel.flat = 1;
704 Weapon::swordmodel.CalculateNormals(1);
706 Weapon::staffmodel.load("Models/Staff.solid", 1);
707 Weapon::staffmodel.Scale(.005, .005, .005);
708 Weapon::staffmodel.Rotate(90, 0, 0);
709 Weapon::staffmodel.Rotate(0, 90, 0);
710 Weapon::staffmodel.Rotate(0, 0, 90);
711 Weapon::staffmodel.flat = 1;
712 Weapon::staffmodel.CalculateNormals(1);
714 terrain.shadowtexture.load("Textures/Shadow.png", 0);
715 terrain.bloodtexture.load("Textures/Blood.png", 0);
716 terrain.breaktexture.load("Textures/Break.png", 0);
717 terrain.bloodtexture2.load("Textures/Blood.png", 0);
720 terrain.footprinttexture.load("Textures/Footprint.png", 0);
721 terrain.bodyprinttexture.load("Textures/Bodyprint.png", 0);
722 hawktexture.load("Textures/Hawk.png", 0);
725 Sprite::cloudtexture.load("Textures/Cloud.png", 1);
726 Sprite::cloudimpacttexture.load("Textures/CloudImpact.png", 1);
727 Sprite::bloodtexture.load("Textures/BloodParticle.png", 1);
728 Sprite::snowflaketexture.load("Textures/SnowFlake.png", 1);
729 Sprite::flametexture.load("Textures/Flame.png", 1);
730 Sprite::bloodflametexture.load("Textures/BloodFlame.png", 1);
731 Sprite::smoketexture.load("Textures/Smoke.png", 1);
732 Sprite::shinetexture.load("Textures/Shine.png", 1);
733 Sprite::splintertexture.load("Textures/Splinter.png", 1);
734 Sprite::leaftexture.load("Textures/Leaf.png", 1);
735 Sprite::toothtexture.load("Textures/Tooth.png", 1);
739 ReSizeGLScene(90, .01);
743 //Set up distant light
744 light.color[0] = .95;
745 light.color[1] = .95;
747 light.ambient[0] = .2;
748 light.ambient[1] = .2;
749 light.ambient[2] = .24;
750 light.location.x = 1;
751 light.location.y = 1;
752 light.location.z = -.2;
753 Normalise(&light.location);
763 texscale = .2 / megascale / viewdistdetail;
764 terrain.scale = 3 * megascale * viewdistdetail;
766 viewer.x = terrain.size / 2 * terrain.scale;
767 viewer.z = terrain.size / 2 * terrain.scale;
769 hawk.load("Models/Hawk.solid", 1);
770 hawk.Scale(.03, .03, .03);
771 hawk.Rotate(90, 1, 1);
772 hawk.CalculateNormals(0);
773 hawk.ScaleNormals(-1, -1, -1);
774 hawkcoords.x = terrain.size / 2 * terrain.scale - 5 - 7;
775 hawkcoords.z = terrain.size / 2 * terrain.scale - 5 - 7;
776 hawkcoords.y = terrain.getHeight(hawkcoords.x, hawkcoords.z) + 25;
778 eye.load("Models/Eye.solid", 1);
779 eye.Scale(.03, .03, .03);
780 eye.CalculateNormals(0);
782 cornea.load("Models/Cornea.solid", 1);
783 cornea.Scale(.03, .03, .03);
784 cornea.CalculateNormals(0);
786 iris.load("Models/Iris.solid", 1);
787 iris.Scale(.03, .03, .03);
788 iris.CalculateNormals(0);
790 LoadSave("Textures/BloodFur.png", 0, 1, &bloodText[0], 0);
791 LoadSave("Textures/WolfBloodFur.png", 0, 1, &wolfbloodText[0], 0);
800 //Fix knife stab, too lazy to do it manually
804 // FIXME - Why this uses skeleton.joints.size() and not Animation::numjoints? (are they equal?)
805 // It seems skeleton.joints.size() is 0 at this point, so this is useless.
806 for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
807 for (unsigned j = 0; j < Animation::animations[knifesneakattackanim].frames.size(); j++) {
808 Animation::animations[knifesneakattackanim].frames[j].joints[i].position += moveamount;
814 for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
815 for (unsigned j = 0; j < Animation::animations[knifesneakattackedanim].frames.size(); j++) {
816 Animation::animations[knifesneakattackedanim].frames[j].joints[i].position += moveamount;
822 for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
823 Animation::animations[dead1anim].frames[1].joints[i].position = Animation::animations[dead1anim].frames[0].joints[i].position;
824 Animation::animations[dead2anim].frames[1].joints[i].position = Animation::animations[dead2anim].frames[0].joints[i].position;
825 Animation::animations[dead3anim].frames[1].joints[i].position = Animation::animations[dead3anim].frames[0].joints[i].position;
826 Animation::animations[dead4anim].frames[1].joints[i].position = Animation::animations[dead4anim].frames[0].joints[i].position;
828 Animation::animations[dead1anim].frames[0].speed = 0.001;
829 Animation::animations[dead2anim].frames[0].speed = 0.001;
830 Animation::animations[dead3anim].frames[0].speed = 0.001;
831 Animation::animations[dead4anim].frames[0].speed = 0.001;
833 Animation::animations[dead1anim].frames[1].speed = 0.001;
834 Animation::animations[dead2anim].frames[1].speed = 0.001;
835 Animation::animations[dead3anim].frames[1].speed = 0.001;
836 Animation::animations[dead4anim].frames[1].speed = 0.001;
838 for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
839 for (unsigned j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) {
840 Animation::animations[swordsneakattackanim].frames[j].joints[i].position += moveamount;
844 for (unsigned j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) {
845 Animation::animations[swordsneakattackanim].frames[j].weapontarget += moveamount;
850 for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) {
851 for (unsigned j = 0; j < Animation::animations[swordsneakattackedanim].frames.size(); j++) {
852 Animation::animations[swordsneakattackedanim].frames[j].joints[i].position += moveamount;
857 temptexdetail = texdetail;
859 texdetail = temptexdetail;
863 if (!screentexture) {
867 if (targetlevel != 7) {
868 emit_sound_at(fireendsound);