summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-10-13 20:39:01 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-10-13 20:39:01 +0000
commit949b0bc5002cd94dcbf37ef23f6c32d41d62c704 (patch)
treed2ca3afb1b6daa71215e0983d62315f9818e9e19
parent221dab875d4756a11ba1418a75a05b8b486968e7 (diff)
downloadpcsxr-949b0bc5002cd94dcbf37ef23f6c32d41d62c704.tar.gz
Fixing naming convention on a Cocoa function.
Fixing string format in a Cocoa string. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@80390 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/English.lproj/Localizable.strings2
-rw-r--r--macosx/PcsxrPlugin.h2
-rw-r--r--macosx/PcsxrPlugin.m22
-rw-r--r--macosx/PluginList.h1
-rw-r--r--macosx/PluginList.m18
5 files changed, 22 insertions, 23 deletions
diff --git a/macosx/English.lproj/Localizable.strings b/macosx/English.lproj/Localizable.strings
index 20d26d35..518ab7f1 100644
--- a/macosx/English.lproj/Localizable.strings
+++ b/macosx/English.lproj/Localizable.strings
@@ -7,7 +7,7 @@
*/
"Plugin Initialization Failed!" = "Plugin Initialization Failed!";
-"Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system." = "Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system.";
+"Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system." = "Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system.";
"Error!" = "Error!";
"Installation Succesfull" = "Installation Succesfull";
"Installation Failed!" = "Installation Failed!";
diff --git a/macosx/PcsxrPlugin.h b/macosx/PcsxrPlugin.h
index 63181135..dd5347e6 100644
--- a/macosx/PcsxrPlugin.h
+++ b/macosx/PcsxrPlugin.h
@@ -35,7 +35,7 @@
- (NSString *)description;
- (BOOL)hasAboutAs:(int)type;
- (BOOL)hasConfigureAs:(int)type;
-- (long)initAs:(int)aType;
+- (long)runAs:(int)aType;
- (long)shutdownAs:(int)aType;
- (void)aboutAs:(int)type;
- (void)configureAs:(int)type;
diff --git a/macosx/PcsxrPlugin.m b/macosx/PcsxrPlugin.m
index b1d5a8e6..7c010ef1 100644
--- a/macosx/PcsxrPlugin.m
+++ b/macosx/PcsxrPlugin.m
@@ -104,7 +104,7 @@
pluginRef = nil;
name = nil;
- path = [aPath retain];
+ path = [aPath copy];
long tempVers = 0;
NSString *goodPath = nil;
for (NSString *plugDir in [PcsxrPlugin pluginsPaths])
@@ -134,10 +134,10 @@
}
pluginRef = SysLoadLibrary([goodPath fileSystemRepresentation]);
- if (pluginRef == nil) {
- [self release];
- return nil;
- }
+ if (pluginRef == nil) {
+ [self release];
+ return nil;
+ }
// TODO: add support for plugins with multiple functionalities???
PSE_getLibType = (PSEgetLibType) SysLoadSym(pluginRef, "PSEgetLibType");
@@ -172,8 +172,7 @@
PSE_getLibVersion = (PSEgetLibVersion) SysLoadSym(pluginRef, "PSEgetLibVersion");
if (SysLibError() == nil) {
version = PSE_getLibVersion();
- }
- else {
+ } else {
version = -1;
}
@@ -226,7 +225,7 @@
return;
}
-- (long)initAs:(int)aType
+- (long)runAs:(int)aType
{
char symbol[255];
long (*init)();
@@ -240,17 +239,18 @@
sprintf(symbol, "%sinit", [[PcsxrPlugin prefixForType:aType] cStringUsingEncoding:NSASCIIStringEncoding]);
init = initArg = SysLoadSym(pluginRef, symbol);
if (SysLibError() == nil) {
- if (aType != PSE_LT_PAD)
+ if (aType != PSE_LT_PAD) {
res = init();
- else
+ } else {
res = initArg(1|2);
+ }
}
if (0 == res) {
active |= aType;
} else {
NSRunCriticalAlertPanel(NSLocalizedString(@"Plugin Initialization Failed!", nil),
- [NSString stringWithFormat:NSLocalizedString(@"Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system.", nil), [PcsxrPlugin prefixForType:aType], res],
+ [NSString stringWithFormat:NSLocalizedString(@"Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system.", nil), [PcsxrPlugin prefixForType:aType], res],
nil, nil, nil);
}
diff --git a/macosx/PluginList.h b/macosx/PluginList.h
index 51ba5066..8eaa6727 100644
--- a/macosx/PluginList.h
+++ b/macosx/PluginList.h
@@ -12,7 +12,6 @@
//extern NSMutableArray *plugins;
@interface PluginList : NSObject {
-
@private
NSMutableArray *pluginList;
diff --git a/macosx/PluginList.m b/macosx/PluginList.m
index 7f340f65..72ec6aa0 100644
--- a/macosx/PluginList.m
+++ b/macosx/PluginList.m
@@ -153,7 +153,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
NSUInteger i;
// verify that the ones that are in list still works
- for (i=0; i<[pluginList count]; i++) {
+ for (i=0; i < [pluginList count]; i++) {
if (![[pluginList objectAtIndex:i] verifyOK]) {
[pluginList removeObjectAtIndex:i]; i--;
}
@@ -183,13 +183,13 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
// check the we have the needed plugins
missingPlugins = NO;
- for (i=0; i<sizeof(*typeList); i++) {
+ for (i=0; i < sizeof(*typeList); i++) {
PcsxrPlugin *plugin = [self activePluginForType:typeList[i]];
if (nil == plugin) {
NSArray *list = [self pluginsForType:typeList[i]];
NSUInteger j;
- for (j=0; j<[list count]; j++) {
+ for (j=0; j < [list count]; j++) {
if ([self setActivePlugin:[list objectAtIndex:j] forType:typeList[i]])
break;
}
@@ -235,11 +235,11 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
{
BOOL bad = NO;
- if ([activeGpuPlugin initAs:PSE_LT_GPU] != 0) bad = YES;
- if ([activeSpuPlugin initAs:PSE_LT_SPU] != 0) bad = YES;
- if ([activeCdrPlugin initAs:PSE_LT_CDR] != 0) bad = YES;
- if ([activePadPlugin initAs:PSE_LT_PAD] != 0) bad = YES;
- if ([activeNetPlugin initAs:PSE_LT_NET] != 0) bad = YES;
+ if ([activeGpuPlugin runAs:PSE_LT_GPU] != 0) bad = YES;
+ if ([activeSpuPlugin runAs:PSE_LT_SPU] != 0) bad = YES;
+ if ([activeCdrPlugin runAs:PSE_LT_CDR] != 0) bad = YES;
+ if ([activePadPlugin runAs:PSE_LT_PAD] != 0) bad = YES;
+ if ([activeNetPlugin runAs:PSE_LT_NET] != 0) bad = YES;
return !bad;
}
@@ -289,7 +289,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
}
*pluginPtr = [plugin retain];
if (*pluginPtr) {
- if ([*pluginPtr initAs:type] != 0) {
+ if ([*pluginPtr runAs:type] != 0) {
[*pluginPtr release];
*pluginPtr = nil;
}