From 8b79b8149d1e23d90b5871f980aec65d8aa7ae23 Mon Sep 17 00:00:00 2001 From: physick Date: Wed, 15 Jul 2026 17:46:13 +0500 Subject: Puzzle infrastructure pt 1. --- src/scenes/resultView.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/scenes/resultView.c') 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; -- cgit v1.3