Changeset 44


Ignore:
Timestamp:
Dec 22, 2002, 11:36:42 PM (20 years ago)
Author:
Sam Hocevar
Message:
  • Removed the dependency on <math.h>. We don't need no stinking sqrt!
Location:
ttyvaders/trunk/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/Makefile.am

    r40 r44  
    2525        explosions.c \
    2626        main.c \
     27        math.c \
    2728        starfield.c \
    2829        weapons.c \
  • ttyvaders/trunk/src/common.h

    r42 r44  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: common.h,v 1.8 2002/12/22 22:17:41 sam Exp $
     6 *   $Id: common.h,v 1.9 2002/12/22 22:36:42 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    186186void ceo_alert( void );
    187187
     188int r00t( int a );
     189
  • ttyvaders/trunk/src/weapons.c

    r42 r44  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: weapons.c,v 1.8 2002/12/22 22:17:41 sam Exp $
     6 *   $Id: weapons.c,v 1.9 2002/12/22 22:36:42 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    2222
    2323#include <stdlib.h>
    24 #include <math.h>
    2524
    2625#include "common.h"
     
    173172                /* Normalize and update speed */
    174173                wp->vx[i] = (7 * wp->vx[i]
    175                               + (dx * 48) / sqrt(dx*dx+dy*dy) ) / 8;
     174                              + (dx * 48) / r00t(dx*dx+dy*dy) ) / 8;
    176175                wp->vy[i] = (7 * wp->vy[i]
    177                               + (dy * 24) / sqrt(dx*dx+dy*dy) ) / 8;
     176                              + (dy * 24) / r00t(dx*dx+dy*dy) ) / 8;
    178177
    179178                break;
Note: See TracChangeset for help on using the changeset viewer.