revert -O2 when non matching,fix EU compile,disable cursor in fullscreen

- O2 caused problems with audio on US builds when targeting generic systems
- compiling an EU version previously caused problems due to race condition in the Makefile
- not being able to see the cursor on a small window is annoying, only hide on fullscreen
This commit is contained in:
Jan200101 2020-05-08 13:41:12 +02:00
parent 848f7c352b
commit c540898c71
No known key found for this signature in database
GPG Key ID: 5B71B1D78B882E05
2 changed files with 12 additions and 4 deletions

View File

@ -254,7 +254,7 @@ endif
endif endif
# Use a default opt flag for gcc # Use a default opt flag for gcc
ifeq ($(NON_MATCHING),1) ifeq ($(COMPILER),gcc)
OPT_FLAGS := -O2 OPT_FLAGS := -O2
endif endif
@ -644,17 +644,22 @@ $(BUILD_DIR)/text/%/define_text.inc.c: text/define_text.inc.c text/%/courses.h t
$(CPP) $(VERSION_CFLAGS) $< -o $@ -I text/$*/ $(CPP) $(VERSION_CFLAGS) $< -o $@ -I text/$*/
$(TEXTCONV) charmap.txt $@ $@ $(TEXTCONV) charmap.txt $@ $@
O_FILES += $(wildcard $(BUILD_DIR)/bin/$(VERSION)/*.o)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_SRC_DIRS) $(ULTRA_ASM_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) include) $(MIO0_DIR) $(addprefix $(MIO0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION) ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_SRC_DIRS) $(ULTRA_ASM_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) include) $(MIO0_DIR) $(addprefix $(MIO0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
# Make sure build directory exists before compiling anything # Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS) DUMMY != mkdir -p $(ALL_DIRS)
$(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h $(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h
ifeq ($(VERSION),eu)
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
O_FILES += $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
else
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
endif
################################################################ ################################################################
# TEXTURE GENERATION # # TEXTURE GENERATION #

View File

@ -80,7 +80,6 @@ const SDL_Scancode scancode_rmapping_nonextended[][2] = {
static void gfx_sdl_init(void) { static void gfx_sdl_init(void) {
SDL_Init(SDL_INIT_VIDEO); SDL_Init(SDL_INIT_VIDEO);
SDL_ShowCursor(SDL_DISABLE); // Removes the cursor from view when upon the game's window.
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@ -105,6 +104,7 @@ static void gfx_sdl_init(void) {
if (configFullscreen) if (configFullscreen)
{ {
SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP);
SDL_ShowCursor(SDL_DISABLE);
} }
SDL_GL_CreateContext(wnd); SDL_GL_CreateContext(wnd);
@ -159,10 +159,12 @@ static void gfx_sdl_onkeydown(int scancode) {
if (!configFullscreen) if (!configFullscreen)
{ {
SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP);
SDL_ShowCursor(SDL_DISABLE);
} }
else else
{ {
SDL_SetWindowFullscreen(wnd, 0); SDL_SetWindowFullscreen(wnd, 0);
SDL_ShowCursor(SDL_ENABLE);
} }
configFullscreen = !configFullscreen; configFullscreen = !configFullscreen;
@ -170,6 +172,7 @@ static void gfx_sdl_onkeydown(int scancode) {
else if (state[SDL_SCANCODE_ESCAPE] && configFullscreen) else if (state[SDL_SCANCODE_ESCAPE] && configFullscreen)
{ {
SDL_SetWindowFullscreen(wnd, 0); SDL_SetWindowFullscreen(wnd, 0);
SDL_ShowCursor(SDL_ENABLE);
configFullscreen = false; configFullscreen = false;
} }
} }