mirror of https://github.com/axmolengine/axmol.git
Remove CCModuleManager.h/cpp and adjust the related project
This commit is contained in:
parent
70cba1f64a
commit
d1b4d43a0b
|
@ -1376,10 +1376,6 @@
|
|||
464AD6E6197EBB1400E502D8 /* pvr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 464AD6E3197EBB1400E502D8 /* pvr.cpp */; };
|
||||
464AD6E7197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; };
|
||||
464AD6E8197EBB1400E502D8 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 464AD6E4197EBB1400E502D8 /* pvr.h */; };
|
||||
46633BC4199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */; };
|
||||
46633BC5199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */; };
|
||||
46633BC6199DDB2F00F6E838 /* CCModuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */; };
|
||||
46633BC7199DDB2F00F6E838 /* CCModuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46633BC3199DDB2F00F6E838 /* CCModuleManager.h */; };
|
||||
46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */; };
|
||||
46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */; };
|
||||
46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */; };
|
||||
|
@ -2335,8 +2331,6 @@
|
|||
3EA4786F195478E00068D9D1 /* CCBundleReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBundleReader.h; sourceTree = "<group>"; };
|
||||
464AD6E3197EBB1400E502D8 /* pvr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pvr.cpp; path = ../base/pvr.cpp; sourceTree = "<group>"; };
|
||||
464AD6E4197EBB1400E502D8 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pvr.h; path = ../base/pvr.h; sourceTree = "<group>"; };
|
||||
46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCModuleManager.cpp; path = ../base/CCModuleManager.cpp; sourceTree = "<group>"; };
|
||||
46633BC3199DDB2F00F6E838 /* CCModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCModuleManager.h; path = ../base/CCModuleManager.h; sourceTree = "<group>"; };
|
||||
46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = "<group>"; };
|
||||
46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = "<group>"; };
|
||||
|
@ -3095,8 +3089,6 @@
|
|||
1A570095180BC5B00088DEC7 /* base-nodes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
46633BC2199DDB2F00F6E838 /* CCModuleManager.cpp */,
|
||||
46633BC3199DDB2F00F6E838 /* CCModuleManager.h */,
|
||||
15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */,
|
||||
15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */,
|
||||
1A57009C180BC5D20088DEC7 /* CCNode.cpp */,
|
||||
|
@ -5239,7 +5231,6 @@
|
|||
1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */,
|
||||
5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */,
|
||||
50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */,
|
||||
46633BC6199DDB2F00F6E838 /* CCModuleManager.h in Headers */,
|
||||
46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */,
|
||||
46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */,
|
||||
50ABBD3E1925AB0000A911A9 /* CCGeometry.h in Headers */,
|
||||
|
@ -5740,7 +5731,6 @@
|
|||
50ABC0041926664800A911A9 /* CCLock.h in Headers */,
|
||||
5034CA40191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */,
|
||||
50ABBEC21925AB6F00A911A9 /* CCValue.h in Headers */,
|
||||
46633BC7199DDB2F00F6E838 /* CCModuleManager.h in Headers */,
|
||||
50ABBECA1925AB6F00A911A9 /* firePngData.h in Headers */,
|
||||
B257B4511989D5E800D9A687 /* CCPrimitive.h in Headers */,
|
||||
50ABBE401925AB6F00A911A9 /* CCDataVisitor.h in Headers */,
|
||||
|
@ -6318,7 +6308,6 @@
|
|||
50ABBE651925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */,
|
||||
B37510781823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */,
|
||||
50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */,
|
||||
46633BC4199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */,
|
||||
1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */,
|
||||
50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */,
|
||||
1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */,
|
||||
|
@ -6826,7 +6815,6 @@
|
|||
50ABBE8C1925AB6F00A911A9 /* CCNS.cpp in Sources */,
|
||||
50ABBDAE1925AB4100A911A9 /* CCRenderer.cpp in Sources */,
|
||||
50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */,
|
||||
46633BC5199DDB2F00F6E838 /* CCModuleManager.cpp in Sources */,
|
||||
1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */,
|
||||
1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */,
|
||||
1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */,
|
||||
|
|
|
@ -249,7 +249,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
|||
<ClCompile Include="..\base\CCEventTouch.cpp" />
|
||||
<ClCompile Include="..\base\ccFPSImages.c" />
|
||||
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
|
||||
<ClCompile Include="..\base\CCModuleManager.cpp" />
|
||||
<ClCompile Include="..\base\CCNS.cpp" />
|
||||
<ClCompile Include="..\base\CCProfiling.cpp" />
|
||||
<ClCompile Include="..\base\ccRandom.cpp" />
|
||||
|
@ -573,7 +572,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
|||
<ClInclude Include="..\base\CCIMEDispatcher.h" />
|
||||
<ClInclude Include="..\base\ccMacros.h" />
|
||||
<ClInclude Include="..\base\CCMap.h" />
|
||||
<ClInclude Include="..\base\CCModuleManager.h" />
|
||||
<ClInclude Include="..\base\CCNS.h" />
|
||||
<ClInclude Include="..\base\CCPlatformConfig.h" />
|
||||
<ClInclude Include="..\base\CCPlatformMacros.h" />
|
||||
|
|
|
@ -730,9 +730,6 @@
|
|||
<ClCompile Include="..\renderer\CCVertexIndexData.cpp">
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\CCModuleManager.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base\ccRandom.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1696,9 +1693,6 @@
|
|||
<ClInclude Include="..\renderer\CCVertexIndexData.h">
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\CCModuleManager.h">
|
||||
<Filter>base</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\base\ccRandom.h">
|
||||
<Filter>base</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -114,7 +114,6 @@ base/CCEventListenerTouch.cpp \
|
|||
base/CCEventMouse.cpp \
|
||||
base/CCEventTouch.cpp \
|
||||
base/CCIMEDispatcher.cpp \
|
||||
base/CCModuleManager.cpp \
|
||||
base/CCNS.cpp \
|
||||
base/CCProfiling.cpp \
|
||||
base/ccRandom.cpp \
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "base/CCModuleManager.h"
|
||||
#include <unordered_map>
|
||||
#include "base/CCConsole.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//RegisterJPEG *temp = new RegisterJPEG();
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
void ModuleManager::registerModule(const string &moduleName, void* module)
|
||||
{
|
||||
auto &moduleMap = createMap();
|
||||
if (moduleMap.find(moduleName) != moduleMap.end())
|
||||
{
|
||||
CCLOG("module: %s exists", moduleName.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
moduleMap[moduleName] = module;
|
||||
}
|
||||
|
||||
void ModuleManager::unRegisterModule(const string &moduleName)
|
||||
{
|
||||
auto &moduleMap = createMap();
|
||||
moduleMap.erase(moduleName);
|
||||
}
|
||||
|
||||
void* ModuleManager::getModule(const string &moduleName)
|
||||
{
|
||||
auto &moduleMap = createMap();
|
||||
auto result = moduleMap.find(moduleName);
|
||||
if (result != moduleMap.end())
|
||||
{
|
||||
return result->second;
|
||||
}
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unordered_map<std::string, void*>& ModuleManager::createMap()
|
||||
{
|
||||
static unordered_map<string, void*> map;
|
||||
return map;
|
||||
}
|
||||
|
||||
NS_CC_END
|
|
@ -1,50 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2014 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BASE_CC_MODULE_MANAGER__
|
||||
#define __BASE_CC_MODULE_MANAGER__
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "base/CCPlatformMacros.h"
|
||||
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class CC_DLL ModuleManager
|
||||
{
|
||||
public:
|
||||
static void registerModule(const std::string &moduleName, void* module);
|
||||
static void unRegisterModule(const std::string &moduleName);
|
||||
static void* getModule(const std::string &moduleName);
|
||||
|
||||
private:
|
||||
static std::unordered_map<std::string, void*>& createMap();
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue