-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sdl-gamecontroller' (pull request GH-17)
- Loading branch information
Showing
45 changed files
with
955 additions
and
802 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<!DOCTYPE funcs | ||
SYSTEM '../../../clonk.dtd'> | ||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?> | ||
<funcs> | ||
<func> | ||
<title>PlayRumble</title> | ||
<category>Player</category> | ||
<version>8.0 OC</version> | ||
<syntax> | ||
<rtype>bool</rtype> | ||
<params> | ||
<param> | ||
<type>int</type> | ||
<name>player</name> | ||
<desc>Number of the player whose controller should rumble. Can be NO_OWNER to make all controllers rumble.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>strength</name> | ||
<desc>Strength of the rumble, between 0 and 1000.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>length</name> | ||
<desc>Duration of the rumble in milliseconds.</desc> | ||
</param> | ||
</params> | ||
</syntax> | ||
<desc>Plays a haptic effect on the given player's gamepad. Returns true if all parameters are valid; there is no way to know whether the rumble was actually played.</desc> | ||
<examples> | ||
<example> | ||
<code> | ||
<funclink>ShakeObjects</funclink>(<funclink>LandscapeWidth</funclink>()/2, <funclink>LandscapeHeight</funclink>()/2, <funclink>Distance</funclink>(<funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>())/2); | ||
PlayRumble(NO_OWNER, 1000, 2000); | ||
</code> | ||
<text>Earthquake: Shakes all Clonks and rumbles all controllers at full strength for two seconds.</text> | ||
</example> | ||
</examples> | ||
<related> | ||
<funclink>StopRumble</funclink> | ||
</related> | ||
</func> | ||
<author>Luchs</author><date>2016-02</date> | ||
</funcs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<!DOCTYPE funcs | ||
SYSTEM '../../../clonk.dtd'> | ||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?> | ||
<funcs> | ||
<func> | ||
<title>PlayerControl</title> | ||
<category>Callbacks</category> | ||
<version>5.1 OC</version> | ||
<syntax> | ||
<rtype>bool</rtype> | ||
<params> | ||
<param> | ||
<type>int</type> | ||
<name>player</name> | ||
<desc>Number of the player who pressed the control.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>control</name> | ||
<desc>Number of the pressed control, defined as a CON_ constant via PlayerControls.txt.</desc> | ||
</param> | ||
<param> | ||
<type>id</type> | ||
<name>control_extra</name> | ||
<desc>Optional id defined with ExtraData in PlayerControls.txt.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>x</name> | ||
<desc>X coordinate for mouse controls.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>y</name> | ||
<desc>Y coordinate for mouse controls.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>strength</name> | ||
<desc>Current strength of the control. For key presses: 0 or 100. For analog stick or trigger movement (state = CONS_Moved): 0 to <code>PLRCON_MaxStrength</code>.</desc> | ||
</param> | ||
<param> | ||
<type>bool</type> | ||
<name>repeated</name> | ||
<desc>Whether the call is generated because of a held button.</desc> | ||
</param> | ||
<param> | ||
<type>int</type> | ||
<name>state</name> | ||
<desc> | ||
State of the key press. Possible values: | ||
<table> | ||
<rowh> | ||
<col>Constant</col> | ||
<col>Description</col> | ||
</rowh> | ||
<row> | ||
<literal_col>CONS_Down</literal_col> | ||
<col>Key has been pressed down.</col> | ||
</row> | ||
<row> | ||
<literal_col>CONS_Up</literal_col> | ||
<col>Key has been released. Only generated for held keys.</col> | ||
</row> | ||
<row> | ||
<literal_col>CONS_Moved</literal_col> | ||
<col>An analog control on a gamepad has been moved. Only generated for held keys.</col> | ||
</row> | ||
</table> | ||
</desc> | ||
</param> | ||
</params> | ||
</syntax> | ||
<desc>Called globally for each control command by players. See <emlink href="script/playercontrols.html">Player Controls</emlink>.</desc> | ||
<related><funclink>GetPlayerControlState</funclink></related> | ||
<related><emlink href="playercontrols.html">Player Controls</emlink></related> | ||
</func> | ||
<author>Luchs</author><date>2016-02</date> | ||
</funcs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<!DOCTYPE funcs | ||
SYSTEM '../../../clonk.dtd'> | ||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?> | ||
<funcs> | ||
<func> | ||
<title>StopRumble</title> | ||
<category>Player</category> | ||
<version>8.0 OC</version> | ||
<syntax> | ||
<rtype>bool</rtype> | ||
<params> | ||
<param> | ||
<type>int</type> | ||
<name>player</name> | ||
<desc>Number of the player whose controller should stop rumbling. Can be NO_OWNER to make all controllers stop.</desc> | ||
</param> | ||
</params> | ||
</syntax> | ||
<desc>Stops a rumble effect that was started with <funclink>PlayRumble</funclink>. Returns true if the given player is valid; there is no way to know whether there was actually a playing rumble effect.</desc> | ||
<related> | ||
<funclink>PlayRumble</funclink> | ||
</related> | ||
</func> | ||
<author>Luchs</author><date>2016-02</date> | ||
</funcs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.