ã¹ããŒã¹ã¯ããèªäœã課ããŸãã
èæ¯
ç§ã¯ãå€ãã®ããã°ã©ããŒãšåãããã«ããã®è·ââæ¥ãéžãã ã®ã¯ã幌å°æã«ã³ã³ãã¥ãŒã¿ãŒã²ãŒã ããã¬ã€ãããããã®éçºã倢èŠãŠããããã§ãã æ§æãšã©ãŒãªãã§ã³ã³ãã€ã«ã§ããã³ãŒããå€ããå°ãªããæžãããšãåŠã¶ãšããã«ããã¡ãããç§ã¯ãã¹ãŠã®å人ãç¥äººã«èŠããããããçš®é¡ã®æããªã²ãŒã ãäœãå§ããŸããã ããããæéãçµã€ãšããŸã£ããéãããšãããããã«ãªããã²ãŒã ãããç©ãããªãããžã§ã¯ãã«åãçµãããã«ãªããŸããã ãããŠããã¯éå»æ°å¹Žéç¶ããã ããããåœåã®æ¬²æ±ã¯æ¶ãããèªç±æéã®ã¿ãæ¶ããŸããã
ç§ã¯é·ãéAndroidåãã®ãããžã§ã¯ããäœããããšæã£ãŠããŸãããããåç¥ã®ããã«ããããžã§ã¯ãã®å€§éšåã¯Android SDKãšJavaã§éçºãããŠãããNDKã¯ãé床ãéèŠãªãå Žæã§ã®ã¿äœ¿çšããããšããå§ãããŸãã
ããããQtããããšãã«ãããã®æšå¥šäºé ãšã«ãŒã«ããã¹ãŠå¿ èŠãšããã®ã¯èª°ã§ããïŒ ã²ãŒã ã®é«å質ãªéçºã«ååã ãšæãã»ã©Javaãç¥ããªãã®ã§ãåŠç¿ãããã¯ãããŸããã§ããããC ++ã®ç¥èã¯ãããŸãã Qt for Androidã§ã®ããã€ãã®ãã¹ããããžã§ã¯ãã®åŸãæ¬æ Œçãªã¢ããªã±ãŒã·ã§ã³ãéçºããä»ã®ãã©ãããã©ãŒã ã«è»¢éããããšããå¯èœã§ããããšã«æ°ä»ããŸããã ãŸããShia LaBeouf-Just Do itã®ãããªãèŠãåŸããããè¡ãéåœã«ããããšãæããã«ãªããŸããã
Qt 5.5.1ããã³C ++ã§Androidåãã²ãŒã ãéçºããçµéšã«ã€ããŠã話ããããšæããŸãã
ã¢ã€ãã¢
å¥åŠãªããšã«ãã²ãŒã ã®ã¢ã€ãã¢ã¯éåžžã«æ©ããéåžžã«çããæ¹æ³ã§çãŸããŸããã ããã¡ãã®ãã¹ããããïŒä»®ç§°ïŒãäœæããããã«ãæºåž¯é»è©±ã®ã»ã³ãµãŒã§å®éšããŸããããã®æå³ã¯-æºåž¯é»è©±ãæŒãåæ°ãå¢ããã»ã©ããã€ã³ããå¢ããŸãã ãããè¡ãã«ã¯ãé»è©±ããã®ææãšã¹ãããŒã¯ãåºå¥ããå¿ èŠããããŸãããã幞ããªããšã«æåããŸããã§ããããç»é¢ã«ã°ã©ãã衚瀺ãããšãã«é¢çœãçµµãæãããã²ãŒã ã®ã¢ã€ãã¢ãç§ãã¡ã«è°è«ãããŸããã
çªç¶ãæŽçªã«èœã¡ããã®ã«ã€ããŠã²ãŒã ãäœãããã£ãã®ã§ããããã®èŒªéã¯æéãšãšãã«å€åããŸãã ããšããšã¯ãæç»ã¹ã¿ã€ã«ã®ã°ã©ãã£ãã¯ã¹ã䜿çšããŠ2次å ã®ã²ãŒã ãäœæããããšã«ãªã£ãŠããã å°æ¥ããã¹ãŠãããããã¥ãŒã®3次å ã²ãŒã ã«æµã蟌ã¿ãŸããã çé«ç·ã®ããã¬ã€ã€ãŒãäœæã§ããæŽçªãžã§ãã¬ãŒã¿ãŒãäœæãããŸããã æŽçªã®å£ãšã®è¡çªãèšç®ããæ¹æ³ãšããããã3次å ã¢ãã«ã«å€æããæ¹æ³ã¯ïŒ ä¿¡ããããªãã»ã©ã¯ãŒã«ãªãã®ãé·ãéèããŠçºæããããšã¯å¯èœã§ããããç§ã¯è¿åããŠäžçã®ãã¯ã»ã«å¹ŸäœåŠãäœããŸããã è¡çªã®èšç®ãšç»é¢äžã®è¡šç€ºã¯ã¯ããã«ç°¡åã«ãªããŸããããã²ãŒã ãMinecraftã«äŒŒãŠãããšããäºå®ãç ç²ã«ããŸãã ç§ã¯é©ããããã圌女ã圌ã«äŒŒããŠã圌ãããã£ã©ã¯ã¿ãŒã¢ãã«ãè¿œå ããŸããã ãããã£ãŠãã²ãŒã ã®å€èŠ³ãšã³ã³ã»ããã圢æãããŸããã
æŽçªçºé»æ©ã®æåã®ããŒãžã§ã³ïŒã¢ãŒã«ã€ãåçïŒ
ã²ãŒã ã®éçºãå§ããŠãç§ã¯å€ãã®äººã®ããã«ãéã皌ããšããç®æšãèªåèªèº«ã«èšå®ããŸããã§ããããç§ã¯èªåã®ãããžã§ã¯ããå§ããŠãããçµãããããã£ãã ãã§ãã ãããã£ãŠãã²ãŒã ã¯ç¡æã§ããå¿ èŠããããŸãïŒèª°ãç§ãããããè³Œå ¥ããŸããïŒïŒ
ã°ã©ãã£ãã¯ã¹
æå³
Qtã§ã¯ã3Dã°ã©ãã£ãã¯ã¹ã«OpenGL ES 2.0ã䜿çšã§ããŸãã次ã®ã¯ã©ã¹ãããã«åœ¹ç«ã¡ãŸãã
- QGLWidgetã¯å»æ¢ãããã¯ã©ã¹ã§ãQWidgetã®åå«ã§ãã Qt 5.0ããåã«äœ¿çš
- QOpenGLWidget-æ°ããã¯ã©ã¹ãQGLWidgetãšåãæ©èœãå®è¡ããŸããããã®å®è£ ã§äžéãã¬ãŒã ãããã¡ãŒã䜿çšããŸã
- QOpenGLWindow -OpenGLã°ã©ãã£ãã¯ã¹ã衚瀺ããããã«èšèšãããŠããŸãããŠã£ãžã§ããã§ã¯ãªããäŸåé¢ä¿ãŠã£ãžã§ããã¢ãžã¥ãŒã«ããã«ããŸãã
ãããã®ãŠã£ãžã§ãããè©ŠããŠãããã€ãã®çµè«ãåºããŸããã
- QGLWidgetã¯ã匱ãã¹ããŒããã©ã³ã§ã¯QOpenGLWidgetãããã¯ããã«é«éã§ã
- QOpenGLWidgetã¯ããŠã£ã³ããŠã®ãµã€ãºãå€æŽãããšãã«å éšãã¬ãŒã ãããã¡ãŒã®ãµã€ãºãå€æŽããŸããããããããã°ãŸãã¯æ©èœã§ããå°åœ±è¡åã ãã®ãã¹ãŠã«ã€ããŠããã®ãŠã£ãžã§ããã䜿çšããããã©ãŒãã³ã¹ã¯éåžžã«å°ããã£ã
- QOpenGLWindowã¯æé©ãªåè£ã§ãã ã°ã©ãã£ãã¯ã·ãŒã³ã®ãã¥ãŒããŒããšããŠäœ¿çšã§ãããåãŠã£ãžã§ãããè¿œå ã§ããªããããQtã䜿çšããŠãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãäœæã§ããŸããã ãããã圌ã¯3ã€ãã¹ãŠã®äžã§æãçç£çã§ã
ã²ãŒã ãå®è£ ããã«ã¯ãQOpenGLWindowãéžæãããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãèªåã§åŸªç°ãããå¿ èŠããããŸããã
ãã¬ãŒã ã®æŽæ°ã¯ãswapBuffersã®åŸã«çæãããframeSwappedïŒïŒã·ã°ãã«ã䜿çšããŠå®è£ ãããŸããã ãã®ä¿¡å·ã䜿çšãããšãã¿ã€ããŒã䜿çšããå Žåãããã¹ã ãŒãºãªãã¬ãŒã å€æŽãå®çŸã§ããŸãã
ã¢ãã¡ãŒã·ã§ã³ãèšç®ããã«ã¯ããã¬ãŒã æéãèšç®ããå¿ èŠããããŸããã ãããè¡ãããã«ãç§ã¯QTimeãæåã«äœ¿çšããŸããããããã¯æªãèãã§ãããã®ã¯ã©ã¹ã¯äžåäžãªæéãèæ ®ããŠããããã§ãã ãŸãããã®ã¯ã©ã¹ãå€æŽããæš©éã¯ããªç§ã«å¶éãããŠããŸãããããã¯äžå®å®ãªFPSã§ã®ã¹ã ãŒãºãªã¢ãã¡ãŒã·ã§ã³ã«ã¯äžååã§ãã
ããã¥ã¡ã³ããèããŠåç §ããåŸã QElapsedTimerã¯ã©ã¹ã䜿çšããããšã«ããŸããã ãã®ã¯ã©ã¹ã¯å調ãªæéã䜿çšããããšããæ倧ããç§ã®å解èœãæã¡ãŸãã
ãã¯ã¹ãã£ãšã€ã³ã¿ãŒãã§ã€ã¹
æåã®ããŒãžã§ã³ãšãããã°ã§ã¯ããã¯ã¹ãã£ã¯äžæçã«Minecraftããåçšãããããã€ãã®ãã£ã©ã¯ã¿ãŒã¹ãã³ã䜿çšãããŸããã ã€ã³ã¿ãŒãã§ã€ã¹ã®æåã®ããŒãžã§ã³ã¯ç°è²ã®åè§ããã¿ã³ã§ãå€æ¹ã«äœæãããåŠçã«ã¯1ãæããããŸããã
ã²ãŒã ã®æåã®ã¹ã¯ãªãŒã³ã·ã§ãã
ç§ã®å人ããã¶ã€ããŒã«éžã°ããŸããã ãã®éžæã®å©ç¹ã¯ããã®ãã¶ã€ããŒãä¿¡é Œã§ããããšã§ããæ¬ ç¹ã¯ã圌ããã¶ã€ããŒã§ã¯ãªãããšã§ã-圌ã¯èªåè»æŽå士ã§ãã
å°æ¥çã«ã¯ããªãªãžãã«ã®ãã¯ã¹ãã£ãããã€ãã®ã¬ãã«ã§æãããã£ã©ã¯ã¿ãŒã®ãã¯ã¹ãã£ãäœæããŸããã
ãçŸãããã€ã³ã¿ãŒãã§ãŒã¹ãšãã£ã©ã¯ã¿ãŒãæãããã»ã¹ã¯éåžžã«æéããããããšãå€æããŸããã ãã¶ã€ããŒãç§ããæ°ãããã£ã©ã¯ã¿ãŒããã¿ã³ãçµãåºãããšããŠããéãç§ã¯ã³ãŒãã®æé©åãç¶ãããããããŸããã§ããã
æåŸãã2çªç®ã®ããŒãžã§ã³ã®ã¹ã¯ãªãŒã³ã·ã§ãã
ã¬ãã«ãã¯ã¹ãã£ã¯ããã¹ãŠã®ãããã¯ã®å€§ããªã¢ãã©ã¹ã§ããã16ãã¯ã»ã«ã®èŸºãæã€32åã®ãã¥ãŒããå容ããŸãã ãã®ã¢ãããŒãã§ã¯ãã¬ã€ã€ãŒãæç»ãããšãã«ãçŸåšã®ãã¯ã¹ãã£ãåžžã«åã€ã³ã¹ããŒã«ããå¿ èŠã¯ãããŸããããè€æ°ã®åŒã³åºãã§é ç¹ãããã¡ãŒã䜿çšããŠã¬ãã«å šäœãæç»ã§ããŸãã
åé¡ã¯ãä»ã®ãããã¯ã«é£æ¥ãããããã¯ã®æ¥µç«¯ãªãã¯ã»ã«ã§çºçããŸããã ãã¯ã¹ãã£åº§æšãäžžãããšãã¢ãŒããã¡ã¯ãããããã¯ã®ç«¯ã«ã¹ãã©ã€ãã®åœ¢ã§çŸãå§ããŸããã ãã®åé¡ã解決ããã«ã¯ããããã¯ã®ãšããžã®ãã¯ã»ã«ãè€è£œããå¹ 1ãã¯ã»ã«ã®å¢çç·ãåãããã¯ã«è¿œå ããŸããã ãã®ãããªç¬ç¹ã®CLAMP_TO_EDGEã
æ®å¿µãªããããã®ã¢ãããŒãã§ã¯ãã¬ãã«ã«mipmapã䜿çšã§ããŸããã§ããã é ç¹ãããã¡ãŒã®ãã¯ã¹ãã£åº§æšã¯ããã®ãªãã»ããã1ãã¯ã»ã«åèæ ®ããå¿ èŠããããŸãã詳现ãäœæžããããã¯ã¹ãã£ãäœæããå Žåããã®ãªãã»ããã¯å°ãããªãã詳现ã¬ãã«ã«å¿ããŠç°ãªãã¬ãã«ã®ãžãªã¡ããªã䜿çšããå¿ èŠããããŸãã ç§ã¯ãããæ°ã«ããªãããšã«æ±ºããŸããããªããªã ãã¯ã¹ãã£èªäœã®ã¬ãã«ã¯256x256ãã¯ã»ã«ãããªãããããã€ãªãã¢ãã£ã«ã¿ãªã³ã°ã§ã¯ããã©ãŒãã³ã¹ã¯ããã»ã©åäžããŸããããå®è£ ã«ã¯ããã«å°é£ã䌎ããŸãã
ãŸãã32åã®ãããã¯ãããããŸããããã¬ãã«ããããã£ã§ã¯ã90ã180ãããã³270床å転ãããããã¯ãé 眮ããæ©èœãèšå®ãããããã¯ãã¯ã¹ãã£éã®åãæ¿ãã®ã¢ãã¡ãŒã·ã§ã³ãèšå®ããŠãã²ãŒã ã®èŠèŠçãªã³ã³ããŒãã³ããå€æ§åããããšãã§ããŸãã ãã ãããã¡ã³ã®å転ã®å¹æãäœæããããã«ãããããã®ã¬ãã«ã§ã®ã¿ã¢ãã¡ãŒã·ã§ã³ãé©çšããŸããã
ã·ã§ãŒããŒ
Qtã«ã¯ã·ã§ãŒããŒãæäœããããã®äŸ¿å©ãªã¯ã©ã¹ããããŸãã QOpenGLShaderProgramã䜿çšããŸãã ã ãã®ã¯ã©ã¹ã䜿çšãããšãé ç¹ã·ã§ãŒããŒãšãã©ã°ã¡ã³ãã·ã§ãŒããŒãè¿œå ããããããã³ã³ãã€ã«ãããªã³ã¯ãããŠããã©ãŒã ãšattrubuteãèšå®ã§ããŸãã ã¯ã©ã¹èªäœã¯å€ãã®OpenGLåŒã³åºãã®åãªãã©ãããŒã§ããããããã£ãŠããã®ã¯ã©ã¹ã®åŒã³åºãã®éã«GLåŒã³åºããçŽæ¥äœ¿çšããããšã§ã¯ã©ã¹ãç Žå£ã§ãããšããç解ã«ãããŠãæ¬æ Œçãªãªããžã§ã¯ãã§ã¯ãããŸããã
䟿å©ãªããšã«ãESã·ã§ãŒããŒããã¹ã¯ããããšã¢ãã€ã«ããã€ã¹ã®äž¡æ¹ã§æ£åžžã«ã³ã³ãã€ã«ãããããã«ãã¯ã©ã¹ã¯èªåçã«defineãè¿œå ããŸãã ããã¯äž»ã«ããã¹ã¯ãããäžã§ã¯äœã«ããªããªã粟床æå®åã«é©çšãããŸãã
ããã€ãã®ãããã¯ã®ã©ã€ãã£ã³ã°ãšã¢ãã¡ãŒã·ã§ã³ããã£ã©ã¯ã¿ãŒã·ã§ãŒããŒãã€ã³ã¿ãŒãã§ã€ã¹ã·ã§ãŒããŒãªã©ãã²ãŒã ã¯ãŒã«ãçšã«åå¥ã®ã·ã§ãŒããŒãäœæããå¿ èŠããããŸããã
ã€ã³ã¿ãŒãã§ã€ã¹ã·ã§ãŒããŒã«ã¯
- ã·ã³ãã«ãã¯ã¹ãã£ã·ã§ãŒããŒ
- ã·ã§ãŒããŒããŒhp \ã·ãŒã«ã
- ãµãŒã¯ã«ã·ã§ãŒããŒ
æåã®ããŒãžã§ã³ã§ã¯ãã€ã³ãžã±ãŒã¿ãŒãã©ã¹ã³ãšã€ã³ãžã±ãŒã¿ãŒèªäœã圢æããé·æ¹åœ¢ã®ã»ãããããã°ã¬ã¹ããŒã«å®è£ ãããé»çã«é ãããŠããŸãã ããããæ°ããããŒã®ã¬ã€ã¢ãŠããèŠããšãããã®æ¹æ³ãæåŠããªããã°ãªããŸããã§ããã
ããŒHPã·ãŒã«ã
ãã®ããŒãã·ã§ãŒããŒã§å®è£ ããããšã«ããŸãããæåã¯éåžžã«å¥åŠãªã¢ã€ãã¢ã®ããã«æããŸããããæçµçã«ã¯é¿ããããªããã®ãšããŠåãå ¥ãã次ã®ããã«å®è£ ããŸããã
ã·ã§ãŒããŒã³ãŒã
#ifdef GL_ES precision highp int; #endif varying highp vec4 v_position; varying highp vec2 v_dim; uniform lowp vec4 u_color; uniform highp float u_tg; uniform highp float u_value_a; uniform highp float u_value_b; uniform highp int u_step; uniform lowp vec3 u_pallete[3]; void main() { int hstep = u_step/2; int w = int(v_dim.x); int h = int(v_dim.y); int wd = u_step*3; int pos_bl = int(v_position.x - u_tg*v_position.y + v_dim.y); int pos_br = int(v_position.x + u_tg*v_position.y); int pos_l = (pos_bl - wd*(pos_bl/wd))/u_step; lowp float b0 = float(pos_l == 0) * float(pos_bl <= int(u_value_a*v_dim.x)); lowp float b1 = float(pos_l == 1) * float(pos_bl >= int((1.0-u_value_b)*v_dim.x)); lowp float b2 = clamp(float(pos_l == 2) + 1.0-(b0+b1), 0.0, 1.0); highp float p = abs(2.0*(v_position.w - 0.5)); highp float out_p = (1.0 - 0.25*p); lowp float i = float(int(v_position.y) > hstep) * float(int(v_position.y) < h - hstep); lowp float o = (1.0-i)*float(pos_br >= h) * float(pos_bl <=w); lowp float a = i*float(pos_br >= h+u_step) * float(pos_bl <=w - u_step); lowp float b = i*float(pos_br < h+u_step) * float(pos_br >= h); lowp float c = i*float(pos_bl > w - u_step) * float(pos_bl <= w); highp float pr = (1.0 - p)*a; gl_FragColor = vec4( u_pallete[0]*pr*b0 + u_pallete[1]*pr*b1 + u_pallete[2]*pr*b2 + u_pallete[0]*out_p * b + u_pallete[1]*out_p * c + mix(u_pallete[0], u_pallete[1], v_position.z)*out_p*o, clamp(a+b+c+o, 0.0, 1.0)*u_color.a); }
ãŸããããŸããŸãªAndroidããã€ã¹ãšãã®ã°ã©ãã£ãã¯ã¢ã¯ã»ã©ã¬ãŒã¿ã«ã€ããŠãè¿°ã¹ãããšæããŸãã ç§ã¯åé¡ã«ééããŸããïŒ
- ã·ã§ãŒããŒã³ãŒãã¯1ã€ã®ããã€ã¹ã§åé¡ãªãã³ã³ãã€ã«ãããå¥ã®ããã€ã¹ã§ãšã©ãŒãçºçããŸã
- ã·ã§ãŒããŒã¯æ£åžžã«ã³ã³ãã€ã«ãããŸãããäžéšã®ããã€ã¹ã§ã¯æ£ããæ©èœããŸããã ããšãã°ãPowerVRã§ã¯ãããŒã«ã«å€æ°ããŠããã©ãŒã ãŸãã¯å±æ§ãšåãããã«åŒã³åºãããå Žåãããã¯ãšã©ãŒã«ã¯ãªããŸããããã·ã§ãŒããŒèªäœã¯æ£ããåäœããªããªããŸã
- äžéšã®ããã€ã¹ã§ã¯ãå€æ°ãŸãã¯é¢æ°ãçµã¿èŸŒã¿é¢æ°ãšåãããã«åŒã³åºããããšãšã©ãŒãçºçããŸãã ããšãã°ãå¯å€ããã¯ã¹ãŸãã¯ã¯ã©ã³ã
- äžéšã®ããã€ã¹ã§ãããŒãã®ç²ŸåºŠã«åé¡ããããŸãã
ãã®ãã¹ãŠã®çµæ-ã¢ãã€ã«ã²ãŒã ã§ã·ã§ãŒããŒã䜿çšããå Žåã¯ãã°ã©ãã£ãã¯ã¢ã¯ã»ã©ã¬ãŒã¿ãŒã®æãäžè¬çãªã¢ãã«ã§ãããããã¹ãããŠãã ããã ã·ã§ãŒããŒãã³ã³ãã€ã«ãããŠã³ã³ãã¥ãŒã¿ãŒã§åäœããå Žåãããã¯é£äººã®æºåž¯é»è©±ã§åäœãããšããæå³ã§ã¯ãããŸããã æ°ããVulkan APIã¯ãããŸããŸãªã·ã§ãŒããŒã³ã³ãã€ã©ã®åé¡ã解決ãããã®ã¯ã¬ã€ãžãŒãªäžçã«ç§©åºãããããã¯ãã§ãããããã¯æªæ¥ã®ããžãã¹ã§ãããä»æ¥ãç§ãã¡ã¯æã£ãŠããŸãã
é³
æ€çŽ¢ãã
é³ã¯äžè¬çã«å¥ã®æã§ãã èªåã§é²é³ããããšãã§ããŸãããããã¯ããªãé¢åã§ãéåžžã®ãã€ã¯ãšèŽèŠãå¿ èŠã§ãïŒç§ãã¡ã®å Žåã§ã¯ãããŸããïŒã ãŸããã€ã³ã¿ãŒãããäžã§ç®çã®ãµãŠã³ããèŠã€ããããšãã§ããŸãã
Creative Commons 0ã©ã€ã»ã³ã¹ã§ãµãŠã³ããæ€çŽ¢ããŠãæ°ååããå¯èœæ§ã®ããåãµãŠã³ãã®äœæè ã瀺ããªãããšãæãŸããã§ãã éåžžã®ç¡æã®ãµãŠã³ããèŠã€ããã®ã¯ããªãé£ããããã«æãããããããŸããããããã§ãã åé¡ã¯ãããããå°æ°ã§ãããšããããšã§ã¯ãªããããã©ãããããããã®å€ããããããã®ã»ãšãã©ãæãããããšã§ãã ãµãŠã³ãæ€çŽ¢ã¯ãå€ãã®ãµãŠã³ããèããŠãæé©ãªãµãŠã³ããéžæããå¿ èŠãããããã»ã¹ã§ãã
æ段
Qtã«ã¯ããµãŠã³ããåºåããããã®QSound ã QSoundEffect ã QAudioOutputãããã³QMediaPlayerã¯ã©ã¹ããããŸãã æåã®ããŒãžã§ã³ã§ã¯ãQSoundEffectã䜿çšããŠãšãã§ã¯ããåºåããQMediaPlayerã䜿çšããŠãµãŠã³ããåºåããŸããã ããããçµå±ã®ãšããããããã¯ãã¹ãŠé©åããŠããŸããã
QMediaPlayerã®ã¿ãå§çž®ãªãŒãã£ãªãã¡ã€ã«ãåŠçã§ããŸããããã®ã¯ã©ã¹ãããæ£ç¢ºã«ã¯ãAndroidã§ã®å®è£ ã«ã¯ããã€ãã®äžå¿«ãªç¬éããããŸãã
- é³ã®å§ãŸãã§ããªãŒãºããŸãã é³æ¥œãã«ãŒãç¶æ ã§åçãããå Žåãç¹°ãè¿ããããšãã¢ããªã±ãŒã·ã§ã³å šäœã«é¡èãªé 延ãçããŸãã
- ãªãœãŒã¹ããã¡ãã£ã¢ãã¡ã€ã«ãèªã¿åããšãã¢ããªã±ãŒã·ã§ã³ããŒã¿ãã©ã«ããŒã«äžæãã¡ã€ã«ãäœæãããããèªäœãåé€ããããšã¯éããªããããã¢ããªã±ãŒã·ã§ã³ã®ãµã€ãºã倧ãããªããŸãã ããã¯å¶ç¶ã«çºèŠãããã®ã§ãã
QSoundããã³QSoundEffectã¯ãéå§çž®ã®wavãã¡ã€ã«ã§ã®ã¿æ©èœããŸãã QSoundEffectã¯é 延ãªãã§ãµãŠã³ããåºåããããã«èšèšãããŠããããµãŠã³ãèªäœãã«ãŒããããããšãã§ããŸãããAndroidã§äœ¿çšããå ŽåããAUDIO_OUTPUT_FLAG_FAST denied by clientããšããã¡ãã»ãŒãžããã°ãã°ãã°ã«è¡šç€ºãããŸãã ããã¯ãããã€ã¹ããšã«ç°ãªãäžæ£ãªãµã³ããªã³ã°ã¬ãŒããåå ã§ãã äžéšã®ããã€ã¹ã¯44KHzã飲ã¿èŸŒã¿ãäžéšã®ããã€ã¹ã¯48KHzãå¿ èŠãšãããªããžã§ã¯ãèªäœã¯wavãã¡ã€ã«ã«èšé²ãããŠãããšããã«ãµãŠã³ããéä¿¡ããŸãã ãµãŠã³ããªãœãŒã¹ã®ãµã€ãºã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãµã€ãºã®ããªãã®å²åã§ããã
ããããã¹ãŠã®æ¬ ç¹ã¯ãã²ãŒã ã«ãµãŠã³ããè¿œå ããåŸããµãŠã³ããšé³æ¥œãåçãããšãã«å ·äœçãªFPSã®æ²äžãçŸãããšããäºå®ã«ã€ãªãããŸããã
解決çã¯ããããã®ã¯ã©ã¹ãæŸæ£ãããµãŠã³ãã«SFMLã©ã€ãã©ãªã䜿çšããããšã§ããã SDLã«äŒŒãéåžžã«ã·ã³ãã«ã§è»œéãªã©ã€ãã©ãªã ã°ã©ãã£ãã¯ã¹ããµãŠã³ããå ¥åããã€ã¹ãæäœããããã®äŸ¿å©ãªã¯ã©ã¹ã ãã®ã©ã€ãã©ãªã¯ãmp3ïŒã©ã€ã»ã³ã¹ããã¹ãŠã®ãã®ïŒã®æäœæ¹æ³ãç¥ããŸãããããã以äžã®ããšãè¡ããŸãã ãšãã§ã¯ããšé³æ¥œã«ã¯ogg圢åŒã䜿çšããŸããã
é³å£°åºå
ãµãŠã³ãããªãã·ã§ã³ã®ã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšããã«ã¯ãQtãã€ãã£ãã¯ã©ã¹ãé©ããŠããŸãã ã²ãŒã éçºçš-ãŸã£ãããããŸããã SFMLããã䜿ããããç°¡åã«ã
ã¢ããªå åºå
åºåã«ã¯ãQt- QtAdMobçšã®æ¢è£œã®AdMobå®è£ ã䜿çšããŸããã
æåã¯ã1ã€ã®å°ããªãããŒã®ã¿ãã¡ãã¥ãŒã«è¿œå ãããŸããããåŸã«ç»é¢éåºåã圢æãããŸããã
ç»é¢éåºåãèªã¿èŸŒãŸããç¶æ ã§ãã£ãŠããå°ãé ããŠè¡šç€ºãããã®ã¯èå³æ·±ãããšã§ãã ã€ãŸããåºåã衚瀺ããããšãã«ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ããããã¯ããåºåãéããããåŸã«å埩ããå¿ èŠããããŸããã åæã«ãã©ã€ãã©ãªã§ã¯ãåºåã衚瀺ãããŠéããããç¬éããã£ããã§ããŸããã§ããã ãã®ã©ã€ãã©ãªæ©èœãAndroidã®ããŒãžã§ã³ã«è¿œå ããŸããã iosã®ããŒãžã§ã³ã¯ãåäœã確èªããæ©èœããªãããããŸã 觊ããããŠããŸããã
åæãšçµ±èš
PlayããŒã±ããã«æåã®ããŒãžã§ã³ãæçš¿ããããšã§ãéçºè ã®ã³ââã³ãœãŒã«ã«çµ±èšæ å ±ã衚瀺ãããããšãæã¿ãŸããã ããããå€æããããã«ãã¢ã¯ãã£ããŠãŒã¶ãŒã®çµ±èšã¯Googleã¢ããªãã£ã¯ã¹ã«é¢é£ä»ããããŠãããã¢ããªã±ãŒã·ã§ã³ã§ã¢ãã©ã€ã¶ãŒãã©ãã«ãŒããªã³ã«ãããŸã§æ©èœããŸããã ãŸããå©çšå¯èœãªçµ±èšã«ã¯1æ¥ä»¥äžã®é 延ãããã倪平æŽæéã«åŸã£ãŠèšç®ãããŸãã ãã®ç¶æ³ã§ã¯ãããªãã®è¡åãããŠã³ããŒãã«ã©ã®ããã«åœ±é¿ããããç解ããããšã¯ã§ããŸããã ãããã£ãŠãQtAdMobã®ã¢ã¯ãã£ããã£ã¯ã©ã¹ãè¿œå ããŸãããããã¯ãåæåæåé¢æ°ãšã²ãŒã ã€ãã³ãéä¿¡é¢æ°ã«ãã£ãŠQtActivityããç¶æ¿ãããŸãã ã³ãŒãã®äŸãæããŸããããªããªãã ãã¹ãŠãããã¥ã¡ã³ãã«çŸããèšèŒãããŠããŸãã
ã€ãã³ãã§ã¯ãã€ã³ã¿ãŒãã§ã€ã¹äžã®ãã¹ãŠã®ãã¿ã³ãæŒããããã²ãŒã ã®ç¶æ³ãçºçãããããã¬ãã«ã®ãããã£ã©ã¯ã¿ãŒãéãããããã¯è§£é€ãããããŸããã
ããããã¹ãŠã®çµ±èšãåéãããããã§ãç§ã¯ã©ãããããã«åº§ã£ãŠããã©ãžã«ã§èª°ããã²ãŒã ãéå§ããæåã®ããã·ã§ã³ãå®äºã§ãããããããã²ãŒã ãåé€ãããã©ããããªã¢ã«ã¿ã€ã ã§èŠãããšãã§ããŸãã
ãŸããçµ±èšã«ãããšãç§ãã¡ã¯çŸåšãã²ãŒã ã®ãã£ã³ããªã³ã§ãã
Google Playã«ã€ããŠ
éçºè ã³ã³ãœãŒã«èªäœã¯éåžžã«äŸ¿å©ãªããŒã«ã§ãããçµ±èšãšåºåã®æ©èœã¯ä»ã®ã¢ã«ãŠã³ãã«é¢é£ä»ããããŠããŸãã
èªåã§ã¢ããªã±ãŒã·ã§ã³ãå®å šã«éçºããã«ã¯ãå°ãªããšãAdWordsãAdSenseãAdMobãGoogle Analyticsã¢ã«ãŠã³ããå¿ èŠã§ãã ãã®å Žåãæ¥ç¶ã¯ãããã®éã§ç¢ºç«ãããŸãã ãããã®ã¢ã«ãŠã³ãã¯ãã¹ãŠåå¥ã®GoogleãµãŒãã¹ã§ãããããŸããŸãªæè¡ãµããŒããšèšå®ããããŸãã ãŸããAdMobã¢ã«ãŠã³ãã«ã¯AdWordsãšAdSenseã¢ã«ãŠã³ããå¿ èŠã§ãã ãã ããããããã¹ãŠã®ã¢ã«ãŠã³ãã¯ã1ã€ã®ã³ããŒã§ã¡ã€ã³ã®Gmailã¢ã«ãŠã³ãã«ãªã³ã¯ã§ããŸãã ããããå®è·µã瀺ããŠããããã«ããããµãŒãã¹ãéããšãå¥ã®ãµãŒãã¹ã3çªç®ã®ãµãŒãã¹ãªã©ã«æ°ããã¢ã«ãŠã³ããäœæããããã«æäŸããããããæåãããã®ãã¹ãŠã«æ··ä¹±ããå¯èœæ§ããããŸãã
ã©ãããããããéæ³ã®ããã«ãæè¡ãµããŒãæ åœè ã¯äœãèµ·ãã£ãã®ã説æã§ããã2ã€ã®AdWordsã¢ã«ãŠã³ããäœæããŠ1ã€ã®ã¡ãŒã«ã«ãªã³ã¯ããäžæ¹1ã€ã®ã¢ã«ãŠã³ããéçºè ã®ã³ââã³ãœãŒã«ã«ããã1ã€ã®ã¢ã«ãŠã³ããAdMobã«ãªã³ã¯ããŸããïŒããã«ã€ããŠã¯ç¥ããŸããã§ããïŒã
åºåãã£ã³ããŒã³ããã§ãã¯ããããã«1ã€ã®ã¢ã«ãŠã³ãã«500rãæããŸããã ããã«å¯ŸåŠããããã«ããã¯ãã«ã«ãµããŒãã®ãã³ãã«åŸã£ãŠãã¢ã«ãŠã³ãã®1ã€ããå·Šãã®ã¡ãŒã«ã«è»¢éããã¢ã¯ã»ã¹ãéããŸããã ããã¯ãã¹ãŠãæåã«ç§ã®ã¡ãŒã«ããäž¡æ¹ã®ã¢ã«ãŠã³ããæäœã§ããªããªãããã®åŸãèªåã®åæãšæ¥ç¶ãç¹°ãè¿ããŠãããã©ãŒãã³ã¹ãæ»ããŸããã ããããçµå±ã®ãšãããAdMobã¯æ©èœããªããªããŸããã AdMobã¯500rãããéèŠã ã£ãã®ã§ãAdMobãæ©èœããããã«ãã¹ãŠã«ã¢ã¯ã»ã¹ã§ããªããªãããšãç¥ããªããããã®æé å šäœãæ°ãã«å®è¡ããå¿ èŠããããŸããã ãããŠããã¡ããããããã®500rã¯æ¥ç¶ãããŠããªãã¢ã«ãŠã³ãã«ãã³ã°ã¢ãããããŸãŸã«ãªããŸããã
ãããã£ãŠãããã«ã¯æ³šæããŠãã ããã
翻蚳
ã²ãŒã ã§
ã²ãŒã ã¡ãã¥ãŒããã·ã¢èªãšè±èªã®2ã€ã®èšèªã«ç¿»èš³ããŸããã ã²ãŒã èšèªã®éžæã¯ãã·ã¹ãã ãã±ãŒã«ã«ãã£ãŠå®è¡ãããŸãã ã·ã¹ãã ããã·ã¢èªã§ããå Žåãã²ãŒã ã¯ãã·ã¢èªã§ããã®ä»ã®å Žåã¯ãã¹ãŠè±èªã§è¡ãããŸãã
Qtã®ããã¹ãæ å ±ã翻蚳ããããã«ãã¯ã©ã¹ã«ãã£ãŠå®è¡ãããçµã¿èŸŒã¿ã®ã¡ã«ããºã ããããŸã
QTranslator myTranslator; myTranslator.load(":/translations/neverfall_" + QLocale::system().name()); a.installTranslator(&myTranslator);
翻蚳ãå¿ èŠãªãã¹ãŠã®è¡ã¯QObject :: trïŒïŒé¢æ°ã«æž¡ãããŸããQObjectã®åå«ã§ã¯ãªãã¯ã©ã¹ã®å ŽåãQApplication :: translateé¢æ°ã䜿çšã§ããŸããé åã§å®£èšãããæååã«ã¯ãã¯ãQT_TRANSLATE_NOOPãQT_TR_NOOPã䜿çšã§ããŸãã
ããããããã¯æŠãã®ååã«éããŸããã 翻蚳èªäœãäœæããå¿ èŠããããŸããããã¯ãlupdateããã³lreleaseããã°ã©ã ã«ãã£ãŠè¡ãããŸãã 1ã€ç®ã¯ããããã®é¢æ°ãšãã¯ããå«ããœãŒã¹ã³ãŒãããæ å ±ãåéãã翻蚳çšã®æ å ±ãå«ãXmlãã¡ã€ã«ãäœæããŸãã
2çªç®ã¯ãxmlãã¡ã€ã«ããqmãã€ããªãã¡ã€ã«ãåéããŸãããã®ãã¡ã€ã«ã¯QTranslatorã«çŽæ¥ããŒããããŸã ã
翻蚳å¯èœãªæååãšããŠã¿ã°ã®ãããªãã®ã䜿çšãããããè±èªãšãã·ã¢èªã«ç¿»èš³ããŸããã ããšãã°ããïŒGameOverTextãã¯ãã²ãŒã ãªãŒããŒãã«å€æãããŸãã ããã¯ããœãŒã¹ã³ãŒããå€æŽããããå¥ã®äœããæžãããããã¹ãŠã®ç¿»èš³ãå€æŽãããããå¿ èŠããªãããã«äœæãããããã§ãã lupdateã®å Žåãããã¯å¥ã®è¡ã§ãã
åžå Žã§
Google Playã§ã¯ãæãç°¡åãªæ¹æ³ã§ããã¹ãããã·ã¢èªã§äœæããGoogle翻蚳è ã«æããããè±èªã«ç¿»èš³ããä¿®æ£ããŸããã ãããŠãåãGoogle翻蚳è ãè±èªã®ããã¹ããæãäžè¬çãªèšèªã«ç¿»èš³ããŸããã 説æã®å€åœ¢ã®1ã€ã«ãé ã§ãã³ãžã§ã³ã«çªå ¥ããšãããã¬ãŒãºãå«ãŸããŠããŠããã®äžåœèªã®ãã¹ãŠã®ç¿»èš³ãçµãŠããé ã®äžã®æŽçªã«é£ã³èŸŒããããšãæå³ããŠããã®ã¯é¢çœãã§ãã AliExperseã§çç ããããã®ã§ãåãæ®ãããªãããã§ãã
çµè«ãšèšç»
çµæãããª
çµè«ãšããŠããã®ã²ãŒã ã®éçºããã»ã¹ã¯ãã€ãŠæãèå³æ·±ãã¢ã¯ãã£ããã£ã®1ã€ã§ããã倧ããªåã³ãšçµéšãããããããšèšããããšæããŸãã éçºã¯ãä»å¹Žã®8æãããä»äºã®åŸãšå€éã«ãèªç±ãªæéã«è¡ãããŸããã ãéã¯éçºè ã®ã¢ã«ãŠã³ãã«ã®ã¿è²»ããããæ°åãã«ã¯åºåã«è²»ããããããããã®ã²ãŒã ãç§ãã¡ã«äœããããããªããšããŠããç§ã¯åæºããŸããã
å°æ¥ã®èšç»ã¯ã人ã ãç§ãã¡ã®åµé ã«ã©ã®ããã«å¯Ÿå¿ãããã«ãã£ãŠç°ãªããŸãã ã¬ãã¥ãŒããå€æãããšãããªãè¯ãã®ã§ãããããŠã³ããŒããšåé€ããå€æãããšãç§ã¯ããŒãã®åŸãã§æãè¿ã家åºçšååºã«è¡ãããã§ãã ã²ãŒã ã¯ããããããªãè€éã§ãåºåãæããã«äžè¶³ããŠãã
ã²ãŒã ãiOSã«ç§»è¡ããäºå®ã§ãããããã¯Appleãã¯ãããžãŒã®æ¬ åŠãšå¹Žé100ãã«ããããŠElven Objective Cã§ã®ã³ãã¥ãã±ãŒã·ã§ã³ã®èŠéãã«ãã£ãŠåŠšããããŠããŸãã
ãããç§ãã¡ã®æåŸã®ã²ãŒã ã§ã¯ãªããåŸãããçµéšãèæ ®ããŠãå®è£ ããããšããå€ãã®æ°ããã¢ã€ãã¢ãããããšãé¡ã£ãŠããŸãã ãã®ã²ãŒã -æåã®ãã³ã±ãŒãã¯ããŽããŽããããã®ãã©ããã«ããããã-ç§ãå€æãããã®ã§ã¯ãããŸããã
æ¢è£œã®ãšã³ãžã³ã䜿çšããŠãããããç°¡åãã€è¿ éã«è¡ãããšãã§ãããã¶ã€ããŒãåºç瀟ãåŒãä»ããããšãã§ãããšããäºå®ã«ã€ããŠã®ã³ã¡ã³ããæåŸ ããŠããŸãã ãžã§ãã€ã®éçºè ãã¡ãæåããæåŸãŸã§èªåãã¡ã§è¡ããããšæã£ãã®ã§ãç§ã¯ããã«çããŸãã