DXGL r427 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r426
|
r427
|
r428
>
Date:
18:55, 13 April 2014
Author:
admin
Status:
new
Tags:
Comment:
Make global variables in glDirect3D.cpp constant.
Modified paths:
/ddraw/glDirect3D.cpp
(modified) (
history
)
/ddraw/glDirect3D.h
(modified) (
history
)
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/glDirect3DDevice.h
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3D.cpp
—
—
@@ -29,7 +29,7 @@
30
30
#include "glDirect3DMaterial.h"
31
31
#include "glDirect3DLight.h"
32
32
33
-D3DDEVICEDESC7 d3ddesc =
33
+const D3DDEVICEDESC7 d3ddesc =
34
34
{
35
35
D3DDEVCAPS_CANBLTSYSTONONLOCAL | D3DDEVCAPS_CANRENDERAFTERFLIP | D3DDEVCAPS_DRAWPRIMTLVERTEX |
36
36
D3DDEVCAPS_FLOATTLVERTEX | D3DDEVCAPS_TEXTURENONLOCALVIDMEM | D3DDEVCAPS_TEXTURESYSTEMMEMORY |
—
—
@@ -127,7 +127,7 @@
128
128
0,0,0,0 //dwReserved1 through dwReserved4
129
129
};
130
130
131
-D3DDEVICEDESC d3ddesc3 =
131
+const D3DDEVICEDESC d3ddesc3 =
132
132
{
133
133
sizeof(D3DDEVICEDESC), // dwSize
134
134
D3DDD_BCLIPPING|D3DDD_COLORMODEL|D3DDD_DEVCAPS|D3DDD_DEVICERENDERBITDEPTH|
—
—
@@ -180,7 +180,7 @@
181
181
char *name;
182
182
char *devname;
183
183
};
184
-D3DDevice devices[3] =
184
+const D3DDevice devices[3] =
185
185
{
186
186
{
187
187
"Simulated RGB Rasterizer",
Index: ddraw/glDirect3D.h
—
—
@@ -19,8 +19,8 @@
20
20
#ifndef __GLDIRECT3D_H
21
21
#define __GLDIRECT3D_H
22
22
23
-extern D3DDEVICEDESC7 d3ddesc;
24
-extern D3DDEVICEDESC d3ddesc3;
23
+extern const D3DDEVICEDESC7 d3ddesc;
24
+extern const D3DDEVICEDESC d3ddesc3;
25
25
class glDirectDraw7;
26
26
27
27
class glDirect3D3;
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -74,7 +74,7 @@
75
75
DWORD dwMinStippleHeight,dwMaxStippleHeight;
76
76
} D3DDEVICEDESC2,*LPD3DDEVICEDESC2;
77
77
78
-extern D3DDEVICEDESC7 d3ddesc;
78
+extern const D3DDEVICEDESC7 d3ddesc;
79
79
80
80
const DWORD renderstate_default[153] = {0, // 0
81
81
NULL, //texturehandle
—
—
@@ -276,6 +276,8 @@
277
277
glDirect3DDevice7::glDirect3DDevice7(REFCLSID rclsid, glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7)
278
278
{
279
279
TRACE_ENTER(4,14,this,24,&rclsid,14,glD3D7,14,glDDS7);
280
+ memcpy(&d3ddesc, &::d3ddesc, sizeof(D3DDEVICEDESC));
281
+ memcpy(&d3ddesc3, &::d3ddesc3, sizeof(D3DDEVICEDESC));
280
282
int zbuffer = 0;
281
283
glD3DDev3 = NULL;
282
284
glD3DDev2 = NULL;
Index: ddraw/glDirect3DDevice.h
—
—
@@ -230,6 +230,8 @@
231
231
D3DMATRIXHANDLE mhWorld;
232
232
D3DMATRIXHANDLE mhView;
233
233
D3DMATRIXHANDLE mhProjection;
234
+ D3DDEVICEDESC7 d3ddesc;
235
+ D3DDEVICEDESC d3ddesc3;
234
236
};
235
237
236
238
#endif //__GLDIRECT3DDEVICE_H
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