Skip to content

Commit

Permalink
AVALANCHE: Don't use cctype in Help anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
uruk committed Feb 14, 2014
1 parent b46224e commit 370e596
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions engines/avalanche/help.cpp
Expand Up @@ -29,7 +29,6 @@

#include "avalanche/avalanche.h"
#include "avalanche/help.h"
#include <cctype>

namespace Avalanche {

Expand Down Expand Up @@ -204,7 +203,11 @@ bool Help::handleKeyboard(const Common::Event &event) {
return true;

for (int i = 0; i < _buttonNum; i++) {
char upperCase = toupper(event.kbd.ascii);
char upperCase = 255; // Dummy value.
if ((97 <= event.kbd.ascii) && (event.kbd.ascii <= 122)) {
upperCase = event.kbd.ascii - 32;
}

This comment has been minimized.

Copy link
@criezy

criezy Feb 14, 2014

Member

With that change you only set upperCase when the character typed is the lower case character while before it was set when either the upper case or lower case character was typed. So now the shortcut only works with the lower case character. Is that on purpose?

This comment has been minimized.

Copy link
@peterbozso

peterbozso Feb 15, 2014

Member

Not at all! Thanks for your remark! :)

if (((Common::KEYCODE_a <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_z) && (_buttons[i]._trigger == upperCase)) ||
((event.kbd.keycode == Common::KEYCODE_PAGEUP) && (_buttons[i]._trigger == 214)) ||
((event.kbd.keycode == Common::KEYCODE_PAGEDOWN) && (_buttons[i]._trigger == 216))) { // We had to handle the pageups/pagedowns separately.
Expand Down

1 comment on commit 370e596

@lordhoto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be noteworthy that you can still use toupper without including cctype because common/scummsys.h includes ctype.h.

Please sign in to comment.