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

C++ MP_INFO函数代码示例

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

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



在下文中一共展示了MP_INFO函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: get_jobs

int
get_jobs (int x, int y, int jobs)
{
  int q;
  if (numof_markets > 0)
    {
      for (q = 0; q < numof_markets; q++)
	{
	  if ((abs (marketx[q] - x) < MARKET_RANGE
	       && abs (markety[q] - y) < MARKET_RANGE
	       && (MP_INFO(marketx[q],markety[q]).int_2 > (3 * jobs / 2))))
	    {
	      MP_INFO(marketx[q],markety[q]).int_2 -= jobs;
	      income_tax += jobs;
	      return (1);
	    }
	}
    }
  if (get_stuff (x, y, jobs, T_JOBS) != 0)
    {
      income_tax += jobs;
      return (1);
    }
  return (0);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:25,代码来源:market.c


示例2: update_tech_dep

void
update_tech_dep (int x, int y)
{
  switch (MP_GROUP(x,y))
    {
    case (GROUP_ORGANIC_FARM):
      MP_INFO(x,y).int_7 = ((double) MP_INFO(x,y).int_1
			      * ORGANIC_FARM_FOOD_OUTPUT) / MAX_TECH_LEVEL;
      break;
    case (GROUP_WINDMILL):
#ifdef OLD_POWER_CODE
      MP_INFO(x,y).int_5 = WINDMILL_POWER
#else
      MP_INFO(x,y).int_1 = WINDMILL_POWER
#endif
	+ (((double) MP_INFO(x,y).int_2 * WINDMILL_POWER) / MAX_TECH_LEVEL);
      break;
    case (GROUP_COAL_POWER):
#ifdef OLD_POWER_CODE
      MP_INFO(x,y).int_5 = POWERS_COAL_OUTPUT
#else
      MP_INFO(x,y).int_1 = POWERS_COAL_OUTPUT
#endif
	+ (((double) MP_INFO(x,y).int_4 * POWERS_COAL_OUTPUT)
	   / MAX_TECH_LEVEL);
      break;
    case (GROUP_SOLAR_POWER):
      MP_INFO(x,y).int_3 = POWERS_SOLAR_OUTPUT
	+ (((double) MP_INFO(x,y).int_2 * POWERS_SOLAR_OUTPUT)
	   / MAX_TECH_LEVEL);
      break;
    }
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:33,代码来源:engine.c


示例3: get_goods

int
get_goods (int x, int y, int goods)
{
  int q;
  if (numof_markets > 0)
    {
      for (q = 0; q < numof_markets; q++)
	{
	  if (abs (marketx[q] - x) < MARKET_RANGE
	      && abs (markety[q] - y) < MARKET_RANGE
	      && (MP_INFO(marketx[q],markety[q]).int_4
		  > goods))
	    {
	      MP_INFO(marketx[q],markety[q]).int_4 -= goods;
	      goods_tax += goods;
	      goods_used += goods;
	      /* make the waste here. */
	      MP_INFO(marketx[q],markety[q]).int_7 += goods / 3;
	      return (1);
	    }
	}
    }
  if (get_stuff (x, y, goods, T_GOODS) != 0)
    {
      put_stuff (x, y, goods / 3, T_WASTE);
      goods_tax += goods;
      goods_used += goods;
      return (1);
    }
  return (0);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:31,代码来源:market.c


示例4: remove_people

void remove_people(int num)
{
    int x, y;
    /* reset housed population so that we can display it correctly */
    housed_population = 1;
    while (housed_population && (num > 0)) {
        housed_population = 0;
        for (y = 0; y < WORLD_SIDE_LEN; y++)
            for (x = 0; x < WORLD_SIDE_LEN; x++)
                if (MP_GROUP_IS_RESIDENCE(x, y) && MP_INFO(x, y).population > 0) {
                    MP_INFO(x, y).population--;
                    housed_population += MP_INFO(x, y).population;
                    num--;
                    total_evacuated++;
                }
    }
    while (num > 0 && people_pool > 0) {
        num--;
        total_evacuated++;
        people_pool--;
    }

    refresh_population_text();

    /* Note that the previous test was inaccurate.  There could be 
       exactly 1000 people left. */
    if (!housed_population && !people_pool) {
        ok_dial_box("launch-gone.mes", GOOD, 0L);
    }
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:30,代码来源:rocket_pad.cpp


示例5: do_power_line

/*
  int_5 is animation schedule
  int_6 is the grid it is on
  int_7 is a grid timestamp
*/
void
do_power_line (int x, int y)
{
    if (grid[MP_INFO(x,y).int_6]->powered == -1)
	return;

    switch(MP_INFO(x,y).int_5) 
    {
    case 0: 
	MP_INFO(x,y).int_5 = POWER_MODULUS;
	break;
    case 1:
	if (!(MP_TYPE(x,y) <= 11 && MP_TYPE(x,y) >= 1))
	    break;
	MP_TYPE(x,y) += 11;
	break;
    case 2:
	if (!(MP_TYPE(x,y) >= 11 && MP_TYPE(x,y) <= 22))
	    break;
	MP_TYPE(x,y) -= 11;
	break;
    }

    MP_INFO(x,y).int_5--;
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:30,代码来源:power_line.c


示例6: sell_ore

int
sell_ore (int xt, int yt)
{
  int i = 0;
  i = (MP_INFO(xt,yt).int_5 * PORT_EXPORT_RATE) / 1000;
  MP_INFO(xt,yt).int_5 -= i;
  return (i * PORT_ORE_RATE);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:8,代码来源:engine.c


示例7: sell_coal

int
sell_coal (int xt, int yt)
{
  int i = 0;
  i = (MP_INFO(xt,yt).int_3 * PORT_EXPORT_RATE) / 1000;
  MP_INFO(xt,yt).int_3 -= i;
  return (i * PORT_COAL_RATE);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:8,代码来源:engine.c


示例8: sell_goods

int
sell_goods (int xt, int yt)
{
  int i = 0;
  i = (MP_INFO(xt,yt).int_4 * PORT_EXPORT_RATE) / 1000;
  MP_INFO(xt,yt).int_4 -= i;
  return (i * PORT_GOODS_RATE);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:8,代码来源:engine.c


示例9: sell_steel

int
sell_steel (int xt, int yt)
{
  int i = 0;
  i = (MP_INFO(xt,yt).int_6 * PORT_EXPORT_RATE) / 1000;
  MP_INFO(xt,yt).int_6 -= i;
  return (i * PORT_STEEL_RATE);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:8,代码来源:engine.c


示例10: sell_food

int
sell_food (int xt, int yt)
{
  int i = 0;
  i = (MP_INFO(xt,yt).int_1 * PORT_EXPORT_RATE) / 1000;
  MP_INFO(xt,yt).int_1 -= i;
  return (i * PORT_FOOD_RATE);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:8,代码来源:engine.c


示例11: check_bulldoze_area

void
check_bulldoze_area (int x, int y)
{
    //no need to bulldoze desert
    if( MP_GROUP( x, y ) == GROUP_DESERT ) 
        return;
    
  int xx, yy, g;
  if (MP_TYPE(x,y) == CST_USED)
    {
      xx = MP_INFO(x,y).int_1;
      yy = MP_INFO(x,y).int_2;
    }
  else
    {
      xx = x;
      yy = y;
    }
  g = MP_GROUP(xx,yy);

  if (g == GROUP_MONUMENT && monument_bul_flag == 0)
    {
        if( last_message_group != GROUP_MONUMENT ){
            new Dialog( BULLDOZE_MONUMENT, xx, yy ); // deletes itself
            last_message_group = GROUP_MONUMENT;
        }
        return;
    }
  else if (g == GROUP_RIVER && river_bul_flag == 0)
    {
        if( last_message_group != GROUP_RIVER ){
            new Dialog( BULLDOZE_RIVER, xx, yy ); // deletes itself
            last_message_group = GROUP_RIVER;
        }
        return;
    }
  else if (g == GROUP_SHANTY && shanty_bul_flag == 0)
    {
        if( last_message_group != GROUP_SHANTY ){
            new Dialog( BULLDOZE_SHANTY, xx, yy ); // deletes itself
            last_message_group = GROUP_SHANTY;
        }
        return;
    }
  else if (g == GROUP_TIP)
    {
      if( last_message_group != GROUP_TIP ){
        ok_dial_box ("nobull-tip.mes", BAD, 0L);
        last_message_group = GROUP_TIP;
      }
      return;
    }
  last_message_group = 0;
  getSound()->playSound( "Raze" );
  bulldoze_item (xx,yy);
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:56,代码来源:MapEdit.cpp


示例12: mps_right

void
mps_right (int x, int y)
{
    int i = 0;
    char s[12];
    const char* p;
    int g;

    snprintf(s,sizeof(s),"%d,%d",x,y);
    mps_store_title(i++,s);
    i++;
    mps_store_title(i++,_("Coverage"));
    p = (MP_INFO(x,y).flags & FLAG_FIRE_COVER) ? _("Yes") : _("No");
    mps_store_ss(i++,_("Fire"),p);

    p = (MP_INFO(x,y).flags & FLAG_HEALTH_COVER) ? _("Yes") : _("No");
    mps_store_ss(i++,_("Health"),p);

    p = (MP_INFO(x,y).flags & FLAG_CRICKET_COVER) ? _("Yes") : _("No");
    mps_store_ss(i++,_("Sport"),p);
    i++;
    mps_store_title(i++,_("Pollution"));

    if (MP_POL(x,y) < 10)
        p = _("clear");
    else if (MP_POL(x,y) < 25)
        p = _("good");
    else if (MP_POL(x,y) < 70)
        p = _("fair");
    else if (MP_POL(x,y) < 190)
        p = _("smelly");
    else if (MP_POL(x,y) < 450)
        p = _("smokey");
    else if (MP_POL(x,y) < 1000)
        p = _("smoggy");
    else if (MP_POL(x,y) < 1700)
        p = _("bad");
    else if (MP_POL(x,y) < 3000)
        p = _("very bad");
    else
        p = _("death!");

    mps_store_sd(i++,p,MP_POL(x,y));
    i++;

    mps_store_title(i++,_("Bulldoze Cost"));
    g = MP_GROUP(x,y);
    if (g == 0) {	/* Can't bulldoze grass. */
        mps_store_title(i++,_("N/A"));
    } else {
        if (g < 7)
            g--;			/* translate into button type */
        mps_store_d(i++,main_groups[g].bul_cost);
    }
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:55,代码来源:mps.cpp


示例13: mps_health_centre

void mps_health_centre(int x, int y)
{
    int i = 0;

    mps_store_title(i++, _("Health Centre"));
    i++;
    mps_store_title(i++, _("Inventory"));
    mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_1 * 100.0 / MAX_JOBS_AT_HEALTH_CENTRE);
    mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_2 * 100.0 / MAX_GOODS_AT_HEALTH_CENTRE);

}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:11,代码来源:health_centre.cpp


示例14: do_bulldoze_area

void
do_bulldoze_area (short fill, int xx, int yy)
{
  int size, x, y;
  if (MP_TYPE(xx,yy) == CST_USED)
    {
      x = MP_INFO(xx,yy).int_1;
      y = MP_INFO(xx,yy).int_2;
    }
  else
    {
      x = xx;
      y = yy;
    }
  size = MP_SIZE(x,y);
  if (MP_GROUP(x,y) == GROUP_SUBSTATION
      || MP_GROUP(x,y) == GROUP_WINDMILL)
    remove_a_substation (x, y);
  else if (MP_GROUP(x,y) == GROUP_MARKET)
    remove_a_market (x, y);
  else if (MP_GROUP(x,y) == GROUP_SHANTY)
    numof_shanties--;
  else if (MP_GROUP(x,y) == GROUP_COMMUNE)
    numof_communes--;

  people_pool += MP_INFO(x,y).population;
  clear_mappoint (fill, x, y);
  if (size > 1)			/* do size 2 */
    {
      clear_mappoint (fill, x + 1, y);
      clear_mappoint (fill, x, y + 1);
      clear_mappoint (fill, x + 1, y + 1);
    }
  if (size > 2)			/* do size 3 */
    {
      clear_mappoint (fill, x + 2, y);
      clear_mappoint (fill, x + 2, y + 1);
      clear_mappoint (fill, x + 2, y + 2);
      clear_mappoint (fill, x, y + 2);
      clear_mappoint (fill, x + 1, y + 2);
    }
  if (size > 3)			/* do size 4 */
    {
      clear_mappoint (fill, x + 3, y);
      clear_mappoint (fill, x + 3, y + 1);
      clear_mappoint (fill, x + 3, y + 2);
      clear_mappoint (fill, x + 3, y + 3);
      clear_mappoint (fill, x, y + 3);
      clear_mappoint (fill, x + 1, y + 3);
      clear_mappoint (fill, x + 2, y + 3);
    }
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:52,代码来源:engine.c


示例15: list_chapters

static void list_chapters(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int title_no)
{
    MP_INFO(stream, "CHAPTERS: ");
    for (int n = 0; ; n++) {
        double p = n;
        int r;
        r = get_chapter_time(vts_file, tt_srpt, title_no, &p);
        if (!r)
            break;
        int t = p * 1000;
        MP_INFO(stream, "%02d:%02d:%02d.%03d,", t/3600000, (t/60000)%60, (t/1000)%60, t%1000);
    }
    MP_INFO(stream, "\n");
}
开发者ID:wagic520,项目名称:mpv,代码行数:14,代码来源:stream_dvd.c


示例16: handle_msg_mini_data

void 
handle_msg_mini_data (void)
{
    int i, x, y;
    MsgBuf* msg = &recvbuf;
    Int16* msgp16 = (Int16*) MSG_BODY(msg);
    Int32* msgp32 = (Int32*) MSG_BODY(msg);
    int mini_type, num_entries;

    printf ("Client received MSG_MINI_DATA.\n");
    mini_type = ntohl(*msgp32++);
    num_entries = ntohl(*msgp32++);
    msgp16 = (Int16*) msgp32;

    switch (mini_type) {
    case MINI_SCREEN_POL_FLAG:
	for (x = 0; x < WORLD_SIDE_LEN; x++)
	    for (y = 0; y < WORLD_SIDE_LEN; y++)
		MP_POL(x,y) = ntohl(*msgp32++);
	break;
    case MINI_SCREEN_FIRE_COVER:
    case MINI_SCREEN_CRICKET_COVER:
    case MINI_SCREEN_HEALTH_COVER:
	for (x = 0; x < WORLD_SIDE_LEN; x++)
	    for (y = 0; y < WORLD_SIDE_LEN; y++)
		MP_INFO(x,y).flags = ntohl(*msgp32++);
	break;
    case MINI_SCREEN_UB40_FLAG:
	for (i = 0; i < num_entries; i++) {
	    x = ntohl(*msgp32++);
	    y = ntohl(*msgp32++);
	    MP_INFO(x,y).int_1 = ntohl(*msgp32++);
	}
	break;
    case MINI_SCREEN_STARVE_FLAG:
	for (i = 0; i < num_entries; i++) {
	    x = ntohl(*msgp32++);
	    y = ntohl(*msgp32++);
	    MP_INFO(x,y).int_2 = ntohl(*msgp32++);
	}
	break;
    case MINI_SCREEN_COAL_FLAG:
	for (x = 0; x < WORLD_SIDE_LEN; x++)
	    for (y = 0; y < WORLD_SIDE_LEN; y++)
		MP_INFO(x,y).coal_reserve = ntohs(*msgp16++);
	break;
    }
    update_scoreboard.mini = 1;
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:49,代码来源:climsg.c


示例17: loadGUIFile

void Dialog::editPort(){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    try {
        myDialogComponent = loadGUIFile( "gui/portdialog.xml" );
        assert( myDialogComponent != 0);
        registerDialog();
        blockingDialogIsOpen = true;
        iAmBlocking = true;
    } catch(std::exception& e) {
        std::cerr << "Couldn't display dialog 'tradedialog.xml': "
            << e.what() << "\n";
        return;
    }
    // set Dialog to Port-Data
    Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
    std::stringstream title;
	title << _("Port") << " ( " << pointX <<" , " << pointY << " )";
    p->setText( title.str() );

    CheckButton* cb;
    cb = getCheckButton( *myDialogComponent, "BuyFood" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_FOOD) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellFood" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_FOOD) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyCoal" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_COAL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellCoal" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_COAL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyOre" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_ORE) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellOre" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_ORE) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyGoods" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_GOODS) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellGoods" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_GOODS) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuySteel" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_STEEL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellSteel" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_STEEL) cb->check(); else cb->uncheck();
    // connect signals
    Button* applyButton = getButton( *myDialogComponent, "Apply" );
    applyButton->clicked.connect( makeCallback(*this, &Dialog::applyPortButtonClicked ) );
    Button* gotoButton = getButton( *myDialogComponent, "goto" );
    gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
开发者ID:BackupTheBerlios,项目名称:lincity-ng-svn,代码行数:49,代码来源:Dialog.cpp


示例18: mps_oremine

void
mps_oremine (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Ore Mine"));
  i++;

  mps_store_sfp(i++,_("Stock"), 
		MP_INFO(x,y).int_1 * 100.0 / DIG_MORE_ORE_TRIGGER);
  i++;

  mps_store_sfp(i++,_("Reserve"),
		MP_INFO(x,y).int_2 * 100.0 / (ORE_RESERVE * 16));
}
开发者ID:usrshare,项目名称:lincity,代码行数:15,代码来源:oremine.c


示例19: dvb_tune

int dvb_tune(dvb_priv_t *priv, int freq, char pol, int srate, int diseqc, int tone,
                fe_spectral_inversion_t specInv, fe_modulation_t modulation, fe_guard_interval_t guardInterval,
                fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_code_rate_t HP_CodeRate,
                fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
{
        int ris;

        MP_INFO(priv, "dvb_tune Freq: %lu\n", (long unsigned int) freq);

                ris = tune_it(priv, priv->fe_fd, priv->sec_fd, freq, srate, pol, tone, specInv, diseqc, modulation, HP_CodeRate, TransmissionMode, guardInterval, bandWidth, LP_CodeRate, hier, timeout);

        if(ris != 0)
                MP_INFO(priv, "dvb_tune, TUNING FAILED\n");

        return ris == 0;
}
开发者ID:Deadsign,项目名称:mpv,代码行数:16,代码来源:dvb_tune.c


示例20: set_norm_and_freq

static void set_norm_and_freq(tvi_handle_t *tvh, tv_channels_t *chan)
{
    MP_INFO(tvh, "Selected channel: %s - %s (freq: %.3f)\n",
           chan->number, chan->name, chan->freq/1000.0);
    tv_set_norm_i(tvh, chan->norm);
    tv_set_freq_float(tvh, chan->freq);
}
开发者ID:candux,项目名称:mpv,代码行数:7,代码来源:tv.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ MP_OBJ_FROM_PTR函数代码示例发布时间:2022-05-30
下一篇:
C++ MP_FATAL函数代码示例发布时间: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