~ubuntu-branches/ubuntu/raring/powermanga/raring

« back to all changes in this revision

Viewing changes to src/powermanga.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-08-19 10:15:56 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060819101556-llg7innyzoadukro
Tags: 0.80-3ubuntu1
* Re-merge with Debian
* Fix desktop file for validation
* Install icon in /usr/share/pixmaps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//*****************************************************************************
2
 
// copyright (c) 1998-2004 TLK Games all rights reserved
 
2
// copyright (c) 1998-2005 TLK Games all rights reserved
3
3
//-----------------------------------------------------------------------------
4
4
// file         : "powermanga.cpp"
5
5
// created      : ?
6
 
// updates      : 2004-08-01
 
6
// updates      : 2005-01-08
 
7
// id           : $Id: powermanga.cpp,v 1.1.1.1 2005/01/25 05:53:49 gurumeditation Exp $
7
8
//-----------------------------------------------------------------------------
8
9
// This program is free software; you can redistribute it and/or modify it under
9
10
// the terms of the GNU General Public License as published by the Free Software
22
23
//*****************************************************************************
23
24
//..............................................................................
24
25
#include "powermanga.hpp"
25
 
 
 
26
extern configfile*      power_conf;
26
27
//..............................................................................
27
 
extern int              fullscreen;                            // 1=full screen (use dga or real full screen with SDL)
28
28
unsigned int            iJoueIntro = 1;                        //1=start anim / 2= end anom 
29
29
unsigned int            iCodeTouche = 0;                       //code key pressed / code touche pressee
30
30
unsigned int            iBoutonFeu = 0;                        //1=bouton de la manette de jeu enfonce
41
41
void                    _execute_congra(int);
42
42
int                     iErreurInitialisation;                 //1=erreur a l'initialisation
43
43
extern unsigned int     iOctetsParPixel;                       //nombre d'octets par pixels (1=256 couleurs / 2=65536 couleurs)
44
 
extern _etbfonte1      *pEtbfonte1;                            //object handle 8x8 chars (about CTRL + A)
 
44
extern _etbfonte1             *pEtbfonte1;         //(ETB)objet cpp geran affichage caracteres 8x8
45
45
 
46
46
//..............................................................................
47
47
// Variables utilisees pour la gestion generale du jeu *************************
128
128
vaisseau_nmi            ve[MAX_NMI_ON_SCREEN];                 // D�claration de la structure des vaisseaux ennemis.
129
129
int                     liste_ve[MAX_NMI_ON_SCREEN];           // liste de tous les vaisseaux ennemis a gerer
130
130
int                     cmpt_nmis;                             //compteur nombre d'ennemis
131
 
short                   nbr_nmis = 0;                          //aliens current number
132
 
int                     new_ve;                                //Indique l'indice du tableau corespondant � un nouvel objet 've'.
 
131
short                   nbr_nmis = 0;                          // Indique le nombre d'enemis actuellement g�r�s.
 
132
int                     new_ve;                                // Indique l'indice du tableau corespondant � un nouvel objet 've'.
133
133
explosion               xpl[MAX_NMI_ON_SCREEN];                //structure utilisee par les explosions
134
134
int                     liste_xpl[MAX_NMI_ON_SCREEN];          //liste de tous les 'xpl' geres
135
135
int                     cmpt_exps;                             //compteur du nombre d'explosions
163
163
str_canon               can[MAX_CANONS_ON_SCREEN];             //structure des canons.
164
164
int                     new_can;                               //pointeur sur un nouvel element 'can'.
165
165
int                     cmpt_canons;                           //compteur du nombre de canons
166
 
option                  aff_option[11];                        //tableau pour afficher options 
 
166
option                  aff_option[MAX_TYP_OF_OPTIONS];                        //tableau pour afficher options 
167
167
int                     nbr_ve_spe_generes;                    //nombre de vaisseaux sp�ciaux d�j� utilis�s dans le jeu.
168
168
short                   nbr_bonus = 0;                         //nombre de bonus actuellement g�r�s.
169
169
image                   bonus[MAX_TYP_OF_BONUS][NBR_IMAGES_BONUS];      //tableau des diff�rentes images des bonus.
205
205
int                     tmp_tstd_y;
206
206
short                   ce_vais_act = 0;                       // Variable utilis�e pour indiquer le vaisseau actuellement s�lectionn� dans l'�diteur de courbe.
207
207
short                                                   cercle_px[] = {30,29,29,29,28,27,26,25,24,22,21,19,17,15,13,11,9,7,4,2,0,-2,-4,-7,-9,-11,-13,-15,-17,-19,-21,-22,-24,-25,-26,-27,-28,-29,-29,-29,-30,-29,-29,-29,-28,-27,-26,-25,-24,-22,-21,-19,-17,-15,-13,-11,-9,-7,-4,-2,0,2,4,7,9,11,13,15,17,19,21,22,24,25,26,27,28,29,29,29};
208
 
short                                                   cercle_py[] = {0,2,4,7,9,11,13,15,17,19,21,22,24,25,26,27,28,29,29,29,30,29,29,29,28,27,26,25,24,22,21,19,17,15,13,11,9,7,4,2,0,-2,-4,-7,-9,-11,-13,-15,-17,-19,-21,-22,-24,-25,-26,-27,-28,-29,-29,-29,-30,-29,-29,-29,-28,-27,-26,-25,-24,-22,-21,-19,-17,-15,-13,-11,-9,-7,-4,-2};
 
208
short                                                   cercle_py[] = {0,2,4,7,9,11,13,15,17,19,21,22,24,25,26,27,28,29,29,29,30,29,29,29,28,27,26,25,24,22,21,19,17,15,13,11,9,7,4,2,0,-2,-4,-7,-9,-11,-13,-15,-17,-19,-21,-22,-24,-25,-26,-27,-28,-29,-29,-29,-30,-29,-29,-29,-28,-27,-26,-25,-24,-22,-21,-19,-17,-15,-13,-11,-9,-7,-4,-2};
 
209
 
 
210
 
 
211
// game language
 
212
char                    Lang[8];
 
213
 
209
214
 
210
215
//******************************************************************************
211
216
// "upDateFrame" : the main loop of game / boucle principale du jeu
442
447
    if(vj[J1].type_vaisseau != V1J)                            //le vaisseau n'est pas le premier vaisseau ?
443
448
    {
444
449
      vj[J1].type_vaisseau--;                                  //non, on regresse au vaisseau inferieur
445
 
#ifdef UTILISE_SEAL
 
450
#ifdef USE_SDLMIXER
446
451
      seal_joue(VCHANGE2);                                     //joue un son avec seal
447
452
#endif
448
453
      vj[J1].metamorphose = 1;                                 //indique une metamorphose du vaisseau
555
560
 
556
561
  
557
562
#ifdef SDL_TLK
558
 
  //if ((touch[39]) && (touche_ctrl))
559
 
  if((touch[39]) && !_score::isInputName())
560
 
  {  
561
 
    if(fullscreen)
562
 
      fullscreen = 0;
563
 
    else
564
 
      fullscreen = 1;
565
 
    init_video_mode();
566
 
  }
567
 
  touch[39] = 0;
 
563
        //if ((touch[39]) && (touche_ctrl))
 
564
        if((touch[39]) && !_score::isInputName())
 
565
        {       if(power_conf->fullscreen)
 
566
                        power_conf->fullscreen = 0;
 
567
                else
 
568
                        power_conf->fullscreen = 1;
 
569
                init_video_mode();
 
570
        }
 
571
        touch[39] = 0;
568
572
#endif
569
573
  
570
574
  
655
659
  touchesTriches();
656
660
#endif
657
661
 
658
 
  //Gestion des tirs du joueur (JMM) --------------------------------------------
 
662
        //handle weapon's player ship
659
663
#ifdef DEVELOPPEMENT
660
 
  if(!grid_editor && !curv_editor && !game_over_player_one && !player_pause
661
 
     && etat_menu == MENU_OFF && _score::getActionExecution() == 0)
 
664
        if(!grid_editor && !curv_editor && !game_over_player_one && !player_pause
 
665
                && etat_menu == MENU_OFF && _score::getActionExecution() == 0)
662
666
#else
663
 
  if(!game_over_player_one && !player_pause && etat_menu == MENU_OFF
664
 
     && _score::getActionExecution() == 0)
 
667
        if(!game_over_player_one && !player_pause && etat_menu == MENU_OFF
 
668
                && _score::getActionExecution() == 0)
665
669
#endif
666
 
  {
667
 
    tirsJoueur();
668
 
  }
669
 
  return 1;
 
670
                tirsJoueur();
 
671
        return 1;
670
672
}