Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blendsplitter #117

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
41fb51f
Adding al the files from BlendSplitter project
turbor Apr 19, 2022
67fccf2
Move BlendSplitter icon
turbor Apr 19, 2022
975952a
Improved stackviewer
turbor Apr 19, 2022
fb5f050
First working version with blendsplitter
turbor Apr 19, 2022
2f41c0f
Splitting now works as in blender
turbor Apr 19, 2022
1a58a27
Place all dockingwidgets in comment
turbor Apr 20, 2022
b3011f0
Removed DockableWidget related code
turbor Apr 20, 2022
b76f243
Fixed some crashes and added cursor shapes
turbor Apr 21, 2022
699fa02
Added QScrollArea to SwitchingWidget
turbor Apr 22, 2022
928a1c7
Introduced a QuickGuide explaining the splitter
turbor Apr 26, 2022
565050a
Save and load workspaces layout
turbor Apr 27, 2022
53a5def
Moved getEnabledWidget to SignalDispatcher
turbor Apr 28, 2022
d27bcf8
improved QuickGuide text
turbor Apr 30, 2022
bd6b0f4
Now select your workspace when starting
turbor Apr 30, 2022
e17b826
Rename the tabs by double clicking them
turbor May 1, 2022
363555d
Improved tab renamer
turbor May 2, 2022
be9e648
Code cleanup
turbor May 3, 2022
bc0b493
debugmessages
turbor May 3, 2022
0782d3e
Add objectnames
turbor May 3, 2022
5338939
SignalDispatcher becomes responsible for VDPDataStore
turbor May 4, 2022
45e9800
Fixes mouseover bug in tileviewer
turbor May 4, 2022
301d36a
Trying to improve StackViewer
turbor May 4, 2022
cbb077e
Some debug texts
turbor May 4, 2022
3f33b04
replace 'override final' with just 'final'
m9710797 May 3, 2022
c63ba22
Fixup after cleanup BlendSplitter construction
m9710797 May 3, 2022
3d13e28
removed deletes since widget owns the layout
turbor May 4, 2022
9b80f5f
Improved saved layout preferences
turbor May 4, 2022
ff79f08
Added PaletteView
turbor May 10, 2022
249fb58
SlotLayout changes now handled by SignalDispatcher
turbor May 11, 2022
7e025bd
layout fixes
m9710797 May 12, 2022
749f07c
Cleanup singleton implementation of SignalDispatcher
m9710797 May 12, 2022
9b6873b
simplify SignalDispatcher construction/destruction
m9710797 May 12, 2022
4620811
Don't use copy-assignment-operator in MSXPalette
m9710797 May 12, 2022
b5a9d4a
Don't store redundant msxPalette[] in MSXPalette
m9710797 May 12, 2022
9201767
Json save and load of widget in SwitchingWidget.
turbor May 16, 2022
1ac0a87
Merge branch 'master' into blendsplitter
turbor May 17, 2022
54d9a07
More signal/slot connect rewrites
turbor May 18, 2022
40e2c93
Extra preferences for autoconnect to openMSX
turbor May 19, 2022
4f892e3
Fixed missing QMetaObject::connectSlotsByName
turbor May 19, 2022
de7df52
layout fixes
m9710797 May 18, 2022
65e53fa
Tweak loadFromJson
m9710797 May 18, 2022
1dd57bb
Tweak SavesJsonInterface
m9710797 May 18, 2022
5fda6b0
Do not use 'symTable' and 'symtable' as two distict symbols within th…
m9710797 May 18, 2022
8bf05ae
globally replace 'unsigned char' -> 'uint8_t'
m9710797 May 18, 2022
a339c42
Simplify DebuggerForm::widgetFactory()
m9710797 May 18, 2022
1720800
No need for DisasmViewer::update() (instead need qOverload)
m9710797 May 18, 2022
20e2913
Get rid of deprecated signal
turbor May 21, 2022
3c2e4fd
Follow-up on 2c3fd4cf5d and 205a992a2d
m9710797 May 21, 2022
d5005b0
Simplify usage of QOverload -> qOverload
m9710797 May 21, 2022
56db34c
Have the SpriteViewer use MSXPalette
turbor May 23, 2022
39a9d42
.gitignore adaptions for qtcreator
turbor May 23, 2022
157b303
Have the BitMapViewer use MSXPalette
turbor May 23, 2022
20a221a
Have the TileViewer use MSXPalette
turbor May 23, 2022
f903b40
Removed the old PaletteDialog
turbor May 23, 2022
4d59b42
Fix two text issues/typos.
MBilderbeek May 24, 2022
5db0ee1
PaletteView with better autosync indication
turbor Jun 1, 2022
39c7752
Improving HexViewer
turbor Jun 26, 2022
73b0a03
Merge remote-tracking branch 'origin/master' into blendsplitter
turbor Aug 17, 2022
ff9c79c
More HexViewer improvements
turbor Aug 17, 2022
dc31bc7
Merge branch 'master' into blendsplitter
turbor Nov 22, 2022
3592c72
Add minor tooltip
turbor Nov 23, 2022
f7c0640
VDPRegViewer autodetects VDP in openMSX
turbor Nov 23, 2022
594e192
Avoid superfluous signals
turbor Nov 23, 2022
be840e9
Fix small display error in sprite info
turbor Jan 31, 2023
335a8d8
improve .gitignore
turbor Jan 31, 2023
dfb292e
Fix TileViewer layout
turbor Feb 2, 2023
b3b765d
Merge branch 'master' into blendsplitter
turbor Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ build/*.pyc
derived/
build/msvc/.vs/*
.vscode/
.qtc_clangd/
__pycache__/
ui_*.h
moc_*.cpp
Expand All @@ -10,3 +11,10 @@ moc_predefs.h
qrc_resources.cpp
Makefile
.*.swp
*.orig
*.rej
*.pro
*.pro.user*
build-*
*.zip
*.rom
Binary file added resources/expander.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 resources/quickguide/areas_borders.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 resources/quickguide/areas_join.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 resources/quickguide/areas_resize.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 resources/quickguide/areas_split.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 resources/quickguide/switching_widget.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 resources/quickguide/workspaces_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions resources/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@
<file>icons/symfil.png</file>
<file>overlay.png</file>
</qresource>
<qresource prefix="/BlendSplitter">
<file alias="Expander">expander.png</file>
</qresource>
<qresource prefix="/quickguide">
<file alias="borders.png">quickguide/areas_borders.png</file>
<file alias="join.png">quickguide/areas_join.png</file>
<file alias="resize.png">quickguide/areas_resize.png</file>
<file alias="split.png">quickguide/areas_split.png</file>
<file alias="workspaces.png">quickguide/workspaces_tab.png</file>
<file alias="switching.png">quickguide/switching_widget.png</file>
</qresource>
</RCC>
108 changes: 33 additions & 75 deletions src/BitMapViewer.cpp
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
#include "BitMapViewer.h"
#include "PaletteDialog.h"
#include "VramBitMappedView.h"
#include "VDPDataStore.h"
#include "Convert.h"
#include <QMessageBox>


// static to feed to PaletteDialog and be used when VDP colors aren't selected
static uint8_t currentPalette[32] = {
// RB G
0x00, 0,
0x00, 0,
0x11, 6,
0x33, 7,
0x17, 1,
0x27, 3,
0x51, 1,
0x27, 6,
0x71, 1,
0x73, 3,
0x61, 6,
0x64, 6,
0x11, 4,
0x65, 2,
0x55, 5,
0x77, 7,
};

BitMapViewer::BitMapViewer(QWidget* parent)
: QDialog(parent)
, pageSize(0) // avoid UMR
Expand All @@ -39,19 +16,18 @@ BitMapViewer::BitMapViewer(QWidget* parent)
connect(linesVisible, qOverload<int>(&QComboBox:: currentIndexChanged), this, &BitMapViewer::on_linesVisible_currentIndexChanged);
connect(bgColor, qOverload<int>(&QSpinBox::valueChanged), this, &BitMapViewer::on_bgColor_valueChanged);

connect(useVDPRegisters, &QCheckBox::stateChanged,this, &BitMapViewer::on_useVDPRegisters_stateChanged);
connect(useVDPRegisters, &QCheckBox::stateChanged,this, &BitMapViewer::on_useVDPRegisters_stateChanged);

connect(saveImageButton, &QPushButton::clicked, this, &BitMapViewer::on_saveImageButton_clicked);
connect(editPaletteButton, &QPushButton::clicked, this, &BitMapViewer::on_editPaletteButton_clicked);
connect(useVDPPalette, &QCheckBox::stateChanged, this, &BitMapViewer::on_useVDPPalette_stateChanged);
connect(zoomLevel, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &BitMapViewer::on_zoomLevel_valueChanged);
connect(saveImageButton, &QPushButton::clicked, this, &BitMapViewer::on_saveImageButton_clicked);
connect(useVDPPalette, &QCheckBox::stateChanged, this, &BitMapViewer::on_useVDPPalette_stateChanged);
connect(zoomLevel, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &BitMapViewer::on_zoomLevel_valueChanged);

// hand code entering the actual display widget in the scrollarea With
// the designer-qt4 there is an extra scrollAreaWidget between the
// imageWidget and the QScrollArea so the scrollbars are not correctly
// handled when the image is resized. (since the intermediate widget
// stays the same size). I did not try to have this intermediate widget
// resize and all, since it was superflous anyway.
// resize and all, since it was superfluous anyway.
imageWidget = new VramBitMappedView();
QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
Expand All @@ -64,14 +40,12 @@ BitMapViewer::BitMapViewer(QWidget* parent)

useVDP = useVDPRegisters->isChecked();

const unsigned char* vram = VDPDataStore::instance().getVramPointer();
const uint8_t* vram = VDPDataStore::instance().getVramPointer();
imageWidget->setVramSource(vram);
imageWidget->setVramAddress(0);
// Palette data not received from VDPDataStore yet causing black image, so
// we start by using fixed palette until VDPDataStoreDataRefreshed kicks in.
imageWidget->setPaletteSource(currentPalette);

// now hook up some signals and slots
imageWidget->setPaletteSource(VDPDataStore::instance().getPalette(paletteVDP));

//now hook up some signals and slots
connect(&VDPDataStore::instance(), &VDPDataStore::dataRefreshed,
this, &BitMapViewer::VDPDataStoreDataRefreshed);
connect(&VDPDataStore::instance(), &VDPDataStore::dataRefreshed,
Expand All @@ -96,43 +70,43 @@ void BitMapViewer::updateDisplayAsFrame()

void BitMapViewer::decodeVDPregs()
{
const unsigned char* regs = VDPDataStore::instance().getRegsPointer();
const uint8_t* regs = VDPDataStore::instance().getRegsPointer();

// Get the number of lines
int v1 = (regs[9] & 128) ? 212 : 192;
printf("\nlines acording to the bits %i,: %i\n", (regs[9] & 128), v1);
printf("\nlines according to the bits %i,: %i\n", (regs[9] & 128), v1);
linesLabel->setText(QString("%1").arg(v1, 0, 10));
if (useVDP) linesVisible->setCurrentIndex((regs[9] & 128) ? 1 : 0);

// Get the border color
int v2 = regs[7] & 15;
printf("\nborder acording to the regs %i,: %i\n", regs[7], v2);
printf("\nborder according to the regs %i,: %i\n", regs[7], v2);
if (regs[8] & 32) v2 = 0;
printf("\ncolor 0 is pallet regs %i,: %i\n", (regs[8] & 32), v2);
borderLabel->setText(QString("%1").arg(v2, 0, 10));
if (useVDP) bgColor->setValue(v2);

// Get current screenmode
static const int bits_modetxt[128] = {
1, 3, 0, 255, 2, 255, 255, 255,
4, 255, 80, 255, 5, 255, 255, 255,
6, 255, 255, 255, 7, 255, 255, 255,
255, 255, 255, 255, 8, 255, 255, 255,

255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255, 12, 255, 255, 255,

255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,

255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255,255, 255, 255, 255,
255, 255, 255, 255, 11, 255, 255, 255,
1, 3, 0, 255, 2, 255, 255, 255,
4, 255, 80, 255, 5, 255, 255, 255,
6, 255, 255, 255, 7, 255, 255, 255,
255, 255, 255, 255, 8, 255, 255, 255,

255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 12, 255, 255, 255,

255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,

255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 11, 255, 255, 255,
};
static const int bits_mode[128] = {
0, 0, 0, 0, 0, 0, 0, 0,
Expand Down Expand Up @@ -163,9 +137,6 @@ void BitMapViewer::decodeVDPregs()
screenMode->setCurrentIndex(bits_mode[v3]);
updateDisplayAsFrame();
}
if (useVDPPalette) {
imageWidget->setPaletteSource(VDPDataStore::instance().getPalettePointer());
}

// Get the current visible page
unsigned p = (regs[2] >> 5) & 3;
Expand Down Expand Up @@ -270,27 +241,14 @@ void BitMapViewer::on_saveImageButton_clicked(bool /*checked*/)
"Sorry, the save image dialog is not yet implemented");
}

void BitMapViewer::on_editPaletteButton_clicked(bool /*checked*/)
{
auto* p = new PaletteDialog();
p->setPalette(currentPalette);
p->setAutoSync(true);
connect(p, &PaletteDialog::paletteSynced, imageWidget, &VramBitMappedView::refresh);
p->show();
}

void BitMapViewer::on_useVDPPalette_stateChanged(int state)
{
const uint8_t* palette = VDPDataStore::instance().getPalettePointer();
if (state) {
imageWidget->setPaletteSource(palette);
imageWidget->setPaletteSource(VDPDataStore::instance().getPalette(paletteVDP));
} else {
// Copy palette from VDP to allow changes.
if (palette) memcpy(currentPalette, palette, 32);
imageWidget->setPaletteSource(currentPalette);
imageWidget->setPaletteSource(VDPDataStore::instance().getPalette(paletteBitmap));
}
imageWidget->refresh();
editPaletteButton->setEnabled(!state);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/BitMapViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QDialog>

class VramBitMappedView;
class MSXPalette;

class BitMapViewer : public QDialog, private Ui::BitMapViewer
{
Expand All @@ -26,7 +27,6 @@ class BitMapViewer : public QDialog, private Ui::BitMapViewer
void on_useVDPRegisters_stateChanged(int state);

void on_saveImageButton_clicked(bool checked);
void on_editPaletteButton_clicked(bool checked);
void on_useVDPPalette_stateChanged(int state);
void on_zoomLevel_valueChanged(double d);

Expand Down
Loading