text: /* VUEngine - Virtual Utopia Engine <http://vuengine.planetvb.com/>
   * A universal game engine for the Nintendo Virtual Boy
   *
   * Copyright (C) 2007, 2018 by Jorge Eremiev <jorgech3@gmail.com> and Christian Radke <chris@vr32.de>
   *
   * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
   * associated documentation files (the "Software"), to deal in the Software without restriction, including
   * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
   * the following conditions:
   *
   * The above copyright notice and this permission notice shall be included in all copies or substantial
   * portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
   * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
   * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   */
  
  
  //---------------------------------------------------------------------------------------------------------
  //												INCLUDES
  //---------------------------------------------------------------------------------------------------------
  
  #include <Libgccvb.h>
  #include <AnimatedImage.h>
  #include <BgmapAnimatedSprite.h>
  #include <AnimationState.h>
  
  
  //---------------------------------------------------------------------------------------------------------
  //												DECLARATIONS
  //---------------------------------------------------------------------------------------------------------
  
  extern BYTE VertigoLeftTiles[];
  extern BYTE VertigoLeftMap[];
  extern BYTE VertigoRightTiles[];
  extern BYTE VertigoRightMap[];
  
  
  //---------------------------------------------------------------------------------------------------------
  //												DEFINITIONS
  //---------------------------------------------------------------------------------------------------------
  
  // a function which defines the frames to play
  AnimationFunctionROMSpec VERTIGO_DEFAULT_ANIM =
  {
  	// number of frames of this animation function
  	18,
  
  	// frames to play in animation
  	{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
  
  	// number of cycles a frame of animation is displayed
  	8,
  
  	// whether to play it in loop or not
  	false,
  
  	// method to call on function completion
  	(EventListener)&AnimatedImage_playVolcanoEnd,
  
  	// function's name
  	"Default",
  };
  
  // a function which defines the frames to play
  AnimationFunctionROMSpec VERTIGO_DEFAULT_LOOP_ANIM =
  {
  	// number of frames of this animation function
  	30,
  
  	// frames to play in animation
  	{
  		 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
  		15, 14, 13, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  2,  1,
  	 },
  
  	// number of cycles a frame of animation is displayed
  	8,
  
  	// whether to play it in loop or not
  	true,
  
  	// method to call on function completion
  	NULL,
  
  	// function's name
  	"Loop",
  };
  
  // an animation spec
  AnimationDescriptionROMSpec VERTIGO_ANIM =
  {
  	// animation functions
  	{
  		(AnimationFunction*)&VERTIGO_DEFAULT_ANIM,
  		(AnimationFunction*)&VERTIGO_DEFAULT_LOOP_ANIM,
  		NULL,
  	}
  };
  
  
  /* Left */
  
  CharSetROMSpec VERTIGO_L_CH =
  {
  	// number of chars, depending on allocation type:
  	// __ANIMATED_SINGLE*, __ANIMATED_SHARED*: number of chars of a single animation frame (cols * rows)
  	// __ANIMATED_MULTI, __NOT_ANIMATED: sum of all chars
  	884,
  
  	// allocation type
  	// (__ANIMATED_SINGLE, __ANIMATED_SINGLE_OPTIMIZED, __ANIMATED_SHARED, __ANIMATED_SHARED_COORDINATED, __ANIMATED_MULTI or __NOT_ANIMATED)
  	__ANIMATED_SINGLE_OPTIMIZED,
  
  	// char spec
  	VertigoLeftTiles,
  };
  
  TextureROMSpec VERTIGO_L_TX =
  {
  	// charset spec
  	(CharSetSpec*)&VERTIGO_L_CH,
  
  	// bgmap spec
  	VertigoLeftMap,
  
  	// cols (max 64)
  	48,
  
  	// rows (max 64)
  	28,
  
  	// padding for affine transformations
  	{0, 0},
  
  	// number of frames, depending on charset's allocation type:
  	// __ANIMATED_SINGLE*, __ANIMATED_SHARED*, __NOT_ANIMATED: 1
  	// __ANIMATED_MULTI: total number of frames
  	1,
  
  	// palette number (0-3)
  	0,
  
  	// recyclable
  	false,
  
  	// vertical flip
  	false,
  
  	// horizontal flip
  	false,
  };
  
  BgmapSpriteROMSpec VERTIGO_L_SPRITE =
  {
  	{
  		// sprite's type
  		__TYPE(BgmapAnimatedSprite),
  
  		// texture spec
  		(TextureSpec*)&VERTIGO_L_TX,
  
  		// transparent
  		false,
  
  		// displacement
  		{0, 0, 0, 0},
  	},
  
  	// bgmap mode (__WORLD_BGMAP, __WORLD_AFFINE, __WORLD_OBJECT or __WORLD_HBIAS)
  	// make sure to use the proper corresponding sprite type throughout the spec (BgmapSprite or ObjectSprite)
  	__WORLD_BGMAP,
  
  	// pointer to affine / hbias manipulation function
  	NULL,
  
  	// display mode (__WORLD_ON, __WORLD_LON or __WORLD_RON)
  	__WORLD_LON,
  };
  
  
  /* Right */
  
  CharSetROMSpec VERTIGO_R_CH =
  {
  	// number of chars, depending on allocation type:
  	// __ANIMATED_SINGLE*, __ANIMATED_SHARED*: number of chars of a single animation frame (cols * rows)
  	// __ANIMATED_MULTI, __NOT_ANIMATED: sum of all chars
  	893,
  
  	// allocation type
  	// (__ANIMATED_SINGLE, __ANIMATED_SINGLE_OPTIMIZED, __ANIMATED_SHARED, __ANIMATED_SHARED_COORDINATED, __ANIMATED_MULTI or __NOT_ANIMATED)
  	__ANIMATED_SINGLE_OPTIMIZED,
  
  	// char spec
  	VertigoRightTiles,
  };
  
  TextureROMSpec VERTIGO_R_TX =
  {
  	// charset spec
  	(CharSetSpec*)&VERTIGO_R_CH,
  
  	// bgmap spec
  	VertigoRightMap,
  
  	// cols (max 64)
  	48,
  
  	// rows (max 64)
  	28,
  
  	// padding for affine transformations
  	{0, 0},
  
  	// number of frames, depending on charset's allocation type:
  	// __ANIMATED_SINGLE*, __ANIMATED_SHARED*, __NOT_ANIMATED: 1
  	// __ANIMATED_MULTI: total number of frames
  	1,
  
  	// palette number (0-3)
  	0,
  
  	// recyclable
  	false,
  
  	// vertical flip
  	false,
  
  	// horizontal flip
  	false,
  };
  
  BgmapSpriteROMSpec VERTIGO_R_SPRITE =
  {
  	{
  		// sprite's type
  		__TYPE(BgmapAnimatedSprite),
  
  		// texture spec
  		(TextureSpec*)&VERTIGO_R_TX,
  
  		// transparent
  		false,
  
  		// displacement
  		{0, 0, 0, 0},
  	},
  
  	// bgmap mode (__WORLD_BGMAP, __WORLD_AFFINE, __WORLD_OBJECT or __WORLD_HBIAS)
  	// make sure to use the proper corresponding sprite type throughout the spec (BgmapSprite or ObjectSprite)
  	__WORLD_BGMAP,
  
  	// pointer to affine / hbias manipulation function
  	NULL,
  
  	// display mode (__WORLD_ON, __WORLD_LON or __WORLD_RON)
  	__WORLD_RON,
  };
  
  
  /* Entity */
  
  BgmapSpriteROMSpec* const VERTIGO_SPRITES[] =
  {
  	&VERTIGO_L_SPRITE,
  	&VERTIGO_R_SPRITE,
  	NULL
  };
  
  AnimatedImageROMSpec VERTIGO_EN =
  {
  	{
  		{
  			// class allocator
  			__TYPE(AnimatedImage),
  
  			// children
  			NULL,
  
  			// behaviors
  			NULL,
  
  			// extra
  			NULL,
  
  			// sprites
  			(SpriteSpec**)VERTIGO_SPRITES,
  
  			// use z displacement in projection
  			false,
  				
  			// collision shapes
  				(ShapeSpec*)NULL,
  
  			// size
  			// if 0, width and height will be inferred from the first sprite's texture's size
  			{0, 0, 0},
  
  			// gameworld's character's type
  			0,
  
  			// physical specification
  			(PhysicalSpecification*)NULL,
  		},
  
  		// pointer to the animation spec for the item
  		(AnimationDescription*)&VERTIGO_ANIM,
  
  		// initial animation
  		"Default",
  	}
  };
  