Legacy GM drawing a external gif image shows only a distorted first frame

F

feminist52

Guest
Hi.
I am making an cutscene engine. So I used the I Will Find You And I Will Kill You scene as an example. The gif is
640*480
17MB
510 frames (or at least that is what IrfanView told me)

room start
scene=sprite_add("iwillkillyou.gif",0,0,0,0,0)
audio=audio_create_stream("cutscene test.ogg")
audio_inst=audio_play_sound(audio, 10, 0);

draw
draw_sprite_stretched(scene,(sprite_get_number(scene)-1)*(audio_sound_get_track_position(audio_inst)/audio_sound_length(audio)),0,0,room_width,room_height)

image.png

It showed me a distorted image of what was supposed to appear (the original is perfectly normal), except it just froze in a first subimage. I wanted to see how many subimages the image had. and the show_debug_message(blabla) gave me 1. What am I doing wrong?
 

TheouAegis

Member
GMS doesn't handle gifs properly. Your code would work just fine in GM8. Cant remember if i ever found a workaround.
 

Binsk

Member
If you read the manual for sprite_add you will notice it states that .gif images only load the first subimage. You cannot load the rest of them.

I would suggest you write your own .gif importer via file_bin_* functions and buffers. You might find this article useful if you go that route. Either that or think of a different method to load in a cutscene.
 

zbox

Member
GMC Elder
Well, slandering like that isn't fair as it can output great quality video at good sizes... It's actually used in quite a few professionally published games and is the only one that supports all GM platforms.

A lot of if not all multi-platform video requires an optimizing converter, see bink video and the custom internal formats most game dev studios use.
 
L

Lonewolff

Guest
Well, slandering like that isn't fair as it can output great quality video at good sizes..
No slandering, I am obviously misinformed.

What sort of file size would you be looking at for two hours of 4K video with your codec?
 

zbox

Member
GMC Elder
Let me answer your question with another - do you know what a loaded question is ;)?

Happy to continue this over PM but last I heard you had a reputation around here so... I don't think I'll be replying on this thread any more. I just wanted to let OP know what his options were.

Cheers :)
 
L

Lonewolff

Guest
Correct, I do have a reputation of being a helpful coder. Thank you for noticing.

Anyone can see this by opening up my profile and reading anything I have ever posted.

:)
 
Last edited by a moderator:
Top