[mupen64plus-video-arachnoid] 50/147: Add mipmapping support
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:09:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch master
in repository mupen64plus-video-arachnoid.
commit 25f631e73aa216525d4d5e55786ebb76b2411a7c
Author: Sven Eckelmann <sven at narfation.org>
Date: Sun Jul 24 10:23:16 2011 +0200
Add mipmapping support
---
debian/changelog | 1 +
debian/patches/mipmapping.patch | 125 ++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 127 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 44d8bb7..d2f2125 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ mupen64plus-video-arachnoid (1.99.4-3) UNRELEASED; urgency=low
- Add rewrite_makefile.patch, Rewrite Makefile to fix flags and linking
- Add array_bounds.patch, Fix write past the end of m_fillColor when
initialising CombinerBase
+ - Add mipmapping.patch, Add mipmapping support
* Depend on pkg-config in debian/control for new Makefile
-- Sven Eckelmann <sven at narfation.org> Sat, 23 Jul 2011 16:42:55 +0200
diff --git a/debian/patches/mipmapping.patch b/debian/patches/mipmapping.patch
new file mode 100644
index 0000000..d241c0a
--- /dev/null
+++ b/debian/patches/mipmapping.patch
@@ -0,0 +1,125 @@
+Description: Add mipmapping support
+Origin: upstream, https://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/changeset/e963f7ab6022
+Author: Dorian Fevrier <dfevrier at quintaindustries.com>
+
+---
+diff --git a/src/GraphicsPlugin.cpp b/src/GraphicsPlugin.cpp
+index c0641b816924de2b0cc1c4db6ff8c99ddbeb81b3..368f2aa86bab343b9d3047e6905a9fb964f3cdea 100755
+--- a/src/GraphicsPlugin.cpp
++++ b/src/GraphicsPlugin.cpp
+@@ -135,7 +135,7 @@ bool GraphicsPlugin::initialize(GFX_INFO* graphicsInfo)
+ //Initialize Texture Cache
+ //! @todo Not "hardcode" TextureBitDepth.
+ m_textureCache.initialize(&m_rsp, &m_rdp, m_memory, 16);
+-
++ m_textureCache.setMipmap( m_config->mipmapping );
+
+ //Initialize OpenGL Renderer
+ if ( !OpenGLRenderer::getSingleton().initialize(&m_rsp, &m_rdp, &m_textureCache, m_vi, m_fogManager) )
+diff --git a/src/config/Config.cpp b/src/config/Config.cpp
+index d35aae600c93b624796827b06ea7a88e4adfc6d0..996a644e35e0b204982552fdda018d0423e0f43c 100755
+--- a/src/config/Config.cpp
++++ b/src/config/Config.cpp
+@@ -58,6 +58,7 @@ bool Config::initialize()
+ ConfigSetDefaultBool(m_videoArachnoidSection, "Wireframe", false, "Render in wireframe?");
+ ConfigSetDefaultBool(m_videoArachnoidSection, "Fog", false, "Render fog?");
+ ConfigSetDefaultInt(m_videoArachnoidSection, "MultiSampling", 0, "Use MultiSampling? 0=no 2,4,8,16=quality");
++ ConfigSetDefaultInt(m_videoArachnoidSection, "Mipmapping", 0, "Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear");
+ #ifdef WIN32
+ ConfigSetDefaultInt(m_videoArachnoidSection, "ScreenUpdateSetting", SCREEN_UPDATE_CI, "When to update the screen: 1 - on VI, 2 - on first CI");
+ #else
+@@ -79,5 +80,6 @@ void Config::load()
+ m_cfg.wireframe = ConfigGetParamBool(m_videoArachnoidSection, "Wireframe");
+ m_cfg.fog = ConfigGetParamBool(m_videoArachnoidSection, "Fog");
+ m_cfg.multiSampling = ConfigGetParamBool(m_videoArachnoidSection, "MultiSampling");
++ m_cfg.mipmapping = ConfigGetParamInt(m_videoArachnoidSection, "Mipmapping");
+ m_cfg.screenUpdateSetting = ConfigGetParamInt(m_videoArachnoidSection, "ScreenUpdateSetting");
+ }
+diff --git a/src/config/ConfigMap.h b/src/config/ConfigMap.h
+index e975ff5c4a7ccbe4669495199fec2c2279a1d9b0..05085f9ffa02aa337bf757e464e13eb92eb6768a 100755
+--- a/src/config/ConfigMap.h
++++ b/src/config/ConfigMap.h
+@@ -39,6 +39,7 @@ struct ConfigMap
+ bool wireframe; //!< Render in wireframe? defualt = false
+ bool fog; //!< Render fog? default = true
+ int multiSampling; //!< Use MultiSampling? 0=no 2,4,8,16=quality default = 0
++ int mipmapping; //!< Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear default = 0
+ int screenUpdateSetting; //!< When to redraw the screen default = SCREEN_UPDATE_VI
+ };
+
+diff --git a/src/texture/TextureCache.cpp b/src/texture/TextureCache.cpp
+index e7eb39d87f65a66a08162e9118e0d1676d1ff8db..b1f7218cdb25c70cabaf3db9ee98f06cff869645 100755
+--- a/src/texture/TextureCache.cpp
++++ b/src/texture/TextureCache.cpp
+@@ -35,6 +35,7 @@
+ //gSPBgRect1Cyc
+ //gSPBgRectCopy
+ #define GL_CLAMP_TO_EDGE 0x812F
++#define GL_GENERATE_MIPMAP 0x8191
+
+ #include "Logger.h"
+ #include <iostream>
+@@ -576,8 +577,32 @@ void TextureCache::_activateTexture( unsigned int t, CachedTexture *texture )
+ unsigned int textureFiltering = m_rdp->getTextureFiltering();
+ if ( textureFiltering == G_TF_BILERP || textureFiltering == G_TF_AVERAGE )
+ {
+- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
++ if( m_mipmap > 0 )
++ {
++ // Set Mipmap
++ if(m_mipmap == 1) // nearest
++ {
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
++ }
++ else if(m_mipmap == 2) // bilinear
++ {
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
++ }
++ else if(m_mipmap == 3) // trilinear
++ {
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
++ }
++
++ // Tell to hardware to generate mipmap (himself) when glTexImage2D is called
++ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
++ }
++ else // no mipmapping
++ {
++ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
++ glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE );
++ }
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
++
+ }
+ else
+ {
+@@ -585,6 +610,8 @@ void TextureCache::_activateTexture( unsigned int t, CachedTexture *texture )
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+ }
+
++
++
+ // Set clamping modes
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->clampS ? GL_CLAMP_TO_EDGE : GL_REPEAT );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->clampT ? GL_CLAMP_TO_EDGE : GL_REPEAT );
+diff --git a/src/texture/TextureCache.h b/src/texture/TextureCache.h
+index 26e137d3869d36d719a3a09b86e1ee1cf74a6afd..9712f89e3bbfc89575dfaa929e79555e716ccb90 100755
+--- a/src/texture/TextureCache.h
++++ b/src/texture/TextureCache.h
+@@ -50,6 +50,8 @@ public:
+ void update(unsigned int tile);
+ void dispose();
+
++ void setMipmap( int value ) { m_mipmap = value; }
++
+ //Add and Remove
+ CachedTexture* addTop();
+ void removeBottom();
+@@ -81,6 +83,7 @@ private:
+ unsigned int m_maxBytes; //!< Maximum number of bytes this cache have
+ unsigned int m_cachedBytes; //!< Current number of bytes in cache
+ unsigned int m_bitDepth; //!<
++ int m_mipmap;
+
+ //Cached textures
+ typedef std::list<CachedTexture*> TextureList;
diff --git a/debian/patches/series b/debian/patches/series
index 25602ad..81f4313 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
rewrite_makefile.patch
array_bounds.patch
+mipmapping.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-video-arachnoid.git
More information about the Pkg-games-commits
mailing list