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

« back to all changes in this revision

Viewing changes to src/linux.hpp

  • 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
 
//*****************************************************************************
2
 
// copyright (c) 1998-2004 TLK Games all rights reserved
3
 
//-----------------------------------------------------------------------------
4
 
// file         : "linux..hpp"
5
 
// created      : 1999-08-17
6
 
// updates      : 2004-08-04
7
 
//-----------------------------------------------------------------------------
8
 
// This program is free software; you can redistribute it and/or modify it under
9
 
// the terms of the GNU General Public License as published by the Free Software
10
 
// Foundation; either version 2 of the License, or (at your option) any later
11
 
// version.
12
 
// 
13
 
// This program is distributed in the hope that it will be useful, but WITHOUT
14
 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
 
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16
 
// details.
17
 
//
18
 
// You should have received a copy of the GNU General Public License along with
19
 
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20
 
// Place - Suite 330, Boston, MA  02111-1307, USA.
21
 
//
22
 
//*****************************************************************************
23
 
#ifndef __LINUXHPP__
 
1
//*****************************************************************************
 
2
// copyright (c) 1998-2003 TLK Games all rights reserved
 
3
//-----------------------------------------------------------------------------
 
4
// file         : "linux..hpp"
 
5
// created      : 1999-08-17
 
6
// updates      : 2003-06-28
 
7
//-----------------------------------------------------------------------------
 
8
// This program is free software; you can redistribute it and/or modify it under
 
9
// the terms of the GNU General Public License as published by the Free Software
 
10
// Foundation; either version 2 of the License, or (at your option) any later
 
11
// version.
 
12
// 
 
13
// This program is distributed in the hope that it will be useful, but WITHOUT
 
14
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
15
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
16
// details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License along with
 
19
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
20
// Place - Suite 330, Boston, MA  02111-1307, USA.
 
21
//
 
22
//*****************************************************************************
 
23
#ifndef __LINUXHPP__
24
24
#define __LINUXHPP__
25
25
 
26
26
//////////////////////////
36
36
#include <math.h>
37
37
 
38
38
#else //WIN32
39
 
 
40
 
//..............................................................................
41
 
#include <stdio.h>
42
 
#include <string.h>
43
 
#include <unistd.h>
44
 
#include <math.h>
45
 
#include <stdlib.h>
46
 
#include <fcntl.h>
47
 
#include <sys/stat.h>
48
 
#include <sys/time.h>
49
 
#include <sys/utsname.h>
50
 
#include <pthread.h>
51
 
#include <unistd.h>
 
39
 
 
40
//..............................................................................
 
41
#include <stdio.h>
 
42
#include <string.h>
 
43
#include <unistd.h>
 
44
#include <math.h>
 
45
#include <stdlib.h>
 
46
#include <fcntl.h>
 
47
#include <sys/stat.h>
 
48
#include <sys/time.h>
 
49
#include <sys/utsname.h>
 
50
#include <pthread.h>
 
51
#include <unistd.h>
52
52
#include <sys/types.h>
53
53
 
54
54
#endif //WIN32
55
 
 
56
 
 
57
 
#ifndef _S_ISDIR
58
 
#define _S_ISDIR(__mode) (__mode & _S_IFDIR)
59
 
#endif
60
 
 
61
 
//..............................................................................
62
 
#define _VERBEUX_
63
 
#define TRUE                   1
64
 
#define FALSE                  0
65
 
 
66
 
//gestion fichier graphique en memoire ...........................................
67
 
typedef struct
68
 
{ unsigned int            iLargeur;                            //image width
69
 
  unsigned int            iHauteur;                            //image height
70
 
  unsigned int            iProfond;                            //bits per pixels
71
 
  unsigned int            iTaille;                             //memory size
72
 
  char*                   pAdresse;                            //pointer to the image data
73
 
  unsigned char           tPaletteGif[768] ;                   //palette
74
 
} sDescriptionGfx;
75
 
 
76
 
//"xwindow.cpp"....................................................................
77
 
int                    xw_init();
78
 
int                    reserve_ecran_ram();
79
 
int                    charge_palette(char* _pNomFichier);
80
 
int                    xw_exec();
81
 
int                    change_resolution();
82
 
int                    xw_kill();
83
 
char                  *Xload_pcx(char* _pNomFichier);
84
 
int                    Xload_pcx(char* _pNomFichier, char* _pMem);
85
 
char                  *convertit_16ou24(sDescriptionGfx* _pSrc);
86
 
void                   copie_gfx(sDescriptionGfx* _pGfx);
87
 
int                    reserve_ecranPlayanim();
88
 
void                   kill_ecranPlayanim();
89
 
#ifdef SDL_TLK
90
 
void                   verouille();
91
 
void                   deverouille();
92
 
int                    init_video_mode();
93
 
#endif
94
 
 
95
 
//linuxroutines.cpp ------------------------------------------------------------
96
 
int                    mem_initialise(unsigned int _iNombreZones);
97
 
char*                  reserveMemoire(unsigned int _iTailleMemoire);
98
 
void                   libereMemoire(char* _pMemoire);
99
 
int                    mem_retourneTaille(char* _pMem);
100
 
void                   mem_libereTous();
101
 
int                    load_pcx(char*, char*);
102
 
sDescriptionGfx*       load_pcx(char*);
103
 
unsigned int           littleWord(char* _pMem);
104
 
short                  litMot16bits(short* _pMem);
105
 
int                    litMot32bits(int* _pMem);
106
 
void                   convert32bits_2bigendian (unsigned char* memory);
107
 
int                    chaine_cmp(char* _pChaine1, char* _pChaine2, unsigned int _iTaille);
108
 
char*                  chargeFichier(char* _pNomFichier);
109
 
char*                  chargeFichier(char* _pNomFichier, unsigned int* pTaille);
110
 
int                    chargeFichier(char* _pMemoire, char* _pNomFichier);
111
 
void                   fps_init();
112
 
void                   fps_affiche();
113
 
void                   afficheMessage(char* _Message);
114
 
void                   afficheMessage(char* _Message1, char* _Message2);
115
 
void                   afficheErreur(char* _pErreur1, char* _pErreur2);
116
 
void                   afficheErreur(char* _pErreur1, char* _pErreur2, int _iErreur);
117
 
void                   afficheErreur(char* _pErreur1, char* _pErreur2, char* _pErreur3);
118
 
int                    synchro_processusPause(int _iTemps);
119
 
int                    synchro_CalculDifference();
120
 
int                    synchro_CalculDifference2();
121
 
 
122
 
 
123
 
#endif
 
55
 
 
56
//..............................................................................
 
57
#define _VERBEUX_
 
58
#define TRUE                   1
 
59
#define FALSE                  0
 
60
 
 
61
//gestion fichier graphique en memoire ...........................................
 
62
typedef struct
 
63
{ unsigned int            iLargeur;                            //image width
 
64
  unsigned int            iHauteur;                            //image height
 
65
  unsigned int            iProfond;                            //bits per pixels
 
66
  unsigned int            iTaille;                             //memory size
 
67
  char*                   pAdresse;                            //pointer to the image data
 
68
  unsigned char           tPaletteGif[768] ;                   //palette
 
69
} sDescriptionGfx;
 
70
 
 
71
//"xwindow.cpp"....................................................................
 
72
int                    xw_init();
 
73
int                    reserve_ecran_ram();
 
74
int                    charge_palette(char* _pNomFichier);
 
75
int                    xw_exec();
 
76
int                    change_resolution();
 
77
int                    xw_kill();
 
78
char                  *Xload_pcx(char* _pNomFichier);
 
79
int                    Xload_pcx(char* _pNomFichier, char* _pMem);
 
80
char                  *convertit_16ou24(sDescriptionGfx* _pSrc);
 
81
void                   copie_gfx(sDescriptionGfx* _pGfx);
 
82
int                    reserve_ecranPlayanim();
 
83
void                   kill_ecranPlayanim();
 
84
#ifdef SDL_TLK
 
85
void                   verouille();
 
86
void                   deverouille();
 
87
int                    init_video_mode();
 
88
#endif
 
89
 
 
90
//linuxroutines.cpp ------------------------------------------------------------
 
91
int                    mem_initialise(unsigned int _iNombreZones);
 
92
char*                  reserveMemoire(unsigned int _iTailleMemoire);
 
93
void                   libereMemoire(char* _pMemoire);
 
94
int                    mem_retourneTaille(char* _pMem);
 
95
void                   mem_libereTous();
 
96
int                    load_pcx(char*, char*);
 
97
sDescriptionGfx*       load_pcx(char*);
 
98
unsigned int           littleWord(char* _pMem);
 
99
short                  litMot16bits(short* _pMem);
 
100
int                    litMot32bits(int* _pMem);
 
101
void                   convert32bits_2bigendian (unsigned char* memory);
 
102
int                    chaine_cmp(char* _pChaine1, char* _pChaine2, unsigned int _iTaille);
 
103
char*                  chargeFichier(char* _pNomFichier);
 
104
char*                  chargeFichier(char* _pNomFichier, unsigned int* pTaille);
 
105
int                    chargeFichier(char* _pMemoire, char* _pNomFichier);
 
106
void                   fps_init();
 
107
void                   fps_affiche();
 
108
void                   afficheMessage(char* _Message);
 
109
void                   afficheMessage(char* _Message1, char* _Message2);
 
110
void                   afficheErreur(char* _pErreur1, char* _pErreur2);
 
111
void                   afficheErreur(char* _pErreur1, char* _pErreur2, int _iErreur);
 
112
void                   afficheErreur(char* _pErreur1, char* _pErreur2, char* _pErreur3);
 
113
int                    synchro_processusPause(int _iTemps);
 
114
int                    synchro_CalculDifference();
 
115
int                    synchro_CalculDifference2();
 
116
 
 
117
 
 
118
#endif