ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.143 by root, Mon Apr 16 20:35:28 2007 UTC vs.
Revision 1.165 by root, Tue Dec 25 19:23:11 2007 UTC

15package CFPlus; 15package CFPlus;
16 16
17use Carp (); 17use Carp ();
18 18
19BEGIN { 19BEGIN {
20 $VERSION = '0.97'; 20 $VERSION = '0.9961';
21 21
22 use XSLoader; 22 use XSLoader;
23 XSLoader::load "CFPlus", $VERSION; 23 XSLoader::load "CFPlus", $VERSION;
24} 24}
25 25
28use AnyEvent (); 28use AnyEvent ();
29use Pod::POM (); 29use Pod::POM ();
30use File::Path (); 30use File::Path ();
31use Storable (); # finally 31use Storable (); # finally
32use Fcntl (); 32use Fcntl ();
33 33use JSON::XS qw(encode_json decode_json);
34BEGIN {
35 use Crossfire::Protocol::Base ();
36 *to_json = \&Crossfire::Protocol::Base::to_json;
37 *from_json = \&Crossfire::Protocol::Base::from_json;
38}
39 34
40=item guard { BLOCK } 35=item guard { BLOCK }
41 36
42Returns an object that executes the given block as soon as it is destroyed. 37Returns an object that executes the given block as soon as it is destroyed.
43 38
170 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove 165 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove
171 require YAML; 166 require YAML;
172 utf8::decode $CFG; 167 utf8::decode $CFG;
173 $::CFG = YAML::Load ($CFG); 168 $::CFG = YAML::Load ($CFG);
174 } elsif ($CFG =~ /^\{/) { 169 } elsif ($CFG =~ /^\{/) {
175 $::CFG = from_json $CFG; 170 $::CFG = decode_json $CFG;
176 } else { 171 } else {
177 $::CFG = eval $CFG; ## todo comaptibility cruft 172 $::CFG = eval $CFG; ## todo comaptibility cruft
178 } 173 }
179} 174}
180 175
183 178
184 $::CFG->{VERSION} = $::VERSION; 179 $::CFG->{VERSION} = $::VERSION;
185 180
186 open my $fh, ">:utf8", $file 181 open my $fh, ">:utf8", $file
187 or return; 182 or return;
188 print $fh to_json $::CFG; 183 print $fh encode_json $::CFG;
189} 184}
190 185
191sub http_proxy { 186sub http_proxy {
192 my @proxy = win32_proxy_info; 187 my @proxy = win32_proxy_info;
193 188
241 236
242} 237}
243 238
244package CFPlus::Layout; 239package CFPlus::Layout;
245 240
241$CFPlus::OpenGL::INIT_HOOK{"CFPlus::Layout"} = sub {
242 glyph_cache_restore;
243};
244
246$CFPlus::OpenGL::SHUTDOWN_HOOK{"CFPlus::Layout"} = sub { 245$CFPlus::OpenGL::SHUTDOWN_HOOK{"CFPlus::Layout"} = sub {
247 reset_glyph_cache; 246 glyph_cache_backup;
248}; 247};
249 248
2501; 2491;
251 250
252=back 251=back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines