#ifndef __OD2SRC_SCREENPLAYFIELD_H__ #define __OD2SRC_SCREENPLAYFIELD_H__ 1 /* OD2 - Dune II Clone * * Copyright (C) 2009 Robert Crossfield * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * * $Id$ * */ class cMapCell; class cScreenPlayfield : public cButton { private: cVideoSurface *_surfaceTileHighlight; cVideoSurface *_surfaceLandscape; // Current playfield surface cVideoSurface *_surfaceUnits; // Current unit playfield overlay cVideoSurface *_surfaceFog; cVideoSurface *_surfaceCellAnims; UPoint _map; // New Map X-Y (Top-Left of the playfield) UPoint _landscape; // Currently drawn '_surfaceLandscape' Map X-Y (Top-Left of the playfield) bool _landscapeRedraw; cMapCell **_mapCell; // Current selected map cell const MapInfo &_scale; // Current map scale void drawMapCellAnims(); void drawFog(); void drawLandscape(); // Draw landscape to '_surfaceLandscape' void drawObjects(); // Draw units to '_surfaceUnits' void drawUnit(cUnit *pUnit); void drawTileSquares(word pMapIndex, cStructure *pStructure); // void drawTileSquare(UPoint pMap); // bool scrollCheck(UPoint p); public: cScreenPlayfield(cOD2 *pEngine, cInterface< cOD2 > *pParent); ~cScreenPlayfield(); void screenPrep(); virtual void draw(); virtual bool mouseMove(UPoint p); void buttonClear(); virtual void buttonPressLeft(UPoint p); virtual void buttonPressRight(UPoint p); virtual void buttonReleaseLeft(UPoint p); virtual void buttonReleaseRight(UPoint p); inline void mapTacticalSet(UPoint p) { _map = p; redrawSet(); } // Set playfield map location inline UPoint getMap() { return _map; } inline void redrawLandscapeSet() { _landscapeRedraw = true; cButton::redrawSet(); } }; #endif // __OD2SRC_SCREENPLAYFIELD_H__