u0u0 / cocos2d-lua-community Goto Github PK
View Code? Open in Web Editor NEW基于Cocos2d-x 4.0,打造易用稳定的Cocos2d-x lua引擎。
基于Cocos2d-x 4.0,打造易用稳定的Cocos2d-x lua引擎。
文件 cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java
string[] permissions= {};
修改为ArrayList<String> permissions = new ArrayList<String>();
private void initPermission() {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
String allpermissions[] = {Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.READ_PHONE_STATE};
ArrayList<String> permissions = new ArrayList<String>();
boolean needPop = false;
for (String permission : allpermissions) {
if (PackageManager.PERMISSION_DENIED == ContextCompat.checkSelfPermission(this, permission)) {
if (shouldShowRequestPermissionRationale(permission)) {
permissions.add(permission);
} else {
needPop = true;
}
}
}
if (needPop) {
// init Alert strings
String title = "请在设置中,开启程序权限, 点击权限。";
String conform = "确认";
String cancel = "取消";
if (Cocos2dxHelper.getCurrentLanguage() != "zh") {
title = "Please grant the permissions in settings.";
conform = "OK";
cancel = "Cancel";
}
final String fTitle = title;
final String fconform = conform;
final String fcancel = cancel;
// on clicked handler
final DialogInterface.OnClickListener okHandler = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivity(intent);
finish();
}
};
// on clicked handler
final DialogInterface.OnClickListener noHandler = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
};
// new alert
sContext.runOnUiThread(new Runnable() {
@Override
public void run() {
new AlertDialog.Builder(sContext)
.setMessage(fTitle)
.setPositiveButton(fconform, okHandler)
.setNegativeButton(fcancel, noHandler)
.create()
.show();
}
});
return;
}
if (permissions.size() > 0) {
this.requestPermissions( permissions.toArray(new String[permissions.size()]), 1001);
return;
}
}
// final, can safe init PS module
PSNetwork.init(this);
PSDevice.init(this);
}
升级到 7.x 后,
测试代码如下
local printLua = UIImageBox.new("update/public_btn_003.png",function()
self:stopAllActions()
self:runAction(cc.RepeatForever:create(cc.Sequence:create(
cc.DelayTime:create(0.01),
cc.CallFunc:create(function ()
for i = 1, 100 do
local id = math.random() .. os.time()
audio.playEffectSync(id, “test.ogg”, false)
end
end)
)))
end,{textParams = {text = "开始", size = 30, color = CoreColor.GENERAL_WORDS, font = HYH3GJ}, NOPLIS = true })
display.align(printLua, display.LEFT_BOTTOM, 0, 0)
self:addChild(printLua, 100000)
local printOjbs = UIImageBox.new("update/public_btn_003.png",function()
self:stopAllActions()
audio.stopAllEffects()
audio.unloadAllFile()
end,{textParams = {text = "结束", size = 30, color = CoreColor.GENERAL_WORDS, font = HYH3GJ}, NOPLIS = true })
display.align(printOjbs, display.LEFT_BOTTOM, 150, 0)
self:addChild(printOjbs, 100000)
开始和结束按钮,隔1到2秒来回点击,如此重复
就会发现内存不断增长
目前发现的一个解决办法
lua_audio_manual.cpp文件中
lSourceGC方法改成下面这样
static int lSourceGC(lua_State *L)
{
RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE);
if (!sourceItem->deleted) {
alSourcei(sourceItem->id, AL_BUFFER, 0);
alDeleteSources(1, &sourceItem->id);
sourceItem->deleted = true;
}
return 0;// number of return values
}
麻烦查看下这个bug,并看下解决方案对不对
Hi, I found deleteCharactersInRange will cause auto scroll in Mac even I unchecked the scroll button, any good idea to fix it?
MacOS 下面用Xcode调试,空项目挂着不动内存都会一直增加,每一两秒就增加0.1M,永远不会降低,看看什么原因
调查了下是再次将CocosAcitvity放到前台的时候,被重新创建了,所以就丢失了java侧的editbox,但是从c++重新创建了对应的java的editbox过后,发现新创建的java侧的editbox无法获取焦点focus,所以永远没法调起键盘。
不知道有没有什么解决方案
Help to keep download link alive.
tolua 工具删除了,是使用其他方式生成的lua_bindings 嘛?
如题
4.x比3.x 少了一个接口 Button:setTitleOffset
external 的编译仓库有计划放出来么
咋没找到C++工程的,因为想改写里面的C++组件,想重新编译一下。
考虑到 support 官方早已切换到 androidx, 还是启用 androix, 和 jetifier.
buggly报错内容
void Widget::updateSizeAndPosition()
{
if (_parent) //空指针判断
{
Size pSize = _parent->getContentSize();
updateSizeAndPosition(pSize);
}
}
如题 看文档只知道 protoc -o addressbook.pb ./addressbook.proto --proto_path ./
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) void * __cdecl cocos2d::unzOpen(char const *)" (_imp?unzOpen@cocos2d@@YAPAXPBD@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) void * __cdecl cocos2d::unzOpen(char const *)" (_imp?unzOpen@cocos2d@@YAPAXPBD@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzClose(void *)" (_imp?unzClose@cocos2d@@YAHPAX@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzClose(void *)" (_imp?unzClose@cocos2d@@YAHPAX@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzOpenCurrentFile(void *)" (_imp?unzOpenCurrentFile@cocos2d@@YAHPAX@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzOpenCurrentFile(void *)" (_imp?unzOpenCurrentFile@cocos2d@@YAHPAX@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzReadCurrentFile(void *,void *,unsigned int)" (_imp?unzReadCurrentFile@cocos2d@@YAHPAX0I@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzReadCurrentFile(void *,void *,unsigned int)" (_imp?unzReadCurrentFile@cocos2d@@YAHPAX0I@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGetCurrentFileInfo(void *,struct cocos2d::unz_file_info_s *,char *,unsigned short,void *,unsigned short,char *,unsigned short)" (_imp?unzGetCurrentFileInfo@cocos2d@@YAHPAXPAUunz_file_info_s@1@PADG0G2G@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGetCurrentFileInfo(void *,struct cocos2d::unz_file_info_s *,char *,unsigned short,void *,unsigned short,char *,unsigned short)" (_imp?unzGetCurrentFileInfo@cocos2d@@YAHPAXPAUunz_file_info_s@1@PADG0G2G@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzCloseCurrentFile(void *)" (_imp?unzCloseCurrentFile@cocos2d@@YAHPAX@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzCloseCurrentFile(void *)" (_imp?unzCloseCurrentFile@cocos2d@@YAHPAX@Z)
31>cocos2d.lib(CCFileUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzLocateFile(void *,char const ,int (__cdecl)(void *,char const *,char const *))" (_imp?unzLocateFile@cocos2d@@YAHPAXPBDP6AH011@Z@Z),函数 "public: unsigned char * __thiscall cocos2d::FileUtils::getFileDataFromZip(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)const " (?getFileDataFromZip@FileUtils@cocos2d@@QBEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0paj@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) void * __cdecl cocos2d::unzOpen2(char const *,struct zlib_filefunc_def_s *)" (_imp?unzOpen2@cocos2d@@YAPAXPBDPAUzlib_filefunc_def_s@@@z),函数 "private: bool __thiscall cocos2d::ZipFile::initWithBuffer(void const *,unsigned long)" (?initWithBuffer@ZipFile@cocos2d@@AAE_NPBXK@Z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGoToFirstFile(void *)" (_imp?unzGoToFirstFile@cocos2d@@YAHPAX@Z),函数 "public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall cocos2d::ZipFile::getFirstFilename(void)" (?getFirstFilename@ZipFile@cocos2d@@QAE?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@xz) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGoToFirstFile2(void *,struct cocos2d::unz_file_info64_s *,char *,unsigned short,void *,unsigned short,char *,unsigned short)" (_imp?unzGoToFirstFile2@cocos2d@@YAHPAXPAUunz_file_info64_s@1@PADG0G2G@Z),函数 "public: bool __thiscall cocos2d::ZipFile::setFilter(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?setFilter@ZipFile@cocos2d@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGoToNextFile(void *)" (_imp?unzGoToNextFile@cocos2d@@YAHPAX@Z),函数 "public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall cocos2d::ZipFile::getNextFilename(void)" (?getNextFilename@ZipFile@cocos2d@@QAE?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@xz) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGoToNextFile2(void *,struct cocos2d::unz_file_info64_s *,char *,unsigned short,void *,unsigned short,char *,unsigned short)" (_imp?unzGoToNextFile2@cocos2d@@YAHPAXPAUunz_file_info64_s@1@PADG0G2G@Z),函数 "public: bool __thiscall cocos2d::ZipFile::setFilter(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?setFilter@ZipFile@cocos2d@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGetFilePos(void *,struct cocos2d::unz_file_pos_s *)" (_imp?unzGetFilePos@cocos2d@@YAHPAXPAUunz_file_pos_s@1@@z),函数 "public: bool __thiscall cocos2d::ZipFile::setFilter(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?setFilter@ZipFile@cocos2d@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) 中引用了该符号
31>cocos2d.lib(ZipUtils.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int __cdecl cocos2d::unzGoToFilePos(void *,struct cocos2d::unz_file_pos_s *)" (_imp?unzGoToFilePos@cocos2d@@YAHPAXPAUunz_file_pos_s@1@@z),函数 "public: unsigned char * __thiscall cocos2d::ZipFile::getFileData(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,long *)" (?getFileData@ZipFile@cocos2d@@QAEPAEABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@paj@Z) 中引用了该符号
31>D:\Cocos-Lua\game\win32-build\bin\game\Debug\game.exe : fatal error LNK1120: 14 个无法解析的外部命令
使用是visual studio2022
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.