This commit is contained in:
halx99 2021-10-25 20:29:40 +08:00
parent 9183c664ce
commit 45607062bd
5 changed files with 8 additions and 9 deletions

View File

@ -35,7 +35,7 @@ THE SOFTWARE.
NS_CC_BEGIN NS_CC_BEGIN
extern const char* cocos2dVersion(); extern const char* adxeVersion();
Configuration* Configuration::s_sharedConfiguration = nullptr; Configuration* Configuration::s_sharedConfiguration = nullptr;
@ -66,7 +66,7 @@ Configuration::Configuration()
bool Configuration::init() bool Configuration::init()
{ {
_valueDict["adxe.version"] = Value(cocos2dVersion()); _valueDict["adxe.version"] = Value(adxeVersion());
#if CC_ENABLE_PROFILERS #if CC_ENABLE_PROFILERS

View File

@ -70,7 +70,7 @@
NS_CC_BEGIN NS_CC_BEGIN
extern const char* cocos2dVersion(void); extern const char* adxeVersion(void);
#define PROMPT "> " #define PROMPT "> "
#define DEFAULT_COMMAND_SEPARATOR '|' #define DEFAULT_COMMAND_SEPARATOR '|'
@ -1518,7 +1518,7 @@ void Console::commandUpload(socket_native_type fd)
void Console::commandVersion(socket_native_type fd, const std::string& /*args*/) void Console::commandVersion(socket_native_type fd, const std::string& /*args*/)
{ {
Console::Utility::mydprintf(fd, "%s\n", cocos2dVersion()); Console::Utility::mydprintf(fd, "%s\n", adxeVersion());
} }
// helper free functions // helper free functions

View File

@ -75,7 +75,6 @@ NS_CC_BEGIN
static Director *s_SharedDirector = nullptr; static Director *s_SharedDirector = nullptr;
#define kDefaultFPS 60 // 60 frames per second #define kDefaultFPS 60 // 60 frames per second
extern const char* cocos2dVersion();
const char *Director::EVENT_BEFORE_SET_NEXT_SCENE = "director_before_set_next_scene"; const char *Director::EVENT_BEFORE_SET_NEXT_SCENE = "director_before_set_next_scene";
const char *Director::EVENT_AFTER_SET_NEXT_SCENE = "director_after_set_next_scene"; const char *Director::EVENT_AFTER_SET_NEXT_SCENE = "director_after_set_next_scene";

View File

@ -241,7 +241,7 @@ void Profile::flush()
testData[KEY_FILE_VERSION] = Value(FILE_VERSION); testData[KEY_FILE_VERSION] = Value(FILE_VERSION);
testData[KEY_DEVICE] = Value(DEVICE_NAME); testData[KEY_DEVICE] = Value(DEVICE_NAME);
testData[KEY_OS_VERSION] = Value(OS_VERSION); testData[KEY_OS_VERSION] = Value(OS_VERSION);
testData[KEY_ENGINE_VERSION] = Value(cocos2d::cocos2dVersion()); testData[KEY_ENGINE_VERSION] = Value(cocos2d::adxeVersion());
time_t t = time(0); time_t t = time(0);
localtime(&t); localtime(&t);
testData[KEY_TIMESTAMP] = Value(genStr("%ld", t)); testData[KEY_TIMESTAMP] = Value(genStr("%ld", t));

View File

@ -33,15 +33,15 @@ class CCPluginVersion(cocos2d.CCPlugin):
return "prints the version of the installed components" return "prints the version of the installed components"
def _show_versions(self): def _show_versions(self):
path = os.path.join(self._src_dir, "cocos2dx", "cocos2d.cpp") path = os.path.join(self._src_dir, "cocos2dx", "adxe.cpp")
if not os.path.exists(path): if not os.path.exists(path):
path = os.path.join(self._src_dir, "cocos", "2d", "cocos2d.cpp") path = os.path.join(self._src_dir, "cocos", "2d", "adxe.cpp")
if not os.path.exists(path): if not os.path.exists(path):
raise cocos2d.CCPluginError("Couldn't find file with version information") raise cocos2d.CCPluginError("Couldn't find file with version information")
with open(path, 'r') as f: with open(path, 'r') as f:
data = f.read() data = f.read()
match = re.search('cocos2dVersion\(\)\s*{\s*return\s+"([^"]+)"\s*;', data) match = re.search('adxeVersion\(\)\s*{\s*return\s+"([^"]+)"\s*;', data)
if match: if match:
print 'cocos2d %s' % match.group(1) print 'cocos2d %s' % match.group(1)
else: else: