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.96 by root, Mon Jul 17 01:41:54 2006 UTC vs.
Revision 1.100 by root, Sun Jul 23 16:11:12 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
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::Combobox
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 {
672 my $r = new CFClient::UI::ScrolledWindow (
673 expand => 1,
674 scroll_y => 1
675 );
649 my $vb = new CFClient::UI::VBox; 676 $r->add (my $vb = new CFClient::UI::VBox);
650 677
651 $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,
652 can_hover => 1, can_events => 1, 679 can_hover => 1, can_events => 1,
653 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.");
654 $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, 681 $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1,
668 $hb->add (my $tbl = new CFClient::UI::Table expand => 1); 695 $hb->add (my $tbl = new CFClient::UI::Table expand => 1);
669 696
670 my $color2 = [1, 1, 0]; 697 my $color2 = [1, 1, 0];
671 698
672 for ( 699 for (
673 [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"], 700 [0, 0, st_str => "Str", 30],
674 [0, 1, st_dex => "Dex", 30, "<b>Dexterity</b>, your physical agility. Determines chance of being hit and affects armor class and speed"], 701 [0, 1, st_dex => "Dex", 30],
675 [0, 2, st_con => "Con", 30, "<b>Constitution</b>, physical health and toughness. Determines how many healthpoints you can have"], 702 [0, 2, st_con => "Con", 30],
676 [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"], 703 [0, 3, st_int => "Int", 30],
677 [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"], 704 [0, 4, st_wis => "Wis", 30],
678 [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"], 705 [0, 5, st_pow => "Pow", 30],
679 [0, 6, st_cha => "Cha", 30, "<b>Charisma</b>, how well you are received by NPCs. Affects buying and selling prices in shops."], 706 [0, 6, st_cha => "Cha", 30],
680 707
681 [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."], 708 [2, 0, st_wc => "Wc", -120],
682 [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."], 709 [2, 1, st_ac => "Ac", -120],
683 [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."], 710 [2, 2, st_dam => "Dam", 120],
684 [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."], 711 [2, 3, st_arm => "Arm", 120],
685 [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."], 712 [2, 4, st_spd => "Spd", 10.54],
686 [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."], 713 [2, 5, st_wspd => "WSp", 10.54],
687 ) { 714 ) {
688 my ($col, $row, $id, $label, $template, $tooltip) = @$_; 715 my ($col, $row, $id, $label, $template) = @$_;
689 716
690 $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label 717 $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label
691 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, align => +1, template => $template, tooltip => $tooltip); 718 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0,
719 align => +1, template => $template, tooltip => $CFClient::STAT_TOOLTIP{$label});
692 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label 720 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label
693 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, align => -1, text => $label, tooltip => $tooltip); 721 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0,
722 align => -1, text => $label, tooltip => $CFClient::STAT_TOOLTIP{$label});
694 } 723 }
695 724
696 $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1); 725 $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1);
697 726
698 my $row = 0; 727 my $row = 0;
773 } 802 }
774 } 803 }
775 804
776 #update_stats_window ({}); 805 #update_stats_window ({});
777 806
778 $vb 807 $r
779} 808}
780 809
781sub skill_window { 810sub skill_window {
811 my $sw = new CFClient::UI::ScrolledWindow (expand => 1);
782 $STATWIDS->{skill_tbl} = new CFClient::UI::Table expand => 1, col_expand => [0, 0, 1, 0, 0, 1] 812 $sw->add ($STATWIDS->{skill_tbl} = new CFClient::UI::Table expand => 1, col_expand => [0, 0, 1, 0, 0, 1]);
813 $sw
783} 814}
784 815
785sub formsep($) { 816sub formsep($) {
786 scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1 817 scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1
787} 818}
1229sub inventory_widget { 1260sub inventory_widget {
1230 my $hb = new CFClient::UI::HBox homogeneous => 1; 1261 my $hb = new CFClient::UI::HBox homogeneous => 1;
1231 1262
1232 $hb->add (my $vb1 = new CFClient::UI::VBox); 1263 $hb->add (my $vb1 = new CFClient::UI::VBox);
1233 $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); 1264 $vb1->add (new CFClient::UI::Label align => 0, text => "Player");
1265
1266 $vb1->add (my $hb1 = new CFClient::UI::HBox);
1267
1268 use sort 'stable';
1269
1270 $hb1->add (new CFClient::UI::Combobox
1271 value => undef,
1272 options => [
1273 [undef, "Type/Name"],
1274 [
1275 sub { sort {
1276 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1277 or $a->{type} <=> $b->{type}
1278 } @_ },
1279 "Weight/Type",
1280 ],
1281 [sub { } => "#TODO#"],
1282 ],
1283 on_changed => sub {
1284 $INV->set_sort_order ($_[1]);
1285 },
1286 );
1287 $hb1->add (new CFClient::UI::Label text => "Weight: ", align => 1, expand => 1);
1288 #TODO# update to weigh/maxweight
1289 $hb1->add ($STATWIDS->{i_weight} = new CFClient::UI::Label align => -1);
1290
1291 $vb1->add (my $sw1 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1);
1234 $vb1->add ($INV = new CFClient::UI::Inventory); 1292 $sw1->add ($INV = new CFClient::UI::Inventory);
1235 1293
1236 $hb->add (my $vb2 = new CFClient::UI::VBox); 1294 $hb->add (my $vb2 = new CFClient::UI::VBox);
1237 1295
1238 $vb2->add ($INV_RIGHT_HB = new CFClient::UI::HBox); 1296 $vb2->add ($INV_RIGHT_HB = new CFClient::UI::HBox);
1239 1297
1298 $vb2->add (my $sw2 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1);
1240 $vb2->add ($INVR = new CFClient::UI::Inventory); 1299 $sw2->add ($INVR = new CFClient::UI::Inventory);
1241 1300
1242 # XXX: Call after $INVR = ... because set_opencont sets the items 1301 # XXX: Call after $INVR = ... because set_opencont sets the items
1243 CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); 1302 CFClient::Protocol::set_opencont ($::CONN, 0, "Floor");
1244 1303
1245 $hb 1304 $hb
1267 has_close_button => 1 1326 has_close_button => 1
1268 ; 1327 ;
1269 1328
1270 my $ntb = 1329 my $ntb =
1271 $PL_NOTEBOOK = 1330 $PL_NOTEBOOK =
1272 new CFClient::UI::Notebook 1331 new CFClient::UI::Notebook expand => 1, debug => 1;
1273 expand => 1,
1274 debug => 1,
1275 filter => (new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1),
1276 ;
1277 1332
1278 $ntb->add ( 1333 $ntb->add (
1279 "Statistics (F2)" => $STATS_PAGE = stats_window, 1334 "Statistics (F2)" => $STATS_PAGE = stats_window,
1280 "Shows statistics, where all your Stats and Resistances are shown." 1335 "Shows statistics, where all your Stats and Resistances are shown."
1281 ); 1336 );
1282 $ntb->add ( 1337 $ntb->add (
1283 "Skills (F3)" => $SKILL_PAGE = skill_window, 1338 "Skills (F3)" => $SKILL_PAGE = skill_window,
1284 "Shows all your Skills." 1339 "Shows all your Skills."
1285 ); 1340 );
1341
1342 my $spellsw = new CFClient::UI::ScrolledWindow (expand => 1, scroll_y => 1);
1343 $spellsw->add ($SPELL_PAGE = new CFClient::UI::SpellList);
1286 $ntb->add ( 1344 $ntb->add (
1287 "Spellbook (F4)" => $SPELL_PAGE = new CFClient::UI::SpellList, 1345 "Spellbook (F4)" => $spellsw,
1288 "Displays all spells you have and lets you edit keyboard shortcuts for them." 1346 "Displays all spells you have and lets you edit keyboard shortcuts for them."
1289 ); 1347 );
1290 $ntb->add ( 1348 $ntb->add (
1291 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, 1349 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget,
1292 "Toggles the inventory window, where you can manage your loot (or treasures :). " 1350 "Toggles the inventory window, where you can manage your loot (or treasures :). "
1429 1487
1430 my $parser = HTML::Parser->new ( 1488 my $parser = HTML::Parser->new (
1431 text_h => [sub { 1489 text_h => [sub {
1432 my ($text) = @_; 1490 my ($text) = @_;
1433 $text =~ s/\s+/ /g; 1491 $text =~ s/\s+/ /g;
1434 $s[-1]{text} .= CFClient::UI::Label::escape $text; 1492 $s[-1]{text} .= CFClient::asxml $text;
1435 }, "dtext"], 1493 }, "dtext"],
1436 start_h => [sub { 1494 start_h => [sub {
1437 my ($tag, $attr) = @_; 1495 my ($tag, $attr) = @_;
1438 if ($passthrough{$tag}) { 1496 if ($passthrough{$tag}) {
1439 $s[-1]{text} .= "<$tag>"; 1497 $s[-1]{text} .= "<$tag>";
1526 }; 1584 };
1527 warn "$@" if $@; 1585 warn "$@" if $@;
1528 return; 1586 return;
1529 } 1587 }
1530 1588
1531 my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", 1589 my $pom = CFClient::Pod::load CFClient::find_rcfile "pod/$pod.pod",
1532 doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; 1590 doc_viewer => 1, sub { CFClient::Pod::as_paragraphs $_[0] };
1591
1592 #use Data::Dumper; warn Dumper $pom;#d#
1533 1593
1534 $viewer->clear; 1594 $viewer->clear;
1535 1595
1536# $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n", 1596# $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n",
1537# (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1), 1597# (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1),
1538# (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"), 1598# (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"),
1539# ]);#d# 1599# ]);#d#
1540 1600
1541 $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) 1601 $viewer->add_paragraph ([1, 1, 1, 1], [$_->{text}, @{ $_->{obj} || [] }], $_->{indent})
1542 for @$pom; 1602 for @$pom;
1543 1603
1544 $viewer->set_offset (0); 1604 $viewer->set_offset (0);
1545 1605
1546 0 1606 0
1812 1872
1813 $WANT_REFRESH = 0; 1873 $WANT_REFRESH = 0;
1814 $CAN_REFRESH = 0; 1874 $CAN_REFRESH = 0;
1815 $LAST_REFRESH = $NOW; 1875 $LAST_REFRESH = $NOW;
1816 1876
18170 && do {
1818 # some weird model-drawing code, just a joke right now
1819 use CFClient::OpenGL;
1820
1821 $demo{t}{eye_auv} ||= new_from_file CFClient::Texture "eye2.png" or die;
1822 $demo{t}{body_auv} ||= new_from_file CFClient::Texture "body_auv3.png" or die;
1823 $demo{r} ||= do {
1824 my $mod = Compress::LZF::sthaw do { local $/; open my $fh, "<:raw:perlio", "dread.lz3"; <$fh> };
1825 $mod->{v} = pack "f*", @{$mod->{v}};
1826 $_ = [scalar @$_, pack "S!*", @$_]
1827 for values %{$mod->{g}};
1828 $mod
1829 };
1830
1831 my $r = $demo{r} or die;
1832
1833 glDepthMask 1;
1834 glClear GL_DEPTH_BUFFER_BIT;
1835 glEnable GL_TEXTURE_2D;
1836 glEnable GL_DEPTH_TEST;
1837 glEnable GL_CULL_FACE;
1838 glShadeModel $::FAST ? GL_FLAT : GL_SMOOTH;
1839
1840 glMatrixMode GL_PROJECTION;
1841 glLoadIdentity;
1842 glFrustum -1 * ($::WIDTH / $::HEIGHT), 1 * ($::WIDTH / $::HEIGHT), 1, -1, 1, 10000;
1843 #glOrtho 0, $::WIDTH, 0, $::HEIGHT, -10000, 10000;
1844 glMatrixMode GL_MODELVIEW;
1845 glLoadIdentity;
1846
1847 glPushMatrix;
1848 glTranslate 0, 0, -800;
1849 glScale 1, -1, 1;
1850 glRotate $NOW * 1000 % 36000 / 5, 0, 1, 0;
1851 glRotate $NOW * 1000 % 36000 / 6, 1, 0, 0;
1852 glRotate $NOW * 1000 % 36000 / 7, 0, 0, 1;
1853 glScale 50, 50, 50;
1854
1855 glInterleavedArrays GL_T2F_N3F_V3F, 0, $r->{v};
1856 while (my ($k, $v) = each %{$r->{g}}) {
1857 glBindTexture GL_TEXTURE_2D, ($demo{t}{$k}{name} or die);
1858 glDrawElements GL_TRIANGLES, $v->[0], GL_UNSIGNED_SHORT, $v->[1];
1859 }
1860
1861 glPopMatrix;
1862
1863 glShadeModel GL_FLAT;
1864 glDisable GL_DEPTH_TEST;
1865 glDisable GL_TEXTURE_2D;
1866 glDepthMask 0;
1867
1868 $WANT_REFRESH++;
1869};
1870
1871 CFClient::SDL_GL_SwapBuffers; 1877 CFClient::SDL_GL_SwapBuffers;
1872} 1878}
1873 1879
1874my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub { 1880my $refresh_watcher = Event->timer (after => 0, hard => 0, interval => 1 / $MAX_FPS, cb => sub {
1875 $NOW = time; 1881 $NOW = time;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines