[Scummvm-git-logs] scummvm master -> b673e0adf57d1f3358f617a4f9a14e641428f7f8

aquadran noreply at scummvm.org
Wed Dec 15 22:55:42 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b673e0adf5 TINYGL: Janitorial


Commit: b673e0adf57d1f3358f617a4f9a14e641428f7f8
    https://github.com/scummvm/scummvm/commit/b673e0adf57d1f3358f617a4f9a14e641428f7f8
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-15T23:55:36+01:00

Commit Message:
TINYGL: Janitorial

Changed paths:
    graphics/tinygl/api.cpp
    graphics/tinygl/clear.cpp
    graphics/tinygl/image_util.cpp
    graphics/tinygl/list.cpp
    graphics/tinygl/select.cpp
    graphics/tinygl/texelbuffer.cpp
    graphics/tinygl/texelbuffer.h
    graphics/tinygl/texture.cpp
    graphics/tinygl/zblit.cpp
    graphics/tinygl/zblit.h
    graphics/tinygl/zblit_public.h
    graphics/tinygl/zbuffer.cpp
    graphics/tinygl/zbuffer.h
    graphics/tinygl/zgl.h
    graphics/tinygl/zline.cpp
    graphics/tinygl/ztriangle.cpp


diff --git a/graphics/tinygl/api.cpp b/graphics/tinygl/api.cpp
index 07a4c39d3e..11e06d65e2 100644
--- a/graphics/tinygl/api.cpp
+++ b/graphics/tinygl/api.cpp
@@ -698,7 +698,7 @@ void tglInitNames() {
 	c->gl_add_op(p);
 }
 
-void tglPushName(unsigned int name) {
+void tglPushName(uint name) {
 	TinyGL::GLContext *c = TinyGL::gl_get_context();
 	TinyGL::GLParam p[2];
 
@@ -717,7 +717,7 @@ void tglPopName() {
 	c->gl_add_op(p);
 }
 
-void tglLoadName(unsigned int name) {
+void tglLoadName(uint name) {
 	TinyGL::GLContext *c = TinyGL::gl_get_context();
 	TinyGL::GLParam p[2];
 
@@ -740,7 +740,7 @@ void tglPolygonOffset(TGLfloat factor, TGLfloat units) {
 
 // Special Functions
 
-void tglCallList(unsigned int list) {
+void tglCallList(uint list) {
 	TinyGL::GLContext *c = TinyGL::gl_get_context();
 	TinyGL::GLParam p[2];
 
diff --git a/graphics/tinygl/clear.cpp b/graphics/tinygl/clear.cpp
index 7751d8992a..865524bf96 100644
--- a/graphics/tinygl/clear.cpp
+++ b/graphics/tinygl/clear.cpp
@@ -52,8 +52,8 @@ void GLContext::glopClear(GLParam *p) {
 	int s = (int)(clear_stencil);
 
 	issueDrawCall(new ClearBufferDrawCall(mask & TGL_DEPTH_BUFFER_BIT, z,
-										  mask & TGL_COLOR_BUFFER_BIT, r, g, b,
-										  mask & TGL_STENCIL_BUFFER_BIT, s));
+	                                      mask & TGL_COLOR_BUFFER_BIT, r, g, b,
+	                                      mask & TGL_STENCIL_BUFFER_BIT, s));
 }
 
 } // end of namespace TinyGL
diff --git a/graphics/tinygl/image_util.cpp b/graphics/tinygl/image_util.cpp
index 546b5ca19c..b79b90666a 100644
--- a/graphics/tinygl/image_util.cpp
+++ b/graphics/tinygl/image_util.cpp
@@ -42,7 +42,7 @@ static inline int interpolate(int v00, int v01, int v10, int xf, int yf) {
 // TODO: more accurate resampling
 
 void GLContext::gl_resizeImage(Graphics::PixelBuffer &dest, int xsize_dest, int ysize_dest,
-		    const Graphics::PixelBuffer &src, int xsize_src, int ysize_src) {
+	                       const Graphics::PixelBuffer &src, int xsize_src, int ysize_src) {
 	int point1_offset, point2_offset, point3_offset, dest_offset = 0;
 	int point_y_offset, point_offset;
 	float x1, y1, x1inc, y1inc;
@@ -111,7 +111,7 @@ void GLContext::gl_resizeImage(Graphics::PixelBuffer &dest, int xsize_dest, int
 
 // resizing with no interlating nor nearest pixel
 void GLContext::gl_resizeImageNoInterpolate(Graphics::PixelBuffer &dest, int xsize_dest, int ysize_dest,
-				 const Graphics::PixelBuffer &src, int xsize_src, int ysize_src) {
+	                                    const Graphics::PixelBuffer &src, int xsize_src, int ysize_src) {
 	int dest_offset = 0;
 	int x1, y1, x1inc, y1inc;
 	int yi;
diff --git a/graphics/tinygl/list.cpp b/graphics/tinygl/list.cpp
index 4f4b27ff71..039275115e 100644
--- a/graphics/tinygl/list.cpp
+++ b/graphics/tinygl/list.cpp
@@ -58,7 +58,7 @@ GLContext *gl_get_context() {
 	return gl_ctx;
 }
 
-static GLList *find_list(GLContext *c, unsigned int list) {
+static GLList *find_list(GLContext *c, uint list) {
 	return c->shared_state.lists[list];
 }
 
@@ -206,7 +206,7 @@ void GLContext::glopCallList(GLParam *p) {
 	}
 }
 
-void tglNewList(unsigned int list, int mode) {
+void tglNewList(uint list, int mode) {
 	GLList *l;
 	GLContext *c = gl_get_context();
 
@@ -239,7 +239,7 @@ void tglEndList() {
 	c->exec_flag = 1;
 }
 
-int tglIsList(unsigned int list) {
+int tglIsList(uint list) {
 	GLContext *c = gl_get_context();
 	GLList *l = find_list(c, list);
 
diff --git a/graphics/tinygl/select.cpp b/graphics/tinygl/select.cpp
index cd27b0cca6..4041f1b8f1 100644
--- a/graphics/tinygl/select.cpp
+++ b/graphics/tinygl/select.cpp
@@ -68,7 +68,7 @@ int tglRenderMode(int mode) {
 	return result;
 }
 
-void tglSelectBuffer(int size, unsigned int *buf) {
+void tglSelectBuffer(int size, uint *buf) {
 	GLContext *c = gl_get_context();
 
 	assert(c->render_mode != TGL_SELECT);
@@ -108,8 +108,8 @@ void GLContext::glopLoadName(GLParam *p) {
 	}
 }
 
-void GLContext::gl_add_select(unsigned int zmin, unsigned int zmax) {
-	unsigned int *ptr;
+void GLContext::gl_add_select(uint zmin, uint zmax) {
+	uint *ptr;
 	int n;
 
 	if (!select_overflow) {
diff --git a/graphics/tinygl/texelbuffer.cpp b/graphics/tinygl/texelbuffer.cpp
index d14bcf9fe0..788af8a680 100644
--- a/graphics/tinygl/texelbuffer.cpp
+++ b/graphics/tinygl/texelbuffer.cpp
@@ -25,12 +25,12 @@
 #include "graphics/tinygl/zbuffer.h"
 #include "graphics/tinygl/texelbuffer.h"
 
-namespace Graphics {
+namespace TinyGL {
 
 #define ZB_POINT_ST_UNIT (1 << ZB_POINT_ST_FRAC_BITS)
 #define ZB_POINT_ST_FRAC_MASK (ZB_POINT_ST_UNIT - 1)
 
-TexelBuffer::TexelBuffer(unsigned int width, unsigned int height, unsigned int textureSize) {
+TexelBuffer::TexelBuffer(uint width, uint height, uint textureSize) {
 	assert(width);
 	assert(height);
 	assert(textureSize);
@@ -43,7 +43,7 @@ TexelBuffer::TexelBuffer(unsigned int width, unsigned int height, unsigned int t
 	_heightRatio = (float) height / textureSize;
 }
 
-static inline unsigned int wrap(unsigned int wrap_mode, int coord, unsigned int _fracTextureUnit, unsigned int _fracTextureMask) {
+static inline uint wrap(uint wrap_mode, int coord, uint _fracTextureUnit, uint _fracTextureMask) {
 	switch (wrap_mode) {
 	case TGL_MIRRORED_REPEAT:
 		if (coord & _fracTextureUnit)
@@ -52,7 +52,7 @@ static inline unsigned int wrap(unsigned int wrap_mode, int coord, unsigned int
 	case TGL_CLAMP_TO_EDGE:
 		if (coord < 0)
 			return 0;
-		if ((unsigned int) coord > _fracTextureMask)
+		if ((uint) coord > _fracTextureMask)
 			return _fracTextureMask;
 		return coord;
 	default:
@@ -63,11 +63,11 @@ static inline unsigned int wrap(unsigned int wrap_mode, int coord, unsigned int
 }
 
 void TexelBuffer::getARGBAt(
-	unsigned int wrap_s, unsigned int wrap_t,
+	uint wrap_s, uint wrap_t,
 	int s, int t,
 	uint8 &a, uint8 &r, uint8 &g, uint8 &b
 ) const {
-	unsigned int x, y;
+	uint x, y;
 	x = wrap(wrap_s, s, _fracTextureUnit, _fracTextureMask) * _widthRatio;
 	y = wrap(wrap_t, t, _fracTextureUnit, _fracTextureMask) * _heightRatio;
 	getARGBAt(
@@ -78,9 +78,9 @@ void TexelBuffer::getARGBAt(
 }
 
 // Nearest: store texture in original size.
-NearestTexelBuffer::NearestTexelBuffer(const PixelBuffer &buf, unsigned int width, unsigned int height, unsigned int textureSize) : TexelBuffer(width, height, textureSize) {
-	unsigned int pixel_count = _width * _height;
-	_buf = PixelBuffer(buf.getFormat(), pixel_count, DisposeAfterUse::NO);
+NearestTexelBuffer::NearestTexelBuffer(const Graphics::PixelBuffer &buf, uint width, uint height, uint textureSize) : TexelBuffer(width, height, textureSize) {
+	uint pixel_count = _width * _height;
+	_buf = Graphics::PixelBuffer(buf.getFormat(), pixel_count, DisposeAfterUse::NO);
 	_buf.copyBuffer(0, pixel_count, buf);
 }
 
@@ -89,8 +89,8 @@ NearestTexelBuffer::~NearestTexelBuffer() {
 }
 
 void NearestTexelBuffer::getARGBAt(
-	unsigned int pixel,
-	unsigned int, unsigned int,
+	uint pixel,
+	uint, uint,
 	uint8 &a, uint8 &r, uint8 &g, uint8 &b
 ) const {
 	_buf.getARGBAt(pixel, a, r, g, b);
@@ -112,14 +112,14 @@ void NearestTexelBuffer::getARGBAt(
 #define P11_OFFSET 3
 #define PIXEL_PER_TEXEL_SHIFT 2
 
-BilinearTexelBuffer::BilinearTexelBuffer(const PixelBuffer &buf, unsigned int width, unsigned int height, unsigned int textureSize) : TexelBuffer(width, height, textureSize) {
-	unsigned int pixel00_offset = 0, pixel11_offset, pixel01_offset, pixel10_offset;
+BilinearTexelBuffer::BilinearTexelBuffer(const Graphics::PixelBuffer &buf, uint width, uint height, uint textureSize) : TexelBuffer(width, height, textureSize) {
+	uint pixel00_offset = 0, pixel11_offset, pixel01_offset, pixel10_offset;
 	uint8 *texel8;
 	uint32 *texel32;
 
 	texel32 = _texels = new uint32[_width * _height << PIXEL_PER_TEXEL_SHIFT];
-	for (unsigned int y = 0; y < _height; y++) {
-		for (unsigned int x = 0; x < _width; x++) {
+	for (uint y = 0; y < _height; y++) {
+		for (uint x = 0; x < _width; x++) {
 			texel8 = (uint8 *)texel32;
 			pixel11_offset = pixel00_offset + _width + 1;
 			buf.getARGBAt(
@@ -175,11 +175,11 @@ static inline int interpolate(int v00, int v01, int v10, int xf, int yf) {
 }
 
 void BilinearTexelBuffer::getARGBAt(
-	unsigned int pixel,
-	unsigned int ds, unsigned int dt,
+	uint pixel,
+	uint ds, uint dt,
 	uint8 &a, uint8 &r, uint8 &g, uint8 &b
 ) const {
-	unsigned int p00_offset, p01_offset, p10_offset;
+	uint p00_offset, p01_offset, p10_offset;
 	uint8 *texel = (uint8 *)(_texels + (pixel << PIXEL_PER_TEXEL_SHIFT));
 	if ((ds + dt) > ZB_POINT_ST_UNIT) {
 		p00_offset = P11_OFFSET;
@@ -222,4 +222,4 @@ void BilinearTexelBuffer::getARGBAt(
 	);
 }
 
-}
+} // end of namespace TinyGL
diff --git a/graphics/tinygl/texelbuffer.h b/graphics/tinygl/texelbuffer.h
index 6af586a92c..98299ed0a2 100644
--- a/graphics/tinygl/texelbuffer.h
+++ b/graphics/tinygl/texelbuffer.h
@@ -25,54 +25,54 @@
 
 #include "graphics/tinygl/pixelbuffer.h"
 
-namespace Graphics {
+namespace TinyGL {
 
 class TexelBuffer {
 public:
-	TexelBuffer(unsigned int width, unsigned int height, unsigned int textureSize);
+	TexelBuffer(uint width, uint height, uint textureSize);
 	virtual ~TexelBuffer() {};
 
 	void getARGBAt(
-		unsigned int wrap_s, unsigned int wrap_t,
+		uint wrap_s, uint wrap_t,
 		int s, int t,
 		uint8 &a, uint8 &r, uint8 &g, uint8 &b
 	) const;
 
 protected:
 	virtual void getARGBAt(
-		unsigned int pixel,
-		unsigned int ds, unsigned int dt,
+		uint pixel,
+		uint ds, uint dt,
 		uint8 &a, uint8 &r, uint8 &g, uint8 &b
 	) const = 0;
-	unsigned int _width, _height, _fracTextureUnit, _fracTextureMask;
+	uint _width, _height, _fracTextureUnit, _fracTextureMask;
 	float _widthRatio, _heightRatio;
 };
 
 class NearestTexelBuffer : public TexelBuffer {
 public:
-	NearestTexelBuffer(const PixelBuffer &buf, unsigned int width, unsigned int height, unsigned int textureSize);
+	NearestTexelBuffer(const Graphics::PixelBuffer &buf, uint width, uint height, uint textureSize);
 	~NearestTexelBuffer();
 
 protected:
 	void getARGBAt(
-		unsigned int pixel,
-		unsigned int, unsigned int,
+		uint pixel,
+		uint, uint,
 		uint8 &a, uint8 &r, uint8 &g, uint8 &b
 	) const override;
 
 private:
-	PixelBuffer _buf;
+	Graphics::PixelBuffer _buf;
 };
 
 class BilinearTexelBuffer : public TexelBuffer {
 public:
-	BilinearTexelBuffer(const PixelBuffer &buf, unsigned int width, unsigned int height, unsigned int textureSize);
+	BilinearTexelBuffer(const Graphics::PixelBuffer &buf, uint width, uint height, uint textureSize);
 	~BilinearTexelBuffer();
 
 protected:
 	void getARGBAt(
-		unsigned int pixel,
-		unsigned int ds, unsigned int dt,
+		uint pixel,
+		uint ds, uint dt,
 		uint8 &a, uint8 &r, uint8 &g, uint8 &b
 	) const override;
 
@@ -80,6 +80,6 @@ private:
 	uint32 *_texels;
 };
 
-}
+} // end of namespace TinyGL
 
 #endif
diff --git a/graphics/tinygl/texture.cpp b/graphics/tinygl/texture.cpp
index bcdafe83e4..3b1b5346ad 100644
--- a/graphics/tinygl/texture.cpp
+++ b/graphics/tinygl/texture.cpp
@@ -159,7 +159,7 @@ void GLContext::glopTexImage2D(GLParam *p) {
 		im->pixmap = nullptr;
 	}
 	if (pixels != NULL) {
-		unsigned int filter;
+		uint filter;
 		Graphics::PixelFormat pf;
 		bool found = false;
 		Common::Array<struct tglColorAssociation>::const_iterator it = colorAssociationList.begin();
@@ -196,14 +196,14 @@ void GLContext::glopTexImage2D(GLParam *p) {
 		case TGL_LINEAR_MIPMAP_NEAREST:
 		case TGL_LINEAR_MIPMAP_LINEAR:
 		case TGL_LINEAR:
-			im->pixmap = new Graphics::BilinearTexelBuffer(
+			im->pixmap = new BilinearTexelBuffer(
 				srcInternal,
 				width, height,
 				_textureSize
 			);
 			break;
 		default:
-			im->pixmap = new Graphics::NearestTexelBuffer(
+			im->pixmap = new NearestTexelBuffer(
 				srcInternal,
 				width, height,
 				_textureSize
@@ -289,7 +289,7 @@ void GLContext::glopPixelStore(GLParam *p) {
 
 } // end of namespace TinyGL
 
-void tglGenTextures(int n, unsigned int *textures) {
+void tglGenTextures(int n, uint *textures) {
 	TinyGL::GLContext *c = TinyGL::gl_get_context();
 
 	for (int i = 0; i < n; i++) {
@@ -298,7 +298,7 @@ void tglGenTextures(int n, unsigned int *textures) {
 	c->maxTextureName += n;
 }
 
-void tglDeleteTextures(int n, const unsigned int *textures) {
+void tglDeleteTextures(int n, const uint *textures) {
 	TinyGL::GLContext *c = TinyGL::gl_get_context();
 	TinyGL::GLTexture *t;
 
diff --git a/graphics/tinygl/zblit.cpp b/graphics/tinygl/zblit.cpp
index 30d6fe99a7..c02d7ece3f 100644
--- a/graphics/tinygl/zblit.cpp
+++ b/graphics/tinygl/zblit.cpp
@@ -103,8 +103,9 @@ public:
 		Graphics::PixelBuffer _buf; // This is needed for the conversion.
 
 		Line() : _x(0), _y(0), _length(0), _pixels(nullptr) { }
-		Line(int x, int y, int length, byte *pixels, const Graphics::PixelFormat &textureFormat) : _buf(gl_get_context()->fb->getPixelFormat(), length, DisposeAfterUse::NO),
-					_x(x), _y(y), _length(length) {
+		Line(int x, int y, int length, byte *pixels, const Graphics::PixelFormat &textureFormat) :
+				_buf(gl_get_context()->fb->getPixelFormat(), length, DisposeAfterUse::NO),
+				_x(x), _y(y), _length(length) {
 			// Performing texture to screen conversion.
 			Graphics::PixelBuffer srcBuf(textureFormat, pixels);
 			_buf.copyBuffer(0, 0, length, srcBuf);
@@ -223,7 +224,7 @@ public:
 
 	template <bool kDisableBlending, bool kDisableColoring, bool kFlipVertical, bool kFlipHorizontal>
 	FORCEINLINE void tglBlitRotoScale(int dstX, int dstY, int width, int height, int srcX, int srcY, int srcWidth, int srcHeight, int rotation,
-		int originX, int originY, float aTint, float rTint, float gTint, float bTint);
+	                                  int originX, int originY, float aTint, float rTint, float gTint, float bTint);
 
 	//Utility function that calls the correct blitting function.
 	template <bool kDisableBlending, bool kDisableColoring, bool kDisableTransform, bool kFlipVertical, bool kFlipHorizontal, bool kEnableAlphaBlending>
@@ -362,7 +363,6 @@ FORCEINLINE void BlitImage::tglBlitRLE(int dstX, int dstY, int srcX, int srcY, i
 							c->fb->writePixel((dstX + x) + (dstY + (l._y - srcY)) * fbWidth, aDst * aTint, rDst * rTint, gDst * gTint, bDst * bTint);
 						}
 					}
-
 				}
 			}
 			lineIndex++;
@@ -458,7 +458,7 @@ FORCEINLINE void BlitImage::tglBlitSimple(int dstX, int dstY, int srcX, int srcY
 // filter to scale the blit image before copying it to the screen.
 template <bool kDisableBlending, bool kDisableColoring, bool kFlipVertical, bool kFlipHorizontal>
 FORCEINLINE void BlitImage::tglBlitScale(int dstX, int dstY, int width, int height, int srcX, int srcY, int srcWidth, int srcHeight,
-					 float aTint, float rTint, float gTint, float bTint) {
+	                                 float aTint, float rTint, float gTint, float bTint) {
 	GLContext *c = gl_get_context();
 
 	int clampWidth, clampHeight;
@@ -548,7 +548,7 @@ systems.
 
 template <bool kDisableBlending, bool kDisableColoring, bool kFlipVertical, bool kFlipHorizontal>
 FORCEINLINE void BlitImage::tglBlitRotoScale(int dstX, int dstY, int width, int height, int srcX, int srcY, int srcWidth, int srcHeight, int rotation,
-							 int originX, int originY, float aTint, float rTint, float gTint, float bTint) {
+	                                     int originX, int originY, float aTint, float rTint, float gTint, float bTint) {
 	GLContext *c = gl_get_context();
 
 	int clampWidth, clampHeight;
diff --git a/graphics/tinygl/zblit.h b/graphics/tinygl/zblit.h
index f5db4c64af..bac3f02105 100644
--- a/graphics/tinygl/zblit.h
+++ b/graphics/tinygl/zblit.h
@@ -53,8 +53,9 @@ namespace Internal {
 	@brief Sets up a scissor rectangle for blit calls: every blit call is affected by this rectangle.
 	*/
 	void tglBlitSetScissorRect(const Common::Rect &rect);
-	void tglBlitResetScissorRect(void);
+	void tglBlitResetScissorRect();
 } // end of namespace Internal
+
 } // end of namespace TinyGL
 
 #endif // GRAPHICS_TINYGL_ZBLIT_H_
diff --git a/graphics/tinygl/zblit_public.h b/graphics/tinygl/zblit_public.h
index cfbbaed0e6..6ff785f94b 100644
--- a/graphics/tinygl/zblit_public.h
+++ b/graphics/tinygl/zblit_public.h
@@ -31,8 +31,8 @@ namespace TinyGL {
 
 struct BlitTransform {
 	BlitTransform(int dstX, int dstY) : _rotation(0), _originX(0), _originY(0), _aTint(1.0f),
-				_rTint(1.0f), _gTint(1.0f), _bTint(1.0), _flipHorizontally(false),
-				_flipVertically(false) {
+	                                    _rTint(1.0f), _gTint(1.0f), _bTint(1.0), _flipHorizontally(false),
+	                                    _flipVertically(false) {
 		_destinationRectangle.translate(dstX, dstY);
 	}
 
@@ -67,7 +67,8 @@ struct BlitTransform {
 	}
 
 	bool operator==(const BlitTransform &other) const {
-		return _sourceRectangle == other._sourceRectangle && _destinationRectangle == other._destinationRectangle &&
+		return
+			_sourceRectangle == other._sourceRectangle && _destinationRectangle == other._destinationRectangle &&
 			_rotation == other._rotation && _originX == other._originX && _originY == other._originY &&
 			_aTint == other._aTint && _rTint == other._rTint && _gTint == other._gTint && _bTint == other._bTint &&
 			_flipHorizontally == other._flipHorizontally && _flipVertically == other._flipVertically;
diff --git a/graphics/tinygl/zbuffer.cpp b/graphics/tinygl/zbuffer.cpp
index 83ad77037b..5646fbcd2d 100644
--- a/graphics/tinygl/zbuffer.cpp
+++ b/graphics/tinygl/zbuffer.cpp
@@ -39,10 +39,10 @@ namespace TinyGL {
 // adr must be aligned on an 'int'
 static void memset_s(void *adr, int val, int count) {
 	int n, v;
-	unsigned int *p;
+	uint *p;
 	unsigned short *q;
 
-	p = (unsigned int *)adr;
+	p = (uint *)adr;
 	v = val | (val << 16);
 
 	n = count >> 3;
@@ -62,9 +62,9 @@ static void memset_s(void *adr, int val, int count) {
 
 static void memset_l(void *adr, int val, int count) {
 	int n, v;
-	unsigned int *p;
+	uint *p;
 
-	p = (unsigned int *)adr;
+	p = (uint *)adr;
 	v = val;
 	n = count >> 2;
 	for (int i = 0; i < n; i++) {
@@ -122,7 +122,7 @@ void FrameBuffer::clear(int clearZ, int z, int clearColor, int r, int g, int b,
                         bool clearStencil, int stencilValue) {
 	if (clearZ) {
 		const uint8 *zc = (const uint8 *)&z;
-		unsigned int i;
+		uint i;
 		for (i = 1; i < sizeof(z) && zc[0] == zc[i]; i++) { ; }
 		if (i == sizeof(z)) {
 			// All "z" bytes are identical, use memset (fast)
@@ -136,7 +136,7 @@ void FrameBuffer::clear(int clearZ, int z, int clearColor, int r, int g, int b,
 		byte *pp = _pbuf.getRawBuffer();
 		uint32 color = _pbufFormat.RGBToColor(r, g, b);
 		const uint8 *colorc = (uint8 *)&color;
-		unsigned int i;
+		uint i;
 		for (i = 1; i < sizeof(color) && colorc[0] == colorc[i]; i++) { ; }
 		if (i == sizeof(color)) {
 			// All "color" bytes are identical, use memset (fast)
@@ -164,9 +164,9 @@ void FrameBuffer::clearRegion(int x, int y, int w, int h, bool clearZ, int z,
                               bool clearColor, int r, int g, int b, bool clearStencil, int stencilValue) {
 	if (clearZ) {
 		int height = h;
-		unsigned int *zbuf = _zbuf + (y * _pbufWidth);
+		uint *zbuf = _zbuf + (y * _pbufWidth);
 		const uint8 *zc = (const uint8 *)&z;
-		unsigned int i;
+		uint i;
 		for (i = 1; i < sizeof(z) && zc[0] == zc[i]; i++) { ; }
 		if (i == sizeof(z)) {
 			// All "z" bytes are identical, use memset (fast)
@@ -187,7 +187,7 @@ void FrameBuffer::clearRegion(int x, int y, int w, int h, bool clearZ, int z,
 		byte *pp = _pbuf.getRawBuffer() + y * _pbufPitch + x * _pbufBpp;
 		uint32 color = _pbufFormat.RGBToColor(r, g, b);
 		const uint8 *colorc = (uint8 *)&color;
-		unsigned int i;
+		uint i;
 		for (i = 1; i < sizeof(color) && colorc[0] == colorc[i]; i++) { ; }
 		if (i == sizeof(color)) {
 			// All "color" bytes are identical, use memset (fast)
@@ -221,8 +221,8 @@ void FrameBuffer::clearRegion(int x, int y, int w, int h, bool clearZ, int z,
 	}
 }
 
-inline static void blitPixel(uint8 offset, unsigned int *from_z, unsigned int *to_z, unsigned int z_length, byte *from_color, byte *to_color, unsigned int color_length) {
-	const unsigned int d = from_z[offset];
+inline static void blitPixel(uint8 offset, uint *from_z, uint *to_z, uint z_length, byte *from_color, byte *to_color, uint color_length) {
+	const uint d = from_z[offset];
 	if (d > to_z[offset]) {
 		memcpy(to_color + offset, from_color + offset, color_length);
 		memcpy(to_z + offset, &d, z_length);
@@ -237,8 +237,8 @@ void FrameBuffer::blitOffscreenBuffer(Buffer *buf) {
 		const int unrolled_pixel_bytes = pixel_bytes * UNROLL_COUNT;
 		byte *to = _pbuf.getRawBuffer();
 		byte *from = buf->pbuf;
-		unsigned int *to_z = _zbuf;
-		unsigned int *from_z = buf->zbuf;
+		uint *to_z = _zbuf;
+		uint *from_z = buf->zbuf;
 		int count = _pbufWidth * _pbufHeight;
 		while (count >= UNROLL_COUNT) {
 			blitPixel(0x0, from_z, to_z, sizeof(int), from, to, pixel_bytes);
diff --git a/graphics/tinygl/zbuffer.h b/graphics/tinygl/zbuffer.h
index 654b4c336f..87be424089 100644
--- a/graphics/tinygl/zbuffer.h
+++ b/graphics/tinygl/zbuffer.h
@@ -88,15 +88,16 @@ struct ZBufferPoint {
 	float sz, tz;  // temporary coordinates for mapping
 
 	bool operator==(const ZBufferPoint &other) const {
-		return	x == other.x &&
-				y == other.y &&
-				z == other.z &&
-				s == other.s &&
-				t == other.t &&
-				r == other.r &&
-				g == other.g &&
-				b == other.b &&
-				a == other.a;
+		return
+			x == other.x &&
+			y == other.y &&
+			z == other.z &&
+			s == other.s &&
+			t == other.t &&
+			r == other.r &&
+			g == other.g &&
+			b == other.b &&
+			a == other.a;
 	}
 };
 
@@ -282,7 +283,7 @@ private:
 	}
 
 	template <bool kEnableAlphaTest, bool kBlendingEnabled, bool kDepthWrite>
-	FORCEINLINE void writePixel(int pixel, int value, unsigned int z) {
+	FORCEINLINE void writePixel(int pixel, int value, uint z) {
 		if (kBlendingEnabled == false) {
 			_pbuf.setPixelAt(pixel, value);
 			if (kDepthWrite) {
@@ -310,10 +311,10 @@ private:
 	                                   int &dzdx, int &drdx, int &dgdx, int &dbdx, uint dadx);
 
 	template <bool kDepthWrite, bool kLightsMode, bool kSmoothMode, bool kEnableAlphaTest, bool kEnableScissor, bool kEnableBlending, bool kStencilEnabled, bool kDepthTestEnabled>
-	FORCEINLINE void putPixelTexture(int fbOffset, const Graphics::TexelBuffer *texture,
+	FORCEINLINE void putPixelTexture(int fbOffset, const TexelBuffer *texture,
 	                                 uint wrap_s, uint wrap_t, uint *pz, byte *ps, int _a,
 	                                 int x, int y, uint &z, int &t, int &s,
-									 uint &r, uint &g, uint &b, uint &a,
+	                                 uint &r, uint &g, uint &b, uint &a,
 	                                 int &dzdx, int &dsdx, int &dtdx, int &drdx, int &dgdx, int &dbdx, uint dadx);
 
 	template <bool kDepthWrite, bool kEnableScissor, bool kStencilEnabled, bool kDepthTestEnabled>
@@ -364,7 +365,7 @@ private:
 	}
 
 	template <bool kEnableAlphaTest, bool kBlendingEnabled, bool kDepthWrite>
-	FORCEINLINE void writePixel(int pixel, byte aSrc, byte rSrc, byte gSrc, byte bSrc, unsigned int z) {
+	FORCEINLINE void writePixel(int pixel, byte aSrc, byte rSrc, byte gSrc, byte bSrc, uint z) {
 		if (kEnableAlphaTest) {
 			if (!checkAlphaTest(aSrc))
 				return;
@@ -464,13 +465,18 @@ private:
 			default:
 				break;
 			}
-			int finalR, finalG, finalB;
-			finalR = rDst + rSrc;
-			finalG = gDst + gSrc;
-			finalB = bDst + bSrc;
-			if (finalR > 255) { finalR = 255; }
-			if (finalG > 255) { finalG = 255; }
-			if (finalB > 255) { finalB = 255; }
+			int finalR = rDst + rSrc;
+			int finalG = gDst + gSrc;
+			int finalB = bDst + bSrc;
+			if (finalR > 255) {
+				finalR = 255;
+			}
+			if (finalG > 255) {
+				finalG = 255;
+			}
+			if (finalB > 255) {
+				finalB = 255;
+			}
 			_pbuf.setPixelAt(pixel, 255, finalR, finalG, finalB);
 		}
 	}
@@ -553,7 +559,7 @@ public:
 		_offsetUnits = offsetUnits;
 	}
 
-	FORCEINLINE void setTexture(const Graphics::TexelBuffer *texture, unsigned int wraps, unsigned int wrapt) {
+	FORCEINLINE void setTexture(const TexelBuffer *texture, uint wraps, uint wrapt) {
 		_currentTexture = texture;
 		_wrapS = wraps;
 		_wrapT = wrapt;
@@ -578,13 +584,13 @@ private:
 	void clearOffscreenBuffer(Buffer *buffer);
 
 	template <bool kInterpRGB, bool kInterpZ, bool kInterpST, bool kInterpSTZ, int kSmoothMode,
-			  bool kDepthWrite, bool kAlphaTestEnabled, bool kEnableScissor, bool kBlendingEnabled,
-			  bool kStencilEnabled, bool kDepthTestEnabled>
+	          bool kDepthWrite, bool kAlphaTestEnabled, bool kEnableScissor, bool kBlendingEnabled,
+	          bool kStencilEnabled, bool kDepthTestEnabled>
 	void fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2);
 
 	template <bool kInterpRGB, bool kInterpZ, bool kInterpST, bool kInterpSTZ, int kSmoothMode,
-			  bool kDepthWrite, bool kAlphaTestEnabled, bool kEnableScissor, bool kBlendingEnabled,
-			  bool kStencilEnabled>
+	          bool kDepthWrite, bool kAlphaTestEnabled, bool kEnableScissor, bool kBlendingEnabled,
+	          bool kStencilEnabled>
 	void fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2);
 
 	template <bool kInterpRGB, bool kInterpZ, bool kInterpST, bool kInterpSTZ, int kDrawLogic, bool kDepthWrite, bool enableAlphaTest, bool kEnableScissor, bool kBlendingEnabled>
@@ -622,13 +628,13 @@ private:
 	void fillLineInterp(ZBufferPoint *p1, ZBufferPoint *p2);
 
 	template <bool kDepthWrite>
-	FORCEINLINE void putPixel(unsigned int pixelOffset, int color, int x, int y, unsigned int z);
+	FORCEINLINE void putPixel(uint pixelOffset, int color, int x, int y, uint z);
 
 	template <bool kDepthWrite, bool kEnableScissor>
-	FORCEINLINE void putPixel(unsigned int pixelOffset, int color, int x, int y, unsigned int z);
+	FORCEINLINE void putPixel(uint pixelOffset, int color, int x, int y, uint z);
 
 	template <bool kEnableScissor>
-	FORCEINLINE void putPixel(unsigned int pixelOffset, int color, int x, int y);
+	FORCEINLINE void putPixel(uint pixelOffset, int color, int x, int y);
 
 	template <bool kInterpRGB, bool kInterpZ, bool kDepthWrite>
 	FORCEINLINE void drawLine(const ZBufferPoint *p1, const ZBufferPoint *p2);
@@ -654,8 +660,8 @@ private:
 	Common::Rect _clipRectangle;
 	bool _enableScissor;
 
-	const Graphics::TexelBuffer *_currentTexture;
-	unsigned int _wrapS, _wrapT;
+	const TexelBuffer *_currentTexture;
+	uint _wrapS, _wrapT;
 	bool _blendingEnabled;
 	int _sourceBlendingFactor;
 	int _destinationBlendingFactor;
diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h
index 70534c3e6d..97b0258bf2 100644
--- a/graphics/tinygl/zgl.h
+++ b/graphics/tinygl/zgl.h
@@ -114,7 +114,6 @@ struct GLMaterial {
 	Vector4 specular;
 	bool has_specular;
 	float shininess;
-
 	// computed values
 	int shininess_i;
 	int do_specular;
@@ -132,7 +131,7 @@ union GLParam {
 	int op;
 	float f;
 	int i;
-	unsigned int ui;
+	uint ui;
 	void *p;
 };
 
@@ -177,7 +176,7 @@ struct GLVertex {
 };
 
 struct GLImage {
-	Graphics::TexelBuffer *pixmap;
+	TexelBuffer *pixmap;
 	int xsize, ysize;
 };
 
@@ -187,7 +186,7 @@ struct GLImage {
 
 struct GLTexture {
 	GLImage images[MAX_TEXTURE_LEVELS];
-	unsigned int handle;
+	uint handle;
 	int versionNumber;
 	struct GLTexture *next, *prev;
 	bool disposed;
@@ -244,7 +243,7 @@ public:
 		}
 		size_t returnPos = _memoryPosition;
 		_memoryPosition += size;
-		return ((char *)_memoryBuffer) + returnPos;
+		return ((byte *)_memoryBuffer) + returnPos;
 	}
 
 	void reset() {
@@ -300,8 +299,8 @@ struct GLContext {
 	int texture_2d_enabled;
 	int texture_mag_filter;
 	int texture_min_filter;
-	unsigned int texture_wrap_s;
-	unsigned int texture_wrap_t;
+	uint texture_wrap_s;
+	uint texture_wrap_t;
 	Common::Array<struct tglColorAssociation> colorAssociationList;
 
 	// shared state
@@ -340,14 +339,14 @@ struct GLContext {
 
 	// selection
 	int render_mode;
-	unsigned int *select_buffer;
+	uint *select_buffer;
 	int select_size;
-	unsigned int *select_ptr, *select_hit;
+	uint *select_ptr, *select_hit;
 	int select_overflow;
 	int select_hits;
 
 	// names
-	unsigned int name_stack[MAX_NAME_STACK_DEPTH];
+	uint name_stack[MAX_NAME_STACK_DEPTH];
 	int name_stack_size;
 
 	// clear
@@ -457,7 +456,7 @@ public:
 	static void gl_draw_triangle_select(GLContext *c, GLVertex *p0, GLVertex *p1, GLVertex *p2);
 	void gl_draw_triangle_clip(GLVertex *p0, GLVertex *p1, GLVertex *p2, int clip_bit);
 
-	void gl_add_select(unsigned int zmin, unsigned int zmax);
+	void gl_add_select(uint zmin, uint zmax);
 	void gl_add_select1(int z1, int z2, int z3);
 	void gl_enable_disable_light(int light, int v);
 	void gl_shade_vertex(GLVertex *v);
diff --git a/graphics/tinygl/zline.cpp b/graphics/tinygl/zline.cpp
index 2f5f857fdc..613b905d71 100644
--- a/graphics/tinygl/zline.cpp
+++ b/graphics/tinygl/zline.cpp
@@ -31,7 +31,7 @@
 namespace TinyGL {
 
 template <bool kDepthWrite>
-FORCEINLINE void FrameBuffer::putPixel(unsigned int pixelOffset, int color, int x, int y, unsigned int z) {
+FORCEINLINE void FrameBuffer::putPixel(uint pixelOffset, int color, int x, int y, uint z) {
 	if (_enableScissor)
 		putPixel<kDepthWrite, true>(pixelOffset, color, x, y, z);
 	else
@@ -39,18 +39,18 @@ FORCEINLINE void FrameBuffer::putPixel(unsigned int pixelOffset, int color, int
 }
 
 template <bool kDepthWrite, bool kEnableScissor>
-FORCEINLINE void FrameBuffer::putPixel(unsigned int pixelOffset, int color, int x, int y, unsigned int z) {
+FORCEINLINE void FrameBuffer::putPixel(uint pixelOffset, int color, int x, int y, uint z) {
 	if (kEnableScissor && scissorPixel(x, y)) {
 		return;
 	}
-	unsigned int *pz = _zbuf + pixelOffset;
+	uint *pz = _zbuf + pixelOffset;
 	if (compareDepth(z, *pz)) {
 		writePixel<true, true, kDepthWrite>(pixelOffset, color, z);
 	}
 }
 
 template <bool kEnableScissor>
-FORCEINLINE void FrameBuffer::putPixel(unsigned int pixelOffset, int color, int x, int y) {
+FORCEINLINE void FrameBuffer::putPixel(uint pixelOffset, int color, int x, int y) {
 	if (kEnableScissor && scissorPixel(x, y)) {
 		return;
 	}
@@ -142,9 +142,9 @@ void FrameBuffer::drawLine(const ZBufferPoint *p1, const ZBufferPoint *p2) {
 }
 
 void FrameBuffer::plot(ZBufferPoint *p) {
-	const unsigned int pixelOffset = p->y * _pbufWidth + p->x;
+	const uint pixelOffset = p->y * _pbufWidth + p->x;
 	const int col = RGB_TO_PIXEL(p->r, p->g, p->b);
-	const unsigned int z = p->z;
+	const uint z = p->z;
 	if (_depthWrite && _depthTestEnabled)
 		putPixel<true>(pixelOffset, col, p->x, p->y, z);
 	else
diff --git a/graphics/tinygl/ztriangle.cpp b/graphics/tinygl/ztriangle.cpp
index 6f27657e88..ac5a618f25 100644
--- a/graphics/tinygl/ztriangle.cpp
+++ b/graphics/tinygl/ztriangle.cpp
@@ -37,8 +37,8 @@ static const int NB_INTERP = 8;
 
 template <bool kDepthWrite, bool kSmoothMode, bool kEnableAlphaTest, bool kEnableScissor, bool kEnableBlending, bool kStencilEnabled, bool kDepthTestEnabled>
 FORCEINLINE void FrameBuffer::putPixelNoTexture(int fbOffset, uint *pz, byte *ps, int _a,
-	                                            int x, int y, uint &z, uint &r, uint &g, uint &b, uint &a,
-	                                            int &dzdx, int &drdx, int &dgdx, int &dbdx, uint dadx) {
+	                                        int x, int y, uint &z, uint &r, uint &g, uint &b, uint &a,
+	                                        int &dzdx, int &drdx, int &dgdx, int &dbdx, uint dadx) {
 	if (kEnableScissor && scissorPixel(x + _a, y)) {
 		return;
 	}
@@ -71,11 +71,11 @@ FORCEINLINE void FrameBuffer::putPixelNoTexture(int fbOffset, uint *pz, byte *ps
 }
 
 template <bool kDepthWrite, bool kLightsMode, bool kSmoothMode, bool kEnableAlphaTest, bool kEnableScissor, bool kEnableBlending, bool kStencilEnabled, bool kDepthTestEnabled>
-FORCEINLINE void FrameBuffer::putPixelTexture(int fbOffset, const Graphics::TexelBuffer *texture,
-											  uint wrap_s, uint wrap_t, uint *pz, byte *ps, int _a,
-											  int x, int y, uint &z, int &t, int &s,
-											  uint &r, uint &g, uint &b, uint &a,
-										      int &dzdx, int &dsdx, int &dtdx, int &drdx, int &dgdx, int &dbdx, uint dadx) {
+FORCEINLINE void FrameBuffer::putPixelTexture(int fbOffset, const TexelBuffer *texture,
+	                                      uint wrap_s, uint wrap_t, uint *pz, byte *ps, int _a,
+	                                      int x, int y, uint &z, int &t, int &s,
+	                                      uint &r, uint &g, uint &b, uint &a,
+	                                      int &dzdx, int &dsdx, int &dtdx, int &drdx, int &dgdx, int &dbdx, uint dadx) {
 	if (kEnableScissor && scissorPixel(x + _a, y)) {
 		return;
 	}
@@ -152,7 +152,7 @@ template <bool kInterpRGB, bool kInterpZ, bool kInterpST, bool kInterpSTZ, int k
           bool kDepthWrite, bool kAlphaTestEnabled, bool kEnableScissor, bool kBlendingEnabled,
           bool kStencilEnabled, bool kDepthTestEnabled>
 void FrameBuffer::fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2) {
-	const Graphics::TexelBuffer *texture;
+	const TexelBuffer *texture;
 	float fdzdx = 0, fndzdx = 0, ndszdx = 0, ndtzdx = 0;
 
 	ZBufferPoint *tp, *pr1 = 0, *pr2 = 0, *l1 = 0, *l2 = 0;
@@ -520,7 +520,7 @@ void FrameBuffer::fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint
 					}
 					for (int _a = 0; _a < NB_INTERP; _a++) {
 						putPixelTexture<kDepthWrite, kInterpRGB, kSmoothMode, kAlphaTestEnabled, kEnableScissor, kBlendingEnabled, kStencilEnabled, kDepthTestEnabled>
-						                                  (pp, texture, _wrapS, _wrapT, pz, ps, _a, x, y, z, t, s, r, g, b, a, dzdx, dsdx, dtdx, drdx, dgdx, dbdx, dadx);
+						               (pp, texture, _wrapS, _wrapT, pz, ps, _a, x, y, z, t, s, r, g, b, a, dzdx, dsdx, dtdx, drdx, dgdx, dbdx, dadx);
 					}
 					pp += NB_INTERP;
 					if (kInterpZ) {
@@ -547,7 +547,7 @@ void FrameBuffer::fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint
 
 				while (n >= 0) {
 					putPixelTexture<kDepthWrite, kInterpRGB, kSmoothMode, kAlphaTestEnabled, kEnableScissor, kBlendingEnabled, kStencilEnabled, kDepthTestEnabled>
-					                                  (pp, texture, _wrapS, _wrapT, pz, ps, 0, x, y, z, t, s, r, g, b, a, dzdx, dsdx, dtdx, drdx, dgdx, dbdx, dadx);
+					               (pp, texture, _wrapS, _wrapT, pz, ps, 0, x, y, z, t, s, r, g, b, a, dzdx, dsdx, dtdx, drdx, dgdx, dbdx, dadx);
 					pp += 1;
 					if (kInterpZ) {
 						pz += 1;




More information about the Scummvm-git-logs mailing list