summaryrefslogtreecommitdiff
path: root/src/resources/imageset.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-10-10 22:14:45 +0300
committerAndrei Karas <akaras@inbox.ru>2017-10-10 22:15:57 +0300
commitaa3f63fd497558a02feb3ddbc44f31eac091f39b (patch)
tree0e28b9b1f0501dd8be9e1a38db4ec1777fa3fbfa /src/resources/imageset.cpp
parent7c10a6b61e9d06a4ae9cc9f942dfacb6fcfd9d3d (diff)
downloadmv-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.gz
mv-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.bz2
mv-aa3f63fd497558a02feb3ddbc44f31eac091f39b.tar.xz
mv-aa3f63fd497558a02feb3ddbc44f31eac091f39b.zip
Remove most unused files.
Diffstat (limited to 'src/resources/imageset.cpp')
-rw-r--r--src/resources/imageset.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
deleted file mode 100644
index 724038100..000000000
--- a/src/resources/imageset.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * The ManaPlus Client
- * Copyright (C) 2004-2009 The Mana World Development Team
- * Copyright (C) 2009-2010 The Mana Developers
- * Copyright (C) 2011-2017 The ManaPlus Developers
- *
- * This file is part of The ManaPlus Client.
- *
- * This program 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 2 of the License, or
- * any later version.
- *
- * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "resources/imageset.h"
-
-#include "logger.h"
-
-#include "resources/image/image.h"
-
-#include "utils/cast.h"
-#include "utils/dtor.h"
-
-#include "debug.h"
-
-ImageSet::ImageSet(Image *const img, const int width, const int height,
- const int margin, const int spacing) :
- Resource(),
- mImages(),
- mWidth(width),
- mHeight(height),
- mOffsetX(0),
- mOffsetY(0)
-{
- if (img != nullptr)
- {
- const int hAdd = height + spacing;
- const int wAdd = width + spacing;
- for (int y = margin; y + height <= img->getHeight() - margin;
- y += hAdd)
- {
- for (int x = margin; x + width <= img->getWidth() - margin;
- x += wAdd)
- {
- Image *const image = img->getSubImage(x, y, width, height);
- image->mNotCount = true;
- mImages.push_back(image);
- }
- }
- }
-}
-
-ImageSet::~ImageSet()
-{
- delete_all(mImages);
-}
-
-Image* ImageSet::get(const size_type i) const
-{
- if (i >= mImages.size())
- {
- logger->log("Warning: No sprite %d in this image set",
- CAST_S32(i));
- return nullptr;
- }
- return mImages[i];
-}
-
-int ImageSet::calcMemoryLocal() const
-{
- return static_cast<int>(sizeof(ImageSet)) +
- Resource::calcMemoryLocal() +
- static_cast<int>(mImages.capacity() * sizeof(Image));
-}