Skip to content
Permalink
Browse files
Dummy graphics noe are theme specific!
you now can define dummies by theme.
data/ directory no more need and will be removed from project
  • Loading branch information
Wohlstand committed Nov 26, 2014
1 parent 4941900 commit c6b290bf19f678e34146441059601d528dae72ee
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 9 deletions.
@@ -351,6 +351,10 @@ <h1 style="text-align: left">theme.ini referance</h1>
<td style="width: 136px">overwrite-mode</td>
<td>Overwrite mode switch</td>
</tr>
<tr>
<td style="width: 136px">properties</td>
<td>Show properties icon</td>
</tr>
<tr>
<td style="width: 136px">&nbsp;</td>
<td>&nbsp;</td>
@@ -557,6 +561,54 @@ <h1 style="text-align: left">theme.ini referance</h1>
<td style="width: 136px">musicboxes-locked</td>
<td>Locked state<a/> of all </a>music boxes</td>
</tr>
<tr>
<td style="width: 136px">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td style="width: 136px; text-align: center"><strong>[items]</strong></td>
<td><strong>Overwrite default dummy images of items</strong></td>
</tr>
<tr>
<td style="width: 136px; height: 21px;">level-background</td>
<td style="height: 21px">Dummy background image</td>
</tr>
<tr>
<td style="width: 136px">level-bgo</td>
<td>Dummy background object image</td>
</tr>
<tr>
<td style="width: 136px">level-block</td>
<td>Dummy block image</td>
</tr>
<tr>
<td style="width: 136px">level-npc</td>
<td>Dummy NPC image</td>
</tr>
<tr>
<td style="width: 136px; height: 21px;">world-path</td>
<td style="height: 21px">Dummy path image</td>
</tr>
<tr>
<td style="width: 136px">world-scenery</td>
<td>Dummy scenery image</td>
</tr>
<tr>
<td style="width: 136px">world-tile</td>
<td>Dummy tile image</td>
</tr>
<tr>
<td style="width: 136px">world-level</td>
<td>Dummy level image</td>
</tr>
<tr>
<td style="width: 136px">world-musicbox</td>
<td>Music box item image</td>
</tr>
<tr>
<td style="width: 136px">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p style="text-align: left">&nbsp;</p>
<p style="text-align: left">&nbsp;</p>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -157,4 +157,15 @@
<file>sections/21.png</file>
<file>sections/21_n.png</file>
</qresource>
<qresource prefix="/dummies">
<file>dummies/dummy-bg.png</file>
<file>dummies/music_box.png</file>
<file>dummies/unknown_bgo.png</file>
<file>dummies/unknown_block.png</file>
<file>dummies/unknown_npc.png</file>
<file>dummies/unknown_path.png</file>
<file>dummies/unknown_scene.png</file>
<file>dummies/unknown_tile.png</file>
<file>dummies/unknown_wlvl.png</file>
</qresource>
</RCC>
@@ -189,6 +189,18 @@ void Themes::init()
images_map[player1] = QPixmap(":/player1.png");
images_map[player2] = QPixmap(":/player2.png");


//dummy images
images_map[dummy_musicbox] = QPixmap(":/dummies/dummies/music_box.png");
images_map[dummy_bg] = QPixmap(":/dummies/dummies/dummy-bg.png");
images_map[dummy_bgo] = QPixmap(":/dummies/dummies/unknown_bgo.png");
images_map[dummy_block] = QPixmap(":/dummies/dummies/unknown_block.png");
images_map[dummy_npc] = QPixmap(":/dummies/dummies/unknown_npc.png");
images_map[dummy_path] = QPixmap(":/dummies/dummies/unknown_path.png");
images_map[dummy_scenery] = QPixmap(":/dummies/dummies/unknown_scene.png");
images_map[dummy_tile] = QPixmap(":/dummies/dummies/unknown_tile.png");
images_map[dummy_wlevel] = QPixmap(":/dummies/dummies/unknown_wlvl.png");

currentThemeDir = "";
//initCursors();

@@ -444,6 +456,18 @@ void Themes::loadTheme(QString themeDir)
loadImage(guiset,"musicboxes-locked", musicboxes_locked );
guiset.endGroup();

guiset.beginGroup("items");
loadImage(guiset,"level-background", dummy_bg );
loadImage(guiset,"level-bgo", dummy_bgo );
loadImage(guiset,"level-block", dummy_block );
loadImage(guiset,"level-npc", dummy_npc );
loadImage(guiset,"world-path", dummy_path );
loadImage(guiset,"world-scenery", dummy_scenery );
loadImage(guiset,"world-tile", dummy_tile );
loadImage(guiset,"world-level", dummy_wlevel );
loadImage(guiset,"world-musicbox", dummy_musicbox );
guiset.endGroup();

currentThemeDir=themeDir;

initCursors();
@@ -199,7 +199,17 @@ class Themes
levels_free,
levels_locked,
musicboxes_free,
musicboxes_locked
musicboxes_locked,

dummy_musicbox,
dummy_bg,
dummy_bgo,
dummy_block,
dummy_npc,
dummy_path,
dummy_scenery,
dummy_tile,
dummy_wlevel
};

static void init();
@@ -34,6 +34,8 @@
#include "edit_modes/mode_resize.h"
#include "edit_modes/mode_fill.h"

#include "../common_features/themes.h"

LvlScene::LvlScene(GraphicsWorkspace * parentView, dataconfigs &configs, LevelData &FileData, QObject *parent) : QGraphicsScene(parent)
{
setItemIndexMethod(QGraphicsScene::NoIndex);
@@ -97,9 +99,34 @@ LvlScene::LvlScene(GraphicsWorkspace * parentView, dataconfigs &configs, LevelDa
resetCursor();

//set dummy images if target not exist or wrong
uBlockImg = QPixmap(ApplicationPath + "/" + "data/unknown_block.png");
uNpcImg = QPixmap(ApplicationPath + "/" + "data/unknown_npc.png");
uBgoImg = QPixmap(ApplicationPath + "/" + "data/unknown_bgo.png");
uBlockImg = Themes::Image(Themes::dummy_block);
uNpcImg = Themes::Image(Themes::dummy_npc);
uBgoImg = Themes::Image(Themes::dummy_bgo);

//Build animators for dummies
SimpleAnimator * tmpAnimator;
tmpAnimator = new SimpleAnimator(uBlockImg, 0);
animates_Blocks.push_back( tmpAnimator );
tmpAnimator = new SimpleAnimator(uBgoImg, 0);
animates_BGO.push_back( tmpAnimator );

obj_npc dummyNpc;
dummyNpc.frames = 1;
dummyNpc.framestyle = 0;
dummyNpc.framespeed = 64;
dummyNpc.width = uNpcImg.width();
dummyNpc.height = uNpcImg.height();
dummyNpc.gfx_w = uNpcImg.width();
dummyNpc.gfx_h = uNpcImg.height();
dummyNpc.ani_bidir = false;
dummyNpc.ani_direct = false;
dummyNpc.ani_directed_direct = false;
dummyNpc.custom_animate = false;
dummyNpc.custom_physics_to_gfx = true;
AdvNpcAnimator * tmpNpcAnimator = new AdvNpcAnimator(uNpcImg, dummyNpc);
animates_NPC.push_back( tmpNpcAnimator );




//set Default Z Indexes
@@ -36,6 +36,8 @@
#include "edit_modes/wld_mode_resize.h"
#include "edit_modes/wld_mode_setpoint.h"

#include "../common_features/themes.h"

WldScene::WldScene(GraphicsWorkspace * parentView, dataconfigs &configs, WorldData &FileData, QObject *parent) : QGraphicsScene(parent)
{
setItemIndexMethod(QGraphicsScene::NoIndex);
@@ -104,12 +106,24 @@ WldScene::WldScene(GraphicsWorkspace * parentView, dataconfigs &configs, WorldDa
messageBox = NULL;

//set dummy images if target not exist or wrong
uTileImg=QPixmap(ApplicationPath + "/" + "data/unknown_tile.png");
uSceneImg=QPixmap(ApplicationPath + "/" + "data/unknown_scene.png");
uPathImg=QPixmap(ApplicationPath + "/" + "data/unknown_path.png");
uLevelImg=QPixmap(ApplicationPath + "/" + "data/unknown_wlvl.png");
uTileImg = Themes::Image(Themes::dummy_tile);
uSceneImg = Themes::Image(Themes::dummy_scenery);
uPathImg = Themes::Image(Themes::dummy_path);
uLevelImg = Themes::Image(Themes::dummy_wlevel);

musicBoxImg = Themes::Image(Themes::dummy_musicbox);

//Build animators for dummies
SimpleAnimator * tmpAnimator;
tmpAnimator = new SimpleAnimator(uTileImg, 0);
animates_Tiles.push_back( tmpAnimator );
tmpAnimator = new SimpleAnimator(uSceneImg, 0);
animates_Scenery.push_back( tmpAnimator );
tmpAnimator = new SimpleAnimator(uPathImg, 0);
animates_Paths.push_back( tmpAnimator );
tmpAnimator = new SimpleAnimator(uLevelImg, 0);
animates_Levels.push_back( tmpAnimator );

musicBoxImg=QPixmap(ApplicationPath + "/" + "data/music_box.png");

//set Default Z Indexes
tileZ=0; // tiles

0 comments on commit c6b290b

Please sign in to comment.