// Layer.hpp : Layer class // // 17.11.1998 / DH - Redesign // 24.11.1998 / DH - Clean-up // 02.12.1998 / DH - Map dynamically from memory // // Copyright (c) 1998 Daniel Hartmeier. All rights reserved. #ifndef __Layer__ #define __Layer__ class Layer; #include "Tile.hpp" #include "Level.hpp" // ------------------------------------------------------------------- class Layer { public: Layer(Level &level, int distance, int width, int height, const unsigned char *table, const unsigned char *map); virtual ~Layer(); virtual void init(); // Call once before any drawing virtual void draw(GsOT *ot); virtual int moveHorz(int x); // Return number of pixels moved (may differ from x because of border) virtual int moveVert(int y); // Distance is handled internally virtual void checkCollision(int x, int y, int &cx, int &cy, unsigned char &attr) const; // Screen pixel coordinates virtual void getOrigin(int &x, int &y) const { x = offsetX*16+dx; y = offsetY*16+dy; return; } virtual Tile **getTiles() const { return tiles; } protected: virtual void moveTiles(); private: Level &level; const unsigned char *map, *table; const int width, height, distance; int offsetX, offsetY, dx, dy, restX, restY; Tile *tiles[357]; // 21*17 for 320*256 (PAL) }; // ------------------------------------------------------------------- #endif