QTfrontend/ui/widget/bgwidget.cpp
author Xeli
Sun, 22 Jan 2012 23:36:36 +0100
changeset 6589 2fa0a274a1e3
parent 6583 4218782d8ca0
child 6616 f77bb02b669f
permissions -rw-r--r--
some tweaks to the build process, cmake now generates some vital files, fpc only compiles those files which have been changed since the last time, SDL still does not work
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     1
/*
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     3
 * Copyright (c) 2009 Kristian Lehmann <email@thexception.net>
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4560
diff changeset
     4
 * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr@gmail.com>
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     5
 *
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License as published by
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     8
 * the Free Software Foundation; version 2 of the License
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
     9
 *
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    13
 * GNU General Public License for more details.
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    14
 *
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    18
 */
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    19
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    20
#include "bgwidget.h"
6579
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    21
#include "hwconsts.h"
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    22
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    23
SpritePosition::SpritePosition(QWidget * parent, int sw, int sh)
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    24
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    25
    wParent = parent;
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    26
    iSpriteWidth = sw;
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    27
    iSpriteHeight = sh;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    28
    reset();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    29
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    30
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    31
SpritePosition::~SpritePosition()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    32
{
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    33
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    34
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    35
void SpritePosition::move()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    36
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    37
    fX += fXMov;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    38
    fY += fYMov;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    39
    iAngle += 4;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    40
    if (iAngle >= 360) iAngle = 0;
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
    41
    if ((fX - fXMov) > wParent->width()) reset();
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
    42
    else if ((fY - fYMov) > wParent->height()) reset();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    43
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    44
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    45
void SpritePosition::reset()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    46
{
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    47
    // random movement values
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    48
    fYMov = ((qrand() % 400)+300) / 100.0f;
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    49
    fXMov = fYMov * 0.2f+((qrand()%100)/100.0f * 0.6f); //so between 0.2 and 0.8, or 0.5 +/- 0.3
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    50
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    51
    // random respawn locations
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    52
    int tmp = fXMov * (wParent->height() / fYMov);
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    53
    fX = (qrand() % (wParent->width() + tmp)) - tmp;
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    54
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    55
    // adjust respawn location to be next to (but outside) the parent's limits
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    56
    if (fX > -iSpriteWidth)
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    57
    {
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    58
        fY = -1 * iSpriteHeight;
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    59
    }
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    60
    else
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    61
    {
6243
9777d802be1a whoops, I'm a nerd
sheepluva
parents: 6242
diff changeset
    62
        fY = qrand() % wParent->height();
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    63
        fX = -iSpriteWidth;
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    64
    }
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    65
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
    66
    // random initial angle
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    67
    iAngle = qrand() % 360;
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    68
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    69
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    70
QPoint SpritePosition::pos()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    71
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    72
    return QPoint((int)fX,(int)fY);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    73
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    74
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    75
int SpritePosition::getAngle()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    76
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    77
    return iAngle;
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    78
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    79
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    80
void SpritePosition::init()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    81
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    82
    fY = qrand() % (wParent->height() + 1);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
    83
    fX = qrand() % (wParent->width() + 1);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    84
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    85
6574
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
    86
BGWidget::BGWidget(QWidget * parent) : QWidget(parent), enabled(false)
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
    87
{
2071
0faa147c47df Still trying to improve perf of stars - this seems to help a little bit
nemo
parents: 2069
diff changeset
    88
    setAttribute(Qt::WA_NoSystemBackground, true);
6579
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    89
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    90
    QString fname;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    91
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    92
    //For each season, there is a replacement for the star (Star.png)
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    93
    //Todo: change element for easter and birthday
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    94
    //Simply replace Confetti.png and Egg.png with an appropriate graphic)
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    95
    switch (season)
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    96
    {
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    97
    case SEASON_CHRISTMAS : fname = "Flake.png";
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    98
			    break;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
    99
    case SEASON_EASTER : fname = "Egg.png";
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   100
			 break;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   101
    case SEASON_HWBDAY : fname = "Confetti.png";
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   102
			 break;
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   103
    default : fname = "Star.png";
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   104
    }
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   105
fc52f7c22c9b GCI task: season greetings
valnut
parents: 6574
diff changeset
   106
    sprite.load(":/res/" + fname);
2377
f3fab2b09e0c And in frontend
nemo
parents: 2071
diff changeset
   107
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   108
    setAutoFillBackground(false);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   109
6242
27297c421bbc frontend flakes:
sheepluva
parents: 6241
diff changeset
   110
    for (int i = 0; i < SPRITE_MAX; i++) spritePositions[i] = new SpritePosition(this, sprite.width(), sprite.height());
2377
f3fab2b09e0c And in frontend
nemo
parents: 2071
diff changeset
   111
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   112
    for (int i = 0; i < 90; i++)
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   113
    {
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   114
        rotatedSprites[i] = new QImage(sprite.width(), sprite.height(), QImage::Format_ARGB32);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   115
        rotatedSprites[i]->fill(0);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   116
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   117
        QPoint translate(sprite.width()/2, sprite.height()/2);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   118
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   119
        QPainter p;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   120
        p.begin(rotatedSprites[i]);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   121
    //  p.setRenderHint(QPainter::Antialiasing);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   122
        p.setRenderHint(QPainter::SmoothPixmapTransform);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   123
        p.translate(translate.x(), translate.y());
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   124
        p.rotate(4 * i);
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   125
        p.translate(-1*translate.x(), -1*translate.y());
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   126
        p.drawImage(0, 0, sprite);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   127
    }
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   128
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   129
    timerAnimation = new QTimer();
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   130
    connect(timerAnimation, SIGNAL(timeout()), this, SLOT(animate()));
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   131
    timerAnimation->setInterval(ANIMATION_INTERVAL);
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   132
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   133
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   134
BGWidget::~BGWidget()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   135
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   136
    for (int i = 0; i < SPRITE_MAX; i++) delete spritePositions[i];
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   137
    for (int i = 0; i < 90; i++) delete rotatedSprites[i];
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   138
    delete timerAnimation;
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   139
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   140
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   141
void BGWidget::paintEvent(QPaintEvent *event)
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   142
{
4560
5d6c7f88db73 - Some work on drawMap widget and scene to allow undo, clear, save and load operations
unc0rr
parents: 2948
diff changeset
   143
    Q_UNUSED(event);
6574
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
   144
    if (!enabled)
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
   145
        return;
4560
5d6c7f88db73 - Some work on drawMap widget and scene to allow undo, clear, save and load operations
unc0rr
parents: 2948
diff changeset
   146
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   147
    QPainter p;
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   148
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   149
    p.begin(this);
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   150
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   151
    for (int i = 0; i < SPRITE_MAX; i++)
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   152
    {
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   153
        QPoint point = spritePositions[i]->pos();
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   154
        p.drawImage(point.x(), point.y(), *rotatedSprites[spritePositions[i]->getAngle()/4]);
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   155
    }
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   156
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   157
    p.end();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   158
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   159
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   160
void BGWidget::animate()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   161
{
6574
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
   162
    if (!enabled)
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
   163
        return;
ec059b55aa72 GCI task: stars
bovi
parents: 6243
diff changeset
   164
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   165
    for (int i = 0; i < SPRITE_MAX; i++)
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   166
    {
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   167
        QPoint oldPos = spritePositions[i]->pos();
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   168
        spritePositions[i]->move();
6241
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   169
        QPoint newPos = spritePositions[i]->pos();
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   170
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   171
        int xdiff = newPos.x() - oldPos.x();
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   172
        int ydiff = newPos.y() - oldPos.y();
e2c7771162ae frontend flakes:
sheepluva
parents: 6060
diff changeset
   173
        update(oldPos.x(), oldPos.y(), xdiff+sprite.width(), ydiff+sprite.height());
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   174
    }
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   175
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   176
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   177
void BGWidget::startAnimation()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   178
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   179
    timerAnimation->start();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   180
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   181
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   182
void BGWidget::stopAnimation()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   183
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   184
    timerAnimation->stop();
6583
4218782d8ca0 skip button sound when exiting
bovi
parents: 6579
diff changeset
   185
    repaint();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   186
}
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   187
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   188
void BGWidget::init()
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   189
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2377
diff changeset
   190
    for (int i = 0; i < SPRITE_MAX; i++) spritePositions[i]->init();
2012
76fff564246b TheXception's patch:
unc0rr
parents:
diff changeset
   191
}