DXGL r252 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r251
|
r252
|
r253
>
Date:
15:15, 2 September 2012
Author:
admin
Status:
new
Tags:
Comment:
Tweak D3DTLVERTEX vertex shader, still somewhat broken.
Add locking of rects within DDraw surfaces.
Modified paths:
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -841,6 +841,13 @@
842
842
surfacetype = 0;
843
843
goto retry;
844
844
}
845
+ if(lpDestRect)
846
+ {
847
+ ULONG_PTR ptr = (ULONG_PTR)ddsd.lpSurface;
848
+ ptr += (lpDestRect->left * (ddsd.ddpfPixelFormat.dwRGBBitCount/8));
849
+ ptr += (lpDestRect->top * (ddsd.lPitch));
850
+ ddsd.lpSurface = (LPVOID)ptr;
851
+ }
845
852
memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
846
853
locked++;
847
854
return DD_OK;
Index: ddraw/shadergen.cpp
—
—
@@ -271,7 +271,7 @@
272
272
gl_Position = vec4(pos.x,-pos.y,pos.z,pos.w);\n";
273
273
static const char op_normalize[] = "N = normalize(gl_NormalMatrix*nxyz);\n";
274
274
static const char op_normalpassthru[] = "N = gl_NormalMatrix*nxyz;\n";
275
-static const char op_passthru[] = "gl_Position = vec4((xyz.x/(width/2.0))-1.0,(xyz.y/(height/2.0))-1.0,xyz.z,1.0/rhw);\n";
275
+static const char op_passthru[] = "gl_Position = vec4(((xyz.x/rhw)/(width/2.0))-1.0,((xyz.y/rhw)/(height/2.0))-1.0,(xyz.z/rhw),1.0/rhw);\n";
276
276
static const char op_resetcolor[] = "diffuse = specular = vec4(0.0);\n\
277
277
ambient = ambientcolor / 255.0;\n";
278
278
static const char op_dirlight[] = "DirLight(lightX);\n";
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