mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-24 21:15:12 +00:00
Beta 32.0.1 (#325)
* patch for beta 32 * require the development flag for Lua profiler * autogen
This commit is contained in:
parent
7e1dafaa73
commit
6cb1b2faec
19 changed files with 79 additions and 88 deletions
9
Makefile
9
Makefile
|
@ -21,9 +21,6 @@ DEBUG ?= 0
|
||||||
# Enable development/testing flags
|
# Enable development/testing flags
|
||||||
DEVELOPMENT ?= 0
|
DEVELOPMENT ?= 0
|
||||||
|
|
||||||
# Enable lua profiler
|
|
||||||
LUA_PROFILER ?= 0
|
|
||||||
|
|
||||||
# Build for the N64 (turn this off for ports)
|
# Build for the N64 (turn this off for ports)
|
||||||
TARGET_N64 = 0
|
TARGET_N64 = 0
|
||||||
|
|
||||||
|
@ -1063,12 +1060,6 @@ ifeq ($(TARGET_RPI),1)
|
||||||
CFLAGS += -DTARGET_RPI
|
CFLAGS += -DTARGET_RPI
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Check for lua profiler option
|
|
||||||
ifeq ($(LUA_PROFILER),1)
|
|
||||||
CC_CHECK_CFLAGS += -DLUA_PROFILER
|
|
||||||
CFLAGS += -DLUA_PROFILER
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Check for texture fix option
|
# Check for texture fix option
|
||||||
ifeq ($(TEXTURE_FIX),1)
|
ifeq ($(TEXTURE_FIX),1)
|
||||||
CC_CHECK_CFLAGS += -DTEXTURE_FIX
|
CC_CHECK_CFLAGS += -DTEXTURE_FIX
|
||||||
|
|
|
@ -11506,12 +11506,18 @@ SPTASK_STATE_FINISHED = 3
|
||||||
--- @type SpTaskState
|
--- @type SpTaskState
|
||||||
SPTASK_STATE_FINISHED_DP = 4
|
SPTASK_STATE_FINISHED_DP = 4
|
||||||
|
|
||||||
|
--- @type integer
|
||||||
|
MAX_LOCAL_VERSION_LENGTH = 12
|
||||||
|
|
||||||
--- @type integer
|
--- @type integer
|
||||||
MAX_VERSION_LENGTH = 10
|
MAX_VERSION_LENGTH = 10
|
||||||
|
|
||||||
--- @type integer
|
--- @type integer
|
||||||
MINOR_VERSION_NUMBER = 0
|
MINOR_VERSION_NUMBER = 0
|
||||||
|
|
||||||
|
--- @type integer
|
||||||
|
PATCH_VERSION_NUMBER = 1
|
||||||
|
|
||||||
--- @type integer
|
--- @type integer
|
||||||
VERSION_NUMBER = 32
|
VERSION_NUMBER = 32
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
make DEBUG=1 DEVELOPMENT=1 STRICT=1 PROFILE=1 LUA_PROFILER=1 -j
|
make DEBUG=1 DEVELOPMENT=1 STRICT=1 PROFILE=1 -j
|
||||||
else
|
else
|
||||||
make DEBUG=1 DEVELOPMENT=1 PROFILE=1 LUA_PROFILER=1 -j
|
make DEBUG=1 DEVELOPMENT=1 PROFILE=1 -j
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# find file
|
# find file
|
||||||
|
|
|
@ -4086,8 +4086,10 @@
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
## [version.h](#version.h)
|
## [version.h](#version.h)
|
||||||
|
- MAX_LOCAL_VERSION_LENGTH
|
||||||
- MAX_VERSION_LENGTH
|
- MAX_VERSION_LENGTH
|
||||||
- MINOR_VERSION_NUMBER
|
- MINOR_VERSION_NUMBER
|
||||||
|
- PATCH_VERSION_NUMBER
|
||||||
- VERSION_NUMBER
|
- VERSION_NUMBER
|
||||||
- VERSION_TEXT
|
- VERSION_TEXT
|
||||||
|
|
||||||
|
|
|
@ -674,7 +674,7 @@ void render_hud(void) {
|
||||||
print_text(10, 60, "SURFACE NODE POOL FULL");
|
print_text(10, 60, "SURFACE NODE POOL FULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(LUA_PROFILER)
|
#if defined(DEVELOPMENT)
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
extern void lua_profiler_update_counters();
|
extern void lua_profiler_update_counters();
|
||||||
|
|
|
@ -1117,41 +1117,32 @@ void basic_update(UNUSED s16 *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool find_demo_number(void) {
|
bool find_demo_number(void) {
|
||||||
bool changeLevel = false;
|
|
||||||
switch (gCurrLevelNum) {
|
switch (gCurrLevelNum) {
|
||||||
case LEVEL_BOWSER_1:
|
case LEVEL_BOWSER_1:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 0;
|
demoNumber = 0;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_WF:
|
case LEVEL_WF:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 1;
|
demoNumber = 1;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_CCM:
|
case LEVEL_CCM:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 2;
|
demoNumber = 2;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_BBH:
|
case LEVEL_BBH:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 3;
|
demoNumber = 3;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_JRB:
|
case LEVEL_JRB:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 4;
|
demoNumber = 4;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_HMC:
|
case LEVEL_HMC:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 5;
|
demoNumber = 5;
|
||||||
break;
|
return true;
|
||||||
case LEVEL_PSS:
|
case LEVEL_PSS:
|
||||||
changeLevel = true;
|
|
||||||
demoNumber = 6;
|
demoNumber = 6;
|
||||||
break;
|
return true;
|
||||||
default:
|
default:
|
||||||
changeLevel = false;
|
|
||||||
demoNumber = -1;
|
demoNumber = -1;
|
||||||
}
|
}
|
||||||
return changeLevel;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void start_demo(void) {
|
static void start_demo(void) {
|
||||||
|
@ -1204,8 +1195,7 @@ s32 play_mode_normal(void) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gDjuiInMainMenu && gCurrDemoInput == NULL && configMenuDemos && !inPlayerMenu) {
|
if (gDjuiInMainMenu && gCurrDemoInput == NULL && configMenuDemos && !inPlayerMenu) {
|
||||||
find_demo_number();
|
if ((++gDemoCountdown) == PRESS_START_DEMO_TIMER && (find_demo_number() && (demoNumber <= 6 || demoNumber > -1))) {
|
||||||
if ((++gDemoCountdown) == PRESS_START_DEMO_TIMER && (demoNumber <= 6 || demoNumber > -1)) {
|
|
||||||
start_demo();
|
start_demo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,14 +143,17 @@ bool configUncappedFramerate = true;
|
||||||
unsigned int configFrameLimit = 60;
|
unsigned int configFrameLimit = 60;
|
||||||
unsigned int configDrawDistance = 5;
|
unsigned int configDrawDistance = 5;
|
||||||
bool configDisablePopups = 0;
|
bool configDisablePopups = 0;
|
||||||
#ifdef LUA_PROFILER
|
#if defined(DEVELOPMENT)
|
||||||
bool configLuaProfiler = 1;
|
bool configLuaProfiler = 0;
|
||||||
#endif
|
#endif
|
||||||
bool configDisableDownloadedModels = 0;
|
bool configDisableDownloadedModels = 0;
|
||||||
unsigned int configInterpolationMode = 1;
|
unsigned int configInterpolationMode = 1;
|
||||||
unsigned int configGamepadNumber = 0;
|
unsigned int configGamepadNumber = 0;
|
||||||
bool configBackgroundGamepad = 1;
|
bool configBackgroundGamepad = 1;
|
||||||
bool configSingleplayerPause = 0;
|
bool configSingleplayerPause = 0;
|
||||||
|
bool configDebugPrint = 0;
|
||||||
|
bool configDebugInfo = 0;
|
||||||
|
bool configDebugError = 0;
|
||||||
|
|
||||||
static const struct ConfigOption options[] = {
|
static const struct ConfigOption options[] = {
|
||||||
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
||||||
|
@ -248,13 +251,16 @@ static const struct ConfigOption options[] = {
|
||||||
{.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause},
|
{.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause},
|
||||||
{.name = "share_lives", .type = CONFIG_TYPE_BOOL , .boolValue = &configShareLives},
|
{.name = "share_lives", .type = CONFIG_TYPE_BOOL , .boolValue = &configShareLives},
|
||||||
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
|
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
|
||||||
#ifdef LUA_PROFILER
|
#if defined(DEVELOPMENT)
|
||||||
{.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler},
|
{.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler},
|
||||||
#endif
|
#endif
|
||||||
{.name = "disable_downloaded_models", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisableDownloadedModels},
|
{.name = "disable_downloaded_models", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisableDownloadedModels},
|
||||||
{.name = "interpolation_mode", .type = CONFIG_TYPE_UINT , .uintValue = &configInterpolationMode},
|
{.name = "interpolation_mode", .type = CONFIG_TYPE_UINT , .uintValue = &configInterpolationMode},
|
||||||
{.name = "gamepad_number", .type = CONFIG_TYPE_UINT , .uintValue = &configGamepadNumber},
|
{.name = "gamepad_number", .type = CONFIG_TYPE_UINT , .uintValue = &configGamepadNumber},
|
||||||
{.name = "background_gamepad", .type = CONFIG_TYPE_UINT , .boolValue = &configBackgroundGamepad}
|
{.name = "background_gamepad", .type = CONFIG_TYPE_UINT , .boolValue = &configBackgroundGamepad},
|
||||||
|
{.name = "debug_print", .type = CONFIG_TYPE_BOOL , .boolValue = &configDebugPrint},
|
||||||
|
{.name = "debug_info", .type = CONFIG_TYPE_BOOL , .boolValue = &configDebugInfo},
|
||||||
|
{.name = "debug_error", .type = CONFIG_TYPE_BOOL , .boolValue = &configDebugError},
|
||||||
};
|
};
|
||||||
|
|
||||||
// FunctionConfigOption functions
|
// FunctionConfigOption functions
|
||||||
|
|
|
@ -100,12 +100,15 @@ extern bool configUncappedFramerate;
|
||||||
extern unsigned int configFrameLimit;
|
extern unsigned int configFrameLimit;
|
||||||
extern unsigned int configDrawDistance;
|
extern unsigned int configDrawDistance;
|
||||||
extern bool configDisablePopups;
|
extern bool configDisablePopups;
|
||||||
#ifdef LUA_PROFILER
|
#if defined(DEVELOPMENT)
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
#endif
|
#endif
|
||||||
extern bool configDisableDownloadedModels;
|
extern bool configDisableDownloadedModels;
|
||||||
extern unsigned int configInterpolationMode;
|
extern unsigned int configInterpolationMode;
|
||||||
extern bool configSingleplayerPause;
|
extern bool configSingleplayerPause;
|
||||||
|
extern bool configDebugPrint;
|
||||||
|
extern bool configDebugInfo;
|
||||||
|
extern bool configDebugError;
|
||||||
|
|
||||||
void configfile_load(const char *filename);
|
void configfile_load(const char *filename);
|
||||||
void configfile_save(const char *filename);
|
void configfile_save(const char *filename);
|
||||||
|
|
|
@ -490,7 +490,7 @@ static CRASH_HANDLER_TYPE crash_handler(EXCEPTION_POINTERS *ExceptionInfo) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
crash_handler_add_info_str(&pText, 335, 208, "Version", get_version());
|
crash_handler_add_info_str(&pText, 335, 208, "Version", get_version_local());
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
|
|
|
@ -42,18 +42,8 @@ static void _debuglog_print_log(char* logType, char* filename) {
|
||||||
_debuglog_print_short_filename(filename);
|
_debuglog_print_short_filename(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DEBUG) && defined(DISABLE_MODULE_LOG)
|
#define LOG_DEBUG(...) if (configDebugPrint) { ( _debuglog_print_log("DEBUG", __FILE__), printf(__VA_ARGS__), printf("\n") ); }
|
||||||
#define LOG_DEBUG(...)
|
#define LOG_INFO(...) if (configDebugInfo) { ( _debuglog_print_log("INFO", __FILE__), printf(__VA_ARGS__), printf("\n") ); }
|
||||||
#define LOG_INFO(...)
|
#define LOG_ERROR(...) if (configDebugError) { ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") ); }
|
||||||
#define LOG_ERROR(...) ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
|
||||||
#elif defined(DEBUG) && !defined(DISABLE_MODULE_LOG)
|
|
||||||
#define LOG_DEBUG(...) ( _debuglog_print_log("DEBUG", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
|
||||||
#define LOG_INFO(...) ( _debuglog_print_log("INFO", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
|
||||||
#define LOG_ERROR(...) ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
|
||||||
#else
|
|
||||||
#define LOG_DEBUG(...)
|
|
||||||
#define LOG_INFO(...)
|
|
||||||
#define LOG_ERROR(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -47,7 +47,7 @@ void djui_panel_main_create(struct DjuiBase* caller) {
|
||||||
djui_interactable_hook_click(&button4->base, djui_panel_main_quit);
|
djui_interactable_hook_click(&button4->base, djui_panel_main_quit);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* version = get_version();
|
char* version = get_version_local();
|
||||||
struct DjuiText* footer = djui_text_create(&panel->base, version);
|
struct DjuiText* footer = djui_text_create(&panel->base, version);
|
||||||
djui_base_set_size_type(&footer->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
djui_base_set_size_type(&footer->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
djui_base_set_size(&footer->base, 1.0f, 1.0f);
|
djui_base_set_size(&footer->base, 1.0f, 1.0f);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#ifdef DEVELOPMENT
|
#ifdef DEVELOPMENT
|
||||||
void djui_panel_options_debug_create(struct DjuiBase* caller) {
|
void djui_panel_options_debug_create(struct DjuiBase* caller) {
|
||||||
f32 bodyHeight = 32 * 3 + 64 * 1 + 16 * 1;
|
f32 bodyHeight = 32 * 7 + 64 * 1 + 16 * 1;
|
||||||
|
|
||||||
struct DjuiBase* defaultBase = NULL;
|
struct DjuiBase* defaultBase = NULL;
|
||||||
struct DjuiThreePanel* panel = djui_panel_menu_create(bodyHeight, "\\#ff0800\\D\\#1be700\\E\\#00b3ff\\B\\#ffef00\\U\\#ff0800\\G");
|
struct DjuiThreePanel* panel = djui_panel_menu_create(bodyHeight, "\\#ff0800\\D\\#1be700\\E\\#00b3ff\\B\\#ffef00\\U\\#ff0800\\G");
|
||||||
|
@ -17,12 +17,25 @@ void djui_panel_options_debug_create(struct DjuiBase* caller) {
|
||||||
djui_base_set_size(&checkbox1->base, 1.0f, 32);
|
djui_base_set_size(&checkbox1->base, 1.0f, 32);
|
||||||
defaultBase = &checkbox1->base;
|
defaultBase = &checkbox1->base;
|
||||||
|
|
||||||
#ifdef LUA_PROFILER
|
|
||||||
struct DjuiCheckbox* checkbox2 = djui_checkbox_create(&body->base, "Lua Profiler", &configLuaProfiler);
|
struct DjuiCheckbox* checkbox2 = djui_checkbox_create(&body->base, "Lua Profiler", &configLuaProfiler);
|
||||||
djui_base_set_size_type(&checkbox2->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
djui_base_set_size_type(&checkbox2->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
djui_base_set_size(&checkbox2->base, 1.0f, 32);
|
djui_base_set_size(&checkbox2->base, 1.0f, 32);
|
||||||
defaultBase = &checkbox2->base;
|
defaultBase = &checkbox2->base;
|
||||||
#endif
|
|
||||||
|
struct DjuiCheckbox* checkbox3 = djui_checkbox_create(&body->base, "Debug Print", &configDebugPrint);
|
||||||
|
djui_base_set_size_type(&checkbox3->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
|
djui_base_set_size(&checkbox3->base, 1.0f, 32);
|
||||||
|
defaultBase = &checkbox3->base;
|
||||||
|
|
||||||
|
struct DjuiCheckbox* checkbox4 = djui_checkbox_create(&body->base, "Debug Info", &configDebugInfo);
|
||||||
|
djui_base_set_size_type(&checkbox4->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
|
djui_base_set_size(&checkbox4->base, 1.0f, 32);
|
||||||
|
defaultBase = &checkbox4->base;
|
||||||
|
|
||||||
|
struct DjuiCheckbox* checkbox5 = djui_checkbox_create(&body->base, "Debug Errors", &configDebugError);
|
||||||
|
djui_base_set_size_type(&checkbox5->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
|
djui_base_set_size(&checkbox5->base, 1.0f, 32);
|
||||||
|
defaultBase = &checkbox5->base;
|
||||||
|
|
||||||
struct DjuiButton* button1 = djui_button_create(&body->base, "Back");
|
struct DjuiButton* button1 = djui_button_create(&body->base, "Back");
|
||||||
djui_base_set_size_type(&button1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
djui_base_set_size_type(&button1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||||
|
|
|
@ -132,7 +132,7 @@ void smlua_init(void) {
|
||||||
// load libraries
|
// load libraries
|
||||||
luaopen_base(L);
|
luaopen_base(L);
|
||||||
//luaopen_coroutine(L);
|
//luaopen_coroutine(L);
|
||||||
#if defined(LUA_PROFILER)
|
#if defined(DEVELOPMENT)
|
||||||
luaL_requiref(L, "debug", luaopen_debug, 1);
|
luaL_requiref(L, "debug", luaopen_debug, 1);
|
||||||
luaL_requiref(L, "io", luaopen_io, 1);
|
luaL_requiref(L, "io", luaopen_io, 1);
|
||||||
luaL_requiref(L, "os", luaopen_os, 1);
|
luaL_requiref(L, "os", luaopen_os, 1);
|
||||||
|
|
|
@ -10,7 +10,6 @@ char gSmluaConstants[] = ""
|
||||||
" return a['_pointer'] == b['_pointer'] and a['_lot'] == b['_lot'] and a['_pointer'] ~= nil and a['_lot'] ~= nil\n"
|
" return a['_pointer'] == b['_pointer'] and a['_lot'] == b['_lot'] and a['_pointer'] ~= nil and a['_lot'] ~= nil\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
|
||||||
"_CPointer = {\n"
|
"_CPointer = {\n"
|
||||||
" __index = function (t,k)\n"
|
" __index = function (t,k)\n"
|
||||||
" return nil\n"
|
" return nil\n"
|
||||||
|
@ -24,7 +23,6 @@ char gSmluaConstants[] = ""
|
||||||
" return a['_pointer'] == b['_pointer'] and a['_pointer'] ~= nil and a['_lvt'] ~= nil\n"
|
" return a['_pointer'] == b['_pointer'] and a['_pointer'] ~= nil and a['_lvt'] ~= nil\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
|
||||||
"_SyncTable = {\n"
|
"_SyncTable = {\n"
|
||||||
" __index = function (t,k)\n"
|
" __index = function (t,k)\n"
|
||||||
" local _table = rawget(t, '_table')\n"
|
" local _table = rawget(t, '_table')\n"
|
||||||
|
@ -36,7 +34,6 @@ char gSmluaConstants[] = ""
|
||||||
" _set_sync_table_field(t, k, v)\n"
|
" _set_sync_table_field(t, k, v)\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
|
||||||
"_ReadOnlyTable = {\n"
|
"_ReadOnlyTable = {\n"
|
||||||
" __index = function (t,k)\n"
|
" __index = function (t,k)\n"
|
||||||
" local _table = rawget(t, '_table')\n"
|
" local _table = rawget(t, '_table')\n"
|
||||||
|
@ -45,7 +42,6 @@ char gSmluaConstants[] = ""
|
||||||
" __newindex = function (t,k,v)\n"
|
" __newindex = function (t,k,v)\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @param src Vec3f\n"
|
"--- @param src Vec3f\n"
|
||||||
"--- @return Vec3f\n"
|
"--- @return Vec3f\n"
|
||||||
|
@ -55,7 +51,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = src.z\n"
|
" dest.z = src.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @param x number\n"
|
"--- @param x number\n"
|
||||||
"--- @param y number\n"
|
"--- @param y number\n"
|
||||||
|
@ -67,7 +62,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = z\n"
|
" dest.z = z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @param a Vec3f\n"
|
"--- @param a Vec3f\n"
|
||||||
"--- @return Vec3f\n"
|
"--- @return Vec3f\n"
|
||||||
|
@ -77,7 +71,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = dest.z + a.z\n"
|
" dest.z = dest.z + a.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @param a Vec3f\n"
|
"--- @param a Vec3f\n"
|
||||||
"--- @param b Vec3f\n"
|
"--- @param b Vec3f\n"
|
||||||
|
@ -88,7 +81,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = a.z + b.z\n"
|
" dest.z = a.z + b.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @param a number\n"
|
"--- @param a number\n"
|
||||||
"--- @return Vec3f\n"
|
"--- @return Vec3f\n"
|
||||||
|
@ -98,7 +90,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = dest.z * a\n"
|
" dest.z = dest.z * a\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3f\n"
|
"--- @param dest Vec3f\n"
|
||||||
"--- @return Vec3f\n"
|
"--- @return Vec3f\n"
|
||||||
"function vec3f_normalize(dest)\n"
|
"function vec3f_normalize(dest)\n"
|
||||||
|
@ -106,28 +97,23 @@ char gSmluaConstants[] = ""
|
||||||
" if divisor == 0 then\n"
|
" if divisor == 0 then\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"\n"
|
|
||||||
" local invsqrt = 1.0 / divisor\n"
|
" local invsqrt = 1.0 / divisor\n"
|
||||||
" dest.x = dest.x * invsqrt\n"
|
" dest.x = dest.x * invsqrt\n"
|
||||||
" dest.y = dest.y * invsqrt\n"
|
" dest.y = dest.y * invsqrt\n"
|
||||||
" dest.z = dest.z * invsqrt\n"
|
" dest.z = dest.z * invsqrt\n"
|
||||||
"\n"
|
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param a Vec3f\n"
|
"--- @param a Vec3f\n"
|
||||||
"--- @return number\n"
|
"--- @return number\n"
|
||||||
"function vec3f_length(a)\n"
|
"function vec3f_length(a)\n"
|
||||||
" return math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z)\n"
|
" return math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z)\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param a Vec3f\n"
|
"--- @param a Vec3f\n"
|
||||||
"--- @param b Vec3f\n"
|
"--- @param b Vec3f\n"
|
||||||
"--- @return number\n"
|
"--- @return number\n"
|
||||||
"function vec3f_dot(a, b)\n"
|
"function vec3f_dot(a, b)\n"
|
||||||
" return a.x * b.x + a.y * b.y + a.z * b.z\n"
|
" return a.x * b.x + a.y * b.y + a.z * b.z\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param vec Vec3f\n"
|
"--- @param vec Vec3f\n"
|
||||||
"--- @param onto Vec3f\n"
|
"--- @param onto Vec3f\n"
|
||||||
"--- @return Vec3f\n"
|
"--- @return Vec3f\n"
|
||||||
|
@ -139,7 +125,6 @@ char gSmluaConstants[] = ""
|
||||||
" vec3f_mul(out, numerator / denominator)\n"
|
" vec3f_mul(out, numerator / denominator)\n"
|
||||||
" return out\n"
|
" return out\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param v1 Vec3f\n"
|
"--- @param v1 Vec3f\n"
|
||||||
"--- @param v2 Vec3f\n"
|
"--- @param v2 Vec3f\n"
|
||||||
"--- @return number\n"
|
"--- @return number\n"
|
||||||
|
@ -149,7 +134,6 @@ char gSmluaConstants[] = ""
|
||||||
" dz = v1.z - v2.z\n"
|
" dz = v1.z - v2.z\n"
|
||||||
" return math.sqrt(dx * dx + dy * dy + dz * dz)\n"
|
" return math.sqrt(dx * dx + dy * dy + dz * dz)\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3s\n"
|
"--- @param dest Vec3s\n"
|
||||||
"--- @param src Vec3s\n"
|
"--- @param src Vec3s\n"
|
||||||
"--- @return Vec3s\n"
|
"--- @return Vec3s\n"
|
||||||
|
@ -159,7 +143,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = src.z\n"
|
" dest.z = src.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3s\n"
|
"--- @param dest Vec3s\n"
|
||||||
"--- @param x number\n"
|
"--- @param x number\n"
|
||||||
"--- @param y number\n"
|
"--- @param y number\n"
|
||||||
|
@ -171,7 +154,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = z\n"
|
" dest.z = z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3s\n"
|
"--- @param dest Vec3s\n"
|
||||||
"--- @param a Vec3s\n"
|
"--- @param a Vec3s\n"
|
||||||
"--- @return Vec3s\n"
|
"--- @return Vec3s\n"
|
||||||
|
@ -181,7 +163,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = dest.z + a.z\n"
|
" dest.z = dest.z + a.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3s\n"
|
"--- @param dest Vec3s\n"
|
||||||
"--- @param a Vec3s\n"
|
"--- @param a Vec3s\n"
|
||||||
"--- @param b Vec3s\n"
|
"--- @param b Vec3s\n"
|
||||||
|
@ -192,7 +173,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = a.z + b.z\n"
|
" dest.z = a.z + b.z\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param dest Vec3s\n"
|
"--- @param dest Vec3s\n"
|
||||||
"--- @param a number\n"
|
"--- @param a number\n"
|
||||||
"--- @return Vec3s\n"
|
"--- @return Vec3s\n"
|
||||||
|
@ -202,7 +182,6 @@ char gSmluaConstants[] = ""
|
||||||
" dest.z = dest.z * a\n"
|
" dest.z = dest.z * a\n"
|
||||||
" return dest\n"
|
" return dest\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param v1 Vec3s\n"
|
"--- @param v1 Vec3s\n"
|
||||||
"--- @param v2 Vec3s\n"
|
"--- @param v2 Vec3s\n"
|
||||||
"--- @return number\n"
|
"--- @return number\n"
|
||||||
|
@ -212,7 +191,6 @@ char gSmluaConstants[] = ""
|
||||||
" dz = v1.z - v2.z\n"
|
" dz = v1.z - v2.z\n"
|
||||||
" return math.sqrt(dx * dx + dy * dy + dz * dz)\n"
|
" return math.sqrt(dx * dx + dy * dy + dz * dz)\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param current number\n"
|
"--- @param current number\n"
|
||||||
"--- @param target number\n"
|
"--- @param target number\n"
|
||||||
"--- @param inc number\n"
|
"--- @param inc number\n"
|
||||||
|
@ -232,7 +210,6 @@ char gSmluaConstants[] = ""
|
||||||
" end\n"
|
" end\n"
|
||||||
" return current;\n"
|
" return current;\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param current number\n"
|
"--- @param current number\n"
|
||||||
"--- @param target number\n"
|
"--- @param target number\n"
|
||||||
"--- @param inc number\n"
|
"--- @param inc number\n"
|
||||||
|
@ -250,7 +227,6 @@ char gSmluaConstants[] = ""
|
||||||
" current = target\n"
|
" current = target\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"\n"
|
|
||||||
" -- keep within 32 bits\n"
|
" -- keep within 32 bits\n"
|
||||||
" if current > 2147483647 then\n"
|
" if current > 2147483647 then\n"
|
||||||
" current = -2147483648 + (current - 2147483647)\n"
|
" current = -2147483648 + (current - 2147483647)\n"
|
||||||
|
@ -259,7 +235,6 @@ char gSmluaConstants[] = ""
|
||||||
" end\n"
|
" end\n"
|
||||||
" return current;\n"
|
" return current;\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"--- @param bank number\n"
|
"--- @param bank number\n"
|
||||||
"--- @param soundID number\n"
|
"--- @param soundID number\n"
|
||||||
"--- @param priority number\n"
|
"--- @param priority number\n"
|
||||||
|
@ -269,11 +244,9 @@ char gSmluaConstants[] = ""
|
||||||
" if flags == nil then flags = 0 end\n"
|
" if flags == nil then flags = 0 end\n"
|
||||||
" return (bank << 28) | (soundID << 16) | (priority << 8) | flags | SOUND_STATUS_WAITING\n"
|
" return (bank << 28) | (soundID << 16) | (priority << 8) | flags | SOUND_STATUS_WAITING\n"
|
||||||
"end\n"
|
"end\n"
|
||||||
"\n"
|
|
||||||
"-------------\n"
|
"-------------\n"
|
||||||
"-- courses --\n"
|
"-- courses --\n"
|
||||||
"-------------\n"
|
"-------------\n"
|
||||||
"\n"
|
|
||||||
"--- @type integer\n"
|
"--- @type integer\n"
|
||||||
"COURSE_NONE = 0\n"
|
"COURSE_NONE = 0\n"
|
||||||
"--- @type integer\n"
|
"--- @type integer\n"
|
||||||
|
@ -4041,5 +4014,7 @@ char gSmluaConstants[] = ""
|
||||||
"VERSION_TEXT = 'beta'\n"
|
"VERSION_TEXT = 'beta'\n"
|
||||||
"VERSION_NUMBER = 32\n"
|
"VERSION_NUMBER = 32\n"
|
||||||
"MINOR_VERSION_NUMBER = 0\n"
|
"MINOR_VERSION_NUMBER = 0\n"
|
||||||
|
"PATCH_VERSION_NUMBER = 1\n"
|
||||||
"MAX_VERSION_LENGTH = 10\n"
|
"MAX_VERSION_LENGTH = 10\n"
|
||||||
|
"MAX_LOCAL_VERSION_LENGTH = 12\n"
|
||||||
;
|
;
|
|
@ -5,7 +5,7 @@
|
||||||
#include "pc/djui/djui_chat_message.h"
|
#include "pc/djui/djui_chat_message.h"
|
||||||
#include "pc/crash_handler.h"
|
#include "pc/crash_handler.h"
|
||||||
|
|
||||||
#if defined(LUA_PROFILER)
|
#if defined(DEVELOPMENT)
|
||||||
#include "../mods/mods.h"
|
#include "../mods/mods.h"
|
||||||
#include "game/print.h"
|
#include "game/print.h"
|
||||||
#include "gfx_dimensions.h"
|
#include "gfx_dimensions.h"
|
||||||
|
@ -70,6 +70,7 @@ void lua_profiler_update_counters() {
|
||||||
print_text(GFX_DIMENSIONS_FROM_LEFT_EDGE(4), y, text);
|
print_text(GFX_DIMENSIONS_FROM_LEFT_EDGE(4), y, text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_HOOKED_REFERENCES 64
|
#define MAX_HOOKED_REFERENCES 64
|
||||||
|
@ -89,14 +90,14 @@ int smlua_call_hook(lua_State* L, int nargs, int nresults, int errfunc, struct M
|
||||||
struct Mod* prev = gLuaActiveMod;
|
struct Mod* prev = gLuaActiveMod;
|
||||||
gLuaActiveMod = activeMod;
|
gLuaActiveMod = activeMod;
|
||||||
gLuaLastHookMod = activeMod;
|
gLuaLastHookMod = activeMod;
|
||||||
#if defined(LUA_PROFILER)
|
#if defined(DEVELOPMENT)
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
lua_profiler_start_counter(activeMod);
|
lua_profiler_start_counter(activeMod);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int rc = smlua_pcall(L, nargs, nresults, errfunc);
|
int rc = smlua_pcall(L, nargs, nresults, errfunc);
|
||||||
#if defined(LUA_PROFILER)
|
#if defined(DEVELOPMENT)
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
lua_profiler_stop_counter(activeMod);
|
lua_profiler_stop_counter(activeMod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -436,10 +436,15 @@ bool mod_load(struct Mods* mods, char* basePath, char* modName) {
|
||||||
valid = true;
|
valid = true;
|
||||||
} else if (is_directory(fullPath)) {
|
} else if (is_directory(fullPath)) {
|
||||||
char tmpPath[SYS_MAX_PATH] = { 0 };
|
char tmpPath[SYS_MAX_PATH] = { 0 };
|
||||||
|
char path1[SYS_MAX_PATH] = { 0 };
|
||||||
|
char path2[SYS_MAX_PATH] = { 0 };
|
||||||
if (!concat_path(tmpPath, fullPath, "main.lua")) {
|
if (!concat_path(tmpPath, fullPath, "main.lua")) {
|
||||||
LOG_ERROR("Failed to concat path '%s' + '%s'", fullPath, "main.lua");
|
LOG_ERROR("Failed to concat path '%s' + '%s'", fullPath, "main.lua");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if ((concat_path(path1, fullPath, "c-update.lua") && path_exists(path1)) || (concat_path(path2, fullPath, "m-update.lua") && path_exists(path2))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
valid = path_exists(tmpPath);
|
valid = path_exists(tmpPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,14 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
|
static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
|
||||||
|
static char sLocalVersionString[MAX_VERSION_LENGTH] = { 0 };
|
||||||
|
|
||||||
char* get_version(void) {
|
char* get_version(void) {
|
||||||
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER);
|
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER);
|
||||||
return sVersionString;
|
return sVersionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* get_version_local(void) {
|
||||||
|
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER);
|
||||||
|
return sLocalVersionString;
|
||||||
|
}
|
||||||
|
|
|
@ -4,8 +4,11 @@
|
||||||
#define VERSION_TEXT "beta"
|
#define VERSION_TEXT "beta"
|
||||||
#define VERSION_NUMBER 32
|
#define VERSION_NUMBER 32
|
||||||
#define MINOR_VERSION_NUMBER 0
|
#define MINOR_VERSION_NUMBER 0
|
||||||
|
#define PATCH_VERSION_NUMBER 1
|
||||||
|
|
||||||
#define MAX_VERSION_LENGTH 10
|
#define MAX_VERSION_LENGTH 10
|
||||||
|
#define MAX_LOCAL_VERSION_LENGTH 12
|
||||||
char* get_version(void);
|
char* get_version(void);
|
||||||
|
char* get_version_local(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -329,7 +329,7 @@ void main_func(void) {
|
||||||
#error No rendering API!
|
#error No rendering API!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char* version = get_version();
|
char* version = get_version_local();
|
||||||
char window_title[96] = { 0 };
|
char window_title[96] = { 0 };
|
||||||
#ifdef GIT_HASH
|
#ifdef GIT_HASH
|
||||||
snprintf(window_title, 96, "sm64ex-coop: %s [%s]", version, GIT_HASH);
|
snprintf(window_title, 96, "sm64ex-coop: %s [%s]", version, GIT_HASH);
|
||||||
|
|
Loading…
Reference in a new issue