diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-11-17 20:57:40 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-11-17 20:57:40 +0800 |
commit | a8b976af1c549be3e7ebe401d15c2826a5a6fa4a (patch) | |
tree | 537fafedda417ce1510e6161811799973430baa5 | |
parent | 380ff1b2d1a1e9057abd1f21884eb78702e7b73a (diff) | |
download | rich4-a8b976af1c549be3e7ebe401d15c2826a5a6fa4a.tar.xz |
graph_fill
-rw-r--r-- | csrc/font.c | 15 |
1 files changed, 14 insertions, 1 deletions
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); } |