Tetris: make playable on macOS
This commit is contained in:
parent
13d18d071f
commit
5ec4182519
@ -1,5 +1,5 @@
|
|||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CFLAGS ?= -O2 -Wall -Wextra
|
CFLAGS ?= -O2 -Wall -Wextra -std=c++14
|
||||||
PREFIX ?= /usr/local/bin
|
PREFIX ?= /usr/local/bin
|
||||||
LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -lSDL2_ttf -pthread
|
LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -lSDL2_ttf -pthread
|
||||||
|
|
||||||
|
@ -389,7 +389,8 @@ void handleKeyUpMain( SDL_Keycode key ) {
|
|||||||
|
|
||||||
void pollEventsMain( SDLPP::Scene &scene ) {
|
void pollEventsMain( SDLPP::Scene &scene ) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while ( SDL_PollEvent( &event ) != 0 ) {
|
while ( SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1 ) {
|
||||||
|
SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||||
switch ( event.type ) {
|
switch ( event.type ) {
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
quitGame();
|
quitGame();
|
||||||
@ -501,7 +502,8 @@ void handleKeyDownMenu( SDL_Keycode key ) {
|
|||||||
|
|
||||||
void pollEventsMenu() {
|
void pollEventsMenu() {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while ( SDL_PollEvent( &event ) != 0 ) {
|
while ( SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1 ) {
|
||||||
|
SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||||
switch ( event.type ) {
|
switch ( event.type ) {
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
quitGame();
|
quitGame();
|
||||||
@ -566,7 +568,8 @@ void handleKeyDownGameOver( SDL_Keycode key ) {
|
|||||||
|
|
||||||
void pollEventsGameOver() {
|
void pollEventsGameOver() {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while ( SDL_PollEvent( &event ) != 0 ) {
|
while ( SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1 ) {
|
||||||
|
SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||||
switch ( event.type ) {
|
switch ( event.type ) {
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
quitGame();
|
quitGame();
|
||||||
@ -689,7 +692,8 @@ void handleKeyDownOptions( SDL_Keycode key ) {
|
|||||||
|
|
||||||
void pollEventsOptions() {
|
void pollEventsOptions() {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while ( SDL_PollEvent( &event ) != 0 ) {
|
while ( SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1 ) {
|
||||||
|
SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||||
switch ( event.type ) {
|
switch ( event.type ) {
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
quitGame();
|
quitGame();
|
||||||
|
Loading…
Reference in New Issue
Block a user