mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
graphics optimization feature inspirated by diablo3 engine
* the rendering now consits of two panes - the background pane (for animated stuff like the map) - the foreground pane (for steady stuff, like UI) each pane has it own max FPS and works idependently this may increase graphics performance on many platforms
This commit is contained in:
@@ -13,20 +13,60 @@ Panel
|
||||
!text: tr('Fullscreen')
|
||||
|
||||
Label
|
||||
!text: tr('Frame rate limit')
|
||||
id: backgroundFrameRateLimitLabel
|
||||
!text: tr('Background pane framerate limit: %s', 'max')
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 6
|
||||
|
||||
HorizontalScrollBar
|
||||
id: frameRateScrollBar
|
||||
id: backgroundFrameRateScrollBar
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 3
|
||||
minimum: 0
|
||||
maximum: 50
|
||||
value: 0
|
||||
minimum: 10
|
||||
maximum: 201
|
||||
value: 201
|
||||
step: 1
|
||||
@onValueChange: g_app.setFrameSleep(self:getValue())
|
||||
@onValueChange: |
|
||||
local value = self:getValue()
|
||||
local text = value
|
||||
if value == self:getMaximum() then
|
||||
text = 'max'
|
||||
value = 0
|
||||
end
|
||||
|
||||
self:getParent():getChildById('backgroundFrameRateLimitLabel'):setText(tr('Background pane framerate limit: %s', text))
|
||||
g_app.setBackgroundPaneMaxFps(value)
|
||||
|
||||
Label
|
||||
id: foregroundFrameRateLimitLabel
|
||||
!text: tr('Foreground pane framerate limit: %s', '8')
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 6
|
||||
|
||||
HorizontalScrollBar
|
||||
id: foregroundFrameRateScrollBar
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 3
|
||||
minimum: 1
|
||||
maximum: 61
|
||||
value: 8
|
||||
step: 1
|
||||
@onValueChange: |
|
||||
local value = self:getValue()
|
||||
local text = value
|
||||
if value == self:getMaximum() then
|
||||
text = 'max'
|
||||
value = 0
|
||||
end
|
||||
|
||||
self:getParent():getChildById('foregroundFrameRateLimitLabel'):setText(tr('Foreground pane framerate limit: %s', text))
|
||||
g_app.setForegroundPaneMaxFps(value)
|
||||
|
||||
|
Reference in New Issue
Block a user