Skip to content

Commit

Permalink
Merge new screenshot001.png
Browse files Browse the repository at this point in the history
  • Loading branch information
savagesteel committed Jan 26, 2020
2 parents 323bb1a + 2e38cab commit 90038a4
Show file tree
Hide file tree
Showing 33 changed files with 1,357 additions and 135 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.4.0 - 2020-01-08
### Added
- Palette hits view for all frames and current frame.
- Palette translation hits view for all frames and current frame.
- Palette hits view for current tile and current sub-tile when displaying a level CEL.
- JSON configuration file and corresponding settings dialog.
- Working folder setting.
- Status bar message when opening file.

### Changed
- Default palette from town.pal to builtin _default.pal.
- Default palette translation to _null.trn.

### Fixed
- Export dialog button height.


## 0.3.2 - 2020-01-08
### Changed
- Start using Qt Framework 5.12.6 LTS.
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Diablo 1 Graphics Tool

Diablo 1 Graphics Tool can open CEL/CL2 graphics files and display them with chosen PAL and TRN files.
- regular, level and compiled CEL support
- mono and multi-group CL2 support
- Bitmap and PNG export in multiple files or tiled file

- Regular, level and compiled CEL support.
- Mono and multi-group CL2 support.
- Palette hits and palette translation hits display.
- Bitmap and PNG export in multiple files or tiled file.

This tool is written using the Qt Framework 5.12 LTS and can be compiled on Windows, Linux and MacOS.
Go to the [releases page](https://github.com/savagesteel/d1-graphics-tool/releases) to download the latest Windows 32-bit build.

![Screenshot](/images/screenshot001.png)
![Screenshot 1](/images/screenshot001.png)
![Screenshot 2](/images/screenshot002.png)
![Screenshot 3](/images/screenshot003.png)
![Screenshot 4](/images/screenshot004.png)
31 changes: 24 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
## TODO
1. Rework PAL and TRN support
- Fix palette view crop and increase size.
- Add a palette hits view based on PalView.
- Build default.pal with first 128 bytes with a specific color.

### Add
- PowerShell release script which takes a Qt build folder as parameter
- Add settings
- Background color? (grey, green, magenta, cyan?)
- Default zoom level (depending on CEL/CL2 type?)
- By default: x2
- Automatic dezoom when opening a bigger image?
- Default palette size? (192px, 256px)
- Application icon
- PCX support
- GIF viewing support

### Change
- Rework PAL and TRN support
- Build additional palettes
- Last color with specific color to identify transparent zones
- Second half with specific color?
- One for each hue in a specific color?
- Include cel/cl2 to trn mapping in the program, especially for monsters.
2. Rewrite level CEL frame type detection to leverage associated MIN file when available.
3. Add PCX support
4. Add GIF viewing support
- Remove CelView and LevelCelView dependencies from PalView by leveraging signals/slots.
- Rewrite level CEL frame type detection to leverage associated MIN file when available.

### Fix
- Last color of pal/trn not displayed as transparent??
Binary file modified images/screenshot001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed releases/d1-graphics-tool-0.3.1-win-x86.zip
Binary file not shown.
Binary file removed releases/d1-graphics-tool-0.3.2-win-x86.zip
Binary file not shown.
9 changes: 6 additions & 3 deletions source/D1GraphicsTool.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ SOURCES += main.cpp \
d1til.cpp \
levelcelview.cpp \
d1celbase.cpp \
exportdialog.cpp
exportdialog.cpp \
settingsdialog.cpp

HEADERS += mainwindow.h \
d1cel.h \
Expand All @@ -47,13 +48,15 @@ HEADERS += mainwindow.h \
d1til.h \
levelcelview.h \
d1celbase.h \
exportdialog.h
exportdialog.h \
settingsdialog.h

FORMS += mainwindow.ui \
celview.ui \
palview.ui \
levelcelview.ui \
exportdialog.ui
exportdialog.ui \
settingsdialog.ui

RESOURCES += \
d1files.qrc
15 changes: 12 additions & 3 deletions source/D1GraphicsTool.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2020-01-08T18:46:27. -->
<!-- Written by QtCreator 4.11.0, 2020-01-26T13:46:52. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -59,6 +59,15 @@
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.TidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
Expand All @@ -67,7 +76,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.6 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.6 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5126.win32_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
Expand Down Expand Up @@ -299,7 +308,7 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/Christophe/GitHub/d1-graphics-tool/build-D1GraphicsTool-Desktop_Qt_5_12_6_MinGW_32_bit-Release</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/Christophe/GitHub/d1-graphics-tool/build-D1GraphicsTool-Desktop_Qt_5_12_6_MinGW_32_bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
Expand Down
15 changes: 14 additions & 1 deletion source/celview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CelView::~CelView()
delete ui;
}

void CelView::setCel( D1CelBase* c )
void CelView::initialize( D1CelBase* c )
{
this->cel = c;

Expand All @@ -45,11 +45,21 @@ void CelView::setCel( D1CelBase* c )
QString::number( this->cel->getFrameCount() ) );
}

D1CelBase* CelView::getCel()
{
return this->cel;
}

QString CelView::getCelPath()
{
return this->cel->getFilePath();
}

quint32 CelView::getCurrentFrameIndex()
{
return this->currentFrameIndex;
}

void CelView::displayFrame()
{
if( !this->cel )
Expand Down Expand Up @@ -88,6 +98,9 @@ void CelView::displayFrame()
// Set current frame text
this->ui->frameIndexEdit->setText(
QString::number( this->currentFrameIndex + 1 ) );

// Notify PalView that the frame changed (used to refresh palette hits
emit frameChanged();
}

bool CelView::checkGroupNumber()
Expand Down
7 changes: 6 additions & 1 deletion source/celview.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ class CelView : public QWidget
explicit CelView( QWidget *parent = 0 );
~CelView();

void setCel( D1CelBase* );
void initialize( D1CelBase* );
D1CelBase* getCel();
QString getCelPath();
quint32 getCurrentFrameIndex();

void displayFrame();
bool checkGroupNumber();
void setGroupNumber();

signals:
void frameChanged();

private slots:
void on_firstFrameButton_clicked();
void on_previousFrameButton_clicked();
Expand Down
8 changes: 8 additions & 0 deletions source/d1celbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ quint32 D1CelBase::getFrameCount()
return this->frameCount;
}

D1CelFrameBase* D1CelBase::getFrame( quint16 frameIndex )
{
if( frameIndex < this->frameCount )
return this->frames[frameIndex];
else
return NULL;
}

quint16 D1CelBase::getFrameWidth( quint16 frameIndex )
{
if( frameIndex < this->frameCount )
Expand Down
1 change: 1 addition & 0 deletions source/d1celbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class D1CelBase : public QObject
quint16 getGroupCount();
QPair<quint16,quint16> getGroupFrameIndices( quint16 );
quint32 getFrameCount();
D1CelFrameBase* getFrame( quint16 );
quint16 getFrameWidth( quint16 );
quint16 getFrameHeight( quint16 );

Expand Down
1 change: 1 addition & 0 deletions source/d1files.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<qresource prefix="/">
<file>town.pal</file>
<file>null.trn</file>
<file>default.pal</file>
</qresource>
</RCC>
8 changes: 8 additions & 0 deletions source/d1min.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,11 @@ quint16 D1Min::getSubtileCount()
{
return this->subtileCount;
}

QList<quint16> D1Min::getCelFrameIndices( quint16 subTileIndex )
{
if( subTileIndex < this->subtileCount )
return this->celFrameIndices.at( subTileIndex );
else
return QList<quint16>();
}
1 change: 1 addition & 0 deletions source/d1min.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class D1Min : public QObject
quint16 getSubtileWidth();
quint16 getSubtileHeight();
quint16 getSubtileCount();
QList<quint16> getCelFrameIndices( quint16 );

private:
D1MIN_TYPE type;
Expand Down
8 changes: 8 additions & 0 deletions source/d1til.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,11 @@ quint16 D1Til::getTilePixelHeight()
return this->tilePixelHeight;
}

QList<quint16> D1Til::getSubtileIndices( quint16 tileIndex )
{
if( tileIndex < this->tileCount )
return this->subtileIndices.at( tileIndex );
else
return QList<quint16>();
}

1 change: 1 addition & 0 deletions source/d1til.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class D1Til : public QObject
quint16 getTileHeight();
quint16 getTilePixelWidth();
quint16 getTilePixelHeight();
QList<quint16> getSubtileIndices( quint16 );

private:
D1TIL_TYPE type;
Expand Down
Binary file added source/default.pal
Binary file not shown.
9 changes: 4 additions & 5 deletions source/exportdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>327</height>
<width>797</width>
<height>365</height>
</rect>
</property>
<property name="minimumSize">
Expand Down Expand Up @@ -538,13 +538,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
<height>16777215</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
Expand Down Expand Up @@ -602,6 +602,5 @@
<buttongroup name="outputFilesFormatButtonGroup"/>
<buttongroup name="spritesSettingsButtonGroup"/>
<buttongroup name="levelFramesButtonGroup"/>
<buttongroup name="framesGeneralSettingsButtonGroup"/>
</buttongroups>
</ui>
33 changes: 33 additions & 0 deletions source/levelcelview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,41 @@ void LevelCelView::initialize( D1CelBase* c, D1Min* m, D1Til* t )
QString::number( this->til->getTileCount() ) );
}

D1CelBase* LevelCelView::getCel()
{
return this->cel;
}

QString LevelCelView::getCelPath()
{
return this->cel->getFilePath();
}

D1Min* LevelCelView::getMin()
{
return this->min;
}

D1Til* LevelCelView::getTil()
{
return this->til;
}

quint32 LevelCelView::getCurrentFrameIndex()
{
return this->currentFrameIndex;
}

quint16 LevelCelView::getCurrentSubtileIndex()
{
return this->currentSubtileIndex;
}

quint16 LevelCelView::getCurrentTileIndex()
{
return this->currentTileIndex;
}

void LevelCelView::displayFrame()
{
quint16 minPosX = 0;
Expand Down Expand Up @@ -121,6 +151,9 @@ void LevelCelView::displayFrame()
// Set current tile text
this->ui->tileIndexEdit->setText(
QString::number( this->currentTileIndex + 1 ) );

// Notify PalView that the frame changed (used to refresh palette hits
emit frameChanged();
}

void LevelCelView::on_firstFrameButton_clicked()
Expand Down
10 changes: 10 additions & 0 deletions source/levelcelview.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,20 @@ class LevelCelView : public QWidget
~LevelCelView();

void initialize( D1CelBase*, D1Min*, D1Til* );
D1CelBase* getCel();
QString getCelPath();
D1Min* getMin();
D1Til* getTil();

quint32 getCurrentFrameIndex();
quint16 getCurrentSubtileIndex();
quint16 getCurrentTileIndex();

void displayFrame();

signals:
void frameChanged();

private slots:
void on_firstFrameButton_clicked();
void on_previousFrameButton_clicked();
Expand Down
Loading

0 comments on commit 90038a4

Please sign in to comment.