diff --git a/src/sys/ags.cpp b/src/sys/ags.cpp index db536c2..663ba47 100644 --- a/src/sys/ags.cpp +++ b/src/sys/ags.cpp @@ -402,7 +402,7 @@ void AGS::fade_in(int duration_ms) update_screen(); } -void AGS::draw_screen(int sx, int sy, int width, int height) +void AGS::invalidate_screen(int sx, int sy, int width, int height) { SDL_Rect rect = {sx, sy, width, height}; SDL_Rect screen_rect = {0, 0, screen_width, screen_height}; diff --git a/src/sys/ags.h b/src/sys/ags.h index 39ac8e0..d623440 100644 --- a/src/sys/ags.h +++ b/src/sys/ags.h @@ -120,8 +120,7 @@ public: std::vector get_screen_palette() const; uint8 get_pixel(int dest, int x, int y) const { return vram[dest][y][x]; } void set_pixel(int dest, int x, int y, uint8 color) { vram[dest][y][x] = color; } - // Marks a rectangle of the display screen for the next update_screen(). - void draw_screen(int sx, int sy, int width, int height); + void invalidate_screen(int sx, int sy, int width, int height); void fade_out(int duration_ms, bool white); void fade_in(int duration_ms); diff --git a/src/sys/ags_draw.cpp b/src/sys/ags_draw.cpp index aeb2d4a..84c1eaf 100644 --- a/src/sys/ags_draw.cpp +++ b/src/sys/ags_draw.cpp @@ -115,7 +115,7 @@ void AGS::blit_cg(int dest, CG& cg, const SDL_Rect* src, int dx, int dy) SDL_Rect dstrect = { dx, dy, src ? src->w : cg.width(), src ? src->h : cg.height() }; SDL_BlitSurface(cg.surface(), src, hBmpScreen[dest], &dstrect); if (dest == 0) { - draw_screen(dstrect.x, dstrect.y, dstrect.w, dstrect.h); + invalidate_screen(dstrect.x, dstrect.y, dstrect.w, dstrect.h); } } @@ -151,7 +151,7 @@ void AGS::copy_screen(int src, int dest, int sx, int sy, int ex, int ey, int dx, SDL_SetColorKey(src_surface, SDL_FALSE, 0); if (dest == 0) - draw_screen(dx, dy, width, height); + invalidate_screen(dx, dy, width, height); } void AGS::gcopy(int gsc, int gde, int glx, int gly, int gsw) @@ -169,7 +169,7 @@ void AGS::gcopy(int gsc, int gde, int glx, int gly, int gsw) SDL_BlitSurface(hBmpScreen[src], &srcrect, hBmpScreen[dest], &destrect); if(dest == 0) { - draw_screen(dx, dy, glx * 8, gly); + invalidate_screen(dx, dy, glx * 8, gly); } } @@ -213,7 +213,7 @@ void AGS::paint(int x, int y, uint8 color) miny = std::min(y, miny); maxy = std::max(y, maxy); } - draw_screen(minx, miny, maxx - minx + 1, maxy - miny + 1); + invalidate_screen(minx, miny, maxx - minx + 1, maxy - miny + 1); } void AGS::draw_box(int index) @@ -243,7 +243,7 @@ void AGS::draw_mesh(int sx, int sy, int width, int height) vram[0][y + 1][x] = 255; } } - draw_screen(sx, sy, width, height); + invalidate_screen(sx, sy, width, height); } void AGS::box_fill(int dest, int sx, int sy, int ex, int ey, uint8 color) @@ -251,7 +251,7 @@ void AGS::box_fill(int dest, int sx, int sy, int ex, int ey, uint8 color) SDL_Rect rect = {sx, sy, ex - sx + 1, ey - sy + 1}; SDL_FillRect(hBmpScreen[dest], &rect, color); if(dest == 0) { - draw_screen(sx, sy, ex - sx + 1, ey - sy + 1); + invalidate_screen(sx, sy, ex - sx + 1, ey - sy + 1); } } @@ -267,7 +267,7 @@ void AGS::box_line(int dest, int sx, int sy, int ex, int ey, uint8 color) SDL_FillRect(hBmpScreen[dest], &left, color); SDL_FillRect(hBmpScreen[dest], &right, color); if(dest == 0) { - draw_screen(sx, sy, ex - sx + 1, ey - sy + 1); + invalidate_screen(sx, sy, ex - sx + 1, ey - sy + 1); } } diff --git a/src/sys/ags_text.cpp b/src/sys/ags_text.cpp index 0fe87a0..30927da 100644 --- a/src/sys/ags_text.cpp +++ b/src/sys/ags_text.cpp @@ -409,7 +409,7 @@ void AGS::draw_text(std::string_view string, bool text_wait) if (!draw_menu && text_wait && code != ' ') { // 画面更新 if(screen == 0) - draw_screen(ctx.pos.x, dest_y, dest_x - ctx.pos.x, ascent - descent); + invalidate_screen(ctx.pos.x, dest_y, dest_x - ctx.pos.x, ascent - descent); ctx.pos.x = dest_x; // Wait g_nact->text_wait(); @@ -418,7 +418,7 @@ void AGS::draw_text(std::string_view string, bool text_wait) if (!draw_menu && !text_wait) { // 画面更新 if(screen == 0) - draw_screen(ctx.pos.x, dest_y, dest_x - ctx.pos.x, ascent - descent); + invalidate_screen(ctx.pos.x, dest_y, dest_x - ctx.pos.x, ascent - descent); } ctx.pos.x = dest_x; } diff --git a/src/sys/ags_window.cpp b/src/sys/ags_window.cpp index eddd63c..a84fc85 100644 --- a/src/sys/ags_window.cpp +++ b/src/sys/ags_window.cpp @@ -156,7 +156,7 @@ void AGS::draw_push(int index) int x = w.ex - 16; int y = w.ey - 16; draw_gaiji(0, x, y, push_bitmap ? push_bitmap : builtin_bitmap, 16, text.font_color); - draw_screen(x, y, 16, 16); + invalidate_screen(x, y, 16, 16); } void AGS::open_text_window(int index, bool erase) @@ -197,7 +197,7 @@ void AGS::open_text_window(int index, bool erase) SDL_SetSurfacePalette(hBmpScreen[0], w.window.palette()); SDL_Rect rect = {sx, sy, width, height}; SDL_BlitSurface(w.window.surface(), NULL, hBmpScreen[0], &rect); - draw_screen(sx, sy, width, height); + invalidate_screen(sx, sy, width, height); SDL_SetSurfacePalette(hBmpScreen[0], screen_palette); } @@ -233,7 +233,7 @@ void AGS::close_text_window(int index, bool update) SDL_SetSurfacePalette(hBmpScreen[0], w.screen.palette()); SDL_Rect rect = {sx, sy, width, height}; SDL_BlitSurface(w.screen.surface(), NULL, hBmpScreen[0], &rect); - draw_screen(sx, sy, width, height); + invalidate_screen(sx, sy, width, height); SDL_SetSurfacePalette(hBmpScreen[0], screen_palette); } @@ -280,7 +280,7 @@ void AGS::open_menu_window(int index) SDL_Rect dst_rect = {sx, sy, width, height}; SDL_BlitSurface(hBmpScreen[2], &src_rect, hBmpScreen[0], &dst_rect); box_line(0, sx, sy, ex, sy + menu.font_size + 3, menu.frame_color); - draw_screen(wsx, wsy, wwidth, wheight); + invalidate_screen(wsx, wsy, wwidth, wheight); } void AGS::redraw_menu_window(int index, int selected) @@ -297,7 +297,7 @@ void AGS::redraw_menu_window(int index, int selected) SDL_Rect dst_rect = {sx, sy, width, height}; SDL_BlitSurface(hBmpScreen[2], &src_rect, hBmpScreen[0], &dst_rect); box_line(0, sx, sy + (menu.font_size + 4) * selected, ex, sy + (menu.font_size + 4) * (selected + 1) - 1, menu.frame_color); - draw_screen(sx, sy, width, height); + invalidate_screen(sx, sy, width, height); } void AGS::close_menu_window(int index) @@ -308,7 +308,7 @@ void AGS::close_menu_window(int index) SDL_SetSurfacePalette(hBmpScreen[0], w.screen.palette()); SDL_Rect rect = {w.screen.x, w.screen.y, w.screen.width(), w.screen.height()}; SDL_BlitSurface(w.screen.surface(), NULL, hBmpScreen[0], &rect); - draw_screen(w.screen.x, w.screen.y, w.screen.width(), w.screen.height()); + invalidate_screen(w.screen.x, w.screen.y, w.screen.width(), w.screen.height()); SDL_SetSurfacePalette(hBmpScreen[0], screen_palette); } } @@ -337,5 +337,5 @@ void AGS::draw_window(int sx, int sy, int ex, int ey, bool frame, uint8 frame_co SDL_FillRects(hBmpScreen[0], rects, 4, frame_color); box_line(0, sx + 4, sy + 4, ex - 4, ey - 4, frame_color); } - draw_screen(sx, sy, ex - sx + 1, ey - sy + 1); + invalidate_screen(sx, sy, ex - sx + 1, ey - sy + 1); } diff --git a/src/sys/nact_gakuenking.cpp b/src/sys/nact_gakuenking.cpp index dc6bb26..b04b495 100644 --- a/src/sys/nact_gakuenking.cpp +++ b/src/sys/nact_gakuenking.cpp @@ -1358,7 +1358,7 @@ private: ags->set_pixel(0, x + col, y + row, (cursor.body[row] & bit) ? 15 : 0); } } - ags->draw_screen(x, y, MOUSE_CURSOR_SIZE, MOUSE_CURSOR_SIZE); + ags->invalidate_screen(x, y, MOUSE_CURSOR_SIZE, MOUSE_CURSOR_SIZE); } // --- A key wait icon --------------------------------------------------