cocos2d-x

android studio emulator crashing after 3.0 update

倾然丶 夕夏残阳落幕 提交于 2019-12-18 05:10:36
问题 I have been messing around with android studio and I ended up installing cocos2dx and using an arm cpu emulator to work with cocos2dx. I have recently seen a message prompting for an update for the android emulator service so I installed it and now my emulator crashes while trying to boot and gives this error in the logcat - this is the error it gave me 19:36 Emulator: ** 19:36 Emulator: ERROR:/buildbot/src/android/emu-3.0-release/external/qemu/fpu/softfloat.c:486:round_canonical: code should

Game Engine Collison Bitmask… Why 0x01 etc?

邮差的信 提交于 2019-12-17 19:22:45
问题 Coming across this situation both in Sprite Kit (iOS Development) and in Cocos2d-x (which I know was pretty much the inspiration for Sprite Kit, hence why they use a lot of the same tools), I finally decided to figure out why this happens: When using a physic engine, I create a sprite, and add a physicsBody to it. For the most part, I understand how to set the category, collision, and contact bitmasks, and how they work. The problem is the actual bitmask number: SpriteKit: static const uint32

音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)

笑着哭i 提交于 2019-12-17 05:49:59
原文链接: http://www.himigame.com/iphone-cocos2d/482.html 今天Himi为大家讲解如何在cocos2d中视频、音乐、音效的播放教程; 首先介绍音乐、音效的播放: 音频与音效的播放很简单,毕竟cocos2d引擎为我们封装好了这一切,直接上代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 //----------------音乐相关 //加载音乐 +( void )loadBgMusic{ // [[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"himi.caf"]; } //播放背景音乐 +( void )playBgMusic:(NSString*)fileName{ [[SimpleAudioEngine sharedEngine] playBackgroundMusic:fileName]; } //暂停背景音乐 +( void )pauseBgMusic{ [[SimpleAudioEngine sharedEngine] pauseBackgroundMusic]; } //继续播放背景音乐 +( void )resumeBgMusic{ [

cocos2dx性能优化

让人想犯罪 __ 提交于 2019-12-16 00:52:13
游戏性能应该在设计编码时就需要认真对待,在按照常规处理之后需要使用工具查找游戏性能瓶颈,之后针对处理. 主要的性能问题所在基本是GPU,CPU.经常涉及到游戏逻辑优化,优化效果的指标:帧率、内存、drawcall. 查找 GPU 性能瓶颈的工具 使用 Xcode OpenGL ES Profiler。 文档链接地址 如果你想 profiling 特定 GPU 的移动设备的图形性能,我们可以使用这些 GPU 制造商提供的工具: 对于 ARM Mali GPU,可以使用 mali graphics debugger: http://malideveloper.arm.com/resources/tools/mali-graphics-debugger/ 对于 Imagination PowerVR GPU,可以使用 PVRTune: https://community.imgtec.com/developers/powervr/tools/pvrtune/ 对于 Qualcomm Adreno GPU,可以使用 adreno GPU profiler: https://developer.qualcomm.com/software/adreno-gpu-profiler 使用工具查看图形渲染管线哪个阶段遇到瓶颈了,是顶点处理阶段,还是像素着色阶段。 查找 CPU 性能瓶颈的工具 Mac

C++ static const multiple declaration error in Eclipse for Android NDK

风流意气都作罢 提交于 2019-12-13 17:54:20
问题 I've read the similar questions, but the one that answers mine applies only to VisualStudio. I am using Eclipse and developing an Android application using Cocos2d-X, which is a framework that uses Android's NDK. I created a class named Config, which contains all of the application's constants such as ball sizes and fps. Below is how I arranged the code. Config.h #ifndef __CONFIG_H_ // this was auto-generated by eclipse #define __CONFIG_H_ class Config { public: static const double GRAVITY;

Bad access to memory using strcat

♀尐吖头ヾ 提交于 2019-12-13 17:05:42
问题 I'm using linux. I have a function called like: PlayBackgroundIntroMusic((char *)"IntroMusic"); The functions is: void SoundManager:: PlayBackgroundIntroMusic( char * musicFile) { // Concatenate extension for each platform strcat (musicFile,audioExtension); CCLOG("musicFile: %c" musicFile); SimpleAudioEngine::sharedEngine()->playBackgroundMusic(std::string(CCFileUtils::fullPathFromRelativePath(musicFile)).c_str(), false); } But i having a bad access to memory on line: strcat (musicFile

How to make two way platform box2d body?

妖精的绣舞 提交于 2019-12-13 16:26:18
问题 I have created platform using box2d. I want box2d body detect and not detect dynamically. Box2d shapes will do the followings Detect collision on some condition Not detect collision on some condition Both condition will work on different condition in same box2d object. Any idea would help a lot. Thanks in advance. 回答1: There are several ways to control what happens when a collision occurs in Box2d. The first thing to do is read this article and decide on what way you want to control it. That

Call native ObjC classes from cocos2d-x code

左心房为你撑大大i 提交于 2019-12-13 07:44:44
问题 How can I call/bridge my native iOS ObjC classes from cocos2d-x C++? Using cocos2d-x 3.5. 回答1: Use Objective-C to C++ callbacks http://www.plungeinteractive.com/blog/2012/08/05/obj-c-to-cpp-callbacks/ Edit: // // iOSHelper.h // #ifndef __iOSHelper__ #define __iOSHelper__ #include <iostream> class iOSHelper { public: void showAlert(); }; #endif - // // iOSHelper.mm // #include "iOSHelper.h" //-- #import "AppController.h" void iOSHelper::showAlert() { AppController* appController =