Skip to content

Commit

Permalink
FIX - button exeption
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrusBzh committed Jun 14, 2020
1 parent 2df1139 commit 1c341aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "SelectSkin.hpp"
#include "SelectSkins.hpp"
#include "EndScene.hpp"
#include <exception>

/* Win32: Remove the console application */
//#ifdef _IRR_WINDOWS_
Expand Down
6 changes: 3 additions & 3 deletions Button/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Button::Button(IrrlichtDevice *device, vector2d<int> size, vector2d<int> pos, Bu
this->_driver = device->getVideoDriver();
this->_env = device->getGUIEnvironment();
if ((this->_textureButton = this->_driver->getTexture(path1.c_str())) == 0)
throw std::exception("Loading texture button");
throw ButtonError("Loading texture button");
if ((this->_textureButtonOver = this->_driver->getTexture(path2.c_str())) == 0)
throw std::exception("Loading texture button over");
throw ButtonError("Loading texture button over");
if ((this->_button = this->_env->addButton(rect<s32>(pos.X, pos.Y, pos.X + size.X, pos.Y + size.Y), 0, type)) == 0)
throw std::exception("Add button");
throw ButtonError("Add button");
this->_button->setImage(this->_textureButton);
this->_button->setPressedImage(this->_textureButtonOver);
this->_states = 0;
Expand Down
2 changes: 1 addition & 1 deletion Exception/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ StorageError::StorageError(const std::string &msg = "") : Error(msg)

}

MenuError::MenuError(const std::string &msg = "") : Error(msg)
ButtonError::ButtonError(const std::string &msg = "") : Error(msg)
{

}
Expand Down
6 changes: 3 additions & 3 deletions Exception/Error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class StorageError : public Error
virtual ~StorageError() throw(){}
};

class MenuError : public Error
class ButtonError : public Error
{
public:
MenuError(const std::string &msg);
virtual ~MenuError() throw(){}
ButtonError(const std::string &msg);
virtual ~ButtonError() throw(){}
};

class MusicError : public Error
Expand Down

0 comments on commit 1c341aa

Please sign in to comment.