Skip to content

Commit f85b841

Browse files
authored
Merge pull request #501 from coop-deluxe/dev
2 parents 4e01841 + 382b03d commit f85b841

142 files changed

Lines changed: 3250 additions & 2795 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ COOPNET ?= 1
4545
# Enable docker build workarounds
4646
DOCKERBUILD ?= 0
4747
# Sets your optimization level for building.
48-
# A choose is chosen by default for you.
48+
# A choice is made by default for you.
4949
OPT_LEVEL ?= -1
5050
# Enable compiling with more debug info.
5151
DEBUG_INFO_LEVEL ?= 2
@@ -66,8 +66,6 @@ ifeq ($(shell arch),arm64)
6666
else
6767
MIN_MACOS_VERSION ?= 10.15
6868
endif
69-
# Homebrew Prefix
70-
BREW_PREFIX ?= $(shell brew --prefix)
7169
# Make some small adjustments for handheld devices
7270
HANDHELD ?= 0
7371

@@ -122,6 +120,10 @@ endif
122120

123121
ifeq ($(HOST_OS),Darwin)
124122
OSX_BUILD := 1
123+
124+
ifndef BREW_PREFIX
125+
BREW_PREFIX := $(shell brew --prefix)
126+
endif
125127
endif
126128

127129
# MXE overrides
@@ -1327,9 +1329,6 @@ $(SOUND_BIN_DIR)/tbl_header: $(SOUND_BIN_DIR)/sound_data.ctl
13271329
$(SOUND_BIN_DIR)/samples_offsets.inc.c: $(SOUND_BIN_DIR)/sound_data.ctl
13281330
@true
13291331

1330-
$(SOUND_BIN_DIR)/sequences_offsets.inc.c: $(SOUND_BIN_DIR)/sound_data.ctl
1331-
@true
1332-
13331332
$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json $(SOUND_SEQUENCE_DIRS) $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH)
13341333
@$(PRINT) "$(GREEN)Generating: $(BLUE)$@ $(NO_COL)\n"
13351334
$(V)$(PYTHON) $(TOOLS_DIR)/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/sequences_header $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(C_DEFINES) $$(cat $(ENDIAN_BITWIDTH))
@@ -1340,6 +1339,9 @@ $(SOUND_BIN_DIR)/bank_sets: $(SOUND_BIN_DIR)/sequences.bin
13401339
$(SOUND_BIN_DIR)/sequences_header: $(SOUND_BIN_DIR)/sequences.bin
13411340
@true
13421341

1342+
$(SOUND_BIN_DIR)/sequences_offsets.inc.c: $(SOUND_BIN_DIR)/sequences.bin
1343+
@true
1344+
13431345
$(SOUND_BIN_DIR)/%.m64: $(SOUND_BIN_DIR)/%.o
13441346
$(call print,Converting to M64:,$<,$@)
13451347
$(V)$(OBJCOPY) -j .rodata $< -O binary $@

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ Interestingly enough though, the goal of the project has slowly evolved over tim
1313

1414
## Lua
1515
sm64coopdx is moddable via Lua, similar to Roblox and Garry's Mod's Lua APIs. To get started, click [here](docs/lua/lua.md) to see the Lua documentation.
16+
17+
## Wiki
18+
The wiki is made using GitHub's wiki feature, you can go to the wiki tab or click [here](https://github.com/coop-deluxe/sm64coopdx/wiki).

autogen/convert_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
override_disallowed_functions = {
9090
"src/audio/external.h": [ " func_" ],
91-
"src/engine/math_util.h": [ "atan2s", "atan2f", "vec3s_sub" ],
91+
"src/engine/math_util.h": [ "atan2f", "vec3s_sub" ],
9292
"src/engine/surface_load.h": [ "alloc_surface_poools" ],
9393
"src/engine/surface_collision.h": [ " debug_", "f32_find_wall_collision" ],
9494
"src/game/mario_actions_airborne.c": [ "^[us]32 act_.*" ],
@@ -114,7 +114,7 @@
114114
"src/pc/lua/utils/smlua_obj_utils.h": [ "spawn_object_remember_field" ],
115115
"src/game/camera.h": [ "update_camera", "init_camera", "stub_camera", "^reset_camera", "move_point_along_spline" ],
116116
"src/game/behavior_actions.h": [ "bhv_dust_smoke_loop", "bhv_init_room" ],
117-
"src/pc/lua/utils/smlua_audio_utils.h": [ "smlua_audio_utils_override", "audio_custom_shutdown", "smlua_audio_custom_init", "smlua_audio_custom_deinit", "audio_sample_destroy_pending_copies", "audio_custom_update_volume" ],
117+
"src/pc/lua/utils/smlua_audio_utils.h": [ "smlua_audio_utils_override", "audio_custom_shutdown", "smlua_audio_custom_deinit", "audio_sample_destroy_pending_copies", "audio_custom_update_volume" ],
118118
"src/pc/djui/djui_hud_utils.h": [ "djui_hud_render_texture", "djui_hud_render_texture_raw", "djui_hud_render_texture_tile", "djui_hud_render_texture_tile_raw" ],
119119
"src/pc/lua/utils/smlua_level_utils.h": [ "smlua_level_util_reset" ],
120120
"src/pc/lua/utils/smlua_text_utils.h": [ "smlua_text_utils_init", "smlua_text_utils_shutdown", "smlua_text_utils_reset_all" ],

autogen/lua_constants/built-in.lua

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,5 @@
11
math.randomseed(get_time())
22

3-
4-
--------------
5-
-- CObjects --
6-
--------------
7-
8-
_CObjectPool = {}
9-
10-
_CObject = {
11-
__index = function (t,k)
12-
return _get_field(t['_lot'], t['_pointer'], k, t)
13-
end,
14-
__newindex = function (t,k,v)
15-
_set_field(t['_lot'], t['_pointer'], k, v, t)
16-
end,
17-
__tostring = function(t)
18-
return 'CObject: ' .. t['_lot'] .. ', [' .. string.format('0x%08X', t['_pointer']) .. ']'
19-
end,
20-
__eq = function (a, b)
21-
return a['_pointer'] == b['_pointer'] and a['_lot'] == b['_lot'] and a['_pointer'] ~= nil and a['_lot'] ~= nil
22-
end
23-
}
24-
25-
function _NewCObject(lot, pointer)
26-
if _CObjectPool[lot] == nil then
27-
_CObjectPool[lot] = {}
28-
end
29-
30-
if _CObjectPool[lot][pointer] == nil then
31-
local obj = {}
32-
rawset(obj, '_pointer', pointer)
33-
rawset(obj, '_lot', lot)
34-
setmetatable(obj, _CObject)
35-
_CObjectPool[lot][pointer] = obj
36-
return obj
37-
end
38-
39-
return _CObjectPool[lot][pointer]
40-
end
41-
42-
local _CPointerPool = {}
43-
44-
_CPointer = {
45-
__index = function (t,k)
46-
return nil
47-
end,
48-
__newindex = function (t,k,v)
49-
end,
50-
__tostring = function(t)
51-
return 'CPointer: ' .. t['_lvt'] .. ', [' .. string.format('0x%08X', t['_pointer']) .. ']'
52-
end,
53-
__eq = function (a, b)
54-
return a['_pointer'] == b['_pointer'] and a['_pointer'] ~= nil and a['_lvt'] ~= nil
55-
end
56-
}
57-
58-
function _NewCPointer(lvt, pointer)
59-
if _CPointerPool[lvt] == nil then
60-
_CPointerPool[lvt] = {}
61-
end
62-
63-
if _CPointerPool[lvt][pointer] == nil then
64-
local obj = {}
65-
rawset(obj, '_pointer', pointer)
66-
rawset(obj, '_lvt', lvt)
67-
setmetatable(obj, _CPointer)
68-
_CPointerPool[lvt][pointer] = obj
69-
return obj
70-
end
71-
72-
return _CPointerPool[lvt][pointer]
73-
end
74-
753
_SyncTable = {
764
__index = function (t,k)
775
local _table = rawget(t, '_table')

autogen/lua_definitions/constants.lua

Lines changed: 10 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,6 @@
22

33
math.randomseed(get_time())
44

5-
6-
--------------
7-
-- CObjects --
8-
--------------
9-
10-
_CObjectPool = {}
11-
12-
_CObject = {
13-
__index = function (t,k)
14-
return _get_field(t['_lot'], t['_pointer'], k, t)
15-
end,
16-
__newindex = function (t,k,v)
17-
_set_field(t['_lot'], t['_pointer'], k, v, t)
18-
end,
19-
__tostring = function(t)
20-
return 'CObject: ' .. t['_lot'] .. ', [' .. string.format('0x%08X', t['_pointer']) .. ']'
21-
end,
22-
__eq = function (a, b)
23-
return a['_pointer'] == b['_pointer'] and a['_lot'] == b['_lot'] and a['_pointer'] ~= nil and a['_lot'] ~= nil
24-
end
25-
}
26-
27-
function _NewCObject(lot, pointer)
28-
if _CObjectPool[lot] == nil then
29-
_CObjectPool[lot] = {}
30-
end
31-
32-
if _CObjectPool[lot][pointer] == nil then
33-
local obj = {}
34-
rawset(obj, '_pointer', pointer)
35-
rawset(obj, '_lot', lot)
36-
setmetatable(obj, _CObject)
37-
_CObjectPool[lot][pointer] = obj
38-
return obj
39-
end
40-
41-
return _CObjectPool[lot][pointer]
42-
end
43-
44-
local _CPointerPool = {}
45-
46-
_CPointer = {
47-
__index = function (t,k)
48-
return nil
49-
end,
50-
__newindex = function (t,k,v)
51-
end,
52-
__tostring = function(t)
53-
return 'CPointer: ' .. t['_lvt'] .. ', [' .. string.format('0x%08X', t['_pointer']) .. ']'
54-
end,
55-
__eq = function (a, b)
56-
return a['_pointer'] == b['_pointer'] and a['_pointer'] ~= nil and a['_lvt'] ~= nil
57-
end
58-
}
59-
60-
function _NewCPointer(lvt, pointer)
61-
if _CPointerPool[lvt] == nil then
62-
_CPointerPool[lvt] = {}
63-
end
64-
65-
if _CPointerPool[lvt][pointer] == nil then
66-
local obj = {}
67-
rawset(obj, '_pointer', pointer)
68-
rawset(obj, '_lvt', lvt)
69-
setmetatable(obj, _CPointer)
70-
_CPointerPool[lvt][pointer] = obj
71-
return obj
72-
end
73-
74-
return _CPointerPool[lvt][pointer]
75-
end
76-
775
_SyncTable = {
786
__index = function (t,k)
797
local _table = rawget(t, '_table')
@@ -3779,6 +3707,9 @@ INT_TWIRL = (1 << 8)
37793707
--- @type InteractionFlag
37803708
INT_GROUND_POUND_OR_TWIRL = (INT_GROUND_POUND | INT_TWIRL)
37813709

3710+
--- @type InteractionFlag
3711+
INT_LUA = (1 << 31)
3712+
37823713
--- @class InteractionType
37833714

37843715
--- @type InteractionType
@@ -5571,7 +5502,7 @@ MARIO_HAND_RIGHT_OPEN = 5
55715502
MAX_KEYS = 512
55725503

55735504
--- @type integer
5574-
MAX_KEY_VALUE_LENGTH = 256
5505+
MAX_KEY_VALUE_LENGTH = 512
55755506

55765507
--- @type integer
55775508
PACKET_LENGTH = 3000
@@ -9230,7 +9161,10 @@ HOOK_ON_LANGUAGE_CHANGED = 44
92309161
HOOK_ON_MODS_LOADED = 45
92319162

92329163
--- @type LuaHookedEventType
9233-
HOOK_MAX = 46
9164+
HOOK_ON_NAMETAGS_RENDER = 46
9165+
9166+
--- @type LuaHookedEventType
9167+
HOOK_MAX = 47
92349168

92359169
--- @class LuaModMenuElementType
92369170

@@ -12557,10 +12491,10 @@ SPTASK_STATE_FINISHED_DP = 4
1255712491
MAX_VERSION_LENGTH = 32
1255812492

1255912493
--- @type integer
12560-
MINOR_VERSION_NUMBER = 2
12494+
MINOR_VERSION_NUMBER = 3
1256112495

1256212496
--- @type string
12563-
SM64COOPDX_VERSION = "v1.0.3"
12497+
SM64COOPDX_VERSION = "v1.0.4"
1256412498

1256512499
--- @type integer
1256612500
VERSION_NUMBER = 37

0 commit comments

Comments
 (0)