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. * \param filename The path of the offending file.
*/ */
inline FileNotFoundException(const std::string& filename) : 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) m_filename(filename)
{} {}
@ -53,4 +53,10 @@ private:
} // error } // error
} // zelda } // zelda
#define THROW_FILENOTFOUND_EXCEPTION(msg) \
do \
{ \
throw zelda::error::FileNotFoundException(__LINE_STRING__ " " __FILE__ " " msg); \
} while(0)
#endif #endif

View File

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

View File

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

View File

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

View File

@ -42,8 +42,8 @@ HEADERS += \
$$PWD/include/ZQuestFileWriter.hpp \ $$PWD/include/ZQuestFileWriter.hpp \
$$PWD/include/ZQuestFileReader.hpp \ $$PWD/include/ZQuestFileReader.hpp \
$$PWD/include/Compression.hpp \ $$PWD/include/Compression.hpp \
$$PWD/include/lzo.h \ $$PWD/include/lzo.h \
$$PWD/include/WiiImage.hpp \ $$PWD/include/WiiImage.hpp \
$$PWD/include/ZQuestFile.hpp \ $$PWD/include/ZQuestFile.hpp \
$$PWD/include/Checksums.hpp \ $$PWD/include/Checksums.hpp \
$$PWD/include/SkywardSwordFile.hpp \ $$PWD/include/SkywardSwordFile.hpp \
@ -56,7 +56,7 @@ HEADERS += \
$$PWD/include/SpriteFileWriter.hpp \ $$PWD/include/SpriteFileWriter.hpp \
$$PWD/include/SpriteFrame.hpp \ $$PWD/include/SpriteFrame.hpp \
$$PWD/include/SpritePart.hpp \ $$PWD/include/SpritePart.hpp \
../libzelda/include/InvalidDataException.hpp $$PWD/include/InvalidDataException.hpp
SOURCES += \ SOURCES += \
$$PWD/src/utility.cpp \ $$PWD/src/utility.cpp \
@ -84,7 +84,7 @@ SOURCES += \
$$PWD/src/ZQuestFileWriter.cpp \ $$PWD/src/ZQuestFileWriter.cpp \
$$PWD/src/ZQuestFileReader.cpp \ $$PWD/src/ZQuestFileReader.cpp \
$$PWD/src/Compression.cpp \ $$PWD/src/Compression.cpp \
$$PWD/src/lzo.c \ $$PWD/src/lzo.c \
$$PWD/src/WiiImage.cpp \ $$PWD/src/WiiImage.cpp \
$$PWD/src/ZQuestFile.cpp \ $$PWD/src/ZQuestFile.cpp \
$$PWD/src/Checksums.cpp \ $$PWD/src/Checksums.cpp \

View File

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

View File

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

View File

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