~ubuntu-branches/ubuntu/saucy/dossizola/saucy

« back to all changes in this revision

Viewing changes to .pc/debian-changes-1.0-8.3/dossizola/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Jari Aalto
  • Date: 2010-11-05 16:16:25 UTC
  • Revision ID: james.westby@ubuntu.com-20101105161625-sih2fme049kwo4th
Tags: 1.0-8.3
* Non-maintainer upload.
  - Move to packaging format "3.0 (quilt)" due to desktop image files.
  - NMU approved by maintainer, see #549545.
* debian/compat
  - Update obsolete 5 to 8.
* debian/control
  - (Build-Depends): Add autotools-dev due to config.{sub,guess}.
    Update to debhelper 8.
  - (Depends) update tag "Source-Version" to "source:Version"
    to correct binNMU. Patch tanks to Lior Kaplan <kaplan@debian.org>
    (normal; Closes: #435939).
  - (Homepage): New field.
  - (Standards-Version): Update to 3.9.1.
  - Package dossizola
    + (Depends): Add ${misc:Depends} (Lintian).
  - Package dossizola-data
    + (Depends): New. Add ${misc:Depends} (Lintian).
    + (Description): Extend (Lintian).
* debian/copyright
  - Point to GPL-2, save as UTF-8, add copyright years (Lintian).
  - Add FSF preamble (Lintian).
  - Point URL to canonical Sourceforge project.
* debian/dossizola.{desktop,png,xcf}
  - New. Supplied by Stéphane Blondon <stephane.blondon@gmail.com>.
    (minor; Closes: #573870).
* debian/dossizola.sgml
  - (refnamediv): Fix bad whatis entry. Must be same as <refmeta> (Lintian).
* debian/rules
  - (PACKAGE, PKGDIR, SHAREROOTDIR, ICONDIR, DESKTOPDIR): New variables.
  - (binary-indep): Comment out dh_installchangelogs because upsream
    ChangeLog is empty (Lintian).
  - (clean): Cann makefile only if it exists. Delete Makefile.
  - (configure-stamp): use latest config.{sub,guess}
    (wishlist, FTBFS avr32; Closes: #549545).
  - (install): Change obsolete "dh_clean -k" to "dh_prep" (Lintian).
    Add install commands for *.desktop file and icons.
* debian/preinst
  - Add "set -e" (Lintian).
* debian/source/{format,include-binaries}
  - New files.
* debian/watch
  - New file (Lintian).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <string.h>
 
4
#include <time.h>
 
5
#include <SDL/SDL.h>
 
6
#include <SDL/SDL_image.h>
 
7
#include "isola.h"
 
8
 
 
9
 
 
10
// ****************************************************************************
 
11
// ********************************** Main ************************************
 
12
// ****************************************************************************
 
13
int main (int argc, char *argv[])
 
14
{
 
15
        JEU jeu;                                        // Donn�es principales du jeu
 
16
        Uint32 flags;                           // Param�tres pour l'affichage (fen�tre ou plein �cran)
 
17
        int i;
 
18
        
 
19
        srand ((unsigned) time (NULL)); // Initialise le g�n�rateur de nbs al�atoires
 
20
        flags = SDL_SWSURFACE;                  // Parametre de l'�cran
 
21
        
 
22
        // Lit les options pass�es en argument au programme
 
23
        for (i = 1; i < argc; i ++)
 
24
        {
 
25
                if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help"))             // Affiche une aide
 
26
                {       printf ("\n************** Do'SSi Zo'la 1.0 **************\n");
 
27
                        printf ("\n\t\t-h : this help\n\t\t-f : fullscreen\n\t\t-w : windowed\n");
 
28
                        printf ("\ncontact the authors:\nCyril CLEMENT  <dossiman@users.sourceforge.net>\nGaelle DAIREAUX <ponstyl@users.sourceforge.net>\n");
 
29
                        printf ("\nhome page: http://dossizola.sourceforge.net\n\n");
 
30
                        exit (0);
 
31
                }
 
32
                else if (!strcmp (argv[i], "-f"))       // Mode plein �cran
 
33
                        flags = SDL_HWSURFACE | SDL_FULLSCREEN;
 
34
                else if (!strcmp (argv[i], "-w"))       // Mode fen�tr�e
 
35
                        flags = SDL_HWSURFACE;
 
36
                else
 
37
                {       fprintf (stderr, "%s not allowed.\n", argv[i]);
 
38
                        exit (1);
 
39
                }
 
40
        }       
 
41
        strcpy (imgpath, argv[0]);
 
42
        for (i = strlen (imgpath); i >= 0; i --)
 
43
        {       
 
44
                if (imgpath[i] == '/')
 
45
                {       imgpath[i] = '\0';
 
46
                        strcat (imgpath, "/images/");
 
47
                        break;
 
48
                }
 
49
                if (!i) strcpy (imgpath, "./images/");
 
50
        }
 
51
        
 
52
        // Initialise SDL
 
53
        if (SDL_Init (SDL_INIT_VIDEO) < 0)
 
54
        {       fprintf (stderr, "Impossible d'initialiser SDL (%s)\n", SDL_GetError());
 
55
                exit (1);
 
56
        }
 
57
        // Lib�rera les ressources utilis�es par SDL en quittant
 
58
        atexit (SDL_Quit);
 
59
        
 
60
        // Initialise l'affichage en plein �cran ou en fen�tre en 1024x768x32
 
61
        if (!(jeu.ecran = SDL_SetVideoMode (800, 600, 32, flags)))
 
62
                if (!(jeu.ecran = SDL_SetVideoMode (800, 600, 24, flags)))
 
63
                        if (!(jeu.ecran = SDL_SetVideoMode (800, 600, 16, flags)))
 
64
                        {       fprintf (stderr, "Impossible de definir le mode 800*600 (%s)\n", SDL_GetError());
 
65
                                exit (1);
 
66
                        }
 
67
        // D�finit le titre de la fen�tre
 
68
        SDL_WM_SetCaption ("Do'SSi Zo'la", "Do'SSi Zo'la");
 
69
        
 
70
        // Cr�e un back buffer (une copie de sauvegarde de l'�cran en m�moire)
 
71
        if (!(jeu.back = SDL_DisplayFormat (jeu.ecran)))
 
72
        {       fprintf (stderr, "Impossible de cr�er un back buffer (%s)\n", SDL_GetError ());
 
73
                SDL_FreeSurface (jeu.back);
 
74
                exit (1);
 
75
        }
 
76
        
 
77
        // Pr�pare la police de caract�re
 
78
        sprintf (fichier, "%s%s", imgpath, IMG_POLICE1);
 
79
        if (!(jeu.police1.img = IMG_Load (fichier))) ImageErreur (fichier);
 
80
        sprintf (fichier, "%s%s", imgpath, IMG_POLICE2);
 
81
        if (!(jeu.police2.img = IMG_Load (fichier))) ImageErreur (fichier);
 
82
        sprintf (fichier, "%s%s", imgpath, IMG_POLICE3);
 
83
        if (!(jeu.police3.img = IMG_Load (fichier))) ImageErreur (fichier);
 
84
        SDL_SetColorKey (jeu.police1.img, SDL_SRCCOLORKEY, SDL_MapRGB (jeu.police1.img->format, 255, 0, 255));
 
85
        SDL_SetColorKey (jeu.police2.img, SDL_SRCCOLORKEY, SDL_MapRGB (jeu.police2.img->format, 255, 0, 255));
 
86
        SDL_SetColorKey (jeu.police3.img, SDL_SRCCOLORKEY, SDL_MapRGB (jeu.police3.img->format, 255, 0, 255));
 
87
        jeu.police1.rect.x = jeu.police2.rect.x = jeu.police3.rect.x = 0;
 
88
        jeu.police1.rect.y = jeu.police2.rect.y = jeu.police3.rect.y = 0;
 
89
        jeu.police1.rect.w = jeu.police2.rect.w = jeu.police3.rect.w = jeu.police1.img->w / 37;         // Il y a 37 caracteres dans la police
 
90
        jeu.police1.rect.h = jeu.police2.rect.h = jeu.police3.rect.h = jeu.police1.img->h;
 
91
        
 
92
        // Param�tres par d�faut
 
93
        jeu.J1ROUGE = DFT_J1ROUGE;
 
94
        jeu.J1TYPE = DFT_J1TYPE;
 
95
        jeu.J2TYPE = DFT_J2TYPE;
 
96
        jeu.J1NIVO = DFT_J1NIVO;
 
97
        jeu.J2NIVO = DFT_J2NIVO;
 
98
        jeu.INTEMP = DFT_INTEMP;
 
99
        jeu.DOUBLE_DEPLACE  = DFT_DOUBLE_DEPLACE;
 
100
        jeu.DOUBLE_BOULEFEU = DFT_DOUBLE_BOULEFEU;
 
101
        jeu.XGRILLE = DFT_XGRILLE;
 
102
        jeu.YGRILLE = DFT_YGRILLE;
 
103
        FPS = DFT_FPS;
 
104
        
 
105
        while (1)
 
106
        {
 
107
                // Lance le menu de choix des options du jeu si la fonction retourne oui, le prog quitte
 
108
                if (Menu (&jeu)) break;
 
109
                
 
110
                // Lance une partie
 
111
                if (Jeu (&jeu)) break;
 
112
        }
 
113
        
 
114
        printf ("\nIf you have fun with this game, do not forget to rate it at :\n\thttp://happypenguin.org/show?Do'SSi%%20Zo'la\n\nIf you have some question or remark, please send mail to:\n\tdossiman@users.sourceforge.net\n\n");
 
115
        
 
116
        SDL_FreeSurface (jeu.back);
 
117
        SDL_FreeSurface (jeu.police1.img);
 
118
        SDL_FreeSurface (jeu.police2.img);
 
119
        SDL_FreeSurface (jeu.police3.img);
 
120
        
 
121
        return 0;
 
122
}