D:/WorkAround/prequengine/trunk/src/sdlengine.h File Reference

This file contains SDL engine routines. More...

#include <SDL/SDL.h>
#include "debug.h"

Include dependency graph for sdlengine.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sdl_close ()
int sdl_initialize ()
void fps_cycles (int fps)
void delay (unsigned int time)
void set_palette (unsigned char *palette)
void fade_black_2_white ()
void flip ()
void copy_block_phys (int left, int top, int right, int bottom)
void init_screen_buffer (unsigned char *buffer, int width, int height)
void cross_fade (unsigned char *buffer, unsigned char *palette)
void toggle_fullscreen ()
void read_keys ()
void ttf_draw_text (int X, int Y, char *string, int center)
void get_mouse_positions (MouseStatusStruct *mouseData)

Variables

unsigned char * workVideoBuffer
unsigned char * frontVideoBuffer
unsigned char * frontVideoBufferbis
int screenLockupTable [2000]
unsigned char pressedKeyMap [29]
unsigned short int pressedKeyCharMap [31]
short int skipedKey
short int pressedKey
short int skipIntro
short int currentKey
short int key
short int leftMouse
short int rightMouse
SDL_Surface * screen


Detailed Description

This file contains SDL engine routines.

Prequengine: a Little Big Adventure engine

Copyright (C) 2008 Prequengine team
Copyright (C) 2002-2007 The TwinEngine team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file sdlengine.h.


Function Documentation

void copy_block_phys ( int  left,
int  top,
int  right,
int  bottom 
)

Blit surface in the screen in a determinate area

Parameters:
left left position to start copy
top top position to start copy
right right position to start copy
bottom bottom position to start copy

Definition at line 264 of file sdlengine.c.

References screen, and screenBuffer.

Referenced by draw_button_gfx(), and flip_redraw_areas().

void cross_fade ( unsigned char *  buffer,
unsigned char *  palette 
)

Cross fade feature

Parameters:
buffer screen buffer
palette new palette to cross fade
Cross fade feature
Parameters:
buffer screen buffer
palette new palette to cross fade

Definition at line 289 of file sdlengine.c.

References delay(), screen, SCREEN_HEIGHT, SCREEN_WIDTH, and surfaceTable.

Referenced by fade_in(), play_fla_movie(), and redraw_engine_actions().

void delay ( unsigned int  time  ) 

Deplay certain seconds till proceed

Parameters:
time time in seconds to delay

Definition at line 209 of file sdlengine.c.

References lbaTime, read_keys(), and skipIntro.

Referenced by adeline_logo(), cross_fade(), and load_image_delay().

void fade_black_2_white (  ) 

Fade screen from black to white

Definition at line 237 of file sdlengine.c.

References screen.

void flip (  ) 

Blit surface in the screen

Definition at line 253 of file sdlengine.c.

References screen, and screenBuffer.

Referenced by advoptions_menu(), main_menu(), options_menu(), play_fla_movie(), redraw_engine_actions(), savemanage_menu(), and volume_menu().

void fps_cycles ( int  fps  ) 

Frames per second sdl delay

Frames per second sdl delay

Parameters:
fps frames per second

Definition at line 201 of file sdlengine.c.

References lbaTime.

Referenced by draw_button(), fade_2_black(), fade_2_pal(), game_engine_loop(), giveup_menu(), main_menu(), and play_fla_movie().

void get_mouse_positions ( MouseStatusStruct mouseData  ) 

void init_screen_buffer ( unsigned char *  buffer,
int  width,
int  height 
)

Create SDL screen surface

Parameters:
buffer screen buffer to blit surface
width screen width size
height screen height size

Definition at line 281 of file sdlengine.c.

References SCREEN_WIDTH, and screenBuffer.

Referenced by allocate_video_memory().

void read_keys (  ) 

Handle keyboard pressed keys

Definition at line 361 of file sdlengine.c.

References leftMouse, pressedKey, pressedKeyCharMap, pressedKeyMap, rightMouse, skipedKey, skipIntro, and toggle_fullscreen().

Referenced by delay(), play_fla_movie(), process_menu(), and run_game_engine().

void sdl_close (  ) 

Close everything in the game

Definition at line 88 of file sdlengine.c.

References atexit_callback(), stop_midi_music(), and stop_track_music().

Referenced by main(), and sdl_initialize().

int sdl_initialize (  ) 

SDL initializer

Returns:
SDL init state

Definition at line 97 of file sdlengine.c.

References cfgfile, ConfigFile::Debug, HIGH_QUALITY_FREQUENCY, ORIGINAL_GAME_FREQUENCY, screen, SCREEN_HEIGHT, SCREEN_WIDTH, sdl_close(), surfaceTable, and ConfigFile::UseHQSnd.

Referenced by init_engine().

void set_palette ( unsigned char *  palette  ) 

Set a new palette in the SDL screen buffer

Parameters:
palette palette to set

Definition at line 227 of file sdlengine.c.

References screen, and screenBuffer.

Referenced by adjust_palette(), black_2_white(), fade_2_pal(), load_image(), load_menu_image(), play_fla_movie(), set_back_pal(), and toggle_fullscreen().

void toggle_fullscreen (  ) 

Switch between window and fullscreen modes

Definition at line 337 of file sdlengine.c.

References cfgfile, convert_pal_2_RGBA(), copy_screen(), frontVideoBuffer, ConfigFile::FullScreen, palette, paletteRGBA, screen, SCREEN_HEIGHT, SCREEN_WIDTH, set_palette(), and workVideoBuffer.

Referenced by init_engine(), and read_keys().

void ttf_draw_text ( int  X,
int  Y,
char *  string,
int  center 
)


Variable Documentation

short int currentKey

Current key value

Definition at line 70 of file sdlengine.c.

unsigned char* frontVideoBuffer

unsigned char* frontVideoBufferbis

Auxiliar game video buffer

Definition at line 37 of file sdlengine.h.

Referenced by allocate_video_memory().

short int key

Auxiliar key value

Definition at line 72 of file sdlengine.c.

Referenced by process_menu().

short int leftMouse

Definition at line 58 of file sdlengine.h.

Referenced by init_vars(), and read_keys().

short int pressedKey

Pressed key - printTextVar12

Definition at line 65 of file sdlengine.c.

Referenced by process_menu(), and read_keys().

unsigned short int pressedKeyCharMap[31]

Pressed key char map - scanCodeTab2

Definition at line 45 of file sdlengine.h.

Referenced by init_keymap(), and read_keys().

unsigned char pressedKeyMap[29]

Pressed key map - scanCodeTab1

Definition at line 43 of file sdlengine.h.

Referenced by init_keymap(), and read_keys().

short int rightMouse

Definition at line 59 of file sdlengine.h.

Referenced by init_vars(), and read_keys().

SDL_Surface* screen

Main SDL screen surface buffer

Definition at line 53 of file sdlengine.c.

Referenced by copy_block_phys(), cross_fade(), draw_character(), fade_black_2_white(), flip(), sdl_initialize(), set_palette(), and toggle_fullscreen().

int screenLockupTable[2000]

short int skipedKey

Skipped key - key1

Definition at line 63 of file sdlengine.c.

Referenced by process_menu(), and read_keys().

short int skipIntro

Skip intro variable

Definition at line 68 of file sdlengine.c.

Referenced by delay(), play_fla_movie(), process_menu(), read_keys(), redraw_engine_actions(), run_game_engine(), and show_giveup_menu().

unsigned char* workVideoBuffer


Generated on Thu Sep 18 14:14:49 2008 for Prequengine by  doxygen 1.5.5