shithub: tinygl

Download patch

ref: fca0ed59da6623f7afec9f4689b3b3e5138fde7e
parent: 32d34b7cc6d0d30ba509104e390f52d68a5a4e1f
author: David <gek@katherine>
date: Thu Feb 18 12:03:53 EST 2021

Minor update, not much to say

--- a/SDL_Examples/menu.c
+++ b/SDL_Examples/menu.c
@@ -94,9 +94,11 @@
 			{cw = 0; h++;}
 		if(mw<cw)mw=cw;
 	}
-	float w = (size+1)*8*(mw) / (float)winSizeX;
-	float h_ = (size+1)*8*(h)/(float)winSizeY;
-	drawBox(x-w/8,y-h_/8, w, h_);
+	float w = (size)*8*(mw) / (float)winSizeX;
+	float bw = 3*size/(float)winSizeX;
+	float h_ = (size)*8*(h)/(float)winSizeY;
+	float bh = 3*size/(float)winSizeY;
+	drawBox(x-bw/2,y-bh/2, w+bw, h_+bh);
 	glTextSize(size);
 	glDrawText((unsigned char*)text, x*winSizeX, y*winSizeY, textcolor);
 }
--- a/include/zbuffer.h
+++ b/include/zbuffer.h
@@ -227,9 +227,10 @@
 //    GLint *ctable;
     PIXEL *current_texture;
     /* opengl polygon stipple*/
-    GLuint dostipple;
+
 #if TGL_FEATURE_POLYGON_STIPPLE == 1
     GLubyte stipplepattern[TGL_POLYGON_STIPPLE_BYTES];
+    GLuint dostipple;
 #endif
 	GLenum blendeq, sfactor, dfactor;
     GLint enable_blend;
--- a/src/init.c
+++ b/src/init.c
@@ -167,8 +167,9 @@
 	c->current_cull_face = GL_BACK;
 	c->current_shade_model = GL_SMOOTH;
 	c->cull_face_enabled = 0;
-	c->zb->dostipple = 0;
+	
 #if TGL_FEATURE_POLYGON_STIPPLE == 1
+	c->zb->dostipple = 0;
 	for (GLint i = 0; i < 128; i++)
 		c->zb->stipplepattern[i] = 0xFF;
 #endif
--- a/src/misc.c
+++ b/src/misc.c
@@ -111,7 +111,9 @@
 			c->offset_states &= ~TGL_OFFSET_FILL;
 		break;
 	case GL_POLYGON_STIPPLE:
+#if TGL_FEATURE_POLYGON_STIPPLE == 1
 		c->zb->dostipple = v;
+#endif
 		break;
 	case GL_POLYGON_OFFSET_POINT:
 		if (v)