summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-03-29 01:50:47 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-03-29 01:50:47 +0000
commit4b451d014b0e8dbbe71c61eee19445b567a2e581 (patch)
tree02f92fe3af2c922936134d9df654726a6f5e8bca
parentdca90ae6a6e6472c0fd597598651e10c4414be34 (diff)
downloadpcsxr-4b451d014b0e8dbbe71c61eee19445b567a2e581.tar.gz
OS X:
More work on the QL importer. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89711 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/Pcsxr-QL/GeneratePreviewForURL.m11
-rw-r--r--macosx/Pcsxr-QL/nopic.h4
-rw-r--r--macosx/Pcsxr.xcodeproj/project.pbxproj25
3 files changed, 24 insertions, 16 deletions
diff --git a/macosx/Pcsxr-QL/GeneratePreviewForURL.m b/macosx/Pcsxr-QL/GeneratePreviewForURL.m
index 106f1bfb..20cee6ba 100644
--- a/macosx/Pcsxr-QL/GeneratePreviewForURL.m
+++ b/macosx/Pcsxr-QL/GeneratePreviewForURL.m
@@ -28,7 +28,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
unsigned char *pMem = (unsigned char *) malloc(128*96*3);
if (pMem == NULL)
return mFulErr;
-
+
f = gzopen(state_filename, "rb");
if (f != NULL) {
gzseek(f, 32, SEEK_SET); // skip header
@@ -36,17 +36,18 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
gzseek(f, sizeof(uint8_t), SEEK_CUR);
gzread(f, pMem, 128*96*3);
gzclose(f);
-
+ } else {
memcpy(pMem, NoPic_Image.pixel_data, 128*96*3);
}
- NSBitmapImageRep *imRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char**)&NoPic_Image.pixel_data pixelsWide:NoPic_Image.width pixelsHigh:NoPic_Image.height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:0 bytesPerRow:NoPic_Image.width * NoPic_Image.bytes_per_pixel bitsPerPixel:24];
+
+ NSBitmapImageRep *imRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&pMem pixelsWide:NoPic_Image.width pixelsHigh:NoPic_Image.height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:0 bytesPerRow:NoPic_Image.width * NoPic_Image.bytes_per_pixel bitsPerPixel:24];
if (imRep) {
data = [imRep TIFFRepresentation];
QLPreviewRequestSetDataRepresentation(preview, (__bridge CFDataRef)(data), kUTTypeImage, NULL);
}
-
- return noErr;
+ free(pMem);
}
+ return noErr;
}
void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview)
diff --git a/macosx/Pcsxr-QL/nopic.h b/macosx/Pcsxr-QL/nopic.h
index 311e1931..c1dc1609 100644
--- a/macosx/Pcsxr-QL/nopic.h
+++ b/macosx/Pcsxr-QL/nopic.h
@@ -246,7 +246,7 @@ static void PaintPicDot(unsigned char * p,unsigned char c)
/////////////////////////////////////////////////////////////////////
// generic number/border painter
-static void DrawNumBorPic(unsigned char *pMem, int lSelectedSlot)
+static inline void DrawNumBorPic(unsigned char *pMem, int lSelectedSlot)
{
unsigned char *pf;
int x,y;
@@ -293,7 +293,7 @@ static void DrawNumBorPic(unsigned char *pMem, int lSelectedSlot)
/* GIMP RGB C-Source image dump (NoPic.h) */
-static struct {
+static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj
index dfd1c693..2477fe68 100644
--- a/macosx/Pcsxr.xcodeproj/project.pbxproj
+++ b/macosx/Pcsxr.xcodeproj/project.pbxproj
@@ -260,6 +260,13 @@
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
+ 550E347818E65D8B00A1AD21 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 550E343618E6293D00A1AD21;
+ remoteInfo = "Pcsxr-QL";
+ };
551A76F4178697CF0052D185 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@@ -1765,6 +1772,7 @@
551A778F17869F4B0052D185 /* PBXTargetDependency */,
551A779117869F4B0052D185 /* PBXTargetDependency */,
551A779317869F4B0052D185 /* PBXTargetDependency */,
+ 550E347918E65D8B00A1AD21 /* PBXTargetDependency */,
);
name = PCSXR;
productInstallPath = "$(USER_APPS_DIR)";
@@ -2399,6 +2407,11 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
+ 550E347918E65D8B00A1AD21 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 550E343618E6293D00A1AD21 /* Pcsxr-QL */;
+ targetProxy = 550E347818E65D8B00A1AD21 /* PBXContainerItemProxy */;
+ };
551A76F5178697CF0052D185 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 551A76E61786971B0052D185 /* SPUSharedCode */;
@@ -2870,14 +2883,12 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Pcsxr-QL/Pcsxr-QL-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
INFOPLIST_FILE = "Pcsxr-QL/Pcsxr-QL-Info.plist";
INSTALL_PATH = /Library/QuickLook;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2892,7 +2903,6 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -2900,7 +2910,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Pcsxr-QL/Pcsxr-QL-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
INFOPLIST_FILE = "Pcsxr-QL/Pcsxr-QL-Info.plist";
INSTALL_PATH = /Library/QuickLook;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2915,7 +2924,6 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -2923,7 +2931,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Pcsxr-QL/Pcsxr-QL-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
INFOPLIST_FILE = "Pcsxr-QL/Pcsxr-QL-Info.plist";
INSTALL_PATH = /Library/QuickLook;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3371,7 +3378,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -3645,7 +3652,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -3673,7 +3680,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;