mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-21 14:41:39 +00:00
Rename SetTextures to BindTextures
This commit is contained in:
parent
1c0c755b03
commit
97d029972e
@ -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] = {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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<Thin3DDX9Texture *>(textures[i - start]);
|
||||
tex->SetToSampler(device_, i);
|
||||
|
@ -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<Thin3DGLTexture *>(textures[i]);
|
||||
glActiveTexture(GL_TEXTURE0 + i);
|
||||
|
@ -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<Thin3DVKTexture *>(textures[i]);
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user