From a8b976af1c549be3e7ebe401d15c2826a5a6fa4a Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sat, 17 Nov 2018 20:57:40 +0800 Subject: graph_fill --- csrc/font.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/csrc/font.c b/csrc/font.c index 1ab8909..bbccafe 100644 --- a/csrc/font.c +++ b/csrc/font.c @@ -195,6 +195,19 @@ void speak_words(int n) /* TODO */ } +void graph_fill(struct graph_st *gg, int left, int top, int width, int height, int v) +{ + uint16_t color = fcn_4551f0(v); + uint16_t *fill_line= &gg->gdata[gg->width * top + left]; + + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + fill_line[j] = color; + } + fill_line += gg->width; + } +} + void draw_some_text(struct graph_st *gg, const char *str, int a3, int a4, int a5) { DDSURFACEDESC desc; /* esp */ @@ -349,7 +362,7 @@ void draw_some_text(struct graph_st *gg, const char *str, int a3, int a4, int a5 a3, a4, fmt_dim1.left, fmt_dim1.top, width, height); } } - fcn.004561be(&gst_4762e8, fmt_dim1.left, fmt_dim1.top, width, height, 0); + graph_fill(&gst_4762e8, fmt_dim1.left, fmt_dim1.top, width, height, 0); IDirectDrawSurface_Unlock(pddrawsf3, NULL); } -- cgit v1.2.3