void Scene::paintCB(UPaintEvent& e) { // client GL graphics can be performed until the current function returns GLSection gls(this); if (is_initialized) ::g.render.camera(); paintScene(); }
void Scene::initScene() { GLSection gls(this); //NB: render.config() must be called before world.init() which is called in startCB()) ::g.render.config(::g.pref.quality3D); // complete the initialization of VRENG ::g.startCB(); // timer qui lance le reaffichage de la scene (repaint) tous les delta t render_timer.onAction(ucall(this, &UBox::repaint)); // le 1er arg. est le delai entre deux frames successives (si besoin est, changer // cette valeur au lieu de mettre un select() dans paintGL, ce qui est incorrect) // le 2e arg., -1, signifie qu'on repete indefiniement render_timer.start((time_t) (::g.pref.frame_delay/1000.), (int) (-1)); // timer qui execute NetTimeout() tous les delta t net_timer.onAction(ucall(this, &Scene::netTimeoutCB)); net_timer.start(net_delay, -1); message.show(false); is_initialized = true; // the scene is initialized and ready for rendering }
void remove_all(void) { while (n_vars) remove_id(0); /* hard way */ /* for (i = n_vars-1; i >= 0; i--) remove_id(i); */ /* remove_id(n_vars - 1); */ /* the hard way; remove_id(n_vars-1) would be the ``easy'' alternative */ gls(NULL, 0, GLS_INIT, NULL, NULL); /* cleans up static arrays */ reset_block_discr(); /* resets block settings */ max_block_dimension(1); /* reset */ if (gl_bounds != NULL) { efree(gl_bounds); gl_bounds = NULL; } if (valdata != NULL) free_data(valdata); valdata = NULL; }
CC_SAFE_RELEASE(mOtherDefense); CC_SAFE_RELEASE(mOtherLife); CC_SAFE_RELEASE(mGoldIcon); CC_SAFE_RELEASE(mExpIcon); } bool ChallengeResultDialog::onAssignCCBMemberVariable( CCObject * pTarget, const char * pMemberVariableName, CCNode * pNode ) { CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mName1", CCLabelTTF *, mName1); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mName2", CCLabelTTF *, mName2); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mGetGold", CCLabelTTF *, mGetGold); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mGetExp", CCLabelTTF *, mGetExp); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mTitle", CCLabelTTF *, mTitle); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mGoldIcon", CCSprite *, mGoldIcon); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mExpIcon", CCSprite *, mExpIcon); CCB_CCLABELTTF_GLUE(this, "mVs", mVs, gls("82")); CCB_CONTROLBUTTON_GLUE(this, "mCloseBtn", mCloseBtn, gls("77")); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mSelfAttack", CCLabelTTF *, mSelfAttack); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mSelfDefense", CCLabelTTF *, mSelfDefense); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mSelfLife", CCLabelTTF *, mSelfLife); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mOtherAttack", CCLabelTTF *, mOtherAttack); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mOtherDefense", CCLabelTTF *, mOtherDefense); CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mOtherLife", CCLabelTTF *, mOtherLife); return false; } SEL_MenuHandler ChallengeResultDialog::onResolveCCBCCMenuItemSelector(CCObject * pTarget, const char * pSelectorName ) { return NULL; }
int ossfim(int argc, char *argv[]) { int c, n = 25, dx = 9, dy = 9, i, j, plot_vgm = 0; double b = 1, B = 10, s = 1, S = 10, blocksize, samplespacing, est[2], **table; DATA **d = NULL; DPOINT *block = NULL, where; char *vgm_str = "1Exp(10)", *map_name = NULL; VARIOGRAM *vgm; while ((c = getopt(argc, argv, "n:m:B:b:S:s:V:v:x:y:")) != EOF) { switch (c) { case 'n': if (read_int(optarg, &n) || n <= 0) ErrMsg(ER_ARGOPT, "n"); break; case 'b': if (read_double(optarg, &b) || b < 0) ErrMsg(ER_ARGOPT, "b"); break; case 'B': if (read_double(optarg, &B) || B <= 0) ErrMsg(ER_ARGOPT, "B"); break; case 's': if (read_double(optarg, &s) || s <= 0) ErrMsg(ER_ARGOPT, "s"); break; case 'S': if (read_double(optarg, &S) || S <= 0) ErrMsg(ER_ARGOPT, "S"); break; case 'x': if (read_int(optarg, &dx) || dx <= 0) ErrMsg(ER_ARGOPT, "x"); break; case 'y': if (read_int(optarg, &dy) || dy <= 0) ErrMsg(ER_ARGOPT, "y"); break; case 'v': vgm_str = optarg; break; case 'V': plot_vgm = 1; vgm_str = optarg; break; case 'm': map_name = optarg; break; default: ErrClo(optopt); break; } } which_identifier("dummy grid"); d = get_gstat_data(); init_one_data(d[0]); d[0]->id = 0; d[0]->n_list = d[0]->n_max = 0; d[0]->mode = X_BIT_SET | Y_BIT_SET | V_BIT_SET; set_norm_fns(d[0]); vgm = get_vgm(0); if (read_variogram(vgm, vgm_str)) ErrMsg(ER_SYNTAX, vgm_str); vgm->ev->evt = SEMIVARIOGRAM; vgm->id1 = vgm->id2 = d[0]->id; block = get_block_p(); block->z = 0.0; block->x = block->y = -1.0; est[0] = 0.0; est[1] = -1.0; where.x = where.y = where.z = 0.0; where.X = (double *) emalloc(sizeof(double)); where.X[0] = 1.0; if (plot_vgm) return fprint_gnuplot_variogram(stdout, vgm, "", GIF, 0); table = (double **) emalloc((dy + 1) * sizeof(double *)); for (i = 0; i <= dy; i++) table[i] = (double *) emalloc((dx + 1) * sizeof(double)); /* do it: */ for (i = 0; i <= dx; i++) { /* sample spacing loop */ samplespacing = s + (i / (1.0 * dx)) * (S - s); generate_grid(d[0], samplespacing, n); select_at(d[0], &where); for (j = 0; j <= dy; j++) { /* block sizes loop */ reset_block_discr(); vgm_init_block_values(vgm); blocksize = b + (j / (1.0 * dy)) * (B - b); block->x = block->y = blocksize; if (blocksize == 0.0) SET_POINT(&where); else SET_BLOCK(&where); gls(d, 1, GLS_BLUP, &where, est); if (map_name) table[i][j] = sqrt(est[1]); else printlog("%g %g %g\n", samplespacing, blocksize, sqrt(est[1])); } } if (map_name) ossfim2map(table, map_name, s, S, b, B, dx, dy); return 0; }
void CommonNotify::_onNotification(CCObject* object) { CCLOG("CommonNotify::_onNotification"); NotificationObserver* observer = (NotificationObserver*)object; string name(observer->getName()); if (name == kVCLevelUp) { if(UserProxy::shared()->userVO.level > UserProxy::shared()->mLastUserVO.level) { FRAMEWORK->popup("LevelUpDialog"); } } else if(name == kVCBuyMoney) { FRAMEWORK->popup("BuyMoneyDialog"); } else if (name == kNCVersionError) { AlertDialog::initContent(gls("185"), true, this, callfunc_selector(CommonNotify::_forceUpgrade)); FRAMEWORK->popup("AlertDialog"); } else if(name == kNCNetError) { NetError* netError = (NetError*)observer->getObject(); if(netError->errorCode == kNCErrorMoney) { if(netError->cmdName == kNCBuyEnergy) { FRAMEWORK->popup("BuyMoneyDialog"); } else { AlertDialog::initContent(gls("145")); FRAMEWORK->popup("AlertDialog"); } } else if(netError->errorCode == kNCErrorReceipt) { if(netError->cmdName == kNCBuyMoney) { FloatText::shared()->playAnim(gls("201")); } } else if(netError->errorCode == kNCErrorCoin) { AlertDialog::initContent(gls("146")); FRAMEWORK->popup("AlertDialog"); } else if(netError->errorCode == kNCErrorFreeTime) { AlertDialog::initContent(gls("147")); FRAMEWORK->popup("AlertDialog"); } else if(netError->errorCode == kNCErrorEnergyFull) { AlertDialog::initContent(gls("162")); FRAMEWORK->popup("AlertDialog"); } else if(netError->errorCode == kNCErrorEnergy) { AlertTitleDialog::initContent(gls("182"), fls("183", StaticShop::shared()->getSupplyCostCount(SUPPLY_TYPE_ENERGY)), false, this, callfunc_selector(CommonNotify::_buyEnergy), NULL, NULL, gls("133")); FRAMEWORK->popup("AlertTitleDialog"); } else if(netError->errorCode == kNCErrorLife) { int cost = StaticShop::shared()->getSupplyCostCount(SUPPLY_TYPE_LIFE); AlertDialog::initContent(fls("188",cost), false,this, callfunc_selector(CommonNotify::_buyLife)); FRAMEWORK->popup("AlertDialog"); } else if(netError->errorCode == kNCErrorBagFull) { AlertDialog::initContent(gls("190")); FRAMEWORK->popup("AlertDialog"); } else if(netError->errorCode == kNCErrorIntenfityLack) { xmlBuy& buyFusion = StaticShop::shared()->mBuyFusion[1]; AlertTitleDialog::initContent( gls("213"), fls("214", buyFusion.money, buyFusion.count), false, this, callfunc_selector(CommonNotify::_buyFusion), NULL, NULL, gls("133")); FRAMEWORK->popup("AlertTitleDialog"); } else { AlertDialog::initContent(fls("160",netError->cmdName.c_str(), netError->errorCode)); FRAMEWORK->popup("AlertDialog"); } } else if(name == kVCSellEquip) { AlertDialog::initContent(gls("170"), false, this, callfunc_selector(CommonNotify::_sellItem)); FRAMEWORK->popup("AlertDialog"); } else if(name == kNCSellEquipage) { FloatText::shared()->playAnim(gls("197")); } }