//------------------------------------------------------------------------------ // File: load.c // Author: George Bain // Date: May 26, 1997 // Description: Load all sprites and initialize // Copyright (C) 1997 George Bain, All Rights Reserved //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // I N C L U D E S //------------------------------------------------------------------------------ #include // standard Sony library #include "load.h" #include "gfx.h" #include "sprites.img" //------------------------------------------------------------------------------ // G L O B A L S //------------------------------------------------------------------------------ object_handler red_enemy[NUM_ENEMIES], blue_enemy[NUM_ENEMIES]; object_handler rockets[NUM_ROCKETS]; object_handler explosion[NUM_EXPLOSIONS]; object_handler power_up[NUM_POWERUPS]; object_handler player; object_handler boss_one; object_handler status; //------------------------------------------------------------------------------ // Function: InitBossOne() // Description: Initialize first boss sprite // Parameters: none // Returns: void // Notes: Using tga2img by Mario Perdue //------------------------------------------------------------------------------ void InitBossOne( void ) { u_short tpage; // texture page RECT rect; // frame buffer rectangular area // load image into the frame buffer rect.x = IMG_SPRITES_X; rect.y = IMG_SPRITES_Y; rect.w = IMG_SPRITES_WW; rect.h = IMG_SPRITES_H; LoadImage(&rect, imgSprites); // load the palette into the frame buffer rect.x = PAL_SPRITES_X; rect.y = PAL_SPRITES_Y; rect.w = PAL_SPRITES_WW; rect.h = 1; LoadImage(&rect, palSprites); // get the texture page for the image tpage = GetTPage(2, 0, IMG_SPRITES_X, IMG_SPRITES_Y); InitSprite( (object_ptr)&boss_one.sprite,IMG_SPRITES_ATTR,100,100,0,0, tpage,0,0,PAL_SPRITES_X,PAL_SPRITES_Y,0x80,0x80,0x80,0,0,ONE,ONE,0 ); GetFrame( (object_ptr)&boss_one.sprite,BOSS_WIDTH,BOSS_HEIGHT,1,85,0 ); boss_one.state = BOSS_DEACTIVE; // set state printf("Init boss one complete\n"); }// InitBossOne //------------------------------------------------------------------------------ // Function: InitEnemy() // Description: Initialize enemy sprites // Parameters: none // Returns: void // Notes: Using tga2img by Mario Perdue //------------------------------------------------------------------------------ void InitEnemy( void ) { u_short tpage; // texture page RECT rect; // frame buffer rectangular area int count; // load image into the frame buffer rect.x = IMG_SPRITES_X; rect.y = IMG_SPRITES_Y; rect.w = IMG_SPRITES_WW; rect.h = IMG_SPRITES_H; LoadImage(&rect, imgSprites); // load the palette into the frame buffer rect.x = PAL_SPRITES_X; rect.y = PAL_SPRITES_Y; rect.w = PAL_SPRITES_WW; rect.h = 1; LoadImage(&rect, palSprites); // get the texture page for the image tpage = GetTPage(2, 0, IMG_SPRITES_X, IMG_SPRITES_Y); for ( count=0; count