meaning of c & r
This commit is contained in:
parent
30fd67d0f0
commit
ba36e6d180
2 changed files with 12 additions and 13 deletions
13
src/ui_sdl.c
13
src/ui_sdl.c
|
@ -61,7 +61,6 @@ typedef struct sdl_keypad_t {
|
||||||
typedef struct sdl_button_t {
|
typedef struct sdl_button_t {
|
||||||
const char* name;
|
const char* name;
|
||||||
short pressed;
|
short pressed;
|
||||||
/* short extra; */
|
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -1712,19 +1711,19 @@ static void SDLDrawSerialDevices()
|
||||||
stringColor( sdlwindow, 10, 240, text, 0xffffffff );
|
stringColor( sdlwindow, 10, 240, text, 0xffffffff );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void draw_nibble( int c, int r, int val )
|
static inline void draw_nibble( int col, int row, int val )
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
x = ( c * 4 ); // x: start in pixels
|
x = ( col * 4 ); // x: start in pixels
|
||||||
|
|
||||||
if ( r <= display.lines )
|
if ( row <= display.lines )
|
||||||
x -= 2 * display.offset;
|
x -= 2 * display.offset;
|
||||||
y = r; // y: start in pixels
|
y = row; // y: start in pixels
|
||||||
|
|
||||||
val &= 0x0f;
|
val &= 0x0f;
|
||||||
if ( val != lcd_buffer[ r ][ c ] ) {
|
if ( val != lcd_buffer[ row ][ col ] ) {
|
||||||
lcd_buffer[ r ][ c ] = val;
|
lcd_buffer[ row ][ col ] = val;
|
||||||
|
|
||||||
SDLDrawNibble( x, y, val );
|
SDLDrawNibble( x, y, val );
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,17 +210,17 @@ static inline void tui_draw_nibble( int nx, int ny, int val )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void draw_nibble( int c, int r, int val )
|
static inline void draw_nibble( int col, int row, int val )
|
||||||
{
|
{
|
||||||
int x = ( c * 4 ), // x: start in pixels,
|
int x = ( col * 4 ), // x: start in pixels,
|
||||||
y = r; // y: start in pixels
|
y = row; // y: start in pixels
|
||||||
|
|
||||||
if ( r <= display.lines )
|
if ( row <= display.lines )
|
||||||
x -= 2 * display.offset;
|
x -= 2 * display.offset;
|
||||||
|
|
||||||
val &= 0x0f;
|
val &= 0x0f;
|
||||||
if ( val != lcd_buffer[ r ][ c ] ) {
|
if ( val != lcd_buffer[ row ][ col ] ) {
|
||||||
lcd_buffer[ r ][ c ] = val;
|
lcd_buffer[ row ][ col ] = val;
|
||||||
|
|
||||||
tui_draw_nibble( x, y, val );
|
tui_draw_nibble( x, y, val );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue