本文整理汇总了C++中region_fill函数的典型用法代码示例。如果您正苦于以下问题:C++ region_fill函数的具体用法?C++ region_fill怎么用?C++ region_fill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了region_fill函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: select_scroll
// scroll the current selection
void select_scroll(s8 dir) {
const s32 max = net_num_ops() - 1;
s16 newSel;
s16 newIdx;
if(dir < 0) {
/// SCROLL DOWN
// if selection is already zero, do nothing
if(*pageSelect == 0) {
// print_dbg("\r\n reached min selection in inputs scroll. ");
return;
}
// remove highlight from old center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
// decrement selection
newSel = *pageSelect - 1;
///// these bounds checks shouldn't really be needed here...
// if(newSel < 0) { newSel = 0; }
// if(newSel > max ) { newSel = max; }
*pageSelect = newSel;
// add new content at top
newIdx = newSel - SCROLL_LINES_BELOW;
if(newIdx < 0) {
// empty row
region_fill(lineRegion, 0);
} else {
render_line(newIdx);
}
// render tmp region to bottom of scroll
// (this also updates scroll byte offset)
render_to_scroll_top();
// add highlight to new center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
} else {
// SCROLL UP
// if selection is already max, do nothing
if(*pageSelect == max) {
// print_dbg("\r\n reached max selection in inputs scroll. ");
return;
}
// remove highlight from old center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
// increment selection
newSel = *pageSelect + 1;
*pageSelect = newSel;
// add new content at bottom of screen
newIdx = newSel + SCROLL_LINES_ABOVE;
if(newIdx > max) {
// empty row
region_fill(lineRegion, 0);
} else {
render_line(newIdx);
}
// render tmp region to bottom of scroll
// (this also updates scroll byte offset)
render_to_scroll_bottom();
// add highlight to new center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
}
}
示例2: redraw_ins
// redraw all lines, force selection
void redraw_ins(void) {
u8 i=0;
s32 n = *pageSelect - 3;
// num_ins() includes param count!
const s32 max = net_num_ins() - 1;
// set scroll region
// FIXME: should be separate function i guess
render_set_scroll(¢erScroll);
print_dbg("\r\n redraw_ins() ");
while(i<8) {
if(n == -1) {
// draw a blank line
region_fill(lineRegion, 0);
} else if(n == (max+1)) {
// draw a blank line
region_fill(lineRegion, 0);
} else {
if(n < -1) {
n += (max + 2);
}
if( n > max ) {
n -= (max + 2);
}
render_line( n, 0xa );
}
render_to_scroll_line(i, n == *pageSelect ? 1 : 0);
++i;
++n;
}
}
示例3: handle_key_0
// store
void handle_key_0(s32 val) {
if(val == 0) { return; }
if(check_key(0)) {
region_fill(headRegion, 0x0);
font_string_region_clip(headRegion, "writing scene to card...", 0, 0, 0xa, 0);
headRegion->dirty = 1;
render_update();
region_fill(headRegion, 0x0);
// files_store_scene_name(sceneData->desc.sceneName, 1);
files_store_scene_name(sceneData->desc.sceneName);
print_dbg("\r\n stored scene, back to handler");
font_string_region_clip(headRegion, "done writing.", 0, 0, 0xa, 0);
headRegion->dirty = 1;
render_update();
// refresh
// redraw_lines();
redraw_scenes();
}
show_foot();
}
示例4: select_scroll
// scroll the current selection
static void select_scroll(s32 dir) {
// index for new content
s16 newIdx;
s16 newSel;
if(dir < 0) {
/// SCROLL DOWN
if(*pageSelect == 0) {
return;
}
// remove highlight from old center
// render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
// redraw center row without editing cursor, etc
render_line(*pageSelect, 0xa);
// copy to scroll
render_to_scroll_center();
newSel = *pageSelect - 1;
*pageSelect = newSel;
// add new content at top
newIdx = newSel - SCROLL_LINES_BELOW;
if(newIdx < 0) {
// empty row
region_fill(lineRegion, 0);
} else {
render_line(newIdx, 0xa);
}
// render tmp region to bottom of scroll
// (this also updates scroll byte offset)
render_to_scroll_top();
// add highlight to new center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
} else {
// SCROLL UP
// if selection is already max, do nothing
if(*pageSelect == (maxPresetIdx) ) {
return;
}
// remove highlight from old center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
// increment selection
newSel = *pageSelect + 1;
*pageSelect = newSel;
// add new content at bottom of screen
newIdx = newSel + SCROLL_LINES_ABOVE;
if(newIdx > maxPresetIdx) {
// empty row
region_fill(lineRegion, 0);
} else {
render_line(newIdx, 0xa);
}
// render tmp region to bottom of scroll
// (this also updates scroll byte offset)
render_to_scroll_bottom();
// add highlight to new center
render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
}
}
示例5: op_bignum_redraw
// redraw with current state
void op_bignum_redraw(op_bignum_t* bignum) {
//// TEST
/* u32 i, j; */
/* u8* dat = &(bignum->reg.data[0]); */
// region* r = &(bignum->reg);
if(bignum->enable <= 0) { return; }
// print value to text buffer
op_print(tmpStr, bignum->val);
print_dbg("\r\n op_bignum_redraw , ");
print_dbg(tmpStr);
// blank
region_fill(&(bignum->reg), 0);
// render text to region
region_string_aa(&(bignum->reg), tmpStr, 0, 0, 1);
// ascii art
/* print_dbg("\r\n"); */
/* for(i=0; i< OP_BIGNUM_PX_H; i++) { */
/* for(j=0; j< OP_BIGNUM_PX_W; j++) { */
/* if(*dat > 0) { print_dbg("#"); } else { print_dbg("_"); } */
/* dat++; */
/* } */
/* print_dbg("\r\n"); */
/* } */
// FIXME: this should NOT go here.
//gfx ops should inherit from op_poll,
// and only call for a redraw every 100 ms or whatever.
// screen_draw_region(r->x, r->y, r->w, r->h, r->data);
}
示例6: render_edit_string
// draw editing string to given region, with cursor highlight
void render_edit_string(region* reg, char* str, u8 len, u8 cursor) {
u8 i;
u8* dst = (u8*)reg->data;
u32 off = 0;
// const u32 squarePx = (FONT_CHARW+2) * FONT_CHARH;
u32 dif;
region_fill(reg, 0x0);
for(i=0; i<len; ++i) {
if(str[i] == 0) { break; }
if(i == cursor) {
/// fixme: net art
// region_fill_part(reg, off, squarePx, 0xf);
// hack a column fill with a space character
font_glyph(' ', dst, reg->w, 0x0, 0xf);
dst += 2; off += 2;
font_glyph_fixed(str[i], dst, reg->w, 0x0, 0xf);
dif = FONT_CHARW + 2;
dst += dif;
off += dif;
} else {
dif = font_glyph(str[i], dst, reg->w, 0xf, 0x0) + 1;
dst += dif;
off += dif;
}
}
reg->dirty = 1;
}
示例7: show_foot0
// display the function key labels according to current state
static void show_foot0(void) {
u8 fill = 0;
if(keyPressed == 0) {
fill = 0x5;
}
region_fill(footRegion[0], fill);
font_string_region_clip(footRegion[0], "LOAD", 0, 0, 0xf, fill);
}
示例8: show_foot1
static void show_foot1(void) {
u8 fill = 0;
if(keyPressed == 1) {
fill = 0x5;
}
region_fill(footRegion[1], fill);
font_string_region_clip(footRegion[1], "OUTS", 0, 0, 0xf, fill);
}
示例9: render_line
// fill tmp region with new content
// given input index and foreground color
static void render_line(s16 idx, u8 fg) {
region_fill(lineRegion, 0x0);
if( (idx >= 0) && (idx < maxPresetIdx) ) {
clearln();
appendln((const char*)preset_name(idx));
font_string_region_clip(lineRegion, lineBuf, 2, 0, fg, 0);
}
}
示例10: render_line
// fill tmp region with new content
// given input index
static void render_line(s16 idx, u16 max) {
region_fill(lineRegion, 0x0);
if((idx > max) || (idx < 0)) { return; }
clearln();
appendln((const char*)files_get_dsp_name(idx));
endln();
font_string_region_clip(lineRegion, lineBuf, 0, 0, 0xa, 0);
}
示例11: show_foot3
static void show_foot3(void) {
u8 fill = 0;
u8 fore = 0xf;
if(altMode) {
fill = 0xf;
fore = 0;
}
region_fill(footRegion[3], fill);
font_string_region_clip(footRegion[3], "ALT", 0, 0, fore, fill);
}
示例12: render_line
// fill tmp region with new content
// given input index and foreground color
static void render_line(s16 idx, u8 fg) {
region_fill(lineRegion, 0x0);
if( (idx >= 0) && (idx < files_get_scene_count()) ) {
clearln();
appendln((const char*)files_get_scene_name(idx));
// stick a null character at the end...
lineBuf[SCENE_NAME_LEN - 1] = '\0';
font_string_region_clip(lineRegion, lineBuf, 2, 0, fg, 0);
}
}
示例13: op_bignum_in_x
// input x position
void op_bignum_in_x(op_bignum_t* bignum, const io_t v) {
// blank so we don't leave a trail
region_fill(&(bignum->reg), 0);
if (v > OP_BIGNUM_X_MAX) {
bignum->x = bignum->reg.x = OP_BIGNUM_X_MAX;
} else {
bignum->x = bignum->reg.x = v;
}
op_bignum_redraw(bignum);
}
示例14: render_op_type
// render new operator type name
void render_op_type(void) {
const char* name = op_registry[userOpTypes[newOpType]].name;
// print_dbg("\r\n new op selection: ");
// print_dbg(name);
region_fill(headRegion, 0x0);
clearln();
appendln_char('+');
appendln(name);
endln();
font_string_region_clip(headRegion, lineBuf, 0, 0, 0xa, 0);
}
示例15: show_foot0
// display the function key labels according to current state
static void show_foot0(void) {
u8 fill = 0;
if(keyPressed == 0) {
fill = 0x5;
}
region_fill(footRegion[0], fill);
if(altMode) {
font_string_region_clip(footRegion[0], "FOLLOW", 0, 0, 0xf, fill);
} else {
font_string_region_clip(footRegion[0], "STORE", 0, 0, 0xf, fill);
}
}