initial port for Cevo game in C++ (libs)

This commit is contained in:
Geoffray Levasseur committed 2026-10-22 17:20:45 +02:00
commit 8436242032
375 files changed
+46282

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#include "Cevo/CevoButtonB.h"
#include "Cevo/CevoScreenTools.h"
namespace Cevo {
ButtonB::ButtonB(QWidget *parent) : ButtonBase(parent), m_buffer(25, 25)
{
resize(25, 25);
}
void ButtonB::paint(Dpi::Canvas &canvas)
{
if (m_graphic) {
unshareBitmap(m_buffer);
bitBltBitmap(m_buffer, 0, 0, width(), height(), *m_graphic, 169, 243 + 26 * (down() ? 1 : 0));
if (m_index >= 0 && m_mask) {
bitBltBitmap(m_buffer, 0, 0, width(), height(), *m_mask,
1 + m_index % 12 * 26, 337 + m_index / 12 * 26, RasterOp::And);
bitBltBitmap(m_buffer, 0, 0, width(), height(), *m_graphic,
1 + m_index % 12 * 26, 337 + m_index / 12 * 26, RasterOp::Paint);
}
canvas.draw(0, 0, m_buffer.image());
} else {
canvas.brush().setColor(colorFromDelphi(0x0000FF));
canvas.frameRect(QRect(0, 0, width(), height()));
}
}
void ButtonB::setButtonIndex(int value)
{
if (value != m_index) {
m_index = value;
update();
}
}
} // namespace Cevo