src/Types.hh
author Tero Marttila <terom@fixme.fi>
Wed, 21 Jan 2009 01:57:24 +0200
branchnew_graphics
changeset 410 41fd46cffc52
parent 393 5dd4d782cf3a
child 411 106aaf6eadfe
permissions -rw-r--r--
start working out the Graphics/* code, this is a long way from compiling, let alone working
#ifndef TYPES_HH
#define TYPES_HH

/**
 * Define various types
 */

#include "Vector.hh"

#include <stdint.h>

/* 
 * Standard vector used for Physics stuff
 */
typedef VectorType<float> Vector;

/**
 * A player's health is measured in...
 */
typedef int16_t Health;

/**
 * Terrain/Graphics pixel dimension values are long ints
 */
typedef long int PixelDimension;

/**
 * A Terrain/Pixel coordinate as a PixelDimension Vector
 */
typedef VectorType<PixelDimension> PixelCoordinate;

/**
 * Dimensions of something in pixels
 */
struct PixelDimensions {
    /** Item width/height */
    PixelDimension width, height;
    
    /** Simple constructor */
    PixelDimensions (PixelDimension width, PixelDimension height) :
        width(width), height(height)
    { }
};

/**
 * A rectangular area of pixels
 */
struct PixelArea {
    PixelDimension left, top, right, bottom;

    PixelArea (PixelDimension left, PixelDimension top, PixelDimension right, PixelDimension bottom) :
        left(left), top(top), right(right), bottom(bottom)
    { }
};

/**
 * A time interval, measured in real milliseconds
 */
typedef signed long TimeMS;

/**
 * Abstract tick count, defined as a number of Timer::interval's against real time
 */
typedef int32_t TickCount;

#endif