1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

Changed the names of methods for applying HUD scale

This commit is contained in:
Petar Kukolj 2018-10-27 03:01:14 +02:00 committed by Filip Gawin
parent 36f188611c
commit ef29878039
5 changed files with 10 additions and 10 deletions

View File

@ -232,7 +232,7 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
1.0f // Note: Alpha is not controlled by blip 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); glDrawArrays(GL_LINE_LOOP, 0, 4);
} }
void MapRenderer::setHUDScale(const float scale) { void MapRenderer::scaleHUD(const float scale) {
defaultBlipSize *= scale; defaultBlipSize *= scale;
radarNorthBlipSize *= scale; radarNorthBlipSize *= scale;
otherBlipsScalingFactor = scale; hudScale = scale;
} }

View File

@ -39,7 +39,7 @@ public:
MapRenderer(std::shared_ptr<Renderer> renderer, GameData* data); MapRenderer(std::shared_ptr<Renderer> renderer, GameData* data);
void draw(GameWorld* world, const MapInfo& mi); void draw(GameWorld* world, const MapInfo& mi);
void setHUDScale(const float scale); void scaleHUD(const float scale);
private: private:
GameData* data; GameData* data;
@ -53,7 +53,7 @@ private:
float radarNorthBlipSize = 24.f; float radarNorthBlipSize = 24.f;
float defaultBlipSize = 18.f; float defaultBlipSize = 18.f;
float otherBlipsScalingFactor = 1.f; float hudScale = 1.f;
std::unique_ptr<Renderer::ShaderProgram> rectProg; std::unique_ptr<Renderer::ShaderProgram> rectProg;

View File

@ -345,7 +345,7 @@ void drawOnScreenText(GameWorld* world, GameRenderer* renderer) {
} }
} }
void setHUDScale(const float scale) { void scaleHUD(const float scale) {
hudScale = scale; hudScale = scale;
final_ui_textSize = ui_textSize * scale; final_ui_textSize = ui_textSize * scale;
final_ui_textHeight = ui_textHeight * scale; final_ui_textHeight = ui_textHeight * scale;

View File

@ -10,6 +10,6 @@ void drawHUD(ViewCamera& currentView, PlayerController* player,
void drawOnScreenText(GameWorld* world, GameRenderer* renderer); void drawOnScreenText(GameWorld* world, GameRenderer* renderer);
void setHUDScale(const float scale); void scaleHUD(const float scale);
#endif #endif

View File

@ -75,6 +75,9 @@ RWGame::RWGame(Logger& log, int argc, char* argv[])
renderer.text.setFontTexture(FONT_PRICEDOWN, "font1"); renderer.text.setFontTexture(FONT_PRICEDOWN, "font1");
renderer.text.setFontTexture(FONT_ARIAL, "font2"); renderer.text.setFontTexture(FONT_ARIAL, "font2");
scaleHUD(config.getHUDScale());
renderer.map.scaleHUD(config.getHUDScale());
debug.setDebugMode(btIDebugDraw::DBG_DrawWireframe | debug.setDebugMode(btIDebugDraw::DBG_DrawWireframe |
btIDebugDraw::DBG_DrawConstraints | btIDebugDraw::DBG_DrawConstraints |
btIDebugDraw::DBG_DrawConstraintLimits); 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"); log.info("Game", "Started");
RW_TIMELINE_LEAVE("Startup"); RW_TIMELINE_LEAVE("Startup");
} }