Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RobotiX

Pages: 1
1
Issues Help Desk / Re: sprite_add not working?
« on: January 20, 2015, 08:15:39 pm »
Quote
It looks like we never actually even outlined the function. I can give you the basic steps to add it though.
First outline the function in the general header https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Audio_Systems/General/ASbasic.h#L62
it should be the same path in your local enigma-dev copy regardless of how you installed. By outlining it there it ensures the parameter and return types are the same for every system.
Then you just add the body of the function in https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Audio_Systems/DirectSound/DSbasic.cpp#L92
or https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Audio_Systems/OpenAL/ALbasic.cpp#L152
for OpenAL. That's really all you need to do and the function will be usable, you could also send us a pull request on GitHub and we may merge it so long as you write the code neatly to match the other functions in the files.

Are you suggesting I try writing the sound_fade function? I'd be interested to learn but I know very little about the inner workings of ENIGMA or OpenAL...
I guess you gotta start somewhere though...

2
Issues Help Desk / Re: sprite_add not working?
« on: January 19, 2015, 01:53:04 am »
Oh I know who you are and I am grateful.
I get a "Unknown function or script `sound_fade'" error regardless of which sound system I'm using.
I made a pretty hacky GML alternative that increments or decrements the volume and sets it using sound_volume(). sound_get_volume() also doesn't seem to work so I just use a variable to store the the current value and manipulate that.

3
Issues Help Desk / Re: sprite_add not working?
« on: January 18, 2015, 03:15:54 pm »
Yeah, anytime something is divided by user input it should first check to see if it's zero. But I understand you guys already have massive amounts of work to be done. Overall I am EXTREMELY impressed. I fixed that error and the game I ported from GM ran perfectly. Except for sound_fade...

4
Issues Help Desk / Re: sprite_add not working?
« on: January 18, 2015, 02:21:57 am »
It works perfectly in GM 8.

EDIT:
Ok so I managed to get an error in the console, it said something along the lines as "incorrect PNG signature, it's no PNG or corrupted" So i thought maybe ENIGMA can only handle pngs. No problem, I just converted my image to a png. Still crashes, no error message this time. So I just ran gdb on it and got this:

Code: [Select]
Program received signal SIGFPE, Arithmetic exception.
0x004de1de in enigma::sprite_add_to_index (ns=0x6b391f8, filename=...,
    imgnumb=0, precise=false, transparent=false, smooth=false, x_offset=0,
    y_offset=0, mipmap=false) at Universal_System/spritestruct.cpp:285
285             unsigned cellwidth = width/imgnumb;

and the backtrace:

Code: [Select]
#0  0x004de1de in enigma::sprite_add_to_index (ns=0x6b391f8, filename=...,
    imgnumb=0, precise=false, transparent=false, smooth=false, x_offset=0,
    y_offset=0, mipmap=false) at Universal_System/spritestruct.cpp:285
#1  0x004dd066 in enigma_user::sprite_add (filename=..., imgnumb=0,
    precise=false, transparent=false, smooth=false, preload=true, x_offset=0,
    y_offset=0, mipmap=false) at Universal_System/spritestruct.cpp:68
#2  0x004dd1b6 in enigma_user::sprite_add (filename=..., imgnumb=0,
    transparent=false, smooth=false, x_offset=0, y_offset=0, mipmap=false)
    at Universal_System/spritestruct.cpp:74
#3  0x0040351b in enigma::OBJ_obj_0::myevent_create (this=0x6b38d78)
    at C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfu
nctionality.h:43
#4  0x004e61c1 in enigma::roomstruct::gotome (
    this=0x7ef3e0 <enigma::grd_rooms>, gamestart=true)
    at Universal_System/roomsystem.cpp:193
#5  0x004ea4e9 in enigma::game_start () at Universal_System/roomsystem.cpp:841
#6  0x004b2a0f in enigma::initialize_everything ()
    at Universal_System/loading.cpp:120
#7  0x00407a76 in WinMain@16 (hInstance=0x400000, hPrevInstance=0x0,
    lpCmdLine=0x1ed6386 "", iCmdShow=10)
    at Platforms/Win32/WINDOWSmain.cpp:255
#8  0x0076a48d in main ()

It looks like a problem with ENIGMA.

EDIT AGAIN:
Fixed it. looking at the error it says "Arithmetic exception." and "width/imgnumb" I put two and two together and guessed that it was a divide-by-zero error, I changed image_num to 1 instead of 0 and it didn't crash.
Thanks Obama.

5
Issues Help Desk / sprite_add not working?
« on: January 17, 2015, 10:18:52 pm »
Hey all,

I have lots of GM experience but only recently started with ENIGMA. I started a project from scratch in LGM, it's the newest ENIGMA portable, I have jdk 8, running Windows 7.
Basically I have:
Code: [Select]
image = sprite_add(file_name, 0, false, false, 0, 0)
show_message(string(image))
And then in the draw event:
Code: [Select]
draw_sprite(image, 0, x, y)I get the message and it shows the sprite index but when it tries to call the draw function the game crashes.
Any help would be appreciated.

RobotiX

Pages: 1