From 604b37bd84ad847dee0c26e7ff982231f8f66c81 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering Date: Thu, 22 Jan 2026 14:09:13 +0100 Subject: [PATCH 1/6] sac_int index types --- src/src/sdl3.c | 10 +++++----- src/src/sdl3.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/src/sdl3.c b/src/src/sdl3.c index dfb326e..7dad69d 100644 --- a/src/src/sdl3.c +++ b/src/src/sdl3.c @@ -78,11 +78,11 @@ SDLcontext *SAC_InitDisplay(sac_int height, sac_int width) SAC_RuntimeError("SDL_Init failed: %s", SDL_GetError()); } - if(!SDL_CreateWindowAndRenderer("SaC SDL3", width, height, 0, &ctx->window, &ctx->renderer)) { + if(!SDL_CreateWindowAndRenderer("SaC SDL3", (int)width, (int)height, 0, &ctx->window, &ctx->renderer)) { SAC_RuntimeError("SDL_CreateWindowAndRenderer failed: %s", SDL_GetError()); } - ctx->texture = SDL_CreateTexture(ctx->renderer, SDL_PIXELFORMAT_RGB24, SDL_TEXTUREACCESS_STREAMING, width, height); + ctx->texture = SDL_CreateTexture(ctx->renderer, SDL_PIXELFORMAT_RGB24, SDL_TEXTUREACCESS_STREAMING, (int)width, (int)height); if(ctx->texture == NULL) { SAC_RuntimeError("SDL_CreateTexture failed: %s", SDL_GetError()); } @@ -122,11 +122,11 @@ void SAC_DrawPixelsOffset(SDLcontext *ctx, SACarg *sacPixels, sac_int xOffset, s SAC_RuntimeError("SDL_LockTexture failed: %s", SDL_GetError()); } - for (size_t y = 0; y < MIN(srcHeight, ctx->height - yOffset); y++) { + for (sac_int y = 0; y < MIN(srcHeight, (sac_int)ctx->height - yOffset); y++) { const sac_int *srcRow = srcPixels + y * srcWidth * 3; - uint8_t *dstRow = dstPixels + (yOffset + y) * pitch; + uint8_t *dstRow = dstPixels + (yOffset + y) * (sac_int)pitch; - for (size_t x = 0; x < 3 * MIN(srcWidth, ctx->width - xOffset); x += 3) { + for (sac_int x = 0; x < 3 * MIN(srcWidth, (sac_int)ctx->width - xOffset); x += 3) { dstRow[xOffset + x + 0] = (uint8_t)(srcRow[x + 0]); dstRow[xOffset + x + 1] = (uint8_t)(srcRow[x + 1]); dstRow[xOffset + x + 2] = (uint8_t)(srcRow[x + 2]); diff --git a/src/src/sdl3.h b/src/src/sdl3.h index da8837b..f658d1b 100644 --- a/src/src/sdl3.h +++ b/src/src/sdl3.h @@ -16,7 +16,7 @@ typedef enum { typedef struct SDLselection { SDL_Semaphore *isSelecting; selmode_t mode; - int coords[4]; + sac_int coords[4]; } SDLselection; typedef struct SDLcontext { From 18a929ec024bc4bdc4a8eae2dcbb3e26235b4f69 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering Date: Thu, 22 Jan 2026 14:12:15 +0100 Subject: [PATCH 2/6] sac_int index types --- src/src/sdl3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/src/sdl3.c b/src/src/sdl3.c index 7dad69d..050112a 100644 --- a/src/src/sdl3.c +++ b/src/src/sdl3.c @@ -180,11 +180,11 @@ sac_int SAC_CloseDisplay(SDLcontext *ctx) } } - int exitStatus; - SDL_WaitThread(ctx->eventHandler, &exitStatus); + int status; + SDL_WaitThread(ctx->eventHandler, &status); SDL_Quit(); - return (sac_int)exitStatus; + return (sac_int)status; } bool SAC_IsRunning(SDLcontext *ctx) From a213ab5969659d09e139ae89c5b3c984227b31ab Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:00:50 +0200 Subject: [PATCH 3/6] configure sac2c step should no longer be needed --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91047aa..f99f963 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,8 +11,6 @@ jobs: - uses: actions/checkout@v7 with: submodules: 'recursive' - - name: Configure sac2c - run: cp -r /root/.sac2crc $HOME/.sac2crc - name: Install SDL3 run: apt install -y libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev - name: Setup CMake From f9552a1120c1b3751bcd35eb9b26dbbf7e970143 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:04:33 +0200 Subject: [PATCH 4/6] set DSAC2C_EXEC --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f99f963..e94e06f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,6 @@ jobs: - name: Install SDL3 run: apt install -y libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev - name: Setup CMake - run: cmake -DTARGETS="seq;mt_pth" -B build + run: cmake -DSAC2C_EXEC=sac2c -DTARGETS="seq;mt_pth" -B build - name: Build run: cmake --build build From 4f830ecbc5de12e3588776013322dc48ef02b9ed Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 7 Sep 2026 13:13:54 +0200 Subject: [PATCH 5/6] DSAC2C_EXEC should not be necessary --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e94e06f..f99f963 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,6 @@ jobs: - name: Install SDL3 run: apt install -y libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev - name: Setup CMake - run: cmake -DSAC2C_EXEC=sac2c -DTARGETS="seq;mt_pth" -B build + run: cmake -DTARGETS="seq;mt_pth" -B build - name: Build run: cmake --build build From 6974a64f8d64172402156230a2db9c35ef285cb5 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 7 Sep 2026 13:15:58 +0200 Subject: [PATCH 6/6] Configure sac2c --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f99f963..5d0b7c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,8 @@ jobs: submodules: 'recursive' - name: Install SDL3 run: apt install -y libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev + - name: Configure sac2c + run: cp -r /root/.sac2crc $HOME/.sac2crc - name: Setup CMake run: cmake -DTARGETS="seq;mt_pth" -B build - name: Build