~ubuntu-branches/debian/stretch/opentyrian/stretch

« back to all changes in this revision

Viewing changes to src/nortvars.c

  • Committer: Package Import Robot
  • Author(s): Etienne Millon
  • Date: 2015-03-31 08:48:54 UTC
  • Revision ID: package-import@ubuntu.com-20150331084854-f5a4uoz7uv3vopk6
Tags: upstream-2.1.20130907+dfsg
ImportĀ upstreamĀ versionĀ 2.1.20130907+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * OpenTyrian: A modern cross-platform port of Tyrian
 
3
 * Copyright (C) 2007-2009  The OpenTyrian Development Team
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
#include "file.h"
 
20
#include "joystick.h"
 
21
#include "keyboard.h"
 
22
#include "nortvars.h"
 
23
#include "opentyr.h"
 
24
#include "vga256d.h"
 
25
#include "video.h"
 
26
 
 
27
#include <assert.h>
 
28
#include <ctype.h>
 
29
 
 
30
JE_boolean inputDetected;
 
31
 
 
32
JE_boolean JE_anyButton( void )
 
33
{
 
34
        poll_joysticks();
 
35
        service_SDL_events(true);
 
36
        return newkey || mousedown || joydown;
 
37
}
 
38
 
 
39
void JE_dBar3( SDL_Surface *surface, JE_integer x,  JE_integer y,  JE_integer num,  JE_integer col )
 
40
{
 
41
        JE_byte z;
 
42
        JE_byte zWait = 2;
 
43
 
 
44
        col += 2;
 
45
 
 
46
        for (z = 0; z <= num; z++)
 
47
        {
 
48
                JE_rectangle(surface, x, y - 1, x + 8, y, col); /* <MXD> SEGa000 */
 
49
                if (zWait > 0)
 
50
                {
 
51
                        zWait--;
 
52
                } else {
 
53
                        col++;
 
54
                        zWait = 1;
 
55
                }
 
56
                y -= 2;
 
57
        }
 
58
}
 
59
 
 
60
void JE_barDrawShadow( SDL_Surface *surface, JE_word x, JE_word y, JE_word res, JE_word col, JE_word amt, JE_word xsize, JE_word ysize )
 
61
{
 
62
        xsize--;
 
63
        ysize--;
 
64
 
 
65
        for (int z = 1; z <= amt / res; z++)
 
66
        {
 
67
                JE_barShade(surface, x+2, y+2, x+xsize+2, y+ysize+2);
 
68
                fill_rectangle_xy(surface, x, y, x+xsize, y+ysize, col+12);
 
69
                fill_rectangle_xy(surface, x, y, x+xsize, y, col+13);
 
70
                JE_pix(surface, x, y, col+15);
 
71
                fill_rectangle_xy(surface, x, y+ysize, x+xsize, y+ysize, col+11);
 
72
                x += xsize + 2;
 
73
        }
 
74
 
 
75
        amt %= res;
 
76
        if (amt > 0)
 
77
        {
 
78
                JE_barShade(surface, x+2, y+2, x+xsize+2, y+ysize+2);
 
79
                fill_rectangle_xy(surface, x,y, x+xsize, y+ysize, col+(12 / res * amt));
 
80
        }
 
81
}
 
82
 
 
83
void JE_wipeKey( void )
 
84
{
 
85
        // /!\ Doesn't seems to affect anything.
 
86
}
 
87