DXGL r882 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r881
|
r882
|
r883
>
Date:
23:59, 8 December 2018
Author:
admin
Status:
new
Tags:
Comment:
Fix RGBA8332 texture upload and download.
Modified paths:
/ddraw/glTexture.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glTexture.cpp
—
—
@@ -453,8 +453,7 @@
454
454
}
455
455
else return; // Non-primary surfaces should not have scaling
456
456
inpitch = NextMultipleOf4(This->levels[level].ddsd.dwWidth * This->internalsize);
457
- outpitch = NextMultipleOf4(This->levels[level].ddsd.dwHeight
458
- * (NextMultipleOf8(This->levels[level].ddsd.ddpfPixelFormat.dwRGBBitCount)/8));
457
+ outpitch = This->levels[level].ddsd.lPitch;
459
458
if (This->pboPack->size < inpitch * This->levels[level].ddsd.dwHeight)
460
459
BufferObject_SetData(This->pboPack, GL_PIXEL_PACK_BUFFER,
461
460
inpitch * This->levels[level].ddsd.dwHeight, NULL, GL_DYNAMIC_READ);
—
—
@@ -474,7 +473,7 @@
475
474
{
476
475
for (i = 0; i < This->levels[level].ddsd.dwHeight; i++)
477
476
colorconvproc[This->convfunctiondownload](This->levels[level].ddsd.dwWidth,
478
- This->levels[level].buffer + (i*outpitch), readbuffer + (i + inpitch));
477
+ This->levels[level].buffer + (i*outpitch), readbuffer + (i * inpitch));
479
478
}
480
479
BufferObject_Unmap(This->pboPack, GL_PIXEL_PACK_BUFFER);
481
480
}
—
—
@@ -557,8 +556,7 @@
558
557
if (!This->pboUnpack)
559
558
BufferObject_Create(&This->pboUnpack, This->renderer->ext, This->renderer->util);
560
559
outpitch = NextMultipleOf4(This->levels[level].ddsd.dwWidth * This->internalsize);
561
- inpitch = NextMultipleOf4(This->levels[level].ddsd.dwHeight
562
- * (NextMultipleOf8(This->levels[level].ddsd.ddpfPixelFormat.dwRGBBitCount) / 8));
560
+ inpitch = This->levels[level].ddsd.lPitch;
563
561
if (This->pboUnpack->size < outpitch * This->levels[level].ddsd.dwHeight)
564
562
BufferObject_SetData(This->pboUnpack, GL_PIXEL_UNPACK_BUFFER,
565
563
outpitch * This->levels[level].ddsd.dwHeight, NULL, GL_DYNAMIC_DRAW);
—
—
@@ -565,7 +563,7 @@
566
564
writebuffer = (char*)BufferObject_Map(This->pboUnpack, GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
567
565
for (i = 0; i < This->levels[level].ddsd.dwHeight; i++)
568
566
colorconvproc[This->convfunctionupload](This->levels[level].ddsd.dwWidth,
569
- writebuffer + (i*outpitch), This->levels[level].buffer + (i + inpitch));
567
+ writebuffer + (i*outpitch), This->levels[level].buffer + (i * inpitch));
570
568
BufferObject_Unmap(This->pboUnpack, GL_PIXEL_UNPACK_BUFFER);
571
569
BufferObject_Bind(This->pboUnpack, GL_PIXEL_UNPACK_BUFFER);
572
570
if (This->renderer->ext->GLEXT_EXT_direct_state_access)
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version