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

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.84 by root, Wed Apr 12 15:46:14 2006 UTC vs.
Revision 1.85 by root, Wed Apr 12 17:11:02 2006 UTC

20use CFClient::UI; 20use CFClient::UI;
21 21
22our $VERSION = '0.1'; 22our $VERSION = '0.1';
23 23
24my $MAX_FPS = 60; 24my $MAX_FPS = 60;
25my $MIN_FPS = 5; # unused
25my $TICKS_PER_FRAME = int 1000 / $MAX_FPS - 1; # min ticks per frame 26my $TICKS_PER_FRAME = int 1000 / $MAX_FPS - 1; # min ticks per frame
26 27
27our $FACECACHE; 28our $FACECACHE;
28 29
29our $CFG; 30our $CFG;
30our $CONN; 31our $CONN;
31our $FAST; # fast, low-quality mode 32our $FAST; # fast, low-quality mode, possibly useful for software-rendering
32 33
33our @SDL_MODES; 34our @SDL_MODES;
34our $WIDTH; 35our $WIDTH;
35our $HEIGHT; 36our $HEIGHT;
36our $FULLSCREEN; 37our $FULLSCREEN;
64 my ($w, $h) = $DEBUG_STATUS->size_request; 65 my ($w, $h) = $DEBUG_STATUS->size_request;
65 $DEBUG_STATUS->size_allocate ($WIDTH - $w, 0, $w, $h); 66 $DEBUG_STATUS->size_allocate ($WIDTH - $w, 0, $w, $h);
66} 67}
67 68
68sub start_game { 69sub start_game {
70 status "logging in...";
71
69 my $mapsize = List::Util::min 64, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; 72 my $mapsize = List::Util::min 64, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
70 73
71 $CONN = new conn 74 $CONN = new conn
72 host => $CFG->{host}, 75 host => $CFG->{host},
73 port => $CFG->{port}, 76 port => $CFG->{port},
75 pass => $CFG->{password}, 78 pass => $CFG->{password},
76 mapw => $mapsize, 79 mapw => $mapsize,
77 maph => $mapsize, 80 maph => $mapsize,
78 ; 81 ;
79 82
83 status "login successful";
84
80 CFClient::lowdelay fileno $CONN->{fh}; 85 CFClient::lowdelay fileno $CONN->{fh};
81} 86}
82 87
83sub stop_game { 88sub stop_game {
84 undef $CONN; 89 undef $CONN;
102 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value; 107 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value;
103 $mode_label->set_text (sprintf "%dx%d", @{$SDL_MODES[$value]}); 108 $mode_label->set_text (sprintf "%dx%d", @{$SDL_MODES[$value]});
104 }); 109 });
105 $mode_slider->emit (changed => $mode_slider->{range}[0]); 110 $mode_slider->emit (changed => $mode_slider->{range}[0]);
106 111
112 $table->add (0, 1, new CFClient::UI::Label align => 1, text => "Fullscreen");
113 $table->add (1, 1, new CFClient::UI::CheckBox state => $CFG->{fullscreen}, connect_changed => sub {
114 my ($self, $value) = @_;
115 $CFG->{fullscreen} = $value;
116 });
117
107 $table->add (1, 1, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { 118 $table->add (1, 2, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub {
108 destroy_screen (); 119 destroy_screen ();
109 init_screen (); 120 init_screen ();
110 }); 121 });
111 122
112 $vbox->add (new CFClient::UI::Label align => 0, text => "Server"); 123 $vbox->add (new CFClient::UI::Label align => 0, text => "Server");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines