• 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ón2d0323631c85c0d3be5385b43fe5be76bddf0728 (tree)
Tiempo2012-09-23 14:54:02
Autorh2so5 <h2so5@git....>
Commiterh2so5

Log Message

Merge branch 'master' of git.sourceforge.jp:/gitroot/mmo/main

Cambiar Resumen

Diferencia incremental

--- a/client/Card.cpp
+++ b/client/Card.cpp
@@ -241,10 +241,10 @@ Handle<Value> Card::Function_Music_stopBGM(const Arguments& args)
241241 {
242242
243243 if (args.Length() == 1 && args[0]->IsBoolean()) {
244- auto fade = args[1]->ToBoolean()->BooleanValue();
244+ auto fade = args[0]->ToBoolean()->BooleanValue();
245245 ResourceManager::music()->Stop(fade);
246246 }else if(args.Length() == 0) {
247- ResourceManager::music()->Stop(false);
247+ ResourceManager::music()->Stop(true);
248248 }
249249
250250 return Undefined();
--- a/client/Music.cpp
+++ b/client/Music.cpp
@@ -9,15 +9,16 @@
99
1010 extern int LoadFile(const TCHAR *FilePath, void **FileImageAddr, int *FileSize);
1111
12+
1213 Music::Music() :
1314 bgm_handle_(),
1415 se_handle_(),
15-prev_bgm_(-1),
16-present_bgm_(-1),
17-requested_bgm_(-1),
18-music_paths_(),
1916 crossfade_now_(false),
20-fade_count_(0)
17+fade_out_(false),
18+fade_count_(-1),
19+present_bgm_(-1),
20+prev_bgm_(-1),
21+requested_bgm_(-1)
2122 {
2223 }
2324
@@ -137,8 +138,16 @@ void Music::Stop(bool fadeout)
137138 {
138139 StopSoundMem(present_bgm_);
139140 }
140- crossfade_now_ = fadeout;
141+ if(crossfade_now_)
142+ {
143+ StopSoundMem(present_bgm_);
144+ present_bgm_ = requested_bgm_;
145+ }
146+ crossfade_now_ = false;
147+ fade_out_ = fadeout;
148+ fadeout_count_ = GetVolumeSoundMem(present_bgm_);
141149 fade_count_ = 0;
150+ requested_bgm_ = -1;
142151 }
143152
144153 void Music::PlaySE(tstring name)
@@ -176,10 +185,12 @@ void Music::Update()
176185 crossfade_now_ = true;
177186 }
178187 }
179- if(!crossfade_now_)return;
180- if(CheckHandleASyncLoad(requested_bgm_) == false && requested_bgm_ != -1)
188+ if(CheckHandleASyncLoad(requested_bgm_) == false && requested_bgm_ != -1 && crossfade_now_)
181189 {
182190 if(fade_count_ == 0)PlaySoundMem(requested_bgm_,DX_PLAYTYPE_LOOP);
191+ ChangeVolumeSoundMem((int)((90.0-(double)fade_count_)/0.9),present_bgm_);
192+ ChangeVolumeSoundMem((int)((double)fade_count_/0.9),requested_bgm_);
193+ ++fade_count_;
183194 if(fade_count_ >= 90)
184195 {
185196 ChangeVolumeSoundMem(100,requested_bgm_);
@@ -190,9 +201,20 @@ void Music::Update()
190201 fade_count_ = 0;
191202 crossfade_now_ = false;
192203 }
193- ChangeVolumeSoundMem((int)((double)fade_count_/0.9),requested_bgm_);
194- ChangeVolumeSoundMem((int)((90.0-(double)fade_count_)/0.9),present_bgm_);
195- ++fade_count_;
204+ }
205+ if(fade_out_ == true)
206+ {
207+ if(fadeout_count_ >= 90)
208+ {
209+ StopSoundMem(present_bgm_);
210+ ChangeVolumeSoundMem(100,present_bgm_);
211+ present_bgm_ = -1;
212+ fadeout_count_ = 0;
213+ fade_out_ = false;
214+ requested_bgm_ = -1;
215+ }
216+ ChangeVolumeSoundMem((int)((90.0-(double)fadeout_count_)/0.9),present_bgm_);
217+ ++fadeout_count_;
196218 }
197219 }
198220
--- a/client/Music.hpp
+++ b/client/Music.hpp
@@ -30,7 +30,9 @@ public:
3030
3131 private:
3232 bool crossfade_now_;
33+ bool fade_out_;
3334 int fade_count_;
35+ int fadeout_count_;
3436 int present_bgm_;
3537 int prev_bgm_;
3638 int requested_bgm_;
--- a/client/bin/cards/bgmlist/main.js
+++ b/client/bin/cards/bgmlist/main.js
@@ -2,7 +2,7 @@
22 /***MetaData***
33
44 {
5- "name": "BGMリスト",
5+ "name": "BGM繝ェ繧ケ繝?,
66 "icon": "icon.png",
77 "api_version": 1
88 }
@@ -17,7 +17,6 @@ list = new UI.List({
1717 Music.onReload = function () {
1818
1919 list.clearItems();
20-
2120 var even_line = false;
2221 var music_names = Music.all();
2322 for (var i = 0; i < music_names.length; i++) {
@@ -33,7 +32,17 @@ Music.onReload = function () {
3332 })
3433 );
3534 })(music_names[i])
36- }
35+}
36+ list.addItem(
37+ new UI.Label({
38+ docking: UI.DOCKING_TOP | UI.DOCKING_LEFT | UI.DOCKING_RIGHT,
39+ text: "蜀咲函蛛懈ュ「",
40+ bgcolor: ((even_line = !even_line) ? "#EEAFEECC" : "#FFFFFFCC"),
41+ onclick: function () {
42+ Music.stop(true)
43+ }
44+ })
45+ );
3746 }
3847
3948 Music.onReload();