aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/dc/softkbd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/dc/softkbd.cpp')
-rw-r--r--backends/platform/dc/softkbd.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/backends/platform/dc/softkbd.cpp b/backends/platform/dc/softkbd.cpp
index 79363713a5..1f2bd619e1 100644
--- a/backends/platform/dc/softkbd.cpp
+++ b/backends/platform/dc/softkbd.cpp
@@ -70,10 +70,10 @@ SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os)
assert((sizeof(key_codes)/sizeof(key_codes[0])) == SK_NUM_KEYS);
const char *np = key_names;
- for(int i=0; i<SK_NUM_KEYS; i++) {
+ for (int i=0; i<SK_NUM_KEYS; i++) {
labels[0][i].create_texture(np);
np += strlen(np)+1;
- if(key_codes[i]>8192) {
+ if (key_codes[i]>8192) {
labels[1][i].create_texture(np);
np += strlen(np)+1;
}
@@ -92,19 +92,19 @@ void SoftKeyboard::draw(float x, float y, int transp)
bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff);
x0 = x += 4.0;
y += 4.0;
- for(int i=0; i<SK_NUM_KEYS; i++) {
+ for (int i=0; i<SK_NUM_KEYS; i++) {
float w = (i == 58? 164.0 : 24.0);
unsigned int bg = (i == keySel? bg_alpha_mask|0xffff00 :
bg_alpha_mask|0xc0c0ff);
draw_trans_quad(x, y, x+w, y+24.0, bg, bg, bg, bg);
- if(key_codes[i]<0 && (shiftState & ~key_codes[i]))
+ if (key_codes[i]<0 && (shiftState & ~key_codes[i]))
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0xffffff, 0.5);
- else if(key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
+ else if (key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
labels[1][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
else
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
x += w+4.0;
- if(++c == 11) {
+ if (++c == 11) {
c = 0;
x = x0;
y += 28.0;
@@ -116,41 +116,41 @@ int SoftKeyboard::key(int k, byte &shiftFlags)
{
switch(k) {
case 1001:
- if(++keySel == SK_NUM_KEYS)
+ if (++keySel == SK_NUM_KEYS)
keySel = 0;
break;
case 1002:
- if(--keySel < 0)
+ if (--keySel < 0)
keySel = SK_NUM_KEYS - 1;
break;
case 1003:
- if(keySel >= 55) {
- if(keySel > 58)
+ if (keySel >= 55) {
+ if (keySel > 58)
keySel += 5;
keySel -= 55;
- } else if(keySel > 47) {
- if((keySel += 6) < 59)
+ } else if (keySel > 47) {
+ if ((keySel += 6) < 59)
keySel = 59;
} else
keySel += 11;
break;
case 1004:
- if(keySel > 58)
+ if (keySel > 58)
keySel -= 6;
- else if((keySel -= 11) < 0)
- if((keySel += 66) > 58)
- if((keySel -= 5) < 59)
+ else if ((keySel -= 11) < 0)
+ if ((keySel += 66) > 58)
+ if ((keySel -= 5) < 59)
keySel = 59;
break;
case 1000:
case 13:
case 32:
case 319:
- if(key_codes[keySel]<0)
+ if (key_codes[keySel]<0)
shiftState ^= ~key_codes[keySel];
else {
shiftFlags = shiftState;
- if(key_codes[keySel] > 8192)
+ if (key_codes[keySel] > 8192)
return ((shiftState & Common::KBD_SHIFT)? (key_codes[keySel]>>8):
key_codes[keySel]) & 0xff;
else
@@ -164,9 +164,9 @@ int SoftKeyboard::key(int k, byte &shiftFlags)
void SoftKeyboard::mouse(int x, int y)
{
os->mouseToSoftKbd(x, y, x, y);
- if(x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
+ if (x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
x%28 >= 4 && y%28 >= 4)
- if((keySel = 11*(y/28)+(x/28)) > 58)
- if((keySel -= 5) < 59)
+ if ((keySel = 11*(y/28)+(x/28)) > 58)
+ if ((keySel -= 5) < 59)
keySel = 58;
}