mirror of https://github.com/sm64pc/sm64pc.git
Add wireframe mode, CC refresh button, quicksand disabled on Godmode
This commit is contained in:
parent
5fe22cf50d
commit
8534991688
|
@ -8,6 +8,7 @@
|
||||||
#include "game_init.h"
|
#include "game_init.h"
|
||||||
#include "interaction.h"
|
#include "interaction.h"
|
||||||
#include "mario_step.h"
|
#include "mario_step.h"
|
||||||
|
#include "moon/saturn/saturn_types.h"
|
||||||
|
|
||||||
static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 };
|
static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 };
|
||||||
|
|
||||||
|
@ -127,6 +128,7 @@ u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
|
||||||
|
|
||||||
case SURFACE_QUICKSAND:
|
case SURFACE_QUICKSAND:
|
||||||
case SURFACE_MOVING_QUICKSAND:
|
case SURFACE_MOVING_QUICKSAND:
|
||||||
|
if (enable_god) break;
|
||||||
if ((m->quicksandDepth += sinkingSpeed) >= 60.0f) {
|
if ((m->quicksandDepth += sinkingSpeed) >= 60.0f) {
|
||||||
m->quicksandDepth = 60.0f;
|
m->quicksandDepth = 60.0f;
|
||||||
}
|
}
|
||||||
|
@ -134,6 +136,7 @@ u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
|
||||||
|
|
||||||
case SURFACE_DEEP_QUICKSAND:
|
case SURFACE_DEEP_QUICKSAND:
|
||||||
case SURFACE_DEEP_MOVING_QUICKSAND:
|
case SURFACE_DEEP_MOVING_QUICKSAND:
|
||||||
|
if (enable_god) break;
|
||||||
if ((m->quicksandDepth += sinkingSpeed) >= 160.0f) {
|
if ((m->quicksandDepth += sinkingSpeed) >= 160.0f) {
|
||||||
update_mario_sound_and_camera(m);
|
update_mario_sound_and_camera(m);
|
||||||
return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0);
|
return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0);
|
||||||
|
@ -142,6 +145,7 @@ u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
|
||||||
|
|
||||||
case SURFACE_INSTANT_QUICKSAND:
|
case SURFACE_INSTANT_QUICKSAND:
|
||||||
case SURFACE_INSTANT_MOVING_QUICKSAND:
|
case SURFACE_INSTANT_MOVING_QUICKSAND:
|
||||||
|
if (enable_god) break;
|
||||||
update_mario_sound_and_camera(m);
|
update_mario_sound_and_camera(m);
|
||||||
return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0);
|
return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -398,7 +398,7 @@ namespace MoonInternal {
|
||||||
if (ImGui::BeginMenu("Tools")) {
|
if (ImGui::BeginMenu("Tools")) {
|
||||||
ImGui::MenuItem("Toggle View (F1)", NULL, &show_menu_bar);
|
ImGui::MenuItem("Toggle View (F1)", NULL, &show_menu_bar);
|
||||||
ImGui::MenuItem("Jabo Mode", NULL, &configImGui.jaboMode);
|
ImGui::MenuItem("Jabo Mode", NULL, &configImGui.jaboMode);
|
||||||
//ImGui::MenuItem("Night Mode", NULL, &enable_night_skybox);
|
ImGui::MenuItem("Wireframe Mode", NULL, &configImGui.wireframeMode);
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("View")) {
|
if (ImGui::BeginMenu("View")) {
|
||||||
|
@ -601,12 +601,13 @@ namespace MoonInternal {
|
||||||
ImGui::Checkbox("Infinite Lives", &Cheats.InfiniteLives);
|
ImGui::Checkbox("Infinite Lives", &Cheats.InfiniteLives);
|
||||||
ImGui::Checkbox("Moon Jump", &Cheats.MoonJump); ImGui::SameLine(); HelpMarker(
|
ImGui::Checkbox("Moon Jump", &Cheats.MoonJump); ImGui::SameLine(); HelpMarker(
|
||||||
"Hold L in mid-air to Moon Jump!");
|
"Hold L in mid-air to Moon Jump!");
|
||||||
ImGui::Checkbox("Responsive Controls", &Cheats.Responsive);
|
|
||||||
ImGui::Checkbox("Super Speed", &Cheats.SuperSpeed);
|
|
||||||
ImGui::Checkbox("Custom Mario Scale", &Cheats.ScaleMario);
|
ImGui::Checkbox("Custom Mario Scale", &Cheats.ScaleMario);
|
||||||
if (Cheats.ScaleMario) {
|
if (Cheats.ScaleMario) {
|
||||||
ImGui::SliderFloat("Scale ###mario_scale", &mario_scale_size, 0.2f, 5.0f);
|
ImGui::SliderFloat("Scale ###mario_scale", &mario_scale_size, 0.2f, 5.0f);
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
}
|
}
|
||||||
|
ImGui::Checkbox("Responsive Controls", &Cheats.Responsive);
|
||||||
|
ImGui::Checkbox("Super Speed", &Cheats.SuperSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -664,6 +665,10 @@ namespace MoonInternal {
|
||||||
load_cc_file(cc_array[configColorCode]);
|
load_cc_file(cc_array[configColorCode]);
|
||||||
apply_editor_from_cc();
|
apply_editor_from_cc();
|
||||||
}
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button( ICON_MD_REFRESH "###refresh_cc_array")) {
|
||||||
|
MoonInternal::load_cc_directory();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, 10));
|
ImGui::Dummy(ImVec2(0, 10));
|
||||||
|
|
||||||
|
@ -1046,6 +1051,7 @@ namespace MoonInternal {
|
||||||
ImGui::Text("Texture Filtering");
|
ImGui::Text("Texture Filtering");
|
||||||
const char* texture_filters[] = { "Nearest", "Linear", "Three-point" };
|
const char* texture_filters[] = { "Nearest", "Linear", "Three-point" };
|
||||||
ImGui::Combo("###texture_filters", (int*)&configFiltering, texture_filters, IM_ARRAYSIZE(texture_filters));
|
ImGui::Combo("###texture_filters", (int*)&configFiltering, texture_filters, IM_ARRAYSIZE(texture_filters));
|
||||||
|
ImGui::Checkbox("Wireframe Mode", &configImGui.wireframeMode);
|
||||||
}
|
}
|
||||||
if (ImGui::CollapsingHeader("Audio")) {
|
if (ImGui::CollapsingHeader("Audio")) {
|
||||||
ImGui::Text("Volume");
|
ImGui::Text("Volume");
|
||||||
|
|
|
@ -73,7 +73,11 @@ void saturn_emblem_swap() {
|
||||||
if (custom_emblem_name != "default") {
|
if (custom_emblem_name != "default") {
|
||||||
(*hookTexture) = const_cast<char*>(custom_emblem_name.c_str());
|
(*hookTexture) = const_cast<char*>(custom_emblem_name.c_str());
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
(*hookTexture) = const_cast<char*>("actors/mario/mario_logo.rgba16");
|
||||||
|
#else
|
||||||
(*hookTexture) = const_cast<char*>(texName.c_str());
|
(*hookTexture) = const_cast<char*>(texName.c_str());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
|
|
|
@ -62,7 +62,8 @@ ImGuiConfig configImGui = {
|
||||||
.s_machinima = true,
|
.s_machinima = true,
|
||||||
.s_appearance = true,
|
.s_appearance = true,
|
||||||
.s_options = false,
|
.s_options = false,
|
||||||
.jaboMode = false
|
.jaboMode = false,
|
||||||
|
.wireframeMode = false
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int configLanguage = 0;
|
unsigned int configLanguage = 0;
|
||||||
|
@ -141,6 +142,7 @@ static const struct ConfigOption options[] = {
|
||||||
{.name = "vsync", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.vsync},
|
{.name = "vsync", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.vsync},
|
||||||
{.name = "texture_filtering", .type = CONFIG_TYPE_UINT, .uintValue = &configFiltering},
|
{.name = "texture_filtering", .type = CONFIG_TYPE_UINT, .uintValue = &configFiltering},
|
||||||
{.name = "jaboMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.jaboMode},
|
{.name = "jaboMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.jaboMode},
|
||||||
|
{.name = "wireframeMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.wireframeMode},
|
||||||
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
||||||
{.name = "master_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMasterVolume},
|
{.name = "master_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMasterVolume},
|
||||||
{.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume},
|
{.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume},
|
||||||
|
|
|
@ -29,6 +29,7 @@ typedef struct {
|
||||||
bool s_options;
|
bool s_options;
|
||||||
bool texture_debug;
|
bool texture_debug;
|
||||||
bool jaboMode;
|
bool jaboMode;
|
||||||
|
bool wireframeMode;
|
||||||
} ImGuiConfig;
|
} ImGuiConfig;
|
||||||
|
|
||||||
extern ConfigWindow configWindow;
|
extern ConfigWindow configWindow;
|
||||||
|
|
|
@ -604,8 +604,16 @@ static void gfx_opengl_set_use_alpha(bool use_alpha) {
|
||||||
|
|
||||||
static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t buf_vbo_num_tris) {
|
static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t buf_vbo_num_tris) {
|
||||||
//printf("flushing %d tris\n", buf_vbo_num_tris);
|
//printf("flushing %d tris\n", buf_vbo_num_tris);
|
||||||
|
if(configImGui.wireframeMode){
|
||||||
|
glPolygonMode(GL_FRONT, GL_LINE);
|
||||||
|
glPolygonMode(GL_BACK, GL_LINE);
|
||||||
|
}
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * buf_vbo_len, buf_vbo, GL_STREAM_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * buf_vbo_len, buf_vbo, GL_STREAM_DRAW);
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris);
|
glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris);
|
||||||
|
if(configImGui.wireframeMode){
|
||||||
|
glPolygonMode(GL_FRONT, GL_FILL);
|
||||||
|
glPolygonMode(GL_BACK, GL_FILL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool gl_get_version(int *major, int *minor, bool *is_es) {
|
static inline bool gl_get_version(int *major, int *minor, bool *is_es) {
|
||||||
|
|
Loading…
Reference in New Issue