void create_monster(void) { short row, col; short i; boolean found = 0; object *monster; row = rogue.row; col = rogue.col; for (i = 0; i < 9; i++) { rand_around(i, &row, &col); if (((row == rogue.row) && (col == rogue.col)) || (row < MIN_ROW) || (row > (DROWS-2)) || (col < 0) || (col > (DCOLS-1))) { continue; } if ((!(dungeon[row][col] & MONSTER)) && (dungeon[row][col] & (FLOOR|TUNNEL|STAIRS|DOOR))) { found = 1; break; } } if (found) { monster = gr_monster((object *)0, 0); put_m_at(row, col, monster); mvaddch(row, col, gmc(monster)); if (monster->m_flags & (WANDERS | WAKENS)) { wake_up(monster); } } else { messagef(0, "you hear a faint cry of anguish in the distance"); } }
heavysideFunction::nodes_type heavysideFunction::transformToReal( nodes_type const& Gt ) const { gm_ptrtype _gm_ptr( new gm_type ); gm_type::precompute_ptrtype __geopc( new gm_type::precompute_type( _gm_ptr, Gt ) ); gm_type::Context<vm::POINT, element_type> gmc( _gm_ptr, *M_elt, __geopc ); return gmc.xReal(); }
void move_mon_to(object *monster, short row, short col) { short c; int mrow, mcol; mrow = monster->row; mcol = monster->col; dungeon[mrow][mcol] &= ~MONSTER; dungeon[row][col] |= MONSTER; c = mvinch(mrow, mcol); if ((c >= 'A') && (c <= 'Z')) { if (!detect_monster) { mvaddch(mrow, mcol, monster->trail_char); } else { if (rogue_can_see(mrow, mcol)) { mvaddch(mrow, mcol, monster->trail_char); } else { if (monster->trail_char == '.') { monster->trail_char = ' '; } mvaddch(mrow, mcol, monster->trail_char); } } } monster->trail_char = mvinch(row, col); if (!blind && (detect_monster || rogue_can_see(row, col))) { if ((!(monster->m_flags & INVISIBLE) || (detect_monster || see_invisible || r_see_invisible))) { mvaddch(row, col, gmc(monster)); } } if ((dungeon[row][col] & DOOR) && (get_room_number(row, col) != cur_room) && (dungeon[mrow][mcol] == FLOOR) && !blind) { mvaddch(mrow, mcol, ' '); } if (dungeon[row][col] & DOOR) { dr_course(monster, ((dungeon[mrow][mcol] & TUNNEL) ? 1 : 0), row, col); } else { monster->row = row; monster->col = col; } }
/** \fn getFFCompressParams \brief Dialog for lavcodec mpeg4/... codec settings */ uint8_t DIA_xvid4(COMPRES_PARAMS *incoming) { int b; int ret=0; int code; xvid4EncParam localParam; ADM_assert(incoming->extraSettingsLen==sizeof(localParam)); memcpy(&localParam,incoming->extraSettings,sizeof(localParam)); #define PX(x) &(localParam.x) // Our tabs /* Tab 1 main */ diaElemBitrate bitrate(incoming,NULL); #define MKTOGGLE(y,x) diaElemToggle t_##x(PX(x),y) MKTOGGLE(QT_TR_NOOP("_Interlaced"), interlaced); MKTOGGLE(QT_TR_NOOP("Ca_rtoon mode"), cartoon); MKTOGGLE(QT_TR_NOOP("_Greyscale"), greyscale); MKTOGGLE(QT_TR_NOOP("Turbo mode"), turbo); MKTOGGLE(QT_TR_NOOP("C_hroma optimizer"), chroma_opt); diaElem *main[]={&bitrate,&t_interlaced,&t_cartoon,&t_greyscale,&t_turbo,&t_chroma_opt}; diaElemTabs tabMain(QT_TR_NOOP("Main"),6,main); /* Tab 2 motion */ diaMenuEntry motionMenu[] = { {0, QT_TR_NOOP("None"),NULL} ,{1, QT_TR_NOOP("Very Low"),NULL} ,{2, QT_TR_NOOP("Low"),NULL} ,{3, QT_TR_NOOP("Medium"),NULL} ,{4, QT_TR_NOOP("High"),NULL} ,{5, QT_TR_NOOP("Very High"),NULL} ,{6, QT_TR_NOOP("Ultra High"),NULL}}; diaElemMenu motion(PX(guiLevel),QT_TR_NOOP("Motion Search Precision"),7,motionMenu); diaMenuEntry vhqMenu[] = { {0, QT_TR_NOOP("Off"),NULL} ,{1, QT_TR_NOOP("Mode Decision"),NULL} ,{2, QT_TR_NOOP("Limited Search"),NULL} ,{3, QT_TR_NOOP("Medium Search"),NULL} ,{4, QT_TR_NOOP("Wide Search"),NULL} }; diaElemMenu vhq(PX(vhqmode),QT_TR_NOOP("VHQ Mode"),5,vhqMenu); /* Tab2-ASP */ diaElemUInteger bframe(PX(bframes),QT_TR_NOOP("Max B Frames"),0,3); diaElemToggle qpel(PX(qpel),QT_TR_NOOP("Quarter Pixel")); diaElemToggle gmc(PX(gmc),QT_TR_NOOP("GMC")); diaElemToggle bvhq(PX(bvhq),QT_TR_NOOP("BVHQ")); diaElemFrame frameASP(QT_TR_NOOP("Advanced Simple Profile")); frameASP.swallow(&bframe); frameASP.swallow(&qpel); frameASP.swallow(&gmc); frameASP.swallow(&bvhq); /* Tab 2 motion extra */ diaElemToggle inter4mv(PX(inter4mv),QT_TR_NOOP("4MV")); diaElemToggle chroma_me(PX(chroma_me),QT_TR_NOOP("Chroma ME")); diaElemToggle hqac(PX(chroma_me),QT_TR_NOOP("HQ AC")); diaElemFrame frameMore(QT_TR_NOOP("More Search")); frameMore.swallow(&inter4mv); frameMore.swallow(&chroma_me); frameMore.swallow(&hqac); /* Tab 2 gop size */ diaElemUInteger min_key_interval(PX(min_key_interval),QT_TR_NOOP("Min Gop Size"),1,900); diaElemUInteger max_key_interval(PX(max_key_interval),QT_TR_NOOP("Max Gop Size"),1,900); diaElemFrame frameGop(QT_TR_NOOP("GOP Size")); frameGop.swallow(&min_key_interval); frameGop.swallow(&max_key_interval); diaElem *motions[]={&motion,&vhq,&frameMore,&frameGop,&frameASP}; diaElemTabs tabMotion(QT_TR_NOOP("Motion"),5,motions); /* Tab 3 Qz*/ diaMenuEntry qzMenu[] = { {0, QT_TR_NOOP("H263"),NULL} ,{1, QT_TR_NOOP("Mpeg"),NULL}} ; diaElemMenu h263(PX(mpegQuantizer),QT_TR_NOOP("Quantization Matrix"),2,qzMenu); diaElemToggle trellis(PX(trellis),QT_TR_NOOP("Trellis Quantization")); diaElem *qz[]={&h263,&trellis}; diaElemTabs tabQz(QT_TR_NOOP("Quantization"),2,qz); /* Tab 4 : 2nd pass */ #define MKENTRY(y,x) diaElemUInteger x(PX(x),y,0,100); frameOne.swallow(&x); diaElemFrame frameOne(QT_TR_NOOP("Two Pass Tuning")); MKENTRY(QT_TR_NOOP("Key Frame Boost(%)"), keyframe_boost); MKENTRY(QT_TR_NOOP("I-frames closer than..."), kfthreshold); MKENTRY(QT_TR_NOOP(".. are reduced by(%)"), kfreduction); MKENTRY(QT_TR_NOOP("Max Overflow Improvement(%)"), max_overflow_improvement); MKENTRY(QT_TR_NOOP("Max Overglow Degradation(%)"), max_overflow_degradation); #undef MKENTRY #define MKENTRY(y,x) diaElemUInteger x(PX(x),y,0,100);frameTwo.swallow(&x); diaElemFrame frameTwo(QT_TR_NOOP("Curve Compression")); MKENTRY(QT_TR_NOOP("High Bitrate Scenes (%)"), curve_compression_high); MKENTRY(QT_TR_NOOP("Low Bitrate Scenes (%)"), curve_compression_low); MKENTRY(QT_TR_NOOP("Overflow Control Strength"), overflow_control_strength); diaElem *twopass[]={&frameOne,&frameTwo}; diaElemTabs tabPass(QT_TR_NOOP("Two Pass"),2,twopass); /**/ /* End of tabs */ diaElemTabs *tabs[4]={&tabMain,&tabMotion,&tabQz,&tabPass}; if( diaFactoryRunTabs(QT_TR_NOOP("Xvid4 Configuration"),4,tabs)) { memcpy(incoming->extraSettings,&localParam,sizeof(localParam)); return 1; } return 0; }
bool ffMpeg4Configure(void) { diaMenuEntry meE[]={ {1,QT_TRANSLATE_NOOP("ffmpeg4","None")}, {2,QT_TRANSLATE_NOOP("ffmpeg4","Full")}, {3,QT_TRANSLATE_NOOP("ffmpeg4","Log")}, {4,QT_TRANSLATE_NOOP("ffmpeg4","Phods")}, {5,QT_TRANSLATE_NOOP("ffmpeg4","EPZS")}, {6,QT_TRANSLATE_NOOP("ffmpeg4","X1")} }; diaMenuEntry qzE[]={ {0,QT_TRANSLATE_NOOP("ffmpeg4","H.263")}, {1,QT_TRANSLATE_NOOP("ffmpeg4","MPEG")} }; diaMenuEntry rdE[]={ {0,QT_TRANSLATE_NOOP("ffmpeg4","MB comparison")}, {1,QT_TRANSLATE_NOOP("ffmpeg4","Fewest bits (vhq)")}, {2,QT_TRANSLATE_NOOP("ffmpeg4","Rate distortion")} }; diaMenuEntry threads[]={ {0,QT_TRANSLATE_NOOP("ffmpeg4","One thread")}, {2,QT_TRANSLATE_NOOP("ffmpeg4","Two threads)")}, {3,QT_TRANSLATE_NOOP("ffmpeg4","Three threads")}, {99,QT_TRANSLATE_NOOP("ffmpeg4","Auto (#cpu)")} }; FFcodecSettings *conf=&Mp4Settings; uint32_t me=(uint32_t)conf->lavcSettings.me_method; #define PX(x) &(conf->lavcSettings.x) diaElemBitrate bitrate(&(Mp4Settings.params),NULL); diaElemMenu meM(&me,QT_TRANSLATE_NOOP("ffmpeg4","Matrices"),4,meE); diaElemMenu threadM(PX(MultiThreaded),QT_TRANSLATE_NOOP("ffmpeg4","Threading"),4,threads); diaElemUInteger qminM(PX(qmin),QT_TRANSLATE_NOOP("ffmpeg4","Mi_n. quantizer:"),1,31); diaElemUInteger qmaxM(PX(qmax),QT_TRANSLATE_NOOP("ffmpeg4","Ma_x. quantizer:"),1,31); diaElemUInteger qdiffM(PX(max_qdiff),QT_TRANSLATE_NOOP("ffmpeg4","Max. quantizer _difference:"),1,31); diaElemToggle fourMv(PX(_4MV),QT_TRANSLATE_NOOP("ffmpeg4","4_MV")); diaElemToggle trellis(PX(_TRELLIS_QUANT),QT_TRANSLATE_NOOP("ffmpeg4","_Trellis quantization")); diaElemToggle qpel(PX(_QPEL),QT_TRANSLATE_NOOP("ffmpeg4","_Quarter pixel")); diaElemToggle gmc(PX(_GMC),QT_TRANSLATE_NOOP("ffmpeg4","_GMC")); diaElemUInteger max_b_frames(PX(max_b_frames),QT_TRANSLATE_NOOP("ffmpeg4","_Number of B frames:"),0,32); diaElemMenu qzM(PX(mpeg_quant),QT_TRANSLATE_NOOP("ffmpeg4","_Quantization type:"),2,qzE); diaElemMenu rdM(PX(mb_eval),QT_TRANSLATE_NOOP("ffmpeg4","_Macroblock decision:"),3,rdE); diaElemUInteger filetol(PX(vratetol),QT_TRANSLATE_NOOP("ffmpeg4","_Filesize tolerance (kb):"),0,100000); diaElemFloat qzComp(PX(qcompress),QT_TRANSLATE_NOOP("ffmpeg4","_Quantizer compression:"),0,1); diaElemFloat qzBlur(PX(qblur),QT_TRANSLATE_NOOP("ffmpeg4","Quantizer _blur:"),0,1); diaElemUInteger GopSize(PX(gop_size),QT_TRANSLATE_NOOP("ffmpeg4","_Gop Size:"),1,500); /* First Tab : encoding mode */ diaElem *diamode[]={&GopSize,&threadM,&bitrate}; diaElemTabs tabMode(QT_TRANSLATE_NOOP("ffmpeg4","User Interface"),3,diamode); /* 2nd Tab : ME */ diaElemFrame frameMe(QT_TRANSLATE_NOOP("ffmpeg4","Advanced Simple Profile")); frameMe.swallow(&max_b_frames); frameMe.swallow(&qpel); frameMe.swallow(&gmc); diaElem *diaME[]={&fourMv,&frameMe}; diaElemTabs tabME(QT_TRANSLATE_NOOP("ffmpeg4","Motion Estimation"),2,diaME); /* 3nd Tab : Qz */ diaElem *diaQze[]={&qzM,&rdM,&qminM,&qmaxM,&qdiffM,&trellis}; diaElemTabs tabQz(QT_TRANSLATE_NOOP("ffmpeg4","Quantization"),6,diaQze); /* 4th Tab : RControl */ diaElem *diaRC[]={&filetol,&qzComp,&qzBlur}; diaElemTabs tabRC(QT_TRANSLATE_NOOP("ffmpeg4","Rate Control"),3,diaRC); diaElemTabs *tabs[]={&tabMode,&tabME,&tabQz,&tabRC}; if( diaFactoryRunTabs(QT_TRANSLATE_NOOP("ffmpeg4","libavcodec MPEG-4 configuration"),4,tabs)) { conf->lavcSettings.me_method=(Motion_Est_ID)me; return true; } return false; }