Skip to content

Commit

Permalink
Also make the decorations part of the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
sago007 committed Aug 13, 2023
1 parent 6444412 commit a0c212c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion source/code/BlockGameSdl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ private:
under = board[j][i-1];
}
if (((left != number)&&(right == number)&&(over != number)&&(under == number))&&(garbageSize>0)) {
DrawImgBoardBounded(smiley[board[j][i]%4], 2*bsize, 12*bsize-i*bsize-pixels+(bsize/2)*garbageSize);
if (globalData.theme.decoration.decoration_sprites.size()) {
const sago::SagoSprite& sprite = globalData.spriteHolder->GetSprite(globalData.theme.decoration.decoration_sprites[board[j][i]%globalData.theme.decoration.decoration_sprites.size()]);
DrawImgBoardBounded(sprite, 2*bsize, 12*bsize-i*bsize-pixels+(bsize/2)*garbageSize);
}
}
if (!((left != number)&&(right == number)&&(over == number)&&(under == number))) { //not in garbage
garbageSize=0;
Expand Down
4 changes: 0 additions & 4 deletions source/code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ static int InitImages(sago::SagoSpriteHolder& holder) {
garbageGM = holder.GetSprite("garbage_gm");
garbageGML = holder.GetSprite("garbage_gml");
garbageGMR = holder.GetSprite("garbage_gmr");
smiley[0] = holder.GetSprite("smileys0");
smiley[1] = holder.GetSprite("smileys1");
smiley[2] = holder.GetSprite("smileys2");
smiley[3] = holder.GetSprite("smileys3");
transCover = holder.GetSprite("trans_cover");
bExit = holder.GetSprite("b_exit");
bSkip = holder.GetSprite("b_blank");
Expand Down
1 change: 0 additions & 1 deletion source/code/mainVars.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static sago::SagoSprite garbageFill;
static sago::SagoSprite garbageM;
static sago::SagoSprite garbageML;
static sago::SagoSprite garbageMR;
static sago::SagoSprite smiley[4];
static sago::SagoSprite garbageGM;
static sago::SagoSprite garbageGML;
static sago::SagoSprite garbageGMR;
Expand Down
7 changes: 7 additions & 0 deletions source/code/themes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Source information and contacts persons can be found at
#pragma once

#include <string>
#include <vector>

enum class ImgScale { Stretch,
Tile,
Expand All @@ -39,10 +40,16 @@ struct BackGroundData {
ImgScale background_scale = ImgScale::Stretch;
};

struct DecorationData {
std::string name = "smilies";
std::vector<std::string> decoration_sprites = {"smileys0", "smileys1", "smileys2", "smileys3"};
};

struct Theme {
std::string theme_name = "standard";
std::string back_board = "back_board"; // Can also be "back_board_sample_snow" or "trans_cover"
BackGroundData background;
DecorationData decoration;
};

/**
Expand Down

0 comments on commit a0c212c

Please sign in to comment.