mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
g13d: Run clang-format to clean things up a bit
This commit is contained in:
parent
70e77c2b3b
commit
516423ae16
@ -177,25 +177,25 @@ void G13_LCD::image_test(int x, int y) {
|
||||
} else {
|
||||
image_clear();
|
||||
switch (x) {
|
||||
case 1:
|
||||
for (row = 0; row < G13_LCD_ROWS; ++row) {
|
||||
col = row;
|
||||
image_setpixel(row, col);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - col);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for (row = 0; row < G13_LCD_ROWS; ++row) {
|
||||
col = row;
|
||||
image_setpixel(row, col);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - col);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
default:
|
||||
for (row = 0; row < G13_LCD_ROWS; ++row) {
|
||||
col = row;
|
||||
image_setpixel(row, 8);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - 8);
|
||||
image_setpixel(row, G13_LCD_COLUMNS / 2);
|
||||
image_setpixel(row, col);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - col);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
for (row = 0; row < G13_LCD_ROWS; ++row) {
|
||||
col = row;
|
||||
image_setpixel(row, 8);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - 8);
|
||||
image_setpixel(row, G13_LCD_COLUMNS / 2);
|
||||
image_setpixel(row, col);
|
||||
image_setpixel(row, G13_LCD_COLUMNS - col);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
image_send();
|
||||
|
@ -57,10 +57,10 @@ void G13_Stick::set_mode(stick_mode_t m) {
|
||||
}
|
||||
_stick_mode = m;
|
||||
switch (_stick_mode) {
|
||||
case STICK_CALBOUNDS:
|
||||
_bounds.tl = G13_StickCoord(255, 255);
|
||||
_bounds.br = G13_StickCoord(0, 0);
|
||||
break;
|
||||
case STICK_CALBOUNDS:
|
||||
_bounds.tl = G13_StickCoord(255, 255);
|
||||
_bounds.br = G13_StickCoord(0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,17 +116,17 @@ void G13_Stick::parse_joystick(unsigned char *buf) {
|
||||
// update targets if we're in calibration mode
|
||||
switch (_stick_mode) {
|
||||
|
||||
case STICK_CALCENTER:
|
||||
_center_pos = _current_pos;
|
||||
return;
|
||||
case STICK_CALCENTER:
|
||||
_center_pos = _current_pos;
|
||||
return;
|
||||
|
||||
case STICK_CALNORTH:
|
||||
_north_pos = _current_pos;
|
||||
return;
|
||||
case STICK_CALNORTH:
|
||||
_north_pos = _current_pos;
|
||||
return;
|
||||
|
||||
case STICK_CALBOUNDS:
|
||||
_bounds.expand(_current_pos);
|
||||
return;
|
||||
case STICK_CALBOUNDS:
|
||||
_bounds.expand(_current_pos);
|
||||
return;
|
||||
};
|
||||
|
||||
// determine our normalized position
|
||||
|
@ -41,34 +41,34 @@ void string_repr_out::write_on(std::ostream &o) const {
|
||||
while (cp < end) {
|
||||
|
||||
switch (*cp) {
|
||||
case '\n':
|
||||
o << "\\n";
|
||||
break;
|
||||
case '\r':
|
||||
o << "\\r";
|
||||
break;
|
||||
case '\0':
|
||||
o << "\\0";
|
||||
break;
|
||||
case '\t':
|
||||
o << "\\t";
|
||||
break;
|
||||
case '\\':
|
||||
case '\'':
|
||||
case '\"':
|
||||
o << "\\" << *cp;
|
||||
break;
|
||||
default: {
|
||||
char c = *cp;
|
||||
if (c < 32) {
|
||||
char hi = '0' + (c & 0x0f);
|
||||
char lo = '0' + ((c >> 4) & 0x0f);
|
||||
o << "\\x" << hi << lo;
|
||||
} else {
|
||||
o << c;
|
||||
case '\n':
|
||||
o << "\\n";
|
||||
break;
|
||||
case '\r':
|
||||
o << "\\r";
|
||||
break;
|
||||
case '\0':
|
||||
o << "\\0";
|
||||
break;
|
||||
case '\t':
|
||||
o << "\\t";
|
||||
break;
|
||||
case '\\':
|
||||
case '\'':
|
||||
case '\"':
|
||||
o << "\\" << *cp;
|
||||
break;
|
||||
default: {
|
||||
char c = *cp;
|
||||
if (c < 32) {
|
||||
char hi = '0' + (c & 0x0f);
|
||||
char lo = '0' + ((c >> 4) & 0x0f);
|
||||
o << "\\x" << hi << lo;
|
||||
} else {
|
||||
o << c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user