Skip to content

Commit

Permalink
Fixing compilation errors for Emscripten port.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen committed Jun 24, 2013
1 parent 80cb06d commit 62902ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cocos2dx/platform/emscripten/CCTextureCacheEmscripten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ using namespace std;
// Following methods are implemented in TextureCacheEmscripten.js:
extern "C" {
void cocos2dx_newAsyncImageLoader(int textureCache, int callback__ignored);
void cocos2dx_asyncImageLoader_LoadImage(const char *path, AsyncStruct *asyncData);
void cocos2dx_asyncImageLoader_LoadImage(const char *path, TextureCache::AsyncStruct *asyncData);
void cocos2dx_shutdownAsyncImageLoader();
};

extern "C" {
// This C interface is exposed so that the JavaScript in
// TextureCacheEmscripten.js is able to call into these functions.
void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, AsyncStruct *data, unsigned char *imgData, int width, int height);
void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, TextureCache::AsyncStruct *data, unsigned char *imgData, int width, int height);
void TextureCacheEmscripten_preMultiplyImageRegion( unsigned char *in, int win, int hin, unsigned char *out, int wout, int hout, int xout, int yout);
};

void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, AsyncStruct *data, unsigned char *imgData, int width, int height)
void TextureCacheEmscripten_addImageAsyncCallBack(TextureCacheEmscripten *tc, TextureCache::AsyncStruct *data, unsigned char *imgData, int width, int height)
{
tc->addImageAsyncCallBack_emscripten(data, imgData, width, height);
}
Expand Down
3 changes: 2 additions & 1 deletion cocos2dx/textures/CCTextureCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class CC_DLL TextureCache : public Object
void loadImage();
Image::EImageFormat computeImageFormatType(std::string& filename);

private:
public:
struct AsyncStruct
{
public:
Expand All @@ -167,6 +167,7 @@ class CC_DLL TextureCache : public Object
SEL_CallFuncO selector;
};

protected:
typedef struct _ImageInfo
{
AsyncStruct *asyncStruct;
Expand Down

0 comments on commit 62902ad

Please sign in to comment.