daz
|
|
Posted on: February 20, 2014, 10:52:45 am |
|
|
Joined: Jul 2010
Posts: 167
|
I have tried both versions of the sprite_add function and as soon as it's called it crashes the game.
spr_title = sprite_add(dataDir + "textures/title.png", 1, false, false, true, true, 0, 0); spr_title = sprite_add(dataDir + "textures/title.png", 1, false, true, 0, 0);
(I did a file_exists on the path, it returned true) background_add doesn't have any problems. I tried setting graphics engine to both OpenGL 1 and 3. I have tried changing up the parameters, nothing seems to matter.
Using portable exe from 2/18 if it helps.
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #1 Posted on: February 20, 2014, 12:18:52 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
What size is the image?
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #3 Posted on: February 21, 2014, 04:16:07 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Post the image anyway, because draw_sprite_part should work regardless of whether the texture is power of two. It needs fixed.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
|
Darkstar2
|
|
Reply #6 Posted on: February 22, 2014, 02:07:30 am |
|
|
Joined: Jan 2014
Posts: 1238
|
Well fuck me ! now it's crashing even in the compiled EXE ! I tried different modules, modes, etc, same..... tried sprite_add_alpha and it tells me function does not exist. lol. I tried adding it through the create resource in the IDE, it worked, no crash, and it displayed properly as it should. I tried converting the PNG into a BMP, GIF, etc, same thing. Hope this helps. Wow this reminds me I used to get this kind of thing a lot when working with 8.1 and studio importing certain files. I hope you find a solution to this Also using the latest portable + latest jars
|
|
« Last Edit: February 22, 2014, 02:12:42 am by Darkstar2 »
|
Logged
|
|
|
|
|
Goombert
|
|
Reply #8 Posted on: February 22, 2014, 04:00:06 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Confirmed the issue only exists for sprite_add and background_add and is the result of the transparency parameter and the calculation of the collision box. It is because these two loops do not know the actual size of the pixel data array in order to loop it properly. I tested with the following code. show_message(working_directory+"/title.png"); sprite_index = sprite_add(working_directory+"/title.png",1,1,0,0,0); Edit: I have discovered the full issue and was able to get it to draw properly. Apparantly some Joe Jerkoff thinks our universal graphics system abstract image code is supposed to retrofit powers of two, even though that's is not graphics system agnostic behavior. This can be fixed fully when we add texture atlasing. https://github.com/enigma-dev/enigma-dev/issues/653
|
|
« Last Edit: February 22, 2014, 05:17:34 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #10 Posted on: February 22, 2014, 05:56:15 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Yes Harri, I recanted halfway through, I thought the behavior on graphics cards that didn't support it was to just fit it to a power of two size. And then later changed the ticket to texture atlasing. That said, I can implement all the options to LateralGM but the texture atlasing needs designed around that, if somebody is going to do it ENIGMA side then I will go ahead and add it LGM side.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #12 Posted on: February 23, 2014, 01:29:28 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Well it still needs fixed atm, and I have fixed his issue in my local version but now I am trying to figure out the saving power of two issues. And I want to recant again, I was correct in my initial premise partially. Because every sprite and background function shouldnt be doing the padding, this is graphics system dependent and the padding should be moved to graphics_create_texture/graphics_get_rgba_data and the universal system can provide utility functions for padding and cropping the data in its image format code, which will in turn also lead to less code. This has now been resolved temporarily in the following pull request with Josh's help. By temporarily I mean it fixes it, but doesn't get started with texture atlasing, but does fix the issue properly. https://github.com/enigma-dev/enigma-dev/pull/654
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
time-killer-games
|
|
Reply #13 Posted on: February 23, 2014, 12:52:02 pm |
|
|
"Guest"
|
When GMS originally released the C++ runner during the beta season, sprite/background_add() could successfully load and draw PNG, JPG, BMP, GIF, and for just sprite_add() animated GIF.Since then in GMS all those image formats other than PNG were dropped because they "weren't cross-platform compatible" even though they technically are. So yet another thing we could have that GMS will never have are those external image importing formats that Studio dropped, but that is only IF such functionality were added to ENIGMA, because right now, we only support BMP, which isn't compatible w/ studio, studio only has PNG. So if we aren't going to support JPG, GIF, and animated GIF, we should at least support PNG to be more compatible with Studio and the fact BMP doesn't support partial alpha transparency, but PNG does.
|
|
|
Logged
|
|
|
|
Darkstar2
|
|
Reply #14 Posted on: February 23, 2014, 01:28:38 pm |
|
|
Joined: Jan 2014
Posts: 1238
|
lol! Yep you nailed it once again, they seem to have an acquired skill of butchering and removing, sometimes I wonder, are they removing more stuff than they are adding ? At this rate what's going to be left for cross platform compatibility sake ! Actually if you translate to proper english it would have nothing to do with cross platform, they could easily fix this but it would require some minimal work God forbid ! So translated it means: "We don't want to bother making it cross platform." BTW, what about the less talked about MNG (animated PNG), ? Whatever happened to this format ? Did not pick up ? I remember many years ago I was using software for animated GIFs, and it supported MNG as well
|
|
|
Logged
|
|
|
|
|