blob: b5c275f72fd4275d73d43bea9c6c8c760eda5a86 [file] [log] [blame]
Kevin Ferrare93b2f9f2007-08-04 03:01:46 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: jackpot.c 14034 2007-07-28 05:42:55Z kevin $
9 *
Nicolas Pennequin357ffb32008-05-05 10:32:46 +000010 * Copyright (C) 2007 Copyright Kévin Ferrare
Kevin Ferrare93b2f9f2007-08-04 03:01:46 +000011 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Kevin Ferrare93b2f9f2007-08-04 03:01:46 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "picture.h"
23
24void picture_draw(struct screen* display, const struct picture* picture,
25 int x, int y){
26 display->bitmap(
27 picture->data,
28 x, y,
29 picture->width, picture->height
30 );
31}
32
33/**
34 * Draws a part of the given picture on the given screen
35 * Use it when the data contains multiple pictures from top to bottom.
36 * In that case, picture.height represents the height of one picture,
37 * not the whole set.
38 * @param display the screen where to display the picture
39 * @param picture the picture's data, only a part will be displayed
40 * @param yoffset display the data in the picture from yoffset to
41 * yoffset+picture.height
42 * @param x abscissa where to put the picture
43 * @param y ordinate where to put the picture
44 */
45void vertical_picture_draw_part(struct screen* display, const struct picture* picture,
46 int yoffset,
47 int x, int y){
48 display->bitmap_part(
49 picture->data,
50 /*slice into picture->data */
51 0, yoffset,
52 picture->width,
53 /* Position on the screen */
54 x, y, picture->width, picture->height
55 );
56}
57
58/**
59 * Draws a part of the given picture on the given screen
60 * Use it when the data contains multiple pictures from top to bottom.
61 *
62 * @param display the screen where to display the picture
63 * @param picture the picture's data, only a part will be displayed
64 * @param sprite_no display that sprite in the picture
65 * @param x abscissa where to put the picture
66 * @param y ordinate where to put the picture
67 */
68void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture,
69 int sprite_no,
70 int x, int y){
71 vertical_picture_draw_part(display, picture, sprite_no*picture->height, x, y);
72}