Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snow leopard Compatibility Fixes #125

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "submodules/libgme_m"]
path = submodules/libgme_m
url = https://github.com/bazzinotti/libgme_m.git
branch = experimental
[submodule "submodules/wla-dx"]
path = submodules/wla-dx
url = https://github.com/bazzinotti/wla-dx.git
Expand Down
17 changes: 12 additions & 5 deletions pc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ SHARED_DIR = shared/
PROJ_DIR = ext
#

CC=$(CROSS_COMPILE)g++
CPP=$(CROSS_COMPILE)g++
OBJCC=$(CROSS_COMPILE)g++
# Only Set compilers if they are unset (default). This lets you set them from the environment manually.
ifeq ($(origin CC),default)
CC = $(CROSS_COMPILE)g++
endif
ifeq ($(origin CPP),default)
CPP = $(CROSS_COMPILE)g++
endif
# OBJCC is not a Make default variable so use this syntax instead
OBJCC ?= $(CROSS_COMPILE)g++

debug = -g
optimize = -O3

Expand Down Expand Up @@ -259,12 +266,12 @@ $(BIN)/$(DEC7Z): $(PROJ_DIR)/lzma1505/C/Util/7z/$(DEC7Z) $(PROJ_DIR)/lzma1505/C/
cp $(PROJ_DIR)/lzma1505/C/Util/7z/$(DEC7Z) $(BIN)

$(PROJ_DIR)/lzma1505/C/Util/7z/$(DEC7Z):
uname_S=$(uname_S) make -C $(PROJ_DIR)/lzma1505/C/Util/7z -f makefile.gcc
uname_S=$(uname_S) LDFLAGS= CFLAGS= make -C $(PROJ_DIR)/lzma1505/C/Util/7z -f makefile.gcc

$(BIN)/$(UNRAR): $(PROJ_DIR)/unrar/$(UNRAR)
cp $(PROJ_DIR)/unrar/$(UNRAR) $(BIN)
$(PROJ_DIR)/unrar/$(UNRAR):
uname_S=$(uname_S) make -C $(PROJ_DIR)/unrar
uname_S=$(uname_S) CPPFLAGS= LDFLAGS= make -C $(PROJ_DIR)/unrar

$(LIBJDKMIDI_LIB): $(LIBJDKMIDI_OSDIR)/Makefile
cd $(LIBJDKMIDI_OSDIR) && make
Expand Down
3 changes: 2 additions & 1 deletion pc/debugger/BrrContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ uint16_t get_voice_srcn_addr(uint8_t voice)
int BrrContextMenu::write_brr_to_file_callback(void *data)
{
uintptr_t brr_addr = (uintptr_t) data;
write_brr_to_file( (Brr *) &::IAPURAM[brr_addr]);
return write_brr_to_file( (Brr *) &::IAPURAM[brr_addr]);
}

int BrrContextMenu::write_sti_to_file_callback(void *data)
Expand Down Expand Up @@ -146,6 +146,7 @@ int BrrContextMenu::write_sti_to_file_callback(void *data)
}

sample.brr = NULL; // stop destructor from freeing that mem
return 0;
}

#include "BaseD.h"
Expand Down
2 changes: 2 additions & 0 deletions pc/debugger/Menu_Bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,12 @@ int Menu_Bar::About_Context::clicked_patreon(void *nada)
{
DEBUGLOG("CLICKED PATREON\n");
openUrl(PATREON_URL);
return 0;
}

int Menu_Bar::About_Context::clicked_merch(void *nada)
{
DEBUGLOG("CLICKED MERCH\n");
openUrl(MERCH_URL);
return 0;
}
10 changes: 6 additions & 4 deletions pc/debugger/content_areas/Dsp_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ int Dsp_Window::receive_event(SDL_Event &ev)
{
default:break;
}
return;
return 0;
}

dblclick::check_event(&ev);
Expand Down Expand Up @@ -1276,12 +1276,12 @@ int Dsp_Window::receive_event(SDL_Event &ev)
case SDL_MOUSEBUTTONDOWN:
{
if (screw_clickable.check_mouse_and_execute(ev.button.x, ev.button.y))
return;
return 0;
for (int i=0; i < NUM_TIMERS; i++)
{
timers.num = i;
if (timers.label[i].check_mouse_and_execute(ev.button.x, ev.button.y))
return;
return 0;
}
/* NOTE: Add code here to check for clicks over DIR entries */
for (int i=0; i < NUM_DIR_ENTRIES_DISPLAYED; i++)
Expand All @@ -1291,7 +1291,7 @@ int Dsp_Window::receive_event(SDL_Event &ev)
dir_rects[i].check_mouse_and_execute(ev.button.x, ev.button.y) ) ||
( ev.button.button == SDL_BUTTON_LEFT &&
loop_clickable[i].clickable_text.check_mouse_and_execute(ev.button.x, ev.button.y)) )
return;
return 0;
}
for (int i=0; i < MAX_VOICES; i++)
{
Expand All @@ -1305,6 +1305,7 @@ int Dsp_Window::receive_event(SDL_Event &ev)
default:
break;
}
return 0;
}

int Dsp_Window::dir_rect_clicked(void *idx)
Expand All @@ -1327,4 +1328,5 @@ int Dsp_Window::dir_rect_clicked(void *idx)

::brrcontext.menu.preload(mouse::x, mouse::y);
::brrcontext.menu.activate();
return 0;
}
1 change: 1 addition & 0 deletions pc/debugger/content_areas/Instrument_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ int Instrument_Window::receive_event(SDL_Event &ev)
default:
break;
}
return 0;
}

void Instrument_Window::set_voice(unsigned char v)
Expand Down
3 changes: 2 additions & 1 deletion pc/debugger/content_areas/Main_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int Main_Window::receive_event(SDL_Event &ev)
{
default:break;
}
return;
return 0;
}
check_quit(ev);

Expand Down Expand Up @@ -891,6 +891,7 @@ int Main_Window::receive_event(SDL_Event &ev)
default:
break;
}
return 0;
}

void Main_Window::run()
Expand Down
7 changes: 7 additions & 0 deletions pc/ext/NativeFileDialog/nfd_cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
#include "nfd.h"
#include "nfd_common.h"

/* OSX Compatibility Hack for MacOS < 10.9. This was tested on 10.6.8 Snow Leopard */
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
# if __MAC_OS_X_VERSION_MAX_ALLOWED < 1090
# define NSModalResponseOK NSAlertDefaultReturn
# endif
#endif

static NSArray *BuildAllowedFileTypes( const char *filterList )
{
// Commas and semicolons are the same thing on this platform
Expand Down
6 changes: 4 additions & 2 deletions pc/ext/lzma1505/C/Util/7z/makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ else ifeq ($(uname_S), Cross_Windows)
endif

ifeq ($(uname_S), Darwin)
OSX_BACKSUPPORT = -arch x86_64 -mmacosx-version-min=10.9 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1090
ifeq ($(OSX_BACKSUPPORT), 1)
OSX_BACKSUPPORT = -arch x86_64 -mmacosx-version-min=10.9 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1090
endif
CFLAGS += $(OSX_BACKSUPPORT)
LDFLAGS += $(OSX_BACKSUPPORT)
endif
Expand Down
6 changes: 4 additions & 2 deletions pc/ext/unrar/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ else ifeq ($(uname_S), Cross_Windows)
endif

ifeq ($(uname_S), Darwin)
OSX_BACKSUPPORT = -arch x86_64 -mmacosx-version-min=10.9 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1090
ifeq ($(OSX_BACKSUPPORT), 1)
OSX_BACKSUPPORT = -arch x86_64 -mmacosx-version-min=10.9 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1090
endif
CXXFLAGS += $(OSX_BACKSUPPORT)
LDFLAGS += $(OSX_BACKSUPPORT)
endif
Expand Down
2 changes: 1 addition & 1 deletion pc/shared/Experience.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ struct Experience
virtual void run() {};
virtual void one_time_draw() {}
virtual void draw() {};
virtual int receive_event(SDL_Event &ev) {};
virtual int receive_event(SDL_Event &ev) {return 0;};
};
2 changes: 2 additions & 0 deletions pc/shared/SdlNfd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ int SdlNfd::init(SDL_Window *win)
return -2; // already loaded*/

_sdlWindow = win;

return 0;
}


Expand Down
2 changes: 1 addition & 1 deletion pc/shared/gui/MouseCursors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void MouseCursors::prev()
set_cursor(index);
}

int MouseCursors::handle_event(const SDL_Event &ev)
void MouseCursors::handle_event(const SDL_Event &ev)
{
BmpCursorAni::handle_event(ev);
MouseTextureAni::handle_event(ev);
Expand Down
2 changes: 1 addition & 1 deletion pc/shared/gui/MouseCursors.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct MouseCursors
void next();
void prev();

int handle_event(const SDL_Event &ev);
void handle_event(const SDL_Event &ev);
void draw_aux();

private:
Expand Down
3 changes: 2 additions & 1 deletion pc/shared/gui/Spc_Export_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Spc_Export_Window::~Spc_Export_Window()
int Spc_Export_Window::init()
{
// Prepare SPC memory area for export
return 0;
}

void Spc_Export_Window::show()
Expand Down Expand Up @@ -151,7 +152,7 @@ int Spc_Export_Window::receive_event(SDL_Event &ev)
case SDL_MOUSEBUTTONDOWN:
{
if (export_button.check_mouse_and_execute(mouse::prescaled_x, mouse::prescaled_y))
return;
return 0;
//if (r) return r;
} break;

Expand Down
1 change: 1 addition & 0 deletions pc/shared/gui/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bool Tab::check_mouse_and_execute(int x, int y, void *newdata/*=NULL*/)
{
if (enabled)
return Clickable_Rect::check_mouse_and_execute(x,y,newdata);
else {return false;}
}

int Tab::horiz_pixel_length()
Expand Down
2 changes: 2 additions & 0 deletions pc/shared/gui/Text_Edit_Rect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static inline int check_dblclick(const SDL_Event &ev, Text_Edit_Rect *ter)
break;
default:break;
}
return 0;
}

void Text_Edit_Rect::stop_editing(Text_Edit_Rect *ter/*=cur_editing_ter*/)
Expand Down Expand Up @@ -244,6 +245,7 @@ int Text_Edit_Rect::clicked_callback(void *data)
SDL_StopTextInput();
Text_Edit_Rect::cursor.stop_timer();
}
return 0;
}

void Text_Edit_Rect::one_time_draw(SDL_Surface *screen)
Expand Down
2 changes: 2 additions & 0 deletions pc/shared/windows/Options_Window/Audio_Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ int Audio_Options::Context::change_audio_out_device(void *item)
SDL_Log("change_audio_out_device, %s", itemp->clickable_text.str);
if (ao->openDeviceonClick)
::player->init(::player->sample_rate, itemp->clickable_text.str);
return 0;
}

Audio_Options::Context::Context(Audio_Options *ao) : ao(ao)
Expand Down Expand Up @@ -131,4 +132,5 @@ int Audio_Options::receive_event(SDL_Event &ev)

default:break;
}
return 0;
}
7 changes: 7 additions & 0 deletions pc/tracker/BpmSpdAddWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ int BpmSpdAddWidget::handle_event(const SDL_Event &ev)

add_incbtn.check_event(ev);
add_decbtn.check_event(ev);
return 0;
}

//void BpmSpdAddWidget::one_time_draw(SDL_Surface *screen/*=::render->screen*/)
Expand Down Expand Up @@ -128,37 +129,43 @@ int BpmSpdAddWidget::incbpm(void *bsaw)
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->tracker->song.settings.inc_bpm();
b->updatebpm();
return 0;
}

int BpmSpdAddWidget::decbpm(void *bsaw)
{
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->tracker->song.settings.dec_bpm();
b->updatebpm();
return 0;
}

int BpmSpdAddWidget::incspd(void *bsaw)
{
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->tracker->song.settings.inc_spd();
b->updatespd();
return 0;
}

int BpmSpdAddWidget::decspd(void *bsaw)
{
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->tracker->song.settings.dec_spd();
b->updatespd();
return 0;
}

int BpmSpdAddWidget::incadd(void *bsaw)
{
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->pep->inc_addval();
return 0;
}

int BpmSpdAddWidget::decadd(void *bsaw)
{
BpmSpdAddWidget *b = (BpmSpdAddWidget *)bsaw;
b->pep->dec_addval();
return 0;
}
2 changes: 2 additions & 0 deletions pc/tracker/ChunkLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ size_t VersionChunkLoader::save(SDL_RWops *file)
SDL_RWseek(file, chunksize_location, RW_SEEK_SET);
SDL_RWwrite(file, &chunklen, 2, 1);
SDL_RWseek(file, chunkend_location, RW_SEEK_SET);
return 0;
}

size_t VersionChunkLoader::load(SDL_RWops *file, size_t chunksize)
Expand Down Expand Up @@ -376,4 +377,5 @@ size_t VersionChunkLoader::load(SDL_RWops *file, size_t chunksize)
maxread += subchunksize;
}
}
return 0;
}