050476bae9
When method_ is not set, assume it means the default dither algorithm, set it to NULL in disable(). This can also avoid possible segfaults. Bump revision.
25 lines
850 B
Text
25 lines
850 B
Text
$NetBSD: patch-au,v 1.2 2006/02/27 15:49:56 joerg Exp $
|
|
|
|
--- color-gray.cc.orig 1995-11-14 05:46:10.000000000 +0000
|
|
+++ color-gray.cc
|
|
@@ -75,14 +75,17 @@ typedef void (GrayWindowRenderer::*GrayM
|
|
class GrayWindowRenderer : public PseudoWindowRenderer {
|
|
public:
|
|
GrayWindowRenderer(VideoWindow* vw, int decimation,
|
|
- const u_short* graylut) :
|
|
+ const u_short* graylut) : method_(NULL),
|
|
PseudoWindowRenderer(vw, decimation, graylut) { }
|
|
void render(const u_char* frm, int off, int x, int w, int h) {
|
|
- (this->*method_)(frm, off, x, w, h);
|
|
+ if (this->method_)
|
|
+ (this->*method_)(frm, off, x, w, h);
|
|
+ else
|
|
+ dither_null(frm, off, x, w, h);
|
|
}
|
|
protected:
|
|
virtual void update();
|
|
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
|
|
+ virtual void disable() { method_ = NULL; }
|
|
GrayMethod method_;
|
|
};
|
|
|