summaryrefslogtreecommitdiff
path: root/demo/source/chgcol.c
blob: 6b99abb8e16b606084f77fbb820b80599afd76c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <ax-demo.h>

#include <ax/gfx.h>

void axd_chgcol(axd_dat * _dat,ax_i8 const _dir) {
	constexpr ax_i8 maxcol = 0xEu;
	ax_i8 col = _dat->col;
	if (!_dir) {
		if (!col) {col = maxcol;}
		else      {--col;}
	}
	else {
		if (col == maxcol) {col = 0x0u;}
		else               {++col;}
	}
	_dat->col = col;
	axd_setcolbdr(_dat->vaddr,col);
}