• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

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


Commit MetaInfo

Revision293 (tree)
Zeit2022-03-13 00:07:05
Autorxops-mikan

Log Message

一部クラスのメンバー変数初期化処理の追加、算術関数を変更、一部処理の軽微な変更 (R292追加分)

Ändern Zusammenfassung

Diff

--- trunk/ai.cpp (revision 292)
+++ trunk/ai.cpp (revision 293)
@@ -173,27 +173,27 @@
173173
174174 //前進する
175175 if( zombie == true ){
176- if( fabs(atan) < DegreeToRadian(20) ){
176+ if( fabsf(atan) < DegreeToRadian(20) ){
177177 ObjDriver->SetModeFlag(AI_CTRL_MOVEWALK);
178178 }
179179 }
180180 else if( movemode == AI_NAVI_MOVE_RUN ){
181- if( fabs(atan) < DegreeToRadian(50) ){
181+ if( fabsf(atan) < DegreeToRadian(50) ){
182182 ObjDriver->SetModeFlag(AI_CTRL_MOVEFORWARD);
183183 }
184184 }
185185 else if( movemode == AI_NAVI_MOVE_RUN2 ){
186- if( fabs(atan) < DegreeToRadian(50) ){
186+ if( fabsf(atan) < DegreeToRadian(50) ){
187187 ObjDriver->SetModeFlag(AI_CTRL_MOVEFORWARD);
188188 }
189189 }
190190 else if( movemode == AI_NAVI_MOVE_WALK ){
191- if( fabs(atan) < DegreeToRadian(6) ){
191+ if( fabsf(atan) < DegreeToRadian(6) ){
192192 ObjDriver->SetModeFlag(AI_CTRL_MOVEWALK);
193193 }
194194 }
195195 else if( movemode == AI_NAVI_MOVE_TRACKING ){
196- if( fabs(atan) < DegreeToRadian(20) ){
196+ if( fabsf(atan) < DegreeToRadian(20) ){
197197 if( r < (AI_ARRIVALDIST_WALKTRACKING * AI_ARRIVALDIST_WALKTRACKING) ){
198198 ObjDriver->SetModeFlag(AI_CTRL_MOVEWALK);
199199 }
@@ -238,10 +238,10 @@
238238 CheckTargetAngle(posx, 0.0f, posz, rx*-1 + (float)M_PI/2, 0.0f, target_posx, 0.0f, target_posz, 0.0f, &atan, NULL, NULL);
239239
240240 //前後移動の処理
241- if( fabs(atan) < DegreeToRadian(56) ){
241+ if( fabsf(atan) < DegreeToRadian(56) ){
242242 ObjDriver->SetModeFlag(AI_CTRL_MOVEFORWARD);
243243 }
244- if( fabs(atan) > DegreeToRadian(123.5f) ){
244+ if( fabsf(atan) > DegreeToRadian(123.5f) ){
245245 ObjDriver->SetModeFlag(AI_CTRL_MOVEBACKWARD);
246246 }
247247
@@ -412,7 +412,7 @@
412412 }
413413
414414 //特定方向に向き終われば、普通の警戒に移行する
415- if( fabs(tr) <= DegreeToRadian(2.5f) ){
415+ if( fabsf(tr) <= DegreeToRadian(2.5f) ){
416416 FaceCaution_flag = false;
417417 }
418418
@@ -495,7 +495,7 @@
495495 }
496496
497497 //特定方向に向けているか判定
498- if( fabs(tr) <= DegreeToRadian(2.5f) ){
498+ if( fabsf(tr) <= DegreeToRadian(2.5f) ){
499499 returnflag = true;
500500 }
501501
@@ -684,8 +684,8 @@
684684 }
685685
686686 //敵に向かって前進する
687- if( fabs(atanx) <= DegreeToRadian(25) ){
688- if( (fabs(atanx) <= DegreeToRadian(15)) && (r < 24.0f*24.0f) && (actioncnt%50 > 20) ){
687+ if( fabsf(atanx) <= DegreeToRadian(25) ){
688+ if( (fabsf(atanx) <= DegreeToRadian(15)) && (r < 24.0f*24.0f) && (actioncnt%50 > 20) ){
689689 //歩きを取り消し、走る
690690 ObjDriver->SetModeFlag(AI_CTRL_MOVEFORWARD);
691691 ObjDriver->DelModeFlag(AI_CTRL_MOVEWALK);
@@ -702,7 +702,7 @@
702702 }
703703 */
704704
705- if( (r < 9.0f*9.0f)&&( fabs(y) < 10.0f) ){
705+ if( (r < 9.0f*9.0f)&&( fabsf(y) < 10.0f) ){
706706 float x = posx - tx;
707707 float z = posz - tz;
708708
@@ -1209,7 +1209,7 @@
12091209 }
12101210
12111211 //投げる
1212- if( (fabs(atan_rx) < DegreeToRadian(1.5f))&&(fabs(atan_ry) < DegreeToRadian(1.5f)) ){
1212+ if( (fabsf(atan_rx) < DegreeToRadian(1.5f))&&(fabsf(atan_ry) < DegreeToRadian(1.5f)) ){
12131213 //角度を設定
12141214 ctrlhuman->SetRxRy(rx, ry);
12151215
@@ -1382,7 +1382,7 @@
13821382 //距離を判定し、角度も取得
13831383 if( CheckTargetAngle(posx, posy, posz, rx*-1 + (float)M_PI/2, 0.0f, tx, ty, tz, maxDist, &mrx, &mry, &Dist2) == true ){
13841384 //角度上、視界に入っていれば
1385- if( (fabs(mrx) < search_rx/2)&&(fabs(mry) < search_ry/2) ){
1385+ if( (fabsf(mrx) < search_rx/2)&&(fabsf(mry) < search_ry/2) ){
13861386 float vx, vy, vz;
13871387
13881388 Dist = sqrtf(Dist2);
@@ -1435,7 +1435,7 @@
14351435
14361436 //距離と角度を計算
14371437 if( CheckTargetAngle(posx, posy, posz, rx*-1 + (float)M_PI/2, 0.0f, tposx, tposy, tposz, 22.0f, &atan, NULL, NULL) == true ){
1438- if( fabs(atan) < DegreeToRadian(40) ){
1438+ if( fabsf(atan) < DegreeToRadian(40) ){
14391439 return true;
14401440 }
14411441 }
@@ -2318,6 +2318,6 @@
23182318 addry *= 0.8f;
23192319
23202320 //0.0fへ補正
2321- if( fabs(addrx) < DegreeToRadian(0.2f) ){ addrx = 0.0f; }
2322- if( fabs(addry) < DegreeToRadian(0.2f) ){ addry = 0.0f; }
2321+ if( fabsf(addrx) < DegreeToRadian(0.2f) ){ addrx = 0.0f; }
2322+ if( fabsf(addry) < DegreeToRadian(0.2f) ){ addry = 0.0f; }
23232323 }
\ No newline at end of file
--- trunk/d3dgraphics-directx.cpp (revision 292)
+++ trunk/d3dgraphics-directx.cpp (revision 293)
@@ -42,6 +42,7 @@
4242 fullscreenflag = false;
4343 for(int i=0; i<MAX_MODEL; i++){
4444 pmesh[i] = NULL;
45+ nummaterials[i] = 0;
4546 }
4647 for(int i=0; i<MAX_TEXTURE; i++){
4748 ptextures[i] = NULL;
@@ -60,19 +61,33 @@
6061 #endif
6162
6263 blockdata = NULL;
64+ bs = 0;
6365 for(int i=0; i<TOTAL_BLOCKTEXTURE; i++){
6466 mapTextureID[i] = -1;
6567 }
68+#ifdef BLOCKDATA_GPUMEMORY
69+ g_pVB = NULL;
70+#else
71+ ZeroMemory(g_pVertices, sizeof(VERTEXTXTA)*MAX_BLOCKS*6*4);
72+#endif
6673
74+ for( int i=0; i<TOTAL_HAVEWEAPON; i++ ){
75+ HUD_myweapon_x[i] = 0.0f;
76+ HUD_myweapon_y[i] = 0.0f;
77+ HUD_myweapon_z[i] = 0.0f;
78+ }
79+
6780 StartRenderFlag = false;
6881 EnableFogFlag = false;
6982
70- //ptextsprite = NULL;
83+ ptextsprite = NULL;
7184 pxmsfont = NULL;
7285 pxmssmallfont = NULL;
86+ TextureFontFname[0] = '\0';
7387 TextureFont = -1;
7488
7589 #ifdef ENABLE_DEBUGCONSOLE
90+ ZeroMemory(DebugFontData, sizeof(unsigned char)*96*16);
7691 TextureDebugFont = -1;
7792 #endif
7893 }
@@ -1209,12 +1224,12 @@
12091224 for(; camera_ry<D3DX_PI*-1; camera_ry += D3DX_PI*2){}
12101225
12111226 //カメラの向きを決定
1212- if( fabs(camera_ry) == D3DX_PI/2 ){
1227+ if( fabsf(camera_ry) == D3DX_PI/2 ){
12131228 //真上or真下を向いているならば、カメラの上部指定を横向きにする。
12141229 vUpVecF_x = cosf(camera_rx); vUpVecF_y = 0.0f; vUpVecF_z = sinf(camera_rx);
12151230 }
12161231 else{
1217- if( fabs(camera_ry) < D3DX_PI/2 ){
1232+ if( fabsf(camera_ry) < D3DX_PI/2 ){
12181233 vUpVecF_x = 0.0f; vUpVecF_y = 1.0f; vUpVecF_z = 0.0f;
12191234 }
12201235 else{
--- trunk/d3dgraphics-opengl.cpp (revision 292)
+++ trunk/d3dgraphics-opengl.cpp (revision 293)
@@ -50,6 +50,7 @@
5050 //! @brief コンストラクタ
5151 D3DGraphics::D3DGraphics()
5252 {
53+ hWnd = NULL;
5354 hGLRC = NULL;
5455 width = 0;
5556 height = 0;
@@ -71,13 +72,22 @@
7172 viewangle = 0.0f;
7273
7374 blockdata = NULL;
75+ bs = 0;
7476 for(int i=0; i<TOTAL_BLOCKTEXTURE; i++){
7577 mapTextureID[i] = -1;
7678 }
7779
80+ TextureFontFname[0] = '\0';
7881 TextureFont = -1;
7982
83+ for( int i=0; i<TOTAL_HAVEWEAPON; i++ ){
84+ HUD_myweapon_x[i] = 0.0f;
85+ HUD_myweapon_y[i] = 0.0f;
86+ HUD_myweapon_z[i] = 0.0f;
87+ }
88+
8089 #ifdef ENABLE_DEBUGCONSOLE
90+ ZeroMemory(DebugFontData, sizeof(unsigned char)*96*16);
8191 TextureDebugFont = -1;
8292 #endif
8393 }
@@ -624,21 +634,23 @@
624634 }
625635 }
626636
627- //色情報配列を用意
628- ColorAry[0] = 1.0f;
629- ColorAry[1] = 1.0f;
630- ColorAry[2] = 1.0f;
631- ColorAry[3] = 1.0f;
632- for(int i=1; i<cnt; i++){
633- memcpy(&(ColorAry[i*4]), ColorAry, sizeof(float)*4);
637+ if( polygons > 0 ){
638+ //色情報配列を用意
639+ ColorAry[0] = 1.0f;
640+ ColorAry[1] = 1.0f;
641+ ColorAry[2] = 1.0f;
642+ ColorAry[3] = 1.0f;
643+ for(int i=1; i<cnt; i++){
644+ memcpy(&(ColorAry[i*4]), ColorAry, sizeof(float)*4);
645+ }
646+ ColorGrayAry[0] = 0.8f;
647+ ColorGrayAry[1] = 0.8f;
648+ ColorGrayAry[2] = 0.8f;
649+ ColorGrayAry[3] = 1.0f;
650+ for(int i=1; i<cnt; i++){
651+ memcpy(&(ColorGrayAry[i*4]), ColorGrayAry, sizeof(float)*4);
652+ }
634653 }
635- ColorGrayAry[0] = 0.8f;
636- ColorGrayAry[1] = 0.8f;
637- ColorGrayAry[2] = 0.8f;
638- ColorGrayAry[3] = 1.0f;
639- for(int i=1; i<cnt; i++){
640- memcpy(&(ColorGrayAry[i*4]), ColorGrayAry, sizeof(float)*4);
641- }
642654
643655 delete [] vertex;
644656 delete [] index;
@@ -1738,7 +1750,7 @@
17381750 {
17391751 float camera_y_flag;
17401752
1741- if( fabs(camera_ry) <= (float)M_PI/2 ){
1753+ if( fabsf(camera_ry) <= (float)M_PI/2 ){
17421754 camera_y_flag = 1.0f;
17431755 }
17441756 else{
@@ -1746,7 +1758,7 @@
17461758 }
17471759
17481760 //真上or真下を向いているならば、カメラの上部指定を反転する。※DirectXと仕様を合わせるため
1749- if( fabs(camera_ry) == (float)M_PI/2 ){
1761+ if( fabsf(camera_ry) == (float)M_PI/2 ){
17501762 camera_y_flag *= -1;
17511763 }
17521764
--- trunk/d3dgraphics.h (revision 292)
+++ trunk/d3dgraphics.h (revision 293)
@@ -97,6 +97,8 @@
9797 #pragma comment(lib, "lib/zlib/zlib.lib")
9898 #pragma comment(lib, "lib/libpng/libpng.lib")
9999
100+//#pragma comment(lib, "legacy_stdio_definitions.lib")
101+
100102 #pragma comment(linker, "/NODEFAULTLIB:libcmt.lib")
101103 #pragma comment(linker, "/NODEFAULTLIB:libcpmt.lib")
102104
--- trunk/datafile.cpp (revision 292)
+++ trunk/datafile.cpp (revision 293)
@@ -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)sqrtf(xs1 * xs1 + ys1 * ys1 + zs1 * zs1);
225+ g1 = 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)sqrtf(xs2 * xs2 + ys2 * ys2 + zs2 * zs2);
231+ g2 = sqrtf(xs2 * xs2 + ys2 * ys2 + zs2 * zs2);
232232
233233 //正しい計算結果を採用する
234234 if( g1 > g2 ){
@@ -253,7 +253,7 @@
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 = sqrtf(fabs(rx*rx + ry*ry + rz*rz)) / 2.0f;
256+ //a = sqrtf(fabsf(rx*rx + ry*ry + rz*rz)) / 2.0f;
257257 //data[i].material[j].shadow = a/2 + 0.5f;
258258 a = sqrtf(rx*rx + ry*ry + rz*rz) / 3.0f;
259259 data[i].material[j].shadow = a/2;
--- trunk/gamemain.cpp (revision 292)
+++ trunk/gamemain.cpp (revision 293)
@@ -3281,7 +3281,7 @@
32813281 z = in_z - camera_z;
32823282
32833283 //近ければ処理する
3284- if( (check == false) || ((fabs(x) < RadarWorldR*2)&&(fabs(z) < RadarWorldR*2)&&(fabs(y) < 80.0f)) ){
3284+ if( (check == false) || ((fabsf(x) < RadarWorldR*2)&&(fabsf(z) < RadarWorldR*2)&&(fabsf(y) < 80.0f)) ){
32853285 //角度を距離を計算
32863286 rx = atan2f(z, x);
32873287 r = sqrtf(x*x + z*z);
@@ -3292,7 +3292,7 @@
32923292 z2 = sinf(rx2) * r;
32933293
32943294 //収まるか判定
3295- if( (check == false) || ((fabs(x2) < RadarWorldR)&&(fabs(z2) < RadarWorldR)) ){
3295+ if( (check == false) || ((fabsf(x2) < RadarWorldR)&&(fabsf(z2) < RadarWorldR)) ){
32963296 //描画座標を計算
32973297 r2 = r / RadarWorldR * (RadarSize/2);
32983298 *out_x = (int)(RadarPosX+RadarSize/2 + cosf(rx2) * r2);
@@ -3386,7 +3386,7 @@
33863386
33873387 if( GetRadarPos(data.x, data.y, data.z, RadarPosX, RadarPosY, RadarSize, RadarWorldR, &x_2d, &y_2d, &y, true) == true ){
33883388 //高さによる透明度
3389- if( (fabs(y) < 40.0f) ){
3389+ if( (fabsf(y) < 40.0f) ){
33903390 alpha = 1.0f;
33913391 }
33923392 else{
@@ -3430,7 +3430,7 @@
34303430
34313431 if( GetRadarPos(tx, ty, tz, RadarPosX, RadarPosY, RadarSize, RadarWorldR, &x_2d, &y_2d, &y, true) == true ){
34323432 //高さによる透明度
3433- if( (fabs(y) < 40.0f) ){
3433+ if( (fabsf(y) < 40.0f) ){
34343434 alpha = 1.0f;
34353435 }
34363436 else{
--- trunk/input.cpp (revision 292)
+++ trunk/input.cpp (revision 293)
@@ -34,6 +34,7 @@
3434 //! @brief コンストラクタ
3535 InputControl::InputControl()
3636 {
37+ hWnd = NULL;
3738 #if INPUT_INTERFACE == 2
3839 pDI = NULL;
3940 pDIDevice = NULL;
@@ -51,6 +52,10 @@
5152 //マウスの設定値初期化
5253 mx = 0;
5354 my = 0;
55+#if INPUT_INTERFACE == 0
56+ point_lt.x = 0;
57+ point_lt.y = 0;
58+#endif
5459 mbl = false;
5560 mbr = false;
5661 mbl_lt = mbl;
@@ -280,7 +285,7 @@
280285 memcpy(keys_lt, keys, sizeof(char)*256);
281286
282287 //現在のキーボード入力を取得
283- GetKeyboardState((PBYTE)&keys);
288+ if( GetKeyboardState((PBYTE)&keys) == 0 ){ return; }
284289 #elif INPUT_INTERFACE == 1
285290 //取得直前のキー情報を、前フレーム情報として記録
286291 memcpy(keys_lt, keys, sizeof(char)*256);
--- trunk/main.h (revision 292)
+++ trunk/main.h (revision 293)
@@ -88,7 +88,7 @@
8888
8989 //BorlandC++ Compiler用の処理
9090 #ifdef __BORLANDC__
91- #define sqrtf(df) sqrtf(df)
91+ //#define sqrtf(df) sqrt(df)
9292 int _matherr(struct _exception *__e) { return 1; }
9393 #endif
9494
@@ -101,6 +101,8 @@
101101 #ifndef _MSC_VER
102102 #define sinf(x) (float)sin(x) //!< sinf(x)
103103 #define cosf(x) (float)cos(x) //!< cosf(x)
104+ #define asinf(x) (float)asin(x) //!< asinf(x)
105+ #define acosf(x) (float)acos(x) //!< acosf(x)
104106 #define atan2f(y,x) (float)atan2(y,x) //!< atan2f(y,x)
105107 #define sqrtf(x) (float)sqrt(x) //!< sqrtf(x)
106108 #define floorf(x) (float)floor(x) //!< floorf(x)
--- trunk/object.cpp (revision 292)
+++ trunk/object.cpp (revision 293)
@@ -1183,7 +1183,7 @@
11831183
11841184 if( deadstate == 1 ){
11851185 //135度以上倒れていれば
1186- if( fabs(rotation_y) >= DegreeToRadian(135) ){
1186+ if( fabsf(rotation_y) >= DegreeToRadian(135) ){
11871187 deadstate = 2;
11881188 move_y = 0.0f;
11891189 return 2;
@@ -1191,7 +1191,7 @@
11911191
11921192 if( pos_y <= (HUMAN_DEADLINE + 10.0f) ){
11931193 //90度以上倒れていれば
1194- if( fabs(rotation_y) >= DegreeToRadian(90) ){
1194+ if( fabsf(rotation_y) >= DegreeToRadian(90) ){
11951195 deadstate = 4;
11961196 return 2;
11971197 }
@@ -1254,7 +1254,7 @@
12541254 //deadstate = 4;
12551255
12561256 //90度以上倒れていれば
1257- if( fabs(rotation_y) >= DegreeToRadian(90) ){
1257+ if( fabsf(rotation_y) >= DegreeToRadian(90) ){
12581258 deadstate = 4;
12591259 return 2;
12601260 }
@@ -1308,7 +1308,7 @@
13081308
13091309 return 0;
13101310 #else
1311- if( fabs(rotation_y) >= DegreeToRadian(90) ){
1311+ if( fabsf(rotation_y) >= DegreeToRadian(90) ){
13121312 return 4;
13131313 }
13141314 else if( rotation_y > 0.0f ){ //倒れ始めていれば、そのまま倒れる。
@@ -1481,7 +1481,7 @@
14811481 }
14821482
14831483 //斜面を登る
1484- if( (fabs(move_x) > 0.2f)||(fabs(move_z) > 0.2f) ){
1484+ if( (fabsf(move_x) > 0.2f)||(fabsf(move_z) > 0.2f) ){
14851485 if( move_y_upper == 0 ){
14861486 if(
14871487 (CollD->CheckALLBlockInside(pos_x + dist_x*2.0f, pos_y, pos_z + dist_z*2.0f) == true)&&
@@ -1609,8 +1609,8 @@
16091609
16101610 //落下ダメージを与える
16111611 if( move_y < HUMAN_DAMAGE_MINSPEED ){
1612- //hp -= GetRand(6) + (int)( fabs(move_y + HUMAN_DAMAGE_MINSPEED)*37.5f );
1613- hp -= GetRand(6) + (int)((float)HUMAN_DAMAGE_MAXFALL / fabs(HUMAN_DAMAGE_MAXSPEED - (HUMAN_DAMAGE_MINSPEED)) * fabs(move_y - (HUMAN_DAMAGE_MINSPEED)));
1612+ //hp -= GetRand(6) + (int)( fabsf(move_y + HUMAN_DAMAGE_MINSPEED)*37.5f );
1613+ hp -= GetRand(6) + (int)((float)HUMAN_DAMAGE_MAXFALL / fabsf(HUMAN_DAMAGE_MAXSPEED - (HUMAN_DAMAGE_MINSPEED)) * fabsf(move_y - (HUMAN_DAMAGE_MINSPEED)));
16141614 }
16151615
16161616 move_y = 0.0f;
@@ -3214,7 +3214,7 @@
32143214 float move_rx2;
32153215
32163216 //足の向きを求める
3217- if( fabs(move_rx) > DegreeToRadian(90)){
3217+ if( fabsf(move_rx) > DegreeToRadian(90)){
32183218 move_rx2 = move_rx + (float)M_PI;
32193219 }
32203220 else{
--- trunk/objectmanager.cpp (revision 292)
+++ trunk/objectmanager.cpp (revision 293)
@@ -2561,7 +2561,7 @@
25612561 int team;
25622562
25632563 //角度上、視界に入っていれば
2564- if( fabs(rx) < DegreeToRadian(10) ){
2564+ if( fabsf(rx) < DegreeToRadian(10) ){
25652565 HumanIndex[i].GetParamData(NULL, NULL, NULL, &team);
25662566 if( team == Player_teamID ){
25672567 *color = d3dg->GetColorCode(0.0f,0.0f,1.0f,1.0f);
@@ -2588,7 +2588,7 @@
25882588 //視点を基準に対象までの角度を算出
25892589 if( CheckTargetAngle(camera_x, camera_y, camera_z, camera_rx, camera_ry, px, py, pz, dist, &rx, &ry, &r) == true ){
25902590 //角度上、視界に入っていれば
2591- if( (fabs(rx) < DegreeToRadian(10))&&(fabs(ry) < DegreeToRadian(10)) ){
2591+ if( (fabsf(rx) < DegreeToRadian(10))&&(fabsf(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));
25942594 dist = sqrtf(r);
@@ -2605,7 +2605,7 @@
26052605 //視点を基準に対象までの角度を算出
26062606 if( CheckTargetAngle(camera_x, camera_y, camera_z, camera_rx, camera_ry, px, py, pz, dist, &rx, &ry, &r) == true ){
26072607 //角度上、視界に入っていれば
2608- if( (fabs(rx) < DegreeToRadian(10))&&(fabs(ry) < DegreeToRadian(10)) ){
2608+ if( (fabsf(rx) < DegreeToRadian(10))&&(fabsf(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());
26112611 dist = sqrtf(r);
--- trunk/resource.cpp (revision 292)
+++ trunk/resource.cpp (revision 293)
@@ -60,6 +60,7 @@
6060 weapon_texture[i] = -1;
6161 weapon_sound[i] = -1;
6262 }
63+ weapon_reloadsound = -1;
6364 for(int i=0; i<(TOTAL_PARAMETERINFO_SMALLOBJECT + MAX_ADDSMALLOBJECT); i++){
6465 smallobject_model[i] = -1;
6566 smallobject_texture[i] = -1;
--- trunk/scene.cpp (revision 292)
+++ trunk/scene.cpp (revision 293)
@@ -34,6 +34,7 @@
3434 //! @brief コンストラクタ
3535 scene::scene()
3636 {
37+ GameState = NULL;
3738 WindowCtrl = NULL;
3839 d3dg = NULL;
3940 inputCtrl = NULL;
@@ -157,7 +158,9 @@
157158
158159 //! @brief コンストラクタ
159160 D2Dscene::D2Dscene()
160-{}
161+{
162+ gametitle = -1;
163+}
161164
162165 //! @brief ディストラクタ
163166 D2Dscene::~D2Dscene()
@@ -214,7 +217,14 @@
214217
215218 //! @brief コンストラクタ
216219 D3Dscene::D3Dscene()
217-{}
220+{
221+ GameSound = NULL;
222+ camera_x = 0.0f;
223+ camera_y = 0.0f;
224+ camera_z = 0.0f;
225+ camera_rx = 0.0f;
226+ camera_ry = 0.0f;
227+}
218228
219229 //! @brief ディストラクタ
220230 D3Dscene::~D3Dscene()
--- trunk/sound-directsound.cpp (revision 292)
+++ trunk/sound-directsound.cpp (revision 293)
@@ -37,6 +37,11 @@
3737 SoundControl::SoundControl()
3838 {
3939 pDSound = NULL;
40+ for(int i=0;i<MAX_LOADSOUND; i++){
41+ for(int j=0; j<MAX_SOUNDLISTS; j++){
42+ pDSBuffer[i][j] = NULL;
43+ }
44+ }
4045 p3DListener = NULL;
4146 mastervolume = 1.0f;
4247 }
--- trunk/sound-ezds.cpp (revision 292)
+++ trunk/sound-ezds.cpp (revision 293)
@@ -37,6 +37,12 @@
3737 SoundControl::SoundControl()
3838 {
3939 lib = NULL;
40+ DSver = NULL;
41+ DSinit = NULL;
42+ DSend = NULL;
43+ DSload = NULL;
44+ DSplay = NULL;
45+ DSrelease = NULL;
4046
4147 //使用済みフラグを初期化
4248 for(int i=0; i<MAX_LOADSOUND; i++){
@@ -43,6 +49,10 @@
4349 useflag[i] = false;
4450 }
4551
52+ camera_x = 0.0f;
53+ camera_y = 0.0f;
54+ camera_z = 0.0f;
55+ camera_rx = 0.0f;
4656 mastervolume = 1.0f;
4757 }
4858
@@ -81,25 +91,22 @@
8191 DSplay = (FARPROCIII)GetProcAddress(lib, "DSplay");
8292 DSrelease = (FARPROCI)GetProcAddress(lib, "DSrelease");
8393
84- //DLL初期化を実行
85- if( DSinit == NULL ){
86- //DLLを開放
87- FreeLibrary(lib);
88- lib = NULL;
89- //return 1;
90- }
91- if( DSinit(WindowCtrl->GethWnd()) == 0 ){
92- //DLLを開放
93- FreeLibrary(lib);
94- lib = NULL;
95- //return 1;
96- }
97-
94+ if( DSinit != NULL ){
95+ //DLL初期化を実行
96+ if( DSinit(WindowCtrl->GethWnd()) != 0 ){
9897 #ifdef ENABLE_DEBUGLOG
99- //ログに出力
100- OutputLog.WriteLog(LOG_COMPLETE, "", "");
98+ //ログに出力
99+ OutputLog.WriteLog(LOG_COMPLETE, "", "");
101100 #endif
101+ return 0;
102+ }
103+ }
102104
105+ //DLLを開放
106+ FreeLibrary(lib);
107+ lib = NULL;
108+
109+ //return 1;
103110 return 0;
104111 }
105112
--- trunk/soundmanager.cpp (revision 292)
+++ trunk/soundmanager.cpp (revision 293)
@@ -523,13 +523,13 @@
523523 float min_dist, dist;
524524
525525 //移動速度を求める
526- speed = (float)sqrtf(plist->move_x*plist->move_x + plist->move_y*plist->move_y + plist->move_z*plist->move_z);
526+ speed = 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)sqrtf(dist2 - min_dist*min_dist);
532+ dist = 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;