1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- /*
- Copyright (C) 2015 Marien Raat
- 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 <http://www.gnu.org/licenses/>.
- */
- #include <SFML/Graphics.hpp>
- #include <diamondsquare.h>
- #include <mapDisplay.h>
- #include <markovNames.h>
- #include <landMap.h>
- #include <lightingGenerator.h>
- #if defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
- #define OS_WIN
- #endif
- class SFMLFrontend {
- public:
- SFMLFrontend(unsigned screenSizeX, unsigned screenSizeY);
- void start();
- private:
- sf::Vector2u screenSize;
- sf::RenderWindow *window;
- #ifndef OS_WIN
- std::random_device *randomDevice;
- #endif
- std::mt19937 *mt;
- sf::Font islandNameFont;
- bool focus;
- // Whether to use the mouse as lamp or the sun in the relief (4)
- // mode.
- bool useMouseLamp;
- // The height of the mouse lamp
- double mouseLampHeight;
- double waterLevel;
- DiamondSquareMapSettings dsMapSettings;
- HeightmapGenerator *heightmapGenerator;
- MapDisplayer *mapDisplayer;
- MarkovNames *markovNames;
- LandMapGenerator *landMapGenerator;
- LightingGenerator *lightingGenerator;
- void loadFiles();
- void handleEvents();
- void handleInput();
- void update();
- void draw();
- void updateHeightmapDisplay();
- double *getClippedHeightmap(double clipValue);
- };
|