Skip to content

Commit

Permalink
d3d_light_get_ambient, d3d_get_lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
omicronrex committed Aug 23, 2024
1 parent aaa3ac0 commit da48258
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
30 changes: 24 additions & 6 deletions gm82dx9.gej
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"folder": "gm82",
"version": "1.0",
"author": "Floogle && renex",
"date": "22/08/2024",
"date": "23/08/2024",
"license": "Free to use, also for commercial games.",
"description": "Requires Game Maker 8.2 Network. Part of the standard Game Maker 8.2 distribution. This extension package upgrades Game Maker to DirectX version 9.0, providing extended render state control and HLSL9 shaders.",
"helpfile": "",
Expand Down Expand Up @@ -85,14 +85,12 @@
"returntype": 2
},
{
"name": "d3d_light_get_enabled",
"name": "d3d_get_lighting",
"extname": "",
"calltype": 12,
"helpline": "d3d_light_get_enabled(index)",
"helpline": "d3d_get_lighting()",
"hidden": false,
"argtypes": [
2
],
"argtypes": [],
"returntype": 2
},
{
Expand Down Expand Up @@ -156,6 +154,26 @@
],
"returntype": 2
},
{
"name": "d3d_light_enabled",
"extname": "",
"calltype": 12,
"helpline": "d3d_light_enabled(index)",
"hidden": false,
"argtypes": [
2
],
"returntype": 2
},
{
"name": "d3d_light_get_ambient",
"extname": "",
"calltype": 12,
"helpline": "d3d_light_get_ambient()",
"hidden": false,
"argtypes": [],
"returntype": 2
},
{
"name": "d3d_set_alphatest",
"extname": "__gm82dx9_set_alphatest",
Expand Down
10 changes: 10 additions & 0 deletions source/gm82dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ GMREAL d3d_light_get_enabled(double index) {
vibe_check(Device->GetLightEnable((int)index,&enabled));
return enabled?1:0;
}
GMREAL d3d_get_lighting(double index) {
DWORD enabled;
Device->GetRenderState(D3DRS_LIGHTING,&enabled);
return enabled?1:0;
}
GMREAL __gm82dx9_buffer_get_lights(double buffer) {
D3DLIGHT9 light;
char* dest=(char*)(int)buffer;
Expand All @@ -164,6 +169,11 @@ GMREAL __gm82dx9_buffer_get_lights(double buffer) {

return 0;
}
GMREAL d3d_light_get_ambient() {
DWORD color;
Device->GetRenderState(D3DRS_AMBIENT,&color);
return (double)(((color&0xff)<<16) + (color&0xff00) + ((color&0xff0000)>>16));
}
GMREAL __gm82dx9_set_light(
double index, double type,
double x, double y, double z,
Expand Down

0 comments on commit da48258

Please sign in to comment.