这篇教程C++ GET_INT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GET_INT函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_INT函数的具体用法?C++ GET_INT怎么用?C++ GET_INT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GET_INT函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: load_stringvoid C_THISCLASS::load_config(unsigned char *data, int len){ int pos=0; if (data[pos] == 1) { pos++; load_string(effect_exp[0],data,pos,len); load_string(effect_exp[1],data,pos,len); load_string(effect_exp[2],data,pos,len); } else { char buf[769]; if (len-pos >= 768) { memcpy(buf,data+pos,768); pos+=768; buf[768]=0; effect_exp[2].assign(buf+512); buf[512]=0; effect_exp[1].assign(buf+256); buf[256]=0; effect_exp[0].assign(buf); } } if (len-pos >= 4) { blend=GET_INT(); pos+=4; } if (len-pos >= 4) { subpixel=GET_INT(); pos+=4; }}
开发者ID:azeem,项目名称:chavs,代码行数:29,
示例2: func_substringCELL func_substring(CELL frame){ CELL string = FV0; CELL start = FV1; CELL end = FV2; if (!STRINGP(string)) { return make_exception("expects a string"); } if (!INTP(start)) { return make_exception("expects a non-negative start index"); } if (!INTP(end)) { return make_exception("expects a non-negative end index"); } size_t len = GET_STRING(string)->len; size_t starti = GET_INT(start); size_t endi = GET_INT(end); if (starti < 0 || starti > len) { return make_exception("start index %d out of range [0,%d]", starti, len); } if (endi < starti || endi > len) { return make_exception("end index %d out of range [%d,%d]", endi, starti, len); } gc_root_1("func_substring", string); CELL result = make_string_raw(endi - starti); gc_unroot(); memcpy(GET_STRING(result)->data, GET_STRING(string)->data + starti, endi - starti); return result;}
开发者ID:adrmcintyre,项目名称:wisp,代码行数:31,
示例3: improve_skill/* code for skill improvement through use */void improve_skill(struct char_data *ch, int skill, int chance){ int percent = GET_SKILL(ch, skill); int newpercent, max; char skillbuf[MAX_STRING_LENGTH]; char mybuf[256]; max = max_lvl_skill[1][spells[find_skill_num_def(skill)].difficulty][(int) GET_LEVEL(ch)]; if (percent >= max || IS_NPC(ch)) return; if (number(1, (chance * 50)) > (GET_WIS(ch) + GET_INT(ch))) return; newpercent = 1; if (number(1, 120) <= GET_WIS(ch)) newpercent++; if (number(1, 120) <= GET_INT(ch)) newpercent++; percent += newpercent; percent = MIN(percent, max); SET_SKILL(ch, skill, percent); if (newpercent) { sprintf(mybuf, "SKILLIMPROVE: %s improved skill %s, int = %d, wis = %d, improved by = %d, now = %d", GET_NAME(ch), spells[find_skill_num_def(skill)].command, GET_INT(ch), GET_WIS(ch), newpercent, percent); mudlog(mybuf, 'D', COM_IMMORT, TRUE); sprintf(skillbuf, "{RYou feel your skill in {W%s {Rimproving.{x/r/n", spells[find_skill_num_def(skill)].command); send_to_char(skillbuf, ch); }}
开发者ID:nawglan,项目名称:ShadowWind,代码行数:28,
示例4: LFUNCAMLprim value LFUN(sqr_nrm2_stub)( value vSTABLE, value vN, value vOFSX, value vINCX, value vX){ CAMLparam1(vX); integer GET_INT(N), GET_INT(INCX); REAL res; VEC_PARAMS(X); caml_enter_blocking_section(); /* Allow other threads */ if (Bool_val(vSTABLE)) {#ifndef LACAML_DOUBLE res = scnrm2_(&N, X_data, &INCX);#else res = dznrm2_(&N, X_data, &INCX);#endif res *= res; } else { COMPLEX cres = FUN(dotc)(&N, X_data, &INCX, X_data, &INCX); res = cres.r; } caml_leave_blocking_section(); /* Disallow other threads */ CAMLreturn(caml_copy_double(res));}
开发者ID:kkirstein,项目名称:lacaml,代码行数:26,
示例5: process_player_kick_packet// process a player kick packetvoid process_player_kick_packet(ubyte *data, header *hinfo){ int player_num,from_player,ban,reason; short player_id; int offset = HEADER_LENGTH; // get the address of the guy who is to be kicked GET_SHORT(player_id); GET_INT(ban); GET_INT(reason); player_num = find_player_id(player_id); PACKET_SET_SIZE(); // only the server should ever receive a request to kick a guy Assert(Net_player->flags & NETINFO_FLAG_AM_MASTER); // determine who sent the packet from_player = find_player_id(hinfo->id); // check to see if this guy is allowed to make such a request if((from_player == -1) || !multi_kick_can_kick(&Net_players[from_player]) ){ nprintf(("Network","Received a kick request from an invalid player!!/n")); } // otherwise, process the request fully else { // make sure we have a valid player to kick if(player_num == -1){ nprintf(("Network","Received request to kick an unknown player!/n")); } else { // will handle all the rest of the details multi_kick_player(player_num,ban,reason); } }}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:35,
|