Skip to content

Commit

Permalink
Copy over font files
Browse files Browse the repository at this point in the history
  • Loading branch information
PGGB committed Feb 1, 2014
1 parent e5ee432 commit 5c1458b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
4 changes: 4 additions & 0 deletions PPSSPP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
8C9959191785DE3A00EE4CA8 /* kirk_engine.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CAFA94E1785B3C200647A96 /* kirk_engine.c */; };
8C99591B1785DE3A00EE4CA8 /* SHA1.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CAFA9521785B3C200647A96 /* SHA1.c */; };
8C99591D1785DE4400EE4CA8 /* xbrz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CAFA9621785B3C200647A96 /* xbrz.cpp */; };
8C99CCCD189DB0D4004E6F63 /* flash0 in Resources */ = {isa = PBXBuildFile; fileRef = 8C99CCCC189DB0D4004E6F63 /* flash0 */; };
8CA153F417C412410003002D /* VirtualDiscFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CA153C217C410220003002D /* VirtualDiscFileSystem.cpp */; };
8CA153F617C412480003002D /* AsyncIOManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CA153C517C4108D0003002D /* AsyncIOManager.cpp */; };
8CA153F717C4125D0003002D /* Clipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CA153E617C411BC0003002D /* Clipper.cpp */; };
Expand Down Expand Up @@ -510,6 +511,7 @@
8C8447A5186B84CE00BE03D5 /* utf16.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utf16.h; sourceTree = "<group>"; };
8C8447A6186B84CE00BE03D5 /* parsers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = parsers.cpp; sourceTree = "<group>"; };
8C8447AA186B8DD600BE03D5 /* gl_common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gl_common.h; sourceTree = "<group>"; };
8C99CCCC189DB0D4004E6F63 /* flash0 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = flash0; sourceTree = "<group>"; };
8CA153BA17C40FA60003002D /* CommonWindows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonWindows.h; sourceTree = "<group>"; };
8CA153BC17C40FBA0003002D /* Swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Swap.h; sourceTree = "<group>"; };
8CA153BE17C40FF40003002D /* ppcEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ppcEmitter.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1427,6 +1429,7 @@
8CAFA7E41785B3C200647A96 /* Common */,
8CAFA83F1785B3C200647A96 /* Core */,
8CAFA9421785B3C200647A96 /* ext */,
8C99CCCC189DB0D4004E6F63 /* flash0 */,
8CAFBAB81785B3D200647A96 /* git-version.cmake */,
8CAFBAB91785B3D200647A96 /* Globals.h */,
8CAFBABA1785B3D200647A96 /* GPU */,
Expand Down Expand Up @@ -2882,6 +2885,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8C99CCCD189DB0D4004E6F63 /* flash0 in Resources */,
8CBB2C1F1790535A00349818 /* ppge_atlas.zim in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
45 changes: 30 additions & 15 deletions PPSSPPGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,25 @@ - (void)dealloc

- (BOOL)loadFileAtPath:(NSString *)path
{
NSString *resourcePath = [[[self owner] bundle] resourcePath];
NSString *supportDirectoryPath = [self supportDirectoryPath];

// Copy over font files if needed
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *fontSourceDirectory = [resourcePath stringByAppendingString:@"/flash0/font/"];
NSString *fontDestinationDirectory = [supportDirectoryPath stringByAppendingString:@"/font/"];
NSArray *fontFiles = [fileManager contentsOfDirectoryAtPath:fontSourceDirectory error:nil];
for(NSString *font in fontFiles)
{
NSString *fontSource = [fontSourceDirectory stringByAppendingString:font];
NSString *fontDestination = [fontDestinationDirectory stringByAppendingString:font];

[fileManager copyItemAtPath:fontSource toPath:fontDestination error:nil];
}

g_Config.Load("");

NSString *directoryString = [[self supportDirectoryPath] stringByAppendingString:@"/"];
NSString *directoryString = [supportDirectoryPath stringByAppendingString:@"/"];
g_Config.currentDirectory = [directoryString UTF8String];
g_Config.externalDirectory = [directoryString UTF8String];
g_Config.memCardDirectory = [directoryString UTF8String];
Expand All @@ -87,22 +103,22 @@ - (BOOL)loadFileAtPath:(NSString *)path
g_Config.iShowFPSCounter = true;
g_Config.bFrameSkipUnthrottle = false;

_coreParam.cpuCore = CPU_JIT;
_coreParam.gpuCore = GPU_GLES;
_coreParam.enableSound = true;
_coreParam.fileToStart = [path UTF8String];
_coreParam.mountIso = "";
_coreParam.startPaused = false;
_coreParam.printfEmuLog = false;
_coreParam.headLess = false;
_coreParam.cpuCore = CPU_JIT;
_coreParam.gpuCore = GPU_GLES;
_coreParam.enableSound = true;
_coreParam.fileToStart = [path UTF8String];
_coreParam.mountIso = "";
_coreParam.startPaused = false;
_coreParam.printfEmuLog = false;
_coreParam.headLess = false;
_coreParam.unthrottle = true;

_coreParam.renderWidth = 480;
_coreParam.renderHeight = 272;
_coreParam.outputWidth = 480;
_coreParam.outputHeight = 272;
_coreParam.pixelWidth = 480;
_coreParam.pixelHeight = 272;
_coreParam.renderHeight = 272;
_coreParam.outputWidth = 480;
_coreParam.outputHeight = 272;
_coreParam.pixelWidth = 480;
_coreParam.pixelHeight = 272;

return YES;
}
Expand Down Expand Up @@ -160,7 +176,6 @@ - (void)executeFrame

int samplesWritten = NativeMix((short *)_soundBuffer, SAMPLERATE / _frameInterval);
[[self ringBufferAtIndex:0] write:_soundBuffer maxLength:sizeof(uint16_t) * samplesWritten * 2];

}

# pragma mark - Video
Expand Down

0 comments on commit 5c1458b

Please sign in to comment.