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

« back to all changes in this revision

Viewing changes to src/fntscrol.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-2003 TLK Games all rights reserved
 
2
// copyright (c) 1998-2005 TLK Games all rights reserved
3
3
//------------------------------------------------------------------------------
4
4
// file         : "fntscrol.cpp" 
5
5
// created      : ?
6
 
// updates      : 2003-07-20
 
6
// updates      : 2005-01-07
7
7
//------------------------------------------------------------------------------
8
8
// functions    : Init_Scroll_Present()
9
9
//              : Destruct_Scroll_Font(int)
27
27
// You should have received a copy of the GNU General Public License along with
28
28
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
29
29
// Place - Suite 330, Boston, MA  02111-1307, USA.
30
 
//
31
30
//******************************************************************************
32
31
#include "powermanga.hpp"
33
32
//..............................................................................
 
33
extern configfile*      power_conf;
34
34
extern fonte            fnt_scroll[NBR_FONTES_SCROLL];         //Tableau de variables utilise pour l'affichage des caracteres qui scrollent.
35
35
extern int              liste_fnt_scroll[NBR_FNT_SCROLL_MAX];  // D�finit la liste de toutes les fontes qui scrollent que l'on doit g�r�s � chaque VBLs.
36
36
extern int              cmpt_fnt_scroll;                       // Utilis� dans les bcles pour compter le nombre de fontes qui scrollent.
53
53
bool                    dir_font_x;
54
54
bool                    dir_font_y;                            // Indique le sens des deplacements.
55
55
char                   *s_empty ="                                                                   ";
56
 
char                   *s_present =
57
 
"WELCOME TO THE MENU OF POWERMANGA. USE THE UP AND DOWN ARROWS TO SELECT A \
58
 
MENU OPTION AND PRESS ENTER TO VALIDATE. DURING THE GAME, USE THE ARROWS TO MOVE THE \
59
 
SHIP, SPACE FOR SHOOTING AND CONTROL TO SELECT AN OPTION, THE P KEY TO PAUSE THE GAME \
60
 
AND THE ESCAPE KEY TO RETURN TO THIS MENU. \
61
 
THE GREEN GEMS INCREASE THE OPTION BY ONE, THE RED GEMS INCREASE THE OPTION BY TWO. \
62
 
THE YELLOW GEMS INCREASE THE NUMBER OF PROTECTION BALLS. \
63
 
WHEN YOU TAKE 6 YELLOW GEMS WITHOUT LOSING A PROTECTION BALL, YOU'LL HAVE A SPECIAL WEAPON. \
64
 
THE PINK GEMS INCREASE YOUR ENERGY AND IF YOUR ENERGY WAS ALREADY FULL IT WILL GIVE YOU A \
65
 
MEGA-BLAST WHICH DESTROYS ALL ENEMIES. POWERMANGA (C) 2003 TLK GAMES.             ";
 
56
 
 
57
// scroll text (now loaded from a file in Load_Scroll_Text())
 
58
char*   s_present = NULL;
 
59
 
 
60
 
 
61
//------------------------------------------------------------------------------
 
62
// load scroll-text
 
63
//------------------------------------------------------------------------------        
 
64
int Load_Scroll_Text()
 
65
{
 
66
        char* pLang = power_conf->get_txtlang();
 
67
        char fname[256];
 
68
        sprintf(fname, "texts/scroll_%s.txt", pLang);
 
69
        Uint32 bsize;
 
70
        char *pTemp = chargeFichier(fname, &bsize);
 
71
        if (!pTemp) return 0;
 
72
        
 
73
        s_present = reserveMemoire(bsize);
 
74
        if (!s_present)
 
75
        {       libereMemoire(pTemp);
 
76
                return 0;
 
77
        }
 
78
        
 
79
        Uint32 j = 0;
 
80
        for(Uint32 i = 0; i < bsize; i++)
 
81
        {       if(pTemp[i] >= ' ' && pTemp[i] != '"')
 
82
                        s_present[j++] = pTemp[i];
 
83
        }
 
84
        libereMemoire(pTemp);
 
85
        return 1;
 
86
}
 
87
 
 
88
//------------------------------------------------------------------------------
 
89
// Free scroll-text
 
90
//------------------------------------------------------------------------------        
 
91
void Free_Scroll_Text()
 
92
{
 
93
        if (s_present) 
 
94
        {       libereMemoire (s_present);
 
95
                s_present = NULL;
 
96
        }
 
97
}
 
98
 
66
99
        
67
100
//------------------------------------------------------------------------------
68
101
// initialize scroll-text