mirror of
https://github.com/libAthena/athena.git
synced 2025-12-09 05:27:50 +00:00
* Remove remaining references to libZelda
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
// This file is part of libZelda.
|
||||
// This file is part of libAthena.
|
||||
//
|
||||
// libZelda is free software: you can redistribute it and/or modify
|
||||
// libAthena 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.
|
||||
//
|
||||
// libZelda is distributed in the hope that it will be useful,
|
||||
// libAthena 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 libZelda. If not, see <http://www.gnu.org/licenses/>
|
||||
// along with libAthena. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include "Athena/Compression.hpp"
|
||||
#include "Athena/Exception.hpp"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "Athena/SpriteFile.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
#include <QVector>
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@ Sprite::Sprite(SpriteFile* root, const std::string& name)
|
||||
: m_root(root),
|
||||
m_currentState(0)
|
||||
{
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
m_name = QString::fromStdString(name);
|
||||
#else
|
||||
m_name = name;
|
||||
@@ -46,7 +46,7 @@ Sprite::Sprite(SpriteFile* root, const std::string& name)
|
||||
|
||||
Sprite::~Sprite()
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
for (SpriteFrame* frame : m_frames)
|
||||
#else
|
||||
foreach(SpriteFrame* frame, m_frames)
|
||||
@@ -61,14 +61,14 @@ Sprite::~Sprite()
|
||||
|
||||
void Sprite::setPosition(const float x, const float y)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setPosition(Vector2Df(x, y));
|
||||
#else
|
||||
setPosition(QPoint(x, y));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void Sprite::setPosition(const Vector2Df& pos)
|
||||
#else
|
||||
void Sprite::setPosition(const QPoint& pos)
|
||||
@@ -77,7 +77,7 @@ void Sprite::setPosition(const QPoint& pos)
|
||||
m_position = pos;
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Df Sprite::position() const
|
||||
#else
|
||||
QPoint Sprite::position() const
|
||||
@@ -86,7 +86,7 @@ QPoint Sprite::position() const
|
||||
return m_position;
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void Sprite::setName(const std::string& name)
|
||||
#else
|
||||
void Sprite::setName(const QString& name)
|
||||
@@ -94,12 +94,12 @@ void Sprite::setName(const QString& name)
|
||||
{
|
||||
m_name = name;
|
||||
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit nameChanged(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::string Sprite::name() const
|
||||
#else
|
||||
QString Sprite::name() const
|
||||
@@ -130,14 +130,14 @@ void Sprite::setStateIds(std::vector<int> ids)
|
||||
if (ids.size() == 0)
|
||||
return;
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
m_stateIds = ids;
|
||||
#else
|
||||
m_stateIds = QList<int>::fromVector(QVector<int>::fromStdVector(ids));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<int> Sprite::stateIds() const
|
||||
#else
|
||||
QList<int> Sprite::stateIds() const
|
||||
@@ -157,7 +157,7 @@ void Sprite::setCurrentState(const Uint32 id)
|
||||
return;
|
||||
|
||||
m_currentState = id;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit stateChanged(id);
|
||||
#endif
|
||||
}
|
||||
@@ -183,7 +183,7 @@ bool Sprite::addFrame(SpriteFrame* part)
|
||||
|
||||
bool Sprite::removeFrame(SpriteFrame* frame)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<SpriteFrame*>::iterator iter = std::find(m_frames.begin(), m_frames.end(), frame);
|
||||
if (iter != m_frames.end())
|
||||
{
|
||||
@@ -203,7 +203,7 @@ void Sprite::setFrame(Uint32 id)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void Sprite::setFrames(std::vector<SpriteFrame*> frames)
|
||||
{
|
||||
if (frames.size() == 0)
|
||||
@@ -233,7 +233,7 @@ Uint32 Sprite::frameCount() const
|
||||
return m_frames.size();
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<SpriteFrame*> Sprite::frames() const
|
||||
#else
|
||||
QList<SpriteFrame*> Sprite::frames() const
|
||||
@@ -267,7 +267,7 @@ void Sprite::setCurrentFrame(Uint32 id)
|
||||
return;
|
||||
|
||||
m_currentFrame = id;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit frameChanged(currentFrame());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ SpriteFile::SpriteFile(Uint32 width, Uint32 height, float originX, float originY
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
SpriteFile::SpriteFile(const Vector2Di& size, const Vector2Df& origin)
|
||||
#else
|
||||
SpriteFile::SpriteFile(const QSize& size, const QPoint& origin)
|
||||
@@ -53,7 +53,7 @@ SpriteFile::SpriteFile(const QSize& size, const QPoint& origin)
|
||||
|
||||
SpriteFile::~SpriteFile()
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
for (std::pair<std::string, Sprite*> sprite : m_sprites)
|
||||
{
|
||||
delete sprite.second;
|
||||
@@ -65,26 +65,26 @@ SpriteFile::~SpriteFile()
|
||||
|
||||
void SpriteFile::setSize(Uint32 width, Uint32 height)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setSize(Vector2Di(width, height));
|
||||
#else
|
||||
setSize(QSize(width, height));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFile::setSize(const Vector2Di& size)
|
||||
#else
|
||||
void SpriteFile::setSize(const QSize& size)
|
||||
#endif
|
||||
{
|
||||
m_size = size;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit sizeChanged(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Di SpriteFile::size() const
|
||||
#else
|
||||
QSize SpriteFile::size() const
|
||||
@@ -95,7 +95,7 @@ QSize SpriteFile::size() const
|
||||
|
||||
Uint32 SpriteFile::width() const
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
return m_size.x;
|
||||
#else
|
||||
return m_size.width();
|
||||
@@ -104,7 +104,7 @@ Uint32 SpriteFile::width() const
|
||||
|
||||
Uint32 SpriteFile::height() const
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
return m_size.y;
|
||||
#else
|
||||
return m_size.height();
|
||||
@@ -113,27 +113,27 @@ Uint32 SpriteFile::height() const
|
||||
|
||||
void SpriteFile::setOrigin(const float x, const float y)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setOrigin(Vector2Df(x, y));
|
||||
#else
|
||||
setOrigin(QPoint(x, y));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFile::setOrigin(const Vector2Df& origin)
|
||||
#else
|
||||
void SpriteFile::setOrigin(const QPoint& origin)
|
||||
#endif
|
||||
{
|
||||
m_origin = origin;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit originChanged(origin);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Df SpriteFile::origin() const
|
||||
#else
|
||||
QPoint SpriteFile::origin() const
|
||||
@@ -144,7 +144,7 @@ QPoint SpriteFile::origin() const
|
||||
|
||||
float SpriteFile::originX() const
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
return m_origin.x;
|
||||
#else
|
||||
return m_origin.x();
|
||||
@@ -153,7 +153,7 @@ float SpriteFile::originX() const
|
||||
|
||||
float SpriteFile::originY() const
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
return m_origin.y;
|
||||
#else
|
||||
return m_origin.y();
|
||||
@@ -187,7 +187,7 @@ STexture* SpriteFile::texture(Uint32 id)
|
||||
return m_textures[id];
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<STexture*> SpriteFile::textures() const
|
||||
#else
|
||||
QList<STexture*> SpriteFile::textures() const
|
||||
@@ -203,7 +203,7 @@ Uint32 SpriteFile::textureCount() const
|
||||
|
||||
void SpriteFile::addSprite(Sprite* sprite)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::string name(sprite->name());
|
||||
Athena::utility::tolower(name);
|
||||
if (m_sprites.find(name) != m_sprites.end())
|
||||
@@ -217,7 +217,7 @@ void SpriteFile::addSprite(Sprite* sprite)
|
||||
m_sprites[name] = sprite;
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFile::removeSprite(const std::string& name)
|
||||
{
|
||||
std::string tmpName(name);
|
||||
@@ -238,7 +238,7 @@ void SpriteFile::removeSprite(Sprite* sprite)
|
||||
removeSprite(sprite->name());
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFile::setSprites(std::unordered_map<std::string, Sprite*> sprites)
|
||||
{
|
||||
if (sprites.size() == 0)
|
||||
@@ -265,7 +265,7 @@ void SpriteFile::setSprites(QMap<QString, Sprite *> sprites)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Sprite* SpriteFile::sprite(const std::string& name)
|
||||
{
|
||||
std::string nameLow(name);
|
||||
@@ -285,7 +285,7 @@ Sprite* SpriteFile::sprite(const QString& name)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::unordered_map<std::string, Sprite*> SpriteFile::sprites() const
|
||||
#else
|
||||
QMap<QString, Sprite*> SpriteFile::sprites() const
|
||||
@@ -299,7 +299,7 @@ Uint32 SpriteFile::spriteCount() const
|
||||
return m_sprites.size();
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFile::setTextures(std::vector<STexture*> textures)
|
||||
{
|
||||
if (textures.size() == 0)
|
||||
|
||||
@@ -83,7 +83,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
// it will be slow as hell, so we store them in a vector locally
|
||||
// then give that vector the the container, this bypasses the de-reference
|
||||
// for each texture
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<Sakura::STexture*> textures;
|
||||
#else
|
||||
QList<Sakura::STexture*> textures;
|
||||
@@ -105,7 +105,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
// Normally this isn't a problem, but someone may decide to copy and paste a sprite
|
||||
// and forget to change the name, that needs to be handled, but it's outside the scope
|
||||
// of this reader.
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::unordered_map <std::string, Sakura::Sprite*> sprites;
|
||||
#else
|
||||
QMap<QString, Sakura::Sprite*> sprites;
|
||||
@@ -114,7 +114,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
for (Uint16 i = 0; i < spriteCount; i++)
|
||||
{
|
||||
Sakura::Sprite* sprite = new Sakura::Sprite(ret);
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::string name = base::readString();
|
||||
#else
|
||||
QString name = QString::fromStdString(base::readString());
|
||||
@@ -138,7 +138,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
// and the storage footprint, while Sakura supports packs and zips
|
||||
// it's still a bad idea to have a metric ton of texture resources
|
||||
// littering the place
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<Sakura::SpriteFrame*> frames;
|
||||
#else
|
||||
QList<Sakura::SpriteFrame*> frames;
|
||||
@@ -151,7 +151,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
Uint16 partCount = base::readUint16();
|
||||
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<Sakura::SpritePart*> parts;
|
||||
#else
|
||||
QList<Sakura::SpritePart*> parts;
|
||||
@@ -159,7 +159,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
for (Uint8 j = 0; j < partCount; j++)
|
||||
{
|
||||
Sakura::SpritePart* part = new Sakura::SpritePart(frame);
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::string name = base::readString();
|
||||
#else
|
||||
QString name = QString::fromStdString(base::readString());
|
||||
@@ -188,7 +188,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile()
|
||||
}
|
||||
|
||||
sprite->setFrames(frames);
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
if (sprite->name() != std::string())
|
||||
{
|
||||
std::string nameLow(sprite->name());
|
||||
|
||||
@@ -58,7 +58,7 @@ void SpriteFileWriter::writeFile(Sakura::SpriteFile* file)
|
||||
base::writeBool(texture->Preload);
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
for (std::pair<std::string, Sakura::Sprite*> spritePair : file->sprites())
|
||||
{
|
||||
Sakura::Sprite* sprite = spritePair.second;
|
||||
@@ -81,13 +81,13 @@ void SpriteFileWriter::writeFile(Sakura::SpriteFile* file)
|
||||
base::writeUint16(frame->partCount());
|
||||
for (Sakura::SpritePart* part: frame->parts())
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
base::writeString(part->name());
|
||||
#else
|
||||
base::writeString(part->name().toStdString());
|
||||
#endif
|
||||
base::writeBool(part->hasCollision());
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
base::writeFloat(part->offset().x);
|
||||
base::writeFloat(part->offset().y);
|
||||
base::writeFloat(part->textureOffset().x);
|
||||
|
||||
@@ -34,12 +34,12 @@ SpriteFrame::SpriteFrame(Sprite* root)
|
||||
void SpriteFrame::setFrameTime(float frameTime)
|
||||
{
|
||||
m_frameTime = frameTime;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit frameTimeChanged(frameTime);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpriteFrame::setParts(std::vector<SpritePart*> parts)
|
||||
#else
|
||||
void SpriteFrame::setParts(QList<SpritePart*> parts)
|
||||
@@ -48,7 +48,7 @@ void SpriteFrame::setParts(QList<SpritePart*> parts)
|
||||
m_parts = parts;
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::vector<SpritePart*> SpriteFrame::parts() const
|
||||
#else
|
||||
QList<SpritePart*> SpriteFrame::parts() const
|
||||
|
||||
@@ -33,7 +33,7 @@ SpritePart::SpritePart(SpriteFrame* root, const std::string& name, bool hasColli
|
||||
: m_root(root),
|
||||
m_hasCollision(hasCollision)
|
||||
{
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
m_name = QString::fromStdString(name);
|
||||
#else
|
||||
m_name = name;
|
||||
@@ -44,19 +44,19 @@ SpritePart::~SpritePart()
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpritePart::setName(const std::string& name)
|
||||
#else
|
||||
void SpritePart::setName(const QString& name)
|
||||
#endif
|
||||
{
|
||||
m_name = name;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit nameChanged(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
std::string SpritePart::name() const
|
||||
#else
|
||||
QString SpritePart::name() const
|
||||
@@ -68,7 +68,7 @@ QString SpritePart::name() const
|
||||
void SpritePart::setCollision(bool col)
|
||||
{
|
||||
m_hasCollision = col;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit collisionChanged(col);
|
||||
#endif
|
||||
}
|
||||
@@ -80,26 +80,26 @@ bool SpritePart::hasCollision() const
|
||||
|
||||
void SpritePart::setOffset(float x, float y)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setOffset(Vector2Df(x, y));
|
||||
#else
|
||||
setOffset(QPoint(x, y));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpritePart::setOffset(const Vector2Df& offset)
|
||||
#else
|
||||
void SpritePart::setOffset(const QPoint& offset)
|
||||
#endif
|
||||
{
|
||||
m_offset = offset;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit offsetChanged(offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Df SpritePart::offset() const
|
||||
#else
|
||||
QPoint SpritePart::offset() const
|
||||
@@ -110,26 +110,26 @@ QPoint SpritePart::offset() const
|
||||
|
||||
void SpritePart::setTextureOffset(float x, float y)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setTextureOffset(Vector2Df(x, y));
|
||||
#else
|
||||
setTextureOffset(QPoint(x, y));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpritePart::setTextureOffset(const Vector2Df& offset)
|
||||
#else
|
||||
void SpritePart::setTextureOffset(const QPoint& offset)
|
||||
#endif
|
||||
{
|
||||
m_textureOffset = offset;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit textureOffsetChanged(offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Df SpritePart::textureOffset() const
|
||||
#else
|
||||
QPoint SpritePart::textureOffset() const
|
||||
@@ -140,26 +140,26 @@ QPoint SpritePart::textureOffset() const
|
||||
|
||||
void SpritePart::setSize(Uint32 width, Uint32 height)
|
||||
{
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
setSize(Vector2Di(width, height));
|
||||
#else
|
||||
setSize(QSize(width, height));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
void SpritePart::setSize(const Vector2Di& size)
|
||||
#else
|
||||
void SpritePart::setSize(const QSize& size)
|
||||
#endif
|
||||
{
|
||||
m_size = size;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit sizeChanged(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef LIBZELDA_USE_QT
|
||||
#ifndef ATHENA_USE_QT
|
||||
Vector2Di SpritePart::size() const
|
||||
#else
|
||||
QSize SpritePart::size() const
|
||||
@@ -171,7 +171,7 @@ QSize SpritePart::size() const
|
||||
void SpritePart::setFlippedHorizontally(const bool val)
|
||||
{
|
||||
m_flippedH = val;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit orientationChanged(val, flippedVertically());
|
||||
#endif
|
||||
}
|
||||
@@ -184,7 +184,7 @@ bool SpritePart::flippedHorizontally() const
|
||||
void SpritePart::setFlippedVertically(const bool val)
|
||||
{
|
||||
m_flippedV = val;
|
||||
#ifdef LIBZELDA_USE_QT
|
||||
#ifdef ATHENA_USE_QT
|
||||
emit orientationChanged(flippedHorizontally(), val);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user