简体   繁体   English

琐碎的Haxe(HaxePunk)游戏在HTC Desire(Icecream Sandwich)上运行太慢

[英]Trivial Haxe (HaxePunk) game runs far too slow on HTC Desire (Icecream Sandwich)

I've made a simple, 3 frame, animation of a character walking to wherever you click on screen using Haxe+ Haxepunk... Well I copy/pasted code from online tutorials just to test Haxe out. 我制作了一个简单的3帧动画角色,使用Haxe + Haxepunk可以移动到您在屏幕上单击的任何位置...好吧,我从在线教程中复制/粘贴了代码以测试Haxe。

This runs great in flash, iOS simulator and on a Samsung Galaxy 3... But on my HTC desire it runs at less than 1 frame per second. 这在Flash,iOS模拟器和Samsung Galaxy 3上运行非常出色。但是我对HTC的要求是,它的运行速度不到每秒1帧。 While I know the desire is no spring chicken this is a massive performance gap, more so than I've seen on any app re: Galaxy vs. Desire... 虽然我知道渴望不是春之鸡,但这是一个巨大的性能差距,比我在任何应用程序re:Galaxy vs. Desire上看到的还要多。

Is this a Haxe problem or something I have done wrong (wrong NDK, wrong compile flags, OS too old, etc)? 这是Haxe问题还是我做错了什么(错误的NDK,错误的编译标志,操作系统太旧等)?

Go into Engine.hx, the render() function, and comment out HXP.screen.refresh(). 进入Engine.hx,render()函数,并注释掉HXP.screen.refresh()。 This line is absolutely killing performance on OUYA (an android gaming console) so it might be killing you too. 这条线绝对会破坏OUYA(Android游戏机)的性能,因此也可能会杀死您。 Since you're not clearing the screen every frame anymore you'll want to draw a background every update by adding a Backdrop instance to your world. 由于您不再需要清除每一帧的屏幕,因此您需要通过向世界添加Backdrop实例来绘制每次更新的背景。 My game goes from 7 fps to 52 fps with these changes alone at 1080p resolution and ~80 entities. 我的游戏从7 fps变为52 fps,仅这些变化就达到了1080p分辨率和约80个实体。

Also try grabbing the latest HaxePunk from github and running ant to install it, the devs have been working on android performance lately and there's some good unreleased fixes which will be cream on top of the above fix. 还可以尝试从github上获取最新的HaxePunk并运行ant来安装它,开发人员最近一直在研究android性能,并且有一些很好的未发布的修复程序,这些修复程序将是上述修复程序的基础。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM