flexlay.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Flexlay - A Generic 2D Game Editor
  2. // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #ifndef HEADER_FLEXLAY_FLEXLAY_HPP
  17. #define HEADER_FLEXLAY_FLEXLAY_HPP
  18. #include <ClanLib/Core/Resources/resource_manager.h>
  19. class CL_DisplayWindow;
  20. /*! \mainpage Flexlay - A Flexible Layered 2D Editor
  21. \section intro Introduction
  22. Flexlay is a rather flexible layered editor mainly meant for editing
  23. game data such as levels, tilemaps, enemy placement and such. It
  24. provides a basic framework which makes it easy to add new
  25. functionality, special dialog windows and such needed to customize it
  26. for a specific game. Flexlay itself is actually a Python module and
  27. not an editor in itself, however due to reasonably simple Python
  28. scripts one can already have a fully working editor.
  29. \section structure Structure
  30. Flexlay provides the following basic classes on which everything else
  31. is build:
  32. Command: each operation on data is encapsuled in a Command object
  33. which provides undo/redo capability, together with a way to easily
  34. record macros and write scripts with it.
  35. EditorMapLayer: a map layer is the class that holds the data, special
  36. layers such as object or tilemap layers derive from this class to
  37. provide the capabilites needed to use them
  38. Tool: A tool manages and dispatches mouse input to Commands, thus
  39. giving the user an interactive way to manipulate map data.
  40. GUI: Flexlay provides a simple GUI framework that can be used from
  41. Python to create dialogboxes, add buttons to the main window and such.
  42. \section games Games
  43. Currently Flexlay supports the following games with different levels
  44. of completeness:
  45. netPanzer: fully working load/save and map editing capabilites
  46. SuperTux: fully working load/save and map editing capabilites, however
  47. a bit limited when it comes to object properties
  48. Windstille: fully working load/save support, however due to the game
  49. itself not being ready this is not so usefull
  50. Pingus: just very basic load support
  51. */
  52. /** Flexlay holds the DisplayWindow and manages the graphic mode and
  53. screen resolution that should be. Its the top most class that
  54. needs to be inited before the rest becomes useable. FIXME: Make
  55. Flexlay 'batchable' so that it can run without a GUI */
  56. class Flexlay
  57. {
  58. private:
  59. CL_DisplayWindow* window;
  60. public:
  61. int screen_width;
  62. int screen_height;
  63. bool fullscreen;
  64. bool allow_resize;
  65. bool use_opengl;
  66. CL_ResourceManager resources;
  67. static Flexlay* current() { return current_; }
  68. public:
  69. static Flexlay* current_;
  70. Flexlay();
  71. CL_Signal_v2<int, int>& sig_resize();
  72. void set_datadir(const std::string& datadir_);
  73. void init(const std::string& title = "Flexlay", int width = 800, int height = 600,
  74. bool fullscreen = false, bool allow_resize = false);
  75. void deinit();
  76. };
  77. #endif
  78. /* EOF */