TINYGL: Added not equality operator for GLVertex and DrawCall.

This commit is contained in:
Stefano Musumeci 2014-08-09 12:34:26 +02:00
parent 35a36f7c09
commit c27be840ea
3 changed files with 9 additions and 5 deletions

View File

@ -219,9 +219,6 @@ void tglPresentBuffer() {
namespace Graphics {
DrawCall::DrawCall(DrawCallType type) : _type(type) {
}
bool DrawCall::operator==(const DrawCall &other) const {
if (_type == other._type) {
switch (_type) {

View File

@ -48,9 +48,12 @@ enum DrawCallType {
class DrawCall {
public:
DrawCall(DrawCallType type);
DrawCall(DrawCallType type) : _type(type) { }
virtual ~DrawCall() { }
bool operator==(const DrawCall &other) const;
bool operator!=(const DrawCall &other) const {
return !(*this == other);
}
virtual void execute(bool restoreState) const = 0;
virtual void execute(const Common::Rect &clippingRectangle, bool restoreState) const = 0;
DrawCallType getType() const { return _type; }

View File

@ -125,7 +125,7 @@ struct GLVertex {
int clip_code; // clip code
ZBufferPoint zp; // integer coordinates for the rasterization
bool operator==(const GLVertex &other) {
bool operator==(const GLVertex &other) const {
return edge_flag == other.edge_flag &&
normal == other.normal &&
coord == other.coord &&
@ -136,6 +136,10 @@ struct GLVertex {
clip_code == other.clip_code &&
zp == other.zp;
}
bool operator!=(const GLVertex &other) const {
return !(*this == other);
}
};
struct GLImage {