当前位置: 首页>>代码示例>>C++>>正文


C++ render_line函数代码示例

本文整理汇总了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();
}
开发者ID:bbnickell,项目名称:aleph,代码行数:25,代码来源:page_ins.c

示例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);
  }
}
开发者ID:dinchak,项目名称:aleph,代码行数:61,代码来源:page_ops.c

示例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);
  }
}
开发者ID:bensteinberg,项目名称:aleph,代码行数:60,代码来源:page_presets.c

示例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 );
}
开发者ID:BitBangedFF,项目名称:hobd,代码行数:58,代码来源:render_hobd_imu_sample_time.c

示例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);
        }
开发者ID:earl,项目名称:r3-hostkit,代码行数:14,代码来源:agg_rasterizer_scanline_aa.cpp

示例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);
}
开发者ID:BadyRaty,项目名称:Mednafen-Core,代码行数:28,代码来源:cache.cpp

示例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);
}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:32,代码来源:cache.cpp

示例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);
}
开发者ID:joshdekock,项目名称:jim-ps3ware,代码行数:15,代码来源:vorbis.c

示例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(&centerScroll);

  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;
  }
}
开发者ID:bbnickell,项目名称:aleph,代码行数:36,代码来源:page_ins.c

示例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();
  }
}
开发者ID:BadyRaty,项目名称:Mednafen-Core,代码行数:7,代码来源:ppu.cpp

示例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();
}
开发者ID:samdoshi,项目名称:aleph,代码行数:30,代码来源:page_outs.c

示例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();
}
开发者ID:samdoshi,项目名称:aleph,代码行数:27,代码来源:page_outs.c

示例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();
}
开发者ID:patgarner,项目名称:aleph,代码行数:25,代码来源:page_ins.c

示例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);
}
开发者ID:deeice,项目名称:ldglite,代码行数:35,代码来源:L3View.c

示例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);
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:18,代码来源:vorbis.c


注:本文中的render_line函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。