diff --git a/src/video.cpp b/src/video.cpp index 0017ffa04a4..2ebda48f7b3 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -293,11 +293,11 @@ void CVideo::make_fake() image::set_pixel_format(frameBuffer->format); } -void CVideo::make_test_fake() +void CVideo::make_test_fake(const unsigned width, + const unsigned height, const unsigned bpp) { - // Create fake screen that is 1024x768 24bpp - // We can then use this in tests to draw - frameBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE,1024,768,32,0xFF0000,0xFF00,0xFF,0); + frameBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, + width, height, bpp, 0xFF0000, 0xFF00, 0xFF, 0); image::set_pixel_format(frameBuffer->format); fake_interactive = true; diff --git a/src/video.hpp b/src/video.hpp index 53d22a4d148..4ed2a5fc85a 100644 --- a/src/video.hpp +++ b/src/video.hpp @@ -85,7 +85,15 @@ class CVideo : private boost::noncopyable { int getBpp(); void make_fake(); - void make_test_fake(); + /** + * Creates a fake frame buffer for the unit tests. + * + * @param width The width of the buffer. + * @param height The heigth of the buffer. + * @param bpp The bpp of the buffer. + */ + void make_test_fake(const unsigned width = 1024, + const unsigned height = 768, const unsigned bpp = 32); bool faked() const { return fake_screen_; } //functions to set and clear 'help strings'. A 'help string' is like a tooltip, but it appears