~kameliya/kyuubey

403eabb84239bcb4a093545cef6a52f5c6e99a4d — Asherah Connor 21 days ago 6aa0624 master
renderer: set draw colors on texture correctly
2 files changed, 3 insertions(+), 1 deletions(-)

M renderer.c
M sfont.c
M renderer.c => renderer.c +1 -1
@@ 30,7 30,7 @@ int renderer_init(void) {
    renderer = SDL_CreateRenderer(
        window,
        -1,
        SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
        SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);

    if (!renderer) {
        fprintf(stderr, "SDL_CreateRenderer error: %s\n", SDL_GetError());

M sfont.c => sfont.c +2 -0
@@ 42,7 42,9 @@ sdlfont_t *read_raw_sdlfont(const char *filename) {
        SDL_Texture *t = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, FONT_WIDTH, FONT_HEIGHT);
        SDL_SetTextureBlendMode(t, SDL_BLENDMODE_BLEND);
        SDL_SetRenderTarget(renderer, t);
        SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
        SDL_RenderClear(renderer);
        SDL_SetRenderDrawColor(renderer, 0xff, 0xff, 0xff, SDL_ALPHA_OPAQUE);

        for (int row = 0; row < FONT_HEIGHT; ++row) {
            unsigned char rowdata = c.bitmap[row],