![]() |
|
FLIC Video help |
Eagle11
Member #10,454
December 2008
|
I have been trying for days without success to get an FLIC animation to play at the beginning of my game. There does not seem to be a problem with the code. Everything compiles fine. When I run the program it seems to just skip the video or just display a black screen (I've tried several different ways of playing it). I thought that it might be a problem with the file itself, so I tried using a file that I know worked with the same results. [code] // Called at the beginning of the game to play the intro movie. |
someone972
Member #7,719
August 2006
![]() |
1if (fli_timer)
2{
3 FliFrames++;
4
5 // Open next frame
6 next_fli_frame(1);
7
8 // Make sure that the next frame isn't null before drawing
9 if (fli_bitmap)
10 {
11 // Adjust the palette
12 set_palette(fli_palette);
13
14 // Blit to the screen
15 blit(fli_bitmap, screen, 0, 0, 0, 30,
16 fli_bitmap->w, fli_bitmap->h);
17 }
18}
This part doesn't seem right. Wouldn't you want it to run in a loop instead of just once with the if statement? The [code] tags have changed to <code> tags, by the way. ______________________________________ |
Eagle11
Member #10,454
December 2008
|
Yes, you're right. I messed up and posted the wrong code. Here is what it should be. 1void PlayIntro()
2{
3 int FliFrames = 0;
4 int finishedflag = 0;
5 // Load the intro
6 open_fli("introex.flc");
7 //play_fli("introex.flc", screen, 1, NULL);
8
9 // Loop while the video isn't finished
10 while (!finishedflag)
11 {
12 // If it is time for the next frame
13 if (fli_timer)
14 {
15 // Open next frame
16 next_fli_frame(1);
17
18 // Make sure that the next frame isn't null before drawing
19 if (fli_bitmap)
20 {
21 // Adjust the palette
22 set_palette(fli_palette);
23
24 // Blit to the screen
25 blit(fli_bitmap, screen, 0, 0, 0, 30,
26 fli_bitmap->w, fli_bitmap->h);
27 }
28 // The next frame is null, so the video is over
29 else
30 {
31 finishedflag = 1;
32 }
33 }
34 }
35
36 // Remove the intro fram memory
37 close_fli();
38}
|
someone972
Member #7,719
August 2006
![]() |
Are you sure the flv is being opened ok? next_fli_frame returns FLI_NOT_OPEN if it's not. ______________________________________ |
Eagle11
Member #10,454
December 2008
|
I'm not sure. I'll test and post back tomorrow evening. |
|