PageRenderTime 54ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/game/animation.c

https://github.com/acieroid/gish
C | 1382 lines | 1212 code | 144 blank | 26 comment | 200 complexity | 8fb75cf89de39ccff94bbc761155631b MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. /*
  2. Copyright (C) 2005, 2010 - Cryptic Sea
  3. This file is part of Gish.
  4. Gish is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. See the GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #include "../config.h"
  17. #include "../video/opengl.h"
  18. #if defined(LINUX) || defined(MAC)
  19. #include <unistd.h>
  20. #endif
  21. #include <math.h>
  22. #include <string.h>
  23. #include "../game/animation.h"
  24. #include "../game/gameaudio.h"
  25. #include "../game/game.h"
  26. #include "../game/gameobject.h"
  27. #include "../game/random.h"
  28. #include "../game/sprite.h"
  29. #include "../math/vector.h"
  30. #include "../physics/object.h"
  31. #include "../physics/particle.h"
  32. #include "../video/texture.h"
  33. int numofanimations;
  34. _animation animation[128];
  35. void objectanimation(void)
  36. {
  37. int count,count2;
  38. int particlelist[2];
  39. float vec[3];
  40. float intersectpoint[3];
  41. float normal[3];
  42. float scale;
  43. for (count=0;count<numofobjects;count++)
  44. {
  45. if (object[count].type==1)
  46. {
  47. /*
  48. for (count2=0;count2<object[count].numofparticles;count2++)
  49. if ((rand()&8191)==0)
  50. createparticle(5,particle[object[count].particle[count2]].position,particle[object[count].particle[count2]].velocity,0.125f,-1,100);
  51. */
  52. if (object[count].frame==12)
  53. {
  54. object[count].framedelay+=0.125f;
  55. if (object[count].framedelay>=1.0f)
  56. {
  57. object[count].frame=0;
  58. object[count].framedelay=0.0f;
  59. }
  60. }
  61. if (object[count].numoforientations==0)
  62. {
  63. if (object[count].frame>=5 && object[count].frame<=7)
  64. object[count].frame=1;
  65. if (object[count].frame<4)
  66. {
  67. object[count].framedelay+=1.0f;
  68. if (object[count].framedelay>=4.0f)
  69. {
  70. object[count].frame++;
  71. object[count].framedelay=0.0f;
  72. }
  73. }
  74. }
  75. else
  76. {
  77. if (object[count].frame>0 && object[count].frame<=4)
  78. {
  79. object[count].framedelay+=1.0f;
  80. if (object[count].framedelay>=4.0f)
  81. {
  82. object[count].frame--;
  83. object[count].framedelay=0.0f;
  84. }
  85. }
  86. if (object[count].frame==0)
  87. if ((rnd()&255)==0)
  88. object[count].frame=5;
  89. if (object[count].frame>=5 && object[count].frame<=7)
  90. {
  91. object[count].framedelay+=1.0f;
  92. if (object[count].framedelay>=4.0f)
  93. {
  94. object[count].frame++;
  95. if (object[count].frame==8)
  96. object[count].frame=0;
  97. object[count].framedelay=0.0f;
  98. }
  99. }
  100. }
  101. if ((object[count].button&8)==8)
  102. if (object[count].frame<8)
  103. {
  104. object[count].frame=8;
  105. object[count].framedelay=0.0f;
  106. }
  107. if (object[count].frame>=8 && object[count].frame<=11)
  108. {
  109. object[count].framedelay+=1.0f;
  110. if (object[count].framedelay>=4.0f)
  111. {
  112. if ((object[count].button&8)==8)
  113. {
  114. if (object[count].frame<11)
  115. object[count].frame++;
  116. }
  117. else
  118. {
  119. if (object[count].frame>7)
  120. object[count].frame--;
  121. if (object[count].frame==7)
  122. object[count].frame=0;
  123. }
  124. object[count].framedelay=0.0f;
  125. }
  126. }
  127. }
  128. if (object[count].type==4)
  129. {
  130. if (object[count].animationtype==0 || object[count].animationtype==1)
  131. if ((object[count].button&1)==1)
  132. {
  133. object[count].animationtype=2;
  134. object[count].frame=0;
  135. object[count].framedelay=0.0f;
  136. }
  137. if (object[count].beasttype==12)
  138. if (object[count].animationtype==0)
  139. if ((object[count].button&2)==2)
  140. {
  141. object[count].animationtype=1;
  142. object[count].frame=0;
  143. object[count].framedelay=0.0f;
  144. }
  145. if (object[count].animationtype==0)
  146. {
  147. if (object[count].link!=-1)
  148. {
  149. object[object[count].link].texturenum=animation[object[count].animationnum+32].stand[0];
  150. if (fabs(object[0].position[0]-object[count].position[0])<1.5f)
  151. if (object[0].position[1]>object[count].position[1])
  152. object[object[count].link].texturenum=animation[object[count].animationnum+32].stand[1];
  153. }
  154. object[count].framedelay+=0.1f;
  155. if (object[count].framedelay>=1.0f)
  156. {
  157. object[count].framedelay=0.0f;
  158. object[count].frame++;
  159. if (object[count].frame>=animation[object[count].animationnum].stand[1])
  160. object[count].frame=0;
  161. }
  162. object[count].texturenum=animation[object[count].animationnum].stand[0]+object[count].frame;
  163. if (vectorlength(object[count].velocity)>=0.01f)
  164. {
  165. object[count].animationtype=1;
  166. object[count].frame=0;
  167. object[count].framedelay=0.0f;
  168. }
  169. }
  170. if (object[count].animationtype==1)
  171. {
  172. if (object[count].link!=-1)
  173. {
  174. object[object[count].link].texturenum=animation[object[count].animationnum+32].walk[0];
  175. if (fabs(object[0].position[0]-object[count].position[0])<1.5f)
  176. if (object[0].position[1]>object[count].position[1])
  177. object[object[count].link].texturenum=animation[object[count].animationnum+32].stand[1];
  178. }
  179. if (object[count].beasttype!=12)
  180. object[count].framedelay+=vectorlength(object[count].velocity)*6.0f;
  181. else
  182. object[count].framedelay+=0.2f;
  183. if (object[count].framedelay>=1.0f)
  184. {
  185. object[count].framedelay=0.0f;
  186. object[count].frame++;
  187. if (object[count].frame>=animation[object[count].animationnum].walk[1])
  188. {
  189. object[count].frame=0;
  190. if (object[count].beasttype==12)
  191. object[count].animationtype=0;
  192. }
  193. }
  194. object[count].texturenum=animation[object[count].animationnum].walk[0]+object[count].frame;
  195. if (object[count].beasttype!=12)
  196. if (vectorlength(object[count].velocity)<0.01f)
  197. {
  198. object[count].animationtype=0;
  199. object[count].frame=0;
  200. object[count].framedelay=0.0f;
  201. }
  202. if (object[count].beasttype==12)
  203. if (object[count].frame==4)
  204. if (object[count].framedelay==0.0f)
  205. {
  206. addvectors(vec,object[count].position,yaxis);
  207. createbeast(11,vec,1.0f,1.0f,1.0f,0.2f);
  208. object[numofobjects-1].timetolive=512;
  209. object[numofobjects-1].link=-1;
  210. for (count2=0;count2<4;count2++)
  211. {
  212. particle[object[numofobjects-1].particle[count2]].velocity[1]=0.08f;
  213. if (object[count].direction==0)
  214. particle[object[numofobjects-1].particle[count2]].velocity[0]=-0.04f;
  215. else
  216. particle[object[numofobjects-1].particle[count2]].velocity[0]=0.04f;
  217. }
  218. }
  219. }
  220. if (object[count].animationtype==2)
  221. {
  222. if (object[count].link!=-1)
  223. object[object[count].link].texturenum=animation[object[count].animationnum+32].attack[0];
  224. object[count].framedelay+=0.2f;
  225. if (object[count].framedelay>=1.0f)
  226. {
  227. object[count].framedelay=0.0f;
  228. object[count].frame++;
  229. if (object[count].frame>=animation[object[count].animationnum].attack[1])
  230. {
  231. object[count].animationtype=0;
  232. object[count].frame=0;
  233. }
  234. }
  235. object[count].texturenum=animation[object[count].animationnum].attack[0]+object[count].frame;
  236. if (object[count].frame==1)
  237. if (object[count].framedelay==0.0f)
  238. {
  239. if (object[count].beasttype<3 || object[count].beasttype==8 || object[count].beasttype==11 || object[count].beasttype==16)
  240. playsound(11,object[count].position,NULL,0.25f,0,0.7f,-1,0);
  241. else if (object[count].beasttype==7 || object[count].beasttype==13)
  242. playsound(12,object[count].position,NULL,0.5f,0,1.0f,-1,0);
  243. else
  244. playsound(13,object[count].position,NULL,0.5f,0,1.0f,-1,0);
  245. }
  246. if (object[count].frame==5)
  247. {
  248. //if (object[count].beasttype!=7 && object[count].beasttype!=13)
  249. {
  250. scale=1.25f;
  251. if (object[count].beasttype<3 || object[count].beasttype==8 || object[count].beasttype==11 || object[count].beasttype==16)
  252. scale=0.75f;
  253. if (object[count].beasttype==15)
  254. scale=1.5f;
  255. if (object[count].beasttype==7 || object[count].beasttype==13)
  256. scale=3.0f;
  257. if (object[count].direction==0)
  258. scaleaddvectors(vec,object[count].position,object[count].orientation[0],-scale);
  259. if (object[count].direction==1)
  260. scaleaddvectors(vec,object[count].position,object[count].orientation[0],scale);
  261. if (lineintersectobject(intersectpoint,normal,&scale,object[count].position,vec,0,particlelist))
  262. {
  263. scale=0.06f;
  264. if (object[count].beasttype<3)
  265. scale=0.03f;
  266. if (object[count].beasttype==15)
  267. scale=0.15f;
  268. if (object[count].direction==0)
  269. {
  270. scaleaddvectors(particle[particlelist[0]].velocity,particle[particlelist[0]].velocity,object[count].orientation[0],-scale);
  271. scaleaddvectors(particle[particlelist[1]].velocity,particle[particlelist[1]].velocity,object[count].orientation[0],-scale);
  272. }
  273. if (object[count].direction==1)
  274. {
  275. scaleaddvectors(particle[particlelist[0]].velocity,particle[particlelist[0]].velocity,object[count].orientation[0],scale);
  276. scaleaddvectors(particle[particlelist[1]].velocity,particle[particlelist[1]].velocity,object[count].orientation[0],scale);
  277. }
  278. if (object[count].beasttype<3 || object[count].beasttype==11)
  279. object[0].hitpoints-=20;
  280. else
  281. object[0].hitpoints-=40;
  282. if (object[count].beasttype==15)
  283. object[0].hitpoints-=40;
  284. }
  285. }
  286. if (object[count].beasttype==7 || object[count].beasttype==13)
  287. if (object[count].framedelay==0.0f)
  288. {
  289. if (object[count].beasttype==7)
  290. createbeast(2,object[count].position,1.0f,1.0f,1.0f,0.2f);
  291. else
  292. createbeast(8,object[count].position,1.0f,1.0f,1.0f,0.2f);
  293. object[numofobjects-1].timetolive=512;
  294. object[numofobjects-1].link=-1;
  295. for (count2=0;count2<4;count2++)
  296. {
  297. if (object[count].direction==0)
  298. particle[object[numofobjects-1].particle[count2]].velocity[0]=-0.08f;
  299. else
  300. particle[object[numofobjects-1].particle[count2]].velocity[0]=0.08f;
  301. }
  302. }
  303. }
  304. }
  305. if (object[count].timetolive>=0 && object[count].timetolive<45)
  306. {
  307. if (object[count].timetolive==44)
  308. {
  309. if (object[count].beasttype<3 || object[count].beasttype==8 || object[count].beasttype==11 || object[count].beasttype==16)
  310. {
  311. game.score[0]+=100*game.combo;
  312. createsprite(100*game.combo,object[count].position);
  313. game.combo++;
  314. game.combodelay+=100;
  315. if (game.combodelay>250)
  316. game.combodelay=250;
  317. playsound(7,object[count].position,NULL,1.0f,0,1.0f,-1,0);
  318. }
  319. else
  320. {
  321. game.score[0]+=200*game.combo;
  322. createsprite(200*game.combo,object[count].position);
  323. game.combo++;
  324. game.combodelay+=100;
  325. if (game.combodelay>250)
  326. game.combodelay=250;
  327. playsound(19,object[count].position,NULL,1.0f,0,1.0f,-1,0);
  328. }
  329. for (count2=0;count2<10;count2++)
  330. {
  331. vec[0]=(float)((rnd()&255)-127)/1270.0f;
  332. vec[1]=(float)((rnd()&255)-127)/1270.0f;
  333. vec[2]=0.0f;
  334. addvectors(vec,vec,object[count].velocity);
  335. createparticle(5,object[count].position,vec,0.25f,-1,100+(rnd()&63));
  336. particle[numofparticles-1].rendersize=0.125+(float)(rnd()&127)/1000.0f;
  337. particle[numofparticles-1].texturenum=367;
  338. if (object[count].beasttype==11 || object[count].beasttype==12)
  339. particle[numofparticles-1].texturenum=364;
  340. if (object[count].beasttype==0 || object[count].beasttype==3 || object[count].beasttype==4)
  341. particle[numofparticles-1].texturenum=365;
  342. }
  343. }
  344. if (object[count].link!=-1)
  345. {
  346. object[object[count].link].texturenum=animation[object[count].animationnum+32].die[0];
  347. if (object[object[count].link].timetolive>150)
  348. object[object[count].link].timetolive=150;
  349. }
  350. object[count].animationtype=3;
  351. object[count].frame=8-object[count].timetolive/5;
  352. object[count].framedelay=0.0f;
  353. object[count].texturenum=animation[object[count].animationnum].die[0]+object[count].frame;
  354. }
  355. }
  356. }
  357. if (game.levelnum==34)
  358. if (object[1].type==2)
  359. if ((rnd()&255)==0)
  360. {
  361. object[1].texturenum=64+(rnd()&3);
  362. }
  363. }
  364. void loadanimations(void)
  365. {
  366. int count,count2;
  367. int changeddir;
  368. char filename[32]="bibatk01.tga";
  369. changeddir=chdir("animation");
  370. count2=0;
  371. if (animation[count2].loaded==2)
  372. {
  373. animation[count2].loaded=1;
  374. animation[count2].stand[0]=numofanimations;
  375. animation[count2].stand[1]=6;
  376. strcpy(filename,"bibsta");
  377. for (count=1;count<=animation[count2].stand[1];count++)
  378. {
  379. filename[6]=48+(count/10)%10;
  380. filename[7]=48+count%10;
  381. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  382. numofanimations++;
  383. }
  384. animation[count2].walk[0]=numofanimations;
  385. animation[count2].walk[1]=9;
  386. strcpy(filename,"bibwlk");
  387. for (count=1;count<=animation[count2].walk[1];count++)
  388. {
  389. filename[6]=48+(count/10)%10;
  390. filename[7]=48+count%10;
  391. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  392. numofanimations++;
  393. }
  394. animation[count2].attack[0]=numofanimations;
  395. animation[count2].attack[1]=9;
  396. strcpy(filename,"bibatk");
  397. for (count=1;count<=animation[count2].attack[1];count++)
  398. {
  399. filename[6]=48+(count/10)%10;
  400. filename[7]=48+count%10;
  401. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  402. numofanimations++;
  403. }
  404. animation[count2].die[0]=numofanimations;
  405. animation[count2].die[1]=9;
  406. strcpy(filename,"nibdie");
  407. for (count=1;count<=animation[count2].die[1];count++)
  408. {
  409. filename[6]=48+(count/10)%10;
  410. filename[7]=48+count%10;
  411. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  412. numofanimations++;
  413. }
  414. }
  415. count2=1;
  416. if (animation[count2].loaded==2)
  417. {
  418. animation[count2].loaded=1;
  419. animation[count2].stand[0]=numofanimations;
  420. animation[count2].stand[1]=6;
  421. strcpy(filename,"nibsta");
  422. for (count=1;count<=animation[count2].stand[1];count++)
  423. {
  424. filename[6]=48+(count/10)%10;
  425. filename[7]=48+count%10;
  426. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  427. numofanimations++;
  428. }
  429. animation[count2].walk[0]=numofanimations;
  430. animation[count2].walk[1]=9;
  431. strcpy(filename,"nibwlk");
  432. for (count=1;count<=animation[count2].walk[1];count++)
  433. {
  434. filename[6]=48+(count/10)%10;
  435. filename[7]=48+count%10;
  436. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  437. numofanimations++;
  438. }
  439. animation[count2].attack[0]=numofanimations;
  440. animation[count2].attack[1]=9;
  441. strcpy(filename,"nibatk");
  442. for (count=1;count<=animation[count2].attack[1];count++)
  443. {
  444. filename[6]=48+(count/10)%10;
  445. filename[7]=48+count%10;
  446. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  447. numofanimations++;
  448. }
  449. animation[count2].die[0]=numofanimations;
  450. animation[count2].die[1]=9;
  451. strcpy(filename,"nibdie");
  452. for (count=1;count<=animation[count2].die[1];count++)
  453. {
  454. filename[6]=48+(count/10)%10;
  455. filename[7]=48+count%10;
  456. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  457. numofanimations++;
  458. }
  459. }
  460. count2=2;
  461. if (animation[count2].loaded==2)
  462. {
  463. animation[count2].loaded=1;
  464. animation[count2].stand[0]=numofanimations;
  465. animation[count2].stand[1]=6;
  466. strcpy(filename,"ribsta");
  467. for (count=1;count<=animation[count2].stand[1];count++)
  468. {
  469. filename[6]=48+(count/10)%10;
  470. filename[7]=48+count%10;
  471. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  472. numofanimations++;
  473. }
  474. animation[count2].walk[0]=numofanimations;
  475. animation[count2].walk[1]=9;
  476. strcpy(filename,"ribwlk");
  477. for (count=1;count<=animation[count2].walk[1];count++)
  478. {
  479. filename[6]=48+(count/10)%10;
  480. filename[7]=48+count%10;
  481. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  482. numofanimations++;
  483. }
  484. animation[count2].attack[0]=numofanimations;
  485. animation[count2].attack[1]=9;
  486. strcpy(filename,"ribatk");
  487. for (count=1;count<=animation[count2].attack[1];count++)
  488. {
  489. filename[6]=48+(count/10)%10;
  490. filename[7]=48+count%10;
  491. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  492. numofanimations++;
  493. }
  494. animation[count2].die[0]=numofanimations;
  495. animation[count2].die[1]=9;
  496. strcpy(filename,"ribdie");
  497. for (count=1;count<=animation[count2].die[1];count++)
  498. {
  499. filename[6]=48+(count/10)%10;
  500. filename[7]=48+count%10;
  501. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  502. numofanimations++;
  503. }
  504. }
  505. count2=3;
  506. if (animation[count2].loaded==2)
  507. {
  508. animation[count2].loaded=1;
  509. animation[count2].stand[0]=numofanimations;
  510. animation[count2].stand[1]=6;
  511. strcpy(filename,"mumsta");
  512. for (count=1;count<=animation[count2].stand[1];count++)
  513. {
  514. filename[6]=48+(count/10)%10;
  515. filename[7]=48+count%10;
  516. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  517. numofanimations++;
  518. }
  519. animation[count2].walk[0]=numofanimations;
  520. animation[count2].walk[1]=9;
  521. strcpy(filename,"mumwlk");
  522. for (count=1;count<=animation[count2].walk[1];count++)
  523. {
  524. filename[6]=48+(count/10)%10;
  525. filename[7]=48+count%10;
  526. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  527. numofanimations++;
  528. }
  529. animation[count2].attack[0]=numofanimations;
  530. animation[count2].attack[1]=9;
  531. strcpy(filename,"mumatk");
  532. for (count=1;count<=animation[count2].attack[1];count++)
  533. {
  534. filename[6]=48+(count/10)%10;
  535. filename[7]=48+count%10;
  536. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  537. numofanimations++;
  538. }
  539. animation[count2].die[0]=numofanimations;
  540. animation[count2].die[1]=9;
  541. strcpy(filename,"mumdie");
  542. for (count=1;count<=animation[count2].die[1];count++)
  543. {
  544. filename[6]=48+(count/10)%10;
  545. filename[7]=48+count%10;
  546. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  547. numofanimations++;
  548. }
  549. count2+=32;
  550. animation[count2].stand[0]=numofanimations;
  551. loadtexturetga(numofanimations,"mumhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  552. numofanimations++;
  553. animation[count2].walk[0]=numofanimations;
  554. loadtexturetga(numofanimations,"mumhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  555. numofanimations++;
  556. animation[count2].attack[0]=numofanimations;
  557. loadtexturetga(numofanimations,"mumhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  558. numofanimations++;
  559. animation[count2].stand[1]=numofanimations;
  560. loadtexturetga(numofanimations,"mumhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  561. numofanimations++;
  562. animation[count2].die[0]=numofanimations;
  563. loadtexturetga(numofanimations,"mumhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  564. numofanimations++;
  565. }
  566. count2=4;
  567. if (animation[count2].loaded==2)
  568. {
  569. animation[count2].loaded=1;
  570. animation[count2].stand[0]=numofanimations;
  571. animation[count2].stand[1]=6;
  572. strcpy(filename,"sklsta");
  573. for (count=1;count<=animation[count2].stand[1];count++)
  574. {
  575. filename[6]=48+(count/10)%10;
  576. filename[7]=48+count%10;
  577. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  578. numofanimations++;
  579. }
  580. animation[count2].walk[0]=numofanimations;
  581. animation[count2].walk[1]=9;
  582. strcpy(filename,"sklwlk");
  583. for (count=1;count<=animation[count2].walk[1];count++)
  584. {
  585. filename[6]=48+(count/10)%10;
  586. filename[7]=48+count%10;
  587. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  588. numofanimations++;
  589. }
  590. animation[count2].attack[0]=numofanimations;
  591. animation[count2].attack[1]=9;
  592. strcpy(filename,"sklatk");
  593. for (count=1;count<=animation[count2].attack[1];count++)
  594. {
  595. filename[6]=48+(count/10)%10;
  596. filename[7]=48+count%10;
  597. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  598. numofanimations++;
  599. }
  600. animation[count2].die[0]=numofanimations;
  601. animation[count2].die[1]=9;
  602. strcpy(filename,"skldie");
  603. for (count=1;count<=animation[count2].die[1];count++)
  604. {
  605. filename[6]=48+(count/10)%10;
  606. filename[7]=48+count%10;
  607. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  608. numofanimations++;
  609. }
  610. count2+=32;
  611. animation[count2].stand[0]=numofanimations;
  612. loadtexturetga(numofanimations,"sklhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  613. numofanimations++;
  614. animation[count2].walk[0]=numofanimations;
  615. loadtexturetga(numofanimations,"sklhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  616. numofanimations++;
  617. animation[count2].attack[0]=numofanimations;
  618. loadtexturetga(numofanimations,"sklhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  619. numofanimations++;
  620. animation[count2].stand[1]=numofanimations;
  621. loadtexturetga(numofanimations,"sklhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  622. numofanimations++;
  623. animation[count2].die[0]=numofanimations;
  624. loadtexturetga(numofanimations,"sklhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  625. numofanimations++;
  626. }
  627. count2=5;
  628. if (animation[count2].loaded==2)
  629. {
  630. animation[count2].loaded=1;
  631. animation[count2].stand[0]=numofanimations;
  632. animation[count2].stand[1]=6;
  633. strcpy(filename,"zomsta");
  634. for (count=1;count<=animation[count2].stand[1];count++)
  635. {
  636. filename[6]=48+(count/10)%10;
  637. filename[7]=48+count%10;
  638. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  639. numofanimations++;
  640. }
  641. animation[count2].walk[0]=numofanimations;
  642. animation[count2].walk[1]=9;
  643. strcpy(filename,"zomwlk");
  644. for (count=1;count<=animation[count2].walk[1];count++)
  645. {
  646. filename[6]=48+(count/10)%10;
  647. filename[7]=48+count%10;
  648. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  649. numofanimations++;
  650. }
  651. animation[count2].attack[0]=numofanimations;
  652. animation[count2].attack[1]=9;
  653. strcpy(filename,"zomatk");
  654. for (count=1;count<=animation[count2].attack[1];count++)
  655. {
  656. filename[6]=48+(count/10)%10;
  657. filename[7]=48+count%10;
  658. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  659. numofanimations++;
  660. }
  661. animation[count2].die[0]=numofanimations;
  662. animation[count2].die[1]=9;
  663. strcpy(filename,"zomdie");
  664. for (count=1;count<=animation[count2].die[1];count++)
  665. {
  666. filename[6]=48+(count/10)%10;
  667. filename[7]=48+count%10;
  668. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  669. numofanimations++;
  670. }
  671. count2+=32;
  672. animation[count2].stand[0]=numofanimations;
  673. loadtexturetga(numofanimations,"zomhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  674. numofanimations++;
  675. animation[count2].walk[0]=numofanimations;
  676. loadtexturetga(numofanimations,"zomhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  677. numofanimations++;
  678. animation[count2].attack[0]=numofanimations;
  679. loadtexturetga(numofanimations,"zomhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  680. numofanimations++;
  681. animation[count2].stand[1]=numofanimations;
  682. loadtexturetga(numofanimations,"zomhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  683. numofanimations++;
  684. animation[count2].die[0]=numofanimations;
  685. loadtexturetga(numofanimations,"zomhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  686. numofanimations++;
  687. }
  688. count2=6;
  689. if (animation[count2].loaded==2)
  690. {
  691. animation[count2].loaded=1;
  692. animation[count2].stand[0]=numofanimations;
  693. animation[count2].stand[1]=6;
  694. strcpy(filename,"gimsta");
  695. for (count=1;count<=animation[count2].stand[1];count++)
  696. {
  697. filename[6]=48+(count/10)%10;
  698. filename[7]=48+count%10;
  699. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  700. numofanimations++;
  701. }
  702. animation[count2].walk[0]=numofanimations;
  703. animation[count2].walk[1]=9;
  704. strcpy(filename,"gimwlk");
  705. for (count=1;count<=animation[count2].walk[1];count++)
  706. {
  707. filename[6]=48+(count/10)%10;
  708. filename[7]=48+count%10;
  709. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  710. numofanimations++;
  711. }
  712. animation[count2].attack[0]=numofanimations;
  713. animation[count2].attack[1]=9;
  714. strcpy(filename,"gimatk");
  715. for (count=1;count<=animation[count2].attack[1];count++)
  716. {
  717. filename[6]=48+(count/10)%10;
  718. filename[7]=48+count%10;
  719. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  720. numofanimations++;
  721. }
  722. animation[count2].die[0]=numofanimations;
  723. animation[count2].die[1]=9;
  724. strcpy(filename,"gimdie");
  725. for (count=1;count<=animation[count2].die[1];count++)
  726. {
  727. filename[6]=48+(count/10)%10;
  728. filename[7]=48+count%10;
  729. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  730. numofanimations++;
  731. }
  732. count2+=32;
  733. animation[count2].stand[0]=numofanimations;
  734. loadtexturetga(numofanimations,"gimhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  735. numofanimations++;
  736. animation[count2].walk[0]=numofanimations;
  737. loadtexturetga(numofanimations,"gimhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  738. numofanimations++;
  739. animation[count2].attack[0]=numofanimations;
  740. loadtexturetga(numofanimations,"gimhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  741. numofanimations++;
  742. animation[count2].stand[1]=numofanimations;
  743. loadtexturetga(numofanimations,"gimhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  744. numofanimations++;
  745. animation[count2].die[0]=numofanimations;
  746. loadtexturetga(numofanimations,"gimhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  747. numofanimations++;
  748. }
  749. count2=7;
  750. if (animation[count2].loaded==2)
  751. {
  752. animation[count2].loaded=1;
  753. animation[count2].stand[0]=numofanimations;
  754. animation[count2].stand[1]=6;
  755. strcpy(filename,"vissta");
  756. for (count=1;count<=animation[count2].stand[1];count++)
  757. {
  758. filename[6]=48+(count/10)%10;
  759. filename[7]=48+count%10;
  760. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  761. numofanimations++;
  762. }
  763. animation[count2].walk[0]=numofanimations;
  764. animation[count2].walk[1]=9;
  765. strcpy(filename,"viswlk");
  766. for (count=1;count<=animation[count2].walk[1];count++)
  767. {
  768. filename[6]=48+(count/10)%10;
  769. filename[7]=48+count%10;
  770. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  771. numofanimations++;
  772. }
  773. animation[count2].attack[0]=numofanimations;
  774. animation[count2].attack[1]=9;
  775. strcpy(filename,"visatk");
  776. for (count=1;count<=animation[count2].attack[1];count++)
  777. {
  778. filename[6]=48+(count/10)%10;
  779. filename[7]=48+count%10;
  780. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  781. numofanimations++;
  782. }
  783. animation[count2].die[0]=numofanimations;
  784. animation[count2].die[1]=9;
  785. strcpy(filename,"visdie");
  786. for (count=1;count<=animation[count2].die[1];count++)
  787. {
  788. filename[6]=48+(count/10)%10;
  789. filename[7]=48+count%10;
  790. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  791. numofanimations++;
  792. }
  793. }
  794. count2=8;
  795. if (animation[count2].loaded==2)
  796. {
  797. animation[count2].loaded=1;
  798. animation[count2].stand[0]=numofanimations;
  799. animation[count2].stand[1]=6;
  800. strcpy(filename,"aibsta");
  801. for (count=1;count<=animation[count2].stand[1];count++)
  802. {
  803. filename[6]=48+(count/10)%10;
  804. filename[7]=48+count%10;
  805. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  806. numofanimations++;
  807. }
  808. animation[count2].walk[0]=numofanimations;
  809. animation[count2].walk[1]=9;
  810. strcpy(filename,"aibwlk");
  811. for (count=1;count<=animation[count2].walk[1];count++)
  812. {
  813. filename[6]=48+(count/10)%10;
  814. filename[7]=48+count%10;
  815. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  816. numofanimations++;
  817. }
  818. animation[count2].attack[0]=numofanimations;
  819. animation[count2].attack[1]=9;
  820. strcpy(filename,"aibatk");
  821. for (count=1;count<=animation[count2].attack[1];count++)
  822. {
  823. filename[6]=48+(count/10)%10;
  824. filename[7]=48+count%10;
  825. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  826. numofanimations++;
  827. }
  828. animation[count2].die[0]=numofanimations;
  829. animation[count2].die[1]=9;
  830. strcpy(filename,"aibdie");
  831. for (count=1;count<=animation[count2].die[1];count++)
  832. {
  833. filename[6]=48+(count/10)%10;
  834. filename[7]=48+count%10;
  835. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  836. numofanimations++;
  837. }
  838. }
  839. count2=9;
  840. if (animation[count2].loaded==2)
  841. {
  842. animation[count2].loaded=1;
  843. animation[count2].stand[0]=numofanimations;
  844. animation[count2].stand[1]=6;
  845. strcpy(filename,"altsta");
  846. for (count=1;count<=animation[count2].stand[1];count++)
  847. {
  848. filename[6]=48+(count/10)%10;
  849. filename[7]=48+count%10;
  850. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  851. numofanimations++;
  852. }
  853. animation[count2].walk[0]=numofanimations;
  854. animation[count2].walk[1]=9;
  855. strcpy(filename,"altwlk");
  856. for (count=1;count<=animation[count2].walk[1];count++)
  857. {
  858. filename[6]=48+(count/10)%10;
  859. filename[7]=48+count%10;
  860. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  861. numofanimations++;
  862. }
  863. animation[count2].attack[0]=numofanimations;
  864. animation[count2].attack[1]=9;
  865. strcpy(filename,"altatk");
  866. for (count=1;count<=animation[count2].attack[1];count++)
  867. {
  868. filename[6]=48+(count/10)%10;
  869. filename[7]=48+count%10;
  870. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  871. numofanimations++;
  872. }
  873. animation[count2].die[0]=numofanimations;
  874. animation[count2].die[1]=9;
  875. strcpy(filename,"altdie");
  876. for (count=1;count<=animation[count2].die[1];count++)
  877. {
  878. filename[6]=48+(count/10)%10;
  879. filename[7]=48+count%10;
  880. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  881. numofanimations++;
  882. }
  883. count2+=32;
  884. animation[count2].stand[0]=numofanimations;
  885. loadtexturetga(numofanimations,"gimhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  886. numofanimations++;
  887. animation[count2].walk[0]=numofanimations;
  888. loadtexturetga(numofanimations,"gimhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  889. numofanimations++;
  890. animation[count2].attack[0]=numofanimations;
  891. loadtexturetga(numofanimations,"gimhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  892. numofanimations++;
  893. animation[count2].stand[1]=numofanimations;
  894. loadtexturetga(numofanimations,"gimhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  895. numofanimations++;
  896. animation[count2].die[0]=numofanimations;
  897. loadtexturetga(numofanimations,"gimhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  898. numofanimations++;
  899. }
  900. count2=10;
  901. if (animation[count2].loaded==2)
  902. {
  903. animation[count2].loaded=1;
  904. animation[count2].stand[0]=numofanimations;
  905. animation[count2].stand[1]=6;
  906. strcpy(filename,"frksta");
  907. for (count=1;count<=animation[count2].stand[1];count++)
  908. {
  909. filename[6]=48+(count/10)%10;
  910. filename[7]=48+count%10;
  911. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  912. numofanimations++;
  913. }
  914. animation[count2].walk[0]=numofanimations;
  915. animation[count2].walk[1]=9;
  916. strcpy(filename,"frkwlk");
  917. for (count=1;count<=animation[count2].walk[1];count++)
  918. {
  919. filename[6]=48+(count/10)%10;
  920. filename[7]=48+count%10;
  921. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  922. numofanimations++;
  923. }
  924. animation[count2].attack[0]=numofanimations;
  925. animation[count2].attack[1]=9;
  926. strcpy(filename,"frkatk");
  927. for (count=1;count<=animation[count2].attack[1];count++)
  928. {
  929. filename[6]=48+(count/10)%10;
  930. filename[7]=48+count%10;
  931. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  932. numofanimations++;
  933. }
  934. animation[count2].die[0]=numofanimations;
  935. animation[count2].die[1]=9;
  936. strcpy(filename,"frkdie");
  937. for (count=1;count<=animation[count2].die[1];count++)
  938. {
  939. filename[6]=48+(count/10)%10;
  940. filename[7]=48+count%10;
  941. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  942. numofanimations++;
  943. }
  944. count2+=32;
  945. animation[count2].stand[0]=numofanimations;
  946. loadtexturetga(numofanimations,"frkhed01.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  947. numofanimations++;
  948. animation[count2].walk[0]=numofanimations;
  949. loadtexturetga(numofanimations,"frkhed02.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  950. numofanimations++;
  951. animation[count2].attack[0]=numofanimations;
  952. loadtexturetga(numofanimations,"frkhed03.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  953. numofanimations++;
  954. animation[count2].stand[1]=numofanimations;
  955. loadtexturetga(numofanimations,"frkhed05.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  956. numofanimations++;
  957. animation[count2].die[0]=numofanimations;
  958. loadtexturetga(numofanimations,"frkhed06.tga",0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  959. numofanimations++;
  960. }
  961. count2=11;
  962. if (animation[count2].loaded==2)
  963. {
  964. animation[count2].loaded=1;
  965. animation[count2].stand[0]=numofanimations;
  966. animation[count2].stand[1]=6;
  967. strcpy(filename,"pibsta");
  968. for (count=1;count<=animation[count2].stand[1];count++)
  969. {
  970. filename[6]=48+(count/10)%10;
  971. filename[7]=48+count%10;
  972. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  973. numofanimations++;
  974. }
  975. animation[count2].walk[0]=numofanimations;
  976. animation[count2].walk[1]=9;
  977. strcpy(filename,"pibwlk");
  978. for (count=1;count<=animation[count2].walk[1];count++)
  979. {
  980. filename[6]=48+(count/10)%10;
  981. filename[7]=48+count%10;
  982. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  983. numofanimations++;
  984. }
  985. animation[count2].attack[0]=numofanimations;
  986. animation[count2].attack[1]=9;
  987. strcpy(filename,"pibatk");
  988. for (count=1;count<=animation[count2].attack[1];count++)
  989. {
  990. filename[6]=48+(count/10)%10;
  991. filename[7]=48+count%10;
  992. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  993. numofanimations++;
  994. }
  995. animation[count2].die[0]=numofanimations;
  996. animation[count2].die[1]=9;
  997. strcpy(filename,"pibdie");
  998. for (count=1;count<=animation[count2].die[1];count++)
  999. {
  1000. filename[6]=48+(count/10)%10;
  1001. filename[7]=48+count%10;
  1002. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1003. numofanimations++;
  1004. }
  1005. }
  1006. count2=12;
  1007. if (animation[count2].loaded==2)
  1008. {
  1009. animation[count2].loaded=1;
  1010. animation[count2].stand[0]=numofanimations;
  1011. animation[count2].stand[1]=6;
  1012. strcpy(filename,"sepsta");
  1013. for (count=1;count<=animation[count2].stand[1];count++)
  1014. {
  1015. filename[6]=48+(count/10)%10;
  1016. filename[7]=48+count%10;
  1017. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1018. numofanimations++;
  1019. }
  1020. animation[count2].walk[0]=numofanimations;
  1021. animation[count2].walk[1]=9;
  1022. strcpy(filename,"sepspw");
  1023. for (count=1;count<=animation[count2].walk[1];count++)
  1024. {
  1025. filename[6]=48+(count/10)%10;
  1026. filename[7]=48+count%10;
  1027. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1028. numofanimations++;
  1029. }
  1030. animation[count2].attack[0]=numofanimations;
  1031. animation[count2].attack[1]=8;
  1032. strcpy(filename,"sepatk");
  1033. for (count=1;count<=animation[count2].attack[1];count++)
  1034. {
  1035. filename[6]=48+(count/10)%10;
  1036. filename[7]=48+count%10;
  1037. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1038. numofanimations++;
  1039. }
  1040. animation[count2].die[0]=numofanimations;
  1041. animation[count2].die[1]=9;
  1042. strcpy(filename,"sepdie");
  1043. for (count=1;count<=animation[count2].die[1];count++)
  1044. {
  1045. filename[6]=48+(count/10)%10;
  1046. filename[7]=48+count%10;
  1047. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1048. numofanimations++;
  1049. }
  1050. }
  1051. count2=13;
  1052. if (animation[count2].loaded==2)
  1053. {
  1054. animation[count2].loaded=1;
  1055. animation[count2].stand[0]=numofanimations;
  1056. animation[count2].stand[1]=6;
  1057. strcpy(filename,"sissta");
  1058. for (count=1;count<=animation[count2].stand[1];count++)
  1059. {
  1060. filename[6]=48+(count/10)%10;
  1061. filename[7]=48+count%10;
  1062. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1063. numofanimations++;
  1064. }
  1065. animation[count2].walk[0]=numofanimations;
  1066. animation[count2].walk[1]=9;
  1067. strcpy(filename,"siswlk");
  1068. for (count=1;count<=animation[count2].walk[1];count++)
  1069. {
  1070. filename[6]=48+(count/10)%10;
  1071. filename[7]=48+count%10;
  1072. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1073. numofanimations++;
  1074. }
  1075. animation[count2].attack[0]=numofanimations;
  1076. animation[count2].attack[1]=9;
  1077. strcpy(filename,"sisatk");
  1078. for (count=1;count<=animation[count2].attack[1];count++)
  1079. {
  1080. filename[6]=48+(count/10)%10;
  1081. filename[7]=48+count%10;
  1082. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1083. numofanimations++;
  1084. }
  1085. animation[count2].die[0]=numofanimations;
  1086. animation[count2].die[1]=9;
  1087. strcpy(filename,"sisdie");
  1088. for (count=1;count<=animation[count2].die[1];count++)
  1089. {
  1090. filename[6]=48+(count/10)%10;
  1091. filename[7]=48+count%10;
  1092. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1093. numofanimations++;
  1094. }
  1095. }
  1096. count2=14;
  1097. if (animation[count2].loaded==2)
  1098. {
  1099. animation[count2].loaded=1;
  1100. animation[count2].stand[0]=numofanimations;
  1101. animation[count2].stand[1]=5;
  1102. strcpy(filename,"ghosta");
  1103. for (count=1;count<=animation[count2].stand[1];count++)
  1104. {
  1105. filename[6]=48+(count/10)%10;
  1106. filename[7]=48+count%10;
  1107. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1108. numofanimations++;
  1109. }
  1110. animation[count2].walk[0]=numofanimations;
  1111. animation[count2].walk[1]=5;
  1112. strcpy(filename,"ghowlk");
  1113. for (count=1;count<=animation[count2].walk[1];count++)
  1114. {
  1115. filename[6]=48+(count/10)%10;
  1116. filename[7]=48+count%10;
  1117. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1118. numofanimations++;
  1119. }
  1120. animation[count2].attack[0]=numofanimations;
  1121. animation[count2].attack[1]=8;
  1122. strcpy(filename,"ghoatk");
  1123. for (count=1;count<=animation[count2].attack[1];count++)
  1124. {
  1125. filename[6]=48+(count/10)%10;
  1126. filename[7]=48+count%10;
  1127. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1128. numofanimations++;
  1129. }
  1130. animation[count2].die[0]=numofanimations;
  1131. animation[count2].die[1]=9;
  1132. strcpy(filename,"ghodie");
  1133. for (count=1;count<=animation[count2].die[1];count++)
  1134. {
  1135. filename[6]=48+(count/10)%10;
  1136. filename[7]=48+count%10;
  1137. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1138. numofanimations++;
  1139. }
  1140. }
  1141. count2=15;
  1142. if (animation[count2].loaded==2)
  1143. {
  1144. animation[count2].loaded=1;
  1145. animation[count2].stand[0]=numofanimations;
  1146. animation[count2].stand[1]=6;
  1147. strcpy(filename,"bassta");
  1148. for (count=1;count<=animation[count2].stand[1];count++)
  1149. {
  1150. filename[6]=48+(count/10)%10;
  1151. filename[7]=48+count%10;
  1152. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1153. numofanimations++;
  1154. }
  1155. animation[count2].walk[0]=numofanimations;
  1156. animation[count2].walk[1]=9;
  1157. strcpy(filename,"baswlk");
  1158. for (count=1;count<=animation[count2].walk[1];count++)
  1159. {
  1160. filename[6]=48+(count/10)%10;
  1161. filename[7]=48+count%10;
  1162. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1163. numofanimations++;
  1164. }
  1165. animation[count2].attack[0]=numofanimations;
  1166. animation[count2].attack[1]=9;
  1167. strcpy(filename,"basatk");
  1168. for (count=1;count<=animation[count2].attack[1];count++)
  1169. {
  1170. filename[6]=48+(count/10)%10;
  1171. filename[7]=48+count%10;
  1172. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1173. numofanimations++;
  1174. }
  1175. animation[count2].die[0]=numofanimations;
  1176. animation[count2].die[1]=9;
  1177. strcpy(filename,"basdie");
  1178. for (count=1;count<=animation[count2].die[1];count++)
  1179. {
  1180. filename[6]=48+(count/10)%10;
  1181. filename[7]=48+count%10;
  1182. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1183. numofanimations++;
  1184. }
  1185. }
  1186. count2=16;
  1187. if (animation[count2].loaded==2)
  1188. {
  1189. animation[count2].loaded=1;
  1190. animation[count2].stand[0]=numofanimations;
  1191. animation[count2].stand[1]=6;
  1192. strcpy(filename,"satsta");
  1193. for (count=1;count<=animation[count2].stand[1];count++)
  1194. {
  1195. filename[6]=48+(count/10)%10;
  1196. filename[7]=48+count%10;
  1197. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1198. numofanimations++;
  1199. }
  1200. animation[count2].walk[0]=numofanimations;
  1201. animation[count2].walk[1]=9;
  1202. strcpy(filename,"satwlk");
  1203. for (count=1;count<=animation[count2].walk[1];count++)
  1204. {
  1205. filename[6]=48+(count/10)%10;
  1206. filename[7]=48+count%10;
  1207. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1208. numofanimations++;
  1209. }
  1210. animation[count2].attack[0]=numofanimations;
  1211. animation[count2].attack[1]=9;
  1212. strcpy(filename,"satatk");
  1213. for (count=1;count<=animation[count2].attack[1];count++)
  1214. {
  1215. filename[6]=48+(count/10)%10;
  1216. filename[7]=48+count%10;
  1217. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1218. numofanimations++;
  1219. }
  1220. animation[count2].die[0]=numofanimations;
  1221. animation[count2].die[1]=9;
  1222. strcpy(filename,"ribdie");
  1223. for (count=1;count<=animation[count2].die[1];count++)
  1224. {
  1225. filename[6]=48+(count/10)%10;
  1226. filename[7]=48+count%10;
  1227. loadtexturetga(numofanimations,filename,0,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,GL_LINEAR,GL_LINEAR);
  1228. numofanimations++;
  1229. }
  1230. }
  1231. if (changeddir==0)
  1232. chdir("..");
  1233. }