DynOS fixes

This commit is contained in:
Agent X 2024-06-26 18:50:38 -04:00
parent 565e8b6367
commit 8525a9a2ee
18 changed files with 41 additions and 43 deletions

View file

@ -745,7 +745,7 @@ void PrintError(const char *aFmt, Args... aArgs) {
printf(aFmt, aArgs...);
printf("\r\n");
fflush(stdout);
// PrintConsole(aFmt, CONSOLE_MESSAGE_ERROR, aArgs...);
PrintConsole(CONSOLE_MESSAGE_ERROR, aFmt, aArgs...);
}
#define PrintDataError(...) { \
if (aGfxData->mErrorCount == 0) Print(" ERROR!"); \

View file

@ -165,7 +165,7 @@ void DynOS_Actor_Override(struct Object* obj, void** aSharedChild) {
obj->behavior == smlua_override_behavior(bhvMetalCap) ||
obj->behavior == smlua_override_behavior(bhvVanishCap))) {
struct NetworkPlayer* np = network_player_from_global_index(obj->globalPlayerIndex);
if (np && np->localIndex > 0 && !configGlobalPlayerModels) {
if (np && np->localIndex > 0 && configDynosLocalPlayerModelOnly) {
return;
}
}

View file

@ -451,10 +451,6 @@ void DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName) {
}
}
static inline bool IsPowerOfTwo(s32 n) {
return (n > 0) && ((n & (n - 1)) == 0);
}
bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
#define CONVERT_TEXINFO() { \
/* translate bit size */ \
@ -483,13 +479,6 @@ bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
// texture data is corrupted
if (_RawData == NULL) {
PrintError("Attempted to load corrupted tex file: %s", aTexName);
PrintConsole(CONSOLE_MESSAGE_ERROR, "Attempted to load corrupted tex file: %s", aTexName);
return false;
}
// texture width or height is NPOT
if (!IsPowerOfTwo(_Data->mRawWidth) || !IsPowerOfTwo(_Data->mRawHeight)) {
PrintError("Tex file '%s' has non power of two width or height", aTexName);
PrintConsole(CONSOLE_MESSAGE_WARNING, "Tex file '%s' has non power of two width or height", aTexName);
return false;
}
_Data->mRawFormat = G_IM_FMT_RGBA;

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Výběr souboru"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Pouze lokální model hráče"
LOCAL_PLAYER_MODEL_ONLY = "Pouze lokální model hráče"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Debug Errors"
MISC_TITLE = "JINE"
PAUSE_IN_SINGLEPLAYER = "Pauza v hře s jedním hráčem"
DISABLE_POPUPS = "Vypnout vyskakovací okna"
USE_STANDARD_KEY_BINDINGS_CHAT = "Použij standardní ovládání klávesnice pro chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Klasické ovládání chatu"
MENU_OPTIONS = "Nastavení hlavního menu"
INFORMATION = "Informace"
DEBUG = "Debug"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Bestand selecteren"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Alleen lokaal spelermodel"
LOCAL_PLAYER_MODEL_ONLY = "Alleen lokaal spelermodel"
[HOST_MESSAGE]
INFO_TITLE = "INFORMATIE"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Debug Errors"
MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Pauzeer in een speler"
DISABLE_POPUPS = "Popups uitzetten"
USE_STANDARD_KEY_BINDINGS_CHAT = "Gebruik standaard toetsenbordbediening voor chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Klassieke chatbediening"
MENU_OPTIONS = "Menu Instellingen"
INFORMATION = "Informatie"
DEBUG = "Debug"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "File Select"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Local Player Model Only"
LOCAL_PLAYER_MODEL_ONLY = "Local Player Model Only"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Debug Errors"
MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Pause In Singleplayer"
DISABLE_POPUPS = "Disable Popups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Use Standard Keyboard Controls For Chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Classic Chatbox Controls"
MENU_OPTIONS = "Menu Options"
INFORMATION = "Info"
DEBUG = "Debug"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Sélection de fichier"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Modèle de joueur local seulement"
LOCAL_PLAYER_MODEL_ONLY = "Modèle de joueur local seulement"
[HOST_MESSAGE]
INFO_TITLE = "INFORMATIONS"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Erreurs de Débogage"
MISC_TITLE = "AUTRES"
PAUSE_IN_SINGLEPLAYER = "Pause en Solo"
DISABLE_POPUPS = "Désactiver les Pop-ups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Activer les contrôles clavier standards pour le tchat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Commandes de chat classiques"
MENU_OPTIONS = "Options du menu"
INFORMATION = "Information"
DEBUG = "Débogage"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Dateiauswahl"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Nur lokales Spielermodell"
LOCAL_PLAYER_MODEL_ONLY = "Nur lokales Spielermodell"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Debug Fehler"
MISC_TITLE = "SONSTIGES"
PAUSE_IN_SINGLEPLAYER = "Pause im Einzelspieler"
DISABLE_POPUPS = "Pop-ups deaktivieren"
USE_STANDARD_KEY_BINDINGS_CHAT = "Standard-Tastatursteuerungen für Chat verwenden"
USE_STANDARD_KEY_BINDINGS_CHAT = "Klassische Chat-Steuerung"
MENU_OPTIONS = "Menüoptionen"
INFORMATION = "Information"
DEBUG = "Debug"

View file

@ -159,7 +159,7 @@ FILE_SELECT_THEME = "Selezione file"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Solo modello giocatore locale"
LOCAL_PLAYER_MODEL_ONLY = "Solo modello giocatore locale"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -273,7 +273,7 @@ DEBUG_ERRORS = "Errori di debug"
MISC_TITLE = "VARIE"
PAUSE_IN_SINGLEPLAYER = "Metti in pausa in giocatore singolo"
DISABLE_POPUPS = "Disabilita Popups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usa i controlli standard della tastiera per la chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Controlli della chat classica"
MENU_OPTIONS = "Opzioni Menù"
INFORMATION = "Informazione"
DEBUG = "Debug"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Wybór Pliku"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Tylko lokalny model gracza"
LOCAL_PLAYER_MODEL_ONLY = "Tylko lokalny model gracza"
[HOST_MESSAGE]
INFO_TITLE = "INFORMACJE"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Błędy z Debugowania"
MISC_TITLE = "POZOSTAŁE OPCJE"
PAUSE_IN_SINGLEPLAYER = "Pauza w Trybie Pojedynczego Gracza"
DISABLE_POPUPS = "Wyłącz Dymki Powiadomień"
USE_STANDARD_KEY_BINDINGS_CHAT = "Użyj Standardowych Ustawień Klawiatury dla Czatu"
USE_STANDARD_KEY_BINDINGS_CHAT = "Klasyczne sterowanie czatem"
MENU_OPTIONS = "Opcje Menu"
INFORMATION = "Informacje"
DEBUG = "Debugowanie"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Escolha de arquivo"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Apenas modelo de jogador local"
LOCAL_PLAYER_MODEL_ONLY = "Apenas modelo de jogador local"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Erros debug"
MISC_TITLE = "MAIS"
PAUSE_IN_SINGLEPLAYER = "Pausa com jogador único"
DISABLE_POPUPS = "Desativar popups"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usar controles padrão do teclado para chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Controles clássicos de chat"
MENU_OPTIONS = "Opções de menu"
INFORMATION = "Informação"
DEBUG = "Debug"

View file

@ -160,7 +160,7 @@ FILE_SELECT_THEME = "Выбор файла"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Только локальная модель игрока"
LOCAL_PLAYER_MODEL_ONLY = "Только локальная модель игрока"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -274,7 +274,7 @@ DEBUG_ERRORS = "Ошибки отладки"
MISC_TITLE = "MISC"
PAUSE_IN_SINGLEPLAYER = "Пауза в одиночной игре"
DISABLE_POPUPS = "Отключить всплывающие окна"
USE_STANDARD_KEY_BINDINGS_CHAT = "Использовать стандартные управления клавиатурой для чата"
USE_STANDARD_KEY_BINDINGS_CHAT = "Классическое управление чатом"
MENU_OPTIONS = "Параметры меню"
INFORMATION = "Информация"
DEBUG = "Отладка"

View file

@ -161,7 +161,7 @@ FILE_SELECT_THEME = "Selección de archivo"
[DYNOS]
DYNOS = "DYNOS"
GLOBAL_PLAYER_MODELS = "Solo modelo de jugador local"
LOCAL_PLAYER_MODEL_ONLY = "Solo modelo de jugador local"
[HOST_MESSAGE]
INFO_TITLE = "INFO"
@ -275,7 +275,7 @@ DEBUG_ERRORS = "Errores de Depuración"
MISC_TITLE = "OTROS"
PAUSE_IN_SINGLEPLAYER = "Pausa en modo de un jugador"
DISABLE_POPUPS = "Deshabilitar mensajes emergentes"
USE_STANDARD_KEY_BINDINGS_CHAT = "Usar controles estándar del teclado para chat"
USE_STANDARD_KEY_BINDINGS_CHAT = "Controles de chat clásicos"
MENU_OPTIONS = "Opciones del menú"
INFORMATION = "Información"
DEBUG = "Depuración"

View file

@ -149,7 +149,7 @@ char configPlayerName[MAX_CONFIG_STRING] = "";
unsigned int configPlayerModel = 0;
struct PlayerPalette configPlayerPalette = { { { 0x00, 0x00, 0xff }, { 0xff, 0x00, 0x00 }, { 0xff, 0xff, 0xff }, { 0x72, 0x1c, 0x0e }, { 0x73, 0x06, 0x00 }, { 0xfe, 0xc1, 0x79 }, { 0xff, 0x00, 0x00 }, { 0xff, 0x00, 0x00 } } };
// coop settings
unsigned int configAmountofPlayers = 16;
unsigned int configAmountofPlayers = MAX_PLAYERS;
bool configBubbleDeath = true;
unsigned int configHostPort = DEFAULT_PORT;
unsigned int configHostSaveSlot = 1;
@ -163,12 +163,12 @@ bool configNametags = true;
unsigned int configBouncyLevelBounds = 0;
bool configSkipIntro = 0;
bool configPauseAnywhere = false;
bool configMenuStaffRoll = true;
bool configMenuStaffRoll = false;
unsigned int configMenuLevel = 0;
bool configMenuSound = false;
bool configMenuRandom = false;
bool configMenuDemos = false;
bool configGlobalPlayerModels = true;
bool configDynosLocalPlayerModelOnly = false;
bool configDisablePopups = false;
char configLanguage[MAX_CONFIG_STRING] = "";
// CoopNet settings
@ -292,9 +292,9 @@ static const struct ConfigOption options[] = {
{.name = "coop_menu_sound", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuSound},
{.name = "coop_menu_random", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuRandom},
{.name = "coop_menu_demos", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuDemos},
{.name = "coop_global_player_models", .type = CONFIG_TYPE_BOOL, .boolValue = &configGlobalPlayerModels},
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisablePopups},
{.name = "language", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configLanguage, .maxStringLength = MAX_CONFIG_STRING},
{.name = "dynos_local_player_model_only", .type = CONFIG_TYPE_BOOL, .boolValue = &configDynosLocalPlayerModelOnly},
// CoopNet settings
{.name = "coopnet_ip", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configCoopNetIp, .maxStringLength = MAX_CONFIG_STRING},
{.name = "coopnet_port", .type = CONFIG_TYPE_UINT, .uintValue = &configCoopNetPort},

View file

@ -119,9 +119,9 @@ extern unsigned int configMenuLevel;
extern bool configMenuSound;
extern bool configMenuRandom;
extern bool configMenuDemos;
extern bool configGlobalPlayerModels;
extern bool configDisablePopups;
extern char configLanguage[MAX_CONFIG_STRING];
extern bool configDynosLocalPlayerModelOnly;
// CoopNet settings
extern char configCoopNetIp[MAX_CONFIG_STRING];
extern unsigned int configCoopNetPort;

View file

@ -20,10 +20,10 @@
#include "game/camera.h"
#include "game/hud.h"
#include "game/rendering_graph_node.h"
#include "pc/lua/smlua.h"
#include "engine/math_util.h"
static enum HudUtilsResolution sResolution = RESOLUTION_DJUI;
static enum HudUtilsFilter sFilter = FILTER_NEAREST;
static enum DjuiFontType sFont = FONT_NORMAL;
@ -392,7 +392,16 @@ void djui_hud_print_text_interpolated(const char* message, f32 prevX, f32 prevY,
interp->resolution = sResolution;
}
static inline bool is_power_of_two(u32 n) {
return (n > 0) && ((n & (n - 1)) == 0);
}
void djui_hud_render_texture_raw(const u8* texture, u32 bitSize, u32 width, u32 height, f32 x, f32 y, f32 scaleW, f32 scaleH) {
if (!is_power_of_two(width) || !is_power_of_two(height)) {
LOG_LUA_LINE("Tried to render DJUI HUD texture with NPOT width or height");
return;
}
gDjuiHudUtilsZ += 0.01f;
// translate position

View file

@ -18,9 +18,9 @@ void djui_panel_controls_create(struct DjuiBase* caller) {
{
djui_button_create(body, DLANG(CONTROLS, N64_BINDS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_controls_n64_create);
djui_button_create(body, DLANG(CONTROLS, EXTRA_BINDS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_controls_extra_create);
djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL);
djui_checkbox_create(body, DLANG(CONTROLS, BACKGROUND_GAMEPAD), &configBackgroundGamepad, NULL);
djui_checkbox_create(body, DLANG(CONTROLS, DISABLE_GAMEPADS), &configDisableGamepads, NULL);
djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL);
#ifdef HAVE_SDL2
int numJoys = SDL_NumJoysticks();

View file

@ -15,7 +15,7 @@ static void djui_panel_dynos_apply(struct DjuiBase* caller) {
dynos_pack_set_enabled(caller->tag, caller->bTag);
}
static void djui_panel_dynos_global_player_models(UNUSED struct DjuiBase* caller) {
static void djui_panel_dynos_local_player_model_only(UNUSED struct DjuiBase* caller) {
for (s32 i = 0; i < MAX_PLAYERS; i++) {
network_player_update_model(i);
}
@ -62,7 +62,7 @@ void djui_panel_dynos_create(struct DjuiBase* caller) {
djui_base_set_size(&space->base, 0, 32);
djui_base_set_color(&space->base, 0, 0, 0, 0);
djui_checkbox_create(body, DLANG(DYNOS, GLOBAL_PLAYER_MODELS), &configGlobalPlayerModels, djui_panel_dynos_global_player_models);
djui_checkbox_create(body, DLANG(DYNOS, LOCAL_PLAYER_MODEL_ONLY), &configDynosLocalPlayerModelOnly, djui_panel_dynos_local_player_model_only);
if (gNetworkType == NT_NONE) {
struct DjuiRect* rect1 = djui_rect_container_create(body, 64);
{