Debian Codegraph @

plugins/actor/oinksie/oinksie.c

raw
1 /* Libvisual-plugins - Standard plugins for libvisual
2 *
3 * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit <[email protected]>
4 *
5 * Authors: Dennis Smit <[email protected]>
6 *
7 * $Id: oinksie.c,v 1.5 2006/01/22 13:25:26 synap Exp $
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <string.h>
27
28 #include "common.h"
29 #include "config.h"
30 #include "audio.h"
31 #include "table.h"
32 #include "screen.h"
33 #include "gfx-palette.h"
34 #include "scene.h"
35 #include "oinksie.h"
36
37 void oinksie_init (OinksiePrivate *priv, int width, int height)
38 {
39 _oink_screen_init (priv, width, height);
40 _oink_table_init ();
41 _oink_gfx_palette_init (priv);
42 _oink_scene_randomize (priv);
43 }
44
45 void oinksie_quit (OinksiePrivate *priv)
46 {
47
48 }
49
50 void oinksie_sample (OinksiePrivate *priv)
51 {
52 _oink_audio_analyse (priv);
53 }
54
55 void oinksie_render (OinksiePrivate *priv)
56 {
57 _oink_scene_render (priv);
58 }
59
60 void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky)
61 {
62 _oink_gfx_palette_build (priv, funky);
63 }
64
65 int oinksie_size_set (OinksiePrivate *priv, int width, int height)
66 {
67 _oink_screen_size_set (priv, width, height);
68
69 return 0;
70 }
71
72 VisPalette *oinksie_palette_get (OinksiePrivate *priv)
73 {
74 /* return values for transformation */
75 if (priv->pal_data.pal_new == 1)
76 {
77 _oink_gfx_palette_transform (priv);
78
79 return &priv->pal_old;
80 }
81 else
82 {
83 return &priv->pal_cur;
84 }
85 }
86