some minor fixes in cursor handling

svn-id: r50726
This commit is contained in:
Neeraj Kumar 2010-07-06 16:30:42 +00:00
parent deb2c189c7
commit f145391abb
2 changed files with 14 additions and 11 deletions

View File

@ -30,6 +30,7 @@
#include "graphics/cursorman.h"
#include "testbed/events.h"
#include "testbed/graphics.h"
namespace Testbed {
@ -62,7 +63,8 @@ struct keycodeToChar {
{Common::KEYCODE_w, 'w'},
{Common::KEYCODE_x, 'x'},
{Common::KEYCODE_y, 'y'},
{Common::KEYCODE_z, 'z'}
{Common::KEYCODE_z, 'z'},
{Common::KEYCODE_SPACE, ' '}
};
char EventTests::keystrokeToChar() {
@ -108,16 +110,18 @@ bool EventTests::mouseEvents() {
pt.y = 120;
Testsuite::writeOnScreen("Testbed should be able to detect them, Press X to exit", pt);
// Init Mouse Palette
GFXtests::initMousePalette();
bool quitLoop = false;
bool passed = true;
// handle all mouse events
Common::Event event;
while (!quitLoop) {
// show mouse
// Show mouse
CursorMan.showMouse(true);
g_system->updateScreen();
while (eventMan->pollEvent(event)) {
// Quit if explicitly requested
if (Engine::shouldQuit()) {
@ -153,7 +157,7 @@ bool EventTests::mouseEvents() {
break;
case Common::EVENT_WHEELUP:
Testsuite::clearScreen();
Testsuite::writeOnScreen("Mouse wheel moved down", pt);
Testsuite::writeOnScreen("Mouse wheel moved up", pt);
break;
case Common::EVENT_MBUTTONUP:
Testsuite::clearScreen();
@ -191,7 +195,7 @@ bool EventTests::mouseEvents() {
bool EventTests::kbdEvents() {
// Make user type some word and display the output on screen
Common::String text = "You Entered :";
Common::String text = "You Entered : ";
Common::Point pt(0, 100);
Testsuite::clearScreen();
Testsuite::writeOnScreen("Enter your word, press ESC when done, it will be echoed back", pt);

View File

@ -61,7 +61,7 @@ GFXTestSuite::GFXTestSuite() {
// Mouse Layer tests (Palettes and movements)
addTest("PalettizedCursors", &GFXtests::palettizedCursors);
// FIXME: need to fix it
// FIXME: Scaled cursor crsh with odd dimmensions
addTest("ScaledCursors", &GFXtests::scaledCursors);
// Effects
@ -471,8 +471,8 @@ bool GFXtests::palettizedCursors() {
}
Testsuite::clearScreen();
// Done with cursors
CursorMan.popAllCursors();
// Done with cursors, make them invisible, any other test the could simply make it visible
CursorMan.showMouse(false);
return passed;
}
@ -609,9 +609,8 @@ bool GFXtests::scaledCursors() {
return false;
}
// Done with cursors
CursorMan.popAllCursors();
// Done with cursors, Make them invisible, any other test may enable and use it.
CursorMan.showMouse(false);
Testsuite::clearScreen();
return true;
}