… | |
… | |
113 | our $CONN; |
113 | our $CONN; |
114 | our $PROFILE; # current profile |
114 | our $PROFILE; # current profile |
115 | our $FAST; # fast, low-quality mode, possibly useful for software-rendering |
115 | our $FAST; # fast, low-quality mode, possibly useful for software-rendering |
116 | |
116 | |
117 | our $WANT_REFRESH; |
117 | our $WANT_REFRESH; |
118 | our $CAN_REFRESH; |
|
|
119 | |
118 | |
120 | our @SDL_MODES; |
119 | our @SDL_MODES; |
121 | our $WIDTH; |
120 | our $WIDTH; |
122 | our $HEIGHT; |
121 | our $HEIGHT; |
123 | our $FULLSCREEN; |
122 | our $FULLSCREEN; |
… | |
… | |
144 | our $SETUP_KEYBOARD; |
143 | our $SETUP_KEYBOARD; |
145 | |
144 | |
146 | our $PL_NOTEBOOK; |
145 | our $PL_NOTEBOOK; |
147 | our $PL_WINDOW; |
146 | our $PL_WINDOW; |
148 | |
147 | |
|
|
148 | our $MUSIC_PLAYING_WIDGET; |
|
|
149 | our $LICENSE_WIDGET; |
|
|
150 | |
149 | our $INVENTORY_PAGE; |
151 | our $INVENTORY_PAGE; |
150 | our $STATS_PAGE; |
152 | our $STATS_PAGE; |
151 | our $SKILL_PAGE; |
153 | our $SKILL_PAGE; |
152 | our $SPELL_PAGE; |
154 | our $SPELL_PAGE; |
153 | our $SPELL_LIST; |
155 | our $SPELL_LIST; |
… | |
… | |
159 | our $STATWIDS; |
161 | our $STATWIDS; |
160 | |
162 | |
161 | our $SDL_ACTIVE; |
163 | our $SDL_ACTIVE; |
162 | our %SDL_CB; |
164 | our %SDL_CB; |
163 | |
165 | |
|
|
166 | our $ALT_ENTER_MESSAGE; |
|
|
167 | our $STATUSBOX; |
|
|
168 | our $DEBUG_STATUS; |
|
|
169 | |
|
|
170 | our $INV; |
|
|
171 | our $INVR; |
|
|
172 | our $INVR_HB; |
|
|
173 | |
|
|
174 | ############################################################################# |
|
|
175 | |
|
|
176 | sub status { |
|
|
177 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
|
|
178 | } |
|
|
179 | |
|
|
180 | sub debug { |
|
|
181 | $DEBUG_STATUS->set_text ($_[0]); |
|
|
182 | } |
|
|
183 | |
|
|
184 | sub message { |
|
|
185 | my ($para) = @_; |
|
|
186 | $MESSAGE_WINDOW->message ($para); |
|
|
187 | } |
|
|
188 | |
|
|
189 | ############################################################################# |
|
|
190 | #TODO: maybe move into own audio module... |
|
|
191 | |
164 | our $SDL_MIXER; |
192 | our $SDL_MIXER; |
|
|
193 | |
165 | our $MUSIC_DEFAULT = "in_a_heartbeat.ogg"; |
194 | our $MUSIC_DEFAULT = "in_a_heartbeat.ogg"; |
166 | our $MUSIC_WANT; # arryref of ambient music |
195 | our $MUSIC_WANT; # arryref of ambient music we want to play |
167 | our @MUSIC_HAVE; # ambient music we want now |
196 | our @MUSIC_HAVE; # ambient music we have on disk |
168 | our $MUSIC_START; |
197 | our $MUSIC_START; |
|
|
198 | our @MUSIC_JINGLE; # which jingles to play next |
169 | our $MUSIC_PLAYING_DATA; |
199 | our $MUSIC_PLAYING_DATA; |
170 | our $MUSIC_PLAYING_META; |
200 | our $MUSIC_PLAYING_META; |
171 | our $MUSIC_PLAYER; |
201 | our $MUSIC_PLAYER; |
172 | our $MUSIC_RESUME = 30; # resume music when players less than these many seconds before |
202 | our $MUSIC_RESUME = 30; # resume music when played less than these many seconds before |
173 | our @SOUNDS; # event => file mapping |
203 | |
174 | our %AUDIO_CHUNK; # audio files |
204 | our %AUDIO_CHUNK; # audio "files" |
175 | |
205 | our %AUDIO_PLAY; # which audio faces should be played |
176 | our $ALT_ENTER_MESSAGE; |
|
|
177 | our $STATUSBOX; |
|
|
178 | our $DEBUG_STATUS; |
|
|
179 | |
|
|
180 | our $INV; |
|
|
181 | our $INVR; |
|
|
182 | our $INV_RIGHT_HB; |
|
|
183 | |
|
|
184 | our $PICKUP_CFG; |
|
|
185 | |
|
|
186 | ############################################################################# |
|
|
187 | #TODO: maybe move into own audio module... |
|
|
188 | |
206 | |
189 | sub audio_channel_finished { |
207 | sub audio_channel_finished { |
190 | my ($channel) = @_; |
208 | my ($channel) = @_; |
191 | |
209 | |
192 | # warn "channel $channel finished\n";#d# |
210 | # warn "channel $channel finished\n";#d# |
193 | } |
211 | } |
194 | |
212 | |
195 | our %AUDIO_PLAY; |
|
|
196 | our %AUDIO_CHUNK; |
|
|
197 | |
|
|
198 | sub audio_sound_push($) { |
213 | sub audio_sound_push($) { |
199 | my ($face) = @_; |
214 | my ($face) = @_; |
|
|
215 | |
|
|
216 | $CFG->{effects_enable} |
|
|
217 | or return; |
|
|
218 | |
|
|
219 | $AUDIO_PLAY{$face} |
|
|
220 | or return; |
200 | |
221 | |
201 | if (my $chunk = $AUDIO_CHUNK{$face}) { |
222 | if (my $chunk = $AUDIO_CHUNK{$face}) { |
202 | for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { |
223 | for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { |
203 | my (undef, $dx, $dy, $vol) = @$_; |
224 | my (undef, $dx, $dy, $vol) = @$_; |
204 | |
225 | |
205 | my $channel = CFPlus::Channel::find; |
226 | my $channel = CFPlus::Channel::find; |
206 | $channel->volume ($vol * 128 / 255); |
227 | $channel->volume ($vol * $CFG->{effects_volume} * 128 / 255); |
207 | $dx = $dx / 10 * 255; |
|
|
208 | $channel->set_panning (255 - $dx, 255 + $dx); |
|
|
209 | |
|
|
210 | # my $angle = $dx ? : $dx < 0 ? |
|
|
211 | # my $distance = -$vol; |
|
|
212 | # $channel->set_position ($angle, $distance); |
228 | $channel->set_position_r ($dx, $dy, 20); |
213 | |
|
|
214 | $chunk->play ($channel); |
229 | $chunk->play ($channel); |
215 | } |
230 | } |
216 | } else { |
231 | } else { |
217 | # sound_meta not set means data is in flight either way |
232 | # sound_meta not set means data is in flight either way |
218 | my $meta = $CONN->{sound_meta}{$face} |
233 | my $meta = $CONN->{sound_meta}{$face} |
219 | or return; |
234 | or return; |
220 | |
235 | |
|
|
236 | # if its a jingle, play it as ambient music |
|
|
237 | if ($meta->{meta}{jingle}) { |
|
|
238 | if (delete $AUDIO_PLAY{$face}) { # take the jingle out of the sound queue |
|
|
239 | push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue |
|
|
240 | &audio_music_push ($face); |
|
|
241 | } |
|
|
242 | } else { |
221 | # fetch from database |
243 | # fetch from database |
222 | CFPlus::DB::get res_data => $meta->{name}, sub { |
244 | CFPlus::DB::get res_data => $meta->{name}, sub { |
223 | my $rwops = new CFPlus::RW $_[0]; |
245 | my $rwops = new CFPlus::RW $_[0]; |
224 | my $chunk = new CFPlus::MixChunk $rwops; |
246 | my $chunk = new CFPlus::MixChunk $rwops |
|
|
247 | or Carp::confess "sound face " . (JSON::XS::to_json $meta) . " unloadable: " . CFPlus::Mix_GetError; |
225 | $chunk->volume (($meta->{meta}{volume} || 1) * 128); |
248 | $chunk->volume (($meta->{meta}{volume} || 1) * 128); |
226 | $AUDIO_CHUNK{$face} = $chunk; |
249 | $AUDIO_CHUNK{$face} = $chunk; |
227 | |
250 | |
228 | audio_sound_push ($face); |
251 | audio_sound_push ($face); |
|
|
252 | }; |
229 | }; |
253 | } |
230 | } |
254 | } |
231 | } |
255 | } |
232 | |
256 | |
233 | sub audio_sound_play { |
257 | sub audio_sound_play { |
234 | my ($face, $dx, $dy, $vol) = @_; |
258 | my ($face, $dx, $dy, $vol) = @_; |
235 | |
259 | |
236 | $SDL_MIXER |
260 | $SDL_MIXER |
237 | or return; |
261 | or return; |
|
|
262 | $CFG->{effects_enable} |
|
|
263 | or return; |
238 | |
264 | |
239 | my $queue = $AUDIO_PLAY{$face} ||= []; |
265 | my $queue = $AUDIO_PLAY{$face} ||= []; |
240 | push @$queue, [Event::time + 0.2, $dx, $dy, $vol]; # delay sound by max. 0.2s |
266 | push @$queue, [Event::time + 0.6, $dx, $dy, $vol]; # do not play sound for outdated events |
241 | audio_sound_push $face |
267 | audio_sound_push $face |
242 | unless @$queue > 1; |
268 | unless @$queue > 1; |
|
|
269 | } |
|
|
270 | |
|
|
271 | sub audio_music_set_meta { |
|
|
272 | my ($meta) = @_; |
|
|
273 | |
|
|
274 | $MUSIC_PLAYING_META = $meta; |
|
|
275 | $MUSIC_PLAYING_WIDGET->set_markup ( |
|
|
276 | "<b>Name</b>: " . (CFPlus::asxml $meta->{meta}{name}) . "\n" |
|
|
277 | . "<b>Author</b>: " . (CFPlus::asxml $meta->{meta}{author}) . "\n" |
|
|
278 | . "<b>Source</b>: " . (CFPlus::asxml $meta->{meta}{source}) . "\n" |
|
|
279 | . "<b>License</b>: " . (CFPlus::asxml $meta->{meta}{license}) |
|
|
280 | ); |
243 | } |
281 | } |
244 | |
282 | |
245 | sub audio_music_update_volume { |
283 | sub audio_music_update_volume { |
246 | return unless $MUSIC_PLAYING_META; |
284 | return unless $MUSIC_PLAYING_META; |
247 | my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1; |
285 | my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1; |
248 | my $base = $CFG->{bgm_volume}; |
286 | my $base = $MUSIC_PLAYING_META->{meta}{jingle} ? 1 : $CFG->{bgm_volume}; |
249 | CFPlus::MixMusic::volume $base * $volume * 128; |
287 | CFPlus::MixMusic::volume $base * $volume * 128; |
250 | } |
|
|
251 | |
|
|
252 | sub audio_music_push { |
|
|
253 | my @have = |
|
|
254 | grep $_, |
|
|
255 | map $CONN->{music_meta}{$_}, |
|
|
256 | @$MUSIC_WANT; |
|
|
257 | |
|
|
258 | if (@have) { |
|
|
259 | @MUSIC_HAVE = @have; |
|
|
260 | &audio_music_changed (); |
|
|
261 | } |
|
|
262 | } |
|
|
263 | |
|
|
264 | sub audio_music_set_ambient { |
|
|
265 | my ($songs) = @_; |
|
|
266 | |
|
|
267 | $MUSIC_WANT = $songs; |
|
|
268 | |
|
|
269 | audio_music_push; |
|
|
270 | } |
288 | } |
271 | |
289 | |
272 | sub audio_music_start { |
290 | sub audio_music_start { |
273 | my $meta = $MUSIC_PLAYING_META; |
291 | my $meta = $MUSIC_PLAYING_META; |
274 | |
292 | |
… | |
… | |
286 | my $rwops = $meta->{path} |
304 | my $rwops = $meta->{path} |
287 | ? new_from_file CFPlus::RW $meta->{path} |
305 | ? new_from_file CFPlus::RW $meta->{path} |
288 | : new CFPlus::RW $$MUSIC_PLAYING_DATA; |
306 | : new CFPlus::RW $$MUSIC_PLAYING_DATA; |
289 | |
307 | |
290 | $MUSIC_PLAYER = new CFPlus::MixMusic $rwops |
308 | $MUSIC_PLAYER = new CFPlus::MixMusic $rwops |
291 | or ((warn CFPlus::Mix_GetError), return); # pretty fatal error |
309 | or Carp::confess "music face $meta->{face} unloadable: " . CFPlus::Mix_GetError; |
292 | |
310 | |
293 | my $NOW = time; |
311 | my $NOW = time; |
294 | |
312 | |
295 | if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { |
313 | if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { |
296 | my $pos = $MUSIC_PLAYING_META->{stop_pos}; |
314 | my $pos = $MUSIC_PLAYING_META->{stop_pos}; |
… | |
… | |
299 | } else { |
317 | } else { |
300 | $MUSIC_PLAYER->play (0); |
318 | $MUSIC_PLAYER->play (0); |
301 | $MUSIC_START = time; |
319 | $MUSIC_START = time; |
302 | } |
320 | } |
303 | |
321 | |
304 | delete $MUSIC_PLAYING_META->{stop_time}; |
322 | delete $meta->{stop_time}; |
305 | delete $MUSIC_PLAYING_META->{stop_pos}; |
323 | delete $meta->{stop_pos}; |
306 | } |
324 | } |
307 | } |
325 | } |
308 | |
326 | |
309 | sub audio_music_changed { |
327 | sub audio_music_push { |
310 | return unless $CFG->{bgm_enable}; |
|
|
311 | return unless $SDL_MIXER; |
328 | return unless $SDL_MIXER; |
312 | |
329 | |
|
|
330 | my $fade_out; |
|
|
331 | |
|
|
332 | if (@MUSIC_JINGLE) { |
|
|
333 | @MUSIC_HAVE = $MUSIC_JINGLE[0]; |
|
|
334 | $fade_out = 333; |
|
|
335 | } else { |
|
|
336 | return unless $CFG->{bgm_enable}; |
|
|
337 | |
|
|
338 | my @have = |
|
|
339 | grep $_, |
|
|
340 | map $CONN->{music_meta}{$_}, |
|
|
341 | @$MUSIC_WANT; |
|
|
342 | |
|
|
343 | @MUSIC_HAVE = @have |
|
|
344 | if @have; |
|
|
345 | |
313 | # default MUSIC_HAVE == MUSIC_DEFAULT |
346 | # default MUSIC_HAVE == MUSIC_DEFAULT |
314 | @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE; |
347 | @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE; |
|
|
348 | $fade_out = 1000; |
|
|
349 | } |
315 | |
350 | |
316 | # if the currently playing song is acceptable, let it continue |
351 | # if the currently playing song is acceptable, let it continue |
317 | return if $MUSIC_PLAYING_META |
|
|
318 | && grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE; |
352 | return if grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE; |
319 | |
353 | |
320 | my $NOW = time; |
354 | my $NOW = time; |
321 | |
355 | |
322 | if ($MUSIC_PLAYING_META) { |
356 | if ($MUSIC_PLAYING_META) { |
323 | $MUSIC_PLAYING_META->{stop_time} = $NOW; |
357 | $MUSIC_PLAYING_META->{stop_time} = $NOW; |
324 | $MUSIC_PLAYING_META->{stop_pos} = $NOW - $MUSIC_START; |
358 | $MUSIC_PLAYING_META->{stop_pos} = $NOW - $MUSIC_START; |
325 | CFPlus::MixMusic::fade_out 1000; |
359 | CFPlus::MixMusic::fade_out $fade_out; |
326 | } else { |
360 | } else { |
327 | # sort by stop time, oldest first |
361 | # sort by stop time, oldest first |
328 | @MUSIC_HAVE = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_HAVE; |
362 | @MUSIC_HAVE = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_HAVE; |
329 | |
363 | |
330 | # if the most recently-played piece played very recently, |
364 | # if the most recently-played piece played very recently, |
331 | # resume it, else choose the oldest piece for rotation. |
365 | # resume it, else choose the oldest piece for rotation. |
332 | $MUSIC_PLAYING_META = |
366 | audio_music_set_meta |
333 | $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME |
367 | $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME |
334 | ? $MUSIC_HAVE[-1] |
368 | ? $MUSIC_HAVE[-1] |
335 | : $MUSIC_HAVE[0]; |
369 | : $MUSIC_HAVE[0]; |
336 | |
370 | |
337 | audio_music_start; |
371 | audio_music_start; |
338 | } |
372 | } |
339 | } |
373 | } |
340 | |
374 | |
|
|
375 | sub audio_music_set_ambient { |
|
|
376 | my ($songs) = @_; |
|
|
377 | |
|
|
378 | $MUSIC_WANT = $songs; |
|
|
379 | audio_music_push; |
|
|
380 | } |
|
|
381 | |
341 | sub audio_music_finished { |
382 | sub audio_music_finished { |
|
|
383 | # we compress multiple jingles of the same type |
|
|
384 | shift @MUSIC_JINGLE |
|
|
385 | while @MUSIC_JINGLE && $MUSIC_PLAYING_META == $MUSIC_JINGLE[0]; |
|
|
386 | |
|
|
387 | $MUSIC_PLAYING_WIDGET->clear; |
|
|
388 | |
342 | undef $MUSIC_PLAYER; |
389 | undef $MUSIC_PLAYER; |
343 | undef $MUSIC_PLAYING_META; |
390 | undef $MUSIC_PLAYING_META; |
344 | undef $MUSIC_PLAYING_DATA; |
391 | undef $MUSIC_PLAYING_DATA; |
345 | |
392 | |
346 | audio_music_changed; |
393 | audio_music_push; |
|
|
394 | } |
|
|
395 | |
|
|
396 | sub audio_init { |
|
|
397 | if ($CFG->{audio_enable}) { |
|
|
398 | $ENV{MIX_EFFECTSMAXSPEED} = 1; |
|
|
399 | $SDL_MIXER = !CFPlus::Mix_OpenAudio; |
|
|
400 | |
|
|
401 | unless ($SDL_MIXER) { |
|
|
402 | status "Unable to open sound device: there will be no sound"; |
|
|
403 | return; |
|
|
404 | } |
|
|
405 | |
|
|
406 | CFPlus::Mix_AllocateChannels 16; |
|
|
407 | |
|
|
408 | audio_music_finished; |
|
|
409 | } else { |
|
|
410 | undef $SDL_MIXER; |
|
|
411 | } |
|
|
412 | } |
|
|
413 | |
|
|
414 | sub audio_shutdown { |
|
|
415 | undef $MUSIC_PLAYER; |
|
|
416 | undef $MUSIC_PLAYING_META; |
|
|
417 | undef $MUSIC_PLAYING_DATA; |
|
|
418 | |
|
|
419 | $MUSIC_WANT = []; |
|
|
420 | @MUSIC_JINGLE = (); |
|
|
421 | %AUDIO_PLAY = (); |
|
|
422 | %AUDIO_CHUNK = (); |
|
|
423 | |
|
|
424 | CFPlus::Mix_CloseAudio if $SDL_MIXER; |
|
|
425 | undef $SDL_MIXER; |
347 | } |
426 | } |
348 | |
427 | |
349 | ############################################################################# |
428 | ############################################################################# |
350 | |
|
|
351 | sub status { |
|
|
352 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
|
|
353 | } |
|
|
354 | |
|
|
355 | sub debug { |
|
|
356 | $DEBUG_STATUS->set_text ($_[0]); |
|
|
357 | } |
|
|
358 | |
|
|
359 | sub message { |
|
|
360 | my ($para) = @_; |
|
|
361 | $MESSAGE_WINDOW->message ($para); |
|
|
362 | } |
|
|
363 | |
429 | |
364 | sub destroy_query_dialog { |
430 | sub destroy_query_dialog { |
365 | (delete $_[0]{query_dialog})->destroy |
431 | (delete $_[0]{query_dialog})->destroy |
366 | if $_[0]{query_dialog}; |
432 | if $_[0]{query_dialog}; |
367 | } |
433 | } |
… | |
… | |
701 | state => $CFG->{fullscreen}, |
767 | state => $CFG->{fullscreen}, |
702 | tooltip => "Bring the client into fullscreen mode.", |
768 | tooltip => "Bring the client into fullscreen mode.", |
703 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
769 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
704 | ); |
770 | ); |
705 | |
771 | |
|
|
772 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1"); |
|
|
773 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
|
|
774 | state => $CFG->{opengl11}, |
|
|
775 | tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in " |
|
|
776 | . "higher memory usage and slower performance. It will, however, help tremendously on " |
|
|
777 | . "cards that claim to support a feature but fall back to software rendering. " |
|
|
778 | . "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, " |
|
|
779 | . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you " |
|
|
780 | . "experience extremely low framerates and your card should do better, try this option.</b>", |
|
|
781 | on_changed => sub { my ($self, $value) = @_; $CFG->{opengl11} = $value; 0 } |
|
|
782 | ); |
|
|
783 | |
706 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
784 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
707 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
785 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
708 | state => $CFG->{fast}, |
786 | state => $CFG->{fast}, |
709 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
787 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
710 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
788 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
… | |
… | |
736 | |
814 | |
737 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Smoothing"); |
815 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Smoothing"); |
738 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
816 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
739 | state => $CFG->{map_smoothing}, |
817 | state => $CFG->{map_smoothing}, |
740 | tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " |
818 | tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " |
741 | . "This increases load on the graphics subsystem and works only with 2.x servers. " |
819 | . "This increases load on the graphics subsystem and works only with TRT servers. " |
742 | . "Changes take effect at next connection only.", |
820 | . "Changes take effect at next login only.", |
743 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } |
821 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } |
744 | ); |
822 | ); |
745 | |
823 | |
746 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
824 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
747 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
825 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
… | |
… | |
758 | ); |
836 | ); |
759 | |
837 | |
760 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
838 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
761 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
839 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
762 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
840 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
763 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
841 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant, " |
|
|
842 | . "but you still need to press apply to correctly re-layout the widget.", |
764 | on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
843 | on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
765 | ); |
844 | ); |
766 | |
845 | |
767 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
846 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
768 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
847 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
… | |
… | |
790 | } |
869 | } |
791 | |
870 | |
792 | sub audio_setup { |
871 | sub audio_setup { |
793 | my $vbox = new CFPlus::UI::VBox; |
872 | my $vbox = new CFPlus::UI::VBox; |
794 | |
873 | |
795 | $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]); |
874 | $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 0, 1]); |
796 | |
875 | |
797 | my $row = 0; |
876 | my $row = 0; |
798 | |
877 | |
799 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
878 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
800 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
879 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
… | |
… | |
804 | ); |
883 | ); |
805 | # $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
884 | # $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
806 | # $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
885 | # $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
807 | # $CFG->{effects_volume} = $_[1]; |
886 | # $CFG->{effects_volume} = $_[1]; |
808 | # }); |
887 | # }); |
|
|
888 | |
|
|
889 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Sound Effects"); |
|
|
890 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
|
|
891 | expand => 1, state => $CFG->{effects_enable}, |
|
|
892 | tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", |
|
|
893 | on_changed => sub { |
|
|
894 | $CFG->{effects_enable} = $_[1]; |
|
|
895 | $CONN->update_fx_want if $CONN; |
|
|
896 | 0 |
|
|
897 | } |
|
|
898 | ); |
|
|
899 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
|
|
900 | expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128], |
|
|
901 | tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " |
|
|
902 | . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.", |
|
|
903 | on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 } |
|
|
904 | ); |
|
|
905 | |
809 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); |
906 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); |
810 | $table->add_at (1, $row++, my $hbox = new CFPlus::UI::HBox); |
907 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
811 | $hbox->add (new CFPlus::UI::CheckBox |
|
|
812 | expand => 1, state => $CFG->{bgm_enable}, |
908 | expand => 1, state => $CFG->{bgm_enable}, |
813 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
909 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
814 | on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } |
910 | on_changed => sub { |
|
|
911 | $CFG->{bgm_enable} = $_[1]; |
|
|
912 | $CONN->update_fx_want if $CONN; |
|
|
913 | 0 |
|
|
914 | } |
815 | ); |
915 | ); |
816 | $hbox->add (new CFPlus::UI::Slider |
916 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
817 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
917 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
818 | tooltip => "The volume of the background music. Changes are instant.", |
918 | tooltip => "The volume of the background music. Changes are instant.", |
819 | on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } |
919 | on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } |
820 | ); |
920 | ); |
821 | |
921 | |
822 | $table->add_at (1, $row++, new CFPlus::UI::Button |
922 | $table->add_at (1, $row++, new CFPlus::UI::Button |
823 | expand => 1, align => 0, text => "Apply", |
923 | c_colspan => 2, expand => 1, align => 0, text => "Apply", |
824 | tooltip => "Apply the audio settings", |
924 | tooltip => "Apply the audio settings", |
825 | on_activate => sub { |
925 | on_activate => sub { |
826 | audio_shutdown (); |
926 | audio_shutdown (); |
827 | audio_init (); |
927 | audio_init (); |
828 | 0 |
928 | 0 |
… | |
… | |
899 | $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); |
999 | $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); |
900 | |
1000 | |
901 | $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d# |
1001 | $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d# |
902 | |
1002 | |
903 | $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0); |
1003 | $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0); |
904 | $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", rowspan => 1, colspan => 2); |
1004 | $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", c_rowspan => 1, c_colspan => 2); |
905 | $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", rowspan => 2, colspan => 1); |
1005 | $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1); |
906 | $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", rowspan => 1, colspan => 2); |
1006 | $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", c_rowspan => 1, c_colspan => 2); |
907 | $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", rowspan => 2, colspan => 1); |
1007 | $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", c_rowspan => 2, c_colspan => 1); |
908 | $t->add_at (1,1, new CFPlus::UI::Label text => "e"); |
1008 | $t->add_at (1,1, new CFPlus::UI::Label text => "e"); |
909 | |
1009 | |
910 | $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas); |
1010 | $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas); |
911 | |
1011 | |
912 | $c->add_items ({ |
1012 | $c->add_items ({ |
… | |
… | |
1508 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1608 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1509 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1609 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1510 | |
1610 | |
1511 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1611 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1512 | |
1612 | |
1513 | $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox); |
1613 | $vb2->add ($INVR_HB = new CFPlus::UI::HBox); |
1514 | |
1614 | |
1515 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1615 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1516 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1616 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1517 | |
1617 | |
1518 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1618 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1519 | CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1619 | CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1520 | |
1620 | |
1521 | $hb |
1621 | $hb |
|
|
1622 | } |
|
|
1623 | |
|
|
1624 | sub media_window { |
|
|
1625 | my $vb = new CFPlus::UI::VBox; |
|
|
1626 | |
|
|
1627 | $vb->add (new CFPlus::UI::FancyFrame |
|
|
1628 | label => "Currently playing music", |
|
|
1629 | child => new CFPlus::UI::ScrolledWindow scroll_x => 1, scroll_y => 0, |
|
|
1630 | child => ($MUSIC_PLAYING_WIDGET = new CFPlus::UI::Label ellipsise => 0, fontsize => 0.8), |
|
|
1631 | ); |
|
|
1632 | |
|
|
1633 | $vb->add (new CFPlus::UI::FancyFrame |
|
|
1634 | label => "Other media used in this session", |
|
|
1635 | expand => 1, |
|
|
1636 | child => ($LICENSE_WIDGET = new CFPlus::UI::TextScroller |
|
|
1637 | expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4), |
|
|
1638 | ); |
|
|
1639 | |
|
|
1640 | $vb |
|
|
1641 | } |
|
|
1642 | |
|
|
1643 | sub add_license { |
|
|
1644 | my ($meta) = @_; |
|
|
1645 | |
|
|
1646 | $meta = $meta->{meta} |
|
|
1647 | or return; |
|
|
1648 | |
|
|
1649 | $meta->{license} || $meta->{author} || $meta->{source} |
|
|
1650 | or return; |
|
|
1651 | |
|
|
1652 | $LICENSE_WIDGET->add_paragraph ({ |
|
|
1653 | fg => [1, 1, 1, 1], |
|
|
1654 | markup => "<small>" |
|
|
1655 | . "<b>Name:</b> " . (CFPlus::asxml $meta->{name}) . "\n" |
|
|
1656 | . "<b>Author:</b> " . (CFPlus::asxml $meta->{author}) . "\n" |
|
|
1657 | . "<b>Source:</b> " . (CFPlus::asxml $meta->{source}) . "\n" |
|
|
1658 | . "<b>License:</b> " . (CFPlus::asxml $meta->{license}) . "\n" |
|
|
1659 | . "</small>", |
|
|
1660 | }); |
|
|
1661 | $LICENSE_WIDGET->scroll_to_bottom; |
1522 | } |
1662 | } |
1523 | |
1663 | |
1524 | sub toggle_player_page { |
1664 | sub toggle_player_page { |
1525 | my ($widget) = @_; |
1665 | my ($widget) = @_; |
1526 | |
1666 | |
… | |
… | |
1565 | $ntb->add_tab ( |
1705 | $ntb->add_tab ( |
1566 | "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, |
1706 | "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, |
1567 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |
1707 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |
1568 | . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." |
1708 | . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." |
1569 | ); |
1709 | ); |
1570 | $ntb->add_tab (Pickup => autopickup_setup, |
1710 | $ntb->add_tab (Pickup => autopickup_setup, |
1571 | "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); |
1711 | "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); |
|
|
1712 | |
|
|
1713 | $ntb->add_tab (Media => media_window, |
|
|
1714 | "License, Author and Source info for media sent by the server."); |
1572 | |
1715 | |
1573 | $ntb->set_current_page ($INVENTORY_PAGE); |
1716 | $ntb->set_current_page ($INVENTORY_PAGE); |
1574 | |
1717 | |
1575 | $plwin->add ($ntb); |
1718 | $plwin->add ($ntb); |
1576 | $plwin |
1719 | $plwin |
… | |
… | |
1730 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1873 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1731 | ); |
1874 | ); |
1732 | $hb->add (new CFPlus::UI::Button |
1875 | $hb->add (new CFPlus::UI::Button |
1733 | text => "Quit anyway", |
1876 | text => "Quit anyway", |
1734 | expand => 1, |
1877 | expand => 1, |
1735 | on_activate => sub { exit }, |
1878 | on_activate => sub { Event::unloop_all }, |
1736 | ); |
1879 | ); |
1737 | } |
1880 | } |
1738 | |
1881 | |
1739 | $QUIT_DIALOG->show; |
1882 | $QUIT_DIALOG->show; |
1740 | $QUIT_DIALOG->grab_focus; |
1883 | $QUIT_DIALOG->grab_focus; |
… | |
… | |
1934 | tooltip => "Terminates the program", |
2077 | tooltip => "Terminates the program", |
1935 | on_activate => sub { |
2078 | on_activate => sub { |
1936 | if ($CONN) { |
2079 | if ($CONN) { |
1937 | open_quit_dialog; |
2080 | open_quit_dialog; |
1938 | } else { |
2081 | } else { |
1939 | exit; |
2082 | Event::unloop_all; |
1940 | } |
2083 | } |
1941 | 0 |
2084 | 0 |
1942 | }, |
2085 | }, |
1943 | ); |
2086 | ); |
1944 | |
2087 | |
1945 | $BUTTONBAR->show; |
2088 | $BUTTONBAR->show; |
1946 | $SETUP_DIALOG->show; |
2089 | $SETUP_DIALOG->show; |
|
|
2090 | $MESSAGE_WINDOW->show; |
1947 | } |
2091 | } |
1948 | |
2092 | |
1949 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
2093 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
1950 | } |
2094 | } |
1951 | |
2095 | |
… | |
… | |
1953 | CFPlus::OpenGL::shutdown; |
2097 | CFPlus::OpenGL::shutdown; |
1954 | |
2098 | |
1955 | undef $SDL_ACTIVE; |
2099 | undef $SDL_ACTIVE; |
1956 | } |
2100 | } |
1957 | |
2101 | |
1958 | sub audio_init { |
|
|
1959 | if ($CFG->{audio_enable}) { |
|
|
1960 | $ENV{MIX_EFFECTSMAXSPEED} = 1; |
|
|
1961 | $SDL_MIXER = !CFPlus::Mix_OpenAudio; |
|
|
1962 | |
|
|
1963 | unless ($SDL_MIXER) { |
|
|
1964 | status "Unable to open sound device: there will be no sound"; |
|
|
1965 | return; |
|
|
1966 | } |
|
|
1967 | |
|
|
1968 | CFPlus::Mix_AllocateChannels 16; |
|
|
1969 | |
|
|
1970 | audio_music_finished; |
|
|
1971 | } else { |
|
|
1972 | undef $SDL_MIXER; |
|
|
1973 | } |
|
|
1974 | } |
|
|
1975 | |
|
|
1976 | sub audio_shutdown { |
|
|
1977 | CFPlus::Mix_CloseAudio if $SDL_MIXER; |
|
|
1978 | undef $SDL_MIXER; |
|
|
1979 | @SOUNDS = (); |
|
|
1980 | %AUDIO_CHUNK = (); |
|
|
1981 | } |
|
|
1982 | |
|
|
1983 | my %animate_object; |
2102 | my %animate_object; |
1984 | my $animate_timer; |
2103 | my $animate_timer; |
1985 | |
2104 | |
1986 | my $fps = 9; |
2105 | my $fps = 9; |
1987 | |
2106 | |
1988 | sub force_refresh { |
2107 | sub force_refresh { |
|
|
2108 | if ($ENV{CFPLUS_DEBUG} & 4) { |
1989 | $fps = $fps * 0.95 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.05; |
2109 | $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02; |
1990 | debug sprintf "%3.2f", $fps if $ENV{CFPLUS_DEBUG} & 4; |
2110 | debug sprintf "%3.2f", $fps; |
|
|
2111 | } |
1991 | |
2112 | |
1992 | $CFPlus::UI::ROOT->draw; |
2113 | $CFPlus::UI::ROOT->draw; |
1993 | |
2114 | CFPlus::SDL_GL_SwapBuffers; |
1994 | $WANT_REFRESH = 0; |
|
|
1995 | $CAN_REFRESH = 0; |
|
|
1996 | $LAST_REFRESH = $NOW; |
2115 | $LAST_REFRESH = $NOW; |
1997 | |
2116 | $WANT_REFRESH->stop; |
1998 | CFPlus::SDL_GL_SwapBuffers; |
|
|
1999 | } |
2117 | } |
2000 | |
2118 | |
|
|
2119 | $WANT_REFRESH = Event->idle (min => 0.001, max => 0.06, parked => 1, cb => \&force_refresh); |
|
|
2120 | |
2001 | my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { |
2121 | my $input = Event->timer (after => 0, hard => 0, interval => 1 / 50, cb => sub { |
2002 | $NOW = time; |
2122 | $NOW = time; |
2003 | |
2123 | |
2004 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2124 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2005 | for CFPlus::poll_events; |
2125 | for CFPlus::poll_events; |
2006 | |
2126 | |
2007 | if (%animate_object) { |
2127 | if (%animate_object) { |
2008 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2128 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2009 | ++$WANT_REFRESH; |
2129 | $WANT_REFRESH->start; |
2010 | } |
|
|
2011 | |
|
|
2012 | if ($WANT_REFRESH) { |
|
|
2013 | force_refresh; |
|
|
2014 | } else { |
|
|
2015 | $CAN_REFRESH = 1; |
|
|
2016 | } |
2130 | } |
2017 | }); |
2131 | }); |
2018 | |
2132 | |
2019 | sub animation_start { |
2133 | sub animation_start { |
2020 | my ($widget) = @_; |
2134 | my ($widget) = @_; |
… | |
… | |
2078 | |
2192 | |
2079 | my %DEF_CFG = ( |
2193 | my %DEF_CFG = ( |
2080 | sdl_mode => 0, |
2194 | sdl_mode => 0, |
2081 | fullscreen => 0, |
2195 | fullscreen => 0, |
2082 | fast => 0, |
2196 | fast => 0, |
|
|
2197 | opengl11 => 0, |
2083 | map_scale => 1, |
2198 | map_scale => 1, |
2084 | fow_enable => 1, |
2199 | fow_enable => 1, |
2085 | fow_intensity => 0, |
2200 | fow_intensity => 0, |
2086 | map_smoothing => 1, |
2201 | map_smoothing => 1, |
2087 | gui_fontsize => 1, |
2202 | gui_fontsize => 1, |
… | |
… | |
2089 | gauge_fontsize => 1, |
2204 | gauge_fontsize => 1, |
2090 | gauge_size => 0.35, |
2205 | gauge_size => 0.35, |
2091 | stat_fontsize => 0.7, |
2206 | stat_fontsize => 0.7, |
2092 | mapsize => 100, |
2207 | mapsize => 100, |
2093 | audio_enable => 1, |
2208 | audio_enable => 1, |
|
|
2209 | effects_enable => 1, |
|
|
2210 | effects_volume => 1, |
2094 | bgm_enable => 1, |
2211 | bgm_enable => 1, |
2095 | bgm_volume => 0.25, |
2212 | bgm_volume => 0.5, |
2096 | output_sync => 1, |
2213 | output_sync => 1, |
2097 | output_count => 1, |
2214 | output_count => 1, |
2098 | output_rate => "", |
2215 | output_rate => "", |
2099 | pickup => 0, |
2216 | pickup => 0, |
2100 | inv_sort => "mtime", |
2217 | inv_sort => "mtime", |
… | |
… | |
2174 | } |
2291 | } |
2175 | |
2292 | |
2176 | show_tip_of_the_day if $CFG->{show_tips}; |
2293 | show_tip_of_the_day if $CFG->{show_tips}; |
2177 | |
2294 | |
2178 | Event::loop; |
2295 | Event::loop; |
|
|
2296 | |
|
|
2297 | #video_shutdown; |
|
|
2298 | #audio_shutdown; |
2179 | #CFPlus::SDL_Quit; |
2299 | CFPlus::SDL_Quit; |
2180 | #CFPlus::_exit 0; |
|
|
2181 | |
|
|
2182 | END { |
|
|
2183 | CFPlus::SDL_Quit; |
|
|
2184 | CFPlus::DB::Server::stop; |
2300 | CFPlus::DB::Server::stop; |
2185 | } |
|
|
2186 | |
2301 | |
2187 | =head1 NAME |
2302 | =head1 NAME |
2188 | |
2303 | |
2189 | cfplus - A Crossfire+ and Crossfire game client |
2304 | cfplus - A Crossfire TRT and Crossfire game client |
2190 | |
2305 | |
2191 | =head1 SYNOPSIS |
2306 | =head1 SYNOPSIS |
2192 | |
2307 | |
2193 | Just run it - no commandline arguments are supported. |
2308 | Just run it - no commandline arguments are supported. |
2194 | |
2309 | |
2195 | =head1 USAGE |
2310 | =head1 USAGE |
2196 | |
2311 | |
2197 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
2312 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to |
2198 | fullscreen and interactively. |
2313 | be used in fullscreen mode and interactively. |
2199 | |
2314 | |
2200 | =head1 DEBUGGING |
2315 | =head1 DEBUGGING |
2201 | |
2316 | |
2202 | |
2317 | |
2203 | CFPLUS_DEBUG - environment variable |
2318 | CFPLUS_DEBUG - environment variable |