diff --git a/Source/Android/res/xml/video_prefs.xml b/Source/Android/res/xml/video_prefs.xml index 6ec29c13a0..311c6ce8a9 100644 --- a/Source/Android/res/xml/video_prefs.xml +++ b/Source/Android/res/xml/video_prefs.xml @@ -129,9 +129,10 @@ android:key="showFPS" android:summary="@string/show_fps_descrip" android:title="@string/show_fps"/> - + \ No newline at end of file diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java index 71f896097c..09c7c86e70 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java @@ -1,9 +1,5 @@ package org.dolphinemu.dolphinemu; -import java.util.List; - -import org.dolphinemu.dolphinemu.settings.InputConfigFragment; - import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -11,15 +7,11 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.util.DisplayMetrics; -import android.view.InputDevice; -import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.Window; -import android.view.WindowManager; +import android.view.*; import android.view.WindowManager.LayoutParams; +import org.dolphinemu.dolphinemu.settings.InputConfigFragment; + +import java.util.List; /** * This is the activity where all of the emulation handling happens. diff --git a/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp b/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp index 41f9ce20d0..d3aa1c2a93 100644 --- a/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp +++ b/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp @@ -181,8 +181,7 @@ namespace ButtonManager void DrawButtons() { - for(auto it = m_buttons.begin(); it != m_buttons.end(); ++it) - g_video_backend->Video_DrawTexture((*it)->GetTexture(), (*it)->GetCoords()); + // XXX: Make platform specific drawing } // InputDevice diff --git a/Source/Core/DolphinWX/Src/Android/ButtonManager.h b/Source/Core/DolphinWX/Src/Android/ButtonManager.h index f2b7c1c5cb..bc5204d9bf 100644 --- a/Source/Core/DolphinWX/Src/Android/ButtonManager.h +++ b/Source/Core/DolphinWX/Src/Android/ButtonManager.h @@ -70,12 +70,9 @@ namespace ButtonManager { u32 width, height; char *image; - image = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str(), width, height); + // image = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str(), width, height); + // XXX: Make platform specific drawing - m_tex = g_video_backend->Video_LoadTexture(image, width, height); - - free(image); - m_button = button; memcpy(m_coords, coords, sizeof(float) * 8); m_state = BUTTON_RELEASED; @@ -91,7 +88,7 @@ namespace ButtonManager GLuint GetTexture() { return m_tex; } float *GetCoords() { return m_coords; } - ~Button() { g_video_backend->Video_DeleteTexture(m_tex); } + ~Button() { } }; struct sBind diff --git a/Source/Core/VideoCommon/Src/VideoBackendBase.h b/Source/Core/VideoCommon/Src/VideoBackendBase.h index 7f8c90b2be..9c591d05a5 100644 --- a/Source/Core/VideoCommon/Src/VideoBackendBase.h +++ b/Source/Core/VideoCommon/Src/VideoBackendBase.h @@ -103,14 +103,6 @@ public: virtual void Video_ClearMessages() = 0; virtual bool Video_Screenshot(const char* filename) = 0; - // Loads a texture, -1 on not loaded - // Texture is passed in as RGBA data - virtual int Video_LoadTexture(char *imagedata, u32 width, u32 height) = 0; - // Deletes a texture loaded from LoadTexture - virtual void Video_DeleteTexture(int texID) = 0; - // Draws a texture, arg1 is the value returned by LoadTexture, arg2 is the screen coordinates - virtual void Video_DrawTexture(int texID, float *coords) = 0; - virtual void Video_SetRendering(bool bEnabled) = 0; virtual void Video_GatherPipeBursted() = 0; @@ -163,10 +155,6 @@ class VideoBackendHardware : public VideoBackend void Video_ClearMessages(); bool Video_Screenshot(const char* filename); - int Video_LoadTexture(char *imagedata, u32 width, u32 height) { return -1; } - void Video_DeleteTexture(int texID) {} - void Video_DrawTexture(int texID, float *coords) {} - void Video_SetRendering(bool bEnabled); void Video_GatherPipeBursted(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp index 3be03147d6..ad47a1a777 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp @@ -123,36 +123,6 @@ void SWRenderer::DrawDebugText() SWRenderer::RenderText(debugtext_buffer, 20, 20, 0xFFFFFF00); } -// XXX: We should /really/ be outputting textures to the texture image instead of this way. -void SWRenderer::DrawButton(int texID, float *coords) -{ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - static const GLfloat texverts[4][2] = { - {0, 1}, - {0, 0}, - {1, 0}, - {1, 1} - }; - - glBindTexture(GL_TEXTURE_2D, texID); - - glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, coords); - glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts); - glEnableVertexAttribArray(attr_pos); - glEnableVertexAttribArray(attr_tex); - glActiveTexture(GL_TEXTURE0); - glUniform1i(uni_tex, 0); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glDisableVertexAttribArray(attr_pos); - glDisableVertexAttribArray(attr_tex); - - glBindTexture(GL_TEXTURE_2D, 0); - - glDisable(GL_BLEND); -} - void SWRenderer::DrawTexture(u8 *texture, int width, int height) { GLsizei glWidth = (GLsizei)GLInterface->GetBackBufferWidth(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.h b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.h index 5629976978..ba856936cb 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.h @@ -16,7 +16,6 @@ namespace SWRenderer void RenderText(const char* pstr, int left, int top, u32 color); void DrawDebugText(); - void DrawButton(int texId, float *coords); void DrawTexture(u8 *texture, int width, int height); void SwapBuffer(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp index 6e1aff4e46..c63ad2e446 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp @@ -242,32 +242,6 @@ bool VideoSoftware::Video_Screenshot(const char *_szFilename) return false; } -int VideoSoftware::Video_LoadTexture(char *image, u32 width, u32 height) -{ - GLuint Texture = 0; - glGenTextures(1, &Texture); - - glBindTexture(GL_TEXTURE_2D, Texture); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, image); - - return (int) Texture; -} -void VideoSoftware::Video_DeleteTexture(int texID) -{ - if (texID == -1) return; - glDeleteTextures(1, (GLuint*)&texID); -} -void VideoSoftware::Video_DrawTexture(int texID, float *coords) -{ - if (texID == -1) return; - SWRenderer::DrawButton(texID, coords); -} // ------------------------------- // Enter and exit the video loop // -------------------------------