• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision292 (tree)
Zeit2022-03-12 17:11:50
Autorxops-mikan

Log Message

各クラスにおけるメンバー変数の初期化処理を追加、算術関数をfloat型へ変更、当たり判定関数の仕様修正

Ändern Zusammenfassung

Diff

--- trunk/ai.cpp (revision 291)
+++ trunk/ai.cpp (revision 292)
@@ -38,12 +38,20 @@
3838 ctrlid = in_ctrlid;
3939 if( in_ObjMgr != NULL ){ ctrlhuman = in_ObjMgr->GetHumanObject(in_ctrlid); }
4040 else{ ctrlhuman = NULL; }
41+ enemyhuman = NULL;
4142 blocks = in_blocks;
4243 Param = in_Param;
4344 CollD = in_CollD;
4445 GameSound = in_GameSound;
4546
47+ AIlevel = 0;
4648 battlemode = AI_NORMAL;
49+ NoFight = false;
50+ posx = 0.0f;
51+ posy = 0.0f;
52+ posz = 0.0f;
53+ rx = 0.0f;
54+ ry = 0.0f;
4755 cautionback_posx = 0.0f;
4856 cautionback_posz = 0.0f;
4957 FaceCaution_flag = false;
@@ -52,7 +60,10 @@
5260 waitcnt = 0;
5361 movejumpcnt = 1*((int)GAMEFPS);
5462 gotocnt = 0;
63+ cautioncnt = 0;
64+ actioncnt = 0;
5565 longattack = false;
66+ LevelParam = NULL;
5667
5768 MoveNavi = new AIMoveNavi;
5869 ObjDriver = new AIObjectDriver;
@@ -304,8 +315,8 @@
304315
305316 if( GetRand(2) == 0 ){
306317 //前方向のベクトルを計算
307- vx = cos(rx*-1 + (float)M_PI/2);
308- vz = sin(rx*-1 + (float)M_PI/2);
318+ vx = cosf(rx*-1 + (float)M_PI/2);
319+ vz = sinf(rx*-1 + (float)M_PI/2);
309320 if(
310321 (CollD->CheckALLBlockIntersectDummyRay(posx, posy + HUMAN_MAPCOLLISION_HEIGHT, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == true)|| //腰の高さにブロックがある(ぶつかる)
311322 (CollD->CheckALLBlockIntersectDummyRay(posx, posy - 1.0f, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == false) //足元にブロックがない(落ちる)
@@ -316,8 +327,8 @@
316327 }
317328
318329 //後方向のベクトルを計算
319- vx = cos(rx*-1 + (float)M_PI/2 + (float)M_PI);
320- vz = sin(rx*-1 + (float)M_PI/2 + (float)M_PI);
330+ vx = cosf(rx*-1 + (float)M_PI/2 + (float)M_PI);
331+ vz = sinf(rx*-1 + (float)M_PI/2 + (float)M_PI);
321332 if(
322333 (CollD->CheckALLBlockIntersectDummyRay(posx, posy + HUMAN_MAPCOLLISION_HEIGHT, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == true)|| //腰の高さにブロックがある(ぶつかる)
323334 (CollD->CheckALLBlockIntersectDummyRay(posx, posy - 1.0f, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == false) //足元にブロックがない(落ちる)
@@ -329,8 +340,8 @@
329340 }
330341 else{
331342 //
332- vx = cos(rx*-1);
333- vz = sin(rx*-1);
343+ vx = cosf(rx*-1);
344+ vz = sinf(rx*-1);
334345 if(
335346 (CollD->CheckALLBlockIntersectDummyRay(posx, posy + HUMAN_MAPCOLLISION_HEIGHT, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == true)|| //腰の高さにブロックがある(ぶつかる)
336347 (CollD->CheckALLBlockIntersectDummyRay(posx, posy - 1.0f, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == false) //足元にブロックがない(落ちる)
@@ -340,8 +351,8 @@
340351 ObjDriver->SetModeFlag(AI_CTRL_MOVELEFT);
341352 }
342353
343- vx = cos(rx*-1 + (float)M_PI);
344- vz = sin(rx*-1 + (float)M_PI);
354+ vx = cosf(rx*-1 + (float)M_PI);
355+ vz = sinf(rx*-1 + (float)M_PI);
345356 if(
346357 (CollD->CheckALLBlockIntersectDummyRay(posx, posy + HUMAN_MAPCOLLISION_HEIGHT, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == true)|| //腰の高さにブロックがある(ぶつかる)
347358 (CollD->CheckALLBlockIntersectDummyRay(posx, posy - 1.0f, posz, vx, 0, vz, NULL, NULL, &Dist, HUMAN_MAPCOLLISION_R) == false) //足元にブロックがない(落ちる)
@@ -502,9 +513,9 @@
502513 float new_posx, new_posy, new_posz;
503514
504515 //腰付近の当たり判定
505- new_posx = posx + cos(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
516+ new_posx = posx + cosf(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
506517 new_posy = posy + HUMAN_MAPCOLLISION_HEIGHT;
507- new_posz = posz + sin(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
518+ new_posz = posz + sinf(rx*-1 + (float)M_PI/2) * (AI_CHECKJUMP_DIST + HUMAN_MAPCOLLISION_R);
508519 if( CollD->CheckALLBlockInside(new_posx, new_posy, new_posz) == true ){
509520 ObjMgr->MoveJump(ctrlid);
510521 return true;
@@ -511,9 +522,9 @@
511522 }
512523
513524 //体全体の当たり判定
514- new_posx = posx + cos(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
525+ new_posx = posx + cosf(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
515526 new_posy = posy + AI_CHECKJUMP_HEIGHT;
516- new_posz = posz + sin(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
527+ new_posz = posz + sinf(rx*-1 + (float)M_PI/2) * AI_CHECKJUMP_DIST;
517528 if( CollD->CheckALLBlockInside(new_posx, new_posy, new_posz) == true ){
518529 ObjMgr->MoveJump(ctrlid);
519530 return true;
@@ -570,7 +581,7 @@
570581 else{ scale = 0.4f; }
571582
572583 //距離に応じて高さを変える
573- ty += (sqrt(r) - 200.0f) * scale;
584+ ty += (sqrtf(r) - 200.0f) * scale;
574585 }
575586 }
576587 else{
@@ -583,7 +594,7 @@
583594 float z = posz - tz;
584595 float r = x * x + z * z;
585596
586- scale = sqrt(r) * 0.12f;
597+ scale = sqrtf(r) * 0.12f;
587598 }
588599
589600 //敵の移動を見超す
@@ -696,7 +707,7 @@
696707 float z = posz - tz;
697708
698709 //捕まえる (敵を引き付ける)
699- EnemyHuman->AddPosOrder(atan2(z, x), 0.0f, 0.5f);
710+ EnemyHuman->AddPosOrder(atan2f(z, x), 0.0f, 0.5f);
700711
701712 //敵の視点をランダムに動かす
702713 float erx, ery;
@@ -762,7 +773,7 @@
762773 }
763774
764775 //敵を捉えていれば
765- float atanxy = fabs(atanx) + fabs(atany);
776+ float atanxy = fabsf(atanx) + fabsf(atany);
766777 if( atanxy < ShotAngle ){
767778 int rand = LevelParam->attack;
768779 if( longattack == true ){ rand += 1; }
@@ -1374,7 +1385,7 @@
13741385 if( (fabs(mrx) < search_rx/2)&&(fabs(mry) < search_ry/2) ){
13751386 float vx, vy, vz;
13761387
1377- Dist = sqrt(Dist2);
1388+ Dist = sqrtf(Dist2);
13781389
13791390 //ベクトルを取得
13801391 vx = (tx - posx)/Dist;
--- trunk/collision.cpp (revision 291)
+++ trunk/collision.cpp (revision 292)
@@ -95,17 +95,17 @@
9595 x = data.x[j] - cx;
9696 y = data.y[j] - cy;
9797 z = data.z[j] - cz;
98- rx = atan2(z, x);
99- ry = atan2(y, sqrt(x*x + z*z));
100- r = sqrt(x*x + y*y + z*z);
98+ rx = atan2f(z, x);
99+ ry = atan2f(y, sqrtf(x*x + z*z));
100+ r = sqrtf(x*x + y*y + z*z);
101101
102102 //大きくする
103103 r += COLLISION_ADDSIZE;
104104
105105 //座標を再計算
106- cbdata[i].x[j] = cx + cos(rx) * cos(ry) * r;
107- cbdata[i].y[j] = cy + sin(ry) * r;
108- cbdata[i].z[j] = cz + sin(rx) * cos(ry) * r;
106+ cbdata[i].x[j] = cx + cosf(rx) * cosf(ry) * r;
107+ cbdata[i].y[j] = cy + sinf(ry) * r;
108+ cbdata[i].z[j] = cz + sinf(rx) * cosf(ry) * r;
109109 }
110110 }
111111
@@ -285,8 +285,8 @@
285285 blockdata->Getdata(&bdata, id);
286286
287287 //ベクトル算出
288- vx = cos(rx);
289- vz = sin(rx);
288+ vx = cosf(rx);
289+ vz = sinf(rx);
290290
291291 //内積
292292 d = bdata.material[face].vx*vx + bdata.material[face].vz*vz;
@@ -864,7 +864,7 @@
864864 struct blockdata bdata;
865865 blockdata->Getdata(&bdata, id);
866866
867- float maxDist = sqrt(in_vx*in_vx + in_vy*in_vy + in_vz*in_vz);
867+ float maxDist = sqrtf(in_vx*in_vx + in_vy*in_vy + in_vz*in_vz);
868868 if( maxDist == 0.0f ){ return false; }
869869
870870 //内積
@@ -871,7 +871,7 @@
871871 float Dot = in_vx/maxDist * bdata.material[face].vx + in_vy/maxDist * bdata.material[face].vy + in_vz/maxDist * bdata.material[face].vz;
872872
873873 //角度を求める
874- *out_angle = asin(Dot) * -1;
874+ *out_angle = asinf(Dot) * -1;
875875
876876 return true;
877877 }
@@ -901,7 +901,7 @@
901901 if( out_vz != NULL ){ *out_vz = in_vz - Dot * bdata.material[face].vz; }
902902
903903 //角度を求める
904- if( out_angle != NULL ){ *out_angle = asin(Dot) * -1; }
904+ if( out_angle != NULL ){ *out_angle = asinf(Dot) * -1; }
905905 //if( out_angle != NULL ){ *out_angle = Dot * -1; }
906906
907907 return true;
@@ -968,8 +968,8 @@
968968 float caser = x*x + z*z;
969969 float minr = (c1_r+c2_r) * (c1_r+c2_r);
970970 if( caser < minr ){
971- if( angle != NULL ){ *angle = atan2(z, x); }
972- if( length != NULL ){ *length = sqrt(minr) - sqrt(caser); }
971+ if( angle != NULL ){ *angle = atan2f(z, x); }
972+ if( length != NULL ){ *length = sqrtf(minr) - sqrtf(caser); }
973973 return true;
974974 }
975975 }
@@ -1061,7 +1061,7 @@
10611061 x = s_x - RayPos_x;
10621062 y = s_y - RayPos_y;
10631063 z = s_z - RayPos_z;
1064- d = sqrt(x*x + y*y + z*z);
1064+ d = sqrtf(x*x + y*y + z*z);
10651065
10661066 //レイ始点が半径より近い(=めり込んでいる)
10671067 if( d < s_r ){
@@ -1073,8 +1073,8 @@
10731073 MinDist = DistancePosRay(s_x, s_y, s_z, RayPos_x, RayPos_y, RayPos_z, RayDir_x, RayDir_y, RayDir_z);
10741074
10751075 if( MinDist <= s_r ){
1076- RayDist = sqrt(d*d - MinDist*MinDist); //(レイ始点から)点に最も近づく距離
1077- RDist = sqrt(s_r*s_r - MinDist*MinDist); //(点半径から)点に最も近づく距離
1076+ RayDist = sqrtf(d*d - MinDist*MinDist); //(レイ始点から)点に最も近づく距離
1077+ RDist = sqrtf(s_r*s_r - MinDist*MinDist); //(点半径から)点に最も近づく距離
10781078
10791079 *Dist = RayDist - RDist; //レイ視点最短 - 半径最短 = レイ視点から半径までの最短
10801080
@@ -1288,7 +1288,7 @@
12881288 //点とレイ始点の距離
12891289 x = c_x - RayPos_x;
12901290 z = c_z - RayPos_z;
1291- d = sqrt(x*x + z*z);
1291+ d = sqrtf(x*x + z*z);
12921292
12931293 //点(円柱の中心)とレイの最短距離を求める
12941294 cMinDist = DistancePosRay(c_x, 0.0f, c_z, RayPos_x, 0.0f, RayPos_z, RayDir_x, 0.0f, RayDir_z);
@@ -1298,8 +1298,8 @@
12981298 return false;
12991299 }
13001300
1301- cRayDist = sqrt(d*d - cMinDist*cMinDist); //(レイ始点から)点に最も近づく距離
1302- cRDist = sqrt(c_r*c_r - cMinDist*cMinDist); //(点半径から)点に最も近づく距離
1301+ cRayDist = sqrtf(d*d - cMinDist*cMinDist); //(レイ始点から)点に最も近づく距離
1302+ cRDist = sqrtf(c_r*c_r - cMinDist*cMinDist); //(点半径から)点に最も近づく距離
13031303
13041304 if( d < c_r ){
13051305 RayXZ_min = 0; //始点が円の中なら距離ゼロ
@@ -1311,7 +1311,7 @@
13111311 //点とレイ終点の距離
13121312 x = c_x - RayPos_x + RayDir_x*maxDist;
13131313 z = c_z - RayPos_z + RayDir_x*maxDist;
1314- d = sqrt(x*x + z*z);
1314+ d = sqrtf(x*x + z*z);
13151315
13161316 if( d < c_r ){
13171317 RayXZ_max = maxDist; //終点が円の中なら最大距離
@@ -1321,9 +1321,9 @@
13211321 }
13221322
13231323 //Y軸と比べる前に、Y軸と比較できるよう変換 (底辺の値を斜辺へ変換)
1324- float Ray_ry = atan2(RayDir_y, sqrt(RayDir_x*RayDir_x + RayDir_z*RayDir_z));
1325- Ray_min[0] = RayXZ_min / cos(Ray_ry);
1326- Ray_max[0] = RayXZ_max / cos(Ray_ry);
1324+ float Ray_ry = atan2f(RayDir_y, sqrtf(RayDir_x*RayDir_x + RayDir_z*RayDir_z));
1325+ Ray_min[0] = RayXZ_min / cosf(Ray_ry);
1326+ Ray_max[0] = RayXZ_max / cosf(Ray_ry);
13271327
13281328
13291329 //Y軸のみAABBと同様の処理
@@ -1414,7 +1414,7 @@
14141414
14151415 //レイのベクトルが逆方向なら
14161416 if( Dot < 0.0f ){
1417- return sqrt(x1*x1 + y1*y1 + z1*z1);
1417+ return sqrtf(x1*x1 + y1*y1 + z1*z1);
14181418 }
14191419
14201420 //外積
@@ -1422,7 +1422,7 @@
14221422 y3 = z1 * x2 - x1 * z2;
14231423 z3 = x1 * y2 - y1 * x2;
14241424
1425- return sqrt(x3*x3 + y3*y3 + z3*z3) / sqrt(RayDir_x*RayDir_x + RayDir_y*RayDir_y + RayDir_z*RayDir_z);
1425+ return sqrtf(x3*x3 + y3*y3 + z3*z3) / sqrtf(RayDir_x*RayDir_x + RayDir_y*RayDir_y + RayDir_z*RayDir_z);
14261426 }
14271427
14281428 //! @brief 線分と線分の当たり判定(2D)
@@ -1486,7 +1486,7 @@
14861486 bool Get2DLineInBox(int line_x1, int line_y1, int line_x2, int line_y2, int box_x1, int box_y1, int box_x2, int box_y2, int *out_line_x1, int *out_line_y1, int *out_line_x2, int *out_line_y2)
14871487 {
14881488 //四角形指定が異常
1489- if( (box_x1 >= box_x2)||(box_x1 >= box_x2) ){ return false; }
1489+ if( (box_x1 >= box_x2)||(box_y1 >= box_y2) ){ return false; }
14901490
14911491 //上下左右の空間にあるなら、的外れ
14921492 if( (line_x1 < box_x1)&&(line_x2 < box_x1) ){ return false; }
@@ -1584,7 +1584,7 @@
15841584 //! @param out_ry 対象点への垂直角度を受け取るポインタ(NULL可)
15851585 //! @param out_dist2 対象点への距離<b>の二乗</b>を受け取るポインタ(NULL可)
15861586 //! @return 成功:true 失敗:false
1587-//! @warning out_dist2は距離の<b>二乗</b>です。必要に応じて改めて sqrt()関数 などを用いてください。
1587+//! @warning out_dist2は距離の<b>二乗</b>です。必要に応じて改めて sqrtf()関数 などを用いてください。
15881588 //! @attention 引数 checkdist に有効な距離を与えた場合は、観測点から対象点への距離判定も行います。指定された距離より離れている場合、角度を計算せずに false を返します。
15891589 //! @attention 逆に、引数 checkdist に0.0f以下を与えた場合、距離による判定を行いません。関数は常に true を返します。
15901590 bool CheckTargetAngle(float pos_x, float pos_y, float pos_z, float rx, float ry, float target_x, float target_y, float target_z, float checkdist, float *out_rx, float *out_ry, float *out_dist2)
@@ -1608,7 +1608,7 @@
16081608 }
16091609
16101610 if( out_rx != NULL ){
1611- angleX = atan2(z, x) - rx;
1611+ angleX = atan2f(z, x) - rx;
16121612 for(; angleX > (float)M_PI; angleX -= (float)M_PI*2){}
16131613 for(; angleX < (float)M_PI*-1; angleX += (float)M_PI*2){}
16141614
@@ -1615,7 +1615,7 @@
16151615 *out_rx = angleX;
16161616 }
16171617 if( out_ry != NULL ){
1618- angleY = atan2(y, sqrt(x*x + z*z)) - ry;
1618+ angleY = atan2f(y, sqrtf(x*x + z*z)) - ry;
16191619
16201620 *out_ry = angleY;
16211621 }
@@ -1631,7 +1631,7 @@
16311631 //! @return 正規化前のベクトルの長さ
16321632 float VectorNormalization(float *vx, float *vy, float *vz)
16331633 {
1634- float r = sqrt((*vx) * (*vx) + (*vy) * (*vy) + (*vz) * (*vz));
1634+ float r = sqrtf((*vx) * (*vx) + (*vy) * (*vy) + (*vz) * (*vz));
16351635 if( r > 0.0f ){
16361636 *vx /= r;
16371637 *vy /= r;
--- trunk/d3dgraphics-directx.cpp (revision 291)
+++ trunk/d3dgraphics-directx.cpp (revision 292)
@@ -1211,7 +1211,7 @@
12111211 //カメラの向きを決定
12121212 if( fabs(camera_ry) == D3DX_PI/2 ){
12131213 //真上or真下を向いているならば、カメラの上部指定を横向きにする。
1214- vUpVecF_x = cos(camera_rx); vUpVecF_y = 0.0f; vUpVecF_z = sin(camera_rx);
1214+ vUpVecF_x = cosf(camera_rx); vUpVecF_y = 0.0f; vUpVecF_z = sinf(camera_rx);
12151215 }
12161216 else{
12171217 if( fabs(camera_ry) < D3DX_PI/2 ){
@@ -1232,7 +1232,7 @@
12321232
12331233 //カメラ座標
12341234 D3DXVECTOR3 vEyePt( camera_x, camera_y, camera_z );
1235- D3DXVECTOR3 vLookatPt( cos(camera_rx)*cos(camera_ry) + camera_x, sin(camera_ry) + camera_y, sin(camera_rx)*cos(camera_ry) + camera_z );
1235+ D3DXVECTOR3 vLookatPt( cosf(camera_rx)*cosf(camera_ry) + camera_x, sinf(camera_ry) + camera_y, sinf(camera_rx)*cosf(camera_ry) + camera_z );
12361236 D3DXVECTOR3 vUpVec( vUpVecF_x, vUpVecF_y, vUpVecF_z );
12371237 D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
12381238 #if GRAPHIC_ENGINE == 0
@@ -2162,8 +2162,8 @@
21622162
21632163 //頂点座標と色などを設定
21642164 for(int i=0; i<16+1; i++){
2165- pLineVertices[i].x = (float)x + cos(DegreeToRadian((360.0f/16.0f)) * i) * r;
2166- pLineVertices[i].y = (float)y + sin(DegreeToRadian((360.0f/16.0f)) * i) * r;
2165+ pLineVertices[i].x = (float)x + cosf(DegreeToRadian((360.0f/16.0f)) * i) * r;
2166+ pLineVertices[i].y = (float)y + sinf(DegreeToRadian((360.0f/16.0f)) * i) * r;
21672167
21682168 pLineVertices[i].z = 0.0f;
21692169 pLineVertices[i].rhw = 1.0f;
--- trunk/d3dgraphics-opengl.cpp (revision 291)
+++ trunk/d3dgraphics-opengl.cpp (revision 292)
@@ -1756,7 +1756,7 @@
17561756
17571757 glMatrixMode(GL_MODELVIEW);
17581758 glLoadIdentity();
1759- gluLookAt(camera_x*-1, camera_y, camera_z, camera_x*-1 + cos(camera_rx*-1 + (float)M_PI)*cos(camera_ry), camera_y + sin(camera_ry), camera_z + sin(camera_rx*-1 + (float)M_PI)*cos(camera_ry), 0.0f, camera_y_flag, 0.0f);
1759+ gluLookAt(camera_x*-1, camera_y, camera_z, camera_x*-1 + cosf(camera_rx*-1 + (float)M_PI)*cosf(camera_ry), camera_y + sinf(camera_ry), camera_z + sinf(camera_rx*-1 + (float)M_PI)*cosf(camera_ry), 0.0f, camera_y_flag, 0.0f);
17601760 }
17611761
17621762 //! @brief ワールド空間の座標・角度・拡大率を設定
@@ -2888,8 +2888,8 @@
28882888 //頂点座標を設定
28892889 for(int i=0; i<16+1; i++){
28902890 float x2, y2;
2891- x2 = (float)x + cos((float)M_PI*2/16 * i) * r;
2892- y2 = (float)y + sin((float)M_PI*2/16 * i) * r;
2891+ x2 = (float)x + cosf((float)M_PI*2/16 * i) * r;
2892+ y2 = (float)y + sinf((float)M_PI*2/16 * i) * r;
28932893 VertexAry[i*2] = x2; VertexAry[i*2+1] = y2;
28942894 }
28952895
--- trunk/datafile.cpp (revision 291)
+++ trunk/datafile.cpp (revision 292)
@@ -192,9 +192,9 @@
192192 float rx, ry, rz, a;
193193
194194 //光源の角度を設定
195- lx = cos(LIGHT_RX);
196- ly = sin(LIGHT_RY);
197- lz = sin(LIGHT_RX);
195+ lx = cosf(LIGHT_RX);
196+ ly = sinf(LIGHT_RY);
197+ lz = sinf(LIGHT_RX);
198198
199199 //各ブロックの面情報分処理する
200200 for(int i=0; i<datas; i++){
@@ -222,13 +222,13 @@
222222 xs1 = ((data[i].y[ vID[3] ] - data[i].y[ vID[2] ]) * (data[i].z[ vID[0] ] - data[i].z[ vID[2] ])) - ((data[i].y[ vID[0] ] - data[i].y[ vID[2] ]) * (data[i].z[ vID[3] ] - data[i].z[ vID[2] ]));
223223 ys1 = ((data[i].z[ vID[3] ] - data[i].z[ vID[2] ]) * (data[i].x[ vID[0] ] - data[i].x[ vID[2] ])) - ((data[i].z[ vID[0] ] - data[i].z[ vID[2] ]) * (data[i].x[ vID[3] ] - data[i].x[ vID[2] ]));
224224 zs1 = ((data[i].x[ vID[3] ] - data[i].x[ vID[2] ]) * (data[i].y[ vID[0] ] - data[i].y[ vID[2] ])) - ((data[i].x[ vID[0] ] - data[i].x[ vID[2] ]) * (data[i].y[ vID[3] ] - data[i].y[ vID[2] ]));
225- g1 = (float)sqrt(xs1 * xs1 + ys1 * ys1 + zs1 * zs1);
225+ g1 = (float)sqrtf(xs1 * xs1 + ys1 * ys1 + zs1 * zs1);
226226
227227 //もう一方の三角形でも計算する
228228 xs2 = ((data[i].y[ vID[1] ] - data[i].y[ vID[0] ]) * (data[i].z[ vID[2] ] - data[i].z[ vID[0] ])) - ((data[i].y[ vID[2] ] - data[i].y[ vID[0] ]) * (data[i].z[ vID[1] ] - data[i].z[ vID[0] ]));
229229 ys2 = ((data[i].z[ vID[1] ] - data[i].z[ vID[0] ]) * (data[i].x[ vID[2] ] - data[i].x[ vID[0] ])) - ((data[i].z[ vID[2] ] - data[i].z[ vID[0] ]) * (data[i].x[ vID[1] ] - data[i].x[ vID[0] ]));
230230 zs2 = ((data[i].x[ vID[1] ] - data[i].x[ vID[0] ]) * (data[i].y[ vID[2] ] - data[i].y[ vID[0] ])) - ((data[i].x[ vID[2] ] - data[i].x[ vID[0] ]) * (data[i].y[ vID[1] ] - data[i].y[ vID[0] ]));
231- g2 = (float)sqrt(xs2 * xs2 + ys2 * ys2 + zs2 * zs2);
231+ g2 = (float)sqrtf(xs2 * xs2 + ys2 * ys2 + zs2 * zs2);
232232
233233 //正しい計算結果を採用する
234234 if( g1 > g2 ){
@@ -253,9 +253,9 @@
253253 rx = data[i].material[j].vx + lx;
254254 ry = data[i].material[j].vy + ly;
255255 rz = data[i].material[j].vz + lz;
256- //a = sqrt(fabs(rx*rx + ry*ry + rz*rz)) / 2.0f;
256+ //a = sqrtf(fabs(rx*rx + ry*ry + rz*rz)) / 2.0f;
257257 //data[i].material[j].shadow = a/2 + 0.5f;
258- a = sqrt(rx*rx + ry*ry + rz*rz) / 3.0f;
258+ a = sqrtf(rx*rx + ry*ry + rz*rz) / 3.0f;
259259 data[i].material[j].shadow = a/2;
260260 if( darkflag == false ){
261261 data[i].material[j].shadow += 0.5f;
--- trunk/event.cpp (revision 291)
+++ trunk/event.cpp (revision 292)
@@ -113,10 +113,10 @@
113113 z = hz - pos_z;
114114
115115 if( reverse == false ){
116- if( sqrt(x*x + y*y+ + z*z) > dist_r ){ return false; }
116+ if( sqrtf(x*x + y*y+ + z*z) > dist_r ){ return false; }
117117 }
118118 else{
119- if( sqrt(x*x + y*y+ + z*z) < dist_r ){ return false; }
119+ if( sqrtf(x*x + y*y+ + z*z) < dist_r ){ return false; }
120120 }
121121 return true;
122122 }
--- trunk/gamemain.cpp (revision 291)
+++ trunk/gamemain.cpp (revision 292)
@@ -474,10 +474,31 @@
474474 mainmenu::mainmenu()
475475 {
476476 demopath[0] = '\0';
477+ modescreen = 0;
478+ mainmenu_mouseX = 0;
479+ mainmenu_mouseY = 0;
480+ mainmenu_mouseY_old = mainmenu_mouseY;
481+ gametitle = -1;
477482
478483 #ifdef ENABLE_MENUOPTIONS
484+ for( int i=0; i<OPTIONS_P1_DATAS; i++ ){
485+ Options_p1LinkTextData[i].enable = false;
486+ }
487+ for( int i=0; i<OPTIONS_P2_DATAS; i++ ){
488+ Options_p2LinkTextData[i].enable = false;
489+ }
490+ for( int i=0; i<OPTIONS_P3_DATAS; i++ ){
491+ Options_p3LinkTextData[i].enable = false;
492+ }
493+ Options_p2LinkTextID = -1;
494+ Options_FullscreenFlag_old = GameConfig.GetFullscreenFlag();
495+ Options_KeyConfigID = -1;
496+ Options_KeyConfigCnt = 0;
497+ licenseinfo[0] = "";
479498 licenseinfobuf = new char[100*18];
480- licenseinfobuf[0] = '\0';
499+ for( int i=0; i<OPTIONS_LICENSELINE; i++ ){
500+ licenseinfobuf[i] = '\0';
501+ }
481502 #endif
482503 }
483504
@@ -1546,7 +1567,11 @@
15461567
15471568 //! @brief コンストラクタ
15481569 briefing::briefing()
1549-{}
1570+{
1571+ TwoTexture = false;
1572+ TextureA = -1;
1573+ TextureB = -1;
1574+}
15501575
15511576 //! @brief ディストラクタ
15521577 briefing::~briefing()
@@ -1684,11 +1709,40 @@
16841709 //! @brief コンストラクタ
16851710 maingame::maingame()
16861711 {
1712+ SkyNumber = 0;
1713+ DarkScreenFlag = false;
1714+ FogFlag = true;
1715+ mouse_rx = 0.0f;
1716+ mouse_ry = 0.0f;
1717+ view_rx = 0.0f;
1718+ view_ry = 0.0f;
16871719 add_camera_rx = 0.0f;
16881720 add_camera_ry = 0.0f;
16891721 ShowInfo_Debugmode = false;
1722+ Camera_Debugmode = false;
1723+ tag = false;
1724+ radar = false;
1725+ wireframe = false;
1726+ nomodel = false;
1727+ CenterLine = false;
1728+ Camera_Blind = true;
1729+ Camera_F1mode = false;
16901730 Camera_F2mode = 0;
16911731 Camera_HOMEmode = false;
1732+ Cmd_F5 = false;
1733+ InvincibleID = -1;
1734+ PlayerAI = false;
1735+ AIstop = false;
1736+ AINoFight = false;
1737+ AIdebuginfoID = -1;
1738+ start_framecnt = 0;
1739+ end_framecnt = 0;
1740+ EventStop = false;
1741+ GameSpeed = 1;
1742+ message_id = -1;
1743+ message_cnt = 0;
1744+ redflash_flag = false;
1745+ time = 0;
16921746 time_input = 0;
16931747 time_process_object = 0;
16941748 time_process_ai = 0;
@@ -1695,6 +1749,15 @@
16951749 time_process_event = 0;
16961750 time_sound = 0;
16971751 time_render = 0;
1752+ memcpy(&MainGameInfo, &GameInfoData, sizeof(GameInfo));
1753+
1754+#ifdef ENABLE_DEBUGCONSOLE
1755+ Show_Console = false;
1756+ InfoConsoleData = NULL;
1757+ InputConsoleData = NULL;
1758+ NewCommand[0] = '\0';
1759+ ScreenShot = 0;
1760+#endif
16981761 }
16991762
17001763 //! @brief ディストラクタ
@@ -2336,9 +2399,9 @@
23362399 }
23372400
23382401 //プレイヤーの目の前の座標を取得
2339- x += cos(r*-1 + (float)M_PI/2)*10.0f;
2402+ x += cosf(r*-1 + (float)M_PI/2)*10.0f;
23402403 y += 5.0f;
2341- z += sin(r*-1 + (float)M_PI/2)*10.0f;
2404+ z += sinf(r*-1 + (float)M_PI/2)*10.0f;
23422405
23432406 //人を追加
23442407 id = ObjMgr.AddHumanIndex(x, y, z, r, param, team, weapon_paramid, 0, false);
@@ -2395,22 +2458,22 @@
23952458
23962459 //キー操作によりカメラ座標を計算
23972460 if( CheckInputControl(KEY_MOVEFORWARD, 0) ){
2398- camera_x += cos(camera_rx)*cos(camera_ry)*dist;
2399- camera_y += sin(camera_ry)*dist;
2400- camera_z += sin(camera_rx)*cos(camera_ry)*dist;
2461+ camera_x += cosf(camera_rx)*cosf(camera_ry)*dist;
2462+ camera_y += sinf(camera_ry)*dist;
2463+ camera_z += sinf(camera_rx)*cosf(camera_ry)*dist;
24012464 }
24022465 if( CheckInputControl(KEY_MOVEBACKWARD, 0) ){
2403- camera_x -= cos(camera_rx)*cos(camera_ry)*dist;
2404- camera_y -= sin(camera_ry)*dist;
2405- camera_z -= sin(camera_rx)*cos(camera_ry)*dist;
2466+ camera_x -= cosf(camera_rx)*cosf(camera_ry)*dist;
2467+ camera_y -= sinf(camera_ry)*dist;
2468+ camera_z -= sinf(camera_rx)*cosf(camera_ry)*dist;
24062469 }
24072470 if( CheckInputControl(KEY_MOVELEFT, 0) ){
2408- camera_x += cos(camera_rx + (float)M_PI/2)*dist;
2409- camera_z += sin(camera_rx + (float)M_PI/2)*dist;
2471+ camera_x += cosf(camera_rx + (float)M_PI/2)*dist;
2472+ camera_z += sinf(camera_rx + (float)M_PI/2)*dist;
24102473 }
24112474 if( CheckInputControl(KEY_MOVERIGHT, 0) ){
2412- camera_x += cos(camera_rx - (float)M_PI/2)*dist;
2413- camera_z += sin(camera_rx - (float)M_PI/2)*dist;
2475+ camera_x += cosf(camera_rx - (float)M_PI/2)*dist;
2476+ camera_z += sinf(camera_rx - (float)M_PI/2)*dist;
24142477 }
24152478 }
24162479
@@ -2529,9 +2592,9 @@
25292592
25302593 camera_rx += DegreeToRadian(1.0f);
25312594 camera_ry = ry;
2532- camera_x = x + cos(camera_rx)*r;
2595+ camera_x = x + cosf(camera_rx)*r;
25332596 camera_y = y + 33.3f;
2534- camera_z = z + sin(camera_rx)*r;
2597+ camera_z = z + sinf(camera_rx)*r;
25352598 }
25362599 else if( Camera_F1mode == true ){
25372600 float crx, cry;
@@ -2540,14 +2603,14 @@
25402603 //カメラの注視点を計算
25412604 crx = camera_rx*0.8f + (view_rx + mouse_rx*-1 + (float)M_PI/2)*0.2f; // 8 : 2
25422605 cry = camera_ry*0.8f + (view_ry + mouse_ry)*0.2f - (float)M_PI/2; // 8 : 2
2543- ccx = x - cos(crx)*cos(cry)*3.0f;
2544- ccy = y + HUMAN_HEIGHT-0.5f + sin(cry*-1)*2.5f;
2545- ccz = z - sin(crx)*cos(cry)*3.0f;
2606+ ccx = x - cosf(crx)*cosf(cry)*3.0f;
2607+ ccy = y + HUMAN_HEIGHT-0.5f + sinf(cry*-1)*2.5f;
2608+ ccz = z - sinf(crx)*cosf(cry)*3.0f;
25462609
25472610 //注視点からカメラまでの当たり判定
25482611 cry += (float)M_PI/2;
25492612 float dist;
2550- if( CollD.CheckALLBlockIntersectRay(ccx, ccy, ccz, cos(crx)*cos(cry)*-1, sin(cry*-1), sin(crx)*cos(cry)*-1, NULL, NULL, &dist, VIEW_F1MODE_DIST) == true ){
2613+ if( CollD.CheckALLBlockIntersectRay(ccx, ccy, ccz, cosf(crx)*cosf(cry)*-1, sinf(cry*-1), sinf(crx)*cosf(cry)*-1, NULL, NULL, &dist, VIEW_F1MODE_DIST) == true ){
25512614 dist -= 1.0f;
25522615 }
25532616 else{
@@ -2555,9 +2618,9 @@
25552618 }
25562619
25572620 //カメラ座標を再計算
2558- camera_x = ccx - cos(crx)*cos(cry)*(dist);
2559- camera_y = ccy + sin(cry*-1)*dist;
2560- camera_z = ccz - sin(crx)*cos(cry)*(dist);
2621+ camera_x = ccx - cosf(crx)*cosf(cry)*(dist);
2622+ camera_y = ccy + sinf(cry*-1)*dist;
2623+ camera_z = ccz - sinf(crx)*cosf(cry)*(dist);
25612624 camera_rx = crx;
25622625 camera_ry = cry;
25632626 }
@@ -2565,9 +2628,9 @@
25652628 float crx = view_rx + mouse_rx*-1 + (float)M_PI/2;
25662629 float cry = view_ry + mouse_ry;
25672630
2568- camera_x = x + cos(crx)*cos(cry)*VIEW_DIST;
2569- camera_y = y + VIEW_HEIGHT + sin(cry)*VIEW_DIST;
2570- camera_z = z + sin(crx)*cos(cry)*VIEW_DIST;
2631+ camera_x = x + cosf(crx)*cosf(cry)*VIEW_DIST;
2632+ camera_y = y + VIEW_HEIGHT + sinf(cry)*VIEW_DIST;
2633+ camera_z = z + sinf(crx)*cosf(cry)*VIEW_DIST;
25712634 camera_rx = crx;
25722635 camera_ry = cry;
25732636 }
@@ -2864,22 +2927,22 @@
28642927 if( scopemode == 2 ){ addang = VIEWANGLE_SCOPE_2 / 4; }
28652928
28662929 //上
2867- if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx)*cos(camera_ry + addang) * adddist, camera_y + sin(camera_ry + addang) * adddist, camera_z + sin(camera_rx)*cos(camera_ry + addang) * adddist) == true ){
2930+ if( CollD.CheckALLBlockInside(camera_x + cosf(camera_rx)*cosf(camera_ry + addang) * adddist, camera_y + sinf(camera_ry + addang) * adddist, camera_z + sinf(camera_rx)*cosf(camera_ry + addang) * adddist) == true ){
28682931 d3dg->Draw2DBox(0, 0, GameConfig.GetScreenWidth(), GameConfig.GetScreenHeight()/2, d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
28692932 }
28702933
28712934 //下
2872- if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx)*cos(camera_ry - addang) * adddist, camera_y + sin(camera_ry - addang) * adddist, camera_z + sin(camera_rx)*cos(camera_ry - addang) * adddist) == true ){
2935+ if( CollD.CheckALLBlockInside(camera_x + cosf(camera_rx)*cosf(camera_ry - addang) * adddist, camera_y + sinf(camera_ry - addang) * adddist, camera_z + sinf(camera_rx)*cosf(camera_ry - addang) * adddist) == true ){
28732936 d3dg->Draw2DBox(0, GameConfig.GetScreenHeight()/2, GameConfig.GetScreenWidth(), GameConfig.GetScreenHeight(), d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
28742937 }
28752938
28762939 //左
2877- if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx + addang)*cos(camera_ry) * adddist, camera_y + sin(camera_ry) * adddist, camera_z + sin(camera_rx + addang)*cos(camera_ry) * adddist) == true ){
2940+ if( CollD.CheckALLBlockInside(camera_x + cosf(camera_rx + addang)*cosf(camera_ry) * adddist, camera_y + sinf(camera_ry) * adddist, camera_z + sinf(camera_rx + addang)*cosf(camera_ry) * adddist) == true ){
28782941 d3dg->Draw2DBox(0, 0, GameConfig.GetScreenWidth()/2, GameConfig.GetScreenHeight(), d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
28792942 }
28802943
28812944 //右
2882- if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx - addang)*cos(camera_ry) * adddist, camera_y + sin(camera_ry) * adddist, camera_z + sin(camera_rx - addang)*cos(camera_ry) * adddist) == true ){
2945+ if( CollD.CheckALLBlockInside(camera_x + cosf(camera_rx - addang)*cosf(camera_ry) * adddist, camera_y + sinf(camera_ry) * adddist, camera_z + sinf(camera_rx - addang)*cosf(camera_ry) * adddist) == true ){
28832946 d3dg->Draw2DBox(GameConfig.GetScreenWidth()/2, 0, GameConfig.GetScreenWidth(), GameConfig.GetScreenHeight(), d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
28842947 }
28852948 }
@@ -3220,20 +3283,20 @@
32203283 //近ければ処理する
32213284 if( (check == false) || ((fabs(x) < RadarWorldR*2)&&(fabs(z) < RadarWorldR*2)&&(fabs(y) < 80.0f)) ){
32223285 //角度を距離を計算
3223- rx = atan2(z, x);
3224- r = sqrt(x*x + z*z);
3286+ rx = atan2f(z, x);
3287+ r = sqrtf(x*x + z*z);
32253288
32263289 //カメラ基準の座標を再計算
32273290 rx2 = (rx - camera_rx)*-1 - (float)M_PI/2;
3228- x2 = cos(rx2) * r;
3229- z2 = sin(rx2) * r;
3291+ x2 = cosf(rx2) * r;
3292+ z2 = sinf(rx2) * r;
32303293
32313294 //収まるか判定
32323295 if( (check == false) || ((fabs(x2) < RadarWorldR)&&(fabs(z2) < RadarWorldR)) ){
32333296 //描画座標を計算
32343297 r2 = r / RadarWorldR * (RadarSize/2);
3235- *out_x = (int)(RadarPosX+RadarSize/2 + cos(rx2) * r2);
3236- *out_y = (int)(RadarPosY+RadarSize/2 + sin(rx2) * r2);
3298+ *out_x = (int)(RadarPosX+RadarSize/2 + cosf(rx2) * r2);
3299+ *out_y = (int)(RadarPosY+RadarSize/2 + sinf(rx2) * r2);
32373300 if( local_y != NULL ){ *local_y = y; }
32383301 outf = true;
32393302 }
@@ -3277,7 +3340,7 @@
32773340 //各面ごとに処理する
32783341 for(int j=0; j<6; j++){
32793342 //登れない斜面か判定 ※地面や階段などの傾斜を除外する
3280- float angle = acos(bdata.material[j].vy);
3343+ float angle = acosf(bdata.material[j].vy);
32813344 if( (HUMAN_MAPCOLLISION_SLOPEANGLE < angle)&&(angle < DegreeToRadian(120)) ){
32823345
32833346 //ブロック頂点データの関連付けを取得
@@ -4208,7 +4271,7 @@
42084271 //小物を新規配置
42094272 if( GetCommandNum("newobj", &id) == true ){
42104273 if( (0 <= id)&&(id < TOTAL_PARAMETERINFO_SMALLOBJECT) ){
4211- int dataid = ObjMgr.AddSmallObjectIndex(camera_x + cos(camera_rx)*20.0f, camera_y, camera_z + sin(camera_rx)*20.0f, camera_rx*-1, id, true);
4274+ int dataid = ObjMgr.AddSmallObjectIndex(camera_x + cosf(camera_rx)*20.0f, camera_y, camera_z + sinf(camera_rx)*20.0f, camera_rx*-1, id, true);
42124275 if( dataid != -1 ){
42134276 sprintf(str, "Add SmallObject[%d].", dataid);
42144277 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
--- trunk/main.h (revision 291)
+++ trunk/main.h (revision 292)
@@ -88,7 +88,7 @@
8888
8989 //BorlandC++ Compiler用の処理
9090 #ifdef __BORLANDC__
91- #define sqrtf(df) sqrt(df)
91+ #define sqrtf(df) sqrtf(df)
9292 int _matherr(struct _exception *__e) { return 1; }
9393 #endif
9494
@@ -97,6 +97,17 @@
9797 #define UNREFERENCED_PARAMETER(P) ((P)=(P))
9898 #endif
9999
100+//float型の算術関数用意
101+#ifndef _MSC_VER
102+ #define sinf(x) (float)sin(x) //!< sinf(x)
103+ #define cosf(x) (float)cos(x) //!< cosf(x)
104+ #define atan2f(y,x) (float)atan2(y,x) //!< atan2f(y,x)
105+ #define sqrtf(x) (float)sqrt(x) //!< sqrtf(x)
106+ #define floorf(x) (float)floor(x) //!< floorf(x)
107+ #define ceilf(x) (float)ceil(x) //!< ceilf(x)
108+ #define fabsf(x) (float)fabs(x) //!< fabsf(x)
109+#endif
110+
100111 #define SetFlag(value, bit) value = value | bit //!< ビットによるフラグ 設定
101112 #define DelFlag(value, bit) value = value & (~bit) //!< ビットによるフラグ 解除
102113 #define GetFlag(value, bit) (value & bit) //!< ビットによるフラグ 取得
--- trunk/object.cpp (revision 291)
+++ trunk/object.cpp (revision 292)
@@ -211,6 +211,7 @@
211211 totalmove = 0.0f;
212212 StateGunsightErrorRange = 0;
213213 ReactionGunsightErrorRange = 0;
214+ Invincible = false;
214215
215216 MotionCtrl = new HumanMotionControl;
216217 }
@@ -950,9 +951,9 @@
950951 //! @param speed 速度
951952 void human::AddPosOrder(float rx, float ry, float speed)
952953 {
953- move_x += cos(rx) * cos(ry) * speed;
954- move_y += sin(ry) * speed;
955- move_z += sin(rx) * cos(ry) * speed;
954+ move_x += cosf(rx) * cosf(ry) * speed;
955+ move_y += sinf(ry) * speed;
956+ move_z += sinf(rx) * cosf(ry) * speed;
956957 }
957958
958959 //! @brief 弾が 頭 にヒット
@@ -1164,9 +1165,9 @@
11641165 weaponreloadcnt = 0;
11651166
11661167 //次のフレームの頭の座標を取得
1167- check_posx = pos_x + cos(rotation_x*-1 - (float)M_PI/2) * sin(add_ry) * HUMAN_HEIGHT;
1168- check_posy = pos_y + cos(add_ry) * HUMAN_HEIGHT;
1169- check_posz = pos_z + sin(rotation_x*-1 - (float)M_PI/2) * sin(add_ry) * HUMAN_HEIGHT;
1168+ check_posx = pos_x + cosf(rotation_x*-1 - (float)M_PI/2) * sinf(add_ry) * HUMAN_HEIGHT;
1169+ check_posy = pos_y + cosf(add_ry) * HUMAN_HEIGHT;
1170+ check_posz = pos_z + sinf(rotation_x*-1 - (float)M_PI/2) * sinf(add_ry) * HUMAN_HEIGHT;
11701171
11711172 if( CollD->CheckALLBlockInside(check_posx, check_posy, check_posz) == true ){
11721173 deadstate = 2;
@@ -1209,9 +1210,9 @@
12091210 }
12101211 else{
12111212 //次のフレームの頭の座標を取得
1212- check_posx = pos_x + cos(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1213- check_posy = pos_y + cos(rotation_y + add_ry) * HUMAN_HEIGHT;
1214- check_posz = pos_z + sin(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1213+ check_posx = pos_x + cosf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
1214+ check_posy = pos_y + cosf(rotation_y + add_ry) * HUMAN_HEIGHT;
1215+ check_posz = pos_z + sinf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
12151216
12161217 if( CollD->CheckALLBlockInside(check_posx, check_posy, check_posz) == true ){
12171218 deadstate = 3;
@@ -1267,9 +1268,9 @@
12671268 }
12681269
12691270 //次のフレームの足の座標を取得
1270- check_posx = pos_x - cos(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1271+ check_posx = pos_x - cosf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
12711272 check_posy = pos_y + 0.1f;
1272- check_posz = pos_z - sin(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1273+ check_posz = pos_z - sinf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
12731274
12741275 if( CollD->CheckALLBlockInside(check_posx, check_posy, check_posz) == true ){
12751276 deadstate = 4;
@@ -1277,9 +1278,9 @@
12771278 }
12781279
12791280 //次のフレームの頭の座標を取得
1280- check_posx = pos_x - cos(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1281- check_posy = pos_y + cos(rotation_y + add_ry) * HUMAN_HEIGHT;
1282- check_posz = pos_z - sin(rotation_x*-1 - (float)M_PI/2) * sin(rotation_y + add_ry) * HUMAN_HEIGHT;
1281+ check_posx = pos_x - cosf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
1282+ check_posy = pos_y + cosf(rotation_y + add_ry) * HUMAN_HEIGHT;
1283+ check_posz = pos_z - sinf(rotation_x*-1 - (float)M_PI/2) * sinf(rotation_y + add_ry) * HUMAN_HEIGHT;
12831284
12841285 if( CollD->CheckALLBlockInside(check_posx, check_posy, check_posz) == true ){
12851286 deadstate = 4;
@@ -1287,8 +1288,8 @@
12871288 }
12881289
12891290 //足の座標を移動
1290- pos_x -= cos(rotation_x*-1 - (float)M_PI/2) * sin(add_ry) * HUMAN_HEIGHT;
1291- pos_z -= sin(rotation_x*-1 - (float)M_PI/2) * sin(add_ry) * HUMAN_HEIGHT;
1291+ pos_x -= cosf(rotation_x*-1 - (float)M_PI/2) * sinf(add_ry) * HUMAN_HEIGHT;
1292+ pos_z -= sinf(rotation_x*-1 - (float)M_PI/2) * sinf(add_ry) * HUMAN_HEIGHT;
12921293
12931294 rotation_y += add_ry;
12941295 return 2;
@@ -1457,7 +1458,7 @@
14571458 dist_y = pos_y - pos_y2;
14581459 dist_z = pos_z - pos_z2;
14591460
1460- speed = sqrt(dist_x*dist_x + dist_z*dist_z);
1461+ speed = sqrtf(dist_x*dist_x + dist_z*dist_z);
14611462 if( (speed != 0.0f)||(move_y != 0.0f) ){
14621463
14631464 //頭部で当たり判定
@@ -1497,7 +1498,7 @@
14971498 inblockdata->Getdata(&bdata, id);
14981499
14991500 //斜面に立っているならば、上昇無効
1500- if( acos(bdata.material[face].vy) > HUMAN_MAPCOLLISION_SLOPEANGLE ){
1501+ if( acosf(bdata.material[face].vy) > HUMAN_MAPCOLLISION_SLOPEANGLE ){
15011502 flag = true;
15021503 }
15031504 }
@@ -1538,7 +1539,7 @@
15381539 FallFlag = false;
15391540 for(int i=0; i<3; i++){
15401541 int cnt = 0;
1541- float ang = atan2(move_z, move_x);
1542+ float ang = atan2f(move_z, move_x);
15421543 float x, y, z;
15431544
15441545 //落下
@@ -1550,32 +1551,32 @@
15501551 y = pos_y + HUMAN_MAPCOLLISION_GROUND_HEIGHT;
15511552
15521553 //4方向判定 No.1
1553- x = pos_x + cos(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1554- z = pos_z + sin(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1554+ x = pos_x + cosf(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1555+ z = pos_z + sinf(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
15551556 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1556- x = pos_x - cos(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1557- z = pos_z - sin(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1557+ x = pos_x - cosf(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
1558+ z = pos_z - sinf(ang)*HUMAN_MAPCOLLISION_GROUND_R1;
15581559 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1559- x = pos_x + cos(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1560- z = pos_z + sin(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1560+ x = pos_x + cosf(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1561+ z = pos_z + sinf(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
15611562 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1562- x = pos_x + cos(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1563- z = pos_z + sin(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1563+ x = pos_x + cosf(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
1564+ z = pos_z + sinf(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R1;
15641565 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
15651566 if( cnt == 4 ){ FallFlag = true; break; }
15661567
15671568 //4方向判定 No.2
1568- x = pos_x + cos(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1569- z = pos_z + sin(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1569+ x = pos_x + cosf(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1570+ z = pos_z + sinf(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
15701571 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1571- x = pos_x - cos(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1572- z = pos_z - sin(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1572+ x = pos_x - cosf(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
1573+ z = pos_z - sinf(ang)*HUMAN_MAPCOLLISION_GROUND_R2;
15731574 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1574- x = pos_x + cos(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1575- z = pos_z + sin(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1575+ x = pos_x + cosf(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1576+ z = pos_z + sinf(ang + (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
15761577 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
1577- x = pos_x + cos(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1578- z = pos_z + sin(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1578+ x = pos_x + cosf(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
1579+ z = pos_z + sinf(ang - (float)M_PI/2)*HUMAN_MAPCOLLISION_GROUND_R2;
15791580 if( CollD->CheckALLBlockInside(x, y, z) == true ){ cnt += 1; }
15801581 if( cnt == 4 ){ FallFlag = true; break; }
15811582 }
@@ -1588,8 +1589,8 @@
15881589 if( CollD->CheckALLBlockInside(x, y, z) == true ){ FallFlag = true; break; }
15891590
15901591 //外側へ少し外して判定
1591- x = pos_x + cos(ang)*HUMAN_MAPCOLLISION_GROUND_R3;
1592- z = pos_z + sin(ang)*HUMAN_MAPCOLLISION_GROUND_R3;
1592+ x = pos_x + cosf(ang)*HUMAN_MAPCOLLISION_GROUND_R3;
1593+ z = pos_z + sinf(ang)*HUMAN_MAPCOLLISION_GROUND_R3;
15931594 if( CollD->CheckALLBlockInside(x, y, z) == true ){ FallFlag = true; break; }
15941595 }
15951596
@@ -1633,7 +1634,7 @@
16331634 inblockdata->Getdata(&bdata, id);
16341635
16351636 //斜面に立っているならば、斜面を滑らせる処理
1636- if( acos(bdata.material[face].vy) > HUMAN_MAPCOLLISION_SLOPEANGLE ){
1637+ if( acosf(bdata.material[face].vy) > HUMAN_MAPCOLLISION_SLOPEANGLE ){
16371638 move_x = bdata.material[face].vx * 1.2f;
16381639 move_y = bdata.material[face].vy * -0.5f;
16391640 move_z = bdata.material[face].vz * 1.2f;
@@ -1657,11 +1658,11 @@
16571658 dist_y = pos_y - pos_y2;
16581659 dist_z = pos_z - pos_z2;
16591660
1660- Dist = sqrt(dist_x*dist_x + dist_z*dist_z);
1661- speed = sqrt((move_x*2)*(move_x*2) + (move_z*2)*(move_z*2));
1661+ Dist = sqrtf(dist_x*dist_x + dist_z*dist_z);
1662+ speed = sqrtf((move_x*2)*(move_x*2) + (move_z*2)*(move_z*2));
16621663
16631664 //明らかに移動量がおかしいならば元に戻す
1664- if( (sqrt(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z) > HUMAN_MAPCOLLISION_CHECK_MAXDIST)||(Dist - speed > 1.0f) ){
1665+ if( (sqrtf(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z) > HUMAN_MAPCOLLISION_CHECK_MAXDIST)||(Dist - speed > 1.0f) ){
16651666 pos_x = pos_x2;
16661667 pos_y = pos_y2;
16671668 pos_z = pos_z2;
@@ -1668,7 +1669,7 @@
16681669 }
16691670
16701671 if( player == true ){
1671- speed = sqrt(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z);
1672+ speed = sqrtf(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z);
16721673
16731674 //移動先との間にブロックがあるならば元に戻す
16741675 if(
@@ -1910,9 +1911,9 @@
19101911
19111912 //腕を描画
19121913 if( rotation_y != 0.0f ){ //死亡して倒れている or 倒れ始めた
1913- float x = pos_x + cos(rotation_x*-1 - (float)M_PI/2)*sin(rotation_y)*16.0f;
1914- float y = pos_y + cos(rotation_y)*16.0f;
1915- float z = pos_z + sin(rotation_x*-1 - (float)M_PI/2)*sin(rotation_y)*16.0f;
1914+ float x = pos_x + cosf(rotation_x*-1 - (float)M_PI/2)*sinf(rotation_y)*16.0f;
1915+ float y = pos_y + cosf(rotation_y)*16.0f;
1916+ float z = pos_z + sinf(rotation_x*-1 - (float)M_PI/2)*sinf(rotation_y)*16.0f;
19161917 d3dg->SetWorldTransform(x, y, z, rotation_x + (float)M_PI, armrotation_y + rotation_y, armmodel_size);
19171918 d3dg->RenderModel(armmodel, id_texture, DarkModelFlag, NoModel);
19181919 }
@@ -2043,12 +2044,12 @@
20432044 void weapon::Dropoff(float x, float y, float z, float rx, float speed)
20442045 {
20452046 //描画する座標と角度を設定
2046- move_x = cos(rx*-1 + (float)M_PI/2) * speed;
2047+ move_x = cosf(rx*-1 + (float)M_PI/2) * speed;
20472048 move_y = 0.0f;
2048- move_z = sin(rx*-1 + (float)M_PI/2) * speed;
2049- pos_x = x + cos(rx*-1 + (float)M_PI/2) * 5.0f;
2049+ move_z = sinf(rx*-1 + (float)M_PI/2) * speed;
2050+ pos_x = x + cosf(rx*-1 + (float)M_PI/2) * 5.0f;
20502051 pos_y = y + 16.0f + move_y;
2051- pos_z = z + sin(rx*-1 + (float)M_PI/2) * 5.0f;
2052+ pos_z = z + sinf(rx*-1 + (float)M_PI/2) * 5.0f;
20522053 rotation_x = rx + (float)M_PI;
20532054
20542055 //未使用(未装備)に設定し、座標移動を有効に
@@ -2206,7 +2207,7 @@
22062207 }
22072208
22082209 //水平の移動速度を求める
2209- maxDist = sqrt(move_x*move_x + move_z*move_z);
2210+ maxDist = sqrtf(move_x*move_x + move_z*move_z);
22102211 if( maxDist < 0.1f ){
22112212 maxDist = 0.0f;
22122213 move_x = 0.0f;
@@ -2467,9 +2468,9 @@
24672468 cnt = jump - jump_cnt;
24682469
24692470 //姿勢から座標・角度を計算
2470- pos_x += cos(jump_rx) * move_rx;
2471+ pos_x += cosf(jump_rx) * move_rx;
24712472 pos_y += jump_cnt * 0.1f;
2472- pos_z += sin(jump_rx) * move_rx;
2473+ pos_z += sinf(jump_rx) * move_rx;
24732474 rotation_x += add_rx;
24742475 rotation_y += add_ry;
24752476
@@ -2507,6 +2508,15 @@
25072508 id_model = modelid;
25082509 id_texture = textureid;
25092510 EnableFlag = false;
2511+
2512+ rotation_y = 0.0f;
2513+ attacks = 0;
2514+ penetration = 0;
2515+ speed = 0;
2516+ teamid = 0;
2517+ humanid = 0;
2518+ ontargetcnt = 0;
2519+ cnt = 0;
25102520 }
25112521
25122522 //! @brief ディストラクタ
@@ -2595,9 +2605,9 @@
25952605 }
25962606
25972607 //移動処理
2598- pos_x += cos(rotation_x)*cos(rotation_y)*speed;
2599- pos_y += sin(rotation_y)*speed;
2600- pos_z += sin(rotation_x)*cos(rotation_y)*speed;
2608+ pos_x += cosf(rotation_x)*cosf(rotation_y)*speed;
2609+ pos_y += sinf(rotation_y)*speed;
2610+ pos_z += sinf(rotation_x)*cosf(rotation_y)*speed;
26012611 cnt += 1;
26022612
26032613 return 0;
@@ -2632,6 +2642,10 @@
26322642 model_size = ParamData.size;
26332643 }
26342644 }
2645+
2646+ move_x = 0.0f;
2647+ move_y = 0.0f;
2648+ move_z = 0.0f;
26352649 }
26362650
26372651 //! @brief ディストラクタ
@@ -2647,9 +2661,9 @@
26472661 //! @attention 先に SetPosData() を実行してください。
26482662 void grenade::SetParamData(float speed, int _teamid, int _humanid, float _ontargetcnt, bool init)
26492663 {
2650- move_x = cos(rotation_x) * cos(rotation_y) * speed;
2651- move_y = sin(rotation_y) * speed;
2652- move_z = sin(rotation_x) * cos(rotation_y) * speed;
2664+ move_x = cosf(rotation_x) * cosf(rotation_y) * speed;
2665+ move_y = sinf(rotation_y) * speed;
2666+ move_z = sinf(rotation_x) * cosf(rotation_y) * speed;
26532667 teamid = _teamid;
26542668 humanid = _humanid;
26552669 ontargetcnt = _ontargetcnt;
@@ -2676,7 +2690,7 @@
26762690 //! @return 速度
26772691 float grenade::GetSpeed()
26782692 {
2679- return sqrt(move_x*move_x + move_y*move_y + move_z*move_z);
2693+ return sqrtf(move_x*move_x + move_y*move_y + move_z*move_z);
26802694 }
26812695
26822696 //! @brief 計算を実行(手榴弾の進行・爆発)
@@ -2700,7 +2714,7 @@
27002714
27012715 int id, face;
27022716 float Dist;
2703- float maxDist = sqrt(move_x*move_x + move_y*move_y + move_z*move_z);
2717+ float maxDist = sqrtf(move_x*move_x + move_y*move_y + move_z*move_z);
27042718
27052719 //マップに対して当たり判定を実行
27062720 if( CollD->CheckALLBlockIntersectRay(pos_x, pos_y, pos_z, move_x/maxDist, move_y/maxDist, move_z/maxDist, &id, &face, &Dist, maxDist) == true ){
--- trunk/objectmanager.cpp (revision 291)
+++ trunk/objectmanager.cpp (revision 292)
@@ -582,8 +582,8 @@
582582 vz = data.material[face].vz;
583583
584584 //角度を求める
585- rx = atan2(vz, vx)*-1 + (float)M_PI;
586- ry = atan2(vy, sqrt(vx*vx + vz*vz))*-1;
585+ rx = atan2f(vz, vx)*-1 + (float)M_PI;
586+ ry = atan2f(vy, sqrtf(vx*vx + vz*vz))*-1;
587587
588588 //エフェクト作成
589589 for(int i=0; i<MAX_EFFECT; i++){
@@ -622,7 +622,7 @@
622622 if( flowing == true ){
623623 for(int i=0; i<(damage/10); i++){
624624 float rx = DegreeToRadian(10)*GetRand(36);
625- AddEffect(x + cos(rx)*1.0f, y + (float)(GetRand(20)-10)/10, z + sin(rx)*1.0f, cos(rx)*0.5f, GetRand(5)*0.1f + 0.5f, sin(rx)*0.5f, -0.09f, DegreeToRadian(10)*GetRand(36), 0.0f, GetRand(40)*0.1f+0.1f, 0.1f, Resource->GetEffectBloodTexture(), 10, 0, 1.0f, 0.0f, addtype, (int)(GAMEFPS * 0.5f));
625+ AddEffect(x + cosf(rx)*1.0f, y + (float)(GetRand(20)-10)/10, z + sinf(rx)*1.0f, cosf(rx)*0.5f, GetRand(5)*0.1f + 0.5f, sinf(rx)*0.5f, -0.09f, DegreeToRadian(10)*GetRand(36), 0.0f, GetRand(40)*0.1f+0.1f, 0.1f, Resource->GetEffectBloodTexture(), 10, 0, 1.0f, 0.0f, addtype, (int)(GAMEFPS * 0.5f));
626626 }
627627 }
628628 }
@@ -693,9 +693,9 @@
693693 //弾丸の座標を取得し、ベクトルを算出。
694694 in_bullet->GetPosData(&bx, &by, &bz, &brx, &bry);
695695 in_bullet->GetParamData(&attacks, &penetration, &speed, &teamid, &humanid, &ontargetcnt);
696- vx = cos(brx)*cos(bry);
697- vy = sin(bry);
698- vz = sin(brx)*cos(bry);
696+ vx = cosf(brx)*cosf(bry);
697+ vy = sinf(bry);
698+ vz = sinf(brx)*cosf(bry);
699699
700700 //マップとの当たり判定(弾道上にブロックがあるか)
701701 if( CollD->CheckALLBlockIntersectRay(bx, by, bz, vx, vy, vz, NULL, NULL, &Dist, (float)speed) == true ){
@@ -1051,7 +1051,7 @@
10511051 x = hx - gx;
10521052 y = hy - gy;
10531053 z = hz - gz;
1054- r = sqrt(x*x + y*y + z*z);
1054+ r = sqrtf(x*x + y*y + z*z);
10551055
10561056 //100.0より遠ければ計算しない
10571057 if( r > MAX_DAMAGE_GRENADE_DISTANCE + HUMAN_HEIGHT ){ continue; }
@@ -1062,7 +1062,7 @@
10621062
10631063 //足元に当たり判定
10641064 y = hy + 2.0f - gy;
1065- r = sqrt(x*x + y*y + z*z);
1065+ r = sqrtf(x*x + y*y + z*z);
10661066 //ブロックが遮っていなければ (レイで当たり判定を行い、当たっていなければ)
10671067 if( CollD->CheckALLBlockIntersectRay(gx, gy, gz, x/r, y/r, z/r, NULL, NULL, &dummy, r) == false ){
10681068 //ダメージ量を計算
@@ -1074,7 +1074,7 @@
10741074
10751075 //頭に当たり判定
10761076 y = hy + (HUMAN_HEIGHT-2.0f) - gy;
1077- r = sqrt(x*x + y*y + z*z);
1077+ r = sqrtf(x*x + y*y + z*z);
10781078 //ブロックが遮っていなければ (レイで当たり判定を行い、当たっていなければ)
10791079 if( CollD->CheckALLBlockIntersectRay(gx, gy, gz, x/r, y/r, z/r, NULL, NULL, &dummy, r) == false ){
10801080 //ダメージ量を計算
@@ -1112,11 +1112,11 @@
11121112 z = gz - hz;
11131113
11141114 //角度を求める
1115- arx = atan2(z, x);
1115+ arx = atan2f(z, x);
11161116
1117- if( sin(atan2(y, sqrt(x*x + z*z))) < 0.0f ){ //上方向に飛ぶなら、角度を計算
1117+ if( sinf(atan2f(y, sqrtf(x*x + z*z))) < 0.0f ){ //上方向に飛ぶなら、角度を計算
11181118 y2 = gy - (hy + HUMAN_HEIGHT);
1119- ary = atan2(y2, sqrt(x*x + z*z)) + (float)M_PI;
1119+ ary = atan2f(y2, sqrtf(x*x + z*z)) + (float)M_PI;
11201120 }
11211121 else{ //下方向に飛ぶなら、垂直角度は無効。(爆風で地面にめり込むのを防止)
11221122 ary = 0.0f;
@@ -1140,7 +1140,7 @@
11401140 #endif
11411141
11421142 //爆風による風圧
1143- HumanIndex[i].AddPosOrder(arx, ary, 2.2f/MAX_DAMAGE_GRENADE_DISTANCE * (MAX_DAMAGE_GRENADE_DISTANCE - sqrt(x*x + y*y + z*z)));
1143+ HumanIndex[i].AddPosOrder(arx, ary, 2.2f/MAX_DAMAGE_GRENADE_DISTANCE * (MAX_DAMAGE_GRENADE_DISTANCE - sqrtf(x*x + y*y + z*z)));
11441144
11451145 //ログ関係の処理
11461146 if( (hp_old > 0)&&(HumanIndex[i].GetHP() <= 0) ){
@@ -1169,7 +1169,7 @@
11691169 x = sx - gx;
11701170 y = sy - gy;
11711171 z = sz - gz;
1172- r = sqrt(x*x + y*y + z*z);
1172+ r = sqrtf(x*x + y*y + z*z);
11731173
11741174 //100.0より遠ければ計算しない
11751175 if( r > MAX_DAMAGE_GRENADE_DISTANCE ){ continue; }
@@ -1247,8 +1247,8 @@
12471247 hry = in_human->GetDeadRy();
12481248
12491249 //腰辺りの座標を算出
1250- hx += cos(hrx*-1 - (float)M_PI/2) * sin(hry) * HUMAN_HEIGHT/2;
1251- hz += sin(hrx*-1 - (float)M_PI/2) * sin(hry) * HUMAN_HEIGHT/2;
1250+ hx += cosf(hrx*-1 - (float)M_PI/2) * sinf(hry) * HUMAN_HEIGHT/2;
1251+ hz += sinf(hrx*-1 - (float)M_PI/2) * sinf(hry) * HUMAN_HEIGHT/2;
12521252
12531253 //エフェクト(煙)の描画
12541254 float rnd = DegreeToRadian(10)*GetRand(18);
@@ -1288,7 +1288,7 @@
12881288 if( (move_x == 0.0f)&&(move_y == 0.0f)&&(move_z == 0.0f) ){ return false; }
12891289
12901290 //ベクトルを求める
1291- dist = sqrt(move_x*move_x + move_y*move_y + move_z*move_z);
1291+ dist = sqrtf(move_x*move_x + move_y*move_y + move_z*move_z);
12921292 vx = move_x / dist;
12931293 vy = move_y / dist;
12941294 vz = move_z / dist;
@@ -1976,8 +1976,8 @@
19761976 int len;
19771977 float a = DegreeToRadian(10) * GetRand(36);
19781978 len = GetRand(5)*2+5;
1979- rx2 = rx + cos(a)*len * DegreeToRadian(0.15f);
1980- ry2 = ry + sin(a)*len * DegreeToRadian(0.15f);
1979+ rx2 = rx + cosf(a)*len * DegreeToRadian(0.15f);
1980+ ry2 = ry + sinf(a)*len * DegreeToRadian(0.15f);
19811981 }
19821982 else{
19831983 //そのまま攻撃力と命中時のカウント数を反映
@@ -2062,14 +2062,14 @@
20622062
20632063 //煙の移動ベクトルを決定
20642064 rx = rotation_x*-1 + (float)M_PI/2;
2065- emx = cos(rx)*cos(armrotation_y);
2066- emy = sin(armrotation_y);
2067- emz = sin(rx)*cos(armrotation_y);
2065+ emx = cosf(rx)*cosf(armrotation_y);
2066+ emy = sinf(armrotation_y);
2067+ emz = sinf(rx)*cosf(armrotation_y);
20682068
20692069 //薬莢の移動量を決定
2070- mx = cos(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f;
2070+ mx = cosf(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f;
20712071 my = (ParamData.yakkyou_sy + (GetRand(3)-1)) * 0.12f;
2072- mz = sin(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f;
2072+ mz = sinf(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f;
20732073
20742074 //行列でエフェクト座標を計算
20752075 d3dg->SetWorldTransformHumanWeapon(pos_x, pos_y + 16.0f, pos_z, ParamData.flashx/10, ParamData.flashy/10, ParamData.flashz/10, rotation_x, armrotation_y*-1, 1.0f);
@@ -2350,9 +2350,9 @@
23502350 if( mteam == tteam ){ return false; }
23512351
23522352 //攻撃ポイント(腕の先端)を求める
2353- AttackPoint_x = mx + cos(mrx*-1 + (float)M_PI/2) * 2.0f;
2353+ AttackPoint_x = mx + cosf(mrx*-1 + (float)M_PI/2) * 2.0f;
23542354 AttackPoint_y = my + VIEW_HEIGHT - 0.5f;
2355- AttackPoint_z = mz + sin(mrx*-1 + (float)M_PI/2) * 2.0f;
2355+ AttackPoint_z = mz + sinf(mrx*-1 + (float)M_PI/2) * 2.0f;
23562356 ax = AttackPoint_x - tx;
23572357 az = AttackPoint_z - tz;
23582358
@@ -2396,7 +2396,7 @@
23962396 ty += VIEW_HEIGHT;
23972397
23982398 //敵が攻撃を受けた角度を求める
2399- arx = atan2(mz - tz, mx - tx);
2399+ arx = atan2f(mz - tz, mx - tx);
24002400
24012401 //ロボットかどうか判定
24022402 EnemyHuman->GetParamData(&paramid, NULL, NULL, NULL);
@@ -2571,7 +2571,7 @@
25712571 *color = d3dg->GetColorCode(1.0f,0.0f,0.0f,1.0f);
25722572 sprintf(infostr, "Human[%d] HP %d : Enemy", i, HumanIndex[i].GetHP());
25732573 }
2574- dist = sqrt(r);
2574+ dist = sqrtf(r);
25752575 }
25762576 }
25772577 }
@@ -2591,7 +2591,7 @@
25912591 if( (fabs(rx) < DegreeToRadian(10))&&(fabs(ry) < DegreeToRadian(10)) ){
25922592 *color = d3dg->GetColorCode(0.0f,1.0f,0.0f,1.0f);
25932593 sprintf(infostr, "Weapon[%d] %d:%d", i, lnbs, (nbs - lnbs));
2594- dist = sqrt(r);
2594+ dist = sqrtf(r);
25952595 }
25962596 }
25972597 }
@@ -2608,7 +2608,7 @@
26082608 if( (fabs(rx) < DegreeToRadian(10))&&(fabs(ry) < DegreeToRadian(10)) ){
26092609 *color = d3dg->GetColorCode(1.0f,1.0f,0.0f,1.0f);
26102610 sprintf(infostr, "SmallObject[%d] HP %d", i, SmallObjectIndex[i].GetHP());
2611- dist = sqrt(r);
2611+ dist = sqrtf(r);
26122612 }
26132613 }
26142614 }
@@ -2713,9 +2713,9 @@
27132713 //弾の座標と角度を取得
27142714 BulletIndex[i].GetParamData(NULL, NULL, &speed, &teamid, NULL, NULL);
27152715 BulletIndex[i].GetPosData(&bx, &by, &bz, &brx, &bry);
2716- mx = cos(brx)*cos(bry)*speed;
2717- my = sin(bry)*speed;
2718- mz = sin(brx)*cos(bry)*speed;
2716+ mx = cosf(brx)*cosf(bry)*speed;
2717+ my = sinf(bry)*speed;
2718+ mz = sinf(brx)*cosf(bry)*speed;
27192719 GameSound->PassingBullet(bx, by, bz, mx, my, mz, teamid);
27202720 }
27212721 }
--- trunk/sound-directsound.cpp (revision 291)
+++ trunk/sound-directsound.cpp (revision 292)
@@ -133,7 +133,7 @@
133133 void SoundControl::SetCamera(float x, float y, float z, float rx)
134134 {
135135 p3DListener->SetPosition(x, y, z, DS3D_IMMEDIATE);
136- p3DListener->SetOrientation(cos(rx), 0.0f, sin(rx), 0.0f, 1.0f, 0.0f, DS3D_IMMEDIATE);
136+ p3DListener->SetOrientation(cosf(rx), 0.0f, sinf(rx), 0.0f, 1.0f, 0.0f, DS3D_IMMEDIATE);
137137 }
138138
139139 //! @brief サウンドを読み込む
@@ -594,7 +594,7 @@
594594 return false;
595595 }
596596
597- *out_dist = sqrt(dist);
597+ *out_dist = sqrtf(dist);
598598 return true;
599599 }
600600
--- trunk/sound-ezds.cpp (revision 291)
+++ trunk/sound-ezds.cpp (revision 292)
@@ -247,7 +247,7 @@
247247 //左右のパン(再生バランス)の決定
248248 float vx = x - camera_x;
249249 float vz = z - camera_z;
250- float rx = (atan2(vz, vx) - camera_rx) * -1;
250+ float rx = (atan2f(vz, vx) - camera_rx) * -1;
251251 for(; rx > (float)M_PI; rx -= (float)M_PI*2){}
252252 for(; rx < (float)M_PI*-1; rx += (float)M_PI*2){}
253253 pan = (int)((float)10 / M_PI * rx);
@@ -319,7 +319,7 @@
319319 return false;
320320 }
321321
322- *out_dist = sqrt(dist);
322+ *out_dist = sqrtf(dist);
323323 return true;
324324 }
325325
--- trunk/soundmanager.cpp (revision 291)
+++ trunk/soundmanager.cpp (revision 292)
@@ -523,13 +523,13 @@
523523 float min_dist, dist;
524524
525525 //移動速度を求める
526- speed = (float)sqrt(plist->move_x*plist->move_x + plist->move_y*plist->move_y + plist->move_z*plist->move_z);
526+ speed = (float)sqrtf(plist->move_x*plist->move_x + plist->move_y*plist->move_y + plist->move_z*plist->move_z);
527527
528528 //最短距離の座標を求める
529529 min_dist = DistancePosRay(camera_x, camera_y, camera_z, plist->x, plist->y, plist->z, plist->move_x/speed, plist->move_y/speed, plist->move_z/speed);
530530
531531 //最短距離時の座標を求める
532- dist = (float)sqrt(dist2 - min_dist*min_dist);
532+ dist = (float)sqrtf(dist2 - min_dist*min_dist);
533533 *min_x = plist->x + plist->move_x/speed * dist;
534534 *min_y = plist->y + plist->move_y/speed * dist;
535535 *min_z = plist->z + plist->move_z/speed * dist;
--- trunk/window.cpp (revision 291)
+++ trunk/window.cpp (revision 292)
@@ -356,7 +356,7 @@
356356 //! @return 値
357357 float Round(float r)
358358 {
359- return (r > 0.0f) ? floor(r + 0.5f) : ceil(r - 0.5f);
359+ return (r > 0.0f) ? floorf(r + 0.5f) : ceilf(r - 0.5f);
360360 }
361361
362362 #ifdef ENABLE_PATH_DELIMITER_SLASH