Projects > cpp > Issues > Feature #3324

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Add an API Texture2D* TextureCache::addImage(Image *image, cons char * key)

Feature #3324 [Closed]
birdflying1005 2013-11-30 05:04 . Updated over 10 years ago

I am using TextureCache::addImage, why not add an API

Texture2D* TextureCache::addImage(Image image, cons charkey) ?

birdflying1005 2013-11-30 05:48

I am sorry, I mean to add an API like :

Texture2D * TextureCache::addImage(const std::string &path, const std::string &key);

birdflying1005 2013-11-30 06:30

Texture2D * TextureCache::addImage(const std::string &path)

Currently, the implementation is to convert the path to the real path, and put the real path as the key to store image into map.

_textures.insert( std::make_pair(fullpath, texture) );

When I use TextureCache::getInstance()->getTextureForKey to get the image, I have to input the real path of the image as the key to query it. Complicated and unreasonable a bit.

Regards,
Sean

walzer@cocos2d-x.org 2014-10-08 02:55

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8273

Atom PDF

Status:Closed
Start date:2013-11-30
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:all
Target version:-