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

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.97 by elmex, Wed Jul 19 16:41:51 2006 UTC vs.
Revision 1.102 by root, Mon Jul 24 04:24:43 2006 UTC

36 36
37use CFClient; 37use CFClient;
38use CFClient::OpenGL (); 38use CFClient::OpenGL ();
39use CFClient::Protocol; 39use CFClient::Protocol;
40use CFClient::UI; 40use CFClient::UI;
41use CFClient::Pod;
41use CFClient::BindingEditor; 42use CFClient::BindingEditor;
42use CFClient::MapWidget; 43use CFClient::MapWidget;
43 44
44$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 45$SIG{QUIT} = sub { Carp::cluck "QUIT" };
45$SIG{PIPE} = 'IGNORE'; 46$SIG{PIPE} = 'IGNORE';
130our $BIND_UPD_CB; 131our $BIND_UPD_CB;
131 132
132our $PICKUP_CFG; 133our $PICKUP_CFG;
133 134
134sub status { 135sub status {
135 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); 136 $STATUSBOX->add (CFClient::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
136} 137}
137 138
138sub debug { 139sub debug {
139 $DEBUG_STATUS->set_text ($_[0]); 140 $DEBUG_STATUS->set_text ($_[0]);
140} 141}
189 $MESSAGE_WINDOW->show; 190 $MESSAGE_WINDOW->show;
190 191
191 unshift @dialog, new CFClient::UI::Label 192 unshift @dialog, new CFClient::UI::Label
192 max_w => $::WIDTH * 0.4, 193 max_w => $::WIDTH * 0.4,
193 ellipsise => 0, 194 ellipsise => 0,
194 markup => "\nOr use your keyboard:\n"; 195 markup => "\nOr use your keyboard and the text entry below:\n";
195 196
196 unshift @dialog, my $table = new CFClient::UI::Table; 197 unshift @dialog, my $table = new CFClient::UI::Table;
197 198
198 $table->add (0, 0, new CFClient::UI::Button 199 $table->add (0, 0, new CFClient::UI::Button
199 text => "Next Race", 200 text => "Next Race",
216 max_w => $::WIDTH * 0.4, 217 max_w => $::WIDTH * 0.4,
217 ellipsise => 0, 218 ellipsise => 0,
218 markup => 219 markup =>
219 "<big><b>Character Creation: Race</b></big>\n\n" 220 "<big><b>Character Creation: Race</b></big>\n\n"
220 . "Look at the <b>Messages</b> window to see a description of this race " 221 . "Look at the <b>Messages</b> window to see a description of this race "
221 . "(<small>or hover with your mouse over the bottommost entry in the status area in the lower left area of the screen</small>) "
222 . "and the center of the screen to see how this race looks like " 222 . "and the center of the screen to see how this race looks like "
223 . "(<small>this is below this dialog window, you may need to click on the display area to make it visible</small>).\n\n" 223 . "(<small>below this dialog window: you may need to move the dialog away and "
224 . "click into the display area to make it visible</small>).\n\n"
224 . "You can look at another race, or accept this race (you will come back to this race eventually, " 225 . "You can look at another race, or accept this race (you will cycle back to "
225 . "so you can take your time making this important choice." 226 . "this race eventually, so you can take your time making this important choice."
226 ; 227 ;
227 228
228 } elsif ($prompt =~ /roll new stats/) { 229 } elsif ($prompt =~ /roll new stats/) {
229 if (my $stat = delete $conn->{stat_change_with}) { 230 if (my $stat = delete $conn->{stat_change_with}) {
230 $conn->send ("reply $stat"); 231 $conn->send ("reply $stat");
236 $MESSAGE_WINDOW->hide; 237 $MESSAGE_WINDOW->hide;
237 238
238 unshift @dialog, new CFClient::UI::Label 239 unshift @dialog, new CFClient::UI::Label
239 max_w => $::WIDTH * 0.4, 240 max_w => $::WIDTH * 0.4,
240 ellipsise => 0, 241 ellipsise => 0,
241 markup => "\nOr use your keyboard:\n"; 242 markup => "\nOr use your keyboard and the text entry below:\n";
242 243
243 unshift @dialog, my $table = new CFClient::UI::Table; 244 unshift @dialog, my $table = new CFClient::UI::Table;
244 245
245 # left: re-roll 246 # left: re-roll
246 $table->add (0, 0, new CFClient::UI::Button 247 $table->add (0, 0, new CFClient::UI::Button
251 0 252 0
252 }, 253 },
253 ); 254 );
254 255
255 # center: swap stats 256 # center: swap stats
256 my ($sw1, $sw2) = map +(new CFClient::UI::Combobox 257 my ($sw1, $sw2) = map +(new CFClient::UI::Selector
258 expand => 1,
257 value => $_, 259 value => $_,
258 options => [ 260 options => [
259 [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"], 261 [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"],
260 [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"], 262 [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"],
261 [3 => "Con", "Constitution ($conn->{stat}{+CS_STAT_CON})"], 263 [3 => "Con", "Constitution ($conn->{stat}{+CS_STAT_CON})"],
286 destroy_query_dialog $conn; 288 destroy_query_dialog $conn;
287 0 289 0
288 }, 290 },
289 ); 291 );
290 292
293 unshift @dialog, my $hbox = new CFClient::UI::HBox;
294 for (
295 [Str => CS_STAT_STR],
296 [Dex => CS_STAT_DEX],
297 [Con => CS_STAT_CON],
298 [Int => CS_STAT_INT],
299 [Wis => CS_STAT_WIS],
300 [Pow => CS_STAT_POW],
301 [Cha => CS_STAT_CHA],
302 ) {
303 my ($name, $id) = @$_;
304 $hbox->add (new CFClient::UI::Label
305 markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>",
306 align => 0,
307 expand => 1,
308 can_events => 1,
309 can_hover => 1,
310 tooltip => $CFClient::STAT_TOOLTIP{$name},
311 );
312 }
313
291 unshift @dialog, new CFClient::UI::Label 314 unshift @dialog, new CFClient::UI::Label
292 max_w => $::WIDTH * 0.4, 315 max_w => $::WIDTH * 0.4,
293 ellipsise => 0, 316 ellipsise => 0,
294 markup => 317 markup =>
295 "<big><b>Character Creation: Stats</b></big>\n\n" 318 "<big><b>Character Creation: Stats</b></big>\n\n"
296 . "Look at the <b>Stats</b> window to see your basic stats " 319 . "<b>Stats</b> are a very important aspect of your character. You can use the tooltips to learn what each Stat governs.\n\n"
297 . "(first column: 1 strength, 2 dexterity, 3 constitution, 4 intelligence, 5 wisdom, 6 power and 7 charisma).\n\n" 320 . "The stats generated by the server are always sorted from Str (highest) to Cha (lowest). "
321 . "They will be modified later by both the race and the class you choose.\n\n"
298 . "You can create another set of stats, swap two stat values with each other or accept the stats as they are now and continue. " 322 . "You can create another set of stats, swap two stat values with each other or accept the stats as shown below and continue.\n"
299 . "Race selection will influence those values later on."
300 ; 323 ;
301 } 324 }
302 325
303 push @dialog, my $entry = new CFClient::UI::Entry 326 push @dialog, my $entry = new CFClient::UI::Entry
304 on_changed => sub { 327 on_changed => sub {
644 667
645 $table 668 $table
646} 669}
647 670
648sub stats_window { 671sub stats_window {
649 my $r =
650 new CFClient::UI::ScrolledWindow ( 672 my $r = new CFClient::UI::ScrolledWindow (
651 expand => 1, 673 expand => 1,
652 scroll_y => 1 674 scroll_y => 1
653 ); 675 );
654 $r->add (my $vb = new CFClient::UI::VBox); 676 $r->add (my $vb = new CFClient::UI::VBox);
655 677
656 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 678 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1,
657 can_hover => 1, can_events => 1, 679 can_hover => 1, can_events => 1,
658 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); 680 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server.");
666 tooltip => "The weight of the player including all inventory items."); 688 tooltip => "The weight of the player including all inventory items.");
667 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, 689 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1,
668 can_hover => 1, can_events => 1, 690 can_hover => 1, can_events => 1,
669 tooltip => "The weight limit: you cannot carry more than this."); 691 tooltip => "The weight limit: you cannot carry more than this.");
670 692
671
672 $vb->add (my $hb = new CFClient::UI::HBox expand => 1); 693 $vb->add (my $hb = new CFClient::UI::HBox expand => 1);
673 $hb->add (my $tbl = new CFClient::UI::Table expand => 1); 694 $hb->add (my $tbl = new CFClient::UI::Table expand => 1);
674 695
675 my $color2 = [1, 1, 0]; 696 my $color2 = [1, 1, 0];
676 697
677 for ( 698 for (
678 [0, 0, st_str => "Str", 30, "<b>Physical Strength</b>, determines damage dealt with weapons, how much you can carry, and how often you can attack"], 699 [0, 0, st_str => "Str", 30],
679 [0, 1, st_dex => "Dex", 30, "<b>Dexterity</b>, your physical agility. Determines chance of being hit and affects armor class and speed"], 700 [0, 1, st_dex => "Dex", 30],
680 [0, 2, st_con => "Con", 30, "<b>Constitution</b>, physical health and toughness. Determines how many healthpoints you can have"], 701 [0, 2, st_con => "Con", 30],
681 [0, 3, st_int => "Int", 30, "<b>Intelligence</b>, your ability to learn and use skills and incantations (both prayers and magic) and determines how much spell points you can have"], 702 [0, 3, st_int => "Int", 30],
682 [0, 4, st_wis => "Wis", 30, "<b>Wisdom</b>, the ability to learn and use divine magic (prayers). Determines how many grace points you can have"], 703 [0, 4, st_wis => "Wis", 30],
683 [0, 5, st_pow => "Pow", 30, "<b>Power</b>, your magical potential. Influences the strength of spell effects, and also how much your spell and grace points increase when leveling up"], 704 [0, 5, st_pow => "Pow", 30],
684 [0, 6, st_cha => "Cha", 30, "<b>Charisma</b>, how well you are received by NPCs. Affects buying and selling prices in shops."], 705 [0, 6, st_cha => "Cha", 30],
685 706
686 [2, 0, st_wc => "Wc", -120, "<b>Weapon Class</b>, effectiveness of melee/missile attacks. Lower is more potent. Current weapon, level and Str are some things which effect the value of Wc. The value of Wc may range between 25 and -72."], 707 [2, 0, st_wc => "Wc", -120],
687 [2, 1, st_ac => "Ac", -120, "<b>Armour Class</b>, how protected you are from being hit by any attack. Lower values are better. Ac is based on your race and is modified by the Dex and current armour worn. For characters that cannot wear armour, Ac improves as their level increases."], 708 [2, 1, st_ac => "Ac", -120],
688 [2, 2, st_dam => "Dam", 120, "<b>Damage</b>, how much damage your melee/missile attack inflicts. Higher values indicate a greater amount of damage will be inflicted with each attack."], 709 [2, 2, st_dam => "Dam", 120],
689 [2, 3, st_arm => "Arm", 120, "<b>Armour</b>, how much damage (from physical attacks) will be subtracted from successful hits made upon you. This value ranges between 0 to 99%. Current armour worn primarily determines Arm value. This is the same as the physical resistance."], 710 [2, 3, st_arm => "Arm", 120],
690 [2, 4, st_spd => "Spd", 10.54, "<b>Speed</b>, how fast you can move. The value of speed may range between nearly 0 (\"very slow\") to higher than 5 (\"lightning fast\"). Base speed is determined from the Dex and modified downward proportionally by the amount of weight carried which exceeds the Max Carry limit. The armour worn also sets the upper limit on speed."], 711 [2, 4, st_spd => "Spd", 10.54],
691 [2, 5, st_wspd => "WSp", 10.54, "<b>Weapon Speed</b>, how many attacks you may make per unit of time (0.120s). Higher values indicate faster attack speed. Current weapon and Dex effect the value of weapon speed."], 712 [2, 5, st_wspd => "WSp", 10.54],
692 ) { 713 ) {
693 my ($col, $row, $id, $label, $template, $tooltip) = @$_; 714 my ($col, $row, $id, $label, $template) = @$_;
694 715
695 $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label 716 $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label
696 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, align => +1, template => $template, tooltip => $tooltip); 717 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0,
718 align => +1, template => $template, tooltip => $CFClient::STAT_TOOLTIP{$label});
697 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label 719 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label
698 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, align => -1, text => $label, tooltip => $tooltip); 720 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0,
721 align => -1, text => $label, tooltip => $CFClient::STAT_TOOLTIP{$label});
699 } 722 }
700 723
701 $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1); 724 $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1);
702 725
703 my $row = 0; 726 my $row = 0;
1109 $QUIT_DIALOG = new CFClient::UI::FancyFrame 1132 $QUIT_DIALOG = new CFClient::UI::FancyFrame
1110 x => "center", 1133 x => "center",
1111 y => "center", 1134 y => "center",
1112 z => 50, 1135 z => 50,
1113 title => "Really Quit?", 1136 title => "Really Quit?",
1137 on_key_down => sub {
1138 my ($dialog, $ev) = @_;
1139 $ev->{sym} == 27 and $dialog->hide;
1140 }
1114 ; 1141 ;
1115 1142
1116 $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1); 1143 $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1);
1117 1144
1118 $vb->add (new CFClient::UI::Label 1145 $vb->add (new CFClient::UI::Label
1132 on_activate => sub { exit }, 1159 on_activate => sub { exit },
1133 ); 1160 );
1134 } 1161 }
1135 1162
1136 $QUIT_DIALOG->show; 1163 $QUIT_DIALOG->show;
1164 $QUIT_DIALOG->grab_focus;
1137} 1165}
1138 1166
1139sub autopickup_setup { 1167sub autopickup_setup {
1140 my $table = new CFClient::UI::Table; 1168 my $table = new CFClient::UI::Table;
1141 1169
1231 }); 1259 });
1232 1260
1233 $table 1261 $table
1234} 1262}
1235 1263
1264my %SORT_ORDER = (
1265 type => undef,
1266 mtime => sub { sort {
1267 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED)
1268 or $b->{mtime} <=> $a->{mtime}
1269 or $a->{type} <=> $b->{type}
1270 } @_ },
1271 weight => sub { sort {
1272 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1273 or $a->{type} <=> $b->{type}
1274 } @_ },
1275);
1276
1236sub inventory_widget { 1277sub inventory_widget {
1237 my $hb = new CFClient::UI::HBox homogeneous => 1; 1278 my $hb = new CFClient::UI::HBox homogeneous => 1;
1238 1279
1239 $hb->add (my $vb1 = new CFClient::UI::VBox); 1280 $hb->add (my $vb1 = new CFClient::UI::VBox);
1240 $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); 1281 $vb1->add (new CFClient::UI::Label align => 0, text => "Player");
1282
1283 $vb1->add (my $hb1 = new CFClient::UI::HBox);
1284
1285 use sort 'stable';
1286
1287 $hb1->add (new CFClient::UI::Selector
1288 value => $::CFG->{inv_sort},
1289 options => [
1290 [type => "Type/Name"],
1291 [mtime => "Recent/Normal/Locked"],
1292 [weight => "Weight/Type"],
1293 ],
1294 on_changed => sub {
1295 $::CFG->{inv_sort} = $_[1];
1296 $INV->set_sort_order ($SORT_ORDER{$_[1]});
1297 },
1298 );
1299 $hb1->add (new CFClient::UI::Label text => "Weight: ", align => 1, expand => 1);
1300 #TODO# update to weigh/maxweight
1301 $hb1->add ($STATWIDS->{i_weight} = new CFClient::UI::Label align => -1);
1302
1241 $vb1->add (my $sw1 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1); 1303 $vb1->add (my $sw1 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1);
1242 $sw1->add ($INV = new CFClient::UI::Inventory); 1304 $sw1->add ($INV = new CFClient::UI::Inventory);
1243 1305
1244 $hb->add (my $vb2 = new CFClient::UI::VBox); 1306 $hb->add (my $vb2 = new CFClient::UI::VBox);
1245 1307
1437 1499
1438 my $parser = HTML::Parser->new ( 1500 my $parser = HTML::Parser->new (
1439 text_h => [sub { 1501 text_h => [sub {
1440 my ($text) = @_; 1502 my ($text) = @_;
1441 $text =~ s/\s+/ /g; 1503 $text =~ s/\s+/ /g;
1442 $s[-1]{text} .= CFClient::UI::Label::escape $text; 1504 $s[-1]{text} .= CFClient::asxml $text;
1443 }, "dtext"], 1505 }, "dtext"],
1444 start_h => [sub { 1506 start_h => [sub {
1445 my ($tag, $attr) = @_; 1507 my ($tag, $attr) = @_;
1446 if ($passthrough{$tag}) { 1508 if ($passthrough{$tag}) {
1447 $s[-1]{text} .= "<$tag>"; 1509 $s[-1]{text} .= "<$tag>";
1512 $vbox->add (my $buttons = new CFClient::UI::HBox); 1574 $vbox->add (my $buttons = new CFClient::UI::HBox);
1513 $vbox->add (my $viewer = new CFClient::UI::TextScroller 1575 $vbox->add (my $viewer = new CFClient::UI::TextScroller
1514 expand => 1, fontsize => 0.8, padding_x => 4); 1576 expand => 1, fontsize => 0.8, padding_x => 4);
1515 1577
1516 $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); 1578 $buttons->add (new CFClient::UI::Label text => "Choose a document to display: ");
1517 $buttons->add (my $combo = new CFClient::UI::Combobox 1579 $buttons->add (my $combo = new CFClient::UI::Selector
1518 value => undef, 1580 value => undef,
1519 options => [ 1581 options => [
1520 [intro => "Introduction"], 1582 [intro => "Introduction"],
1521 [manual => "Main Manual"], 1583 [manual => "Main Manual"],
1522 [skill_help => "Skill Reference"], 1584 [skill_help => "Skill Reference"],
1534 }; 1596 };
1535 warn "$@" if $@; 1597 warn "$@" if $@;
1536 return; 1598 return;
1537 } 1599 }
1538 1600
1539 my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", 1601 my $pom = CFClient::Pod::load CFClient::find_rcfile "pod/$pod.pod",
1540 doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; 1602 doc_viewer => 1, sub { CFClient::Pod::as_paragraphs $_[0] };
1603
1604 #use Data::Dumper; warn Dumper $pom;#d#
1541 1605
1542 $viewer->clear; 1606 $viewer->clear;
1543 1607
1544# $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n", 1608# $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n",
1545# (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1), 1609# (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1),
1546# (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"), 1610# (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"),
1547# ]);#d# 1611# ]);#d#
1548 1612
1549 $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) 1613 $viewer->add_paragraph ([1, 1, 1, 1], [$_->{text}, @{ $_->{obj} || [] }], $_->{indent})
1550 for @$pom; 1614 for @$pom;
1551 1615
1552 $viewer->set_offset (0); 1616 $viewer->set_offset (0);
1553 1617
1554 0 1618 0
1820 1884
1821 $WANT_REFRESH = 0; 1885 $WANT_REFRESH = 0;
1822 $CAN_REFRESH = 0; 1886 $CAN_REFRESH = 0;
1823 $LAST_REFRESH = $NOW; 1887 $LAST_REFRESH = $NOW;
1824 1888
18250 && do {
1826 # some weird model-drawing code, just a joke right now
1827 use CFClient::OpenGL;
1828
1829 $demo{t}{eye_auv} ||= new_from_file CFClient::Texture "eye2.png" or die;
1830 $demo{t}{body_auv} ||= new_from_file CFClient::Texture "body_auv3.png" or die;
1831 $demo{r} ||= do {
1832 my $mod = Compress::LZF::sthaw do { local $/; open my $fh, "<:raw:perlio", "dread.lz3"; <$fh> };
1833 $mod->{v} = pack "f*", @{$mod->{v}};
1834 $_ = [scalar @$_, pack "S!*", @$_]
1835 for values %{$mod->{g}};
1836 $mod
1837 };
1838
1839 my $r = $demo{r} or die;
1840
1841 glDepthMask 1;
1842 glClear GL_DEPTH_BUFFER_BIT;
1843 glEnable GL_TEXTURE_2D;
1844 glEnable GL_DEPTH_TEST;
1845 glEnable GL_CULL_FACE;
1846 glShadeModel $::FAST ? GL_FLAT : GL_SMOOTH;
1847
1848 glMatrixMode GL_PROJECTION;
1849 glLoadIdentity;
1850 glFrustum -1 * ($::WIDTH / $::HEIGHT), 1 * ($::WIDTH / $::HEIGHT), 1, -1, 1, 10000;
1851 #glOrtho 0, $::WIDTH, 0, $::HEIGHT, -10000, 10000;
1852 glMatrixMode GL_MODELVIEW;
1853 glLoadIdentity;
1854
1855 glPushMatrix;
1856 glTranslate 0, 0, -800;
1857 glScale 1, -1, 1;
1858 glRotate $NOW * 1000 % 36000 / 5, 0, 1, 0;
1859 glRotate $NOW * 1000 % 36000 / 6, 1, 0, 0;
1860 glRotate $NOW * 1000 % 36000 / 7, 0, 0, 1;
1861 glScale 50, 50, 50;
1862
1863 glInterleavedArrays GL_T2F_N3F_V3F, 0, $r->{v};
1864 while (my ($k, $v) = each %{$r->{g}}) {
1865 glBindTexture GL_TEXTURE_2D, ($demo{t}{$k}{name} or die);
1866 glDrawElements GL_TRIANGLES, $v->[0], GL_UNSIGNED_SHORT, $v->[1];
1867 }
1868
1869 glPopMatrix;
1870
1871 glShadeModel GL_FLAT;
1872 glDisable GL_DEPTH_TEST;
1873 glDisable GL_TEXTURE_2D;
1874 glDepthMask 0;
1875
1876 $WANT_REFRESH++;
1877};
1878
1879 CFClient::SDL_GL_SwapBuffers; 1889 CFClient::SDL_GL_SwapBuffers;
1880} 1890}
1881 1891
1882my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { 1892my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub {
1883 $NOW = time; 1893 $NOW = time;
1987 bgm_volume => 0.25, 1997 bgm_volume => 0.25,
1988 face_prefetch => 0, 1998 face_prefetch => 0,
1989 output_sync => 1, 1999 output_sync => 1,
1990 output_count => 1, 2000 output_count => 1,
1991 pickup => 0, 2001 pickup => 0,
2002 inv_sort => "mtime",
1992 default => "profile", # default profile 2003 default => "profile", # default profile
1993 ); 2004 );
1994 2005
1995 while (my ($k, $v) = each %DEF_CFG) { 2006 while (my ($k, $v) = each %DEF_CFG) {
1996 $CFG->{$k} = $v unless exists $CFG->{$k}; 2007 $CFG->{$k} = $v unless exists $CFG->{$k};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines