- Timestamp:
- Nov 14, 2003, 6:02:36 PM (17 years ago)
- Location:
- libcaca/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/box.c
r165 r173 30 30 { 31 31 box *b = malloc(sizeof(box)); 32 if(b == NULL) 33 exit(1); 32 34 33 35 b->x = x; -
libcaca/trunk/src/main.c
r153 r173 37 37 { 38 38 game *g = malloc(sizeof(game)); 39 if(g == NULL) 40 exit(1); 39 41 40 42 srand(time(NULL)); … … 71 73 g->sf = create_starfield(g); 72 74 g->wp = malloc(sizeof(weapons)); 75 if(g->wp == NULL) 76 exit(1); 73 77 g->ex = malloc(sizeof(explosions)); 78 if(g->ex == NULL) 79 exit(1); 74 80 g->bo = malloc(sizeof(bonus)); 81 if(g->bo == NULL) 82 exit(1); 75 83 g->t = create_tunnel(g, g->w, g->h); 76 84 g->p = create_player(g); 77 85 g->al = malloc(sizeof(aliens)); 86 if(g->al == NULL) 87 exit(1); 78 88 79 89 init_bonus(g, g->bo); -
libcaca/trunk/src/player.c
r163 r173 33 33 { 34 34 player *p = malloc(sizeof(player)); 35 if(p == NULL) 36 exit(1); 35 37 36 38 p->x = g->w / 2; -
libcaca/trunk/src/starfield.c
r161 r173 33 33 34 34 s = malloc(STARS * sizeof(starfield)); 35 if(s == NULL) 36 exit(1); 35 37 36 38 for(i = 0; i < STARS; i++) -
libcaca/trunk/src/tunnel.c
r153 r173 32 32 int i; 33 33 tunnel *t = malloc(sizeof(tunnel)); 34 if(t == NULL) 35 exit(1); 34 36 35 37 t->left = malloc(h*sizeof(int)); 38 if(t->left == NULL) 39 exit(1); 36 40 t->right = malloc(h*sizeof(int)); 41 if(t->right == NULL) 42 exit(1); 37 43 t->w = w; 38 44 t->h = h; -
libcaca/trunk/src/weapons.c
r163 r173 170 170 if(dx | dy) 171 171 { 172 int norm = ee_sqrt(dx * dx + 4 * dy * dy);172 unsigned int norm = ee_sqrt(dx * dx + 4 * dy * dy); 173 173 dx = dx * 32 / norm; 174 174 dy = dy * 32 / norm; … … 182 182 if(dx | dy) 183 183 { 184 int norm = ee_sqrt(dx * dx + 4 * dy * dy);184 unsigned int norm = ee_sqrt(dx * dx + 4 * dy * dy); 185 185 wp->vx[i] = dx * 32 / norm; 186 186 wp->vy[i] = dy * 32 / norm;
Note: See TracChangeset
for help on using the changeset viewer.