1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef TESTBED_GRAPHICS_H
24 #define TESTBED_GRAPHICS_H
25 
26 #include "testbed/testsuite.h"
27 
28 namespace Testbed {
29 
30 namespace GFXtests {
31 
32 // Helper functions for GFX tests
33 void drawEllipse(int x, int y, int a, int b);
34 void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = "", int cursorTargetScale = 1);
35 void initMousePalette();
36 void initMouseCursor();
37 Common::Rect computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale);
38 void HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val);
39 Common::Rect drawCursor(bool cursorPaletteDisabled = false, int cursorTargetScale = 1);
40 
41 // will contain function declarations for GFX tests
42 TestExitStatus cursorTrails();
43 TestExitStatus fullScreenMode();
44 TestExitStatus filteringMode();
45 TestExitStatus aspectRatio();
46 TestExitStatus palettizedCursors();
47 TestExitStatus mouseMovements();
48 TestExitStatus copyRectToScreen();
49 TestExitStatus iconifyWindow();
50 TestExitStatus scaledCursors();
51 TestExitStatus shakingEffect();
52 TestExitStatus focusRectangle();
53 TestExitStatus overlayGraphics();
54 TestExitStatus paletteRotation();
55 TestExitStatus pixelFormats();
56 // add more here
57 
58 } // End of namespace GFXtests
59 
60 class GFXTestSuite : public Testsuite {
61 public:
62 	/**
63 	 * The constructor for the GFXTestSuite
64 	 * For every test to be executed one must:
65 	 * 1) Create a function that would invoke the test
66 	 * 2) Add that test to list by executing addTest()
67 	 *
68 	 * @see addTest()
69 	 */
70 	GFXTestSuite();
~GFXTestSuite()71 	~GFXTestSuite() {}
getName()72 	const char *getName() const {
73 		return "GFX";
74 	}
getDescription()75 	const char *getDescription() const {
76 		return "Graphics Subsystem";
77 	}
78 	static void setCustomColor(uint r, uint g, uint b);
79 
80 private:
81 	/**
82 	 * A Palette consists of 3 components RGB.
83 	 * As of now we only take 3 colors
84 	 * 0 (R:0, G:0, B:0) Black (kColorBlack)
85 	 * 1 (R:255, G:255, B:255) White (kColorWhite)
86 	 * 2 (R:255, G:255, B:255) your customized color (by default white) (kColorCustom)
87 	 * The remaining values are zero
88 	 */
89 	static byte _palette[256 * 3];
90 };
91 
92 } // End of namespace Testbed
93 
94 #endif // TESTBED_GRAPHICS_H
95