PageRenderTime 285ms CodeModel.GetById 61ms app.highlight 174ms RepoModel.GetById 27ms app.codeStats 11ms

/game/animation.c

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