mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
properly uninvert framebuffer-to-texture
This commit is contained in:
parent
5b7e57a9da
commit
990e0883de
@ -1392,11 +1392,11 @@ framebuffer_copy_to_texture(Texture *tex, int z, const DisplayRegion *dr,
|
||||
GLTexture *gltex = gtc->_gltex;
|
||||
setup_gltex(gltex, tex->get_x_size(), tex->get_y_size());
|
||||
|
||||
PIXEL *ip = gltex->pixmap;
|
||||
PIXEL *ip = gltex->pixmap + gltex->xsize * gltex->ysize;
|
||||
PIXEL *fo = _c->zb->pbuf + xo + yo * _c->zb->linesize / PSZB;
|
||||
for (int y = 0; y < gltex->ysize; ++y) {
|
||||
ip -= gltex->xsize;
|
||||
memcpy(ip, fo, gltex->xsize * PSZB);
|
||||
ip += gltex->xsize;
|
||||
fo += _c->zb->linesize / PSZB;
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ void TinyXGraphicsWindow::
|
||||
close_window() {
|
||||
if (_gsg != (GraphicsStateGuardian *)NULL) {
|
||||
TinyGraphicsStateGuardian *tinygsg;
|
||||
DCAST_INTO_R(tinygsg, _gsg, false);
|
||||
DCAST_INTO_V(tinygsg, _gsg);
|
||||
tinygsg->_current_frame_buffer = NULL;
|
||||
_gsg.clear();
|
||||
_active = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user