home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sources / 2611 / blast.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-23  |  1.2 KB  |  74 lines

  1. #ifndef lint
  2. static    char    sccsid[] = "@(#)blast.c 1.1 92/05/28 SMI" ;
  3.     /* @(#)blast.c 1.3 90/07/23 SMI */
  4. #endif
  5.  
  6. /*
  7.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  8.  */
  9.  
  10. /*
  11.  * this file is special for the fighter visuals.  It contains functions:
  12.  *
  13.  * set_blast_state(state)
  14.  *    changes graphics when blast state changes
  15.  *
  16.  */
  17.  
  18.  
  19.  
  20. #include <stdio.h>
  21. #include <math.h>
  22. #include "graphics.h"
  23. #include "dstar.h"
  24. #include "object_types.h"
  25. #include "line_object.h"
  26.  
  27. extern    int    debug_level ;
  28.  
  29. static    XYZF    blast_0[] = {
  30. #include "blast_line0.h"
  31. } ;
  32.  
  33. static    XYZF    blast_1[] = {
  34. #include "blast_line1.h"
  35. } ;
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. /* this routine creates a description for an explosion */
  43.  
  44.  
  45. void
  46. init_blasts(index)
  47.     int    index ;
  48. {
  49.     Object_Desc    *desc1, *desc2 ;
  50.  
  51.     desc1 = (Object_Desc *) malloc(sizeof(Object_Desc)) ;
  52.     desc2 = (Object_Desc *) malloc(sizeof(Object_Desc)) ;
  53.  
  54.     if(desc1 && desc2)
  55.     {
  56.       descriptions[index] = desc1 ;
  57.  
  58.       desc1->thresh = 100.0*100.0 ;
  59.       desc1->next = desc2 ;
  60.       desc1->type = LINE_DRAWING ;
  61.       desc1->first = (caddr_t) blast_0 ;
  62.  
  63.       desc2->thresh = 0.0 ;
  64.       desc2->next = NULL ;
  65.       desc2->type = LINE_DRAWING ;
  66.       desc2->first = (caddr_t) blast_1 ;
  67.     }
  68.     else
  69.     {
  70.       perror("init_blasts: malloc:") ;
  71.       exit(1) ;
  72.     }
  73. }
  74.