-
Notifications
You must be signed in to change notification settings - Fork 9
/
Create_0.gml
54 lines (39 loc) · 1.41 KB
/
Create_0.gml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// @description Insert description here
// You can write your code in this editor
/// @description Insert description here
// You can write your code in this editor
// Inherit the parent event
event_inherited();
text = "Load";
requestIds = {};
errorFlag = false;
requests = [];
onClick = function() {
var _userId = xboxone_get_savedata_user();
show_debug_message("[INFO] gdk_load_buffer (userID: " + string(_userId) + ")");
errorFlag = false;
queue_load("single/b1");
queue_load("multi/b2");
queue_load("multi/b3");
queue_load("multi/b4");
}
function queue_load(_filename)
{
var _bufferId = buffer_create(1, buffer_grow, 1);
switch (os_type) {
case os_windows:
// On Windows GDK the function used to load buffers asynchronously
// is 'gdk_load_buffer' it will return a requestID that can be checked
// during the Async Save/Load event.
var _requestId = gdk_load_buffer(_bufferId, _filename, 0, 10);
break;
case os_xboxseriesxs:
// On Xbox Series X/S the function used to load buffers asynchronously
// is 'gdk_load_buffer' it will return a requestID that can be checked
// during the Async Save/Load event.
var _requestId = buffer_load_async(_bufferId, _filename, 0, 10);
break;
default: throw "[ERROR] objLoad, unsupported platform";
}
requestIds[$ _requestId] = { filename: _filename, bufferId: _bufferId };
}