Commit graph

93 commits

Author SHA1 Message Date
King_DuckZ
1224886848
Trying to fix the build, still broken 2025-02-25 00:21:37 +00:00
King_DuckZ
bc12725ff2
Random stuff to revert later 2025-02-24 19:00:20 +00:00
King_DuckZ
6b835cd1d9 Drag and drop work in progress implementation 2025-02-24 18:58:15 +00:00
King_DuckZ
7af7ce540d Remove index property, store it packed in the pointer instead
To achieve this I force memory to a 16-bytes alignment, to
achieve this code will allocate 15 extra bytes on the heap
but each Block and Frame object will be 8 bytes smaller. Given
they are created on the fly and passed around a lot, I think
this is a good tradeoff. Not super urgent, but I got it done
now, mostly to make sure index is used in a sane way and doesn't
take too large values, which would prevent me from making this
change later in the future.
2025-02-24 18:56:39 +00:00
King_DuckZ
773eaf3f81 Work in progress to make any_forward_iterator work with my code
MemoryCard returns Block objects that are constructed on the
fly, any_iterator needs to have a parameter that makes it
use my non-ref type as its internal reference return type.
This is still missing the pointer version of this change.
Currently broken, it won't compile.
2025-02-24 18:49:30 +00:00
King_DuckZ
2ae665205a Import Alipha's any_iterator
https://github.com/alipha/cpp/blob/master/any_iterator/any_iterator.hpp

Will be used for experimental code, I don't know yet
if this will be kept around or not
2025-02-24 18:47:06 +00:00
King_DuckZ
829ad425aa Rename BlocDb to SavegameDb 2025-02-15 17:26:34 +00:00
King_DuckZ
8c83c32b3d Add an unlimited grid at the bottom of the window
This change's been unstaged since 2020 I think, it was
probably just to test the idea of having a bottom grid
acting as the general "database". It's working though it
needs changing, I'm committing it and will modify it
as needed in the future
2025-02-15 11:24:13 +00:00
King_DuckZ
acf84afa4e Change filter and other stuff in the open file selector 2025-02-15 11:24:13 +00:00
King_DuckZ
0b94626549 Store individual multiblock saves into a separate in-mem db by value 2025-02-15 11:24:13 +00:00
King_DuckZ
b0cc4426bd Indentation change 2025-02-15 11:24:13 +00:00
King_DuckZ
8042481764 Update copyright notice to 2025 2025-02-15 11:24:13 +00:00
King_DuckZ
b427f9e094 Drag&drop, working towards making it accept drop events
Still work in progress
2025-02-15 11:24:13 +00:00
King_DuckZ
f933d66e55 Refactor memory card loading into a new function 2025-02-15 11:24:13 +00:00
King_DuckZ
d35a4f6d08 Refactor d&d code out into a separate class 2025-02-14 11:24:59 +00:00
King_DuckZ
ed1a70b8ce Fix build warning
operator+ is deprecated
2025-02-14 09:50:43 +00:00
King_DuckZ
49a56bac6f Update copyright to 2025 2025-02-14 09:50:20 +00:00
King_DuckZ
f2ddf230dc Reorder methods to match declaration order 2025-02-14 01:16:53 +00:00
King_DuckZ
0822ef20ab Enable block drag (it doesn't do anything yet) 2025-02-14 01:16:12 +00:00
King_DuckZ
2a7340b6aa Bump qt dependency to qt6
Note that this requires meson 0.63+ because: "before
version 0.63.0 Meson would fail to find Qt 6.1 or later".

Update is to fix a KDE error I was getting when opening
the file selector dialog:
> kf.service.services: KServiceTypeTrader: serviceType
> "ThumbCreator" not found
2025-02-13 23:31:28 +00:00
King_DuckZ
23f5225cc0 Build fix 2025-02-05 00:37:00 +00:00
2c452093f5 Disable unit test building in vectorwrapper. 2020-03-28 23:18:29 +01:00
0d287a60f1 Draw blank squares for empty blocks in the grid.
Import vectorwrapper, it's just too convenient. It's only used
in one place for now but I will probably use it more from now on.
2020-03-28 21:33:46 +01:00
88be1a1247 Add a timer to get the animations going. 2020-03-28 18:53:04 +01:00
78e72d0bcb Icons don't need to be in a dedicated widget, just painting is enough.
Now BlockGrid holds the animations and does the drawing by
itself.
2020-03-28 18:38:42 +01:00
4527caff52 Catch up with the nana implementation.
Allow users to open and display memory card files
2020-03-28 16:14:26 +01:00
42a00b7caa Rename gui directory to nana 2020-03-26 11:56:17 +01:00
92e4f52eb4 Implement about this program window based on nana's implementation. 2020-03-26 11:49:54 +01:00
520b9fc2e1 Add gpl header 2020-03-26 11:49:19 +01:00
bb0397cc2d Add Exit to file menu 2020-03-25 22:38:17 +01:00
35d566fd2d Barebone main window implementation. 2020-03-25 22:15:57 +01:00
5450c42bce Disabling nana gui for now.
It's not working as I'd like it to work and nana seems to be
lacking several features I need to do what I have in mind.
Will try Qt next.
2020-03-25 19:25:30 +01:00
8a577d5c39 Trying to group label and grid into a new widget but it's not working. 2020-03-25 19:24:00 +01:00
1805135d3c Print block usage 2020-03-21 23:36:32 +01:00
5688775e6c Finish implementation of block_group().
This forced me to think about treating block 0 specially. The
problem was with block.index() returning [1-15], while the valid
range for MemoryCard::operator[] is [0-14]. This discrepancy was
very confusing. A simple solution would've been to just rename
Block::index() to eg Block::id(), and then know that one has to
do -1 on the id to obtain the index. I tried but discarded this
option. I don't think it's intuitive either (what's id? is it
guaranteed to be index+1? is it a random number, rather? I
know I will forget in 6 months).

Treating block 0 normally would, on the other hand, break range
iteration, as the first iteration would always be on the TOC
block, and all for loops would become 1-based. Also implementing
size() correctly becomes tricky (size could never be 0?)
I don't like the current implementation either but I did
it anyways for now, so operator[] works as before, you can get
block 0 by calling toc_block(), and Block::index() returns some
silly value for block 0. This should work in the future too
when there will be the possibility to forge a new block from
scratch. You don't really want to forge a block 0 as that's
calculated from adding the normal savegame blocks, and for the
latter MemoryCard can just do the +1 internally when receiving
a new Block. Besides Block::link_order() seems to like indices
this way, with 0 being the first savegame and not the TOC. So
it seems to be special in the original PSX API, then let's
treat it specially.
2020-03-21 23:35:43 +01:00
2352bfddc1 Fix size(), now linked blocks also count toward the total count. 2020-03-21 23:20:05 +01:00
bf6814df20 Show the correct number of blocks for multiblock savegames 2020-03-21 21:12:26 +01:00
a98539aa06 Implement use_byte() as per the spec. 2020-03-21 21:05:23 +01:00
54371b62f8 Remove hardcoded paths, allow opening memory cards from menu.
I think sometimes nana deadlocks, not sure what the problem is yet.
2020-03-21 16:53:02 +01:00
2b48b5da41 Don't freak out on empty grids. 2020-03-21 16:49:47 +01:00
05b34b4818 Support non-const to const conversions. 2020-03-21 16:49:34 +01:00
2be3823442 App namespace should be duck, not mc. That's for the lib. 2020-03-21 16:48:49 +01:00
9aa2ceeb90 Looking at the examples the menubar should also be put in the div. 2020-03-21 12:10:12 +01:00
2b8395de69 Improve git sha1 detection 2020-03-21 11:53:04 +01:00
831b958f39 Make the sha1 text a link to the corresponding page 2020-03-21 11:34:49 +01:00
6dfeeba7f9 Add git sha1 info to the binary. 2020-03-21 11:29:21 +01:00
23010d032b Show repo url in cli too. 2020-03-21 10:32:28 +01:00
a0581cb7ab Refactor a bit more and add menu bar and version window. 2020-03-21 10:32:18 +01:00
bcbefd45c9 Inherit from nana::form 2020-03-20 21:27:41 +01:00
1c3de27a16 Refactor window creation stuff outside of main() 2020-03-20 21:24:17 +01:00