Commit b23cad17 authored by Georg Gottleuber's avatar Georg Gottleuber
Browse files

* Bugfix: Pixel perfect drawing of buttons (main menu with any screen height)

* Bugfix: Level editor: ground level was not adjustable because of other buttons
* Bugfix: better background.png loading
* Bugfix: Level load error for benchmark
* New Feature: smooth start of physic simulation (avoid gravity oscillation with very big bridges)
* Minor cleanups
parent a7b7c967
Version 0.0.2 (2019-06-02)
==========
* Bugfix: Pixel perfect drawing of buttons (main menu with any screen height)
* Bugfix: Level editor: ground level was not adjustable because of other buttons
* Bugfix: better background.png loading
* Bugfix: Level load error for benchmark
* New Feature: smooth start of physic simulation (avoid gravity oscillation with very big bridges)
* Minor cleanups
......@@ -7,7 +7,7 @@ https://bielebridge.net
Introduction
--------------------------------------------------
bielebridge is a challenging 2D construction game.
Build bridges to let a trail cross. Like in real the budget ist limited.
Build bridges to let a train cross. Like in real the budget ist limited.
System Requirements
......@@ -23,8 +23,8 @@ General hardware requirements:
Software dependencies:
--------------------------------------------------
Build tools for C++ with GNU make:
build-essential and g++
All distros need build tools for C++ with GNU make:
g++ build-essential
Packages for Linux Mint 19 Tara:
liblua5.2-dev lua5.2 libsdl2-dev libsdl2-gfx-dev libsdl2-ttf-dev libsdl2-image-dev
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bielebridge 0.0.1.
# Generated by GNU Autoconf 2.69 for bielebridge 0.0.2.
#
# Report bugs to <dev@bielebridge.net>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bielebridge'
PACKAGE_TARNAME='bielebridge'
PACKAGE_VERSION='0.0.1'
PACKAGE_STRING='bielebridge 0.0.1'
PACKAGE_VERSION='0.0.2'
PACKAGE_STRING='bielebridge 0.0.2'
PACKAGE_BUGREPORT='dev@bielebridge.net'
PACKAGE_URL=''
......@@ -1309,7 +1309,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bielebridge 0.0.1 to adapt to many kinds of systems.
\`configure' configures bielebridge 0.0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1375,7 +1375,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bielebridge 0.0.1:";;
short | recursive ) echo "Configuration of bielebridge 0.0.2:";;
esac
cat <<\_ACEOF
......@@ -1487,7 +1487,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bielebridge configure 0.0.1
bielebridge configure 0.0.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1948,7 +1948,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bielebridge $as_me 0.0.1, which was
It was created by bielebridge $as_me 0.0.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2812,7 +2812,7 @@ fi
# Define the identity of the package.
PACKAGE='bielebridge'
VERSION='0.0.1'
VERSION='0.0.2'
cat >>confdefs.h <<_ACEOF
......@@ -7801,7 +7801,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bielebridge $as_me 0.0.1, which was
This file was extended by bielebridge $as_me 0.0.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -7867,7 +7867,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bielebridge config.status 0.0.1
bielebridge config.status 0.0.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ([2.69])
AC_INIT([bielebridge], [0.0.1], [dev@bielebridge.net])
AC_INIT([bielebridge], [0.0.2], [dev@bielebridge.net])
#AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CONFIG_HEADER([config.h])
......
......@@ -19,6 +19,8 @@ bielebridge_SOURCES = benchmark.cpp \
gui_component.hpp \
gui_editor.cpp \
gui_editor.hpp \
gui_editor_undomanager.cpp \
gui_editor_undomanager.hpp \
gui_editorsimulator.cpp \
gui_editorsimulator.hpp \
gui_manager.cpp \
......
......@@ -101,13 +101,13 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_bielebridge_OBJECTS = benchmark.$(OBJEXT) game.$(OBJEXT) \
gui_button.$(OBJEXT) gui_component.$(OBJEXT) \
gui_editor.$(OBJEXT) gui_editorsimulator.$(OBJEXT) \
gui_manager.$(OBJEXT) gui_menu_layouts.$(OBJEXT) \
gui_simulator.$(OBJEXT) level.$(OBJEXT) main.$(OBJEXT) \
math_utils.$(OBJEXT) particle.$(OBJEXT) physics.$(OBJEXT) \
sdl_draw.$(OBJEXT) sdl_utils.$(OBJEXT) settings.$(OBJEXT) \
spring.$(OBJEXT) train.$(OBJEXT) hash.$(OBJEXT) \
physics_test.$(OBJEXT)
gui_editor.$(OBJEXT) gui_editor_undomanager.$(OBJEXT) \
gui_editorsimulator.$(OBJEXT) gui_manager.$(OBJEXT) \
gui_menu_layouts.$(OBJEXT) gui_simulator.$(OBJEXT) \
level.$(OBJEXT) main.$(OBJEXT) math_utils.$(OBJEXT) \
particle.$(OBJEXT) physics.$(OBJEXT) sdl_draw.$(OBJEXT) \
sdl_utils.$(OBJEXT) settings.$(OBJEXT) spring.$(OBJEXT) \
train.$(OBJEXT) hash.$(OBJEXT) physics_test.$(OBJEXT)
bielebridge_OBJECTS = $(am_bielebridge_OBJECTS)
bielebridge_DEPENDENCIES =
AM_V_P = $(am__v_P_@AM_V@)
......@@ -127,10 +127,11 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/game.Po \
./$(DEPDIR)/gui_button.Po ./$(DEPDIR)/gui_component.Po \
./$(DEPDIR)/gui_editor.Po ./$(DEPDIR)/gui_editorsimulator.Po \
./$(DEPDIR)/gui_manager.Po ./$(DEPDIR)/gui_menu_layouts.Po \
./$(DEPDIR)/gui_simulator.Po ./$(DEPDIR)/hash.Po \
./$(DEPDIR)/level.Po ./$(DEPDIR)/main.Po \
./$(DEPDIR)/gui_editor.Po \
./$(DEPDIR)/gui_editor_undomanager.Po \
./$(DEPDIR)/gui_editorsimulator.Po ./$(DEPDIR)/gui_manager.Po \
./$(DEPDIR)/gui_menu_layouts.Po ./$(DEPDIR)/gui_simulator.Po \
./$(DEPDIR)/hash.Po ./$(DEPDIR)/level.Po ./$(DEPDIR)/main.Po \
./$(DEPDIR)/math_utils.Po ./$(DEPDIR)/particle.Po \
./$(DEPDIR)/physics.Po ./$(DEPDIR)/physics_test.Po \
./$(DEPDIR)/sdl_draw.Po ./$(DEPDIR)/sdl_utils.Po \
......@@ -322,6 +323,8 @@ bielebridge_SOURCES = benchmark.cpp \
gui_component.hpp \
gui_editor.cpp \
gui_editor.hpp \
gui_editor_undomanager.cpp \
gui_editor_undomanager.hpp \
gui_editorsimulator.cpp \
gui_editorsimulator.hpp \
gui_manager.cpp \
......@@ -446,6 +449,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_button.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_component.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_editor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_editor_undomanager.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_editorsimulator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_manager.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_menu_layouts.Po@am__quote@ # am--include-marker
......@@ -615,6 +619,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/gui_button.Po
-rm -f ./$(DEPDIR)/gui_component.Po
-rm -f ./$(DEPDIR)/gui_editor.Po
-rm -f ./$(DEPDIR)/gui_editor_undomanager.Po
-rm -f ./$(DEPDIR)/gui_editorsimulator.Po
-rm -f ./$(DEPDIR)/gui_manager.Po
-rm -f ./$(DEPDIR)/gui_menu_layouts.Po
......@@ -681,6 +686,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/gui_button.Po
-rm -f ./$(DEPDIR)/gui_component.Po
-rm -f ./$(DEPDIR)/gui_editor.Po
-rm -f ./$(DEPDIR)/gui_editor_undomanager.Po
-rm -f ./$(DEPDIR)/gui_editorsimulator.Po
-rm -f ./$(DEPDIR)/gui_manager.Po
-rm -f ./$(DEPDIR)/gui_menu_layouts.Po
......
......@@ -42,29 +42,45 @@ void timer_handler(int sig)
Benchmark::Benchmark()
{
std::string full_path = DATADIR "/" + fname_benchmark;
level = new Level(0, "benchmark", full_path.c_str());
if(!level->load_failed)
INFO_PRINT("Loaded benchmark level: %s\n", full_path.c_str());
// find background image
std::string full_path_to_benchmark_file = "";
std::string test_path = DATADIR "/"+ fname_benchmark;
if(access(test_path.c_str(), F_OK) != -1 )
{
full_path_to_benchmark_file = test_path;
}
else if(access(("data/"+ fname_benchmark).c_str(), F_OK) != -1 )
{
full_path_to_benchmark_file = "data/"+ fname_benchmark;
}
else if(access(("../data/"+ fname_benchmark).c_str(), F_OK) != -1 )
{
full_path_to_benchmark_file = "../data/"+ fname_benchmark;
}
else
{
ERROR_PRINT("failed to load benchmark level: %s\n", full_path.c_str());
// test local path
full_path = "./data/" + fname_benchmark;
if( access( full_path.c_str(), R_OK ) != -1 )
// get home folder
const char* home = "HOME";
char *user_home = getenv(home);
if (user_home)
{
// file exists and is readable, try it
delete level;
level = new Level(0, "benchmark", full_path.c_str());
if(!level->load_failed)
INFO_PRINT("Loaded benchmark level: %s\n", full_path.c_str());
else
ERROR_PRINT("failed to load benchmark level: %s\n", full_path.c_str());
std::string game_home(user_home);
game_home.append("/" + Settings::singleton()->game_folder_name);
// game home folder exists?
if( access( game_home.c_str(), F_OK ) != -1 )
{
// path ok, set full name of config file
full_path_to_benchmark_file = game_home + "/" + Settings::singleton()->dirname_levels + "/" + fname_benchmark;
}
}
}
level = new Level(0, "benchmark", full_path_to_benchmark_file.c_str());
if(!level->load_failed)
INFO_PRINT("Loaded benchmark level: %s\n", full_path_to_benchmark_file.c_str());
else
ERROR_PRINT("failed to load benchmark level: %s\n", full_path_to_benchmark_file.c_str());
level->copy_for_simulation();
physics = new Physics(level);
}
......
......@@ -129,7 +129,7 @@ void GUI_Component::on_window_resize ()
int GUI_Component::get_x_pos()
{
if(alignment == RES_INDEPENDENT)
return (Settings::singleton()->window_width * pos_x) / 1000;
return int(float_32(Settings::singleton()->window_width * pos_x) / 1000.0f);
else
return pos_x;
}
......@@ -137,15 +137,39 @@ int GUI_Component::get_x_pos()
int GUI_Component::get_y_pos()
{
if(alignment == RES_INDEPENDENT)
return (Settings::singleton()->window_height * pos_y) / 1000;
return int(float_32(Settings::singleton()->window_height * pos_y) / 1000.0f);
else
return pos_y;
}
int GUI_Component::get_x_plus_width_pos()
{
if(alignment == RES_INDEPENDENT)
{
float res_ind_x_pos = float_32(Settings::singleton()->window_width * pos_x) / 1000.0f;
float res_ind_width = float_32(Settings::singleton()->window_width * width) / 1000.0f;
return int(res_ind_x_pos + res_ind_width );
}
else
return pos_x + width;
}
int GUI_Component::get_y_plus_height_pos()
{
if(alignment == RES_INDEPENDENT)
{
float res_ind_y_pos = float_32(Settings::singleton()->window_height * pos_y) / 1000.0f;
float res_ind_height = float_32(Settings::singleton()->window_height * height) / 1000.0f;
return int( res_ind_y_pos + res_ind_height );
}
else
return pos_y + height;
}
int GUI_Component::get_width()
{
if(alignment == RES_INDEPENDENT)
return (Settings::singleton()->window_width * width) / 1000;
return int(float_32(Settings::singleton()->window_width * width) / 1000.0f);
else
return width;
}
......@@ -153,7 +177,7 @@ int GUI_Component::get_width()
int GUI_Component::get_height()
{
if(alignment == RES_INDEPENDENT)
return (Settings::singleton()->window_height * height) / 1000;
return int(float_32(Settings::singleton()->window_height * height) / 1000.0f);
else
return height;
}
......
......@@ -49,22 +49,25 @@ protected:
void recalc_offsets(const Alignment a, const int pos_x, const int pos_y, int& alignment_x_offset, int& alignment_y_offset);
public:
GUI_Component (int x, int y, int width, int height, Alignment alignment);
virtual ~GUI_Component () {}
virtual ~GUI_Component() {}
/** @return true if the component is present at the given location */
virtual bool is_at (int x, int y);
virtual bool is_at(int x, int y);
/** @return text that is beeing displayed */
virtual std::string get_text() =0;
void set_position (int x, int y) { pos_x = x, pos_y = y; }
void set_width (int w) { width = w; }
void set_height (int h) { height = h; }
void set_width(int w) { width = w; }
void set_height(int h) { height = h; }
int get_x_pos ();
int get_y_pos ();
int get_width ();
int get_height ();
int get_x_pos();
int get_y_pos();
// important for RES_INDEPENDENT mode to get pixel perfect output (without rounding errors)
int get_x_plus_width_pos();
int get_y_plus_height_pos();
int get_width();
int get_height();
void on_window_resize ();
......
......@@ -67,6 +67,12 @@ GUI_Editor::GUI_Editor(const int level_id, const std::string& level_name, const
clear_button = new GUI_Button("Clear Bridge", 0, 970, 200, 30, RES_INDEPENDENT);
buttons.push_back(clear_button);
undo_button = new GUI_Button("Undo", 0, 930, 100, 30, RES_INDEPENDENT);
buttons.push_back(undo_button);
redo_button = new GUI_Button("Redo", 100, 930, 100, 30, RES_INDEPENDENT);
buttons.push_back(redo_button);
char budget_all[20];
std::snprintf(budget_all, 20, "Budget:%6d", level->budget);
budget_button = new GUI_Button(budget_all, 0, window_h-160, 180, 25, LEFT_LOWER);
......@@ -174,6 +180,8 @@ GUI_Editor::~GUI_Editor()
delete save_and_back_button;
delete back_button;
delete clear_button;
delete undo_button;
delete redo_button;
delete level_name_button;
if(level->load_failed) delete error_button;
delete budget_left_button;
......@@ -407,6 +415,8 @@ void GUI_Editor::draw_all_buttons() const
sdl->draw_button(save_and_back_button);
sdl->draw_button(back_button);
sdl->draw_button(clear_button);
//sdl->draw_button(undo_button);
//sdl->draw_button(redo_button);
sdl->draw_button(budget_left_button);
sdl->draw_button(budget_used_button);
sdl->draw_button(budget_button);
......@@ -585,10 +595,11 @@ void GUI_Editor::update()
GUI_Component* component = 0;
for (Component_List::iterator i = buttons.begin (); i != buttons.end (); ++i)
{
if ((*i)->is_at (mx_screen, my_screen))
component = *i;
if((*i)->is_at(mx_screen, my_screen) && (*i)->get_visible())
component = *i;
}
if(component) return;
if(component && component->get_visible())
return;
int xr = Math_utils::round_to(mx_world, 5) / 5 ;
xr = level->fit_ground_index_to_boundaries(xr);
......@@ -600,6 +611,7 @@ void GUI_Editor::update()
if(cur_ground_index == level->ground_len-1) cur_ground_index = level->ground_len-2;
}
// if mouse left down set ground height
//
if( Settings::singleton()->mouse_left_down )
level->ground[cur_ground_index] = std::round(my_world);
......@@ -647,7 +659,7 @@ void GUI_Editor::event_mouse_click(GUI_Manager* guimanager, int button, int butt
GUI_Component* component = nullptr;
for(Component_List::iterator i = buttons.begin (); i != buttons.end (); ++i)
{
if((*i)->is_at (x, y) && (*i)->get_visible())
if((*i)->is_at(x, y) && (*i)->get_visible())
component = *i;
}
if(component==save_and_back_button && button==0) // left click (first mouse button)
......@@ -670,6 +682,17 @@ void GUI_Editor::event_mouse_click(GUI_Manager* guimanager, int button, int butt
this->clear_mouse_state();
this->clear_bridge();
}
// Upcoming Feature: Undo & Redo
// if(component==undo_button && button==0) // left click (first mouse button)
// {
// this->clear_mouse_state();
// level = undomanager.undo(level);
// }
// if(component==redo_button && button==0) // left click (first mouse button)
// {
// this->clear_mouse_state();
// level = undomanager.redo(level);
// }
if(component==run_button && button==0 && ! level->load_failed) // left click (first mouse button)
{
......@@ -682,13 +705,13 @@ void GUI_Editor::event_mouse_click(GUI_Manager* guimanager, int button, int butt
this->clear_mouse_state();
display_max_stress = !display_max_stress;
}
if(component==first_level_tooltip_text && button==0) // left click (first mouse button)
if(component==first_level_tooltip_text && button==0 && first_level_tooltip_text->get_visible()) // left click (first mouse button)
first_level_tooltip_text->set_visible(false);
if(component==copy_paste_level_tooltip_text && button==0) // left click (first mouse button)
if(component==copy_paste_level_tooltip_text && button==0 && copy_paste_level_tooltip_text->get_visible()) // left click (first mouse button)
copy_paste_level_tooltip_text->set_visible(false);
if(component==deck_level_tooltip_text && button==0) // left click (first mouse button)
if(component==deck_level_tooltip_text && button==0 && deck_level_tooltip_text->get_visible()) // left click (first mouse button)
deck_level_tooltip_text->set_visible(false);
if(component==help_text && button==0) // left click (first mouse button)
if(component==help_text && button==0 && help_text->get_visible()) // left click (first mouse button)
{
this->clear_mouse_state();
help_text->set_visible(false);
......@@ -758,7 +781,7 @@ void GUI_Editor::event_mouse_click(GUI_Manager* guimanager, int button, int butt
} // end level->editable buttons
// avoid invisible button (missed click because of button is in between)
if((component==level_width_plus_button || component==level_width_minus_button || component==level_shift_right_button || component==level_shift_left_button) && current_editor_mode != GROUND )
component = nullptr;
component = nullptr;
if(level->custom_deck)
{
if(component==deck_button && button==0) // left click (first mouse button)
......@@ -1177,6 +1200,7 @@ Particle* GUI_Editor::get_particle_by_xy(float_32 x, float_32 y, const float_32
void GUI_Editor::clear_bridge()
{
undomanager.save_current_state(level);
level->clear_bridge();
}
......
......@@ -20,14 +20,20 @@
#ifndef HEADER_GUI_EDITOR_H
#define HEADER_GUI_EDITOR_H
#include "gui_editor_undomanager.hpp"
class GUI_Button;
class GUI_Component;
class GUI_Manager;
class GUI_Editorsimulator;
class GUI_Editor_Undomanager;
class GUI_Editor : public GUI_Editorsimulator
{
private:
GUI_Editor_Undomanager undomanager;
GUI_Button* run_button;
GUI_Button* save_and_back_button;
GUI_Button* back_button;
......@@ -36,6 +42,8 @@ private:
GUI_Button* water_button;
GUI_Button* error_button;
GUI_Button* clear_button;
GUI_Button* undo_button;
GUI_Button* redo_button;
GUI_Button* deck_button;
GUI_Button* level_name_button;
GUI_Button* budget_button;
......
// bielebridge -- A free software bridge construction game
// Copyright (C) 2008-2015 Georg Gottleuber (dev@bielebridge.net)
//
//
// This file is part of bielebridge
//
// bielebridge 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.
//
// bielebridge 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 bielebridge. If not, see <http://www.gnu.org/licenses/>.
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <iostream>
#include "vector2d.hpp"
#include "level.hpp"
#include "spring.hpp"
#include "particle.hpp"
#include "error.hpp"
#include "gui_editor_undomanager.hpp"
GUI_Editor_Undomanager::GUI_Editor_Undomanager(){
}
GUI_Editor_Undomanager::~GUI_Editor_Undomanager(){
}
void GUI_Editor_Undomanager::save_current_state(const Level* level){
Level* saved_level = new Level(*level);
// copy everything...
undo_level_list.push_back(saved_level);
}
Level* GUI_Editor_Undomanager::undo(Level* level){
Level* undo_level = undo_level_list.back();
undo_level_list.pop_back();
//undo_level_list.push_back(level);
return undo_level;
}
Level* GUI_Editor_Undomanager::redo(Level* level){
Level* undo_level = undo_level_list.back();
undo_level_list.pop_back();
//undo_level_list.push_back(level);
return undo_level;
}
// bielebridge -- A free software bridge construction game
// Copyright (C) 2008-2015 Georg Gottleuber (dev@bielebridge.net)
//
//
// This file is part of bielebridge
//
// bielebridge 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.
//
// bielebridge 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 bielebridge. If not, see <http://www.gnu.org/licenses/>.
#ifndef HEADER_GUI_EDITOR_UNDOMANAGER_H
#define HEADER_GUI_EDITOR_UNDOMANAGER_H
#include <list>
class Spring;
class Particle;
class Level;
class GUI_Editor_Undomanager
{
private:
// maybe list is not the best choice
std::list<Level*> undo_level_list;
public:
GUI_Editor_Undomanager();
~GUI_Editor_Undomanager();
void save_current_state(const Level* level);
Level* undo(Level* level);
Level* redo(Level* level);
};
#endif
......@@ -80,7 +80,7 @@ void GUI_Menu_Start::draw()
{
event_window_resize();
IDraw_Move_Zoom* sdl = Settings::singleton()->sdl_display;
sdl->draw_background_image(Settings::singleton()->path_to_bgimage);
sdl->draw_background_image(Settings::singleton()->full_path_to_bgimage_file);
// draw name
sdl->draw_button(name_button);
......@@ -204,7 +204,7 @@ void GUI_Menu_Options::draw()
{
// event_window_resize();
IDraw_Move_Zoom* sdl = Settings::singleton()->sdl_display;
sdl->draw_background_image(Settings::singleton()->path_to_bgimage);
sdl->draw_background_image(Settings::singleton()->full_path_to_bgimage_file);
// draw all buttons
for (Button_list::iterator b = buttons.begin (); b != buttons.end (); ++b)
......@@ -344,7 +344,7 @@ void GUI_Menu_About::draw()
{
// event_window_resize();
IDraw_Move_Zoom* sdl = Settings::singleton()->sdl_display;
sdl->draw_background_image(Settings::singleton()->path_to_bgimage);
sdl->draw_background_image(Settings::singleton()->full_path_to_bgimage_file);
// draw all buttons
for (Button_list::iterator b = buttons.begin (); b != buttons.end (); ++b)
......@@ -456,7 +456,7 @@ void GUI_Menu_Levels::draw()
{
// event_window_resize();