|
|
Search
|
|||||||
| Home | Register | Downloads | FAQ | Members List | Calendar | Arcade | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2008
Location: USA
Posts: 18
|
Those pesky bit fields
AKA: I fixed the Texture Coordinate 7 bug you didn't know you had. Code:
Index: Plugin_VideoDX9/Src/VertexLoader.cpp
===================================================================
--- Plugin_VideoDX9/Src/VertexLoader.cpp (revision 1109)
+++ Plugin_VideoDX9/Src/VertexLoader.cpp (working copy)
@@ -198,9 +198,12 @@
SetupColor(i,col[i], m_VtxAttr.color[i].Comp, m_VtxAttr.color[i].Elements);
// TextureCoord
+ // Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
+ // If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
+ // 01 become 00, and 10/11 become 01
int tc[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
- m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
+ m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (m_VtxDesc.Hex >> 31) & 3
};
for (int i = 0; i < 8; i++)
SetupTexCoord(i, tc[i],
Index: Plugin_VideoOGL/Src/VertexLoader.cpp
===================================================================
--- Plugin_VideoOGL/Src/VertexLoader.cpp (revision 1109)
+++ Plugin_VideoOGL/Src/VertexLoader.cpp (working copy)
@@ -187,9 +187,12 @@
}
// TextureCoord
+ // Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
+ // If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
+ // 01 become 00, and 10/11 become 01
int tc[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
- m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
+ m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (m_VtxDesc.Hex >> 31) & 3
};
for (int i = 0; i < 8; i++) {
@@ -227,9 +230,12 @@
// Colors
const int col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
// TextureCoord
+ // Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
+ // If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
+ // 01 become 00, and 10/11 become 01
const int tc[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
- m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
+ m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (m_VtxDesc.Hex >> 31) & 3
};
// Reset pipeline
Last edited by Maratanos; November 11th, 2008 at 02:58.. Reason: added OGL fix |
|
|
|
| Advertisement | [Remove Advertisement] | ||
|
|
|
|
#2 (permalink) |
|
Rockman fan
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2002
Location: Earth!
Posts: 5,098
|
Please let the developer know about it? Good job. Anyway, what about picto box ? After you take a picture with the Picto box the game freezes, you know.
__________________
I have: Wii: Starfall, Neogamma R8 beta 11, and currently on 3.2u PSP PHAT: 1001k [TA-081] Custom Firmware 5.50 GEN-D2(FULL) CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black OS: Windows 7 Ultimate 64bit CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB) Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand Sound Card: 3D Premium Surround Sound Onboard |
|
|
|
|
|
#4 (permalink) | |
|
Rockman fan
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2002
Location: Earth!
Posts: 5,098
|
Awesome. What about this: Quote:
__________________
I have: Wii: Starfall, Neogamma R8 beta 11, and currently on 3.2u PSP PHAT: 1001k [TA-081] Custom Firmware 5.50 GEN-D2(FULL) CASE: EagleTech Sidewinder Gaming Tower Case w/420W Power Supply Black OS: Windows 7 Ultimate 64bit CPU: Intel core 2 Duo Processor E8400 (2x 3.0GHz/6MB L2 Cache/1333FSB) Processor Cooling: Thermaltake V1 CPU Cooling Fan System Kit Silent & Overclocking Proof Graphics Card: NVIDIA GeForce 8800GT 512MB w/DVI + TV Out Video Memory: 2048GB [1024GB X2] DDR2-800 PC6400 Memory Module Corsair-Value or Major Brand Sound Card: 3D Premium Surround Sound Onboard |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|