diff --git a/Makefile b/Makefile index 99fcad1..871dc26 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SDL_CFLAGS := $(shell sdl2-config --cflags) SDL_LFLAGS := -lSDL2_ttf $(shell sdl2-config --libs) -CXXFLAGS = -Isrc -Isrc/sys -D_SYSTEM3 -D_DEBUG_CONSOLE -MMD $(SDL_CFLAGS) +CXXFLAGS = -Isrc -Isrc/sys -D_SYSTEM3 -D_DEBUG_CONSOLE -MMD $(SDL_CFLAGS) -g LIBS = -lfreetype -lharfbuzz -lglib-2.0 -lpng -lbz2 -lz -lintl -liconv \ -luuid -limm32 -lole32 -loleaut32 -lversion -lgdi32 -lgdiplus -lwinmm -lws2_32 diff --git a/src/sys/ags.cpp b/src/sys/ags.cpp index 83a128c..bc5b907 100644 --- a/src/sys/ags.cpp +++ b/src/sys/ags.cpp @@ -453,6 +453,8 @@ void AGS::invalidate_screen(int sx, int sy, int width, int height) { SDL_UnlockSurface(hBmpDest); uint32* pixels = surface_line(hBmpDest, screen_height == 400 ? sy + (scroll - 400) : sy) + sx; + if (sy + height > screen_height) + height = screen_height - sy; SDL_Rect rect = {sx, sy, width, height}; SDL_UpdateTexture(sdlTexture, &rect, pixels, hBmpDest->pitch); SDL_RenderClear(sdlRenderer);