mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
50c30ab790
cutscene "somefile.anm" { delay 10 } // defines somefile.anm with a delay of 10 120Hz tics between frames. a more typical framerate method may come later, but this is how the originals worked. Once defined, they can be played through CON with the new playback command, also called "cutscene". It works like this: definequote 12345 somefile.anm define ANIM_SOMEFILE 12345 ... cutscene ANIM_SOMEFILE // halts game execution and immediately plays cutscene, resuming execution when finished ... Sounds can be played during animations (and tiles can be overlaid, etc) like this: onevent EVENT_CUTSCENE ifcutscene ANIM_SOMEFILE { ifvare RETURN 12 // frame 12 sound FLY_BY rotatesprite ... } endevent The value of the RETURN var at the end of EVENT_CUTSCENE determines the next frame to play. This can be used for looping, etc. Attempting to play animations backwards outright is not advised as animations only seek in one direction (so rewinding requires running it through from frame 0 again). This is will WIP and hasn't been heavily tested at all, so please try it out. git-svn-id: https://svn.eduke32.com/eduke32@4987 1a8010ca-5511-0410-912e-c29ae57300e0
45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
//-------------------------------------------------------------------------
|
|
/*
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
This file is part of EDuke32.
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License version 2
|
|
as published by the Free Software Foundation.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
//-------------------------------------------------------------------------
|
|
|
|
#ifndef anim_h_
|
|
#define anim_h_
|
|
|
|
#define NUM_HARDCODED_ANIMS 12
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t* animbuf;
|
|
void (*sound_func)(int32_t);
|
|
uint16_t *sounds;
|
|
int16_t numsounds;
|
|
uint8_t framedelay;
|
|
char animlock;
|
|
} dukeanim_t;
|
|
|
|
extern dukeanim_t * g_animPtr;
|
|
extern hashtable_t h_dukeanim;
|
|
extern dukeanim_t * G_FindAnim(const char *s);
|
|
extern dukeanim_t * G_DefineAnim(const char *fn, uint8_t framerate, void (*sound_func)(int32_t));
|
|
int32_t G_PlayAnim(const char *fn);
|
|
void G_InitAnim(void);
|
|
|
|
#endif
|