• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ region_fill函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中region_fill函数的典型用法代码示例。如果您正苦于以下问题:C++ region_fill函数的具体用法?C++ region_fill怎么用?C++ region_fill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了region_fill函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
  }
}
开发者ID:dinchak,项目名称:aleph,代码行数:61,代码来源:page_ops.c


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


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


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


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


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


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


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


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


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


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


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


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


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


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


示例16: show_foot2

static void show_foot2(void) {
    u8 fill = 0;
    if(keyPressed == 2) {
        fill = 0x5;
    }
    region_fill(footRegion[2], fill);
    if(targetSelect) {
        font_string_region_clip(footRegion[2], "CONN", 0, 0, 0xf, fill);
    } else {
        font_string_region_clip(footRegion[2], "DISC", 0, 0, 0xf, fill);
    }
}
开发者ID:samdoshi,项目名称:aleph,代码行数:12,代码来源:page_outs.c


示例17: op_screen_init

/// initialize
void op_screen_init(void* op) {
  op_screen_t* screen = (op_screen_t*)op;

  // superclass functions
  screen->super.in_fn = op_screen_in;
  screen->super.pickle = (op_pickle_fn) (&op_screen_pickle);
  screen->super.unpickle = (op_unpickle_fn) (&op_screen_unpickle);
    // polled operator superclass
  screen->op_poll.handler = (poll_handler_t)(&op_screen_poll_handler);
  screen->op_poll.op = screen;

  // superclass val
  screen->super.numInputs = 6;
  screen->super.numOutputs = 0;
 
  screen->super.in_val = screen->in_val;
  screen->in_val[0] = &(screen->enable);
  screen->in_val[1] = &(screen->period);
  screen->in_val[2] = &(screen->val);
  screen->in_val[3] = &(screen->fill);
  screen->in_val[4] = &(screen->x);
  screen->in_val[5] = &(screen->y);

  screen->super.out = screen->outs;
  screen->super.opString = op_screen_opstring;
  screen->super.inString = op_screen_instring;
  screen->super.outString = op_screen_outstring;
  screen->super.type = eOpScreen;

  // class val
  screen->enable = 0;
  screen->period = op_from_int(50);
  screen->val = 0xf;
  screen->fill = 0;
  screen->x = 0;
  screen->y = 0;

  // init graphics
  /*.. this is sort of retarded, 
  doing stuff normally accomplished in region_alloc() or in static init,
  but doing a dumb memory hack on it to share a tmp data space between instances.
  */  
  screen->reg.dirty = 0;
  screen->reg.x = 0;
  screen->reg.y = 0;
  screen->reg.w = OP_SCREEN_PX_W;
  screen->reg.h = OP_SCREEN_PX_H;
  screen->reg.len = OP_SCREEN_GFX_BYTES;
  screen->reg.data = (u8*) (screen->regData);

  region_fill(&(screen->reg), 0);
}
开发者ID:duncanspeakman,项目名称:aleph,代码行数:53,代码来源:op_screen.c


示例18: render_line

// render a given line
void render_line(s16 idx) {

  region_fill(lineRegion, 0x0);
  if((idx >= 0) && (idx < net_num_ops()) ) {
    clearln();
    appendln_idx_lj((u8)idx);
    appendln_char('.');
    appendln(net_op_name(idx));
    endln();
    font_string_region_clip(lineRegion, lineBuf, 0, 0, 0xa, 0);
    // region_fill_part(lineRegion, LINE_UNDERLINE_OFFSET, LINE_UNDERLINE_LEN, 0x1);
  }
}
开发者ID:dinchak,项目名称:aleph,代码行数:14,代码来源:page_ops.c


示例19: show_foot2

static void show_foot2(void) {
  u8 fill = 0;
  if(keyPressed == 2) {
    fill = 0x5;
  }
  region_fill(footRegion[2], fill);

  if(altMode) {
    font_string_region_clip(footRegion[2], "COPY", 0, 0, 0xf, fill);
  } else {
    font_string_region_clip(footRegion[2], "CLEAR", 0, 0, 0xf, fill);
  } 
}
开发者ID:bensteinberg,项目名称:aleph,代码行数:13,代码来源:page_presets.c


示例20: op_bignum_init

/// initialize
void op_bignum_init(void* op) {
  op_bignum_t* bignum = (op_bignum_t*)op;

  // superclass functions
  bignum->super.in_fn = op_bignum_in;
  bignum->super.pickle = (op_pickle_fn) (&op_bignum_pickle);
  bignum->super.unpickle = (op_unpickle_fn) (&op_bignum_unpickle);
    // polled operator superclass
  bignum->op_poll.handler = (poll_handler_t)(&op_bignum_poll_handler);
  bignum->op_poll.op = bignum;

  // superclass val
  bignum->super.numInputs = 5;
  bignum->super.numOutputs = 0;
 
  bignum->super.in_val = bignum->in_val;
  bignum->in_val[0] = &(bignum->enable);
  bignum->in_val[1] = &(bignum->period);
  bignum->in_val[2] = &(bignum->val);
  bignum->in_val[3] = &(bignum->x);
  bignum->in_val[4] = &(bignum->y);

  bignum->super.out = bignum->outs;
  bignum->super.opString = op_bignum_opstring;
  bignum->super.inString = op_bignum_instring;
  bignum->super.outString = op_bignum_outstring;
  bignum->super.type = eOpBignum;

  // class val
  bignum->enable = 0;
  bignum->period = op_from_int(50);
  bignum->val = 0;
  bignum->x = 0;
  bignum->y = 0;

  // init graphics
  /*.. this is sort of retarded, 
  doing stuff normally accomplished in region_alloc() or in static init,
  but doing a dumb memory hack on it to share a tmp data space between instances.
  */  
  bignum->reg.dirty = 0;
  bignum->reg.x = 0;
  bignum->reg.y = 0;
  bignum->reg.w = OP_BIGNUM_PX_W;
  bignum->reg.h = OP_BIGNUM_PX_H;
  bignum->reg.len = OP_BIGNUM_GFX_BYTES;
  bignum->reg.data = (u8*) (bignum->regData);

  region_fill(&(bignum->reg), 0);
}
开发者ID:Someone101,项目名称:aleph,代码行数:51,代码来源:op_bignum.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ regional_alloc函数代码示例发布时间:2022-05-30
下一篇:
C++ region_alloc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap