/** * Program: Solo, a computer solitarie card game. * By: MD, md@tomatesasesinos.com * Copyright 2007 * * License: GPL http://www.gnu.org/licences/gpl.html * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * File: graficos.h * Contents: Constants, function heads and other things */ #ifndef _GRAFICOS_H_ #define _GRAFICOS_H_ #include "globals.h" #define BORDEPANTALLA 10 // No menor que GROSORBORDEPALOS+SEPARACIONDEPALOS #define ANCHOCARTA 50 #define ALTOCARTA 68 #define SEPARACION 20 //No menor que GROSORBORDEPALOS+SEPARACIONDEPALOS #define SEPARACIONVERTICALENTRECARTAS 23 #define SEPARACIONVERTICALENTRECARTAYVOLTEADA 5 #define GROSORBORDEPALOS 1 #define SEPARACIONBORDEPALOS 2 #define SEPARACIONENTRECARTASMONTON 2 #define FICHERO_IMG_CARTAS "data/ornamental.png" #define FICHERO_IMG_CONTRA "data/contra00.png" #define FICHERO_IMG_GANASTE "data/ganaste.png" #define FICHERO_IMG_VACIA "data/vacia.png" #define FICHERO_IMG_SELROJO "data/seleccion rojo.png" #define FICHERO_IMG_SELAZUL "data/seleccion azul.png" SDL_Rect cursorTeclado; //Cordenadas del rectangulo translucido que se usa para elegir cartas con el teclado SDL_Surface *cursorSuperficie; int posicionesPosiblesCursor[POSICIONESTABLERO]; //Posiciones posibles para el cursor que van cambiando en cada momento. Y van de 0 no se puede colocar ahi, 1 la primera posicion de ese sitio de la carta mas arriba de la escalera o la carta boca abajo que se puede destapar y NUMEROS MAYORES para posiciones por debajo si se quiere coger varias cartas int posicionActualCursor; // Es 100*POSICION DENTRO DE ESCALERA + POSICION TABLERO int posicionAnteriorCursor; //Superficie y cordenadas del rectangulo que marca la carta origen de la accion SDL_Surface *cursorOrigenAccionSuperficie; SDL_Rect cursorOrigenAccion; int accionEnCurso; #define ARRIBA 0 #define ABAJO 1 #define DERECHA 2 #define IZQUIERDA 3 SDL_Surface *pantalla, *cartas, *contra,*vacia, *ganaste; void iniciarCursores(void); void cargarImagenes(void); void iniciarSDL(void); void iniciarVentana(void); SDL_Rect *cualSpriteCarta(int numCarta); void blitCartaArriba(int posDelTablero, int x,int y); //Tiene encuenta el borde de la pantalla void mostrarMesa(void); void dibujarBordesPalos(void); void dibujarMontones(void); void dibujarEscaleras(void); void blitCarta(int posDelTablero,int posDentroPila,int x,int y); void solitarioSDL(void); void mostrarCursorTeclado(void); SDL_Surface *crearSuperficie(int w, int h); void moverCursorTeclado(int direccion); void accion(void); void accionSacar(void); #endif