• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión7ad45337ec050e56afa6027c8436da0fdff547e7 (tree)
Tiempo2012-09-28 06:39:25
Autorh2so5 <h2so5@git....>
Commiterh2so5

Log Message

package.pyを更新
シーン遷移の構造を少し変更

Cambiar Resumen

Diferencia incremental

--- a/client/ConfigManager.cpp
+++ b/client/ConfigManager.cpp
@@ -64,6 +64,12 @@ void ConfigManager::Load(const std::string& filename)
6464
6565 void ConfigManager::Save(const std::string& filename)
6666 {
67+ namespace fs = boost::filesystem;
68+ auto dir_path = fs::path(filename).parent_path();
69+ if (!fs::exists(dir_path)) {
70+ fs::create_directory(dir_path);
71+ }
72+
6773 ptree pt;
6874
6975 pt.put("show_nametag", show_nametag_);
--- a/client/scene/Base.hpp
+++ b/client/scene/Base.hpp
@@ -21,7 +21,11 @@ class Base : public std::enable_shared_from_this<Base> {
2121 virtual void ProcessInput(InputManager*) = 0;
2222 virtual void Draw() = 0;
2323 virtual void End() = 0;
24- virtual BasePtr NextScene() {return BasePtr();};
24+ virtual BasePtr NextScene() {return next_scene_;};
25+
26+ protected:
27+ BasePtr next_scene_;
28+
2529 };
2630
2731 }
--- a/client/scene/Connect.cpp
+++ b/client/scene/Connect.cpp
@@ -97,6 +97,12 @@ void Connect::Update()
9797 button_.Update();
9898 button_label_.Update();
9999 message_.Update();
100+
101+ if (command_manager_->status() == CommandManager::STATUS_READY) {
102+ next_scene_= std::make_shared<scene::MainLoop>(manager_accessor_);
103+ } else if (return_flag_) {
104+ next_scene_= std::make_shared<scene::Title>(manager_accessor_);
105+ }
100106 }
101107
102108 void Connect::ProcessInput(InputManager* input)
@@ -119,16 +125,4 @@ void Connect::End()
119125 {
120126 }
121127
122-BasePtr Connect::NextScene()
123-{
124- InputManager input;
125- if (command_manager_->status() == CommandManager::STATUS_READY) {
126- return BasePtr(new scene::MainLoop(manager_accessor_));
127- } else if (return_flag_) {
128- return BasePtr(new scene::Title(manager_accessor_));
129- } else {
130- return BasePtr();
131- }
132-}
133-
134128 }
--- a/client/scene/Connect.hpp
+++ b/client/scene/Connect.hpp
@@ -22,7 +22,6 @@ class Connect : public Base {
2222 void ProcessInput(InputManager*);
2323 void Draw();
2424 void End();
25- BasePtr NextScene();
2625
2726 private:
2827 void AsyncInitialize();
@@ -40,7 +39,6 @@ class Connect : public Base {
4039
4140 bool return_flag_;
4241
43- BasePtr next_scene_;
4442 };
4543
4644 }
--- a/client/scene/Dashboard.cpp
+++ b/client/scene/Dashboard.cpp
@@ -3,6 +3,7 @@
33 //
44
55 #include "Dashboard.hpp"
6+#include "Option.hpp"
67 #include "../ManagerAccessor.hpp"
78 #include "../AccountManager.hpp"
89 #include "../CommandManager.hpp"
@@ -27,11 +28,6 @@ Dashboard::Dashboard(const ManagerAccessorPtr& manager_accessor,
2728 start_count_(0),
2829 end_count_(0)
2930 {
30-
31- // TODO: 描画をDashbordに移管するためにNullにしているが、
32- // 紛らわしいので修正予定
33- manager_accessor_->set_window_manager(WindowManagerWeakPtr());
34-
3531 manager_accessor_->set_config_manager(config_manager_);
3632 manager_accessor_->set_card_manager(card_manager_);
3733 manager_accessor_->set_account_manager(account_manager_);
@@ -50,6 +46,9 @@ Dashboard::~Dashboard()
5046
5147 void Dashboard::Begin()
5248 {
49+ // TODO: 描画をDashbordに移管するためにNullにしているが、
50+ // 紛らわしいので修正予定
51+ manager_accessor_->set_window_manager(WindowManagerWeakPtr());
5352 }
5453
5554 void Dashboard::Update()
@@ -101,6 +100,13 @@ void Dashboard::ProcessInput(InputManager* input)
101100 (!hover && (input->GetMouseLeftCount() == 1 || input->GetMouseRightCount() == 1))) {
102101 end_count_++;
103102 }
103+
104+ if (end_count_ > 10) {
105+ next_scene_ = background_scene_;
106+ } else if(input->GetKeyCount(KEY_INPUT_F1) == 1) {
107+ next_scene_ = std::make_shared<Option>(manager_accessor_, background_scene_);
108+ }
109+
104110 }
105111
106112 void Dashboard::Draw()
@@ -161,16 +167,7 @@ void Dashboard::Draw()
161167
162168 void Dashboard::End()
163169 {
164-
170+ manager_accessor_->set_window_manager(window_manager_);
165171 }
166172
167-BasePtr Dashboard::NextScene()
168-{
169- if (end_count_ > 10) {
170- manager_accessor_->set_window_manager(window_manager_);
171- return background_scene_;
172- } else {
173- return BasePtr();
174- }
175-}
176173 }
\ No newline at end of file
--- a/client/scene/Dashboard.hpp
+++ b/client/scene/Dashboard.hpp
@@ -25,7 +25,6 @@ class Dashboard : public Base {
2525 void ProcessInput(InputManager*);
2626 void Draw();
2727 void End();
28- BasePtr NextScene();
2928
3029 private:
3130 ManagerAccessorPtr manager_accessor_;
Binary files a/client/scene/Init.cpp and b/client/scene/Init.cpp differ
--- a/client/scene/Init.hpp
+++ b/client/scene/Init.hpp
@@ -25,7 +25,6 @@ class Init : public Base {
2525 void Draw();
2626 void ProcessInput(InputManager*);
2727 void End();
28- BasePtr NextScene();
2928
3029 private:
3130 void AsyncInitialize();
@@ -40,8 +39,6 @@ class Init : public Base {
4039 int start_count_;
4140
4241 boost::thread loading_thread_;
43- std::shared_ptr<BasePtr> next_scene_;
44-
4542 std::array<ImageHandlePtr, 5> loading_image_handle_;
4643
4744 boost::mutex mutex_;
--- a/client/scene/MainLoop.cpp
+++ b/client/scene/MainLoop.cpp
@@ -72,10 +72,23 @@ void MainLoop::Update()
7272 card_manager_->Update();
7373 world_manager_->Update();
7474 ResourceManager::music()->Update();
75+
7576 }
7677
7778 void MainLoop::ProcessInput(InputManager* input)
7879 {
80+ if(world_manager_->stage()->host_change_flag())
81+ {
82+ //account_manager_->set_host(world_manager_->stage()->host_change_flag().second);
83+ next_scene_ = std::make_shared<scene::ServerChange>(manager_accessor_);
84+ } else if (input->GetKeyCount(KEY_INPUT_F1) == 1) {
85+ inputbox_->Inactivate();
86+ next_scene_ = std::make_shared<scene::Option>(manager_accessor_, shared_from_this());
87+ } else if (input->GetKeyCount(KEY_INPUT_F2) == 1) {
88+ inputbox_->Inactivate();
89+ next_scene_ = std::make_shared<scene::Dashboard>(manager_accessor_, shared_from_this());
90+ }
91+
7992 if (auto window_manager = manager_accessor_->window_manager().lock()) {
8093 window_manager->ProcessInput(input);
8194 }
@@ -99,6 +112,7 @@ void MainLoop::ProcessInput(InputManager* input)
99112 SaveDrawScreenToPNG( 0, 0, config_manager_->screen_width(), config_manager_->screen_height(),tmp_str);
100113 snapshot_number_++;
101114 }
115+
102116 }
103117
104118 void MainLoop::Draw()
@@ -113,24 +127,7 @@ void MainLoop::Draw()
113127
114128 void MainLoop::End()
115129 {
116-}
117-
118-BasePtr MainLoop::NextScene()
119-{
120- InputManager input;
121- if(world_manager_->stage()->host_change_flag())
122- {
123- //account_manager_->set_host(world_manager_->stage()->host_change_flag().second);
124- return BasePtr(new scene::ServerChange(manager_accessor_));
125- } else if (input.GetKeyCount(KEY_INPUT_F1) == 1) {
126- inputbox_->Inactivate();
127- return BasePtr(new scene::Option(manager_accessor_, shared_from_this()));
128- } else if (input.GetKeyCount(KEY_INPUT_F2) == 1) {
129- inputbox_->Inactivate();
130- return BasePtr(new scene::Dashboard(manager_accessor_, shared_from_this()));
131- } else{
132- return nullptr;
133- }
130+ next_scene_ = BasePtr();
134131 }
135132
136133 }
--- a/client/scene/MainLoop.hpp
+++ b/client/scene/MainLoop.hpp
@@ -29,7 +29,6 @@ class MainLoop : public Base {
2929 void Draw();
3030 void ProcessInput(InputManager*);
3131 void End();
32- BasePtr NextScene();
3332
3433 private:
3534 std::function<void(const tstring&)> push_message_;
--- a/client/scene/Option.cpp
+++ b/client/scene/Option.cpp
@@ -3,6 +3,7 @@
33 //
44
55 #include "Option.hpp"
6+#include "Dashboard.hpp"
67 #include "../ManagerAccessor.hpp"
78 #include "../ConfigManager.hpp"
89 #include "../CommandManager.hpp"
@@ -89,6 +90,12 @@ void Option::Update()
8990
9091 void Option::ProcessInput(InputManager* input)
9192 {
93+ if (end_count_ > 10) {
94+ next_scene_ = background_scene_;
95+ } else if(input->GetKeyCount(KEY_INPUT_F2) == 1) {
96+ next_scene_ = std::make_shared<Dashboard>(manager_accessor_, background_scene_);
97+ }
98+
9299 bool hover = (base_rect_.x <= input->GetMouseX() && input->GetMouseX() <= base_rect_.x + base_rect_.width
93100 && base_rect_.y <= input->GetMouseY() && input->GetMouseY() <= base_rect_.y + base_rect_.height);
94101
@@ -120,6 +127,7 @@ void Option::ProcessInput(InputManager* input)
120127 }
121128
122129 tabs_[selecting_tab_index]->ProcessInput(input);
130+
123131 }
124132
125133 void Option::Draw()
@@ -211,15 +219,6 @@ void Option::End()
211219
212220 }
213221
214-BasePtr Option::NextScene()
215-{
216- if (end_count_ > 10) {
217- return background_scene_;
218- } else {
219- return BasePtr();
220- }
221-}
222-
223222 OptionTabBase::OptionTabBase(const tstring name, const ManagerAccessorPtr& manager_accessor) :
224223 name_(name),
225224 manager_accessor_(manager_accessor)
--- a/client/scene/Option.hpp
+++ b/client/scene/Option.hpp
@@ -31,7 +31,6 @@ class Option : public Base {
3131 void ProcessInput(InputManager*);
3232 void Draw();
3333 void End();
34- BasePtr NextScene();
3534
3635 private:
3736 void AsyncInitialize();
--- a/client/scene/ServerChange.cpp
+++ b/client/scene/ServerChange.cpp
@@ -31,6 +31,11 @@ void ServerChange::End()
3131
3232 void ServerChange::Update()
3333 {
34+ if(world_manager_->stage()->host_change_flag())
35+ {
36+ //account_manager_->set_host(world_manager_->stage()->host_change_flag().second);
37+ next_scene_ = std::make_shared<scene::MainLoop>(manager_accessor_);
38+ }
3439 }
3540
3641 void ServerChange::ProcessInput(InputManager* input)
@@ -42,16 +47,4 @@ void ServerChange::Draw()
4247 {
4348 }
4449
45-BasePtr ServerChange::NextScene()
46-{
47- if(world_manager_->stage()->host_change_flag())
48- {
49- //account_manager_->set_host(world_manager_->stage()->host_change_flag().second);
50- return BasePtr(new scene::MainLoop(manager_accessor_));
51- }else{
52- return nullptr;
53- }
54-}
55-
56-
5750 }
\ No newline at end of file
--- a/client/scene/ServerChange.hpp
+++ b/client/scene/ServerChange.hpp
@@ -20,15 +20,13 @@ class ServerChange : public Base{
2020 void ProcessInput(InputManager*);
2121 void Draw();
2222 void End();
23- BasePtr NextScene();
23+
2424 private:
2525 ManagerAccessorPtr manager_accessor_;
2626 CardManagerPtr card_manager_;
2727 AccountManagerPtr account_manager_;
2828 ConfigManagerPtr config_manager_;
2929 WorldManagerPtr world_manager_;
30-
31- BasePtr next_scene_;
3230 };
3331
3432 }
\ No newline at end of file
Binary files a/client/scene/Title.cpp and b/client/scene/Title.cpp differ
--- a/client/scene/Title.hpp
+++ b/client/scene/Title.hpp
@@ -23,7 +23,6 @@ class Title : public Base {
2323 void ProcessInput(InputManager*);
2424 void Draw();
2525 void End();
26- BasePtr NextScene();
2726
2827 private:
2928 void AsyncInitialize();
@@ -41,7 +40,6 @@ class Title : public Base {
4140 bool connect_flag_;
4241 int screen_count_;
4342
44- BasePtr next_scene_;
4543 };
4644
4745 }
--- a/package.py
+++ b/package.py
@@ -36,13 +36,25 @@ def make_full_package():
3636 zip.write(os.path.join(bin_path, 'config.json'), 'config.json')
3737 zip.write(os.path.join(bin_path, 'server/server.exe'), 'server/server.exe')
3838
39- for root, dirs, files in os.walk(os.path.join(bin_path, 'cards')):
39+ for root, dirs, files in os.walk(os.path.join(bin_path, 'widgets')):
4040 for file in files:
4141 absolute_path = os.path.join(root, file)
4242 relative_path = os.path.relpath(absolute_path, bin_path)
4343 zip.write(absolute_path, relative_path)
4444
45- for root, dirs, files in os.walk(os.path.join(bin_path, 'resources')):
45+ for root, dirs, files in os.walk(os.path.join(bin_path, 'models')):
46+ for file in files:
47+ absolute_path = os.path.join(root, file)
48+ relative_path = os.path.relpath(absolute_path, bin_path)
49+ zip.write(absolute_path, relative_path)
50+
51+ for root, dirs, files in os.walk(os.path.join(bin_path, 'motions')):
52+ for file in files:
53+ absolute_path = os.path.join(root, file)
54+ relative_path = os.path.relpath(absolute_path, bin_path)
55+ zip.write(absolute_path, relative_path)
56+
57+ for root, dirs, files in os.walk(os.path.join(bin_path, 'system')):
4658 for file in files:
4759 absolute_path = os.path.join(root, file)
4860 relative_path = os.path.relpath(absolute_path, bin_path)