From 205be0ea7a48fd0617be7eaef9c7a0c8e8645787 Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 16 Nov 2008 16:01:55 +0000 Subject: [PATCH] alphatest in drawscope() git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3558 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/renderhud.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 8100b98f..fca971d9 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -86,6 +86,9 @@ void drawscope() // this may need to change depending on the aspect ratio at which the scope image is drawn at const float scopeaspect = 4.0f/3.0f; + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.9f); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); static Texture *scopetex = NULL; if(!scopetex) scopetex = textureload("packages/misc/scope.png", 3); @@ -121,6 +124,8 @@ void drawscope() } glEnd(); + + glDisable(GL_ALPHA_TEST); } const char *crosshairnames[CROSSHAIR_NUM] = { "default", "teammate", "scope" };