DXGL r924 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r923
|
r924
|
r925
>
Date:
21:53, 11 May 2019
Author:
admin
Status:
new
Tags:
Comment:
Fix scaled primary modes.
Modified paths:
/ddraw/glTexture.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glTexture.cpp
—
—
@@ -894,6 +894,7 @@
895
895
int texformat = -1;
896
896
int i;
897
897
int bytes;
898
+ int bytes2;
898
899
DWORD x, y;
899
900
GLenum error;
900
901
numtexformats = END_TEXFORMATS - START_TEXFORMATS;
—
—
@@ -1678,6 +1679,7 @@
1679
1680
case MAKEFOURCC('Y', '8', '0', '0'):
1680
1681
case MAKEFOURCC('G', 'R', 'E', 'Y'):
1681
1682
bytes = NextMultipleOf4(This->levels[i].ddsd.dwWidth);
1683
+ bytes2 = NextMultipleOf4(This->bigwidth);
1682
1684
case MAKEFOURCC('Y', '1', '6', ' '):
1683
1685
case MAKEFOURCC('U', 'Y', 'V', 'Y'):
1684
1686
case MAKEFOURCC('U', 'Y', 'N', 'V'):
—
—
@@ -1689,18 +1691,25 @@
1690
1692
case MAKEFOURCC('R', 'G', 'B', 'G'):
1691
1693
case MAKEFOURCC('G', 'R', 'G', 'B'):
1692
1694
bytes = NextMultipleOf4(2 * This->levels[i].ddsd.dwWidth);
1695
+ bytes2 = NextMultipleOf4(2 * This->bigwidth);
1693
1696
break;
1694
1697
case MAKEFOURCC('A', 'Y', 'U', 'V'):
1695
1698
default:
1696
1699
bytes = 4 * This->levels[i].ddsd.dwWidth;
1700
+ bytes2 = 4 * This->bigwidth;
1697
1701
break;
1698
1702
}
1699
1703
}
1700
- else bytes = NextMultipleOf4((This->levels[i].ddsd.ddpfPixelFormat.dwRGBBitCount *
1701
- This->levels[i].ddsd.dwWidth) / 8);
1704
+ else
1705
+ {
1706
+ bytes = NextMultipleOf4((This->levels[i].ddsd.ddpfPixelFormat.dwRGBBitCount *
1707
+ This->levels[i].ddsd.dwWidth) / 8);
1708
+ bytes2 = NextMultipleOf4((This->levels[i].ddsd.ddpfPixelFormat.dwRGBBitCount *
1709
+ This->bigwidth) / 8);
1710
+ }
1702
1711
This->levels[i].buffer = (char*)malloc(bytes * This->levels[i].ddsd.dwHeight);
1703
1712
if ((i == 0) && ((This->levels[i].ddsd.dwWidth != This->bigwidth) || (This->levels[i].ddsd.dwHeight != This->bigheight)))
1704
- This->levels[i].bigbuffer = (char *)malloc(bytes * This->bigheight);
1713
+ This->levels[i].bigbuffer = (char *)malloc(bytes2 * This->bigheight);
1705
1714
}
1706
1715
}
1707
1716
void glTexture__Destroy(glTexture *This)
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