Fix non-Qt build

This commit is contained in:
Antidote 2014-03-21 19:27:29 -07:00
parent f77b394c6b
commit 77599bad3a
8 changed files with 30 additions and 11 deletions

View File

@ -38,7 +38,7 @@ public:
* \param filename The path of the offending file.
*/
inline FileNotFoundException(const std::string& filename) :
Exception("FileNotFoundException:\nCouldn't not find \"" + filename + "\", please check that it exists."),
Exception("Couldn't find \"" + filename + "\", please check that it exists."),
m_filename(filename)
{}
@ -53,4 +53,10 @@ private:
} // error
} // zelda
#define THROW_FILENOTFOUND_EXCEPTION(msg) \
do \
{ \
throw zelda::error::FileNotFoundException(__LINE_STRING__ " " __FILE__ " " msg); \
} while(0)
#endif

View File

@ -41,10 +41,17 @@ public:
* \param message The error message to throw
*/
inline IOException(const std::string& message) :
Exception("IOException: " + message)
Exception(message)
{}
};
} // error
} // zelda
#define THROW_IO_EXCEPTION(msg) \
do \
{ \
throw zelda::error::IOException(__LINE_STRING__ " " __FILE__ " " msg); \
} while(0)
#endif

View File

@ -40,7 +40,7 @@ public:
* \param error The error message to throw
*/
inline InvalidOperationException(const std::string& error)
: Exception("InvalidOperationException:\n" + error)
: Exception(error)
{
}
};
@ -48,4 +48,10 @@ public:
} // error
} // zelda
#define THROW_INVALIDOPERATION_EXCEPTION(msg) \
do \
{ \
throw zelda::error::InvalidOperationException(__LINE_STRING__ " " __FILE__ " " msg); \
} while(0)
#endif // __INVALID_OPERATION_EXCEPTION_HPP__

View File

@ -149,7 +149,7 @@ public slots:
* \param origin
*/
#ifndef LIBZELDA_USE_QT
void setOrigin(const Vector2Di& origin);
void setOrigin(const Vector2Df& origin);
#else
void setOrigin(const QPoint& origin);
#endif

View File

@ -56,7 +56,7 @@ HEADERS += \
$$PWD/include/SpriteFileWriter.hpp \
$$PWD/include/SpriteFrame.hpp \
$$PWD/include/SpritePart.hpp \
../libzelda/include/InvalidDataException.hpp
$$PWD/include/InvalidDataException.hpp
SOURCES += \
$$PWD/src/utility.cpp \

View File

@ -3,7 +3,7 @@ TEMPLATE= lib
DESTDIR = ./lib
# Uncomment this if you wish to use Qt with libZelda
DEFINES += LIBZELDA_USE_QT
#DEFINES += LIBZELDA_USE_QT
contains(DEFINES, LIBZELDA_USE_QT){
QT += core

View File

@ -219,7 +219,7 @@ Uint32 Sprite::frameCount() const
}
#ifndef LIBZELDA_USE_QT
std::vector<SpritePart*> Sprite::frames() const
std::vector<SpriteFrame*> Sprite::frames() const
#else
QList<SpriteFrame*> Sprite::frames() const
#endif

View File

@ -126,7 +126,7 @@ QPoint SpritePart::textureOffset() const
void SpritePart::setSize(Uint32 width, Uint32 height)
{
#ifndef LIBZELDA_USE_QT
setSize(Vector2Df(width, height));
setSize(Vector2Di(width, height));
#else
setSize(QSize(width, height));
#endif