Files
mazegame/engine/doc/html/files/device/lightgun-h.html
T

75 lines
11 KiB
HTML

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>lightgun.h</title><link rel="stylesheet" type="text/css" href="../../styles/main.css" /><script type="text/javascript" src="../../styles/main.js"></script><script type="text/javascript">NDLoader.LoadJS("Content", "../../styles/");</script></head>
<!-- Generated by Natural Docs, version 2.2 -->
<!-- saved from url=(0016)http://localhost -->
<body onload="NDLoader.OnLoad('Content');" class="NDPage NDContentPage">
<a name="Common"></a><a name="Topic93"></a><div class="CTopic TGroup LC first">
<div class="CTitle">Common</div>
</div>
<a name="LightGun_Read"></a><a name="Topic94"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_Read</div>
<div id="NDPrototype94" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 LightGun_Read(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">port</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Read light gun data from the given port.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">port<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Input port to read (INPUT_PORT1 or INPUT_PORT2)</p></td></tr></table><div class="CHeading">Return</div><p>Light gun state (use GetTrigger and GetLight functions to get state information).</p></div>
</div>
<a name="ASCII_Plus-X_Terminator_Laser"></a><a name="Topic95"></a><div class="CTopic TGroup LC">
<div class="CTitle">ASCII Plus-X Terminator Laser</div>
</div>
<a name="LightGun_ASCII_GetTrigger"></a><a name="Topic96"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_ASCII_GetTrigger</div>
<div id="NDPrototype96" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> LightGun_ASCII_GetTrigger(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the trigger status of the ASCII light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if the trigger is not pressed.</p></div>
</div>
<a name="LightGun_ASCII_GetLight"></a><a name="Topic97"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_ASCII_GetLight</div>
<div id="NDPrototype97" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 LightGun_ASCII_GetLight(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the light status of the ASCII light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if the gun don't detect light (not pointing to white image on screen).</p></div>
</div>
<a name="MHT_Ingenieros_Gun-Stick"></a><a name="Topic98"></a><div class="CTopic TGroup LC">
<div class="CTitle">MHT Ingenieros Gun-Stick</div>
</div>
<a name="LightGun_GunStick_GetTrigger"></a><a name="Topic99"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_GunStick_GetTrigger</div>
<div id="NDPrototype99" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> LightGun_GunStick_GetTrigger(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the trigger status of the MHT Ingenieros Gun-Stick light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if the trigger is not pressed.</p></div>
</div>
<a name="LightGun_GunStick_GetLight"></a><a name="Topic100"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_GunStick_GetLight</div>
<div id="NDPrototype100" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 LightGun_GunStick_GetLight(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the light status of the MHT Ingenieros Gun-Stick light gun.&nbsp; Parameters: state - Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p><div class="CHeading">Return</div><p>FALSE if the gun don't detect light (not pointing to white image on screen).</p></div>
</div>
<a name="Phenix_Light_Gun"></a><a name="Topic101"></a><div class="CTopic TGroup LC">
<div class="CTitle">Phenix Light Gun</div>
</div>
<a name="LightGun_Phenix_GetTriggerA"></a><a name="Topic102"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_Phenix_GetTriggerA</div>
<div id="NDPrototype102" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> LightGun_Phenix_GetTriggerA(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the trigger A status of the Phenix light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if the trigger A is not pressed.</p></div>
</div>
<a name="LightGun_Phenix_GetTriggerB"></a><a name="Topic103"></a><div class="CTopic TFunction LC">
<div class="CTitle">LightGun_Phenix_GetTriggerB</div>
<div id="NDPrototype103" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> LightGun_Phenix_GetTriggerB(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the trigger B status of the Phenix light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if the trigger B is not pressed.</p></div>
</div>
<a name="LightGun_Phenix_GetLight"></a><a name="Topic104"></a><div class="CTopic TFunction LC last">
<div class="CTitle">LightGun_Phenix_GetLight</div>
<div id="NDPrototype104" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 LightGun_Phenix_GetLight(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">state</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Get the light status of the Phenix light gun.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">state<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Current state of the light gun (from <a href="../../index.html#File:device/lightgun.h:LightGun_Read" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,94);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >LightGun_Read</a>)</p></td></tr></table><div class="CHeading">Return</div><p>Detected 3-bit RGB color</p><pre class="CCode"><span class="SHNumber">0b000</span>: Black (no light detected)<br /><span class="SHNumber">0b001</span>: Blue<br /><span class="SHNumber">0b010</span>: Green<br /><span class="SHNumber">0b011</span>: Cyan<br /><span class="SHNumber">0b100</span>: Red<br /><span class="SHNumber">0b101</span>: Magenta<br /><span class="SHNumber">0b110</span>: Yellow<br /><span class="SHNumber">0b111</span>: White (light detected)</pre></div>
</div>
</body></html>