Originally by Ray Chason for 3.4.3, based on the Qt windowport by Warwick Allison. The look and feel is mostly the same. Some improvements over the Qt 3 interface are: * Panes are resizable * Full support for IBMgraphics, and walls and corridors are drawn with graphical primitives for a continuous appearance no matter what the font says * Lots of irritating glitches fixed * Menus support proportional fonts correctly Adding this because the old Qt windowport cannot be compiled on Qt4, even with Qt3 compatibility stuff. TODO: - background map glyphs - status hilites - menucolors
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt4click.cpp -- a mouse click buffer
|
|
|
|
#include "hack.h"
|
|
#undef Invisible
|
|
#undef Warning
|
|
#undef index
|
|
#undef msleep
|
|
#undef rindex
|
|
#undef wizard
|
|
#undef yn
|
|
#undef min
|
|
#undef max
|
|
|
|
#include <QtGui/QtGui>
|
|
#include "qt4click.h"
|
|
|
|
namespace nethack_qt4 {
|
|
|
|
NetHackQtClickBuffer::NetHackQtClickBuffer() :
|
|
in(0), out(0)
|
|
{
|
|
}
|
|
|
|
bool NetHackQtClickBuffer::Empty() const { return in==out; }
|
|
bool NetHackQtClickBuffer::Full() const { return (in+1)%maxclick==out; }
|
|
|
|
void NetHackQtClickBuffer::Put(int x, int y, int mod)
|
|
{
|
|
click[in].x=x;
|
|
click[in].y=y;
|
|
click[in].mod=mod;
|
|
in=(in+1)%maxclick;
|
|
}
|
|
|
|
int NetHackQtClickBuffer::NextX() const { return click[out].x; }
|
|
int NetHackQtClickBuffer::NextY() const { return click[out].y; }
|
|
int NetHackQtClickBuffer::NextMod() const { return click[out].mod; }
|
|
|
|
void NetHackQtClickBuffer::Get()
|
|
{
|
|
out=(out+1)%maxclick;
|
|
}
|
|
|
|
} // namespace nethack_qt4
|