diff options
author | richiesams | 2013-07-01 17:26:12 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:31:55 -0500 |
commit | daa2c4b67060ba8c86b11f60a59f1b59fec5037f (patch) | |
tree | 5fcd68420df3e89711e39437ece3ba6a09d28d4e /engines | |
parent | 7bc0097ddef3bbbb38bf854a2ed8685c92fd3312 (diff) | |
download | scummvm-rg350-daa2c4b67060ba8c86b11f60a59f1b59fec5037f.tar.gz scummvm-rg350-daa2c4b67060ba8c86b11f60a59f1b59fec5037f.tar.bz2 scummvm-rg350-daa2c4b67060ba8c86b11f60a59f1b59fec5037f.zip |
ZVISION: Move test functions out of video.cpp and into their own file
The file only exist to hold the code. The actual tests will be
moved to an appropriate location later.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/tests.h | 54 | ||||
-rw-r--r-- | engines/zvision/video.cpp | 50 |
2 files changed, 54 insertions, 50 deletions
diff --git a/engines/zvision/tests.h b/engines/zvision/tests.h new file mode 100644 index 0000000000..14f80ed83b --- /dev/null +++ b/engines/zvision/tests.h @@ -0,0 +1,54 @@ + +namespace ZVision { + +void tests() { +#if 0 + // Video test + Video::VideoDecoder *videoDecoder = new ZorkAVIDecoder(); + if (videoDecoder && videoDecoder->loadFile("zassets/temple/t000a11c.avi")) { + Common::List<Graphics::PixelFormat> formats; + formats.push_back(videoDecoder->getPixelFormat()); + //initGraphics(640, 480, true, formats); + + playVideo(videoDecoder); + } +#endif + + Common::File f; + +#if 1 + // Image test + + //initGraphics(640, 480, true, &format); + + if (f.open(" zassets/global/GJDEB11C.TGA")) { + Graphics::TGADecoder tga; + if (!tga.loadStream(f)) + error("Error while reading TGA image"); + f.close(); + + const Graphics::Surface *tgaSurface = tga.getSurface(); + + Graphics::Surface *screen = g_system->lockScreen(); + for (uint16 y = 0; y < tgaSurface->h; y++) + memcpy(screen->getBasePtr(0, y), tgaSurface->getBasePtr(0, y), tgaSurface->pitch); + g_system->unlockScreen(); + + tga.destroy(); + } + + +#endif + +#if 0 + // Sound test + if (f.open("zassets/castle/c000h9tc.raw")) { + Audio::SeekableAudioStream *audioStream = makeRawZorkStream(&f, 22050, DisposeAfterUse::YES); + Audio::SoundHandle handle; + g_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream); + } + +#endif +} + +} // End of namespace ZVision diff --git a/engines/zvision/video.cpp b/engines/zvision/video.cpp index ce686839e8..4e5fe82f97 100644 --- a/engines/zvision/video.cpp +++ b/engines/zvision/video.cpp @@ -132,54 +132,4 @@ void playVideo(Video::VideoDecoder *videoDecoder /*, VideoState videoState*/) { delete videoDecoder; } -void tests() { -#if 0 - // Video test - Video::VideoDecoder *videoDecoder = new ZorkAVIDecoder(); - if (videoDecoder && videoDecoder->loadFile("zassets/temple/t000a11c.avi")) { - Common::List<Graphics::PixelFormat> formats; - formats.push_back(videoDecoder->getPixelFormat()); - //initGraphics(640, 480, true, formats); - - playVideo(videoDecoder); - } -#endif - - Common::File f; - -#if 0 - // Image test - - //initGraphics(640, 480, true, &format); - - if (f.open("zassets/castle/cb8eb11c.tga")) { - Graphics::TGADecoder tga; - if (!tga.loadStream(f)) - error("Error while reading TGA image"); - f.close(); - - const Graphics::Surface *tgaSurface = tga.getSurface(); - - Graphics::Surface *screen = g_system->lockScreen(); - for (uint16 y = 0; y < tgaSurface->h; y++) - memcpy(screen->getBasePtr(0, y), tgaSurface->getBasePtr(0, y), tgaSurface->pitch); - g_system->unlockScreen(); - - tga.destroy(); - } - - -#endif - -#if 0 - // Sound test - if (f.open("zassets/castle/c000h9tc.raw")) { - Audio::SeekableAudioStream *audioStream = makeRawZorkStream(&f, 22050, DisposeAfterUse::YES); - Audio::SoundHandle handle; - g_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream); - } - -#endif -} - } // End of namespace ZVision |