various merge fixes

This commit is contained in:
MelonSpeedruns 2022-05-29 15:19:31 -04:00
commit c16f153485
5 changed files with 44 additions and 66 deletions

View file

@ -243,7 +243,8 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par
if (dxgi.in_paint) { if (dxgi.in_paint) {
dxgi.recursive_paint_detected = true; dxgi.recursive_paint_detected = true;
return DefWindowProcW(h_wnd, message, w_param, l_param); return DefWindowProcW(h_wnd, message, w_param, l_param);
} else { }
else {
if (dxgi.run_one_game_iter != nullptr) { if (dxgi.run_one_game_iter != nullptr) {
dxgi.in_paint = true; dxgi.in_paint = true;
dxgi.run_one_game_iter(); dxgi.run_one_game_iter();
@ -255,7 +256,6 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par
} }
} }
} }
}
break; break;
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
if (dxgi.on_all_keys_up != nullptr) { if (dxgi.on_all_keys_up != nullptr) {
@ -283,6 +283,7 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par
} }
return 0; return 0;
} }
}
void gfx_dxgi_init(const char* game_name, bool start_in_fullscreen) { void gfx_dxgi_init(const char* game_name, bool start_in_fullscreen) {
LARGE_INTEGER qpc_init, qpc_freq; LARGE_INTEGER qpc_init, qpc_freq;

View file

@ -234,7 +234,6 @@ extern "C" void LoadItemLocations(const char* spoilerFileName);
static void gfx_sdl_handle_events(void) { static void gfx_sdl_handle_events(void) {
SDL_Event event; SDL_Event event;
char* dropped_filedir;
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
SohImGui::EventImpl event_impl; SohImGui::EventImpl event_impl;
event_impl.sdl = { &event }; event_impl.sdl = { &event };
@ -256,12 +255,8 @@ static void gfx_sdl_handle_events(void) {
} }
break; break;
case SDL_DROPFILE: case SDL_DROPFILE:
{
#ifndef __linux__
LoadItemLocations(event.drop.file); LoadItemLocations(event.drop.file);
#endif
break; break;
}
case SDL_QUIT: case SDL_QUIT:
exit(0); exit(0);
} }

View file

@ -259,7 +259,8 @@ namespace SohImGui {
} }
void LoadRainbowColor() { void LoadRainbowColor() {
for (uint16_t s=0; s <= sizeof(RainbowColorCvarList); s++) { u8 arrayLength = sizeof(RainbowColorCvarList) / sizeof(*RainbowColorCvarList);
for (u8 s = 0; s < arrayLength; s++) {
std::string cvarName = RainbowColorCvarList[s]; std::string cvarName = RainbowColorCvarList[s];
std::string Cvar_Red = cvarName; std::string Cvar_Red = cvarName;
Cvar_Red += "R"; Cvar_Red += "R";

View file

@ -8,8 +8,6 @@
#include "soh/frame_interpolation.h" #include "soh/frame_interpolation.h"
#include "soh/frame_interpolation.h"
static s16 sUnused = 106; static s16 sUnused = 106;
static s16 sScreenFillAlpha = 255; static s16 sScreenFillAlpha = 255;
@ -169,8 +167,6 @@ void FileChoose_FinishFadeIn(GameState* thisx) {
} }
} }
Sprite sprDPad = { gHookshotIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b };
void SpriteLoad(FileChooseContext* this, Sprite* sprite) { void SpriteLoad(FileChooseContext* this, Sprite* sprite) {
OPEN_DISPS(this->state.gfxCtx, "gfx.c", 12); OPEN_DISPS(this->state.gfxCtx, "gfx.c", 12);
@ -211,14 +207,11 @@ void DrawSeedHashSprites(FileChooseContext* this) {
// Draw Seed Icons // Draw Seed Icons
u16 xStart = 64; u16 xStart = 64;
for (u8 i = 0; i < 5; i++) { for (u8 i = 0; i < 5; i++) {
// gSaveContext.seedIcons[i];
// hacky check to make sure we leaded the icons // hacky check to make sure we leaded the icons
if (gSaveContext.seedIcons[i].height) { if (gSaveContext.seedIcons[i].height) {
SpriteLoad(this, &gSaveContext.seedIcons[i]); SpriteLoad(this, &gSaveContext.seedIcons[i]);
SpriteDraw(this, &gSaveContext.seedIcons[i], xStart + (40 * i), 10, 24, 24); SpriteDraw(this, &gSaveContext.seedIcons[i], xStart + (40 * i), 10, 24, 24);
} }
// SpriteLoad(this, &sprDPad);
// SpriteDraw(this, &sprDPad, xStart + (40 * i), 10, 24, 24);
} }
gDPPipeSync(POLY_OPA_DISP++); gDPPipeSync(POLY_OPA_DISP++);

View file

@ -449,18 +449,6 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
dayTime = ((void)0, gSaveContext.dayTime); dayTime = ((void)0, gSaveContext.dayTime);
// hacky function for testing
// while drag and drop is broken on linux
// enter "rando" as file name
if(this->fileNames[1][0] == '5' &&
this->fileNames[1][1] == '$' &&
this->fileNames[1][2] == '1' &&
this->fileNames[1][3] == '\'' &&
this->fileNames[1][4] == '2')
{
ParseItemLocations("spoiler.json");
}
Sram_InitSave(this, &this->sramCtx); Sram_InitSave(this, &this->sramCtx);
// todo: fill link's pocket here // todo: fill link's pocket here