mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
Changed the names of methods for applying HUD scale
This commit is contained in:
parent
36f188611c
commit
ef29878039
@ -232,7 +232,7 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
|
||||
1.0f // Note: Alpha is not controlled by blip
|
||||
);
|
||||
|
||||
drawBlip(blippos, view, mi, colour, blip.size * otherBlipsScalingFactor * 2.0f);
|
||||
drawBlip(blippos, view, mi, colour, blip.size * hudScale * 2.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,8 +290,8 @@ void MapRenderer::drawBlip(const glm::vec2& coord, const glm::mat4& view,
|
||||
glDrawArrays(GL_LINE_LOOP, 0, 4);
|
||||
}
|
||||
|
||||
void MapRenderer::setHUDScale(const float scale) {
|
||||
void MapRenderer::scaleHUD(const float scale) {
|
||||
defaultBlipSize *= scale;
|
||||
radarNorthBlipSize *= scale;
|
||||
otherBlipsScalingFactor = scale;
|
||||
hudScale = scale;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
MapRenderer(std::shared_ptr<Renderer> renderer, GameData* data);
|
||||
|
||||
void draw(GameWorld* world, const MapInfo& mi);
|
||||
void setHUDScale(const float scale);
|
||||
void scaleHUD(const float scale);
|
||||
|
||||
private:
|
||||
GameData* data;
|
||||
@ -53,7 +53,7 @@ private:
|
||||
|
||||
float radarNorthBlipSize = 24.f;
|
||||
float defaultBlipSize = 18.f;
|
||||
float otherBlipsScalingFactor = 1.f;
|
||||
float hudScale = 1.f;
|
||||
|
||||
std::unique_ptr<Renderer::ShaderProgram> rectProg;
|
||||
|
||||
|
@ -345,7 +345,7 @@ void drawOnScreenText(GameWorld* world, GameRenderer* renderer) {
|
||||
}
|
||||
}
|
||||
|
||||
void setHUDScale(const float scale) {
|
||||
void scaleHUD(const float scale) {
|
||||
hudScale = scale;
|
||||
final_ui_textSize = ui_textSize * scale;
|
||||
final_ui_textHeight = ui_textHeight * scale;
|
||||
|
@ -10,6 +10,6 @@ void drawHUD(ViewCamera& currentView, PlayerController* player,
|
||||
|
||||
void drawOnScreenText(GameWorld* world, GameRenderer* renderer);
|
||||
|
||||
void setHUDScale(const float scale);
|
||||
void scaleHUD(const float scale);
|
||||
|
||||
#endif
|
||||
|
@ -75,6 +75,9 @@ RWGame::RWGame(Logger& log, int argc, char* argv[])
|
||||
renderer.text.setFontTexture(FONT_PRICEDOWN, "font1");
|
||||
renderer.text.setFontTexture(FONT_ARIAL, "font2");
|
||||
|
||||
scaleHUD(config.getHUDScale());
|
||||
renderer.map.scaleHUD(config.getHUDScale());
|
||||
|
||||
debug.setDebugMode(btIDebugDraw::DBG_DrawWireframe |
|
||||
btIDebugDraw::DBG_DrawConstraints |
|
||||
btIDebugDraw::DBG_DrawConstraintLimits);
|
||||
@ -108,9 +111,6 @@ RWGame::RWGame(Logger& log, int argc, char* argv[])
|
||||
}
|
||||
});
|
||||
|
||||
setHUDScale(config.getHUDScale());
|
||||
renderer.map.setHUDScale(config.getHUDScale());
|
||||
|
||||
log.info("Game", "Started");
|
||||
RW_TIMELINE_LEAVE("Startup");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user