enabled HAVE_LIBZ by default for Cocoa builds. this enables save states for people building from source

This commit is contained in:
gecko_reverse 2008-04-06 10:26:05 +00:00
parent 764697ec8c
commit abd5e1bcb3
4 changed files with 27 additions and 9 deletions

View File

@ -70,13 +70,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]>
<Compiler>
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-g" />
<Add option="-DDESMUME_COCOA" />
<Add option="-DHAVE_LIBZ" />
</Compiler>
<Linker>
<Add option="-framework Cocoa" />
<Add option="-framework OpenGL" />
<Add option="-framework AudioUnit" />
<Add option="-lz" />
</Linker>
<ExtraCommands>
<Add after="./makeapp.sh" />

View File

@ -465,11 +465,15 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DESMUME_COCOA;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_LIBZ,
DESMUME_COCOA,
);
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-lz";
PREBINDING = NO;
SDKROOT = macosx10.4;
};
@ -480,10 +484,14 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_PREPROCESSOR_DEFINITIONS = DESMUME_COCOA;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_LIBZ,
DESMUME_COCOA,
);
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-lz";
PREBINDING = NO;
SDKROOT = macosx10.4;
};

View File

@ -174,7 +174,7 @@ void CreateMenu(AppDelegate *delegate)
[file addItem:[NSMenuItem separatorItem]];
temp = [file addItemWithTitle:NSLocalizedString(@"Save State", nil) action:@selector(saveTo:) keyEquivalent:@""];
temp = [file addItemWithTitle:NSLocalizedString(@"Save State", nil) action:nil keyEquivalent:@""];
NSMenu *save_state_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Save State", nil)];
[temp setSubmenu:save_state_menu];
@ -185,11 +185,9 @@ void CreateMenu(AppDelegate *delegate)
for(i = 0; i < SAVE_SLOTS; i++)
{
saveSlot_item[i] = [save_state_menu addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Slot %d", nil), i] action:@selector(saveToSlot:) keyEquivalent:@""];
[saveSlot_item[i] setEnabled:NO];
loadSlot_item[i] = [load_state_menu addItemWithTitle:[saveSlot_item[i] title] action:@selector(loadFromSlot:) keyEquivalent:@""];
[loadSlot_item[i] setEnabled:NO];
}
//fixme changed save state item function names
/* To be implemented when saves.h provides
a way to get the time of a save that's not string/human formatted...
@ -225,6 +223,10 @@ a way to get the time of a save that's not a string / human formatted...
temp = [load_state_menu addItemWithTitle:@"View States" action:nil keyEquivalent:@""];
*/
[save_state_menu release];
[load_state_menu release];
#else
for(i = 0; i < SAVE_SLOTS; i++)
{

View File

@ -1275,7 +1275,6 @@ NSMenuItem *screenshot_to_file_item;
[volume_item[i] setTarget:self];
}
//Update the ROM Info window
if([self ROMLoaded] == YES)
[ROMInfo changeDS:self];
@ -1288,13 +1287,14 @@ NSMenuItem *screenshot_to_file_item;
//This function is called automaticlly by Cocoa
//when it needs to know if a menu item should be greyed out
int i;
if([self ROMLoaded] == NO)
{ //if no rom is loaded, various options are disables
if(item == close_rom_item)return NO;
if(item == rom_info_item)return NO;
if(item == save_state_as_item)return NO;
if(item == load_state_from_item)return NO;
int i;
for(i = 0; i < MAX_SLOTS; i++)
{
if(item == saveSlot_item[i])return NO;
@ -1308,6 +1308,13 @@ NSMenuItem *screenshot_to_file_item;
if(item == screenshot_to_file_item)return NO;
}
else
for(i = 0; i < MAX_SLOTS; i++)
if(item == loadSlot_item[i])
if([self saveStateExists:i]==NO)return NO;
return YES;
}