Revisão | 3837fca19f2ff272d35ded6bf33430b4173302d4 (tree) |
---|---|
Hora | 2012-10-29 00:18:43 |
Autor | h2so5 <h2so5@git....> |
Commiter | h2so5 |
FieldPlayer.hpp, PlayerManager.cpp の文字コードを変更
一部の警告箇所を修正
@@ -266,7 +266,7 @@ void GameLoop::MoveCamera(InputManager* input) | ||
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - float pad_rz = input->GetGamepadManagedAnalogRy(); | |
269 | + float pad_rz = static_cast<float>(input->GetGamepadManagedAnalogRy()); | |
270 | 270 | if (pad_rz > 0) { |
271 | 271 | if (camera.radius > CAMERA_MIN_RADIUS) { |
272 | 272 | camera.radius -= 0.5f * pad_rz; |
@@ -503,9 +503,9 @@ float LightStatus::SolarPosition4(float julius_year) | ||
503 | 503 | |
504 | 504 | float LightStatus::SolarAltitude(float latitude,float sidereal_hour,float solar_declination,float right_ascension) |
505 | 505 | { |
506 | - long float a = (sidereal_hour - solar_declination) * (DX_PI_F / 180.0L); | |
507 | - long float h = sin(TORADIAN(right_ascension)) * sin(TORADIAN(latitude)) + cos(TORADIAN(right_ascension)) * cos(TORADIAN(latitude)) * cos(a); | |
508 | - h = asin(h) * 180.0 / DX_PI_F; | |
506 | + float a =(sidereal_hour - solar_declination) * (DX_PI_F / 180.0L); | |
507 | + float h = sin(TORADIAN(right_ascension)) * sin(TORADIAN(latitude)) + cos(TORADIAN(right_ascension)) * cos(TORADIAN(latitude)) * cos(a); | |
508 | + h = static_cast<float>(asin(h) * 180.0 / DX_PI_F); | |
509 | 509 | return h; |
510 | 510 | } |
511 | 511 |
@@ -533,7 +533,7 @@ float LightStatus::SolarApparentAltitude1(float altitude,float distance) | ||
533 | 533 | { |
534 | 534 | auto e = 0.035333333 * sqrt(altitude); |
535 | 535 | auto p = 0.002442818 / distance; |
536 | - return p - e; | |
536 | + return static_cast<float>(p - e); | |
537 | 537 | } |
538 | 538 | |
539 | 539 | float LightStatus::SolarApparentAltitude2(float altitude,float distance) |
@@ -541,7 +541,7 @@ float LightStatus::SolarApparentAltitude2(float altitude,float distance) | ||
541 | 541 | auto s = 0.266994444 / distance; |
542 | 542 | auto r = 0.585555555; |
543 | 543 | auto k = SolarApparentAltitude1(altitude, distance) - s - r; |
544 | - return k; | |
544 | + return static_cast<float>(k); | |
545 | 545 | } |
546 | 546 | |
547 | 547 | void LightStatus::SetGrobalAmbientColorMatchToTime() |
@@ -266,7 +266,7 @@ JsonGen::JsonGen() | ||
266 | 266 | } while (FindNextFile(hPmdFind, &win32fd_pmd)); |
267 | 267 | FindClose(hPmdFind); |
268 | 268 | |
269 | - for(int i = 0;i < pmd_paths.size();++i){ | |
269 | + for(unsigned int i = 0;i < pmd_paths.size();++i){ | |
270 | 270 | char pmd_info[PMDINFO_SIZE+1]; |
271 | 271 | int fd = _topen(pmd_paths[i].c_str(),O_RDONLY); |
272 | 272 | read(fd,pmd_info,PMDINFO_SIZE); |
@@ -275,7 +275,7 @@ JsonGen::JsonGen() | ||
275 | 275 | // モデル名取得 |
276 | 276 | strcpy_s(pmd_model_name_,pmd_info+7); |
277 | 277 | Trim(pmd_model_name_); |
278 | - int cnt = 0x1b; | |
278 | + unsigned int cnt = 0x1b; | |
279 | 279 | size_t info_size = ADFUNC_DXconvAnsiToWide(0,0,pmd_info+cnt); |
280 | 280 | TCHAR *pmd_info_t = new TCHAR[info_size + 1]; |
281 | 281 | ADFUNC_DXconvAnsiToWide(info_size,pmd_info_t,pmd_info+cnt); |
@@ -171,8 +171,8 @@ void MainLoop::Draw() | ||
171 | 171 | |
172 | 172 | if (world_manager_->stage()->IsVisiblePoint(point)) { |
173 | 173 | auto screen_pos = ConvWorldPosToScreenPos(point); |
174 | - int x = (screen_pos.x / 2) * 2; | |
175 | - int y = (screen_pos.y / 2) * 2 - 16; | |
174 | + int x = static_cast<int>(screen_pos.x / 2) * 2; | |
175 | + int y = static_cast<int>(screen_pos.y / 2) * 2 - 16; | |
176 | 176 | |
177 | 177 | UILabel label_; |
178 | 178 | label_.set_width(160); |
@@ -200,7 +200,10 @@ void MainLoop::Draw() | ||
200 | 200 | SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); |
201 | 201 | auto str = unicode::ToTString(_T("サーバーとの接続が切断されました")); |
202 | 202 | auto width = GetDrawStringWidthToHandle(str.c_str(),str.length(),ResourceManager::default_font_handle()); |
203 | - DrawStringToHandle(config_manager_->screen_width()/2.0f - width,config_manager_->screen_height()/2.0f - ResourceManager::default_font_size(),str.c_str(),GetColor(255,255,255),ResourceManager::default_font_handle()); | |
203 | + DrawStringToHandle( | |
204 | + config_manager_->screen_width() / 2 - width, | |
205 | + config_manager_->screen_height() / 2 - ResourceManager::default_font_size(), | |
206 | + str.c_str(),GetColor(255,255,255),ResourceManager::default_font_handle()); | |
204 | 207 | SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); |
205 | 208 | } |
206 | 209 |
@@ -286,7 +286,7 @@ void Input::Draw() | ||
286 | 286 | c, text_color, font_handle_); |
287 | 287 | width += GetDrawStringWidthToHandle(c,1,font_handle_); |
288 | 288 | } |
289 | - for(int i = select_start;i < ((select_end > it.size()) ? it.size() : select_end); ++i){ | |
289 | + for(int i = select_start;i < ((select_end > static_cast<int>(it.size())) ? it.size() : select_end); ++i){ | |
290 | 290 | c[0] = it[i]; |
291 | 291 | SetDrawBlendMode(DX_BLENDMODE_ALPHA, 180); |
292 | 292 | DrawBox(internal_x + width,internal_y + current_line * font_height_, |
@@ -296,7 +296,7 @@ void Input::Draw() | ||
296 | 296 | width += GetDrawStringWidthToHandle(c,1,font_handle_); |
297 | 297 | SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); |
298 | 298 | } |
299 | - for(int i = ((select_end > it.size()) ? it.size() : select_end);i < it.size(); ++i){ | |
299 | + for(int i = ((select_end > static_cast<int>(it.size())) ? it.size() : select_end);i < it.size(); ++i){ | |
300 | 300 | c[0] = it[i]; |
301 | 301 | DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_, |
302 | 302 | c, text_color, font_handle_); |
@@ -335,7 +335,7 @@ void Input::Draw() | ||
335 | 335 | width += GetDrawStringWidthToHandle(c,1,font_handle_); |
336 | 336 | SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); |
337 | 337 | } |
338 | - for(int i = select_end;i < it.size(); ++i){ | |
338 | + for(unsigned int i = select_end;i < it.size(); ++i){ | |
339 | 339 | c[0] = it[i]; |
340 | 340 | DrawStringToHandle(internal_x + width, internal_y + current_line * font_height_, |
341 | 341 | c, text_color, font_handle_); |
@@ -626,7 +626,7 @@ void Input::ProcessInput(InputManager* input) | ||
626 | 626 | for(int i = 0;i < line_num; ++i){ |
627 | 627 | cnt += lines_[i].size(); |
628 | 628 | } |
629 | - for(int i = 0;i < lines_[line_num].size(); ++i){ | |
629 | + for(unsigned int i = 0;i < lines_[line_num].size(); ++i){ | |
630 | 630 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_); |
631 | 631 | if( tmp + tmp_x < offset_x ){ |
632 | 632 | tmp += tmp_x; |
@@ -637,7 +637,7 @@ void Input::ProcessInput(InputManager* input) | ||
637 | 637 | } |
638 | 638 | }else{ |
639 | 639 | int tmp = 0,cnt = 0; |
640 | - for(int i = 0;i < lines_[0].size(); ++i){ | |
640 | + for(unsigned int i = 0;i < lines_[0].size(); ++i){ | |
641 | 641 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_); |
642 | 642 | if( tmp + tmp_x < offset_x ){ |
643 | 643 | tmp += tmp_x; |
@@ -671,7 +671,7 @@ void Input::ProcessInput(InputManager* input) | ||
671 | 671 | for(int i = 0;i < line_num; ++i,++cnt){ |
672 | 672 | cnt += lines_[i].size(); |
673 | 673 | } |
674 | - for(int i = 0;i < lines_[line_num].size(); ++i){ | |
674 | + for(unsigned int i = 0;i < lines_[line_num].size(); ++i){ | |
675 | 675 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_); |
676 | 676 | if( tmp + tmp_x < offset_x ){ |
677 | 677 | tmp += tmp_x; |
@@ -682,7 +682,7 @@ void Input::ProcessInput(InputManager* input) | ||
682 | 682 | selecting_coursorpoint_ = std::make_pair<int,int>(prev_cursor_pos,cnt); |
683 | 683 | }else{ |
684 | 684 | int tmp = 0,cnt = 0; |
685 | - for(int i = 0;i < lines_[0].size(); ++i){ | |
685 | + for(unsigned int i = 0;i < lines_[0].size(); ++i){ | |
686 | 686 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_); |
687 | 687 | if( tmp + tmp_x < offset_x ){ |
688 | 688 | tmp += tmp_x; |
@@ -719,7 +719,7 @@ void Input::ProcessInput(InputManager* input) | ||
719 | 719 | for(int i = 0;i < line_num; ++i){ |
720 | 720 | cnt += lines_[i].size(); |
721 | 721 | } |
722 | - for(int i = 0;i < lines_[line_num].size(); ++i){ | |
722 | + for(unsigned int i = 0;i < lines_[line_num].size(); ++i){ | |
723 | 723 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[line_num][i],1,font_handle_); |
724 | 724 | if( tmp + tmp_x < offset_x ){ |
725 | 725 | tmp += tmp_x; |
@@ -730,7 +730,7 @@ void Input::ProcessInput(InputManager* input) | ||
730 | 730 | } |
731 | 731 | }else{ |
732 | 732 | int tmp = 0,cnt = 0; |
733 | - for(int i = 0;i < lines_[0].size(); ++i){ | |
733 | + for(unsigned int i = 0;i < lines_[0].size(); ++i){ | |
734 | 734 | auto tmp_x = GetDrawStringWidthToHandle(&lines_[0][i],1,font_handle_); |
735 | 735 | if( tmp + tmp_x < offset_x ){ |
736 | 736 | tmp += tmp_x; |
@@ -66,7 +66,7 @@ std::string Encrypter::GetPublicKey() | ||
66 | 66 | ByteQueue queue; |
67 | 67 | public_key_.Save(queue); |
68 | 68 | |
69 | - size_t length = queue.CurrentSize(); | |
69 | + size_t length = static_cast<size_t>(queue.CurrentSize()); | |
70 | 70 | std::unique_ptr<char[]> outbuf(new char [length]); |
71 | 71 | queue.Get((byte*)outbuf.get(), length); |
72 | 72 |
@@ -86,7 +86,7 @@ std::string Encrypter::GetPrivateKey() | ||
86 | 86 | ByteQueue queue; |
87 | 87 | private_key_.Save(queue); |
88 | 88 | |
89 | - size_t length = queue.CurrentSize(); | |
89 | + size_t length = static_cast<size_t>(queue.CurrentSize()); | |
90 | 90 | std::unique_ptr<char[]> outbuf(new char [length]); |
91 | 91 | queue.Get((byte*)outbuf.get(), length); |
92 | 92 |
@@ -56,7 +56,7 @@ std::string Signature::GetPublicKey() | ||
56 | 56 | ByteQueue queue; |
57 | 57 | public_key_.Save(queue); |
58 | 58 | |
59 | - size_t length = queue.CurrentSize(); | |
59 | + size_t length = static_cast<size_t>(queue.CurrentSize()); | |
60 | 60 | std::unique_ptr<char[]> outbuf(new char [length]); |
61 | 61 | queue.Get((byte*)outbuf.get(), length); |
62 | 62 |
@@ -76,7 +76,7 @@ std::string Signature::GetPrivateKey() | ||
76 | 76 | ByteQueue queue; |
77 | 77 | private_key_.Save(queue); |
78 | 78 | |
79 | - size_t length = queue.CurrentSize(); | |
79 | + size_t length = static_cast<size_t>(queue.CurrentSize()); | |
80 | 80 | std::unique_ptr<char[]> outbuf(new char [length]); |
81 | 81 | queue.Get((byte*)outbuf.get(), length); |
82 | 82 |