DXGL r73 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r72
|
r73
|
r74
>
Date:
17:03, 8 January 2012
Author:
admin
Status:
new
Tags:
Comment:
Add SetLight
Add LightEnable with bEnable FALSE
Modified paths:
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/glDirect3DLight.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -393,6 +393,18 @@
394
394
if(!foundlight) return D3DERR_LIGHT_SET_FAILED;
395
395
lights[dwLightIndex]->SetGLLight(i);
396
396
}
397
+ else
398
+ {
399
+ for(i = 0; i < 8; i++)
400
+ {
401
+ if(gllights[i] == dwLightIndex)
402
+ {
403
+ lights[dwLightIndex]->SetGLLight(-1);
404
+ gllights[i] = -1;
405
+ }
406
+ }
407
+ return D3D_OK;
408
+ }
397
409
return D3D_OK;
398
410
}
399
411
HRESULT WINAPI glDirect3DDevice7::Load(LPDIRECTDRAWSURFACE7 lpDestTex, LPPOINT lpDestPoint, LPDIRECTDRAWSURFACE7 lpSrcTex,
—
—
@@ -423,8 +435,14 @@
424
436
}
425
437
HRESULT WINAPI glDirect3DDevice7::SetLight(DWORD dwLightIndex, LPD3DLIGHT7 lpLight)
426
438
{
427
- FIXME("glDirect3DDevice7::SetLight: stub");
428
- ERR(DDERR_GENERIC);
439
+ bool foundlight = false;
440
+ if(dwLightIndex >= lightsmax)
441
+ {
442
+ if(!ExpandLightBuffer(&lights,&lightsmax,dwLightIndex-1)) return DDERR_OUTOFMEMORY;
443
+ }
444
+ if(!lights[dwLightIndex]) lights[dwLightIndex] = new glDirect3DLight;
445
+ lights[dwLightIndex]->SetLight7(lpLight);
446
+ return D3D_OK;
429
447
}
430
448
HRESULT WINAPI glDirect3DDevice7::SetMaterial(LPD3DMATERIAL7 lpMaterial)
431
449
{
Index: ddraw/glDirect3DLight.cpp
—
—
@@ -75,6 +75,7 @@
76
76
void glDirect3DLight::SetLight7(LPD3DLIGHT7 lpLight7)
77
77
{
78
78
memcpy(&light,lpLight7,sizeof(D3DLIGHT7));
79
+ if(gllight != -1) SetGLLight(gllight);
79
80
}
80
81
81
82
HRESULT WINAPI glDirect3DLight::GetLight(LPD3DLIGHT lpLight)
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