diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-07-15 17:46:13 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-07-15 17:46:13 +0500 |
| commit | 8b79b8149d1e23d90b5871f980aec65d8aa7ae23 (patch) | |
| tree | 88a8788b75270dba53a15cbc2b6e0916f05301c6 /src/scenes/resultView.c | |
| parent | f314b56da42e1ead200e2373e9b214f77290d03b (diff) | |
Puzzle infrastructure pt 1.
Diffstat (limited to 'src/scenes/resultView.c')
| -rw-r--r-- | src/scenes/resultView.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scenes/resultView.c b/src/scenes/resultView.c index b433bd0..033d17e 100644 --- a/src/scenes/resultView.c +++ b/src/scenes/resultView.c @@ -11,7 +11,7 @@ static const int BORDER = 2; static const int SCROLL_SPEED = 10; typedef struct { - char *value; + SubmitionResult *value; int scroll; /// For the fun popping up effect float scroll_up; @@ -57,17 +57,20 @@ bool drawResultView(void *self) { // DrawBackground(); Rectangle body = GetResultViewBodyRect(data->scroll_up); DrawRecBordered(body, WHITE, COLORSCHEME_ORANGE, BORDER); - DrawTextInRec(body, data->value, + DrawTextInRec(body, data->value->stdout, GetMainFont(), 20, COLORSCHEME_BROWN, 3, &data->scroll); return true; } void deinitResultView(void *self) { TraceLog(LOG_INFO, "Deleting a result view"); + ResultViewData *data = ((Scene *)self)->data; + if (data->value != NULL) FreeSunmitionResult(data->value); + free(data); free((Scene *)self); } -Scene *CreateResultView(char *result) { +Scene *CreateResultView(SubmitionResult *result) { TraceLog(LOG_INFO, "Creating a main menu"); Scene *outp = malloc(sizeof(Scene)); outp->Draw = drawResultView; @@ -80,6 +83,7 @@ Scene *CreateResultView(char *result) { free(outp); return NULL; } + data->value = result; data->scroll = 0; data->scroll_up = 1; |
