DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T r

⟦172237808⟧ TextFile

    Length: 3029 (0xbd5)
    Types: TextFile
    Names: »roids.h«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/X/Roids/roids.h« 

TextFile

/* roids.h - definitions of roids data structures. */

#ifndef _roids_h
#define _roids_h

#include <stdio.h>
#include <X11/Xos.h>
#include <math.h>
#include <X11/Xlib.h>

#include <X11/Xutil.h>
#include <X11/cursorfont.h>

#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>

#define XtRFloat "Float"
#define rint(x) ((int) (x))
#define MIN(x, y)	((x) < (y) ? (x) : (y))
#define MAX(x, y)	((x) > (y) ? (x) : (y))
#define NPOINTS 3		/* Number of points on a ship. */

#ifdef MAIN
#define ext
#else
#define ext extern
#endif

/*
 * Definitions to make us act as a widget.
 */

/* New fields for the Roids widget class record */
typedef struct {
     int mumble;   /* No new procedures */
} RoidsClassPart;

/* Full class record declaration */
typedef struct _RoidsClassRec {
    CoreClassPart       core_class;
    RoidsClassPart    roids_class;
} RoidsClassRec;

extern RoidsClassRec roidsClassRec;
extern WidgetClass roidsWidgetClass;

/* New fields for the Roids widget record */
typedef struct _RoidsPart {
    int dummy;
} RoidsPart;



/* Full instance record declaration */

typedef struct _RoidsRec {
    CorePart core;
    RoidsPart roids;
} RoidsRec, *RoidsWidget;




/*
 * Actual roids definitions.
 */

ext Boolean debug;

ext Display *dpy;
ext Window gamewindow;
ext RoidsWidget gamewidget;
ext int gamewidth, gameheight;
ext Widget toplevel, scorewidget;
ext int score;
ext int shipsleft;

/* Ship info: */

ext int shipradius;
ext int numdir;

ext int shipwait;		/* Number of milleseconds to wait between */
				/* moving ship. */
ext int numdestroyed;



ext XtIntervalId shiptimerid;

ext Pixel shippixel;
ext float maxv;			/* Constant: what our maximum
velocity is. */
ext float accper;		/* Constant: how fast we accelerate. */
ext Boolean shipdestroyed;	/* TRUE if the ship is non-existant */

/* Rock info: */

ext XtIntervalId rocktimerid;
ext Pixel rockpixel;
ext int rockwait;		/* Number of milleseconds to wait between */
				/* moving rocks. */
ext float maxrockspeed;		/* Constant: fastest velocity for a rock. */

/* Shot info. */

ext XtIntervalId shottimerid;
ext Pixel shotpixel;
ext int shotwait;
ext float shotacc;		/* How many times faster a shot goes than */
				/* the ship.*/
ext int maxshots;		/* How many shots are allowed to exist at */
				/* once. */
ext int shotduration;		/* How long (in milleseconds) a shot lives. */




ext GC backgc, shipgc, rockgc, shotgc;



/* From widget.c */

extern Boolean TakeFocus();
extern void Quit();



/* From ship.c */

extern void MoveShip();
extern void ThrustOn();
extern void ThrustOff();
extern void RotateLeft();
extern void RotateRight();
extern void RotateOff();
extern void RotateToPoint();
extern void StopRotateToPoint();
extern void RotateMouseMoved();
extern void Fire();

/* From rocks.c */

extern Boolean CheckIfShipHitRocks();
extern Boolean AreaForShipIsClear();
extern Boolean LineHitsRock();
extern void MoveRocks();
extern void InitRocks();

/* From shot.c */

extern void AddShot();
extern void MoveShots();

#endif _roids_h