… | |
… | |
41 | |
41 | |
42 | glDisable GL_COLOR_MATERIAL; |
42 | glDisable GL_COLOR_MATERIAL; |
43 | glShadeModel GL_FLAT; |
43 | glShadeModel GL_FLAT; |
44 | glDisable GL_DITHER; |
44 | glDisable GL_DITHER; |
45 | glDisable GL_DEPTH_TEST; |
45 | glDisable GL_DEPTH_TEST; |
|
|
46 | glDepthMask 0; |
46 | glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST; |
47 | glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST; |
47 | |
48 | |
48 | CFClient::Texture::restore_state (); |
49 | CFClient::Texture::restore_state (); |
49 | } |
50 | } |
50 | |
51 | |
51 | sub gl_check { |
52 | sub gl_check { |
52 | return unless $GL_DEBUG; |
53 | return unless $GL_DEBUG; |
53 | |
54 | |
54 | if (my $error = glGetError) { |
55 | if (my $error = glGetError) { |
55 | Carp::cluck sprintf "opengl error %x while %s", $error, sprintf @_; |
56 | Carp::cluck sprintf "opengl error %x while %s", $error, &sprintf(@_); |
56 | } |
57 | } |
57 | } |
58 | } |
58 | |
59 | |
59 | sub find_rcfile($) { |
60 | sub find_rcfile($) { |
60 | my $path; |
61 | my $path; |
… | |
… | |
105 | -Home => "$Crossfire::VARDIR/pclient", |
106 | -Home => "$Crossfire::VARDIR/pclient", |
106 | -Cachesize => 1_000_000, |
107 | -Cachesize => 1_000_000, |
107 | -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt", |
108 | -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt", |
108 | # -ErrPrefix => "DATABASE", |
109 | # -ErrPrefix => "DATABASE", |
109 | -Verbose => 1, |
110 | -Verbose => 1, |
110 | -Flags => DB_CREATE | DB_RECOVER_FATAL | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, |
111 | -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, |
111 | or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error"; |
112 | or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error"; |
112 | |
113 | |
113 | sub db_table($) { |
114 | sub db_table($) { |
114 | my ($table) = @_; |
115 | my ($table) = @_; |
115 | |
116 | |
… | |
… | |
371 | $tw, $th, |
372 | $tw, $th, |
372 | 0; |
373 | 0; |
373 | CFClient::gl_check "copying to texture %dx%d if=%x", |
374 | CFClient::gl_check "copying to texture %dx%d if=%x", |
374 | $tw, $th, $self->{internalformat}; |
375 | $tw, $th, $self->{internalformat}; |
375 | } |
376 | } |
|
|
377 | |
|
|
378 | glBindTexture GL_TEXTURE_2D, 0; # just to be on the safe side |
376 | } |
379 | } |
377 | |
380 | |
378 | sub DESTROY { |
381 | sub DESTROY { |
379 | my ($self) = @_; |
382 | my ($self) = @_; |
380 | |
383 | |