mirror of
https://github.com/CTurt/dsgmLib.git
synced 2025-06-18 14:45:43 -04:00
Select whether to use saving in the Makefile
This commit is contained in:
parent
c9b87ec095
commit
517d421d00
@ -45,6 +45,11 @@ CFLAGS := -g -Wall -O2 -fms-extensions\
|
||||
$(ARCH)
|
||||
|
||||
CFLAGS += $(INCLUDE) -DARM9 -DGAME_NAME=\"$(GAME_TITLE)\"
|
||||
|
||||
ifeq ($(USES_SAVING),YES)
|
||||
CFLAGS += -DUSES_SAVING
|
||||
endif
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
ASFLAGS := -g $(ARCH)
|
||||
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := YES
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := YES
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -9,19 +9,23 @@
|
||||
#define DSGM_GotoNextRoom(persistent) DSGM_SwitchRoom(DSGM_currentRoom + 1, persistent)
|
||||
|
||||
void DSGM_InitSaving(int argc, char **argv) {
|
||||
if(argc > 0 && strlen(argv[0]) > 4) {
|
||||
snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]);
|
||||
}
|
||||
else {
|
||||
sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav");
|
||||
}
|
||||
|
||||
DSGM_save = fopen(DSGM_saveName, "r+b");
|
||||
|
||||
if(!DSGM_save) {
|
||||
DSGM_save = fopen(DSGM_saveName, "wb");
|
||||
fclose(DSGM_save);
|
||||
}
|
||||
#if USES_SAVING
|
||||
DSGM_Debug("InitSaving\n");
|
||||
|
||||
if(argc > 0 && strlen(argv[0]) > 4) {
|
||||
snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]);
|
||||
}
|
||||
else {
|
||||
sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav");
|
||||
}
|
||||
|
||||
DSGM_save = fopen(DSGM_saveName, "r+b");
|
||||
|
||||
if(!DSGM_save) {
|
||||
DSGM_save = fopen(DSGM_saveName, "wb");
|
||||
fclose(DSGM_save);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void DSGM_Init(int argc, char **argv) {
|
||||
|
BIN
lib/libdsgm.a
BIN
lib/libdsgm.a
Binary file not shown.
@ -1,2 +1,4 @@
|
||||
USES_SAVING := NO
|
||||
|
||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user