More spriting stuff.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-09-26 00:27:38 -07:00
parent 1cd8acb92c
commit 72d4675ec4
4 changed files with 18 additions and 13 deletions
-9
View File
@@ -49,15 +49,6 @@ function CPImageInBundle(aFilename, aSize, aBundle)
return [[CPImage alloc] initWithContentsOfFile:[aBundle pathForResource:aFilename]];
}
@implementation CPBundle (CPImageAdditions)
- (CPString)pathForResource:(CPString)aFilename
{
return [self resourcePath] + '/' + aFilename;
}
@end
/*!
@ingroup appkit
@class CPImage
+9 -2
View File
@@ -99,8 +99,15 @@
}
- (CPString)pathForResource:(CPString)aFilename
{
return [self resourcePath] + '/' + aFilename;
{console.log("?!!!!!!!");
var path = [self resourcePath] + '/' + aFilename,
mappedPath = _URIMap["Resources/" + aFilename];//path];
console.log("~!THE MAPPED PATH FOR " + path + " IS " + mappedPath);
if (mappedPath)
return mappedPath;
return path;
}
- (CPDictionary)infoDictionary
@@ -499,6 +499,7 @@ BundleTask.prototype.defineSourceTasks = function()
filedir (staticPath, [compiledPlatformSource]);
// FIXME: how do we non flatten?
// dir in common
replacedFiles.push(flattensSources ? FILE.basename(aFilename) : FILE.relative(sourcesPath, aFilename));
}, this);
+8 -2
View File
@@ -69,7 +69,9 @@ function objj_bundle()
{
this.path = NULL;
this.info = NULL;
this._URIMap = { };
this.__address = _objj_generateObjectHash();
}
@@ -577,6 +579,7 @@ var OBJJUnrecognizedFormatException = "OBJJUnrecognizedFormatException";
var STATIC_MAGIC_NUMBER = "@STATIC",
MARKER_PATH = "p",
MARKER_URI = "u",
MARKER_CODE = "c",
MARKER_BUNDLE = "b",
MARKER_TEXT = "t",
@@ -618,7 +621,10 @@ function objj_decompile(aString, bundle)
objj_files[file.path] = file;
break;
case MARKER_URI: bundle._URIMap[text] = stream.getString();
break;
case MARKER_BUNDLE: var bundlePath = DIRECTORY(bundle.path) + '/' + text;
file.bundle = objj_getBundleWithPath(bundlePath);