File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed
Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ PROG = haunted
2+ NAME = HauntedHouse
3+ OBJS = renderer.o
4+
5+ ARCH = arm-linux-
6+ CC = $(ARCH)gcc
7+ BINBASE = /opt/miyoo/bin/
8+ SYSROOT = $(shell $(CC) --print-sysroot)
9+
10+ SDL_CFLAGS := $(shell $(BINBASE)pkg-config --cflags sdl)
11+ SDL_LIBS := $(shell $(BINBASE)pkg-config --libs sdl)
12+ CFLAGS = $(SDL_CFLAGS) -O2 -DBITTBOY
13+ LDFLAGS = $(SDL_LIBS)
14+
15+
16+ .c.o:
17+ $(CC) $(CFLAGS) -c $< -o $@
18+
19+ $(PROG): $(OBJS)
20+ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(PROG) sdl-$(PROG).c
21+
22+ clean:
23+ rm -f $(PROG) *.o
File renamed without changes.
Original file line number Diff line number Diff line change 22#include "SDL.h"
33
44
5- SDL_Surface * screen ;
5+ extern SDL_Surface * screen ;
66
77gfx_texture gfx_frame_buffer = { NULL , display_width , display_height };
88gfx_texture * gfx_render_target = & gfx_frame_buffer ;
Original file line number Diff line number Diff line change @@ -1382,6 +1382,16 @@ char getkey()
13821382 exit (0 );
13831383 }
13841384
1385+ #ifdef BITTBOY
1386+ if (event .key .keysym .sym == SDLK_LALT ) return 'A' ;
1387+ if (event .key .keysym .sym == SDLK_LCTRL ) return 'B' ;
1388+ if (event .key .keysym .sym == SDLK_LSHIFT ) return 'X' ;
1389+ if (event .key .keysym .sym == SDLK_SPACE ) return 'Y' ;
1390+ if (event .key .keysym .sym == SDLK_UP ) return 'N' ;
1391+ if (event .key .keysym .sym == SDLK_RIGHT ) return 'E' ;
1392+ if (event .key .keysym .sym == SDLK_DOWN ) return 'S' ;
1393+ if (event .key .keysym .sym == SDLK_LEFT ) return 'W' ;
1394+ #else
13851395 if (event .key .keysym .sym == SDLK_LCTRL ) return 'A' ;
13861396 if (event .key .keysym .sym == SDLK_LALT ) return 'B' ;
13871397 if (event .key .keysym .sym == SDLK_SPACE ) return 'X' ;
@@ -1390,6 +1400,7 @@ char getkey()
13901400 if (event .key .keysym .sym == SDLK_RIGHT ) return 'E' ;
13911401 if (event .key .keysym .sym == SDLK_DOWN ) return 'S' ;
13921402 if (event .key .keysym .sym == SDLK_LEFT ) return 'W' ;
1403+ #endif
13931404
13941405 // Didn't recognize the input
13951406 }
You can’t perform that action at this time.
0 commit comments