-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
174 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 55 additions & 55 deletions
110
native/cocos/editor-support/spine-wasm/util-function.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
#include "util-function.h" | ||
#include <stdint.h> | ||
// extern "C" { | ||
// extern void consoleInfo(char* ptr, uint32_t length); | ||
// } | ||
static char* logBuffer = nullptr; | ||
const int LOG_LENGTH = 1024; | ||
// #include <stdint.h> | ||
// // extern "C" { | ||
// // extern void consoleInfo(char* ptr, uint32_t length); | ||
// // } | ||
// static char* logBuffer = nullptr; | ||
// const int LOG_LENGTH = 1024; | ||
|
||
void LogUtil::Initialize() { | ||
//logBuffer = new char[LOG_LENGTH]; | ||
} | ||
// void LogUtil::Initialize() { | ||
// //logBuffer = new char[LOG_LENGTH]; | ||
// } | ||
|
||
void LogUtil::PrintToJs(std::string& message) { | ||
// int length = message.length(); | ||
// if (length >= LOG_LENGTH) length = LOG_LENGTH -1; | ||
// memcpy(logBuffer, message.c_str(), length); | ||
// logBuffer[length] = 0; | ||
// consoleInfo(logBuffer, length); | ||
} | ||
// void LogUtil::PrintToJs(std::string& message) { | ||
// // int length = message.length(); | ||
// // if (length >= LOG_LENGTH) length = LOG_LENGTH -1; | ||
// // memcpy(logBuffer, message.c_str(), length); | ||
// // logBuffer[length] = 0; | ||
// // consoleInfo(logBuffer, length); | ||
// } | ||
|
||
void LogUtil::PrintToJs(const char* message) { | ||
// std::string strMessage(message); | ||
// int length = strMessage.length(); | ||
// if (length >= LOG_LENGTH) length = LOG_LENGTH - 1; | ||
// memcpy(logBuffer, strMessage.c_str(), length); | ||
// logBuffer[length] = 0; | ||
// consoleInfo(logBuffer, length); | ||
} | ||
// void LogUtil::PrintToJs(const char* message) { | ||
// // std::string strMessage(message); | ||
// // int length = strMessage.length(); | ||
// // if (length >= LOG_LENGTH) length = LOG_LENGTH - 1; | ||
// // memcpy(logBuffer, strMessage.c_str(), length); | ||
// // logBuffer[length] = 0; | ||
// // consoleInfo(logBuffer, length); | ||
// } | ||
|
||
void LogUtil::PrintToJs(char* str, int length) { | ||
// if (length >= LOG_LENGTH) length = LOG_LENGTH - 1; | ||
// memcpy(logBuffer, str, length); | ||
// logBuffer[length] = 0; | ||
// consoleInfo(logBuffer, length); | ||
} | ||
// void LogUtil::PrintToJs(char* str, int length) { | ||
// // if (length >= LOG_LENGTH) length = LOG_LENGTH - 1; | ||
// // memcpy(logBuffer, str, length); | ||
// // logBuffer[length] = 0; | ||
// // consoleInfo(logBuffer, length); | ||
// } | ||
|
||
void LogUtil::PrintIntValue(int value, const char* message) { | ||
// std::string strInt = std::to_string(value); | ||
// std::string finalStr = std::string(message) + strInt; | ||
// LogUtil::PrintToJs(finalStr); | ||
} | ||
// void LogUtil::PrintIntValue(int value, const char* message) { | ||
// // std::string strInt = std::to_string(value); | ||
// // std::string finalStr = std::string(message) + strInt; | ||
// // LogUtil::PrintToJs(finalStr); | ||
// } | ||
|
||
void LogUtil::ReleaseBuffer() { | ||
//delete[] logBuffer; | ||
} | ||
// void LogUtil::ReleaseBuffer() { | ||
// //delete[] logBuffer; | ||
// } | ||
|
||
// const uint32_t MEMORY_SIZE = 8 * 1024 * 1024; | ||
// static uint8_t* uint8Ptr = nullptr; | ||
// // const uint32_t MEMORY_SIZE = 8 * 1024 * 1024; | ||
// // static uint8_t* uint8Ptr = nullptr; | ||
|
||
// uint8_t* StoreMemory::getStoreMemory() { | ||
// if (uint8Ptr) return uint8Ptr; | ||
// // uint8_t* StoreMemory::getStoreMemory() { | ||
// // if (uint8Ptr) return uint8Ptr; | ||
|
||
// uint32_t* uint32Ptr = new uint32_t[MEMORY_SIZE / 4]; | ||
// uint8Ptr = (uint8_t*)uint32Ptr; | ||
// return uint8Ptr; | ||
// } | ||
// // uint32_t* uint32Ptr = new uint32_t[MEMORY_SIZE / 4]; | ||
// // uint8Ptr = (uint8_t*)uint32Ptr; | ||
// // return uint8Ptr; | ||
// // } | ||
|
||
// void StoreMemory::freeStoreMemory() { | ||
// if (uint8Ptr) { | ||
// delete[] uint8Ptr; | ||
// uint8Ptr = nullptr; | ||
// } | ||
// } | ||
// // void StoreMemory::freeStoreMemory() { | ||
// // if (uint8Ptr) { | ||
// // delete[] uint8Ptr; | ||
// // uint8Ptr = nullptr; | ||
// // } | ||
// // } | ||
|
||
// uint32_t StoreMemory::storeMemorySize() { | ||
// return MEMORY_SIZE; | ||
// } | ||
// // uint32_t StoreMemory::storeMemorySize() { | ||
// // return MEMORY_SIZE; | ||
// // } |
Oops, something went wrong.