| 1 |
/**************************************************************************** |
| 2 |
|
| 3 |
This file is part of the wolfenqt project on http://qt.gitorious.org. |
| 4 |
|
| 5 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).* |
| 6 |
All rights reserved. |
| 7 |
|
| 8 |
Contact: Nokia Corporation (qt-info@nokia.com)** |
| 9 |
|
| 10 |
You may use this file under the terms of the BSD license as follows: |
| 11 |
|
| 12 |
"Redistribution and use in source and binary forms, with or without |
| 13 |
modification, are permitted provided that the following conditions are met: |
| 14 |
* Redistributions of source code must retain the above copyright notice, |
| 15 |
* this list of conditions and the following disclaimer. |
| 16 |
* Redistributions in binary form must reproduce the above copyright notice, |
| 17 |
* this list of conditions and the following disclaimer in the documentation |
| 18 |
* and/or other materials provided with the distribution. |
| 19 |
* Neither the name of Nokia Corporation and its Subsidiary(-ies) nor the |
| 20 |
* names of its contributors may be used to endorse or promote products |
| 21 |
* derived from this software without specific prior written permission. |
| 22 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 23 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 24 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 25 |
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 26 |
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 27 |
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 28 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 29 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 30 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 31 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 32 |
POSSIBILITY OF SUCH DAMAGE." |
| 33 |
|
| 34 |
****************************************************************************/ |
| 35 |
#include <QtGui> |
| 36 |
#include "mazescene.h" |
| 37 |
|
| 38 |
int main(int argc, char **argv) |
| 39 |
{ |
| 40 |
QApplication app(argc, argv); |
| 41 |
app.setApplicationName("WolfenQt"); |
| 42 |
QPixmapCache::setCacheLimit(100 * 1024); // 100 MB |
| 43 |
|
| 44 |
const char *map = |
| 45 |
"###&?#.#" |
| 46 |
"# #" |
| 47 |
"= &" |
| 48 |
"# #" |
| 49 |
"# /### #" |
| 50 |
"& # #" |
| 51 |
"* @@ &" |
| 52 |
"# @@ # #" |
| 53 |
"# #" |
| 54 |
"###&%-##" |
| 55 |
"$ !" |
| 56 |
"#&&&&&&#"; |
| 57 |
|
| 58 |
QVector<Light> lights; |
| 59 |
lights << Light(QPointF(3.5, 2.5), 1) |
| 60 |
<< Light(QPointF(3.5, 6.5), 1) |
| 61 |
<< Light(QPointF(1.5, 10.5), 0.3); |
| 62 |
|
| 63 |
MazeScene *scene = new MazeScene(lights, map, 8, 12); |
| 64 |
|
| 65 |
View view; |
| 66 |
view.resize(800, 600); |
| 67 |
view.setScene(scene); |
| 68 |
view.showFullScreen(); |
| 69 |
|
| 70 |
return app.exec(); |
| 71 |
} |