From 4cd353b05008fee3e1d6082a3cb1a2a1df7183ed Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Fri, 23 Aug 2024 11:45:13 +0530 Subject: [PATCH 01/13] docs(feature): New buffer error constants https://github.com/YoYoGames/GameMaker-Bugs/issues/7385 --- .../GML_Reference/Buffers/buffer_write.htm | 38 +++++++++++++++++-- Manual/variable/Default.var | 7 ++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Buffers/buffer_write.htm b/Manual/contents/GameMaker_Language/GML_Reference/Buffers/buffer_write.htm index adc34780c..0214cc295 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Buffers/buffer_write.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Buffers/buffer_write.htm @@ -19,7 +19,39 @@

buffer_write

The function will write your given value at the buffer's current seek position.

The following constants can be used to define the data type:

-

The function will return 0 if it succeeds or -1 if it fails.

+

The function will return 0 if it succeeds or one of the following constants in case of failure:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Buffer Error Constant
ConstantDescriptionValue
buffer_error_generalA general buffer error.-1
buffer_error_out_of_spaceThe buffer doesn't have enough space for the size of the type being written.-2
buffer_error_invalid_typeAttempting to write an invalid type to a buffer. For example, submitting a string value for a buffer_u16 type or a buffer_f16 into a "fast" buffer that only takes buffer_u8 values.-4

 

Syntax:

buffer_write(buffer, type, value);

@@ -49,7 +81,7 @@

Syntax:

 

Returns:

-

Real (0 if success, or -1 if it fails)

+

Real (0 if success) or Buffer Error Constant (if it fails)

 

Example:

buffer_seek(buff, buffer_seek_start, 0);
@@ -67,7 +99,7 @@

Example:

Next: buffer_fill
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved
-

The_Game_Window.htm

+

The Game Window

The game you create happens in a window (even when fullscreen), and this window has a number of properties, like position, size, whether it is fullscreen, etc. These details are normally set automatically for you based on the room size and view ports enabled in combination with the settings from Game Options for the target platform, but you can change them during the game using the functions listed on this page.

 These functions are for Windows, Ubuntu, macOS, GX.games and HTML5 targets only and may not work on any other device.

The following image illustrates how some general window functions relate and interact with each other:

@@ -58,8 +58,8 @@

Border & Caption

  • window_get_caption
  • window_set_showborder
  • window_get_showborder
  • -
  • window_enable_borderless_fullscreen
  • -
  • window_get_borderless_fullscreen
  • +
  • window_enable_borderless_fullscreen
  • +
  • window_get_borderless_fullscreen
  • Dimensions & Position

    -

    When using this function you give the view port index (from 0 to 7) and a surface index (either the application_surface or the unique index value returned by the function surface_create()) or, if a surface has previously been assigned and you want to remove it, a value of -1. For more examples on setting the view port to a surface see the variable view_surface_id.

    +

    When using this function you give the view port index (from 0 to 7) and a surface index (either the application_surface or the handle returned by the function surface_create()) or, if a surface has previously been assigned and you want to remove it, a value of -1. For more examples on setting the view port to a surface see the variable view_surface_id.

     

    Syntax:

    @@ -34,22 +34,22 @@

    Syntax:

    view_port - Real + Real The view port to target (0 - 7) surf - Surface ID + Surface The surface to apply to the view

     

    Returns:

    -

    Real

    +

    Real

     

    Example:

    -

    if (view_get_surface_id(0) == -1)
    +

    if (view_get_surface_id(0) == -1)
    {
        view_set_surface_id(0, global.vSurf);
    }

    @@ -62,7 +62,7 @@

    Example:

    Next: camera_create
    -
    © Copyright YoYo Games Ltd. 2022 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved
    -

    ds_grid_add

    -

    This function can be used to add a given value (real or string) to the value of the given cell within the grid. The value to be added must be the same type as that held within the grid cell, ie: you cannot add a string to a real or vice-versa, and for - strings this corresponds to concatenation.

    -

     

    -

    Syntax:

    -

    ds_grid_add(index, x, y, val);

    - - - - - - - - - - - - - - - - - - - - - - - -
    ArgumentTypeDescription
    indexThe index of the grid.
    xThe x position of the cell in the grid.
    yThe y position of the cell in the grid.
    valThe value to add to the cell.
    -

     

    -

    Returns:

    -

    -

     

    -

    Example:

    -

    ds_grid_add(grid, 5, 5, 6)

    -

    This would add 6 to the given cell within the DS grid referenced by the variable "grid".

    -

     

    -

     

    -

     

    -