This commit is contained in:
konstin 2014-06-21 16:20:53 +02:00
commit f4ce845b6f
146 changed files with 2366 additions and 2555 deletions

BIN
data/fonts/BigDigitFont.xml Normal file → Executable file

Binary file not shown.

BIN
data/fonts/sigmar0.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!-- For sky particles, the size of the box is ignored -->
<particles emitter="box" box_x="0.1" box_y="0.5" box_z="0.1">
<spreading angle="30" />
<velocity x="-0.000"
y="0.002"
z="-0.000" />
<material file="gfx_sparkFire_a.png" clampu="Y" clampv="Y" />
<!-- Amount of particles emitted per second -->
<rate min="20"
max="50" />
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
<lifetime min="3000"
max="3000" />
<!-- Size of the particles -->
<size min="0.2"
max="0.3" />
<color min="40 40 255"
max="255 255 255" />
<!-- How much time in milliseconds before the particle is fully faded out -->
<fadeout time="100" />
<wind speed="0.16"
flips="Y" />
</particles>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row">
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row">
<div x="5%" y="0%" width="90%" proportion="6" layout="horizontal-row" >
@ -41,5 +41,5 @@
</buttonbar>
<progressbar id="progress" x="0" y="20%" width="100%" height="30%" />
</div>
</div>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0%" y="0%" width="100%" height="98%" layout="vertical-row" >
<div x="0%" y="0%" width="100%" height="98%" layout="vertical-row" >
<div x="0" y="0" width="100%" layout="horizontal-row" height="8%">
<icon-button id="back" height="100%" icon="gui/back.png"/>
@ -35,6 +35,5 @@
<list id="list_addons" x="0" y="0" width="100%" height="100%"/>
</box>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="80%" I18N="Section in arena tracks selection screen" text="Arenas"
align="center" text_align="center" />
@ -23,6 +23,5 @@
<spacer width="20" height="3%" />
</div>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" >

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="center" word_wrap="true" proportion="1" />
<spacer height="25" width="10" />
@ -13,7 +12,5 @@
<button id="cancel" I18N="In a 'are you sure?' dialog" text="Cancel" align="center"/>
<spacer height="10" width="10" />
</div>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="center" word_wrap="true" proportion="1" />
<spacer height="25" width="10" />
@ -15,7 +14,5 @@
text="Cancel" align="center"/>
<spacer height="10" width="10" />
</div>
</div>
</stkgui>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="98%" height="96%" layout="vertical-row" >
@ -10,9 +9,6 @@
<header I18N="Title in credits screen" text="Credits" width="100%" />
<box id="animated_area" width="100%" proportion="10" padding="0">
</box>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<header id="title" width="100%" height="fit" text_align="center" word_wrap="true" text="Graphics Settings" />
<spacer height="20" width="10" />
@ -185,6 +184,5 @@
<spacer proportion="1"/>
<button id="close" text="Apply" align="center"/>
</div>
</div>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%"/>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="80%" I18N="Section in easter egg tracks selection screen" text="All Tracks"
align="center" text_align="center" />
@ -23,6 +23,5 @@
<spacer width="20" height="3%" />
</div>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" padding="10">
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" padding="10">
<header id="selected_track" width="80%" height="30"
I18N="No neeed to translate this, it will be overwritten by the track name"
@ -49,6 +49,5 @@
<spacer proportion="2" />
</div>
</div>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="center" word_wrap="true"
I18N="In the 'add new grand prix' dialog"
@ -16,6 +16,5 @@
<spacer height="15" width="20" />
</div>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="center" word_wrap="true"
I18N="In the 'add new player' dialog" text="Enter the new player's name" proportion="1" />
@ -17,6 +17,5 @@
</buttonbar>
<spacer height="15" width="20" />
</div>
</div>
</stkgui>

View File

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row">
<spacer width="10" proportion="1"/>
<button id="continue" x="20" width="250" align="left" text="Continue"/>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png" />
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png" />
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row">
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row">
<header id="title" width="80%" I18N="Title in edit grand prix screen"
text="Edit Grand Prix" align="center" text_align="center" />
@ -29,7 +29,5 @@
<icon-button id="save" width="128" height="128" icon="gui/gp_save.png"
I18N="Menu item" text="Save" />
</buttonbar>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<header width="80%" I18N="Title in grand prix editor screen" text="Grand Prix editor"
align="center" text_align="center" />
@ -40,6 +40,5 @@
I18N="Menu item" text="Rename" />
</buttonbar>
</div>
</div>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row">
<spacer width="10" proportion="1"/>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row">
<spacer width="10" proportion="1"/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="99%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="99%" layout="vertical-row" >
<header width="80%"
I18N="In the kart selection (player setup) screen"
@ -22,8 +22,7 @@
<tabs width="98%" x="1%" height="25" id="kartgroups">
</tabs>
<spacer width="100%" height="2%"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="99%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="99%" layout="vertical-row" >
<header width="80%"
I18N="In the kart selection (player setup) screen"
@ -22,8 +22,7 @@
<tabs width="98%" x="1%" height="25" id="kartgroups">
</tabs>
<spacer width="100%" height="2%"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
<icon id="logo" align="center" proportion="5" width="100%" icon="gui/logo.png"/>
<buttonbar id="menu_toprow" proportion="3" width="90%" align="center">
@ -49,9 +48,6 @@
<icon-button id="quit" width="64" height="64" icon="gui/main_quit.png" extend_label="50"
I18N="Main menu button" text="Quit" label_location="hover"/>
</buttonbar>
</bottombar>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
@ -40,8 +40,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="In the change password dialog" text="Close" label_location="bottom"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
@ -30,7 +31,5 @@
</div>
</box>
<spacer height="15" width="10"/>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-16"?>
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header align="center" width="80%" text="Login" text_align="center"/>
<spacer height="15" width="10"/>
@ -23,8 +22,8 @@
<div x="2%" y="2%" width="96%" height="80%" layout="vertical-row" id="outer_box" >
<label I18N="In the online multiplayer screen" proportion="4" word_wrap="true" text=
"Signing in as a guest allows you to participate in online races,
but it does not allow you to vote for addons,
or collect any achievements while being online."
but it does not allow you to vote for addons,
or collect any achievements while being online."
align="center"/>
</div>
</box>
@ -37,8 +36,7 @@ or collect any achievements while being online."
</buttonbar>
<spacer height="15" width="10"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
@ -47,5 +48,4 @@
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" I18N="In the lobby settings screen" text="Lobby Settings"/>
<spacer height="15" width="10"/>
<box proportion="4" width="90%" layout="vertical-row" align="center">
@ -28,5 +28,4 @@
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
@ -43,5 +44,4 @@
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="85%" layout="vertical-row" >
<label id="info" proportion="1" width="90%" align="center" text_align="center" word_wrap="true" text=""/>
@ -12,8 +12,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="User info dialog" text="Close" label_location="bottom"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="..."/>
@ -18,6 +18,5 @@
<box proportion="1" width="100%" layout="vertical-row" padding="6">
<list id="achievements_list" x="0" y="0" width="100%" height="100%"/>
</box>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="..."/>
@ -31,7 +31,5 @@
</div>
</box>
</div>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="..."/>
@ -20,6 +20,5 @@
</div>
</box>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="..."/>
@ -24,6 +24,5 @@
</div>
</div>
</box>
</div>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
@ -16,8 +16,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/green_check.png"
I18N="Registration dialog" text="Close" label_location="none"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
@ -40,7 +40,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="Registration dialog" text="Cancel" label_location="none"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-16"?>
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header align="center" width="80%" text="Create User" text_align="center"
I18N="In the registration dialog" />
@ -75,8 +74,7 @@
I18N="Registration dialog" text="Cancel" label_location="none"/>
</buttonbar>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="4%" width="96%" height="92%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
@ -29,8 +29,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="Registration dialog" text="Cancel" label_location="bottom"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="85%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
@ -26,8 +26,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="Login dialog" text="Cancel" label_location="bottom"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0%" y="0%" width="100%" height="98%" layout="vertical-row" >
<div x="0%" y="0%" width="100%" height="98%" layout="vertical-row" >
<div x="0" y="0" width="100%" layout="horizontal-row" height="8%">
<icon-button id="back" height="100%" icon="gui/back.png"/>
@ -11,7 +11,5 @@
<box proportion="1" width="98%" align="center" layout="vertical-row" padding="6">
<list id="server_list" x="0" y="0" width="100%" height="100%"/>
</box>
</div>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="85%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
I18N="User info dialog' dialog" text="User Info"/>
@ -34,8 +33,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="User info dialog" text="Close" label_location="bottom"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="1%" y="0%" width="98%" height="99%" layout="vertical-row" >
<header text_align="center" height="fit" text="User search" align="center"/>
@ -17,8 +18,5 @@
<box proportion="1" width="100%" align="center" layout="vertical-row" padding="6">
<list id="user_list" x="0" y="0" width="100%" height="100%"/>
</box>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
<header id="title" width="96%" height="fit" text_align="center" word_wrap="true"
I18N="In the vote dialog' dialog" text="Vote"/>
@ -21,7 +20,5 @@
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
I18N="Vote dialog" text="Close" label_location="none"/>
</buttonbar>
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -63,8 +63,7 @@
<spacer height="20" width="10"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -43,8 +43,7 @@
<label id="conflict" proportion="1" text="" word_wrap="true" align="center"/>
</div>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -33,8 +33,7 @@
<label text="* Which config to use will be inferred from which 'fire' key is pressed to join the game."
proportion="2" word_wrap="true"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -45,8 +45,7 @@
<spacer width="20" height="15"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -56,8 +56,7 @@
<spacer height="18" width="4"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="SuperTuxKart Options"/>
<spacer height="15" width="10"/>
@ -77,8 +77,7 @@
<spacer height="15" width="4"/>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text_align="center" text="Paused" proportion="3" />
@ -29,5 +29,4 @@
<spacer width="20" height="35" />
</div>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="center" text="Press a key" proportion="1" />
@ -10,6 +10,5 @@
<spacer height="10" width="10" />
<button id="cancel" I18N="When configuring input" text="Press ESC to cancel" align="center"/>
</div>
</div>
</stkgui>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text_align="center" text="Paused" proportion="3" />
<!-- FIXME: some play in proportions occur below because the text of an icon
@ -35,5 +34,4 @@
<spacer width="20" height="35" />
</div>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="5%" width="100%" height="95%" layout="vertical-row" id="div">
<roundedbox width="90%" proportion="1" align="center">

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header width="80%" text="Race Setup" align="center" text_align="center" />
@ -36,8 +36,7 @@
<scrollable_toolbar id="gamemode" height="135" width="85%" label_location="bottom" align="center"
child_width="135" child_height="135" />
<spacer proportion="1" width="25" />
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="80%" text="Race Setup" align="center" text_align="center" />
@ -41,6 +41,5 @@
<spacer height="8%" width="1"/>
</div>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
@ -41,7 +41,5 @@
</div>
<button id="continue" I18N="In soccer setup screen" text="Continue" align="center" width="60%"/>
</div>
</stkgui>

View File

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="99%" height="99%">
<div x="1%" y="1%" width="99%" height="99%">
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row">
<label id="name" width="100%" text_align="center"/>
<spacer width="1" height="5%"/>
@ -72,6 +69,5 @@
</div>
<icon-button id="closePopup" x="0" y="0" width="8%" height="8%" icon="gui/back.png"/>
</div>
</div>
</stkgui>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="99%" layout="vertical-row" >
<header width="80%" I18N="Section in track selection screen" text="Grand Prix"
align="center" text_align="center" />
@ -26,6 +26,5 @@
<tabs width="100%" height="25" id="trackgroups"> </tabs>
<spacer width="100%" height="2%" />
</div>
</div>
</stkgui>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" >
@ -16,6 +16,4 @@
</div>
<button id="play" x="-200" y="-40" height="35" align="right" text="Play all"/>
</stkgui>

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" width="100%" text_align="left" word_wrap="true" proportion="1" />
<spacer height="10" width="10" />
<button id="continue" I18N="Button in tutorial" text="Continue" align="right"/>
</div>
</div>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
@ -61,6 +62,6 @@
</box>
<spacer width="20" height="15"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
@ -13,7 +14,7 @@
<icon-button id="tab_controls" width="128" height="128" icon="gui/options_input.png"/>
</tabs>
<box proportion="1" width="98%" layout="vertical-row">
<box proportion="1" width="100%" layout="vertical-row">
<spacer height="15" width="10"/>
@ -55,7 +56,7 @@
<label id="message" width="80%" align="center" text_align="left"/>
</div>
<spacer width="20" height="25"/>
<buttonbar id="options" width="90%" height="13%" align="bottom">
<buttonbar id="options" width="90%" height="13%" align="center">
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
I18N="Login dialog" text="OK" label_location="bottom"/>
<icon-button id="new_user" width="64" height="64" icon="gui/gp_add_track.png"
@ -68,8 +69,7 @@
I18N="Login dialog" text="Cancel" label_location="bottom"/>
</buttonbar>
</box>
<spacer width="20" height="15"/>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -12,6 +12,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{

View File

@ -12,6 +12,7 @@ uniform sampler3D SHB;
uniform float R_wcs = 10.;
uniform vec3 extents;
uniform mat4 RHMatrix;
uniform mat4 InvRHMatrix;
layout (std140) uniform MatrixesData
{
@ -55,7 +56,7 @@ void main()
if (depth==1.0) discard;
vec4 pos_screen_space = getPosFromUVDepth(vec3(uv, depth), InverseProjectionMatrix);
vec4 tmp = (inverse(RHMatrix) * InverseViewMatrix * pos_screen_space);
vec4 tmp = (InvRHMatrix * InverseViewMatrix * pos_screen_space);
vec3 pos = tmp.xyz / tmp.w;
vec3 normal_screen_space = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.));
vec3 normal = (transpose(ViewMatrix) * vec4(normal_screen_space, 0.)).xyz;

View File

@ -13,6 +13,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{

View File

@ -16,6 +16,7 @@ uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform mat4 ShadowViewProjMatrixes[4];
uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{

View File

@ -43,5 +43,12 @@ void main()
// Uncharted2 tonemap with Auria's custom coefficients
vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06);
perChannel = pow(perChannel, vec4(2.2));
FragColor = vec4(perChannel.xyz, col.a);
vec2 inside = uv - 0.5;
float vignette = 1 - dot(inside, inside);
vignette = clamp(pow(vignette, 0.8), 0., 1.);
//vignette = clamp(vignette + vignette - 0.5, 0., 1.15);
FragColor = vec4(perChannel.xyz * vignette, col.a);
}

View File

@ -109,7 +109,7 @@ inline int btGetVersion()
#ifdef __SPU__
#include <spu_printf.h>
#define printf spu_printf
#define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#define btAssert(x) {if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#else
#define btAssert assert
#endif

View File

@ -1,5 +1,5 @@
# Modify this file to change the last-modified date when you add/remove a file.
# This will then trigger a new cmake run automatically.
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")

View File

@ -22,6 +22,7 @@
#include "achievements/achievement_info.hpp"
#include "achievements/achievements_manager.hpp"
#include "config/player_manager.hpp"
#include "io/utf_writer.hpp"
#include "utils/log.hpp"
#include "utils/ptr_vector.hpp"
@ -112,14 +113,48 @@ Achievement * AchievementsStatus::getAchievement(uint32_t id)
} // getAchievement
// ----------------------------------------------------------------------------
/** Synchronises the achievements between local and online usage. It takes
* the list of online achievements, and marks them all to be achieved
* locally. Then it issues 'achieved' requests to the server for all local
* achievements that are not set online.
*/
void AchievementsStatus::sync(const std::vector<uint32_t> & achieved_ids)
{
std::vector<bool> done;
for(unsigned int i =0; i < achieved_ids.size(); ++i)
{
if(done.size()< achieved_ids[i]+1)
done.resize(achieved_ids[i]+1);
done[achieved_ids[i]] = true;
Achievement * achievement = getAchievement(achieved_ids[i]);
if(achievement != NULL)
achievement->setAchieved();
}
std::map<uint32_t, Achievement*>::iterator i;
// String to collect all local ids that are not synched
// to the online account
std::string ids;
for(i=m_achievements.begin(); i!=m_achievements.end(); i++)
{
unsigned int id = i->second->getID();
if(i->second->isAchieved() && (id>=done.size() || !done[id]) )
{
ids=ids+StringUtils::toString(id)+",";
}
}
if(ids.size()>0)
{
ids = ids.substr(0, ids.size() - 1); // delete the last "," in the string
Log::info("Achievements", "Synching achievement %d to server.",
ids.c_str());
Online::HTTPRequest * request = new Online::HTTPRequest(true, 2);
PlayerManager::setUserDetails(request, "achieving");
request->addParameter("achievementid", ids);
request->queue();
}
} // sync
// ----------------------------------------------------------------------------
@ -132,6 +167,7 @@ void AchievementsStatus::onRaceEnd()
}
} // onRaceEnd
// ----------------------------------------------------------------------------
void AchievementsStatus::onLapEnd()
{
//reset all values that need to be reset

View File

@ -69,6 +69,7 @@ protected:
public:
AnimationBase(const XMLNode &node);
AnimationBase(Ipo *ipo);
virtual ~AnimationBase() {}
virtual void update(float dt, Vec3 *xyz=NULL, Vec3 *hpr=NULL,
Vec3 *scale=NULL);
/** This needs to be implemented by the inheriting classes. It is called

View File

@ -166,16 +166,13 @@ PlayerManager::PlayerManager()
*/
PlayerManager::~PlayerManager()
{
// If the passwords should not be remembered, clear all saved sessions.
if(!UserConfigParams::m_remember_user)
{
// If the passwords should not be remembered, clear the saved session.
PlayerProfile *player;
for_in(player, m_all_players)
{
if(!player->rememberPassword())
player->clearSession();
}
}
save();
} // ~PlayerManager
@ -266,7 +263,7 @@ void PlayerManager::save()
players_file << L"<?xml version=\"1.0\"?>\n";
players_file << L"<players version=\"1\" >\n";
if(m_current_player && UserConfigParams::m_remember_user)
if(m_current_player)
{
players_file << L" <current player=\""
<< m_current_player->getName() << L"\"/>\n";

View File

@ -47,6 +47,7 @@ PlayerProfile::PlayerProfile(const core::stringw& name, bool is_guest)
m_saved_user_id = 0;
m_last_online_name = "";
m_last_was_online = false;
m_remember_password = false;
initRemainingData();
} // PlayerProfile
@ -72,19 +73,21 @@ PlayerProfile::PlayerProfile(const XMLNode* node)
m_saved_user_id = 0;
m_last_online_name = "";
m_last_was_online = false;
m_remember_password = false;
m_story_mode_status = NULL;
m_achievements_status = NULL;
m_icon_filename = "";
node->get("name", &m_local_name );
node->get("guest", &m_is_guest_account);
node->get("guest", &m_is_guest_account );
node->get("use-frequency", &m_use_frequency );
node->get("unique-id", &m_unique_id );
node->get("saved-session", &m_saved_session );
node->get("saved-user", &m_saved_user_id );
node->get("saved-token", &m_saved_token );
node->get("last-online-name", &m_last_online_name);
node->get("last-online-name", &m_last_online_name );
node->get("last-was-online", &m_last_was_online );
node->get("remember-password", &m_remember_password);
node->get("icon-filename", &m_icon_filename );
#ifdef DEBUG
@ -203,7 +206,8 @@ void PlayerProfile::save(UTFWriter &out)
out << L" saved-user=\"" << m_saved_user_id
<< L"\" saved-token=\"" << m_saved_token << L"\"\n";
out << L" last-online-name=\"" << m_last_online_name
<< L"\" last-was-online=\"" << m_last_was_online<< L"\">\n";
<< L"\" last-was-online=\"" << m_last_was_online << L"\"\n";
out << L" remember-password=\"" << m_remember_password << L"\">\n";
{
if(m_story_mode_status)
m_story_mode_status->save(out);

View File

@ -101,6 +101,9 @@ private:
/** True if the last time this player was used as online. */
bool m_last_was_online;
/** True if the login data are saved. */
bool m_remember_password;
/** The complete challenge state. */
StoryModeStatus *m_story_mode_status;
@ -212,7 +215,10 @@ public:
// ------------------------------------------------------------------------
bool isFirstTime() const { return m_story_mode_status->isFirstTime(); }
// ------------------------------------------------------------------------
void clearUnlocked() { m_story_mode_status->clearUnlocked(); }
void clearUnlocked()
{
m_story_mode_status->clearUnlocked();
}
// ------------------------------------------------------------------------
/** Returns the current challenge for this player. */
const ChallengeStatus* getCurrentChallengeStatus() const
@ -248,6 +254,8 @@ public:
/** Returns true if a session was saved for this player. */
bool hasSavedSession() const { return m_saved_session; }
// ------------------------------------------------------------------------
StoryModeStatus* getStoryModeStatus() { return m_story_mode_status; }
// ------------------------------------------------------------------------
/** If a session was saved, return the id of the saved user. */
int getSavedUserId() const
{
@ -269,6 +277,13 @@ public:
/** Sets if this player was logged in last time it was used. */
void setWasOnlineLastTime(bool b) { m_last_was_online = b; }
// ------------------------------------------------------------------------
/** Returns if the last time this player was used it was used online or
* offline. */
bool rememberPassword() const { return m_remember_password; }
// ------------------------------------------------------------------------
/** Sets if this player was logged in last time it was used. */
void setRememberPassword(bool b) { m_remember_password = b; }
// ------------------------------------------------------------------------
}; // class PlayerProfile
#endif

View File

@ -682,10 +682,6 @@ namespace UserConfigParams
// ---- User managerment
PARAM_PREFIX BoolUserConfigParam m_remember_user
PARAM_DEFAULT( BoolUserConfigParam(true, "remember_me",
"Automatically remember login data"));
PARAM_PREFIX BoolUserConfigParam m_always_show_login_screen
PARAM_DEFAULT( BoolUserConfigParam(false, "always_show_login_screen",
"Always show the login screen even if last player's session was saved."));

View File

@ -532,7 +532,7 @@ unsigned GPUTimer::elapsedTimeus()
FrameBuffer::FrameBuffer() {}
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h, bool layered) :
DepthTexture(0), RenderTargets(RTTs), width(w), height(h)
RenderTargets(RTTs), DepthTexture(0), width(w), height(h)
{
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
@ -551,7 +551,7 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h, bo
}
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w, size_t h, bool layered) :
DepthTexture(DS), RenderTargets(RTTs), width(w), height(h)
RenderTargets(RTTs), DepthTexture(DS), width(w), height(h)
{
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);

View File

@ -83,12 +83,16 @@ enum TypeFBO
FBO_COLORS,
FBO_LOG_LUMINANCE,
FBO_MLAA_COLORS,
FBO_MLAA_BLEND,
FBO_MLAA_TMP,
FBO_TMP1_WITH_DS,
FBO_TMP2_WITH_DS,
FBO_TMP4,
FBO_LINEAR_DEPTH,
FBO_HALF1,
FBO_HALF1_R,
FBO_HALF2,
FBO_HALF2_R,
FBO_QUARTER1,
FBO_QUARTER2,
FBO_EIGHTH1,
@ -123,6 +127,8 @@ enum QueryPerf
Q_BLOOM,
Q_TONEMAP,
Q_MOTIONBLUR,
Q_MLAA,
Q_GUI,
Q_LAST
};
@ -139,6 +145,8 @@ enum TypeRTT
RTT_HALF1,
RTT_HALF2,
RTT_HALF1_R,
RTT_HALF2_R,
RTT_QUARTER1,
RTT_QUARTER2,
@ -165,6 +173,8 @@ enum TypeRTT
RTT_DISPLACE,
RTT_MLAA_COLORS,
RTT_MLAA_BLEND,
RTT_MLAA_TMP,
RTT_BLOOM_1024,
RTT_BLOOM_512,

View File

@ -137,7 +137,7 @@ Material::Material(const XMLNode *node, int index, bool deprecated)
node->get("fog", &m_fog );
node->get("mask", &m_mask );
node->get("gloss-map", &m_gloss_map );
node->get("water-splash", &m_water_splash );
node->get("jump", &m_is_jump_texture );
node->get("has-gravity", &m_has_gravity );

View File

@ -224,6 +224,8 @@ private:
/** If m_splatting is true, indicates the fourth splatting texture */
std::string m_splatting_texture_4;
std::string m_gloss_map;
bool m_deprecated;
void init (unsigned int index);

View File

@ -244,6 +244,8 @@ void PostProcessing::renderDiffuseEnvMap(const float *bSHCoeff, const float *gSH
void PostProcessing::renderGI(const core::matrix4 &RHMatrix, const core::vector3df &rh_extend, GLuint shr, GLuint shg, GLuint shb)
{
core::matrix4 InvRHMatrix;
RHMatrix.getInverse(InvRHMatrix);
glDisable(GL_DEPTH_TEST);
glUseProgram(FullScreenShader::GlobalIlluminationReconstructionShader::Program);
glBindVertexArray(FullScreenShader::GlobalIlluminationReconstructionShader::vao);
@ -267,7 +269,7 @@ void PostProcessing::renderGI(const core::matrix4 &RHMatrix, const core::vector3
}
setTexture(3, irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), GL_NEAREST, GL_NEAREST);
setTexture(4, irr_driver->getDepthStencilTexture(), GL_NEAREST, GL_NEAREST);
FullScreenShader::GlobalIlluminationReconstructionShader::setUniforms(RHMatrix, rh_extend, 3, 4, 0, 1, 2);
FullScreenShader::GlobalIlluminationReconstructionShader::setUniforms(RHMatrix, InvRHMatrix, rh_extend, 3, 4, 0, 1, 2);
glDrawArrays(GL_TRIANGLES, 0, 3);
}
@ -400,7 +402,9 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
assert(in_fbo.getWidth() == auxiliary.getWidth() && in_fbo.getHeight() == auxiliary.getHeight());
float inv_width = 1.0f / in_fbo.getWidth(), inv_height = 1.0f / in_fbo.getHeight();
{
#if WIN32
if (irr_driver->getGLSLVersion() < 430)
#endif
{
auxiliary.Bind();
glUseProgram(FullScreenShader::Gaussian17TapHShader::Program);
@ -415,8 +419,10 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
glDrawArrays(GL_TRIANGLES, 0, 3);
}
#if WIN32
else
{
glUseProgram(FullScreenShader::ComputeGaussian17TapHShader::Program);
glBindImageTexture(0, in_fbo.getRTT()[0], 0, false, 0, GL_READ_ONLY, GL_R16F);
glBindImageTexture(1, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
@ -424,9 +430,12 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
glUniform1i(FullScreenShader::ComputeGaussian17TapHShader::uniform_dest, 1);
glDispatchCompute(in_fbo.getWidth() / 8, in_fbo.getHeight() / 8, 1);
}
#endif
}
{
#if WIN32
if (irr_driver->getGLSLVersion() < 430)
#endif
{
in_fbo.Bind();
glUseProgram(FullScreenShader::Gaussian17TapVShader::Program);
@ -441,6 +450,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
glDrawArrays(GL_TRIANGLES, 0, 3);
}
#if WIN32
else
{
glUseProgram(FullScreenShader::ComputeGaussian17TapVShader::Program);
@ -450,6 +460,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
glUniform1i(FullScreenShader::ComputeGaussian17TapVShader::uniform_dest, 1);
glDispatchCompute(in_fbo.getWidth() / 8, in_fbo.getHeight() / 8, 1);
}
#endif
}
}
@ -639,7 +650,7 @@ void PostProcessing::applyMLAA()
{
const core::vector2df &PIXEL_SIZE = core::vector2df(1.0f / UserConfigParams::m_width, 1.0f / UserConfigParams::m_height);
IVideoDriver *const drv = irr_driver->getVideoDriver();
irr_driver->getFBO(FBO_TMP1_WITH_DS).Bind();
irr_driver->getFBO(FBO_MLAA_TMP).Bind();
glEnable(GL_STENCIL_TEST);
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
@ -658,11 +669,11 @@ void PostProcessing::applyMLAA()
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
// Pass 2: blend weights
irr_driver->getFBO(FBO_TMP2_WITH_DS).Bind();
irr_driver->getFBO(FBO_MLAA_BLEND).Bind();
glClear(GL_COLOR_BUFFER_BIT);
glUseProgram(FullScreenShader::MLAABlendWeightSHader::Program);
setTexture(0, irr_driver->getRenderTargetTexture(RTT_TMP1), GL_LINEAR, GL_LINEAR);
setTexture(0, irr_driver->getRenderTargetTexture(RTT_MLAA_TMP), GL_LINEAR, GL_LINEAR);
setTexture(1, getTextureGLuint(m_areamap), GL_NEAREST, GL_NEAREST);
FullScreenShader::MLAABlendWeightSHader::setUniforms(PIXEL_SIZE, 0, 1);
@ -670,14 +681,14 @@ void PostProcessing::applyMLAA()
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
// Blit in to tmp1
FrameBuffer::Blit(irr_driver->getFBO(FBO_MLAA_COLORS), irr_driver->getFBO(FBO_TMP1_WITH_DS));
FrameBuffer::Blit(irr_driver->getFBO(FBO_MLAA_COLORS), irr_driver->getFBO(FBO_MLAA_TMP));
// Pass 3: gather
irr_driver->getFBO(FBO_MLAA_COLORS).Bind();
glUseProgram(FullScreenShader::MLAAGatherSHader::Program);
setTexture(0, irr_driver->getRenderTargetTexture(RTT_TMP1), GL_NEAREST, GL_NEAREST);
setTexture(1, irr_driver->getRenderTargetTexture(RTT_TMP2), GL_NEAREST, GL_NEAREST);
setTexture(0, irr_driver->getRenderTargetTexture(RTT_MLAA_TMP), GL_NEAREST, GL_NEAREST);
setTexture(1, irr_driver->getRenderTargetTexture(RTT_MLAA_BLEND), GL_NEAREST, GL_NEAREST);
FullScreenShader::MLAAGatherSHader::setUniforms(PIXEL_SIZE, 0, 1);
glBindVertexArray(FullScreenShader::MLAAGatherSHader::vao);
@ -685,7 +696,6 @@ void PostProcessing::applyMLAA()
// Done.
glDisable(GL_STENCIL_TEST);
}
// ----------------------------------------------------------------------------
@ -850,17 +860,19 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode)
PROFILER_POP_CPU_MARKER();
}
if (UserConfigParams::m_mlaa) // MLAA. Must be the last pp filter.
{
PROFILER_PUSH_CPU_MARKER("- MLAA", 0xFF, 0x00, 0x00);
glEnable(GL_FRAMEBUFFER_SRGB);
irr_driver->getFBO(FBO_MLAA_COLORS).Bind();
renderPassThrough(in_fbo->getRTT()[0]);
glDisable(GL_FRAMEBUFFER_SRGB);
applyMLAA();
out_fbo = &irr_driver->getFBO(FBO_MLAA_COLORS);
if (UserConfigParams::m_mlaa) // MLAA. Must be the last pp filter.
{
PROFILER_PUSH_CPU_MARKER("- MLAA", 0xFF, 0x00, 0x00);
ScopedGPUTimer Timer(irr_driver->getGPUTimer(Q_MLAA));
applyMLAA();
PROFILER_POP_CPU_MARKER();
}
glDisable(GL_FRAMEBUFFER_SRGB);
return out_fbo;
} // render

View File

@ -187,13 +187,10 @@ void IrrDriver::renderGLSL(float dt)
{
FrameBuffer *fbo = m_post_processing->render(camnode);
if (!UserConfigParams::m_mlaa) // MLAA_COLORS already in srgb space
glEnable(GL_FRAMEBUFFER_SRGB);
if (irr_driver->getNormals())
irr_driver->getFBO(FBO_NORMAL_AND_DEPTHS).BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y);
else if (irr_driver->getSSAOViz())
irr_driver->getFBO(FBO_SSAO).BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y);
irr_driver->getFBO(FBO_HALF1_R).BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y);
else if (irr_driver->getRSM())
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
@ -202,9 +199,6 @@ void IrrDriver::renderGLSL(float dt)
}
else
fbo->BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y);
if (!UserConfigParams::m_mlaa)
glDisable(GL_FRAMEBUFFER_SRGB);
}
else
glDisable(GL_FRAMEBUFFER_SRGB);
@ -235,10 +229,13 @@ void IrrDriver::renderGLSL(float dt)
PROFILER_POP_CPU_MARKER();
} // for i<getNumKarts
{
ScopedGPUTimer Timer(getGPUTimer(Q_GUI));
PROFILER_PUSH_CPU_MARKER("GUIEngine", 0x75, 0x75, 0x75);
// Either render the gui, or the global elements of the race gui.
GUIEngine::render(dt);
PROFILER_POP_CPU_MARKER();
}
// Render the profiler
if(UserConfigParams::m_profiler_enabled)
@ -600,7 +597,7 @@ void IrrDriver::renderSolidSecondPass()
GroupedSM<SM_UNTEXTURED>::reset();
setTexture(0, m_rtts->getRenderTarget(RTT_TMP1), GL_NEAREST, GL_NEAREST);
setTexture(1, m_rtts->getRenderTarget(RTT_TMP2), GL_NEAREST, GL_NEAREST);
setTexture(2, m_rtts->getRenderTarget(RTT_SSAO), GL_NEAREST, GL_NEAREST);
setTexture(2, m_rtts->getRenderTarget(RTT_HALF1_R), GL_LINEAR, GL_LINEAR);
{
@ -651,7 +648,30 @@ void IrrDriver::renderTransparent()
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
glDisable(GL_CULL_FACE);
TransparentMeshes<TM_DEFAULT>::reset();
TransparentMeshes<TM_ADDITIVE>::reset();
m_scene_manager->drawAll(scene::ESNRP_TRANSPARENT);
if (World::getWorld() && World::getWorld()->isFogEnabled())
{
glUseProgram(MeshShader::TransparentFogShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for (unsigned i = 0; i < TransparentMeshes<TM_DEFAULT>::MeshSet.size(); i++)
drawTransparentFogObject(*TransparentMeshes<TM_DEFAULT>::MeshSet[i], TransparentMeshes<TM_DEFAULT>::MVPSet[i], TransparentMeshes<TM_DEFAULT>::MeshSet[i]->TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for (unsigned i = 0; i < TransparentMeshes<TM_ADDITIVE>::MeshSet.size(); i++)
drawTransparentFogObject(*TransparentMeshes<TM_ADDITIVE>::MeshSet[i], TransparentMeshes<TM_ADDITIVE>::MVPSet[i], TransparentMeshes<TM_ADDITIVE>::MeshSet[i]->TextureMatrix);
}
else
{
glUseProgram(MeshShader::TransparentShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for (unsigned i = 0; i < TransparentMeshes<TM_DEFAULT>::MeshSet.size(); i++)
drawTransparentObject(*TransparentMeshes<TM_DEFAULT>::MeshSet[i], TransparentMeshes<TM_DEFAULT>::MVPSet[i], TransparentMeshes<TM_DEFAULT>::MeshSet[i]->TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for (unsigned i = 0; i < TransparentMeshes<TM_ADDITIVE>::MeshSet.size(); i++)
drawTransparentObject(*TransparentMeshes<TM_ADDITIVE>::MeshSet[i], TransparentMeshes<TM_ADDITIVE>::MVPSet[i], TransparentMeshes<TM_ADDITIVE>::MeshSet[i]->TextureMatrix);
}
}
void IrrDriver::renderParticles()
@ -1020,7 +1040,7 @@ void IrrDriver::renderLights(unsigned pointlightcount)
}
m_rtts->getFBO(FBO_COMBINED_TMP1_TMP2).Bind();
if (World::getWorld() && World::getWorld()->getTrack()->hasShadows() && SkyboxCubeMap && UserConfigParams::m_gi)
if (World::getWorld() && World::getWorld()->getTrack()->hasShadows() && SkyboxCubeMap)
irr_driver->getSceneManager()->setAmbientLight(SColor(0, 0, 0, 0));
// Render sunlight if and only if track supports shadow
@ -1045,7 +1065,9 @@ void IrrDriver::renderSSAO()
glClear(GL_COLOR_BUFFER_BIT);
m_post_processing->renderSSAO();
// Blur it to reduce noise.
m_post_processing->renderGaussian17TapBlur(irr_driver->getFBO(FBO_SSAO), irr_driver->getFBO(FBO_TMP4));
FrameBuffer::Blit(m_rtts->getFBO(FBO_SSAO), m_rtts->getFBO(FBO_HALF1_R), GL_COLOR_BUFFER_BIT, GL_LINEAR);
m_post_processing->renderGaussian17TapBlur(irr_driver->getFBO(FBO_HALF1_R), irr_driver->getFBO(FBO_HALF2_R));
}
static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z)

View File

@ -27,10 +27,12 @@ static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint i
GLuint result;
glGenTextures(1, &result);
glBindTexture(target, result);
if (irr_driver->getGLSLVersion() < 420)
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
else
#if WIN32
if (irr_driver->getGLSLVersion() >= 420)
glTexStorage3D(target, 1, internalFormat, w, h, d);
else
#endif
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
return result;
}
@ -39,10 +41,12 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
GLuint result;
glGenTextures(1, &result);
glBindTexture(GL_TEXTURE_2D, result);
#if WIN32
if (irr_driver->getGLSLVersion() < 420)
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
else
glTexStorage2D(GL_TEXTURE_2D, mipmaplevel, internalFormat, res.Width, res.Height);
else
#endif
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
return result;
}
@ -105,16 +109,20 @@ RTT::RTT(size_t width, size_t height)
RenderTargetTextures[RTT_NORMAL_AND_DEPTH] = generateRTT(res, GL_RGBA16F, GL_RGBA, GL_FLOAT);
RenderTargetTextures[RTT_COLOR] = generateRTT(res, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_MLAA_COLORS] = generateRTT(res, GL_SRGB8_ALPHA8, GL_BGR, GL_UNSIGNED_BYTE);
RenderTargetTextures[RTT_MLAA_TMP] = generateRTT(res, GL_SRGB8_ALPHA8, GL_BGR, GL_UNSIGNED_BYTE);
RenderTargetTextures[RTT_MLAA_BLEND] = generateRTT(res, GL_SRGB8_ALPHA8, GL_BGR, GL_UNSIGNED_BYTE);
RenderTargetTextures[RTT_SSAO] = generateRTT(res, GL_R16F, GL_RED, GL_FLOAT);
RenderTargetTextures[RTT_DISPLACE] = generateRTT(res, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_HALF1] = generateRTT(half, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_QUARTER1] = generateRTT(quarter, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_EIGHTH1] = generateRTT(eighth, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_HALF1_R] = generateRTT(half, GL_R16F, GL_RED, GL_FLOAT);
RenderTargetTextures[RTT_HALF2] = generateRTT(half, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_QUARTER2] = generateRTT(quarter, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_EIGHTH2] = generateRTT(eighth, GL_RGBA16F, GL_BGRA, GL_FLOAT);
RenderTargetTextures[RTT_HALF2_R] = generateRTT(half, GL_R16F, GL_RED, GL_FLOAT);
RenderTargetTextures[RTT_BLOOM_1024] = generateRTT(shadowsize0, GL_RGBA16F, GL_BGR, GL_FLOAT);
RenderTargetTextures[RTT_BLOOM_512] = generateRTT(shadowsize1, GL_RGBA16F, GL_BGR, GL_FLOAT);
@ -129,10 +137,6 @@ RTT::RTT(size_t width, size_t height)
somevector.push_back(RenderTargetTextures[RTT_SSAO]);
FrameBuffers.push_back(new FrameBuffer(somevector, res.Width, res.Height));
// Clear this FBO to 1s so that if no SSAO is computed we can still use it.
glClearColor(1., 1., 1., 1.);
glClear(GL_COLOR_BUFFER_BIT);
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_NORMAL_AND_DEPTH]);
FrameBuffers.push_back(new FrameBuffer(somevector, DepthStencilTexture, res.Width, res.Height));
@ -150,6 +154,12 @@ RTT::RTT(size_t width, size_t height)
somevector.push_back(RenderTargetTextures[RTT_MLAA_COLORS]);
FrameBuffers.push_back(new FrameBuffer(somevector, res.Width, res.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_MLAA_BLEND]);
FrameBuffers.push_back(new FrameBuffer(somevector, res.Width, res.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_MLAA_TMP]);
FrameBuffers.push_back(new FrameBuffer(somevector, res.Width, res.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_TMP1]);
FrameBuffers.push_back(new FrameBuffer(somevector, DepthStencilTexture, res.Width, res.Height));
somevector.clear();
@ -164,10 +174,20 @@ RTT::RTT(size_t width, size_t height)
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_HALF1]);
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_HALF1_R]);
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
// Clear this FBO to 1s so that if no SSAO is computed we can still use it.
glClearColor(1., 1., 1., 1.);
glClear(GL_COLOR_BUFFER_BIT);
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_HALF2]);
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_HALF2_R]);
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
somevector.clear();
somevector.push_back(RenderTargetTextures[RTT_QUARTER1]);
FrameBuffers.push_back(new FrameBuffer(somevector, quarter.Width, quarter.Height));
somevector.clear();

View File

@ -415,6 +415,8 @@ namespace UtilShader
void ColoredLine::setUniforms(const irr::video::SColor &col)
{
if (UserConfigParams::m_ubo_disabled)
bypassUBO(Program);
glUniform4i(uniform_color, col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha());
glUniformMatrix4fv(glGetUniformLocation(Program, "ModelMatrix"), 1, GL_FALSE, core::IdentityMatrix.pointer());
}
@ -1092,7 +1094,7 @@ namespace MeshShader
Program = LoadProgram(
GL_VERTEX_SHADER, file_manager->getAsset("shaders/grass_pass.vert").c_str(),
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getLightFactor.frag").c_str(),
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/objectref_pass2.frag").c_str());
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/grass_pass2.frag").c_str());
attrib_position = glGetAttribLocation(Program, "Position");
attrib_texcoord = glGetAttribLocation(Program, "Texcoord");
attrib_color = glGetAttribLocation(Program, "Color");
@ -1197,6 +1199,7 @@ namespace MeshShader
GLuint SphereMapShader::attrib_normal;
GLuint SphereMapShader::uniform_MM;
GLuint SphereMapShader::uniform_IMM;
GLuint SphereMapShader::uniform_ambient;
GLuint SphereMapShader::TU_tex;
void SphereMapShader::init()
@ -1210,6 +1213,7 @@ namespace MeshShader
attrib_normal = glGetAttribLocation(Program, "Normal");
uniform_MM = glGetUniformLocation(Program, "ModelMatrix");
uniform_IMM = glGetUniformLocation(Program, "InverseModelMatrix");
uniform_ambient = glGetUniformLocation(Program, "ambient");
GLuint uniform_tex = glGetUniformLocation(Program, "tex");
GLuint uniform_Albedo = glGetUniformLocation(Program, "Albedo");
GLuint uniform_DiffuseMap = glGetUniformLocation(Program, "DiffuseMap");
@ -1230,12 +1234,13 @@ namespace MeshShader
glUseProgram(0);
}
void SphereMapShader::setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix)
void SphereMapShader::setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix, const SColorf &ambient)
{
if (UserConfigParams::m_ubo_disabled)
bypassUBO(Program);
glUniformMatrix4fv(uniform_MM, 1, GL_FALSE, ModelMatrix.pointer());
glUniformMatrix4fv(uniform_IMM, 1, GL_FALSE, InverseModelMatrix.pointer());
glUniform3f(uniform_ambient, ambient.r, ambient.g, ambient.b);
}
GLuint SplattingShader::Program;
@ -2395,6 +2400,7 @@ namespace FullScreenShader
GLuint GlobalIlluminationReconstructionShader::uniform_SHB;
GLuint GlobalIlluminationReconstructionShader::uniform_extents;
GLuint GlobalIlluminationReconstructionShader::uniform_RHMatrix;
GLuint GlobalIlluminationReconstructionShader::uniform_InvRHMatrix;
GLuint GlobalIlluminationReconstructionShader::vao;
void GlobalIlluminationReconstructionShader::init()
@ -2410,15 +2416,17 @@ namespace FullScreenShader
uniform_SHG = glGetUniformLocation(Program, "SHG");
uniform_SHB = glGetUniformLocation(Program, "SHB");
uniform_RHMatrix = glGetUniformLocation(Program, "RHMatrix");
uniform_InvRHMatrix = glGetUniformLocation(Program, "InvRHMatrix");
uniform_extents = glGetUniformLocation(Program, "extents");
vao = createFullScreenVAO(Program);
GLuint uniform_ViewProjectionMatrixesUBO = glGetUniformBlockIndex(Program, "MatrixesData");
glUniformBlockBinding(Program, uniform_ViewProjectionMatrixesUBO, 0);
}
void GlobalIlluminationReconstructionShader::setUniforms(const core::matrix4 &RHMatrix, const core::vector3df &extents, unsigned TU_ntex, unsigned TU_dtex, unsigned TU_SHR, unsigned TU_SHG, unsigned TU_SHB)
void GlobalIlluminationReconstructionShader::setUniforms(const core::matrix4 &RHMatrix, const core::matrix4 &InvRHMatrix, const core::vector3df &extents, unsigned TU_ntex, unsigned TU_dtex, unsigned TU_SHR, unsigned TU_SHG, unsigned TU_SHB)
{
glUniformMatrix4fv(uniform_RHMatrix, 1, GL_FALSE, RHMatrix.pointer());
glUniformMatrix4fv(uniform_InvRHMatrix, 1, GL_FALSE, InvRHMatrix.pointer());
glUniform1i(uniform_ntex, TU_ntex);
glUniform1i(uniform_dtex, TU_dtex);
glUniform1i(uniform_SHR, TU_SHR);
@ -2446,10 +2454,12 @@ namespace FullScreenShader
GLuint ComputeGaussian17TapHShader::uniform_dest;
void ComputeGaussian17TapHShader::init()
{
#if WIN32
Program = LoadProgram(
GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussian.comp").c_str());
uniform_source = glGetUniformLocation(Program, "source");
uniform_dest = glGetUniformLocation(Program, "dest");
#endif
}
GLuint Gaussian6HBlurShader::Program;
@ -2499,10 +2509,12 @@ namespace FullScreenShader
GLuint ComputeGaussian17TapVShader::uniform_dest;
void ComputeGaussian17TapVShader::init()
{
#if WIN32
Program = LoadProgram(
GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussianv.comp").c_str());
uniform_source = glGetUniformLocation(Program, "source");
uniform_dest = glGetUniformLocation(Program, "dest");
#endif
}
GLuint Gaussian6VBlurShader::Program;

View File

@ -250,11 +250,11 @@ class SphereMapShader
public:
static GLuint Program;
static GLuint attrib_position, attrib_normal;
static GLuint uniform_MM, uniform_IMM;
static GLuint uniform_MM, uniform_IMM, uniform_ambient;
static GLuint TU_tex;
static void init();
static void setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix);
static void setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix, const video::SColorf &ambient);
};
class SplattingShader
@ -624,11 +624,11 @@ class GlobalIlluminationReconstructionShader
{
public:
static GLuint Program;
static GLuint uniform_ntex, uniform_dtex, uniform_extents, uniform_SHR, uniform_SHG, uniform_SHB, uniform_RHMatrix;
static GLuint uniform_ntex, uniform_dtex, uniform_extents, uniform_SHR, uniform_SHG, uniform_SHB, uniform_RHMatrix, uniform_InvRHMatrix;
static GLuint vao;
static void init();
static void setUniforms(const core::matrix4 &RHMatrix, const core::vector3df &extents, unsigned TU_ntex, unsigned TU_dtex, unsigned TU_SHR, unsigned TU_SHG, unsigned TU_SHB);
static void setUniforms(const core::matrix4 &RHMatrix, const core::matrix4 &InvRHMatrix, const core::vector3df &extents, unsigned TU_ntex, unsigned TU_dtex, unsigned TU_SHR, unsigned TU_SHG, unsigned TU_SHB);
};
class Gaussian17TapHShader

View File

@ -227,30 +227,16 @@ void STKAnimatedMesh::render()
glUseProgram(MeshShader::BubbleShader::Program);
GLMesh* mesh;
for_in(mesh, TransparentMesh[TM_BUBBLE])
drawBubble(*mesh, ModelViewProjectionMatrix);
if (World::getWorld() != NULL && World::getWorld()->isFogEnabled())
{
if (!TransparentMesh[TM_DEFAULT].empty() || !TransparentMesh[TM_ADDITIVE].empty())
glUseProgram(MeshShader::TransparentFogShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for_in(mesh, TransparentMesh[TM_DEFAULT])
drawTransparentFogObject(*mesh, ModelViewProjectionMatrix, mesh->TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for_in(mesh, TransparentMesh[TM_ADDITIVE])
drawTransparentFogObject(*mesh, ModelViewProjectionMatrix, mesh->TextureMatrix);
{
TransparentMeshes<TM_DEFAULT>::MeshSet.push_back(mesh);
TransparentMeshes<TM_DEFAULT>::MVPSet.push_back(ModelViewProjectionMatrix);
}
else
{
if (!TransparentMesh[TM_DEFAULT].empty() || !TransparentMesh[TM_ADDITIVE].empty())
glUseProgram(MeshShader::TransparentShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for_in(mesh, TransparentMesh[TM_DEFAULT])
drawTransparentObject(*mesh, ModelViewProjectionMatrix, mesh->TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for_in(mesh, TransparentMesh[TM_ADDITIVE])
drawTransparentObject(*mesh, ModelViewProjectionMatrix, mesh->TextureMatrix);
{
TransparentMeshes<TM_ADDITIVE>::MeshSet.push_back(mesh);
TransparentMeshes<TM_ADDITIVE>::MVPSet.push_back(ModelViewProjectionMatrix);
}
return;
}

View File

@ -22,7 +22,7 @@ static void createbillboardvao()
STKBillboard::STKBillboard(irr::scene::ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
const irr::core::vector3df& position, const irr::core::dimension2d<irr::f32>& size,
irr::video::SColor colorTop, irr::video::SColor colorBottom) :
CBillboardSceneNode(parent, mgr, id, position, size, colorTop, colorBottom), IBillboardSceneNode(parent, mgr, id, position)
IBillboardSceneNode(parent, mgr, id, position), CBillboardSceneNode(parent, mgr, id, position, size, colorTop, colorBottom)
{
if (!billboardvao)
createbillboardvao();

View File

@ -249,7 +249,7 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelMatrix, const c
}
setTexture(MeshShader::SphereMapShader::TU_tex, getTextureGLuint(mesh.textures[0]), GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
MeshShader::SphereMapShader::setUniforms(ModelMatrix, InverseModelMatrix);
MeshShader::SphereMapShader::setUniforms(ModelMatrix, InverseModelMatrix, irr_driver->getSceneManager()->getAmbientLight());
assert(mesh.vao_second_pass);
glBindVertexArray(mesh.vao_second_pass);
glDrawElements(ptype, count, itype, 0);
@ -553,8 +553,11 @@ void drawTransparentFogObject(const GLMesh &mesh, const core::matrix4 &ModelView
tmpcol.getGreen() / 255.0f,
tmpcol.getBlue() / 255.0f);
if (mesh.textures[0] != NULL)
{
compressTexture(mesh.textures[0], true);
setTexture(0, getTextureGLuint(mesh.textures[0]), GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
}
glUseProgram(MeshShader::TransparentFogShader::Program);
MeshShader::TransparentFogShader::setUniforms(ModelViewProjectionMatrix, TextureMatrix, fogmax, startH, endH, start, end, col, Camera::getCamera(0)->getCameraSceneNode()->getAbsolutePosition(), 0);

View File

@ -147,6 +147,25 @@ void drawObjectUnlit(const GLMesh &mesh, const core::matrix4 &ModelViewProjectio
void drawShadowRef(const GLMesh &mesh, const core::matrix4 &ModelMatrix);
void drawShadow(const GLMesh &mesh, const core::matrix4 &ModelMatrix);
template<enum TransparentMaterial T>
class TransparentMeshes
{
public:
static std::vector<GLMesh *> MeshSet;
static std::vector<core::matrix4> MVPSet;
static void reset()
{
MeshSet.clear();
MVPSet.clear();
}
};
template<enum TransparentMaterial T>
std::vector<GLMesh *> TransparentMeshes<T>::MeshSet;
template<enum TransparentMaterial T>
std::vector<core::matrix4> TransparentMeshes<T>::MVPSet;
// Forward pass (for transparents meshes)
void drawTransparentObject(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix, const core::matrix4 &TextureMatrix);
void drawTransparentFogObject(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix, const core::matrix4 &TextureMatrix);

View File

@ -209,33 +209,9 @@ void STKMeshSceneNode::drawSolidPass2(const GLMesh &mesh, ShadedMaterial type)
{
switch (type)
{
case SM_SPHEREMAP:
drawSphereMap(mesh, ModelViewProjectionMatrix, TransposeInverseModelView);
break;
case SM_SPLATTING:
drawSplatting(mesh, ModelViewProjectionMatrix);
break;
case SM_ALPHA_REF_TEXTURE:
drawObjectRefPass2(mesh, ModelViewProjectionMatrix, mesh.TextureMatrix);
break;
case SM_GRASS:
drawGrassPass2(mesh, ModelViewProjectionMatrix, windDir);
break;
case SM_RIMLIT:
drawObjectRimLimit(mesh, ModelViewProjectionMatrix, TransposeInverseModelView, core::matrix4::EM4CONST_IDENTITY);
break;
case SM_UNLIT:
drawObjectUnlit(mesh, ModelViewProjectionMatrix);
break;
case SM_DETAILS:
drawDetailledObjectPass2(mesh, ModelViewProjectionMatrix);
break;
case SM_UNTEXTURED:
drawUntexturedObject(mesh, ModelViewProjectionMatrix);
break;
case SM_DEFAULT:
drawObjectPass2(mesh, ModelViewProjectionMatrix, mesh.TextureMatrix);
break;
default:
assert(0 && "Wrong shaded material");
break;
@ -440,33 +416,23 @@ void STKMeshSceneNode::render()
ModelViewProjectionMatrix = computeMVP(AbsoluteTransformation);
GLMesh* mesh;
for_in(mesh, TransparentMesh[TM_DEFAULT])
{
TransparentMeshes<TM_DEFAULT>::MeshSet.push_back(mesh);
TransparentMeshes<TM_DEFAULT>::MVPSet.push_back(ModelViewProjectionMatrix);
}
for_in(mesh, TransparentMesh[TM_ADDITIVE])
{
TransparentMeshes<TM_ADDITIVE>::MeshSet.push_back(mesh);
TransparentMeshes<TM_ADDITIVE>::MVPSet.push_back(ModelViewProjectionMatrix);
}
if (!TransparentMesh[TM_BUBBLE].empty())
glUseProgram(MeshShader::BubbleShader::Program);
for_in(mesh, TransparentMesh[TM_BUBBLE])
drawBubble(*mesh, ModelViewProjectionMatrix);
if (World::getWorld() ->isFogEnabled())
{
if (!TransparentMesh[TM_DEFAULT].empty() || !TransparentMesh[TM_ADDITIVE].empty())
glUseProgram(MeshShader::TransparentFogShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for_in(mesh, TransparentMesh[TM_DEFAULT])
drawTransparentFogObject(*mesh, ModelViewProjectionMatrix, (*mesh).TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for_in(mesh, TransparentMesh[TM_ADDITIVE])
drawTransparentFogObject(*mesh, ModelViewProjectionMatrix, (*mesh).TextureMatrix);
}
else
{
if (!TransparentMesh[TM_DEFAULT].empty() || !TransparentMesh[TM_ADDITIVE].empty())
glUseProgram(MeshShader::TransparentShader::Program);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
for_in(mesh, TransparentMesh[TM_DEFAULT])
drawTransparentObject(*mesh, ModelViewProjectionMatrix, (*mesh).TextureMatrix);
glBlendFunc(GL_ONE, GL_ONE);
for_in(mesh, TransparentMesh[TM_ADDITIVE])
drawTransparentObject(*mesh, ModelViewProjectionMatrix, (*mesh).TextureMatrix);
}
return;
}

View File

@ -138,9 +138,9 @@ void AbstractStateManager::pushScreen(Screen* screen)
// ----------------------------------------------------------------------------
void AbstractStateManager::replaceTopMostScreen(Screen* screen)
void AbstractStateManager::replaceTopMostScreen(Screen* screen, GUIEngine::GameState gameState)
{
assert(m_game_mode != GAME);
//assert(m_game_mode != GAME);
// you need to close any dialog before calling this
assert(!ModalDialog::isADialogActive());
@ -156,9 +156,11 @@ void AbstractStateManager::replaceTopMostScreen(Screen* screen)
assert(m_menu_stack.size() > 0);
// Send tear-down event to previous menu
if (getCurrentScreen() != NULL)
getCurrentScreen()->tearDown();
m_menu_stack[m_menu_stack.size()-1] = name;
setGameState(gameState);
switchToScreen(name.c_str());
// Send init event to new menu

View File

@ -82,7 +82,7 @@ namespace GUIEngine
* without displaying the second-topmost menu of the stack
* in-between)
*/
void replaceTopMostScreen(Screen* screen);
void replaceTopMostScreen(Screen* screen, GUIEngine::GameState gameState = GUIEngine::MENU);
/**
* \brief removes the menu at the top of the screens stack

View File

@ -687,11 +687,11 @@ namespace GUIEngine
{
IGUIEnvironment* g_env;
Skin* g_skin = NULL;
ScalableFont* g_font;
ScalableFont* g_large_font;
ScalableFont* g_title_font;
ScalableFont* g_small_font;
ScalableFont* g_digit_font;
ScalableFont *g_font;
ScalableFont *g_large_font;
ScalableFont *g_title_font;
ScalableFont *g_small_font;
ScalableFont *g_digit_font;
IrrlichtDevice* g_device;
IVideoDriver* g_driver;
@ -1062,7 +1062,7 @@ namespace GUIEngine
ScalableFont* sfont =
new ScalableFont(g_env,
file_manager->getAssetChecked(FileManager::FONT,
"StkFont.xml",true).c_str() );
"StkFont.xml",true) );
sfont->setScale(normal_text_scale);
sfont->setKerningHeight(-5);
g_font = sfont;
@ -1070,13 +1070,13 @@ namespace GUIEngine
ScalableFont* digit_font =
new ScalableFont(g_env,
file_manager->getAssetChecked(FileManager::FONT,
"BigDigitFont.xml",true).c_str());
"BigDigitFont.xml",true));
digit_font->lazyLoadTexture(0); // make sure the texture is loaded for this one
digit_font->setMonospaceDigits(true);
g_digit_font = digit_font;
Private::font_height = g_font->getDimension( L"X" ).Height;
ScalableFont* sfont_larger = sfont->getHollowCopy();
sfont_larger->setScale(normal_text_scale*1.4f);
sfont_larger->setKerningHeight(-5);
@ -1097,7 +1097,7 @@ namespace GUIEngine
new ScalableFont(g_env,
file_manager->getAssetChecked(FileManager::FONT,
"title_font.xml",
true).c_str() );
true) );
sfont2->m_fallback_font = sfont;
// Because the fallback font is much smaller than the title font:
sfont2->m_fallback_font_scale = 4.0f;

View File

@ -305,12 +305,12 @@ void EventHandler::processGUIAction(const PlayerAction action,
case PA_ACCEL:
case PA_MENU_UP:
navigateUp(playerID, type, pressedDown);
navigate(playerID, type, pressedDown, true);
break;
case PA_BRAKE:
case PA_MENU_DOWN:
navigateDown(playerID, type, pressedDown);
navigate(playerID, type, pressedDown, false);
break;
case PA_RESCUE:
@ -364,10 +364,14 @@ const bool NAVIGATION_DEBUG = false;
#pragma mark Private methods
#endif
void EventHandler::navigateUp(const int playerID, Input::InputType type, const bool pressedDown)
/**
* Focus the next widget either downwards or upwards.
*
* \param reverse True means navigating up, false means down.
*/
void EventHandler::navigate(const int playerID, Input::InputType type, const bool pressedDown, const bool reverse)
{
//std::cout << "Naviagte up!\n";
IGUIElement *el = NULL/*, *first=NULL*/, *closest=NULL;
IGUIElement *el = NULL, *closest = NULL;
if (type == Input::IT_STICKBUTTON && !pressedDown)
return;
@ -378,19 +382,22 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
el = w->getIrrlichtElement();
}
// list widgets are a bit special, because up/down keys are also used
// to navigate between various list items, not only to navigate between
// components
if (w != NULL && w->m_type == WTYPE_LIST)
{
ListWidget* list = (ListWidget*)w;
ListWidget* list = (ListWidget*) w;
const bool stay_within_list = list->getSelectionID() > 0;
const bool stay_within_list = reverse ? list->getSelectionID() > 0 :
list->getSelectionID() < list->getItemCount() - 1;
if (stay_within_list)
{
list->setSelectionID(list->getSelectionID()-1);
if (reverse)
list->setSelectionID(list->getSelectionID() - 1);
else
list->setSelectionID(list->getSelectionID() + 1);
return;
}
else
@ -399,16 +406,15 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
}
}
if (w != NULL && w->m_tab_up_root != -1)
if (w != NULL && ((reverse && w->m_tab_up_root != -1) || (!reverse && w->m_tab_down_root != -1)))
{
Widget* up = GUIEngine::getWidget( w->m_tab_up_root );
assert( up != NULL );
el = up->getIrrlichtElement();
Widget* next = GUIEngine::getWidget(reverse ? w->m_tab_up_root : w->m_tab_down_root);
assert(next != NULL);
el = next->getIrrlichtElement();
if (el == NULL)
{
std::cerr << "WARNING : m_tab_down_root is set to an ID for which I can't find the widget\n";
std::cerr << "WARNING : m_tab_down/up_root is set to an ID for which I can't find the widget\n";
return;
}
}
@ -424,190 +430,69 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
// find closest widget
if (el != NULL && el->getTabGroup() != NULL)
{
// if the current widget is e.g. 15, search for widget 14, 13, 12, ... (up to 10 IDs may be missing)
for (int n=1; n<10 && !found; n++)
// Up: if the current widget is e.g. 15, search for widget 14, 13, 12, ... (up to 10 IDs may be missing)
// Down: if the current widget is e.g. 5, search for widget 6, 7, 8, 9, ..., 15 (up to 10 IDs may be missing)
for (int n = 1; n < 10 && !found; n++)
{
closest = GUIEngine::getGUIEnv()->getRootGUIElement()->getElementFromId(el->getTabOrder() - n, true);
closest = GUIEngine::getGUIEnv()->getRootGUIElement()->getElementFromId(el->getTabOrder() + (reverse ? -n : n), true);
if (closest != NULL && Widget::isFocusableId(closest->getID()))
{
if (NAVIGATION_DEBUG) std::cout << "Navigating up to " << closest->getID() << std::endl;
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
// if a dialog is shown, restrict to items in the dialog
if (ModalDialog::isADialogActive() && !ModalDialog::getCurrent()->isMyChild(closestWidget))
{
continue;
if (NAVIGATION_DEBUG)
{
std::cout << "Navigating " << (reverse ? "up" : "down") << " to " << closest->getID() << std::endl;
}
assert(closestWidget != NULL);
if (!closestWidget->isVisible() || !closestWidget->isActivated())
continue;
closestWidget->setFocusForPlayer(playerID);
// another list exception : when entering a list by going down, select the first item
// when focusing a list by going up, select the last item of the list
assert (closestWidget != NULL);
closestWidget->setFocusForPlayer(playerID);
if (closestWidget->m_type == WTYPE_LIST)
{
IGUIListBox* list = (IGUIListBox*)(closestWidget->m_element);
ListWidget* list = (ListWidget*) closestWidget;
assert(list != NULL);
list->setSelected( list->getItemCount()-1 );
return;
list->setSelectionID(reverse ? list->getItemCount() - 1 : 0);
}
found = true;
}
} // end for
}
if (!found)
{
if (NAVIGATION_DEBUG)
{
std::cout << "EventHandler::navigateUp : wrap around, selecting the last widget\n";
}
// select the last widget
Widget* lastWidget = NULL;
if (ModalDialog::isADialogActive())
{
lastWidget = ModalDialog::getCurrent()->getLastWidget();
}
else
{
Screen* screen = GUIEngine::getCurrentScreen();
if (screen == NULL) return;
lastWidget = screen->getLastWidget();
}
if (lastWidget != NULL) lastWidget->setFocusForPlayer(playerID);
}
}
// -----------------------------------------------------------------------------
void EventHandler::navigateDown(const int playerID, Input::InputType type, const bool pressedDown)
{
//std::cout << "Naviagte down!\n";
IGUIElement *el = NULL, *closest = NULL;
if (type == Input::IT_STICKBUTTON && !pressedDown)
return;
Widget* w = GUIEngine::getFocusForPlayer(playerID);
if (w != NULL)
{
el = w->getIrrlichtElement();
}
//std::cout << "!!! Player " << playerID << " navigating down of " << w->m_element->getID() << std::endl;
// list widgets are a bit special, because up/down keys are also used
// to navigate between various list items, not only to navigate between
// components
if (w != NULL && w->m_type == WTYPE_LIST)
{
ListWidget* list = (ListWidget*)w;
const bool stay_within_list = list->getSelectionID() < list->getItemCount()-1;
if (stay_within_list)
{
list->setSelectionID(list->getSelectionID()+1);
return;
}
else
{
list->setSelectionID(-1);
}
}
if (w != NULL && w->m_tab_down_root != -1)
{
Widget* down = GUIEngine::getWidget( w->m_tab_down_root );
assert(down != NULL);
el = down->getIrrlichtElement();
if (el == NULL)
{
std::cerr << "WARNING : m_tab_down_root is set to an ID for which I can't find the widget\n";
return;
}
}
// don't allow navigating to any widget when a dialog is shown; only navigate to widgets in the dialog
if (ModalDialog::isADialogActive() && !ModalDialog::getCurrent()->isMyIrrChild(el))
{
el = NULL;
}
bool found = false;
if (el != NULL && el->getTabGroup() != NULL)
{
// if the current widget is e.g. 5, search for widget 6, 7, 8, 9, ..., 15 (up to 10 IDs may be missing)
for (int n=1; n<10 && !found; n++)
{
closest = GUIEngine::getGUIEnv()->getRootGUIElement()->getElementFromId(el->getTabOrder() + n, true);
if (closest != NULL && Widget::isFocusableId(closest->getID()))
{
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
// if a dialog is shown, restrict to items in the dialog
if (ModalDialog::isADialogActive() && !ModalDialog::getCurrent()->isMyChild(closestWidget))
{
continue;
}
if (NAVIGATION_DEBUG)
{
std::cout << "Navigating down to " << closestWidget->getID() << "\n";
}
assert( closestWidget != NULL );
closestWidget->setFocusForPlayer(playerID);
// another list exception : when entering a list, select the first item
if (closestWidget->m_type == WTYPE_LIST)
{
IGUIListBox* list = (IGUIListBox*)(closestWidget->m_element);
assert(list != NULL);
list->setSelected(0);
}
found = true;
}
} // end for
}
if (!found)
{
if (NAVIGATION_DEBUG)
std::cout << "EventHandler::navigat : wrap around\n";
if (NAVIGATION_DEBUG) std::cout << "Navigating down : wrap around\n";
// select the first widget
Widget* firstWidget = NULL;
// select the last/first widget
Widget* wrapWidget = NULL;
if (ModalDialog::isADialogActive())
{
//std::cout << "w = ModalDialog::getCurrent()->getFirstWidget();\n";
firstWidget = ModalDialog::getCurrent()->getFirstWidget();
wrapWidget = reverse ? ModalDialog::getCurrent()->getLastWidget() :
ModalDialog::getCurrent()->getFirstWidget();
}
else
{
Screen* screen = GUIEngine::getCurrentScreen();
if (screen == NULL) return;
firstWidget = screen->getFirstWidget();
wrapWidget = reverse ? screen->getLastWidget() :
screen->getFirstWidget();
}
if (firstWidget != NULL) firstWidget->setFocusForPlayer(playerID);
if (wrapWidget != NULL) wrapWidget->setFocusForPlayer(playerID);
}
}
@ -631,7 +516,7 @@ void EventHandler::sendEventToUser(GUIEngine::Widget* widget, std::string& name,
EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int playerID)
{
if (w->m_deactivated) return EVENT_BLOCK;
if (!w->isActivated()) return EVENT_BLOCK;
Widget* parent = w->m_event_handler;
@ -658,7 +543,7 @@ EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int
parent = parent->m_event_handler;
}
if (parent->m_deactivated) return EVENT_BLOCK;
if (!parent->isActivated()) return EVENT_BLOCK;
/* notify the found event event handler, and also notify the main callback if the
parent event handler says so */
@ -699,7 +584,7 @@ EventPropagation EventHandler::onGUIEvent(const SEvent& event)
{
Widget* w = GUIEngine::getWidget(id);
if (w == NULL) break;
if (w->m_deactivated)
if (!w->isActivated())
{
GUIEngine::getCurrentScreen()->onDisabledItemClicked(w->m_properties[PROP_ID].c_str());
return EVENT_BLOCK;

View File

@ -62,8 +62,7 @@ namespace GUIEngine
EventPropagation onGUIEvent(const irr::SEvent& event);
EventPropagation onWidgetActivated(Widget* w, const int playerID);
void navigateUp(const int playerID, Input::InputType type, const bool pressedDown);
void navigateDown(const int playerID, Input::InputType type, const bool pressedDown);
void navigate(const int playerID, Input::InputType type, const bool pressedDown, const bool reverse);
/** \brief send an event to the GUI module user's event callback
* \param widget the widget that triggerred this event

View File

@ -21,8 +21,8 @@ namespace gui
{
//! constructor
ScalableFont::ScalableFont(IGUIEnvironment *env, const io::path& filename)
: Driver(0), SpriteBank(0), Environment(env), WrongCharacter(0),
ScalableFont::ScalableFont(IGUIEnvironment *env, const std::string &filename)
: Driver(0), SpriteBank(0), Environment(env), WrongCharacter(0),
MaxHeight(0), GlobalKerningWidth(0), GlobalKerningHeight(0)
{
#ifdef _DEBUG
@ -44,7 +44,7 @@ ScalableFont::ScalableFont(IGUIEnvironment *env, const io::path& filename)
// don't grab environment, to avoid circular references
Driver = Environment->getVideoDriver();
SpriteBank = Environment->addEmptySpriteBank(filename);
SpriteBank = Environment->addEmptySpriteBank(io::path(filename.c_str()));
if (SpriteBank)
SpriteBank->grab();
}
@ -676,7 +676,6 @@ void ScalableFont::draw(const core::stringw& text,
source,
clip,
color, true);
#ifdef FONT_DEBUG
driver->draw2DLine(core::position2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y),
core::position2d<s32>(dest.UpperLeftCorner.X, dest.LowerRightCorner.Y),

Some files were not shown because too many files have changed in this diff Show More