From 97d029972e95bd94c9385bbb80ae983fb13a9b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 23 Dec 2016 23:56:50 +0100 Subject: [PATCH] Rename SetTextures to BindTextures --- GPU/Software/SoftGpu.cpp | 2 +- UI/MainScreen.cpp | 6 +++--- UI/MiscScreens.cpp | 4 ++-- UI/PauseScreen.cpp | 2 +- UI/SavedataScreen.cpp | 2 +- UI/Store.cpp | 2 +- ext/native/gfx_es2/draw_text.cpp | 4 ++-- ext/native/thin3d/thin3d.h | 6 +++--- ext/native/thin3d/thin3d_d3d9.cpp | 4 ++-- ext/native/thin3d/thin3d_gl.cpp | 4 ++-- ext/native/thin3d/thin3d_vulkan.cpp | 4 ++-- ext/native/ui/ui_context.cpp | 4 ++-- ext/native/ui/view.cpp | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 14969773cb..cecfd3f927 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -218,7 +218,7 @@ void SoftGPU::CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight) int indexes[] = {0, 1, 2, 0, 2, 3}; idata->SetData((const uint8_t *)indexes, sizeof(indexes)); - thin3d->SetTexture(0, fbTex); + thin3d->BindTexture(0, fbTex); Thin3DShaderSet *texColor = thin3d->GetShaderSetPreset(SS_TEXTURE_COLOR_2D); static const float identity4x4[16] = { diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index cf5b53d9a8..f2a2a8891f 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -251,7 +251,7 @@ void GameButton::Draw(UIContext &dc) { if (texture) { dc.Draw()->Flush(); - dc.GetThin3DContext()->SetTexture(0, texture); + dc.GetThin3DContext()->BindTexture(0, texture); if (holdStart_ != 0.0) { double time_held = time_now_d() - holdStart_; int holdFrameCount = (int)(time_held * 60.0f); @@ -1013,9 +1013,9 @@ bool MainScreen::DrawBackgroundFor(UIContext &dc, const std::string &gamePath, f } if (ginfo->pic1Texture) { - dc.GetThin3DContext()->SetTexture(0, ginfo->pic1Texture); + dc.GetThin3DContext()->BindTexture(0, ginfo->pic1Texture); } else if (ginfo->pic0Texture) { - dc.GetThin3DContext()->SetTexture(0, ginfo->pic0Texture); + dc.GetThin3DContext()->BindTexture(0, ginfo->pic0Texture); } uint32_t color = whiteAlpha(ease(progress)) & 0xFFc0c0c0; diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 3f6d2a3ddd..e13986496d 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -110,11 +110,11 @@ void DrawGameBackground(UIContext &dc, const std::string &gamePath) { bool hasPic = false; double loadTime; if (ginfo->pic1Texture) { - dc.GetThin3DContext()->SetTexture(0, ginfo->pic1Texture); + dc.GetThin3DContext()->BindTexture(0, ginfo->pic1Texture); loadTime = ginfo->timePic1WasLoaded; hasPic = true; } else if (ginfo->pic0Texture) { - dc.GetThin3DContext()->SetTexture(0, ginfo->pic0Texture); + dc.GetThin3DContext()->BindTexture(0, ginfo->pic0Texture); loadTime = ginfo->timePic0WasLoaded; hasPic = true; } diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index f2e7cacfe4..444d32f24b 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -91,7 +91,7 @@ void AsyncImageFileView::Draw(UIContext &dc) { // TODO: involve sizemode if (texture_) { dc.Flush(); - dc.GetThin3DContext()->SetTexture(0, texture_); + dc.GetThin3DContext()->BindTexture(0, texture_); dc.Draw()->Rect(bounds_.x, bounds_.y, bounds_.w, bounds_.h, color_); dc.Flush(); dc.RebindTexture(); diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 75ee3974b5..83c44c61f8 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -229,7 +229,7 @@ void SavedataButton::Draw(UIContext &dc) { if (texture) { dc.Draw()->Flush(); - dc.GetThin3DContext()->SetTexture(0, texture); + dc.GetThin3DContext()->BindTexture(0, texture); dc.Draw()->DrawTexRect(x, y, x + w, y + h, 0, 0, 1, 1, color); dc.Draw()->Flush(); } diff --git a/UI/Store.cpp b/UI/Store.cpp index ada2d85426..a96d113e43 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -155,7 +155,7 @@ void HttpImageFileView::Draw(UIContext &dc) { // TODO: involve sizemode if (texture_) { dc.Flush(); - dc.GetThin3DContext()->SetTexture(0, texture_); + dc.GetThin3DContext()->BindTexture(0, texture_); dc.Draw()->Rect(bounds_.x, bounds_.y, bounds_.w, bounds_.h, color_); dc.Flush(); dc.RebindTexture(); diff --git a/ext/native/gfx_es2/draw_text.cpp b/ext/native/gfx_es2/draw_text.cpp index 90bb28278a..5be22cf555 100644 --- a/ext/native/gfx_es2/draw_text.cpp +++ b/ext/native/gfx_es2/draw_text.cpp @@ -287,7 +287,7 @@ void TextDrawer::DrawString(DrawBuffer &target, const char *str, float x, float cache_[entryHash] = entry; } - thin3d_->SetTexture(0, entry->texture); + thin3d_->BindTexture(0, entry->texture); // Okay, the texture is bound, let's draw. float w = entry->bmWidth * fontScaleX_; @@ -398,7 +398,7 @@ void TextDrawer::DrawString(DrawBuffer &target, const char *str, float x, float if (iter != cache_.end()) { entry = iter->second; entry->lastUsedFrame = frameCount_; - thin3d_->SetTexture(0, entry->texture); + thin3d_->BindTexture(0, entry->texture); } else { QFont *font = fontMap_.find(fontHash_)->second; QFontMetrics fm(*font); diff --git a/ext/native/thin3d/thin3d.h b/ext/native/thin3d/thin3d.h index b904b1405d..f8eab5011b 100644 --- a/ext/native/thin3d/thin3d.h +++ b/ext/native/thin3d/thin3d.h @@ -382,10 +382,10 @@ public: virtual void SetSamplerStates(int start, int count, Thin3DSamplerState **state) = 0; virtual void SetDepthStencilState(Thin3DDepthStencilState *state) = 0; virtual void SetRasterState(Thin3DRasterState *state) = 0; - virtual void SetTextures(int start, int count, Thin3DTexture **textures) = 0; - void SetTexture(int stage, Thin3DTexture *texture) { - SetTextures(stage, 1, &texture); + virtual void BindTextures(int start, int count, Thin3DTexture **textures) = 0; + void BindTexture(int stage, Thin3DTexture *texture) { + BindTextures(stage, 1, &texture); } // from sampler 0 and upwards // Raster state diff --git a/ext/native/thin3d/thin3d_d3d9.cpp b/ext/native/thin3d/thin3d_d3d9.cpp index 738f54df60..6011796e5c 100644 --- a/ext/native/thin3d/thin3d_d3d9.cpp +++ b/ext/native/thin3d/thin3d_d3d9.cpp @@ -467,7 +467,7 @@ public: bs->Apply(device_); } - void SetTextures(int start, int count, Thin3DTexture **textures); + void BindTextures(int start, int count, Thin3DTexture **textures); // Raster state void SetScissorEnabled(bool enable); @@ -603,7 +603,7 @@ Thin3DTexture *Thin3DDX9Context::CreateTexture(T3DTextureType type, T3DDataForma return tex; } -void Thin3DDX9Context::SetTextures(int start, int count, Thin3DTexture **textures) { +void Thin3DDX9Context::BindTextures(int start, int count, Thin3DTexture **textures) { for (int i = start; i < start + count; i++) { Thin3DDX9Texture *tex = static_cast(textures[i - start]); tex->SetToSampler(device_, i); diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index b28d15ecc0..083173dddb 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -447,7 +447,7 @@ public: #endif } - void SetTextures(int start, int count, Thin3DTexture **textures) override; + void BindTextures(int start, int count, Thin3DTexture **textures) override; // TODO: Add more sophisticated draws. void Draw(T3DPrimitive prim, Thin3DShaderSet *shaderSet, Thin3DVertexFormat *format, Thin3DBuffer *vdata, int vertexCount, int offset) override; @@ -794,7 +794,7 @@ Thin3DShaderSet *Thin3DGLContext::CreateShaderSet(Thin3DShader *vshader, Thin3DS } } -void Thin3DGLContext::SetTextures(int start, int count, Thin3DTexture **textures) { +void Thin3DGLContext::BindTextures(int start, int count, Thin3DTexture **textures) { for (int i = start; i < start + count; i++) { Thin3DGLTexture *glTex = static_cast(textures[i]); glActiveTexture(GL_TEXTURE0 + i); diff --git a/ext/native/thin3d/thin3d_vulkan.cpp b/ext/native/thin3d/thin3d_vulkan.cpp index 2f9206a8ce..a5918f07e5 100644 --- a/ext/native/thin3d/thin3d_vulkan.cpp +++ b/ext/native/thin3d/thin3d_vulkan.cpp @@ -419,7 +419,7 @@ public: void SetViewports(int count, T3DViewport *viewports) override; - void SetTextures(int start, int count, Thin3DTexture **textures) override; + void BindTextures(int start, int count, Thin3DTexture **textures) override; void SetSamplerStates(int start, int count, Thin3DSamplerState **state) override; @@ -1018,7 +1018,7 @@ Thin3DShaderSet *Thin3DVKContext::CreateShaderSet(Thin3DShader *vshader, Thin3DS } } -void Thin3DVKContext::SetTextures(int start, int count, Thin3DTexture **textures) { +void Thin3DVKContext::BindTextures(int start, int count, Thin3DTexture **textures) { for (int i = start; i < start + count; i++) { boundTextures_[i] = static_cast(textures[i]); } diff --git a/ext/native/ui/ui_context.cpp b/ext/native/ui/ui_context.cpp index 5417e2b969..5978aa3955 100644 --- a/ext/native/ui/ui_context.cpp +++ b/ext/native/ui/ui_context.cpp @@ -47,7 +47,7 @@ void UIContext::Begin() { thin3d_->SetSamplerStates(0, 1, &sampler_); thin3d_->SetDepthStencilState(depth_); thin3d_->SetRasterState(rasterNoCull_); - thin3d_->SetTexture(0, uitexture_); + thin3d_->BindTexture(0, uitexture_); thin3d_->SetScissorEnabled(false); UIBegin(uishader_); } @@ -61,7 +61,7 @@ void UIContext::BeginNoTex() { } void UIContext::RebindTexture() const { - thin3d_->SetTexture(0, uitexture_); + thin3d_->BindTexture(0, uitexture_); } void UIContext::Flush() { diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index 752fb9cebc..f0a8230935 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -713,7 +713,7 @@ void Thin3DTextureView::Draw(UIContext &dc) { // TODO: involve sizemode if (texture_) { dc.Flush(); - dc.GetThin3DContext()->SetTexture(0, texture_); + dc.GetThin3DContext()->BindTexture(0, texture_); dc.Draw()->Rect(bounds_.x, bounds_.y, bounds_.w, bounds_.h, color_); dc.Flush(); dc.RebindTexture();