summaryrefslogtreecommitdiffstats
path: root/test/unit/common/image_test.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-05-20 23:31:33 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-05-20 23:31:33 +0200
commitf509312bfe078d18b6f57af8011999231864d7fe (patch)
treea197c0da3ef01902c8c2bb6b40daedf113302a6c /test/unit/common/image_test.cpp
parent5d15d37ef23a43ebe595674b7503112407356cb0 (diff)
parente2be034ec369dbe23b17281a21338282a0258ff2 (diff)
downloadcolobot-f509312bfe078d18b6f57af8011999231864d7fe.tar.gz
colobot-f509312bfe078d18b6f57af8011999231864d7fe.tar.bz2
colobot-f509312bfe078d18b6f57af8011999231864d7fe.zip
Merge commit 'colobot-gold-0.1.4-alpha' into debian
* commit 'colobot-gold-0.1.4-alpha': (159 commits) Release alpha-0.1.4 Fixed console spam when music files are not installed Updated data submodule Fixed amount of fireball damage done to allies, close issue #356 Fixed icon on Windows; updated properties in .rc file COLOBOT: Gold Edition -> Colobot: Gold Edition Updated data submodule #335, #348, #352 Updated INSTALL.md to reflect latest changes to music repository Added oggenc to Travis config Fallback to English files if translated ones are not available Removed duplicate license header Tools for measuring mission time without opening game window Fixed m_exitAfterMission Fixed #335 and #348 Added -headless Changing resolution from commandline -runscene for userlevels Increased mission end accuracy Added some debug stuff, possible fix for #348 and #335 ...
Diffstat (limited to 'test/unit/common/image_test.cpp')
-rw-r--r--test/unit/common/image_test.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/test/unit/common/image_test.cpp b/test/unit/common/image_test.cpp
deleted file mode 100644
index 2b20a17..0000000
--- a/test/unit/common/image_test.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "common/image.h"
-
-#include <SDL.h>
-#include <stdio.h>
-
-/* For now, just a simple test: loading a file from image
- * and saving it to another in PNG. */
-
-int main(int argc, char *argv[])
-{
- if (argc != 3)
- {
- printf("Usage: %s in_image out_image\n", argv[0]);
- return 0;
- }
-
- CImage image;
-
- if (! image.Load(argv[1]))
- {
- std::string err = image.GetError();
- printf("Error loading '%s': %s\n", argv[1], err.c_str());
- return 1;
- }
- Gfx::Color color;
- std::string str;
-
- color = image.GetPixel(Math::IntPoint(0, 0));
- str = color.ToString();
- printf("pixel @ (0,0): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(0, 1));
- str = color.ToString();
- printf("pixel @ (0,1): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(1, 0));
- str = color.ToString();
- printf("pixel @ (1,0): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(1, 1));
- str = color.ToString();
- printf("pixel @ (1,1): %s\n", str.c_str());
-
- image.SetPixel(Math::IntPoint(0, 0), Gfx::Color(0.1f, 0.2f, 0.3f, 0.0f));
- image.SetPixel(Math::IntPoint(1, 0), Gfx::Color(0.3f, 0.2f, 0.1f, 1.0f));
- image.SetPixel(Math::IntPoint(0, 1), Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f));
- image.SetPixel(Math::IntPoint(1, 1), Gfx::Color(0.0f, 0.0f, 0.0f, 1.0f));
-
- if (! image.SavePNG(argv[2]))
- {
- std::string err = image.GetError();
- printf("Error saving PNG '%s': %s\n", argv[2], err.c_str());
- return 2;
- }
-
- return 0;
-}