From 4ff7741a419a8c12e32d12139589bba0c83a013b Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Thu, 12 Nov 2020 18:52:52 +0000 Subject: [PATCH] Fix previous sdl ppp commit, too messy to revert. Signed-off-by: Andrea Odetti --- source/frontends/sa2/emulator.cpp | 12 +----------- source/frontends/sa2/main.cpp | 3 +++ source/linux/duplicates/Applewin.cpp | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/source/frontends/sa2/emulator.cpp b/source/frontends/sa2/emulator.cpp index ea4e8540..b1c834ce 100644 --- a/source/frontends/sa2/emulator.cpp +++ b/source/frontends/sa2/emulator.cpp @@ -30,18 +30,8 @@ namespace int sw, sh; getScreenData(data, width, height, sx, sy, sw, sh); - -#if 0 - void * pixels; - int pitch; - SDL_LockTexture(tex.get(), nullptr, &pixels, &pitch); - - memcpy(pixels, data, width * height * 4); - - SDL_UnlockTexture(tex.get()); -#else SDL_UpdateTexture(tex.get(), nullptr, data, width * 4); -#endif + SDL_Rect srect; srect.x = sx; srect.y = sy; diff --git a/source/frontends/sa2/main.cpp b/source/frontends/sa2/main.cpp index 9609ecd3..76e3aec9 100644 --- a/source/frontends/sa2/main.cpp +++ b/source/frontends/sa2/main.cpp @@ -197,12 +197,15 @@ void run_sdl(int argc, const char * argv []) SDL_RendererInfo info; SDL_GetRendererInfo(ren.get(), &info); + std::cerr << "SDL Renderer:" << info.name << std::endl; for (size_t i = 0; i < info.num_texture_formats; ++i) { std::cerr << SDL_GetPixelFormatName(info.texture_formats[i]) << std::endl; } const Uint32 format = SDL_PIXELFORMAT_ARGB8888; + std::cerr << "Selected format: " << SDL_GetPixelFormatName(format) << std::endl; + std::shared_ptr tex(SDL_CreateTexture(ren.get(), format, SDL_TEXTUREACCESS_STATIC, width, height), SDL_DestroyTexture); Emulator emulator(win, ren, tex); diff --git a/source/linux/duplicates/Applewin.cpp b/source/linux/duplicates/Applewin.cpp index e55c3381..db22d254 100644 --- a/source/linux/duplicates/Applewin.cpp +++ b/source/linux/duplicates/Applewin.cpp @@ -45,7 +45,7 @@ DWORD g_dwCyclesThisFrame = 0; // but it is not at the moment bool g_bFullSpeed = true; -AppMode_e g_nAppMode = MODE_LOGO; +AppMode_e g_nAppMode = MODE_RUNNING; HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom ROM at $F800..$FFFF std::string g_sProgramDir; // Directory of where AppleWin executable resides