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

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.18 by root, Sat Apr 8 13:36:26 2006 UTC vs.
Revision 1.19 by root, Sat Apr 8 14:04:14 2006 UTC

378 for my $num (grep $_, $cell->[0], $cell->[1], $cell->[2]) { 378 for my $num (grep $_, $cell->[0], $cell->[1], $cell->[2]) {
379 my $tex = $::CONN->{face}[$num]{texture} || next; 379 my $tex = $::CONN->{face}[$num]{texture} || next;
380 380
381 glBindTexture GL_TEXTURE_2D, $tex->{name}; 381 glBindTexture GL_TEXTURE_2D, $tex->{name};
382 382
383 my $w = $tex->{width};
384 my $h = $tex->{height};
385
386 my $px = ($x + 1) * 32 - $w;
387 my $py = ($y + 1) * 32 - $h;
388
383 glBegin GL_QUADS; 389 glBegin GL_QUADS;
384 glTexCoord 0, 0; glVertex $x * 32 , $y * 32; 390 glTexCoord 0, 0; glVertex $px , $py;
385 glTexCoord 0, 1; glVertex $x * 32 , $y * 32 + 32; 391 glTexCoord 0, 1; glVertex $px , $py + $h;
386 glTexCoord 1, 1; glVertex $x * 32 + 32, $y * 32 + 32; 392 glTexCoord 1, 1; glVertex $px + $w, $py + $h;
387 glTexCoord 1, 0; glVertex $x * 32 + 32, $y * 32; 393 glTexCoord 1, 0; glVertex $px + $w, $py;
388 glEnd; 394 glEnd;
389 } 395 }
390 } 396 }
391 } 397 }
392 398

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines