… | |
… | |
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; |
… | |
… | |
168 | our $STATUSBOX; |
167 | our $STATUSBOX; |
169 | our $DEBUG_STATUS; |
168 | our $DEBUG_STATUS; |
170 | |
169 | |
171 | our $INV; |
170 | our $INV; |
172 | our $INVR; |
171 | our $INVR; |
173 | our $INV_RIGHT_HB; |
172 | our $INVR_HB; |
174 | |
|
|
175 | our $PICKUP_CFG; |
|
|
176 | |
173 | |
177 | ############################################################################# |
174 | ############################################################################# |
178 | |
175 | |
179 | sub status { |
176 | sub status { |
180 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
177 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
… | |
… | |
217 | my ($face) = @_; |
214 | my ($face) = @_; |
218 | |
215 | |
219 | $CFG->{effects_enable} |
216 | $CFG->{effects_enable} |
220 | or return; |
217 | or return; |
221 | |
218 | |
|
|
219 | $AUDIO_PLAY{$face} |
|
|
220 | or return; |
|
|
221 | |
222 | if (my $chunk = $AUDIO_CHUNK{$face}) { |
222 | if (my $chunk = $AUDIO_CHUNK{$face}) { |
223 | for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { |
223 | for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { |
224 | my (undef, $dx, $dy, $vol) = @$_; |
224 | my (undef, $dx, $dy, $vol) = @$_; |
225 | |
225 | |
226 | my $channel = CFPlus::Channel::find; |
226 | my $channel = CFPlus::Channel::find; |
227 | $channel->volume ($vol * $CFG->{effects_volume} * 128 / 255); |
227 | $channel->volume ($vol * $CFG->{effects_volume} * 128 / 255); |
228 | $dx = $dx / 10 * 255; |
|
|
229 | $channel->set_panning (255 - $dx, 255 + $dx); |
|
|
230 | |
|
|
231 | # my $angle = $dx ? : $dx < 0 ? |
|
|
232 | # my $distance = -$vol; |
|
|
233 | # $channel->set_position ($angle, $distance); |
228 | $channel->set_position_r ($dx, $dy, 20); |
234 | |
|
|
235 | $chunk->play ($channel); |
229 | $chunk->play ($channel); |
236 | } |
230 | } |
237 | } else { |
231 | } else { |
238 | # sound_meta not set means data is in flight either way |
232 | # sound_meta not set means data is in flight either way |
239 | my $meta = $CONN->{sound_meta}{$face} |
233 | my $meta = $CONN->{sound_meta}{$face} |
… | |
… | |
248 | } else { |
242 | } else { |
249 | # fetch from database |
243 | # fetch from database |
250 | CFPlus::DB::get res_data => $meta->{name}, sub { |
244 | CFPlus::DB::get res_data => $meta->{name}, sub { |
251 | my $rwops = new CFPlus::RW $_[0]; |
245 | my $rwops = new CFPlus::RW $_[0]; |
252 | my $chunk = new CFPlus::MixChunk $rwops |
246 | my $chunk = new CFPlus::MixChunk $rwops |
253 | or Carp::confess "sound face $meta->{face} unloadable: " . CFPlus::Mix_GetError; |
247 | or Carp::confess "sound face " . (JSON::XS::to_json $meta) . " unloadable: " . CFPlus::Mix_GetError; |
254 | $chunk->volume (($meta->{meta}{volume} || 1) * 128); |
248 | $chunk->volume (($meta->{meta}{volume} || 1) * 128); |
255 | $AUDIO_CHUNK{$face} = $chunk; |
249 | $AUDIO_CHUNK{$face} = $chunk; |
256 | |
250 | |
257 | audio_sound_push ($face); |
251 | audio_sound_push ($face); |
258 | }; |
252 | }; |
… | |
… | |
267 | or return; |
261 | or return; |
268 | $CFG->{effects_enable} |
262 | $CFG->{effects_enable} |
269 | or return; |
263 | or return; |
270 | |
264 | |
271 | my $queue = $AUDIO_PLAY{$face} ||= []; |
265 | my $queue = $AUDIO_PLAY{$face} ||= []; |
272 | 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 |
273 | audio_sound_push $face |
267 | audio_sound_push $face |
274 | unless @$queue > 1; |
268 | unless @$queue > 1; |
275 | } |
269 | } |
276 | |
270 | |
277 | sub audio_music_set_meta { |
271 | sub audio_music_set_meta { |
… | |
… | |
419 | |
413 | |
420 | sub audio_shutdown { |
414 | sub audio_shutdown { |
421 | undef $MUSIC_PLAYER; |
415 | undef $MUSIC_PLAYER; |
422 | undef $MUSIC_PLAYING_META; |
416 | undef $MUSIC_PLAYING_META; |
423 | undef $MUSIC_PLAYING_DATA; |
417 | undef $MUSIC_PLAYING_DATA; |
424 | |
|
|
425 | audio_music_set_meta { }; |
|
|
426 | |
418 | |
427 | $MUSIC_WANT = []; |
419 | $MUSIC_WANT = []; |
428 | @MUSIC_JINGLE = (); |
420 | @MUSIC_JINGLE = (); |
429 | %AUDIO_PLAY = (); |
421 | %AUDIO_PLAY = (); |
430 | %AUDIO_CHUNK = (); |
422 | %AUDIO_CHUNK = (); |
… | |
… | |
775 | state => $CFG->{fullscreen}, |
767 | state => $CFG->{fullscreen}, |
776 | tooltip => "Bring the client into fullscreen mode.", |
768 | tooltip => "Bring the client into fullscreen mode.", |
777 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
769 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
778 | ); |
770 | ); |
779 | |
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->{force_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->{force_opengl11} = $value; 0 } |
|
|
782 | ); |
|
|
783 | |
|
|
784 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Compress Textures"); |
|
|
785 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
|
|
786 | state => $CFG->{texture_compression}, |
|
|
787 | tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " |
|
|
788 | . "will save a lot of memory and increase performance. The compression algorithm " |
|
|
789 | . "can differ form card to card, so your mileage may vary. This setting is ignored in " |
|
|
790 | . "forced OpenGL 1.1 mode.", |
|
|
791 | on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } |
|
|
792 | ); |
|
|
793 | |
780 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
794 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
781 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
795 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
782 | state => $CFG->{fast}, |
796 | state => $CFG->{fast}, |
783 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
797 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
784 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
798 | on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } |
… | |
… | |
810 | |
824 | |
811 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Smoothing"); |
825 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Smoothing"); |
812 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
826 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
813 | state => $CFG->{map_smoothing}, |
827 | state => $CFG->{map_smoothing}, |
814 | tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " |
828 | tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " |
815 | . "This increases load on the graphics subsystem and works only with 2.x servers. " |
829 | . "This increases load on the graphics subsystem and works only with TRT servers. " |
816 | . "Changes take effect at next connection only.", |
830 | . "Changes take effect at next login only.", |
817 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } |
831 | on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } |
818 | ); |
832 | ); |
819 | |
833 | |
820 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
834 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fog of War"); |
821 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
835 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
… | |
… | |
832 | ); |
846 | ); |
833 | |
847 | |
834 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
848 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
835 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
849 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
836 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
850 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
837 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
851 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant, " |
|
|
852 | . "but you still need to press apply to correctly re-layout the widget.", |
838 | on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
853 | on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, |
839 | ); |
854 | ); |
840 | |
855 | |
841 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
856 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
842 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
857 | $table->add_at (1, $row++, new CFPlus::UI::Slider |
… | |
… | |
879 | # $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
894 | # $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
880 | # $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
895 | # $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
881 | # $CFG->{effects_volume} = $_[1]; |
896 | # $CFG->{effects_volume} = $_[1]; |
882 | # }); |
897 | # }); |
883 | |
898 | |
884 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
899 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Sound Effects"); |
885 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
900 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
886 | expand => 1, state => $CFG->{effects_enable}, |
901 | expand => 1, state => $CFG->{effects_enable}, |
887 | tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", |
902 | tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", |
|
|
903 | on_changed => sub { |
888 | on_changed => sub { $CFG->{effects_enable} = $_[1]; 0 } |
904 | $CFG->{effects_enable} = $_[1]; |
|
|
905 | $CONN->update_fx_want if $CONN; |
|
|
906 | 0 |
|
|
907 | } |
889 | ); |
908 | ); |
890 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
909 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
891 | expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128], |
910 | expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128], |
892 | tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " |
911 | tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " |
893 | . "is set highest and you use your operating system volume setting. Changes are instant.", |
912 | . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.", |
894 | on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 } |
913 | on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 } |
895 | ); |
914 | ); |
896 | |
915 | |
897 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); |
916 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); |
898 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
917 | $table->add_at (1, $row, new CFPlus::UI::CheckBox |
899 | expand => 1, state => $CFG->{bgm_enable}, |
918 | expand => 1, state => $CFG->{bgm_enable}, |
900 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
919 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
901 | on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } |
920 | on_changed => sub { |
|
|
921 | $CFG->{bgm_enable} = $_[1]; |
|
|
922 | $CONN->update_fx_want if $CONN; |
|
|
923 | 0 |
|
|
924 | } |
902 | ); |
925 | ); |
903 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
926 | $table->add_at (2, $row++, new CFPlus::UI::Slider |
904 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
927 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
905 | tooltip => "The volume of the background music. Changes are instant.", |
928 | tooltip => "The volume of the background music. Changes are instant.", |
906 | on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } |
929 | on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } |
… | |
… | |
1595 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1618 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1596 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1619 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1597 | |
1620 | |
1598 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1621 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1599 | |
1622 | |
1600 | $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox); |
1623 | $vb2->add ($INVR_HB = new CFPlus::UI::HBox); |
1601 | |
1624 | |
1602 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1625 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1603 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1626 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1604 | |
1627 | |
1605 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1628 | # XXX: Call after $INVR = ... because set_opencont sets the items |
… | |
… | |
1860 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1883 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1861 | ); |
1884 | ); |
1862 | $hb->add (new CFPlus::UI::Button |
1885 | $hb->add (new CFPlus::UI::Button |
1863 | text => "Quit anyway", |
1886 | text => "Quit anyway", |
1864 | expand => 1, |
1887 | expand => 1, |
1865 | on_activate => sub { exit }, |
1888 | on_activate => sub { Event::unloop_all }, |
1866 | ); |
1889 | ); |
1867 | } |
1890 | } |
1868 | |
1891 | |
1869 | $QUIT_DIALOG->show; |
1892 | $QUIT_DIALOG->show; |
1870 | $QUIT_DIALOG->grab_focus; |
1893 | $QUIT_DIALOG->grab_focus; |
… | |
… | |
2064 | tooltip => "Terminates the program", |
2087 | tooltip => "Terminates the program", |
2065 | on_activate => sub { |
2088 | on_activate => sub { |
2066 | if ($CONN) { |
2089 | if ($CONN) { |
2067 | open_quit_dialog; |
2090 | open_quit_dialog; |
2068 | } else { |
2091 | } else { |
2069 | exit; |
2092 | Event::unloop_all; |
2070 | } |
2093 | } |
2071 | 0 |
2094 | 0 |
2072 | }, |
2095 | }, |
2073 | ); |
2096 | ); |
2074 | |
2097 | |
2075 | $BUTTONBAR->show; |
2098 | $BUTTONBAR->show; |
2076 | $SETUP_DIALOG->show; |
2099 | $SETUP_DIALOG->show; |
|
|
2100 | $MESSAGE_WINDOW->show; |
2077 | } |
2101 | } |
2078 | |
2102 | |
2079 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
2103 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
2080 | } |
2104 | } |
2081 | |
2105 | |
… | |
… | |
2089 | my $animate_timer; |
2113 | my $animate_timer; |
2090 | |
2114 | |
2091 | my $fps = 9; |
2115 | my $fps = 9; |
2092 | |
2116 | |
2093 | sub force_refresh { |
2117 | sub force_refresh { |
|
|
2118 | if ($ENV{CFPLUS_DEBUG} & 4) { |
2094 | $fps = $fps * 0.95 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.05; |
2119 | $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02; |
2095 | debug sprintf "%3.2f", $fps if $ENV{CFPLUS_DEBUG} & 4; |
2120 | debug sprintf "%3.2f", $fps; |
|
|
2121 | } |
2096 | |
2122 | |
2097 | $CFPlus::UI::ROOT->draw; |
2123 | $CFPlus::UI::ROOT->draw; |
2098 | |
2124 | CFPlus::SDL_GL_SwapBuffers; |
2099 | $WANT_REFRESH = 0; |
|
|
2100 | $CAN_REFRESH = 0; |
|
|
2101 | $LAST_REFRESH = $NOW; |
2125 | $LAST_REFRESH = $NOW; |
2102 | |
2126 | $WANT_REFRESH->stop; |
2103 | CFPlus::SDL_GL_SwapBuffers; |
|
|
2104 | } |
2127 | } |
2105 | |
2128 | |
|
|
2129 | $WANT_REFRESH = Event->idle (min => 0.001, max => 0.06, parked => 1, cb => \&force_refresh); |
|
|
2130 | |
2106 | my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { |
2131 | my $input = Event->timer (after => 0, hard => 0, interval => 1 / 50, cb => sub { |
2107 | $NOW = time; |
2132 | $NOW = time; |
2108 | |
2133 | |
2109 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2134 | ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) |
2110 | for CFPlus::poll_events; |
2135 | for CFPlus::poll_events; |
2111 | |
2136 | |
2112 | if (%animate_object) { |
2137 | if (%animate_object) { |
2113 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2138 | $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; |
2114 | ++$WANT_REFRESH; |
2139 | $WANT_REFRESH->start; |
2115 | } |
|
|
2116 | |
|
|
2117 | if ($WANT_REFRESH) { |
|
|
2118 | force_refresh; |
|
|
2119 | } else { |
|
|
2120 | $CAN_REFRESH = 1; |
|
|
2121 | } |
2140 | } |
2122 | }); |
2141 | }); |
2123 | |
2142 | |
2124 | sub animation_start { |
2143 | sub animation_start { |
2125 | my ($widget) = @_; |
2144 | my ($widget) = @_; |
… | |
… | |
2180 | CFPlus::DB::Server::run; |
2199 | CFPlus::DB::Server::run; |
2181 | |
2200 | |
2182 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2201 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2183 | |
2202 | |
2184 | my %DEF_CFG = ( |
2203 | my %DEF_CFG = ( |
2185 | sdl_mode => 0, |
2204 | sdl_mode => 0, |
2186 | fullscreen => 0, |
2205 | fullscreen => 0, |
2187 | fast => 0, |
2206 | fast => 0, |
|
|
2207 | force_opengl11 => undef, |
|
|
2208 | texture_compression => 1, |
2188 | map_scale => 1, |
2209 | map_scale => 1, |
2189 | fow_enable => 1, |
2210 | fow_enable => 1, |
2190 | fow_intensity => 0, |
2211 | fow_intensity => 0, |
2191 | map_smoothing => 1, |
2212 | map_smoothing => 1, |
2192 | gui_fontsize => 1, |
2213 | gui_fontsize => 1, |
2193 | log_fontsize => 0.7, |
2214 | log_fontsize => 0.7, |
2194 | gauge_fontsize => 1, |
2215 | gauge_fontsize => 1, |
2195 | gauge_size => 0.35, |
2216 | gauge_size => 0.35, |
2196 | stat_fontsize => 0.7, |
2217 | stat_fontsize => 0.7, |
2197 | mapsize => 100, |
2218 | mapsize => 100, |
2198 | audio_enable => 1, |
2219 | audio_enable => 1, |
2199 | effects_enable => 1, |
2220 | effects_enable => 1, |
2200 | effects_volume => 1, |
2221 | effects_volume => 1, |
2201 | bgm_enable => 1, |
2222 | bgm_enable => 1, |
2202 | bgm_volume => 0.5, |
2223 | bgm_volume => 0.5, |
2203 | output_sync => 1, |
2224 | output_sync => 1, |
2204 | output_count => 1, |
2225 | output_count => 1, |
2205 | output_rate => "", |
2226 | output_rate => "", |
2206 | pickup => 0, |
2227 | pickup => 0, |
2207 | inv_sort => "mtime", |
2228 | inv_sort => "mtime", |
2208 | default => "profile", # default profile |
2229 | default => "profile", # default profile |
2209 | show_tips => 1, |
2230 | show_tips => 1, |
2210 | logview_max_par => 1000, |
2231 | logview_max_par => 1000, |
2211 | ); |
2232 | ); |
2212 | |
2233 | |
2213 | while (my ($k, $v) = each %DEF_CFG) { |
2234 | while (my ($k, $v) = each %DEF_CFG) { |
2214 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2235 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2215 | } |
2236 | } |
… | |
… | |
2281 | } |
2302 | } |
2282 | |
2303 | |
2283 | show_tip_of_the_day if $CFG->{show_tips}; |
2304 | show_tip_of_the_day if $CFG->{show_tips}; |
2284 | |
2305 | |
2285 | Event::loop; |
2306 | Event::loop; |
|
|
2307 | |
|
|
2308 | #video_shutdown; |
|
|
2309 | #audio_shutdown; |
2286 | #CFPlus::SDL_Quit; |
2310 | CFPlus::SDL_Quit; |
2287 | #CFPlus::_exit 0; |
|
|
2288 | |
|
|
2289 | END { |
|
|
2290 | CFPlus::SDL_Quit; |
|
|
2291 | CFPlus::DB::Server::stop; |
2311 | CFPlus::DB::Server::stop; |
2292 | } |
|
|
2293 | |
2312 | |
2294 | =head1 NAME |
2313 | =head1 NAME |
2295 | |
2314 | |
2296 | cfplus - A Crossfire+ and Crossfire game client |
2315 | cfplus - A Crossfire TRT and Crossfire game client |
2297 | |
2316 | |
2298 | =head1 SYNOPSIS |
2317 | =head1 SYNOPSIS |
2299 | |
2318 | |
2300 | Just run it - no commandline arguments are supported. |
2319 | Just run it - no commandline arguments are supported. |
2301 | |
2320 | |
2302 | =head1 USAGE |
2321 | =head1 USAGE |
2303 | |
2322 | |
2304 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
2323 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to |
2305 | fullscreen and interactively. |
2324 | be used in fullscreen mode and interactively. |
2306 | |
2325 | |
2307 | =head1 DEBUGGING |
2326 | =head1 DEBUGGING |
2308 | |
2327 | |
2309 | |
2328 | |
2310 | CFPLUS_DEBUG - environment variable |
2329 | CFPLUS_DEBUG - environment variable |