Skip to content

Commit

Permalink
UPBGE: Restore anisotropic filtering value in LA_Launcher instead of …
Browse files Browse the repository at this point in the history
…RAS_OpenGLRasterizer.
  • Loading branch information
panzergame committed Aug 8, 2016
1 parent 212def9 commit a7ed66a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions source/gameengine/Launcher/LA_Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ void LA_Launcher::InitEngine()
m_rasterizer->SetEyeSeparation(m_startScene->gm.eyeseparation);
m_rasterizer->SetDrawingMode(GetRasterizerDrawMode());

// Copy current anisotropic level to restore it at the game end.
m_savedData.anisotropic = m_rasterizer->GetAnisotropicFiltering();
// Copy current mipmap mode to restore at the game end.
m_savedData.mipmap = m_rasterizer->GetMipmapping();

Expand Down Expand Up @@ -314,6 +316,9 @@ void LA_Launcher::ExitEngine()
m_canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
}

// Set anisotropic settign back to its original value.
m_rasterizer->SetAnisotropicFiltering(m_savedData.anisotropic);

// Set mipmap setting back to its original value.
m_rasterizer->SetMipmapping(m_savedData.mipmap);

Expand Down
1 change: 1 addition & 0 deletions source/gameengine/Launcher/LA_Launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class LA_Launcher
struct SavedData {
int vsync;
RAS_IRasterizer::MipmapOption mipmap;
int anisotropic;
} m_savedData;

struct PythonConsole {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_STORAGE_TYPE storage, int storage
}
hinterlace_mask[32] = 0;

m_prevafvalue = GPU_get_anisotropic();

if (m_storage_type == RAS_VBO /*|| m_storage_type == RAS_AUTO_STORAGE && GLEW_ARB_vertex_buffer_object*/) {
m_storage = new RAS_StorageVBO(&m_texco_num, m_texco, &m_attrib_num, m_attrib, m_attrib_layer);
}
Expand All @@ -264,9 +262,6 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_STORAGE_TYPE storage, int storage

RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer()
{
// Restore the previous AF value
GPU_set_anisotropic(m_prevafvalue);

if (m_storage)
delete m_storage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
bool m_setfocallength;
int m_noOfScanlines;

short m_prevafvalue;

/* motion blur */
int m_motionblur;
float m_motionblurvalue;
Expand Down

0 comments on commit a7ed66a

Please sign in to comment.