Purposed runtime crash fix

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sun Feb 28, 2010 4:52 am

To the developers:
There has been a bug in construct for awhile that if a "sprite" is added and the cap is run the runtime will crash instantly. It is only reproducible on a few machines such as one of mine and android-music's. The bug first came up after a renderer was updated and as of yet hasn't been fixed. Though this is understandable as most machines are not affected by this bug which leaves for no way to debug it.

The runtime will not crash however if at the start of the layout the sprite is set to invisible, or a distort map is used on the sprite , or a color filter is applied to a corner of the sprite. Also the plasma plugin, canvas plugin and any effect causes construct to crash at runtime. But most of the other plugins such as 3d box, panel and the particles work fine.

I was looking at the construct source and found what I think is the reason for the crash:
In the file "/Common/Renderers/CDX9Renderer_Batch.cpp" under the first "CDX9Renderer::Quad" function on line # 586 it calls this:
[code:1neifibi] D3DCOLOR c = cr::sse2_D3DCOLOR_from_color(filter);[/code:1neifibi]
My cpu a "pentium III" does not have "sse2" so no wonder it crashes.

EDIT:
My purposed fix:
[code:1neifibi]D3DCOLOR c;
if(cr::support_sse2)
c = cr::sse2_D3DCOLOR_from_color(filter);
else
c = filter.getD3DCOLOR();[/code:1neifibi]
Makes Computers that don't have sse2 work. :D

Edit 2X: was able to compile fix... will test tomarrow
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711

Post » Sun Feb 28, 2010 2:55 pm

Nice find, thank you very much! Not sure how that code ended up there since everywhere else I've been pretty careful about use of SSE2 instructions! That would explain everything since that code was introduced with the new renderer (0.99).

I've simply changed it to call the non-SSE2 version since I'm not sure the SSE2 version actually ever ran faster anyway.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Sun Feb 28, 2010 6:48 pm

Just to let you know I tested it on my pentium III computer and it worked. :D :D
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711

Post » Sun Feb 28, 2010 8:15 pm

Great job. I'll credit you in the changelog.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue Mar 02, 2010 5:52 am

Hey, has this fix been integrated in the released .99 version, or just in the svn source, or not at all, just wondering if I need to recompile it myself to include the fix, so I can run it on my acer travelmate c300 tablet, as that is what I do all my game development on, so I can hand draw the graphics right on the screen, yet it still has a keyboard attached for coding and such...

Thanks for any nfo, sorry to but in, I'm new to Scirra, but an old skewl programmer from back in the day.. I code in almost any language, and have released and worked on several huge notable projects, I also own and use almost all game dev engines out there, within reason U know not costing thousands of dollars.. hehehe

Thanks again for doing this,

StOrM3
B
1
G
2
Posts: 1
Reputation: 627

Post » Tue Mar 02, 2010 6:12 am

It looks like this fix will be in v0.99.9, yes.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Mar 03, 2010 3:12 pm

nice one rojohound. Love seeing bugs like this killed.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests