Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon32767 committed Nov 24, 2021
1 parent 11563e7 commit 261d96f
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions sdl12main.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ static Uint32 getpixel(SDL_Surface *surface, int x, int y) {

case 4:
return *(Uint32 *)p;

default:
return 0; /* shouldn't happen, but avoids warnings */
}
return 0;
}

static void loadbmpscale(char* filename, SDL_Surface** s) {
Expand Down Expand Up @@ -147,7 +145,7 @@ static void loadbmpscale(char* filename, SDL_Surface** s) {
SDL_FreeSurface(bmp);
SDL_SetPalette(surf, SDL_PHYSPAL | SDL_LOGPAL, (SDL_Color*)base_palette, 0, 16);
SDL_SetColorKey(surf, SDL_SRCCOLORKEY, 0);
//SDL_SaveBMP(_S, #_S "x.bmp");

*s = surf;
}

Expand Down Expand Up @@ -268,8 +266,6 @@ static Uint8 *n3ds_get_fake_key_state(int *numkeys) {
SDL_PushEvent(&ev);
}
}
#define checkkey(k) if (held & k) printf("held %s\n",#k);
// checkkey(KEY_B);

return st;
}
Expand Down Expand Up @@ -342,8 +338,7 @@ int main(int argc, char** argv) {
0xf0,0x3c,0xf0,0x00,0x00,0x00,0x40,0x00,0x12,0x00,0x00,0x00,
0x00,0x00,0xc0,0x00,0x10,0x00,0x00,0x00,0x00,0x00
};
const unsigned int loading_bmp_len = 202;
SDL_RWops* rw = SDL_RWFromConstMem(loading_bmp, loading_bmp_len);
SDL_RWops* rw = SDL_RWFromConstMem(loading_bmp, sizeof loading_bmp);
SDL_Surface* loading = SDL_LoadBMP_RW(rw, 1);
if (!loading) goto skip_load;

Expand Down Expand Up @@ -567,11 +562,6 @@ static void mainLoop(void) {
}
OSDdraw();

/*for (int i = 0 ; i < 16;i++) {
SDL_Rect rc = {i*8*scale, 0, 8*scale, 4*scale};
SDL_FillRect(screen, &rc, i);
}*/

SDL_Flip(screen);

#ifdef EMSCRIPTEN //emscripten_set_main_loop already sets the fps
Expand Down Expand Up @@ -904,7 +894,6 @@ int pico8emu(CELESTE_P8_CALLBACK_TYPE call, ...) {
int tile = tilemap_data[x + mx + (y + my)*128];
//hack
if (mask == 0 || (mask == 4 && tile_flags[tile] == 4) || gettileflag(tile, mask != 4 ? mask-1 : mask)) {
//al_draw_bitmap(sprites[tile], tx+x*8 - camera_x, ty+y*8 - camera_y, 0);
SDL_Rect srcrc = {
8*(tile % 16),
8*(tile / 16)
Expand All @@ -924,7 +913,6 @@ int pico8emu(CELESTE_P8_CALLBACK_TYPE call, ...) {
dstrc.w = dstrc.h = 8;
}

//SDL_BlitSurface(gfx, &srcrc, screen, &dstrc);
Xblit(gfx, &srcrc, screen, &dstrc, 0, 0, 0);
}
}
Expand Down

0 comments on commit 261d96f

Please sign in to comment.