Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1349 → Rev 1348

/demos/trunk/astro/astro.c
3,6 → 3,9
*
* Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
*
* Authors : Paolo Gai <pj@hartik.sssup.it>
* (see authors.txt for full list of hartik's authors)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
10,6 → 13,25
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#include "asteroid.h"
 
int nshot; /* number of shot active */
373,7 → 395,7
soft_task_def_usemath(ms);
pid = task_create("Astro", astro, &ms, NULL);
if (pid == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <astro>");
sys_end();
} else
386,7 → 408,7
hard_task_def_usemath(mp);
pid = task_create("Taken", look, &mp, NULL);
if (pid == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Taken>");
sys_end();
} else
402,7 → 424,7
hard_task_def_usemath(mp);
pid_TL = task_create("TurnLeft", turn, &mp, NULL);
if (pid_TL == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Turn L>");
sys_end();
}
417,7 → 439,7
hard_task_def_usemath(mp);
pid_TR = task_create("TurnRight", turn, &mp, NULL);
if (pid_TR == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Turn R>");
sys_end();
}
432,7 → 454,7
hard_task_def_usemath(mp);
pid_SU = task_create("SpeedUP", speed, &mp, NULL);
if (pid_SU == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Speed UP>");
sys_end();
}
447,7 → 469,7
hard_task_def_usemath(mp);
pid_SD = task_create("SpeedDOWN", speed, &mp, NULL);
if (pid_SD == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Speed DOWN>");
sys_end();
}
462,7 → 484,7
hard_task_def_usemath(mp);
pid_SZ = task_create("SpeedZERO", speed, &mp, NULL);
if (pid_SZ == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Speed ZERO>");
sys_end();
}
474,7 → 496,7
hard_task_def_usemath(mp);
pid = task_create("MoveAstro", move, &mp, NULL);
if (pid == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <MoveAstro>");
sys_end();
} else
491,7 → 513,7
hard_task_def_usemath(mp);
pid_FL = task_create("FlipAstro", turn, &mp, NULL);
if (pid_FL == NIL) {
FB26_close(FRAME_BUFFER_DEVICE);
grx_close();
perror("Could not create task <Flip Astro>");
sys_end();
}
527,51 → 549,43
k.flag = 0;
k.scan = KEY_SPC;
k.ascii = ' ';
k.status = KEY_PRESSED;
keyb_hook(k,new_shot,FALSE);
keyb_hook(k,new_shot);
 
k.flag = 0;
k.scan = KEY_O;
k.ascii = 'o';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
k.flag = 0;
k.scan = KEY_P;
k.ascii = 'p';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
k.flag = 0;
k.scan = KEY_S;
k.ascii = 's';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
k.flag = 0;
k.scan = KEY_Z;
k.ascii = 'z';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
#ifdef ASTRO_MOVE
k.flag = 0;
k.scan = KEY_A;
k.ascii = 'a';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
k.flag = 0;
k.scan = KEY_F;
k.ascii = 'f';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
#else
k.flag = 0;
k.scan = KEY_X;
k.ascii = 'x';
k.status = KEY_PRESSED;
keyb_hook(k,pad,FALSE);
keyb_hook(k,pad);
 
#endif
}