• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
DevilWithin

Premature destruction of object in Android

35 posts in this topic

wow, this is the craziest thing I've read about templates in a while. 

 

Also, have you overloaded the << operator so that you can use it with ofstreams?  that's quite handy :D I'll have to do that sometime.

 

could you post all of the compiler and linker setting you're using? I'm a little curious as to why this is happening, and I have my summer vacations in around ten days. I'll try and reproduce this on MSVC 2010.

 

Thanks

0

Share this post


Link to post
Share on other sites

What do you mean with the << operator? Didn't get the context :o

 

The settings I can post them later, windows and android even :)

 

@Andreas

 

I created a.cpp , containing only testP(){} and compiled it the same way my engine's library is being compiled, outputting to assembly. Here's the result a.s

 

 

 

.arch armv5te
.fpu softvfp
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 18, 4
.file "a.cpp"
.text
.align 2
.global _Z5testPv
.type _Z5testPv, %function
_Z5testPv:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
bx lr
.size _Z5testPv, .-_Z5testPv
.ident "GCC: (GNU) 4.6 20120106 (prerelease)"
.section .note.GNU-stack,"",%progbits
 

That should be it, right? Here's the compiler options I used: 

 

 

 

arm-linux-androideabi-g++.exe -S -c a.cpp -Wno-psabi -O0 -marm -fno-strict-aliasing -funswitch-loops -finline-limit=100 -fomit-frame-pointer -fno-exceptions -fpic -fstack-protector -frtti -fno-short-enums
 

 

 

0

Share this post


Link to post
Share on other sites

The assembly instruction appears to be as expected.

 

The function is called from as_callfunc_arm_gcc.S with an instruction 'blx r4', so the correct way to return to the caller is with a call to 'bx lr'. 

 

I suspect the crash is likely happening even before the call to the registered function. Probably somewhere in as_callfunc_arm_gcc.cpp.

 

Would you mind adding a few cout's in the as_callfunc_arm.gcc.cpp code to see how far it gets before it crashes? And to see which path it takes in the conditions?

0

Share this post


Link to post
Share on other sites

About the ARM now, here is the compilation command of one source file from angelscript, compiling the ARM version for the NDK.

"Compile++ thumb : angelscript &lt;= as_scriptengine.cpp
...-mthumb...

Others have touched the code since I first contributed the initial native arm call conventions so this might have changed, but they were originally not designed for interoperating with thumb mode. Your problem might be as easy as making the ndk compile your code in arm mode unless you absolutely need thumb. Just put this in your Android.mk:

LOCAL_ARM_MODE := arm
0

Share this post


Link to post
Share on other sites

@quarnster: I added that line to the makefile and it compiled the arm library fine, i tested it and it worked. funny.. :) Thanks.

 

Because im curious, and to make sure that line was the actual fixer, i took it off again and recompiled but i got the same working result.. Could it change the default compiler settings somehow or what?

 

This topic's issues are nice, very nice. :)

0

Share this post


Link to post
Share on other sites

@quarnster: Thanks a lot. I would probably not have found that one, at least not anytime soon. Does it matter where in the Android.mk file this line is added? Can I just add it at the end of the file?

0

Share this post


Link to post
Share on other sites

Im still finding it hard to believe this is working hehe, it all seems so tricky.. :)

 

Thanks to you too for the help given!!

0

Share this post


Link to post
Share on other sites


@quarnster: Thanks a lot. I would probably not have found that one, at least not anytime soon. Does it matter where in the Android.mk file this line is added? Can I just add it at the end of the file?


It needs to be between the two include directives.
0

Share this post


Link to post
Share on other sites

I got hit by this bug as well (manifested as a crash when running scripts on Android) but it did not appear before updating the Android NDK to the latest, which suggests the compiler's handling of arm/thumb interoperation has changed.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0