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.52 by root, Wed May 17 15:18:57 2006 UTC vs.
Revision 1.121 by root, Fri Sep 29 00:56:05 2006 UTC

1=head1 NAME 1=head1 NAME
2 2
3CFClient - undocumented utility garbage for our crossfire client 3CFPlus - undocumented utility garbage for our crossfire client
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use CFClient; 7 use CFPlus;
8 8
9=head1 DESCRIPTION 9=head1 DESCRIPTION
10 10
11=over 4 11=over 4
12 12
13=cut 13=cut
14 14
15package CFClient; 15package CFPlus;
16
17use Carp ();
16 18
17BEGIN { 19BEGIN {
18 $VERSION = '0.1'; 20 $VERSION = '0.52';
19 21
20 use XSLoader; 22 use XSLoader;
21 XSLoader::load "CFClient", $VERSION; 23 XSLoader::load "CFPlus", $VERSION;
22} 24}
23 25
24use Carp (); 26BEGIN {
27 $SIG{__DIE__} = sub {
28 return if CFPlus::in_destruct;
29 #CFPlus::fatal $_[0];#d#
30 CFPlus::error Carp::longmess $_[0];#d#
31 die;#d#
32 };
33}
34
35use utf8;
36
25use AnyEvent (); 37use AnyEvent ();
26use BerkeleyDB; 38use BerkeleyDB;
39use Pod::POM ();
40use Scalar::Util ();
41use Storable (); # finally
27 42
28use CFClient::OpenGL; 43=item guard { BLOCK }
29 44
30our %GL_EXT; 45Returns an object that executes the given block as soon as it is destroyed.
31our $GL_VERSION;
32 46
33our $GL_NPOT; 47=cut
34our $GL_DEBUG = 1;
35 48
36sub gl_init { 49sub guard(&) {
37 $GL_VERSION = gl_version * 1; 50 bless \(my $cb = $_[0]), "CFPlus::Guard"
38 %GL_EXT = map +($_ => 1), split /\s+/, gl_extensions;
39
40 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2;
41
42 glDisable GL_COLOR_MATERIAL;
43 glShadeModel GL_FLAT;
44 glDisable GL_DITHER;
45 glDisable GL_DEPTH_TEST;
46 glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST;
47
48 CFClient::Texture::restore_state ();
49} 51}
50 52
51sub gl_check { 53sub CFPlus::Guard::DESTROY {
52 return unless $GL_DEBUG; 54 ${$_[0]}->()
55}
53 56
54 if (my $error = glGetError) { 57sub asxml($) {
55 Carp::cluck sprintf "opengl error %x while %s", $error, sprintf @_; 58 local $_ = $_[0];
59
60 s/&/&/g;
61 s/>/>/g;
62 s/</&lt;/g;
63
64 $_
65}
66
67package CFPlus::Database;
68
69our @ISA = BerkeleyDB::Btree::;
70
71sub get($$) {
72 my $data;
73
74 $_[0]->db_get ($_[1], $data) == 0
75 ? $data
76 : ()
77}
78
79my %DB_SYNC;
80
81sub put($$$) {
82 my ($db, $key, $data) = @_;
83
84 my $hkey = $db + 0;
85 Scalar::Util::weaken $db;
86 $DB_SYNC{$hkey} ||= AnyEvent->timer (after => 5, cb => sub {
87 delete $DB_SYNC{$hkey};
88 $db->db_sync if $db;
56 } 89 });
90
91 $db->db_put ($key => $data)
57} 92}
93
94package CFPlus;
58 95
59sub find_rcfile($) { 96sub find_rcfile($) {
60 my $path; 97 my $path;
61 98
62 for (grep !ref, @INC) { 99 for (grep !ref, @INC) {
63 $path = "$_/CFClient/resources/$_[0]"; 100 $path = "$_/CFPlus/resources/$_[0]";
64 return $path if -r $path; 101 return $path if -r $path;
65 } 102 }
66 103
67 die "FATAL: can't find required file $_[0]\n"; 104 die "FATAL: can't find required file $_[0]\n";
68} 105}
69 106
107BEGIN {
108 use Crossfire::Protocol::Base ();
109 *to_json = \&Crossfire::Protocol::Base::to_json;
110 *from_json = \&Crossfire::Protocol::Base::from_json;
111}
112
70sub read_cfg { 113sub read_cfg {
71 my ($file) = @_; 114 my ($file) = @_;
72 115
73 open CFG, $file 116 open my $fh, $file
74 or return; 117 or return;
75 118
76 my $CFG;
77
78 local $/; 119 local $/;
79 $CFG = eval <CFG>; 120 my $CFG = <$fh>;
80 121
81 $::CFG = $CFG; 122 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove
82 123 require YAML;
83 close CFG; 124 utf8::decode $CFG;
125 $::CFG = YAML::Load ($CFG);
126 } elsif ($CFG =~ /^\{/) {
127 $::CFG = from_json $CFG;
128 } else {
129 $::CFG = eval $CFG; ## todo comaptibility cruft
130 }
84} 131}
85 132
86sub write_cfg { 133sub write_cfg {
87 my ($file) = @_; 134 my ($file) = @_;
88 135
89 open CFG, ">$file" 136 $::CFG->{VERSION} = $::VERSION;
137
138 open my $fh, ">:utf8", $file
90 or return; 139 or return;
91 140 print $fh to_json $::CFG;
92 {
93 require Data::Dumper;
94 local $Data::Dumper::Purity = 1;
95 $::CFG->{VERSION} = $::VERSION;
96 print CFG Data::Dumper->Dump ([$::CFG], [qw/CFG/]);
97 }
98
99 close CFG;
100} 141}
101 142
102mkdir "$Crossfire::VARDIR/pclient", 0777; 143our $DB_ENV;
103 144our $DB_STATE;
104our $DB_ENV = new BerkeleyDB::Env
105 -Home => "$Crossfire::VARDIR/pclient",
106 -Cachesize => 1_000_000,
107 -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt",
108# -ErrPrefix => "DATABASE",
109 -Verbose => 1,
110 -Flags => DB_CREATE | DB_RECOVER_FATAL | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN,
111 or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error";
112 145
113sub db_table($) { 146sub db_table($) {
114 my ($table) = @_; 147 my ($table) = @_;
115 148
116 $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; 149 $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge;
117 150
118 new CFClient::Database 151 new CFPlus::Database
119 -Env => $DB_ENV, 152 -Env => $DB_ENV,
120 -Filename => $table, 153 -Filename => $table,
121# -Filename => "database", 154# -Filename => "database",
122# -Subname => $table, 155# -Subname => $table,
123 -Property => DB_CHKSUM, 156 -Property => DB_CHKSUM,
124 -Flags => DB_CREATE | DB_UPGRADE, 157 -Flags => DB_CREATE | DB_UPGRADE,
125 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"; 158 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"
126} 159}
127 160
128sub pod_to_pango($) { 161{
129 my ($pom) = @_; 162 use strict;
130 163
131 $pom->present ("CFClient::PodToPango") 164 mkdir "$Crossfire::VARDIR/cfplus", 0777;
132} 165 my $recover = $BerkeleyDB::db_version >= 4.4
166 ? eval "DB_REGISTER | DB_RECOVER"
167 : 0;
133 168
134package CFClient::PodToPango; 169 $DB_ENV = new BerkeleyDB::Env
170 -Home => "$Crossfire::VARDIR/cfplus",
171 -Cachesize => 1_000_000,
172 -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt",
173# -ErrPrefix => "DATABASE",
174 -Verbose => 1,
175 -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover,
176 -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE,
177 or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error";
135 178
136use base Pod::POM::View::Text; 179 $DB_STATE = db_table "state";
137
138our $indent = 0;
139
140*view_seq_code =
141*view_seq_bold = sub { "<b>$_[1]</b>" };
142*view_seq_italic = sub { "<i>$_[1]</i>" };
143*view_seq_space =
144*view_seq_link =
145*view_seq_index = sub { CFClient::UI::Label::escape ($_[1]) };
146
147sub view_seq_text {
148 my $text = $_[1];
149 $text =~ s/\s+/ /g;
150 CFClient::UI::Label::escape ($text)
151} 180}
152 181
153sub view_item { 182package CFPlus::Layout;
154 ("\t" x ($indent / 4))
155 . $_[1]->title->present ($_[0])
156 . "\n"
157 . $_[1]->content->present ($_[0])
158}
159 183
160sub view_textblock { 184$CFPlus::OpenGL::SHUTDOWN_HOOK{"CFPlus::Layout"} = sub {
161 ("\t" x ($indent / 2)) . "$_[1]\n\n" 185 reset_glyph_cache;
162}
163
164sub view_head2 {
165 "<big>" . $_[1]->title->present ($_[0]) . "</big>\n\n"
166 . $_[1]->content->present ($_[0])
167}; 186};
168 187
169sub view_over { 188package CFPlus::Item;
170 local $indent = $indent + $_[1]->indent;
171 $_[1]->content->present ($_[0])
172}
173
174package CFClient::Database;
175
176our @ISA = BerkeleyDB::Btree::;
177
178sub get($$) {
179 my $data;
180
181 $_[0]->db_get ($_[1], $data) == 0
182 ? $data
183 : ()
184}
185
186my %DB_SYNC;
187
188sub put($$$) {
189 my ($db, $key, $data) = @_;
190
191 $DB_SYNC{$db} = AnyEvent->timer (after => 5, cb => sub { $db->db_sync });
192
193 $db->db_put ($key => $data)
194}
195
196package CFClient::Texture;
197 189
198use strict; 190use strict;
191use Crossfire::Protocol::Constants;
199 192
200use Scalar::Util; 193my $last_enter_count = 1;
201 194
202use CFClient::OpenGL; 195sub desc_string {
203
204my %TEXTURES;
205
206sub new {
207 my ($class, %data) = @_;
208
209 my $self = bless {
210 internalformat => GL_RGBA,
211 format => GL_RGBA,
212 type => GL_UNSIGNED_BYTE,
213 %data,
214 }, $class;
215
216 Scalar::Util::weaken ($TEXTURES{$self+0} = $self);
217
218 $self->upload;
219
220 $self
221}
222
223sub new_from_image {
224 my ($class, $image, %arg) = @_;
225
226 $class->new (image => $image, %arg)
227}
228
229sub new_from_file {
230 my ($class, $path, %arg) = @_;
231
232 open my $fh, "<:raw", $path
233 or die "$path: $!";
234
235 local $/;
236 $class->new_from_image (<$fh>, %arg)
237}
238
239#sub new_from_surface {
240# my ($class, $surface) = @_;
241#
242# $surface->rgba;
243#
244# $class->new (
245# data => $surface->pixels,
246# w => $surface->width,
247# h => $surface->height,
248# )
249#}
250
251sub new_from_layout {
252 my ($class, $layout, %arg) = @_;
253
254 my ($w, $h, $data, $format, $internalformat) = $layout->render;
255
256 $class->new (
257 w => $w,
258 h => $h,
259 data => $data,
260 format => $format,
261 internalformat => $format,
262 type => GL_UNSIGNED_BYTE,
263 %arg,
264 )
265}
266
267sub new_from_opengl {
268 my ($class, $w, $h, $cb) = @_;
269
270 $class->new (w => $w || 1, h => $h || 1, render_cb => $cb)
271}
272
273sub topot {
274 (grep $_ >= $_[0], 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)[0]
275}
276
277sub upload {
278 my ($self) = @_; 196 my ($self) = @_;
279 197
280 return unless $GL_VERSION; 198 my $desc =
199 $self->{nrof} < 2
200 ? $self->{name}
201 : "$self->{nrof} × $self->{name_pl}";
281 202
282 my $data; 203 $self->{flags} & F_OPEN
204 and $desc .= " (open)";
205 $self->{flags} & F_APPLIED
206 and $desc .= " (applied)";
207 $self->{flags} & F_UNPAID
208 and $desc .= " (unpaid)";
209 $self->{flags} & F_MAGIC
210 and $desc .= " (magic)";
211 $self->{flags} & F_CURSED
212 and $desc .= " (cursed)";
213 $self->{flags} & F_DAMNED
214 and $desc .= " (damned)";
215 $self->{flags} & F_LOCKED
216 and $desc .= " *";
283 217
284 if (exists $self->{data}) { 218 $desc
285 $data = $self->{data}; 219}
286 220
287 } elsif (exists $self->{render_cb}) { 221sub weight_string {
288 glViewport 0, 0, $self->{w}, $self->{h}; 222 my ($self) = @_;
289 glMatrixMode GL_PROJECTION;
290 glLoadIdentity;
291 glOrtho 0, $self->{w}, 0, $self->{h}, -10000, 10000;
292 glMatrixMode GL_MODELVIEW;
293 glLoadIdentity;
294 $self->{render_cb}->($self, $self->{w}, $self->{h});
295 223
296 } else { 224 my $weight = ($self->{nrof} || 1) * $self->{weight};
297 ($self->{w}, $self->{h}, $data, $self->{internalformat}, $self->{format}, $self->{type}) 225
298 = CFClient::load_image_inline $self->{image}; 226 $weight < 0 ? "?" : $weight * 0.001
227}
228
229sub do_n_dialog {
230 my ($cb) = @_;
231
232 my $w = new CFPlus::UI::Toplevel
233 on_delete => sub { $_[0]->destroy; 1 },
234 has_close_button => 1,
299 } 235 ;
300 236
301 my ($tw, $th) = @$self{qw(w h)}; 237 $w->add (my $vb = new CFPlus::UI::VBox x => "center", y => "center");
238 $vb->add (new CFPlus::UI::Label text => "Enter item count:");
239 $vb->add (my $entry = new CFPlus::UI::Entry
240 text => $last_enter_count,
241 on_activate => sub {
242 my ($entry) = @_;
243 $last_enter_count = $entry->get_text;
244 $cb->($last_enter_count);
245 $w->hide;
246 $w->destroy;
302 247
303 unless ($tw > 0 && $th > 0) { 248 0
304 $tw = $th = 1; 249 },
305 $data = "\x00" x 64; 250 on_escape => sub { $w->destroy; 1 },
306 } 251 );
252 $entry->grab_focus;
253 $w->show;
254}
307 255
308 $self->{minified} = [CFClient::average $tw, $th, $data] 256sub update_widgets {
309 if $self->{minify}; 257 my ($self) = @_;
310 258
311 unless ($GL_NPOT) { 259 # necessary to avoid cyclic references
312 # TODO: does not work for zero-sized textures 260 Scalar::Util::weaken $self;
313 $tw = topot $tw;
314 $th = topot $th;
315 261
316 if (($tw != $self->{w} || $th != $self->{h}) && defined $data) { 262 my $button_cb = sub {
317 my $bpp = (length $data) / ($self->{w} * $self->{h}); 263 my (undef, $ev, $x, $y) = @_;
318 $data = pack "(a" . ($tw * $bpp) . ")*", 264
319 unpack "(a" . ($self->{w} * $bpp) . ")*", $data; 265 my $targ = $::CONN->{player}{tag};
320 $data .= ("\x00" x ($tw * $bpp)) x ($th - $self->{h}); 266
267 if ($self->{container} == $::CONN->{player}{tag}) {
268 $targ = $::CONN->{open_container};
321 } 269 }
270
271 if (($ev->{mod} & CFPlus::KMOD_SHIFT) && $ev->{button} == 1) {
272 $::CONN->send ("move $targ $self->{tag} 0")
273 if $targ || !($self->{flags} & F_LOCKED);
274 } elsif (($ev->{mod} & CFPlus::KMOD_SHIFT) && $ev->{button} == 2) {
275 $self->{flags} & F_LOCKED
276 ? $::CONN->send ("lock " . pack "CN", 0, $self->{tag})
277 : $::CONN->send ("lock " . pack "CN", 1, $self->{tag})
278 } elsif ($ev->{button} == 1) {
279 $::CONN->send ("examine $self->{tag}");
280 } elsif ($ev->{button} == 2) {
281 $::CONN->send ("apply $self->{tag}");
282 } elsif ($ev->{button} == 3) {
283 my $move_prefix = $::CONN->{open_container} ? 'put' : 'drop';
284 if ($self->{container} == $::CONN->{open_container}) {
285 $move_prefix = "take";
286 }
287
288 my @menu_items = (
289 ["examine", sub { $::CONN->send ("examine $self->{tag}") }],
290 ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }],
291 ["ignite/thaw", # first try of an easier use of flint&steel
292 sub {
293 $::CONN->send ("mark ". pack "N", $self->{tag});
294 $::CONN->send ("command apply flint and steel");
295 }
296 ],
297 ["inscribe", # first try of an easier use of flint&steel
298 sub {
299 &::open_string_query ("Text to inscribe", sub {
300 my ($entry, $txt) = @_;
301 $::CONN->send ("mark ". pack "N", $self->{tag});
302 $::CONN->send ("command use_skill inscription $txt");
303 });
304 }
305 ],
306 ["rename", # first try of an easier use of flint&steel
307 sub {
308 &::open_string_query ("Rename item to:", sub {
309 my ($entry, $txt) = @_;
310 $::CONN->send ("mark ". pack "N", $self->{tag});
311 $::CONN->send ("command rename to <$txt>");
312 }, $self->{name},
313 "If you input no name or erase the current custom name, the custom name will be unset");
314 }
315 ],
316 ["apply", sub { $::CONN->send ("apply $self->{tag}") }],
317 (
318 $self->{flags} & F_LOCKED
319 ? (
320 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }],
321 )
322 : (
323 ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }],
324 ["$move_prefix all", sub { $::CONN->send ("move $targ $self->{tag} 0") }],
325 ["$move_prefix &lt;n&gt;",
326 sub {
327 do_n_dialog (sub { $::CONN->send ("move $targ $self->{tag} $_[0]") })
328 }
329 ]
330 )
331 ),
332 );
333
334 CFPlus::UI::Menu->new (items => \@menu_items)->popup ($ev);
335 }
336
337 1
322 } 338 };
323 339
324 $self->{s} = $self->{w} / $tw; 340 my $tooltip_std = "<small>"
325 $self->{t} = $self->{h} / $th; 341 . "Left click - examine item\n"
342 . "Shift-Left click - " . ($self->{container} ? "move or drop" : "take") . " item\n"
343 . "Middle click - apply\n"
344 . "Shift-Middle click - lock/unlock\n"
345 . "Right click - further options"
346 . "</small>\n";
326 347
327 $self->{name} ||= glGenTexture; 348 my $bg = $self->{flags} & F_CURSED ? [1 , 0 , 0, 0.5]
349 : $self->{flags} & F_MAGIC ? [0.2, 0.2, 1, 0.5]
350 : undef;
328 351
329 glBindTexture GL_TEXTURE_2D, $self->{name}; 352 $self->{face_widget} ||= new CFPlus::UI::Face
330 353 can_events => 1,
331 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP; 354 can_hover => 1,
332 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP; 355 anim => $self->{anim},
333 356 animspeed => $self->{animspeed}, # TODO# must be set at creation time
334 if ($::FAST) { 357 on_button_down => $button_cb,
335 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST;
336 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST;
337 } elsif ($self->{mipmap} && $GL_VERSION >= 1.4) {
338 # alternatively check for 0x8191
339 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 1;
340 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR;
341 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR;
342 } else {
343 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, $self->{mipmap};
344 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR;
345 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR;
346 } 358 ;
359 $self->{face_widget}{bg} = $bg;
360 $self->{face_widget}{face} = $self->{face};
361 $self->{face_widget}{anim} = $self->{anim};
362 $self->{face_widget}{animspeed} = $self->{animspeed};
363 $self->{face_widget}->set_tooltip (
364 "<b>Face/Animation.</b>\n"
365 . "Item uses face #$self->{face}. "
366 . ($self->{animspeed} ? "Item uses animation #$self->{anim} at " . (1 / $self->{animspeed}) . "fps. " : "Item is not animated. ")
367 . "\n\n$tooltip_std"
368 );
347 369
348 glGetError; 370 $self->{desc_widget} ||= new CFPlus::UI::Label
349 371 can_events => 1,
350 if (defined $data) { 372 can_hover => 1,
351 glTexImage2D GL_TEXTURE_2D, 0, 373 ellipsise => 2,
352 $self->{internalformat}, 374 align => -1,
353 $tw, $th, # need to pad texture first 375 on_button_down => $button_cb,
354 0,
355 $self->{format},
356 $self->{type},
357 $data;
358 CFClient::gl_check "uploading texture %dx%d if=%x f=%x t=%x",
359 $tw, $th, $self->{internalformat}, $self->{format}, $self->{type};
360 } else {
361 glCopyTexImage2D GL_TEXTURE_2D, 0,
362 $self->{internalformat},
363 0, 0,
364 $tw, $th,
365 0;
366 CFClient::gl_check "copying to texture %dx%d if=%x",
367 $tw, $th, $self->{internalformat};
368 } 376 ;
369} 377 my $desc = CFPlus::Item::desc_string $self;
378 $self->{desc_widget}{bg} = $bg;
379 $self->{desc_widget}->set_text ($desc);
380 $self->{desc_widget}->set_tooltip ("<b>$desc</b>.\n$tooltip_std");
370 381
371sub DESTROY { 382 $self->{weight_widget} ||= new CFPlus::UI::Label
372 my ($self) = @_; 383 can_events => 1,
373 384 can_hover => 1,
374 delete $TEXTURES{$self+0}; 385 ellipsise => 0,
375 386 align => 0,
376 glDeleteTexture delete $self->{name} 387 on_button_down => $button_cb,
377 if $self->{name}; 388 ;
389 $self->{weight_widget}{bg} = $bg;
390 $self->{weight_widget}->set_text (CFPlus::Item::weight_string $self);
391 $self->{weight_widget}->set_tooltip (
392 "<b>Weight</b>.\n"
393 . ($self->{weight} >= 0 ? "One item weighs $self->{weight}g. " : "You have no idea how much this weighs. ")
394 . ($self->{nrof} ? "You have $self->{nrof} of it. " : "Item cannot stack with others of it's kind. ")
395 . "\n\n$tooltip_std"
396 );
378} 397}
379
380sub restore_state{
381 $_->upload
382 for values %TEXTURES;
383};
384 398
3851; 3991;
386 400
387=back 401=back
388 402

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines