本文整理汇总了C++中render_line函数的典型用法代码示例。如果您正苦于以下问题:C++ render_line函数的具体用法?C++ render_line怎么用?C++ render_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了render_line函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_key_1
void handle_key_1(s32 val) {
if(val == 0) { return; }
if(altMode) {
if(check_key(1)) {
// show / hide on play screen
net_toggle_in_play(*pageSelect);
// render to tmp buffer
render_line(*pageSelect, 0xf);
// copy to scroll with highlight
render_to_scroll_line(SCROLL_CENTER_LINE, 1);
}
} else {
if(check_key(1)) {
// show preset name in head region
draw_preset_name();
// include / exclude in preset
net_toggle_in_preset(*pageSelect);
// render to tmp buffer
render_line(*pageSelect, 0xf);
// copy to scroll with highlight
render_to_scroll_line(SCROLL_CENTER_LINE, 1);
}
}
show_foot();
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: render_hobd_imu_sample_time
void render_hobd_imu_sample_time(
const config_s * const config,
const hobd_imu_sample_time_s * const data,
const GLdouble base_x,
const GLdouble base_y )
{
char string[512];
GLdouble delta_y = 5.0;
const GLdouble bound_x = 355.0;
const GLdouble text_yoff = 15.0;
const GLdouble text_xoff = 5.0;
render_line(
base_x,
base_y,
base_x + bound_x,
base_y );
snprintf(
string,
sizeof(string),
"rx_time : %lu",
(unsigned long) data->rx_time );
render_text_2d(
base_x + text_xoff,
base_y + text_yoff,
string,
NULL );
render_line(
base_x,
base_y + text_yoff + delta_y,
base_x + bound_x,
base_y + text_yoff + delta_y );
delta_y += 15.0;
snprintf(
string,
sizeof(string),
"sample_time : %lu",
(unsigned long) data->sample_time );
render_text_2d(
base_x + text_xoff,
base_y + text_yoff + delta_y,
string,
NULL );
delta_y += 5.0;
render_line(
base_x,
base_y + text_yoff + delta_y,
base_x + bound_x,
base_y + text_yoff + delta_y );
}
示例5: render_line
//------------------------------------------------------------------------
void outline_aa::render_line(int x1, int y1, int x2, int y2)
{
enum dx_limit_e { dx_limit = 16384 << poly_base_shift };
int dx = x2 - x1;
if(dx >= dx_limit || dx <= -dx_limit)
{
int cx = (x1 + x2) >> 1;
int cy = (y1 + y2) >> 1;
render_line(x1, y1, cx, cy);
render_line(cx, cy, x2, y2);
}
示例6: while
uint8* PPU::Cache::tile_2bpp(unsigned tile) {
if(tilevalid[0][tile] == 0) {
tilevalid[0][tile] = 1;
uint8 *output = (uint8*)tiledata[0] + (tile << 6);
unsigned offset = tile << 4;
unsigned y = 8;
unsigned color, d0, d1;
while(y--) {
d0 = memory::vram[offset + 0];
d1 = memory::vram[offset + 1];
#define render_line(mask) \
color = !!(d0 & mask) << 0; \
color |= !!(d1 & mask) << 1; \
*output++ = color
render_line(0x80);
render_line(0x40);
render_line(0x20);
render_line(0x10);
render_line(0x08);
render_line(0x04);
render_line(0x02);
render_line(0x01);
#undef render_line
offset += 2;
}
}
return tiledata[0] + (tile << 6);
}
示例7: while
uint8* PPU::Cache::tile_4bpp(unsigned tile) {
if(tilevalid[1][tile] == 0) {
tilevalid[1][tile] = 1;
uint8 *output = (uint8*)tiledata[1] + (tile << 6);
unsigned offset = tile << 5;
unsigned y = 8;
unsigned color, d0, d1, d2, d3;
while(y--) {
d0 = ppu.vram[offset + 0];
d1 = ppu.vram[offset + 1];
d2 = ppu.vram[offset + 16];
d3 = ppu.vram[offset + 17];
#define render_line(mask) \
color = !!(d0 & mask) << 0; \
color |= !!(d1 & mask) << 1; \
color |= !!(d2 & mask) << 2; \
color |= !!(d3 & mask) << 3; \
*output++ = color
render_line(0x80);
render_line(0x40);
render_line(0x20);
render_line(0x10);
render_line(0x08);
render_line(0x04);
render_line(0x02);
render_line(0x01);
#undef render_line
offset += 2;
}
}
return tiledata[1] + (tile << 6);
}
示例8: ff_vorbis_floor1_render_list
void ff_vorbis_floor1_render_list(floor1_entry_t * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
int lx, ly, i;
lx = 0;
ly = y_list[0] * multiplier;
for (i = 1; i < values; i++) {
int pos = list[i].sort;
if (flag[pos]) {
render_line(lx, ly, list[pos].x, y_list[pos] * multiplier, out, samples);
lx = list[pos].x;
ly = y_list[pos] * multiplier;
}
if (lx >= samples) break;
}
if (lx < samples) render_line(lx, ly, samples, ly, out, samples);
}
示例9: 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;
}
}
示例10: render_line_oam_rto
void PPU::render_scanline() {
if(line >= 1 && line < (!overscan() ? 225 : 240)) {
if(framecounter) return;
render_line_oam_rto();
render_line();
}
}
示例11: handle_key_0
// function key handlers
void handle_key_0(s32 val) {
if(val == 0) {
return;
}
if(altMode) {
///// follow
// select target on ins page
tmpTarget = net_get_target(*pageSelect);
if(tmpTarget >= 0) {
pages[ePageIns].select = tmpTarget;
set_page(ePageIns);
redraw_ins();
}
} else {
// store
// show selected preset name
draw_preset_name();
if(check_key(0)) {
// store in preset
net_set_out_preset(*pageSelect, 1);
preset_store_out(preset_get_select(), *pageSelect);
// redraw selected line
render_line(*pageSelect, 0xa);
render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
// TODO: store directly in scene?
}
}
show_foot();
}
示例12: handle_key_1
void handle_key_1(s32 val) {
s16 newOut;
if(val == 0) {
return;
}
if(check_key(1)) {
if(altMode) {
print_dbg("\r\n splitting output: ");
print_dbg_ulong(*pageSelect);
newOut = net_split_out(*pageSelect);
*pageSelect = newOut;
redraw_outs();
} else {
// include / exclude in selected preset
// show preset name in head region
draw_preset_name();
// include / exclude in preset
net_toggle_out_preset(*pageSelect);
// re-draw selected line to update inclusion glyph
// render to tmp buffer
render_line(*pageSelect, 0xf);
// copy to scroll with highlight
render_to_scroll_line(SCROLL_CENTER_LINE, 1);
}
}
show_foot();
}
示例13: handle_key_2
void handle_key_2(s32 val) {
if(val == 0) {
return;
}
if(check_key(2)) {
if(altMode) {
// filter / all
} else {
if(zeroed) {
/// set to max
net_set_in_value(*pageSelect, OP_MAX_VAL);
zeroed = 0;
} else {
/// set to 0
net_set_in_value(*pageSelect, 0);
zeroed = 1;
}
// render to tmp buffer
render_line(*pageSelect, 0xf);
// copy to scroll with highlight
render_to_scroll_line(SCROLL_CENTER_LINE, 1);
}
}
show_foot();
}
示例14: DrawPartLine
//************************************************************************
void DrawPartLine(struct L3PartS *PartPtr,int CurColor,float m[4][4])
{
float r[4];
int i, Color;
float r2[4];
vector3d bb3d[8];
#ifdef SIXTEEN_EDGE_COLORS
if (0 <= CurColor && CurColor <= 15)
Color = edge_color(CurColor);
else
Color = 0;
#else
Color = edge_color(CurColor);
#endif
//Color = CurColor;
r2[0]=(PartPtr->BBox[0][0] + PartPtr->BBox[1][0]) / 2.0;
r2[1]=(PartPtr->BBox[0][1]);
r2[2]=(PartPtr->BBox[0][2] + PartPtr->BBox[1][2]) / 2.0;
M4V3Mul(r,m,r2);
bb3d[0].x=r[0];
bb3d[0].y=r[1];
bb3d[0].z=r[2];
r2[1]=PartPtr->BBox[1][1];
M4V3Mul(r,m,r2);
bb3d[1].x=r[0];
bb3d[1].y=r[1];
bb3d[1].z=r[2];
render_line(&bb3d[0],&bb3d[1],Color);
}
示例15: ff_vorbis_floor1_render_list
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
int lx, ly, i;
lx = 0;
ly = y_list[0] * multiplier;
for (i = 1; i < values; i++) {
int pos = list[i].sort;
if (flag[pos]) {
int x1 = list[pos].x;
int y1 = y_list[pos] * multiplier;
if (lx < samples)
render_line(lx, ly, FFMIN(x1,samples), y1, out);
lx = x1;
ly = y1;
}
if (lx >= samples) break;
}
if (lx < samples) render_line(lx, ly, samples, ly, out);
}