mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
a.m32: Implement a Polymer "head light" emanating from your position in 3D mode.
Toggled with Ctrl+Shift+[KP-]. Variable 'headlight_range' controls its range. For the implementation, a new event EVENT_PREDRAW3DSCREEN was added. git-svn-id: https://svn.eduke32.com/eduke32@3648 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
53b01f57c6
commit
f1f84beeda
4 changed files with 60 additions and 0 deletions
|
@ -93,6 +93,7 @@ enum GameEvent_t {
|
||||||
EVENT_PREKEYS3D,
|
EVENT_PREKEYS3D,
|
||||||
EVENT_LINKTAGS,
|
EVENT_LINKTAGS,
|
||||||
EVENT_KEYPRESS,
|
EVENT_KEYPRESS,
|
||||||
|
EVENT_PREDRAW3DSCREEN,
|
||||||
MAXEVENTS
|
MAXEVENTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -471,6 +471,8 @@ void M32_ResetFakeRORTiles(void)
|
||||||
|
|
||||||
void M32_DrawRoomsAndMasks(void)
|
void M32_DrawRoomsAndMasks(void)
|
||||||
{
|
{
|
||||||
|
VM_OnEvent(EVENT_PREDRAW3DSCREEN, -1);
|
||||||
|
|
||||||
yax_preparedrawrooms();
|
yax_preparedrawrooms();
|
||||||
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
|
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
|
||||||
yax_drawrooms(ExtAnalyzeSprites, cursectnum, 0, 0);
|
yax_drawrooms(ExtAnalyzeSprites, cursectnum, 0, 0);
|
||||||
|
|
|
@ -40,6 +40,10 @@ gamevar showrespawn_always 0 0
|
||||||
|
|
||||||
gamevar move_by_one 0 0
|
gamevar move_by_one 0 0
|
||||||
|
|
||||||
|
// Polymer "head" light
|
||||||
|
gamevar headlight_enabled 0 0
|
||||||
|
gamevar headlight_range 4000 0
|
||||||
|
|
||||||
// see end of file for more user settings and examples
|
// see end of file for more user settings and examples
|
||||||
|
|
||||||
////////// END USER SETTINGS //////////
|
////////// END USER SETTINGS //////////
|
||||||
|
@ -424,6 +428,24 @@ defstate fiddlewithlights
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// not aiming at sprite
|
||||||
|
|
||||||
|
ifeitherctrl ifeithershift ifhitkey KEY_gMINUS
|
||||||
|
{
|
||||||
|
ife headlight_enabled 0
|
||||||
|
{
|
||||||
|
set headlight_enabled 1
|
||||||
|
quote "head light enabled"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set headlight_enabled 0
|
||||||
|
quote "head light disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ends
|
ends
|
||||||
|
|
||||||
defstate do_move_by_one
|
defstate do_move_by_one
|
||||||
|
@ -1119,6 +1141,40 @@ onevent EVENT_ANALYZESPRITES
|
||||||
state tduplin
|
state tduplin
|
||||||
endevent
|
endevent
|
||||||
|
|
||||||
|
defstate update_headlight
|
||||||
|
var li hrz
|
||||||
|
set li 0
|
||||||
|
|
||||||
|
ifvare headlight_enabled 0
|
||||||
|
break
|
||||||
|
|
||||||
|
ifvarn light[li].active 1
|
||||||
|
break
|
||||||
|
|
||||||
|
set light[li].x posx
|
||||||
|
set light[li].y posy
|
||||||
|
set light[li].z posz
|
||||||
|
set light[li].sector cursectnum
|
||||||
|
set hrz horiz
|
||||||
|
set light[li].horiz hrz
|
||||||
|
set light[li].angle ang
|
||||||
|
|
||||||
|
set light[li].range headlight_range
|
||||||
|
set light[li].radius 256
|
||||||
|
set light[li].faderadius 128
|
||||||
|
|
||||||
|
set light[li].r 255
|
||||||
|
set light[li].g 255
|
||||||
|
set light[li].b 255
|
||||||
|
set light[li].priority 0
|
||||||
|
|
||||||
|
set light[li].tilenum 0
|
||||||
|
ends
|
||||||
|
|
||||||
|
onevent EVENT_PREDRAW3DSCREEN
|
||||||
|
state update_headlight
|
||||||
|
endevent
|
||||||
|
|
||||||
onevent EVENT_KEYS3D
|
onevent EVENT_KEYS3D
|
||||||
var l m
|
var l m
|
||||||
|
|
||||||
|
|
|
@ -3514,6 +3514,7 @@ static void C_AddDefaultDefinitions(void)
|
||||||
C_AddDefinition("EVENT_PREKEYS3D", EVENT_PREKEYS3D, LABEL_EVENT);
|
C_AddDefinition("EVENT_PREKEYS3D", EVENT_PREKEYS3D, LABEL_EVENT);
|
||||||
C_AddDefinition("EVENT_LINKTAGS", EVENT_LINKTAGS, LABEL_EVENT);
|
C_AddDefinition("EVENT_LINKTAGS", EVENT_LINKTAGS, LABEL_EVENT);
|
||||||
C_AddDefinition("EVENT_KEYPRESS", EVENT_KEYPRESS, LABEL_EVENT);
|
C_AddDefinition("EVENT_KEYPRESS", EVENT_KEYPRESS, LABEL_EVENT);
|
||||||
|
C_AddDefinition("EVENT_PREDRAW3DSCREEN", EVENT_PREDRAW3DSCREEN, LABEL_EVENT);
|
||||||
|
|
||||||
C_AddDefinition("CLIPMASK0", CLIPMASK0, LABEL_DEFINE);
|
C_AddDefinition("CLIPMASK0", CLIPMASK0, LABEL_DEFINE);
|
||||||
C_AddDefinition("CLIPMASK1", CLIPMASK1, LABEL_DEFINE);
|
C_AddDefinition("CLIPMASK1", CLIPMASK1, LABEL_DEFINE);
|
||||||
|
|
Loading…
Reference in a new issue