-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbelt_block.cpp
More file actions
31 lines (26 loc) · 1.3 KB
/
belt_block.cpp
File metadata and controls
31 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "belt_block.h"
using namespace std;
BeltBlock::BeltBlock() : LoadoutBlock() {
}
BeltBlock::BeltBlock( String name_to_use, int row_to_use, int column_to_use ) : LoadoutBlock( name_to_use, row_to_use, column_to_use ) {
}
void BeltBlock::draw( unsigned char *screen_buffer ) {
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 0 ) + column], " --------------- ", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 1 ) + column], "| | | | |", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 2 ) + column], "| | | | |", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 3 ) + column], " --------------- ", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 4 ) + column], "| | | |", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 5 ) + column], "| | | |", 17 );
memcpy( &screen_buffer[AUTO_EQUIP_UI_LINE_SIZE * ( row + 6 ) + column], " --- --- ", 17 );
}
void BeltBlock::place_cursor( unsigned char *screen_buffer, int cursor ) {
int cursor_column = column + 2;
if( cursor < 4 ) {
draw_cursor( screen_buffer, row + 1, cursor_column + cursor * 4 );
} else {
if( cursor == 5 ) {
cursor_column += 12;
}
draw_cursor( screen_buffer, row + 4, cursor_column );
}
}