Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

x < height 是否應該改為 x < width ? #6

Closed
ccckmit opened this issue Aug 24, 2021 · 1 comment · Fixed by #8
Closed

x < height 是否應該改為 x < width ? #6

ccckmit opened this issue Aug 24, 2021 · 1 comment · Fixed by #8
Assignees

Comments

@ccckmit
Copy link

ccckmit commented Aug 24, 2021

在 syscall_sdl.c 當中的下列這段程式,x < height 是否應該改為 x < width ?

     for (size_t y = 0; y < height; ++y) {
        for (size_t x = 0; x < height; ++x) {
            const uint8_t c = p[x];
            const uint8_t *lut = j + (c * 3);
            d[x] = (lut[0] << 16) | (lut[1] << 8) | lut[2];
        }
        p += width, d += width;
    }

修改為

     for (size_t y = 0; y < height; ++y) {
        for (size_t x = 0; x < width; ++x) {
            const uint8_t c = p[x];
            const uint8_t *lut = j + (c * 3);
            d[x] = (lut[0] << 16) | (lut[1] << 8) | lut[2];
        }
        p += width, d += width;
    }
@eecheng87
Copy link
Collaborator

嗨,我也覺得要改成 width,或許你可以發個 PR。

eecheng87 added a commit to eecheng87/rv32emu-next that referenced this issue Oct 31, 2021
@eecheng87 eecheng87 mentioned this issue Oct 31, 2021
@jserv jserv closed this as completed in #8 Oct 31, 2021
jserv pushed a commit that referenced this issue Oct 31, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants