ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/MapWidget.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/MapWidget.pm (file contents):
Revision 1.5 by root, Wed Apr 19 23:43:07 2006 UTC vs.
Revision 1.6 by root, Thu Apr 20 08:11:57 2006 UTC

137 } 137 }
138 138
139 # HACK BEGIN 139 # HACK BEGIN
140 { 140 {
141 glTranslate -($sx0 - 32), -($sy0 - 32), 0;#remove 141 glTranslate -($sx0 - 32), -($sy0 - 32), 0;#remove
142
143 glTranslate 0, 30;
142 my ($w, $h) = (250, 250); 144 my ($w, $h) = (250, 250);
145
146 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy);
143 147
144 glEnable GL_BLEND; 148 glEnable GL_BLEND;
145 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 149 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
146 glEnable GL_TEXTURE_2D; 150 glEnable GL_TEXTURE_2D;
147 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 151 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
148 152
149 $self->{mapmap_texture} = 153 $self->{mapmap_texture} =
150 new CFClient::Texture 154 new CFClient::Texture
151 w => $w, 155 w => $w,
152 h => $h, 156 h => $h,
153 data => $::MAP->mapmap ($w, $h), 157 data => $::MAP->mapmap (- $w * 0.5, - $h * 0.5, $w, $h),
154 type => $CFClient::GL_VERSION >= 1.2 ? GL_UNSIGNED_INT_8_8_8_8_REV : GL_UNSIGNED_BYTE; 158 type => $CFClient::GL_VERSION >= 1.2 ? GL_UNSIGNED_INT_8_8_8_8_REV : GL_UNSIGNED_BYTE;
155 159
156 $self->{mapmap_texture}->draw_quad (100, 100); 160 $self->{mapmap_texture}->draw_quad (0, 0);
157 161
158 glDisable GL_TEXTURE_2D; 162 glDisable GL_TEXTURE_2D;
163
164 glTranslate 0.375, 0.375;
165
166 glColor 1, 1, 0, 1;
167 glBegin GL_LINE_LOOP;
168 glVertex $w * 0.5 - $sx , $h * 0.5 - $sy ;
169 glVertex $w * 0.5 - $sx , $h * 0.5 - $sy + $sh;
170 glVertex $w * 0.5 - $sx + $sw, $h * 0.5 - $sy + $sh;
171 glVertex $w * 0.5 - $sx + $sw, $h * 0.5 - $sy ;
172 glEnd;
173
159 glDisable GL_BLEND; 174 glDisable GL_BLEND;
160 } 175 }
161 # HACK END 176 # HACK END
162 } 177 }
163 178

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines