DXGL r98 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r97
|
r98
|
r99
>
Date:
19:56, 5 February 2012
Author:
admin
Status:
new
Tags:
Comment:
Fix release compilation.
Fix clipper deletion.
Modified paths:
/ddraw/common.h
(modified) (
history
)
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/ddraw/glDirectDraw.h
(modified) (
history
)
/ddraw/glDirectDrawClipper.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/common.h
—
—
@@ -75,6 +75,9 @@
76
76
DEBUGBREAK\
77
77
return error;\
78
78
}
79
+#else
80
+#define ERR(error) return error;
81
+#endif
79
82
80
83
static inline int NextMultipleOf8(int number){return ((number+7) & (~7));}
81
84
static inline int NextMultipleOf4(int number){return ((number+3) & (~3));}
—
—
@@ -85,8 +88,5 @@
86
89
#define NextMultipleOfWord NextMultipleOf4
87
90
#endif
88
91
89
-#else
90
-#define ERR(error) return error;
91
-#endif
92
92
#include "../cfgmgr/cfgmgr.h"
93
93
#endif //_COMMON_H
Index: ddraw/glDirectDraw.cpp
—
—
@@ -578,7 +578,10 @@
579
579
if(clippers)
580
580
{
581
581
for(int i = 0; i < clippercount; i++)
582
- clippers[i]->Release();
582
+ {
583
+ if(clippers[i]) clippers[i]->Release();
584
+ clippers[i] = NULL;
585
+ }
583
586
free(clippers);
584
587
}
585
588
if(surfaces)
—
—
@@ -790,8 +793,8 @@
791
794
ZeroMemory(&ddCaps,sizeof(DDCAPS_DX7));
792
795
if(lpDDDriverCaps) ddCaps.dwSize = lpDDDriverCaps->dwSize;
793
796
else if(lpDDHELCaps) ddCaps.dwSize = lpDDHELCaps->dwSize;
797
+ else return DDERR_INVALIDPARAMS;
794
798
if(ddCaps.dwSize > sizeof(DDCAPS_DX7)) ddCaps.dwSize = sizeof(DDCAPS_DX7);
795
- else return DDERR_INVALIDPARAMS;
796
799
ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH |
797
800
DDCAPS_COLORKEY | DDCAPS_GDI | DDCAPS_PALETTE | DDCAPS_CANBLTSYSMEM;
798
801
ddCaps.dwCaps2 = DDCAPS2_CANRENDERWINDOWED | DDCAPS2_WIDESURFACES | DDCAPS2_NOPAGELOCKREQUIRED |
—
—
@@ -1406,6 +1409,12 @@
1407
1410
if(surface == primary) primary = NULL;
1408
1411
}
1409
1412
1413
+void glDirectDraw7::DeleteClipper(glDirectDrawClipper *clipper)
1414
+{
1415
+ for(int i = 0; i < clippercount; i++)
1416
+ if(clippers[i] == clipper) clippers[i] = NULL;
1417
+}
1418
+
1410
1419
// DDRAW1 wrapper
1411
1420
glDirectDraw1::glDirectDraw1(glDirectDraw7 *gl_DD7)
1412
1421
{
Index: ddraw/glDirectDraw.h
—
—
@@ -80,6 +80,7 @@
81
81
DWORD primaryx,primaryy,primaryrefresh,primarybpp;
82
82
bool GetFullscreen(){return fullscreen;};
83
83
void DeleteSurface(glDirectDrawSurface7 *surface);
84
+ void DeleteClipper(glDirectDrawClipper *clipper);
84
85
glDirectDrawSurface7 *primary;
85
86
bool primarylost;
86
87
glRenderer *renderer;
Index: ddraw/glDirectDrawClipper.cpp
—
—
@@ -16,6 +16,7 @@
17
17
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
19
19
#include "common.h"
20
+#include "glDirectDraw.h"
20
21
#include "glDirectDrawClipper.h"
21
22
22
23
glDirectDrawClipper::glDirectDrawClipper()
—
—
@@ -32,6 +33,7 @@
33
34
}
34
35
glDirectDrawClipper::~glDirectDrawClipper()
35
36
{
37
+ if(glDD7) glDD7->DeleteClipper(this);
36
38
}
37
39
HRESULT WINAPI glDirectDrawClipper::QueryInterface(REFIID riid, LPVOID* obp)
38
40
{
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