• 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
Szpak

TestReturn failed

8 posts in this topic

Hi, I downloaded and compiled AngelScript 1.10.1b with Dev-Cpp 4.9.9.1 (MinGW 3.3.1). test_build_performance worked fine, but test_feature returned: TestReturn (float): cfunction didn't return properly. Expected 18.870001, got 0.000000 I don't know is it related, but I had few warnings. Is this version compatible with MinGW? Thanks for help. <MY_WARNINGS> g++.exe -c ../../source/test_constructor.cpp -o obj/test_constructor.o -I"E:/Dev-Cpp/include/c++/3.3.1" -I"E:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"E:/Dev-Cpp/include/c++/3.3.1/backward" -I"E:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"E:/Dev-Cpp/include" -I"E:/Dev-Cpp/Common/Include" -I"../../../angelscript/include" -fsave-memoized -fexpensive-optimizations -O2 ../../source/test_constructor.cpp: In function `bool TestConstructor()': ../../source/test_constructor.cpp:66: warning: invalid access to non-static data member `CTestConstructor::a' of NULL object ../../source/test_constructor.cpp:66: warning: (perhaps the `offsetof' macro was used incorrectly) ../../source/test_constructor.cpp:67: warning: invalid access to non-static data member `CTestConstructor::b' of NULL object ../../source/test_constructor.cpp:67: warning: (perhaps the `offsetof' macro was used incorrectly) g++.exe -c ../../source/test_vector3.cpp -o obj/test_vector3.o -I"E:/Dev-Cpp/include/c++/3.3.1" -I"E:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"E:/Dev-Cpp/include/c++/3.3.1/backward" -I"E:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"E:/Dev-Cpp/include" -I"E:/Dev-Cpp/Common/Include" -I"../../../angelscript/include" -fsave-memoized -fexpensive-optimizations -O2 ../../source/test_vector3.cpp: In function `bool TestVector3()': ../../source/test_vector3.cpp:34: warning: invalid access to non-static data member `Vector3::x' of NULL object ../../source/test_vector3.cpp:34: warning: (perhaps the `offsetof' macro was used incorrectly) ../../source/test_vector3.cpp:35: warning: invalid access to non-static data member `Vector3::y' of NULL object ../../source/test_vector3.cpp:35: warning: (perhaps the `offsetof' macro was used incorrectly) ../../source/test_vector3.cpp:36: warning: invalid access to non-static data member `Vector3::z' of NULL object ../../source/test_vector3.cpp:36: warning: (perhaps the `offsetof' macro was used incorrectly) g++.exe -c testvirtualinheritance.cpp -o obj/testvirtualinheritance.o -I"E:/Dev-Cpp/include/c++/3.3.1" -I"E:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"E:/Dev-Cpp/include/c++/3.3.1/backward" -I"E:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"E:/Dev-Cpp/include" -I"E:/Dev-Cpp/Common/Include" -I"../../../angelscript/include" -fsave-memoized -fexpensive-optimizations -O2 ../../source/testvirtualinheritance.cpp: In function `bool TestVirtualInheritance()': ../../source/testvirtualinheritance.cpp:69: warning: pointer to member cast via virtual base `CVBase1' of `CDerivedVirtual' ../../source/testvirtualinheritance.cpp:76: warning: pointer to member cast via virtual base `CVBase2' of `CDerivedVirtual' </MY_WARNINGS>
0

Share this post


Link to post
Share on other sites
I compile and test the library with MinGW with every release. Though I suspect that they changed something in the compiler with the latest release that make the return of floats and doubles fail in AngelScript. I've received a report of the same behaviour on Linux GNUC compiler.

I'll download the latest MinGW compiler and see if I can figure out what's going on.

The warnings you are receiving are unrelated to your problem. They are only warnings and the tests works as supposed.

0

Share this post


Link to post
Share on other sites
I just downloaded Dev-C++ 4.9.9.1 and ran the test_feature with it. Everything worked just fine, including the TestReturnF test.

Maybe you set some configurations that I didn't. Could you send me the project files for AngelScript and test_feature that you used? Or maybe tell me what you changed from the default settings.
0

Share this post


Link to post
Share on other sites
I managed to reproduce the problem. When I configured Dev-C++ to compile the library with optimizations the TestReturnF test failed.

So, until I can get this fixed I recommend that you turn off optimizations for the library.
0

Share this post


Link to post
Share on other sites
I found and fixed the bug. You'll have to replace the implementation for GetReturnedFloat() and GetReturnedDouble() in as_callfunc_x86.cpp:


asDWORD GetReturnedFloat()
{
asDWORD f;

#if defined ASM_INTEL

// Get the float value from ST0
__asm fstp dword ptr [f]

#elif defined ASM_AT_N_T

asm("fstps %0 \n" : "=m" (f));

#endif

return f;
}

asQWORD GetReturnedDouble()
{
asQWORD d;

#if defined ASM_INTEL

// Get the double value from ST0
__asm fstp qword ptr [d]

#elif defined ASM_AT_N_T

asm("fstpl %0 \n" : "=m" (d));

#endif

return d;
}



I'd like to credit you for reporting the bug. Would you mind telling me your real name?
0

Share this post


Link to post
Share on other sites
At first sorry for delay, but I didn't get mail notification about your replies.

Glad to help. After "patch" this test works ok. My real name is Marcin Zajaczkowski.

I have one more question. In test_multithread I had to change
#include "../../add_on/stdstr/stdstr.h"
to
#include "../../add_on/std_string/stdstring.h"
in utils.h to compile. I'm not sure if stdstr.h and stdstring.h is the same, but I couldn't find it in tarball and "Utils & add-ons".
After this I have
TestSharedString: Shared strings don't work as they should

I don't know is it related with this include.

Regards
Marcin
0

Share this post


Link to post
Share on other sites
Thanks for replying Marcin.

The stdstr and the stdstring are the same source. I forgot to update the multithreaded test though, thanks for letting me know.

In order for the multithreaded test to work, the AS library has to be compiled with the preprocessor flag USE_THREADS defined. Description on this and other flags can be found in as_config.h.

Regards,
Andreas
0

Share this post


Link to post
Share on other sites
USE_THREADS helps.
Has this option any side effect? Or it's disabled by default due to portability?

Thanks for help
Marcin
0

Share this post


Link to post
Share on other sites
The main reason it is disabled by default is because the support for multithreading hasn't been fully tested.

There is a slight overhead when turning on multithreaded support because of need to use critical sections to protect the reference counting. But the actual execution of the script code shouldn't be affected.

The multithreaded support is also only available on Windows.
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