2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Profile done as a new generic Window::SectionWidget.

Slide animation reimplemented.
This commit is contained in:
John Preston
2016-05-19 15:03:51 +03:00
parent 6e2dea7030
commit 1d42144c95
37 changed files with 1052 additions and 373 deletions

View File

@@ -74,14 +74,15 @@ bool Processor::write(const structure::Module &module) const {
QFileInfo srcFile(module.filepath());
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
bool forceReGenerate = false;// !options_.rebuildDependencies;
common::ProjectInfo project = {
"codegen_style",
srcFile.fileName(),
"stdafx.h",
!options_.rebuildDependencies, // forceReGenerate
forceReGenerate
};
SpriteGenerator spriteGenerator(module);
SpriteGenerator spriteGenerator(module, forceReGenerate);
if (!spriteGenerator.writeSprites()) {
return false;
}

View File

@@ -48,8 +48,9 @@ constexpr int kErrorCouldNotWrite = 845;
} // namespace
SpriteGenerator::SpriteGenerator(const structure::Module &module)
: module_(module)
SpriteGenerator::SpriteGenerator(const structure::Module &module, bool forceReGenerate)
: forceReGenerate_(forceReGenerate)
, module_(module)
, basePath_(QFileInfo(module.filepath()).dir().absolutePath()) {
}
@@ -84,7 +85,7 @@ bool SpriteGenerator::writeSprites() {
}
}
QFile file(filepath);
if (file.open(QIODevice::ReadOnly)) {
if (!forceReGenerate_ && file.open(QIODevice::ReadOnly)) {
if (file.readAll() == spriteData) {
continue;
}

View File

@@ -34,7 +34,7 @@ class Module;
class SpriteGenerator {
public:
SpriteGenerator(const structure::Module &module);
SpriteGenerator(const structure::Module &module, bool forceReGenerate);
SpriteGenerator(const SpriteGenerator &other) = delete;
SpriteGenerator &operator=(const SpriteGenerator &other) = delete;
@@ -46,6 +46,7 @@ private:
QImage generateSprite(int scale); // scale = 5 for 125% and 6 for 150%.
const structure::Module &module_;
bool forceReGenerate_;
QString basePath_;
QImage sprite2x_;
QList<structure::Variable> sprites_;