File: oinksie.c

package info (click to toggle)
libvisual-plugins 1%3A0.4.0%2Bdfsg1-13
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,644 kB
  • sloc: ansic: 9,358; sh: 8,809; cpp: 871; makefile: 221; sed: 16
file content (86 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* Libvisual-plugins - Standard plugins for libvisual
 * 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit <ds@nerds-incorporated.org>
 *
 * Authors: Dennis Smit <ds@nerds-incorporated.org>
 *
 * $Id: oinksie.c,v 1.5 2006/01/22 13:25:26 synap Exp $
 *
 * 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
 */

#include <stdarg.h>
#include <stdio.h>
#include <string.h>

#include "common.h"
#include "config.h"
#include "audio.h"
#include "table.h"
#include "screen.h"
#include "gfx-palette.h"
#include "scene.h"
#include "oinksie.h"

void oinksie_init (OinksiePrivate *priv, int width, int height)
{
	_oink_screen_init (priv, width, height);
	_oink_table_init ();
	_oink_gfx_palette_init (priv);
	_oink_scene_randomize (priv);
}

void oinksie_quit (OinksiePrivate *priv)
{

}

void oinksie_sample (OinksiePrivate *priv)
{
	_oink_audio_analyse (priv);
}

void oinksie_render (OinksiePrivate *priv)
{
	_oink_scene_render (priv);
}

void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky)
{
	_oink_gfx_palette_build (priv, funky);
}

int oinksie_size_set (OinksiePrivate *priv, int width, int height)
{
	_oink_screen_size_set (priv, width, height);

	return 0;
}

VisPalette *oinksie_palette_get (OinksiePrivate *priv)
{
	/* return values for transformation */
	if (priv->pal_data.pal_new == 1)
	{
		_oink_gfx_palette_transform (priv);

		return &priv->pal_old;
	}
	else
	{
		return &priv->pal_cur;
	}
}