Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 3, 2024
2 parents ae6b533 + a15ba35 commit 6ef4764
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>shader_set_uniform_f_array</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css" />
<script src="../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>shader_set_uniform_f_buffer</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" type="text/css" href="../../../../assets/css/default.css" />
<script src="../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Bart Teunis" />
Expand All @@ -16,8 +16,9 @@
</head>
<body>
<h1><span data-field="title" data-format="default">shader_set_uniform_f_buffer</span></h1>
<p>With this function you can set the value of a shader uniform to a list of floating point values that are stored in a buffer.</p>
<p>As floats are represented in a buffer using the <span class="inline2"><a href="../../Buffers/buffer_write.htm">buffer_f32</a></span> data type, this function expects the data in the range given by offset and count to be formatted as consecutive values of this type.</p>
<p>With this function you can set the value of a shader uniform to a list of floating-point values that are stored in a buffer.</p>
<p>As floats are represented in a buffer using the <span class="inline2"><a href="../../Buffers/buffer_write.htm">buffer_f32</a></span> data type, this function expects the data in the range given by <span class="inline2">offset</span> and <span class="inline2">count</span> to be formatted as consecutive values of this type.</p>
<p><span>Note that the <span class="inline2">count</span> parameter should correspond to the total number of values of the uniform that you&#39;re setting: the number of components of the data type times the array length (in case of an array uniform). For example, <span class="inline2">uniform vec2 u_vUV;</span> expects 2 <span class="inline2">buffer_f32</span> values, <span class="inline2">uniform vec4 u_vColours[16];</span> expects 4 * 16 = 64 values, <span class="inline2">uniform float u_fIntensity[8];</span> expects 1 * 8 = 8 values and <span class="inline2">uniform mat4 u_mMatrices[4];</span> expects (4x4) x 4 = 64 values.</span></p>
<div data-conref="../../../../assets/snippets/Note_Set_Uniforms_After_Shader_Set.hts"> </div>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">shader_set_uniform_f_buffer</span>(uniform, buffer, offset, count);</p>
Expand All @@ -35,23 +36,23 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>handle</td>
<td><span data-keyref="Type_Handle_Shader_Uniform"><a href="../../../../../GameMaker_Language/GML_Reference/Asset_Management/Shaders/shader_get_uniform.htm" target="_blank">Shader Uniform Handle</a></span></td>
<td><span data-keyref="Type_Handle_Shader_Uniform"><a href="shader_get_uniform.htm" target="_blank">Shader Uniform Handle</a></span></td>
<td>The handle to the shader uniform as returned by <span class="inline2"><a data-xref="{title}" href="shader_get_uniform.htm">shader_get_uniform</a></span></td>
</tr>
<tr>
<td>buffer</td>
<td><span data-keyref="Type_ID_Buffer"><a href="../../../../../GameMaker_Language/GML_Reference/Buffers/buffer_create.htm" target="_blank">Buffer ID</a></span></td>
<td><span data-keyref="Type_ID_Buffer"><a href="../../Buffers/buffer_create.htm" target="_blank">Buffer</a></span></td>
<td>The buffer to read the values from</td>
</tr>
<tr>
<td>offset</td>
<td><span data-keyref="Type_Real"><a href="../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td><span data-keyref="Type_Real"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td>The offset (in bytes) in the buffer</td>
</tr>
<tr>
<td>count</td>
<td><span data-keyref="Type_Real"><a href="../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td>The number of values of type <span class="inline2">buffer_f32</span> to be used (see <a data-xref="{captionText}" href="../../Buffers/buffer_write.htm#table">Buffer Data Type Constant</a>)</td>
<td><span data-keyref="Type_Real"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td>The number of values of type <span class="inline2">buffer_f32</span> to use (see <span data-keyref="Type_Constant_Buffer_Data_Type"><a href="../../Buffers/buffer_write.htm" target="_blank">Buffer Data Type Constant</a></span>)</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -92,7 +93,7 @@ <h4>Example:</h4>
<div>Next: <a data-xref="{title}" href="shader_set_uniform_i.htm">shader_set_uniform_i</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
shader_set_uniform_f_buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ <h1><span data-field="title" data-format="default">window_mouse_set_locked</span
<p>This function locks the mouse cursor in place inside the window, and makes it invisible.</p>
<p>Mouse movement can still be read through the functions <span class="inline3_func"><a data-xref="{title}" href="window_mouse_get_delta_x.htm">window_mouse_get_delta_x</a></span> and <span class="inline3_func"><a data-xref="{title}" href="window_mouse_get_delta_y.htm">window_mouse_get_delta_y</a></span>.</p>
<p>The cursor is set back to its previous &quot;visible&quot; state when mouse lock is disabled again, i.e. when the function is called with <span class="inline2">enable</span> set to <span class="inline2">false</span>.</p>
<p> </p>
<div data-conref="../../../../assets/snippets/function_only_for_desktop.hts"> </div>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> Use <span class="inline3_func"><a data-xref="{title}" href="window_mouse_get_locked.htm">window_mouse_get_locked</a></span> to get the locked state of the mouse.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> On HTML5 this function cannot be used in the Create event as this platform requires that the canvas is clicked first.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">window_mouse_set_locked</span>(enable);</p>
Expand All @@ -36,7 +39,7 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>enable</td>
<td><span data-keyref="Type_Bool"><a href="GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></td>
<td><span data-keyref="Type_Bool"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></td>
<td>Whether to lock the mouse or not</td>
</tr>
</tbody>
Expand All @@ -56,7 +59,7 @@ <h4>Example: Basic Use</h4>
<div>Next: <a data-xref="{title}" href="window_mouse_get_locked.htm">window_mouse_get_locked</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
window_mouse_set_locked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>display_mouse_set</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../assets/css/default.css" type="text/css" />
<script src="../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>ds_grid_to_mp_grid</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<link rel="stylesheet" type="text/css" href="../../../../assets/css/default.css" />
<meta name="generator" content="Adobe RoboHelp 2022"/>
<link rel="stylesheet" type="text/css" href="../../../../assets/css/default.css"/>
<script src="../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Bart Teunis" />
<meta name="topic-comment" content="Reference page for the ds_grid_to_mp_grid function" />
<meta name="rh-index-keywords" content="ds_grid_to_mp_grid" />
<meta name="search-keywords" content="ds_grid_to_mp_grid" />
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" />
<meta name="rh-authors" content="Bart Teunis"/>
<meta name="topic-comment" content="Reference page for the ds_grid_to_mp_grid function"/>
<meta name="rh-index-keywords" content="ds_grid_to_mp_grid"/>
<meta name="search-keywords" content="ds_grid_to_mp_grid"/>
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt"/>
</head>
<body>
<h1><span data-field="title" data-format="default">ds_grid_to_mp_grid</span></h1>
Expand All @@ -23,7 +22,7 @@ <h3>Usage Notes</h3>
<ul class="Disc">
<li>Cells set to 0 in the DS grid become empty cells in the MP grid, all other values will be occupied.</li>
<li>By default, a DS grid created with <span class="inline3_func"><a data-xref="{title}" href="ds_grid_create.htm">ds_grid_create</a></span> has all elements set to 0 so an MP grid created from it will be empty.</li>
<li>The grid can contain any value that can be converted to real using the function <span class="inline3_func"><a data-xref="{title}" href="../../Strings/real.htm">real</a></span>. If there are values that cannot be converted, e.g. a string that contains only letters, the function will fail and an error message is shown.</li>
<li>The grid can contain any value that can be converted to real using the function <span class="inline3_func"><a data-xref="{title}" href="../../Variable_Functions/real.htm">real</a></span>. If there are values that cannot be converted, e.g. a string that contains only letters, the function will fail and an error message is shown.</li>
</ul>
<h3><a class="dropspot" data-rhwidget="DropSpot" data-target="drop-down" href="#">Mapping Function</a></h3>
<div class="droptext" data-targetname="drop-down">
Expand Down Expand Up @@ -60,9 +59,9 @@ <h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">ds_grid_to_mp_grid</span>(ds_grid, mp_grid[, func]);</p>
<table>
<colgroup>
<col />
<col />
<col />
<col/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
Expand Down Expand Up @@ -92,45 +91,45 @@ <h4>Returns:</h4>
<p class="code"><span data-keyref="Type_ID_MP_Grid"><a href="../../../../../GameMaker_Language/GML_Reference/Movement_And_Collisions/Motion_Planning/mp_grid_create.htm" target="_blank">MP Grid ID</a></span></p>
<p> </p>
<h4>Example 1: Basic Usage</h4>
<p class="code">var _size = 10;<br />
grd_data = ds_grid_create(_size, _size);<br />
repeat(20)<br />
{<br />
    ds_grid_set(grd_data, irandom(_size-1), irandom(_size-1), choose(0, false, true, &quot;7&quot;, 47));<br />
}<br />
<br />
mpg_data = mp_grid_create(0, 0, _size, _size, 16, 16);<br />
<p class="code">var _size = 10;<br/>
grd_data = ds_grid_create(_size, _size);<br/>
repeat(20)<br/>
{<br/>
    ds_grid_set(grd_data, irandom(_size-1), irandom(_size-1), choose(0, false, true, &quot;7&quot;, 47));<br/>
}<br/>
<br/>
mpg_data = mp_grid_create(0, 0, _size, _size, 16, 16);<br/>
<span data-field="title" data-format="default">ds_grid_to_mp_grid</span>(grd_data, mpg_data);
</p>
<p>The above code first creates a DS grid of 10 cells by 10 cells (initialised in the <span class="inline2">_size</span> variable) using <span class="inline3_func"><a data-xref="{title}" href="ds_grid_create.htm">ds_grid_create</a></span>. It then assigns one of 5 possible values, selected using the <span class="inline3_func"><a data-xref="{title}" href="../../Maths_And_Numbers/Number_Functions/choose.htm">choose</a></span> function, to each of 20 randomly selected cells in the grid. After that, it creates an MP grid using <span class="inline3_func"><a data-xref="{title}" href="../../Movement_And_Collisions/Motion_Planning/mp_grid_create.htm">mp_grid_create</a></span> and fills it using the contents of the DS grid by calling the <span class="inline3_func"><span data-field="title" data-format="default">ds_grid_to_mp_grid</span></span> function. DS grid cells containing <span class="inline2">0</span> or <span class="inline2">false</span> will be marked as &quot;empty&quot; in the MP grid, cells containing <span class="inline2">true</span>, <span class="inline2">&quot;7&quot;</span> or <span class="inline2">47</span> marked as &quot;occupied&quot;.</p>
<p> </p>
<h4>Example 2: Using a Mapping Function</h4>
<p class="code">width = 128;<br />
height = 128;<br />
cellsize = 4;<br />
<br />
function occupied(value, x, y)<br />
{<br />
    switch(value)<br />
    {<br />
        case &quot;Mountains&quot;:<br />
        case &quot;Water&quot;:<br />
        case &quot;Forest&quot;:<br />
            return true;<br />
        case &quot;Grass&quot;:<br />
            return false;<br />
        default:<br />
            return false;<br />
    }<br />
}<br />
<br />
grd_level = ds_grid_create(width, height);<br />
ds_grid_clear(grd_level, &quot;Grass&quot;);<br />
ds_grid_set_disk(grd_level, 60, 60, 20, &quot;Water&quot;);<br />
ds_grid_set_disk(grd_level, 100, 60, 20, &quot;Mountains&quot;);<br />
ds_grid_set_region(grd_level, 60, 100, 110, 110, &quot;Forest&quot;);<br />
<br />
mpg_level = mp_grid_create(0, 0, width, height, 4, 4);<br />
<p class="code">width = 128;<br/>
height = 128;<br/>
cellsize = 4;<br/>
<br/>
function occupied(value, x, y)<br/>
{<br/>
    switch(value)<br/>
    {<br/>
        case &quot;Mountains&quot;:<br/>
        case &quot;Water&quot;:<br/>
        case &quot;Forest&quot;:<br/>
            return true;<br/>
        case &quot;Grass&quot;:<br/>
            return false;<br/>
        default:<br/>
            return false;<br/>
    }<br/>
}<br/>
<br/>
grd_level = ds_grid_create(width, height);<br/>
ds_grid_clear(grd_level, &quot;Grass&quot;);<br/>
ds_grid_set_disk(grd_level, 60, 60, 20, &quot;Water&quot;);<br/>
ds_grid_set_disk(grd_level, 100, 60, 20, &quot;Mountains&quot;);<br/>
ds_grid_set_region(grd_level, 60, 100, 110, 110, &quot;Forest&quot;);<br/>
<br/>
mpg_level = mp_grid_create(0, 0, width, height, 4, 4);<br/>
ds_grid_to_mp_grid(grd_level, mpg_level, occupied);
</p>
<p>The above code first shows an example of how to use a mapping function. First it defines <span class="inline2">width</span>, <span class="inline2">height</span> and <span class="inline2">cellsize</span> as instance variables, as well as a mapping function <span class="inline3_func">occupied</span> that returns <span class="inline2">true</span> if the value is one of <span class="inline2">&quot;Mountains&quot;</span>, <span class="inline2">&quot;Water&quot;</span> or <span class="inline2">&quot;Forest&quot;</span> or <span class="inline2">false</span> if it is either <span class="inline2">&quot;Grass&quot;</span> or any other value. It then creates a <a href="DS_Grids.htm">DS grid</a> <span class="inline2">grd_level</span> of the given width and height and fills it with a couple of terrain types. After that, an MP grid of the same width and height is created using <span class="inline3_func"><a data-xref="{title}" href="../../Movement_And_Collisions/Motion_Planning/mp_grid_create.htm">mp_grid_create</a></span> and its ID stored in a variable <span class="inline2">mpg_level</span>. Finally the MP grid is initialized with the contents of the DS grid, using <span class="inline3_func"><span data-field="title" data-format="default">ds_grid_to_mp_grid</span></span>.</p>
Expand All @@ -151,5 +150,5 @@ <h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All R
<!-- TAGS
ds_grid_to_mp_grid
-->
</body>
</html>

</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ <h1>vertex_format_add_custom</h1>
{<br />
    gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4( in_Position.xyz, 1.0);<br />
    v_vColour = in_BlendWeights;<br />
     ivec4 t = ivec4(in_BlendIndices);<br />
     v_mat = gm_Matrices[ t.x ];<br />
    ivec4 t = ivec4(in_BlendIndices);<br />
    v_mat = gm_Matrices[ t.x ];<br />
}
</p>
<ul class="colour">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ <h5><span data-keyref="Copyright Notice">© Copyright <span class="notranslate">
<!-- TAGS
load_csv
-->
</body>
</html>

</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ord</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../assets/css/default.css" type="text/css" />
<script src="../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Loading

0 comments on commit 6ef4764

Please sign in to comment.