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.36 by elmex, Sat Apr 8 22:23:57 2006 UTC vs.
Revision 1.39 by root, Sun Apr 9 00:09:50 2006 UTC

30 30
31our $WIDTH; 31our $WIDTH;
32our $HEIGHT; 32our $HEIGHT;
33our $FULLSCREEN; 33our $FULLSCREEN;
34 34
35our $UIFONT; 35our $FONTSIZE;
36 36
37our $SDL_TIMER; 37our $SDL_TIMER;
38our $SDL_APP; 38our $SDL_APP;
39our $SDL_EV = new SDL::Event; 39our $SDL_EV = new SDL::Event;
40our %SDL_CB; 40our %SDL_CB;
62 %GL_EXT = map +($_ => 1), split /\s+/, Crossfire::Client::gl_extensions; 62 %GL_EXT = map +($_ => 1), split /\s+/, Crossfire::Client::gl_extensions;
63 63
64 $GL_EXT{GL_ARB_texture_non_power_of_two} 64 $GL_EXT{GL_ARB_texture_non_power_of_two}
65 or warn "WARNING: non-power-of-two opengl extension required"; 65 or warn "WARNING: non-power-of-two opengl extension required";
66 66
67 $UIFONT = SDL::TTFOpenFont Crossfire::Client::find_rcfile "uifont.ttf", $HEIGHT / 40 67 $FONTSIZE = int $HEIGHT / 40;
68 or die "TTFOpenFont: $!";
69 68
70 $ALT_ENTER_MESSAGE = new Crossfire::Client::Widget::Label 0, $HEIGHT - $HEIGHT / 40, 10, $UIFONT, "Alt-Enter toggles fullscreen mode"; 69 $ALT_ENTER_MESSAGE = new Crossfire::Client::Widget::Label 0, $FONTSIZE, $HEIGHT - $FONTSIZE, $FONTSIZE, "Alt-Enter toggles fullscreen mode";
71 $ALT_ENTER_MESSAGE->move (0, $HEIGHT - ($ALT_ENTER_MESSAGE->size_request)[1]); 70 $ALT_ENTER_MESSAGE->move (0, $HEIGHT - ($ALT_ENTER_MESSAGE->size_request)[1]);
72 $ALT_ENTER_MESSAGE->activate; 71 $ALT_ENTER_MESSAGE->activate;
73 72
74 # Test code #d# 73 # Test code #d#
74 {
75 my $frm = new Crossfire::Client::Widget::Frame; 75 my $frm = new Crossfire::Client::Widget::Frame;
76 $tw = new Crossfire::Client::Widget::Window; 76 $tw = new Crossfire::Client::Widget::Window;
77 $frm->add (new Crossfire::Client::Widget::Label 0, 0, 10, $UIFONT, "Foo in the garden!"); 77 $frm->add (new Crossfire::Client::Widget::Label 0, 0, 10, $FONTSIZE, "Foo in the garden!");
78 $tw->add ($frm); 78 $tw->add ($frm);
79 79
80 $tw->move (0, $HEIGHT - 120); 80 $tw->move (0, $HEIGHT - 120);
81 $tw->activate; 81 $tw->activate;
82 # Test code end #d# 82 }
83 83
84 glClearColor 0, 0, 0, 0; 84 glClearColor 0, 0, 0, 0;
85 85
86 glEnable GL_TEXTURE_2D; 86 glEnable GL_TEXTURE_2D;
87 glEnable GL_COLOR_MATERIAL; 87 glEnable GL_COLOR_MATERIAL;
108 108
109 $CONN = new conn 109 $CONN = new conn
110 host => $CFG->{host}, 110 host => $CFG->{host},
111 port => $CFG->{port}, 111 port => $CFG->{port},
112 user => $CFG->{user}, 112 user => $CFG->{user},
113 pass => $CFG->{password}; 113 pass => $CFG->{password},
114 mapw => 50,
115 maph => 37,
116 ;
114} 117}
115 118
116sub stop_game { 119sub stop_game {
117 remove Glib::Source $SDL_TIMER; 120 remove Glib::Source $SDL_TIMER;
118 121
314 317
315 318
316############################################################################# 319#############################################################################
317 320
318SDL::Init SDL_INIT_EVERYTHING; 321SDL::Init SDL_INIT_EVERYTHING;
319SDL::TTFInit;
320 322
321my $mapwidget = Crossfire::Client::Widget::MapWidget->new; 323my $mapwidget = Crossfire::Client::Widget::MapWidget->new;
322 324
323$mapwidget->activate; 325$mapwidget->activate;
324$mapwidget->focus_in; 326$mapwidget->focus_in;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines