diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b7f1eac8..c1123416c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -292,7 +292,7 @@ endif()
install(TARGETS supertuxkart RUNTIME DESTINATION ${STK_INSTALL_BINARY_DIR} BUNDLE DESTINATION .)
install(DIRECTORY ${STK_DATA_DIR} DESTINATION ${STK_INSTALL_DATA_DIR} PATTERN ".svn" EXCLUDE)
install(FILES ${PROJECT_BINARY_DIR}/supertuxkart.desktop DESTINATION share/applications)
-install(FILES data/supertuxkart_32.xpm data/supertuxkart_64.xpm DESTINATION share/pixmaps)
+install(FILES data/supertuxkart_32.png data/supertuxkart_128.png DESTINATION share/pixmaps)
set(PREFIX ${CMAKE_INSTALL_PREFIX})
configure_file(data/supertuxkart_desktop.template supertuxkart.desktop)
diff --git a/data/Makefile.am b/data/Makefile.am
index a504cb6ef..5ed09a97d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -14,7 +14,7 @@ desktopdir = $(prefix)/share/applications
desktop_DATA = supertuxkart.desktop
icondir = $(prefix)/share/pixmaps
-dist_icon_DATA = supertuxkart_32.xpm supertuxkart_64.xpm
+dist_icon_DATA = supertuxkart_32.png supertuxkart_128.png
# The desktop file needs the absolute path to the binary
diff --git a/data/gui/difficulty_hard.png b/data/gui/difficulty_hard.png
index d0fb2040d..2466f843f 100644
Binary files a/data/gui/difficulty_hard.png and b/data/gui/difficulty_hard.png differ
diff --git a/data/gui/racesetup.stkgui b/data/gui/racesetup.stkgui
index bfcf301af..cd790746b 100644
--- a/data/gui/racesetup.stkgui
+++ b/data/gui/racesetup.stkgui
@@ -26,7 +26,7 @@
+ I18N="Difficulty" text="SuperTux"/>
diff --git a/data/supertuxkart_128.png b/data/supertuxkart_128.png
new file mode 100644
index 000000000..b93f156ab
Binary files /dev/null and b/data/supertuxkart_128.png differ
diff --git a/data/supertuxkart_32.png b/data/supertuxkart_32.png
new file mode 100644
index 000000000..4a75df81b
Binary files /dev/null and b/data/supertuxkart_32.png differ
diff --git a/data/supertuxkart_32.xpm b/data/supertuxkart_32.xpm
deleted file mode 100644
index 7de5db82e..000000000
--- a/data/supertuxkart_32.xpm
+++ /dev/null
@@ -1,226 +0,0 @@
-/* XPM */
-static char * supertuxkart_32_xpm[] = {
-"32 32 191 2",
-" c None",
-". c #000000",
-"+ c #C4C4C4",
-"@ c #939392",
-"# c #888887",
-"$ c #BDBCB4",
-"% c #FACA00",
-"& c #CFA400",
-"* c #262315",
-"= c #850303",
-"- c #920000",
-"; c #8A0002",
-"> c #820000",
-", c #860000",
-"' c #860001",
-") c #700000",
-"! c #050200",
-"~ c #D2AB00",
-"{ c #D9B100",
-"] c #D4AD00",
-"^ c #E6B900",
-"/ c #C84C4A",
-"( c #B90000",
-"_ c #B70000",
-": c #C32D2B",
-"< c #A50000",
-"[ c #B40000",
-"} c #AD0000",
-"| c #AE0004",
-"1 c #AC0000",
-"2 c #A30106",
-"3 c #FEFFFF",
-"4 c #E8C115",
-"5 c #E9C019",
-"6 c #FFFFFF",
-"7 c #2E2D2B",
-"8 c #462C1D",
-"9 c #F7F7F7",
-"0 c #FAFAF8",
-"a c #FAFAFA",
-"b c #434343",
-"c c #262726",
-"d c #6A6A6A",
-"e c #F6F6F6",
-"f c #EEECEC",
-"g c #FEFDFD",
-"h c #020202",
-"i c #575857",
-"j c #E1E2E1",
-"k c #0C0C0C",
-"l c #1E1F1E",
-"m c #F0C9B3",
-"n c #EEEEEE",
-"o c #232323",
-"p c #F4F4F4",
-"q c #6B6B6B",
-"r c #040404",
-"s c #070807",
-"t c #262626",
-"u c #141514",
-"v c #C0A291",
-"w c #010100",
-"x c #5A5A5A",
-"y c #474747",
-"z c #B5B5B5",
-"A c #595959",
-"B c #10100F",
-"C c #6F5447",
-"D c #CACACA",
-"E c #0A0A0A",
-"F c #8C8C8C",
-"G c #8E8E8E",
-"H c #030303",
-"I c #BB0000",
-"J c #CB0000",
-"K c #F0F0F0",
-"L c #575757",
-"M c #8E0000",
-"N c #6A0000",
-"O c #390000",
-"P c #B60000",
-"Q c #F9F9F9",
-"R c #FBFBFA",
-"S c #FAFAFB",
-"T c #D4D4D4",
-"U c #E6E6E6",
-"V c #656565",
-"W c #6E0000",
-"X c #9E0000",
-"Y c #A40000",
-"Z c #220000",
-"` c #464646",
-" . c #A10000",
-".. c #9F0000",
-"+. c #B80000",
-"@. c #560000",
-"#. c #242424",
-"$. c #FBFCFF",
-"%. c #F8F8F8",
-"&. c #FEFEFE",
-"*. c #ACB4D2",
-"=. c #A95A01",
-"-. c #D97B00",
-";. c #190000",
-">. c #4A0000",
-",. c #A60000",
-"'. c #BC0000",
-"). c #DB0000",
-"!. c #B49500",
-"~. c #E9BD00",
-"{. c #EABF00",
-"]. c #E8BA00",
-"^. c #EDCF59",
-"/. c #FCFFFF",
-"(. c #CCAA11",
-"_. c #BF9C01",
-":. c #E9BF00",
-"<. c #E7BC00",
-"[. c #F4DF00",
-"}. c #9E0200",
-"|. c #5B0000",
-"1. c #A20000",
-"2. c #EFC800",
-"3. c #EDC500",
-"4. c #EECA00",
-"5. c #EDCB00",
-"6. c #F0CF00",
-"7. c #F2D700",
-"8. c #4D4702",
-"9. c #C36800",
-"0. c #A82400",
-"a. c #980000",
-"b. c #C20000",
-"c. c #640000",
-"d. c #430000",
-"e. c #0E0000",
-"f. c #C10000",
-"g. c #9C0000",
-"h. c #A30200",
-"i. c #680000",
-"j. c #A00000",
-"k. c #310000",
-"l. c #2D2D2D",
-"m. c #A70000",
-"n. c #E6EDED",
-"o. c #000101",
-"p. c #A1A1A1",
-"q. c #010101",
-"r. c #B50000",
-"s. c #A30000",
-"t. c #B30000",
-"u. c #5C0000",
-"v. c #B00000",
-"w. c #9D0000",
-"x. c #A80000",
-"y. c #AA0000",
-"z. c #900000",
-"A. c #212120",
-"B. c #150000",
-"C. c #A90000",
-"D. c #AB0000",
-"E. c #B20000",
-"F. c #B10000",
-"G. c #2E2E2E",
-"H. c #AF0000",
-"I. c #AE0000",
-"J. c #BE4E4E",
-"K. c #DD9C9C",
-"L. c #F8FFFF",
-"M. c #F9FFFF",
-"N. c #B91A1A",
-"O. c #B52323",
-"P. c #C46161",
-"Q. c #D17D7D",
-"R. c #E4C2C2",
-"S. c #EFFBFB",
-"T. c #F1FFFF",
-"U. c #F0FCFC",
-"V. c #F0F2F2",
-"W. c #F3F2F1",
-"X. c #F4F1F1",
-"Y. c #F1EFEF",
-"Z. c #ECF2F2",
-"`. c #EAEDED",
-" + c #E9EBEB",
-".+ c #EBEAEA",
-"++ c #EAE8E8",
-"@+ c #EFEDEC",
-"#+ c #F0ECEA",
-"$+ c #F1F0F1",
-"%+ c #E7E6E7",
-" ",
-" ",
-" ",
-" ",
-" ",
-" . . . . ",
-" . . . . ",
-" . . + @ # . ",
-" . . $ % & * ",
-" = - ; > , ' ) . ! ~ { ] ^ / ( ",
-" _ : < [ } | 1 2 . . 3 4 5 6 ",
-" 7 8 . . 9 0 0 a b ",
-" c . . d 9 e 6 f g h ",
-" i j k l m h . n 6 o p 6 q . . ",
-" r s t u . v w . . x y z n A . . ",
-" B . . . C . . . . D E . F G H . . . ",
-" . . . . . . I J . . 6 6 K L 6 . r 6 M N . . . ",
-" . . . . . O < P P . . Q R S 6 T U V 6 W X Y Z . ",
-" ` . . . . . ...+.@.. #.$.6 $.%.&.. *.=.-.X ;.) ",
-" . . . . >.Y ,. .'.).. !.~.{.].^./.(._.{.:.<.[.}. ",
-" . . . . |...X .1. .2.3.4.5.6.7.8.6.. 9.0.a.< b.. . . . . ",
-" . . . . . 1 W c.d.e.. f.1. .Y .g.h.i.( j.Y j.k.. l.. . . . ",
-" . . . . . . . . . . . . j. .Y .< .1.1 1.1.1.m.. n.o.. . . . ",
-" . p.q.. . . . r.,.j.j.< X < m.j.1.s.1.j.s._ t.u.. . ",
-" . d q.. . . . v.1.< j.Y j.g.m.j.1... ...w.s.< x.y.z.",
-" A.q.. . B.b.,.C.,.D...1.,. .s.1.1.Y D.1 E.r.E.F.[ F.",
-" G.. . } x.x.} E.t.t.F.F.H.I.} I.I.H.1 1 < x.J.K.L.M.",
-" . . 6 N.v.H.1 C.x.x.y.O.P.Q.R.S.T.U.V.W.X. ",
-" Y.Z.`. +.+++@+#+$+%+ ",
-" ",
-" ",
-" "};
diff --git a/data/supertuxkart_64.xpm b/data/supertuxkart_64.xpm
deleted file mode 100644
index dd3930e3c..000000000
--- a/data/supertuxkart_64.xpm
+++ /dev/null
@@ -1,627 +0,0 @@
-/* XPM */
-static char * supertuxkart_64_xpm[] = {
-"64 64 560 2",
-" c None",
-". c #000000",
-"+ c #010101",
-"@ c #AFAFAF",
-"# c #FFFFFF",
-"$ c #0B0B0B",
-"% c #696969",
-"& c #7A7A7A",
-"* c #C4C4C4",
-"= c #454545",
-"- c #939392",
-"; c #040405",
-"> c #888887",
-", c #D1D1D1",
-"' c #8E8E8E",
-") c #676768",
-"! c #6D7490",
-"~ c #080000",
-"{ c #484D63",
-"] c #848487",
-"^ c #282829",
-"/ c #565963",
-"( c #BDBCB4",
-"_ c #927600",
-": c #FACA00",
-"< c #FFDC01",
-"[ c #CFA400",
-"} c #BFBA7E",
-"| c #262315",
-"1 c #181300",
-"2 c #FFE300",
-"3 c #EABC00",
-"4 c #ECC200",
-"5 c #E7BE01",
-"6 c #E6BD00",
-"7 c #EAC001",
-"8 c #ECBE00",
-"9 c #EAC500",
-"0 c #980000",
-"a c #850303",
-"b c #8F0000",
-"c c #920000",
-"d c #950000",
-"e c #8A0002",
-"f c #A40001",
-"g c #820000",
-"h c #860000",
-"i c #770001",
-"j c #860001",
-"k c #900000",
-"l c #700000",
-"m c #AA0000",
-"n c #050200",
-"o c #FFDB00",
-"p c #D2AB00",
-"q c #D7B000",
-"r c #D9B100",
-"s c #D5AE00",
-"t c #D4AD00",
-"u c #D5AD01",
-"v c #E6B900",
-"w c #705A69",
-"x c #C84C4A",
-"y c #AE0000",
-"z c #B90000",
-"A c #B20000",
-"B c #AD0000",
-"C c #A50000",
-"D c #CF8181",
-"E c #EBDBDB",
-"F c #6F0000",
-"G c #8B0101",
-"H c #8A0000",
-"I c #970000",
-"J c #660000",
-"K c #A70000",
-"L c #9A0000",
-"M c #8C0000",
-"N c #9F0000",
-"O c #A20000",
-"P c #A10000",
-"Q c #A90000",
-"R c #AB0000",
-"S c #010000",
-"T c #81763E",
-"U c #F3CE2D",
-"V c #ECBC00",
-"W c #EBC000",
-"X c #ECC100",
-"Y c #EDC300",
-"Z c #ECBB00",
-"` c #E0D9AA",
-" . c #241918",
-".. c #FFF8F7",
-"+. c #BC0202",
-"@. c #CA0000",
-"#. c #B70000",
-"$. c #B80000",
-"%. c #C32D2B",
-"&. c #AC0303",
-"*. c #B40000",
-"=. c #B00002",
-"-. c #AE0004",
-";. c #AC0000",
-">. c #A60001",
-",. c #A30106",
-"'. c #710000",
-"). c #BDBDBC",
-"!. c #FEFFFF",
-"~. c #F5ECB8",
-"{. c #E8C115",
-"]. c #E7B700",
-"^. c #E9C019",
-"/. c #F8F7E1",
-"(. c #303030",
-"_. c #F8F7F6",
-":. c #FBFBFC",
-"<. c #FDFFFF",
-"[. c #FBFBFA",
-"}. c #FCFCFD",
-"|. c #D9D9D9",
-"1. c #1B1A19",
-"2. c #2E2D2B",
-"3. c #462C1D",
-"4. c #F7F7F7",
-"5. c #FAFAFA",
-"6. c #FAFAF8",
-"7. c #F9FAF7",
-"8. c #F9FAFB",
-"9. c #434343",
-"0. c #202120",
-"a. c #262726",
-"b. c #8C5E47",
-"c. c #4F4F4F",
-"d. c #FBFBFB",
-"e. c #FCFCFC",
-"f. c #FCFCFB",
-"g. c #A8A8A8",
-"h. c #212321",
-"i. c #4E4038",
-"j. c #6A6A6A",
-"k. c #F9F9F9",
-"l. c #F6F6F6",
-"m. c #ECEBEB",
-"n. c #EEECEC",
-"o. c #FEFDFD",
-"p. c #020202",
-"q. c #646764",
-"r. c #525552",
-"s. c #2F312F",
-"t. c #010301",
-"u. c #1E1F1E",
-"v. c #272827",
-"w. c #242623",
-"x. c #F4E2D9",
-"y. c #030303",
-"z. c #7E7C7C",
-"A. c #B1B0AF",
-"B. c #D6D4D5",
-"C. c #EFEFEF",
-"D. c #777676",
-"E. c #090909",
-"F. c #292827",
-"G. c #030302",
-"H. c #575857",
-"I. c #6E706E",
-"J. c #E1E2E1",
-"K. c #626462",
-"L. c #0C0C0C",
-"M. c #F0C9B3",
-"N. c #030202",
-"O. c #EEEEEE",
-"P. c #FDFDFD",
-"Q. c #232323",
-"R. c #2C2C2C",
-"S. c #F4F4F4",
-"T. c #6B6B6B",
-"U. c #0D0D0C",
-"V. c #2A2B2A",
-"W. c #676967",
-"X. c #C4C6C4",
-"Y. c #4B4D4B",
-"Z. c #181A18",
-"`. c #293039",
-" + c #82BCDF",
-".+ c #D9B39C",
-"++ c #020101",
-"@+ c #818182",
-"#+ c #202020",
-"$+ c #C5C5C5",
-"%+ c #F8F8F8",
-"&+ c #F2F2F2",
-"*+ c #6D6F6D",
-"=+ c #040404",
-"-+ c #070807",
-";+ c #181918",
-">+ c #262626",
-",+ c #141514",
-"'+ c #080B08",
-")+ c #42484F",
-"!+ c #C0A291",
-"~+ c #010100",
-"{+ c #3A3A3A",
-"]+ c #5A5A5A",
-"^+ c #050505",
-"/+ c #474747",
-"(+ c #B5B5B5",
-"_+ c #595959",
-":+ c #727272",
-"<+ c #404240",
-"[+ c #040604",
-"}+ c #020302",
-"|+ c #9A8273",
-"1+ c #D3D3D3",
-"2+ c #1C1C1C",
-"3+ c #7B7B7B",
-"4+ c #515151",
-"5+ c #10100F",
-"6+ c #6F5447",
-"7+ c #CACACA",
-"8+ c #707070",
-"9+ c #0A0A0A",
-"0+ c #272727",
-"a+ c #8C8C8C",
-"b+ c #0D0D0D",
-"c+ c #273331",
-"d+ c #220807",
-"e+ c #1F0000",
-"f+ c #1E1309",
-"g+ c #BEBEBE",
-"h+ c #818181",
-"i+ c #393939",
-"j+ c #616161",
-"k+ c #414141",
-"l+ c #595858",
-"m+ c #BB0000",
-"n+ c #CF0000",
-"o+ c #CB0000",
-"p+ c #EB0000",
-"q+ c #020000",
-"r+ c #2E2E2E",
-"s+ c #F8F9F9",
-"t+ c #F0F0F0",
-"u+ c #575757",
-"v+ c #8A8A8A",
-"w+ c #ECECEC",
-"x+ c #6A7373",
-"y+ c #8E0000",
-"z+ c #6A0000",
-"A+ c #380000",
-"B+ c #780000",
-"C+ c #AF0000",
-"D+ c #D50000",
-"E+ c #FAFAFB",
-"F+ c #E1E1E1",
-"G+ c #151515",
-"H+ c #D7D7D7",
-"I+ c #F9FAFA",
-"J+ c #6F7474",
-"K+ c #680000",
-"L+ c #9E0000",
-"M+ c #A30000",
-"N+ c #390000",
-"O+ c #BE0000",
-"P+ c #B60000",
-"Q+ c #D80000",
-"R+ c #D4D4D4",
-"S+ c #E6E6E6",
-"T+ c #656565",
-"U+ c #5B6060",
-"V+ c #6E0000",
-"W+ c #B00000",
-"X+ c #A40000",
-"Y+ c #850000",
-"Z+ c #220000",
-"`+ c #1E0000",
-" @ c #BC0000",
-".@ c #BA0000",
-"+@ c #D10000",
-"@@ c #1A0000",
-"#@ c #F7F8F8",
-"$@ c #424242",
-"%@ c #14191A",
-"&@ c #6D0001",
-"*@ c #B50000",
-"=@ c #9D0000",
-"-@ c #540000",
-";@ c #131313",
-">@ c #464646",
-",@ c #060606",
-"'@ c #BD0000",
-")@ c #C30000",
-"!@ c #560000",
-"~@ c #242424",
-"{@ c #FBFCFF",
-"]@ c #FEFEFE",
-"^@ c #E5E5E5",
-"/@ c #9E9E9D",
-"(@ c #ACB4D2",
-"_@ c #A95A01",
-":@ c #D97100",
-"<@ c #D97B00",
-"[@ c #C31400",
-"}@ c #730000",
-"|@ c #190000",
-"1@ c #030000",
-"2@ c #070706",
-"3@ c #313131",
-"4@ c #300000",
-"5@ c #800000",
-"6@ c #313545",
-"7@ c #FEEFA5",
-"8@ c #EFD26A",
-"9@ c #EBC62E",
-"0@ c #EDCD4F",
-"a@ c #F6E591",
-"b@ c #FCFDFF",
-"c@ c #FDFDFC",
-"d@ c #494D59",
-"e@ c #121318",
-"f@ c #FFDF00",
-"g@ c #EFC600",
-"h@ c #E9BF00",
-"i@ c #E9C000",
-"j@ c #EEDA00",
-"k@ c #EABF00",
-"l@ c #D05C00",
-"m@ c #830100",
-"n@ c #A80000",
-"o@ c #840000",
-"p@ c #1F1E1E",
-"q@ c #4A0000",
-"r@ c #A60000",
-"s@ c #DB0000",
-"t@ c #B49500",
-"u@ c #FFD800",
-"v@ c #E9BD00",
-"w@ c #E8BE00",
-"x@ c #E8BA00",
-"y@ c #E6B500",
-"z@ c #EDCF59",
-"A@ c #FBF1BA",
-"B@ c #FCFFFF",
-"C@ c #F5E9B0",
-"D@ c #CCAA11",
-"E@ c #BF9C01",
-"F@ c #E4BA00",
-"G@ c #E9BC00",
-"H@ c #E7BC00",
-"I@ c #EBC700",
-"J@ c #F4DF00",
-"K@ c #9E0200",
-"L@ c #2B2D2D",
-"M@ c #590000",
-"N@ c #500000",
-"O@ c #8B7600",
-"P@ c #FFDD00",
-"Q@ c #E6BC00",
-"R@ c #E8BF00",
-"S@ c #EABF03",
-"T@ c #E8BD00",
-"U@ c #EFBE00",
-"V@ c #A98800",
-"W@ c #EFBF00",
-"X@ c #211700",
-"Y@ c #413300",
-"Z@ c #FFD700",
-"`@ c #EAC200",
-" # c #EFCC00",
-".# c #F2D600",
-"+# c #F1D300",
-"@# c #E8B300",
-"## c #E19B00",
-"$# c #AD1600",
-"%# c #323232",
-" c #5B0000",
-"*# c #F6BB00",
-"=# c #EFC800",
-"-# c #E8C200",
-";# c #EDC500",
-"># c #ECC700",
-",# c #EECA00",
-"'# c #EFCD00",
-")# c #EDCB00",
-"!# c #EFCB00",
-"~# c #F0CF00",
-"{# c #F2D700",
-"]# c #FCE201",
-"^# c #4D4702",
-"/# c #FFED00",
-"(# c #AB8300",
-"_# c #C36800",
-":# c #B84C00",
-"<# c #A82400",
-"[# c #C20000",
-"}# c #490000",
-"|# c #151617",
-"1# c #C70000",
-"2# c #9C0000",
-"3# c #B10000",
-"4# c #BF0000",
-"5# c #E45200",
-"6# c #ED6E00",
-"7# c #DA6B00",
-"8# c #BF6600",
-"9# c #C05E00",
-"0# c #B75200",
-"a# c #B64900",
-"b# c #B95100",
-"c# c #B95000",
-"d# c #B43F00",
-"e# c #AF2E00",
-"f# c #AA1C00",
-"g# c #960000",
-"h# c #940000",
-"i# c #440000",
-"j# c #A00000",
-"k# c #A20200",
-"l# c #A80200",
-"m# c #A00100",
-"n# c #B30000",
-"o# c #640000",
-"p# c #430000",
-"q# c #290000",
-"r# c #0E0000",
-"s# c #090000",
-"t# c #C10000",
-"u# c #9B0000",
-"v# c #A20100",
-"w# c #A30200",
-"x# c #A50100",
-"y# c #310000",
-"z# c #080808",
-"A# c #2D2D2D",
-"B# c #520000",
-"C# c #230000",
-"D# c #570000",
-"E# c #810000",
-"F# c #5B5B5B",
-"G# c #C3C3C3",
-"H# c #990000",
-"I# c #5D6565",
-"J# c #E6EDED",
-"K# c #050707",
-"L# c #000101",
-"M# c #5A0000",
-"N# c #750808",
-"O# c #984545",
-"P# c #551616",
-"Q# c #777777",
-"R# c #A1A1A1",
-"S# c #3B0000",
-"T# c #7A0000",
-"U# c #5C0000",
-"V# c #050000",
-"W# c #B2B2B2",
-"X# c #C50000",
-"Y# c #1C0000",
-"Z# c #4A4A4A",
-"`# c #A70101",
-" $ c #C00000",
-".$ c #A20101",
-"+$ c #212120",
-"@$ c #150000",
-"#$ c #760000",
-"$$ c #A10202",
-"%$ c #A70202",
-"&$ c #2F0000",
-"*$ c #AD0202",
-"=$ c #B20808",
-"-$ c #C34F4F",
-";$ c #DC7E7E",
-">$ c #610000",
-",$ c #B01515",
-"'$ c #BE4E4E",
-")$ c #CC7777",
-"!$ c #DD9C9C",
-"~$ c #ECE1E1",
-"{$ c #F8FFFF",
-"]$ c #FBFFFF",
-"^$ c #F9FFFF",
-"/$ c #738484",
-"($ c #DFA0A0",
-"_$ c #AD0303",
-":$ c #B92E2E",
-"<$ c #C15252",
-"[$ c #C87474",
-"}$ c #D38383",
-"|$ c #DDAAAA",
-"1$ c #E8D8D8",
-"2$ c #F3FFFF",
-"3$ c #F6FFFF",
-"4$ c #F5FFFF",
-"5$ c #F1FCFC",
-"6$ c #EEF1F1",
-"7$ c #ECEDED",
-"8$ c #F6F5F4",
-"9$ c #F5F2F1",
-"0$ c #585757",
-"a$ c #EEF9F9",
-"b$ c #B91A1A",
-"c$ c #B52323",
-"d$ c #BB4040",
-"e$ c #C46161",
-"f$ c #CA7373",
-"g$ c #D17D7D",
-"h$ c #DA9C9C",
-"i$ c #E4C2C2",
-"j$ c #EBE5E5",
-"k$ c #EFFBFB",
-"l$ c #F1FFFF",
-"m$ c #F2FFFF",
-"n$ c #F0FCFC",
-"o$ c #F0F5F5",
-"p$ c #F0F2F2",
-"q$ c #F3F2F1",
-"r$ c #F5F2F0",
-"s$ c #F4F1F1",
-"t$ c #F0ECEC",
-"u$ c #424040",
-"v$ c #CE7878",
-"w$ c #CA7272",
-"x$ c #CD7C7C",
-"y$ c #D17F7F",
-"z$ c #D68181",
-"A$ c #D99393",
-"B$ c #DEA6A6",
-"C$ c #E3BABA",
-"D$ c #E5CBCB",
-"E$ c #EADFDF",
-"F$ c #EDEDED",
-"G$ c #EFF8F8",
-"H$ c #F4FFFF",
-"I$ c #EFFDFD",
-"J$ c #EEF7F7",
-"K$ c #EDF2F1",
-"L$ c #EDEFF0",
-"M$ c #EAE8E8",
-"N$ c #F2EFEE",
-"O$ c #F2EEEC",
-"P$ c #F6F4F3",
-"Q$ c #EFEDEE",
-"R$ c #F1EFEF",
-"S$ c #F5FAFA",
-"T$ c #ECF2F2",
-"U$ c #EAEDED",
-"V$ c #E9ECEC",
-"W$ c #E9EBEB",
-"X$ c #E8E9E9",
-"Y$ c #EBEAEA",
-"Z$ c #ECEBEA",
-"`$ c #EAE9E8",
-" % c #EFEDEC",
-".% c #F5F1EE",
-"+% c #F0ECEA",
-"@% c #F4F2F1",
-"#% c #F1F0F1",
-"$% c #E7E6E7",
-"%% c #F3F4F4",
-"&% c #F1F1F2",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" . . . . . ",
-" . . . . . . . ",
-" . . . . . . . . . ",
-" . . . . . . + . . ",
-" . . . . @ # $ . # % . ",
-" . . . & * = - ; > , . ",
-" . . . ' ) . ! ~ { ] ^ ",
-" . . . / ( _ : < [ } | ",
-" . . 1 2 3 4 5 6 7 8 9 ",
-" 0 a b c d e f g c h i j k l m . . n o p q r s t u v w x y z ",
-" A B C D E F G H I J K L M N C O P Q R . S . T U V W X Y Z ` ...A +. ",
-" @.#.$.%.# C &.*.A B =.-.A ;.>.,.R '.. . . ).!.~.{.].^./.# (. ",
-" . . . . . . # _.:.<.!.<.[.}.|. ",
-" 1.2. 3.. . . . # 4.5.6.7.6.8.5.# 9. ",
-" 0.0.a. b.. S . . c.# 5.d.d.e.e.f.e.# g.. ",
-" a.h. i.. . . . j.5.4.k.l.m.# # n.# o.. p.. ",
-" q.r.s.t.u.v.w. x.. y.. . . z.A.B.C.# D.. . E.. F.G.. . . ",
-" H.I.J.K.L.y.u. M.. p.. . N.O.P.# P.Q.R.S.# # # T.. . . . ",
-" U.V.W.X.Y.Z.. . `. +.+. ++. . @+# # # #+. $+# %+}.&+. . . . . ",
-" *+=+. -+;+>+#+,+'+. )+!+. ~+. . . . {+]+^+/+. (+# O.. _+:+. + . ",
-" <+. . . . [+}++ . . |+. . . . . y.. . 1+# # 2+3+. 4+# (+. . . . . . . . . ",
-" 5+^+. . . . . . 6+. . . . . . . . , 7+8+9+. . 0+a+b+' . y.. . . . . . . ",
-" . . . . . . . . . . c+d+e+f+. . Q.# g+3+h+i+. . j+k+. . . . + # l+. . . . . . . . . ",
-" . . . . . . . . . . . . m+n+o+p+. q+. r+# s+# # t+. u+# # v+. . =+w+# x+y+K z+A+. . . . . ",
-" . . . . . . . . . . . . . B+K C+B C+D+. q+. 2+# 5.E+5.P.F+G+. . . . . H+I+# J+K+L+M+;.$.N+. . . . ",
-" . . . . . . . . . . . N+O+C N P+*.P+Q+. q+. . k.d.[.5.E+5.# # R+&+S+. T+# # U+V+W+L+N X+Y+Z+. . . ",
-" . b+. . . . . . . . `+ @P N L+K .@$.+@@@. . . (+# 5.d.d.d.%+%+4.#@# $@. # # %@&@*@.@K =@*@I -@. . ",
-" ;@>@,@. . . . . . . #.P M+P N N '@$.)@!@. . . ~@# {@!.# <.{@d.%+d.]@^@. /@(@. _@:@<@[@L+}@|@l l 1@ ",
-" 2@3@=+. . . . . . 4@B M+N X+P =@.@$..@5@. . . . 6@7@8@9@0@a@# <.b@c@# d@e@f@o g@h@i@j@k@l@z+m@n@o@ ",
-" p@. . . . . . . . q@K X+N r@P P M+ @#.s@. . n t@u@v@w@k@i@x@y@z@A@B@C@D@. E@F@k@h@h@G@H@I@J@N K@O ",
-" L@. . . . . . . . M@O X+P N P M+P O .@)@N@O@P@w@Q@k@h@k@h@R@S@T@U@V@W@o X@Y@Z@`@ #.#J@+#@###$#B #.)@ . . ",
-" %#. . . . . . . . Q N O L+N P M+O L+P *#=#-#;#>#,#'#)#!#~#+#{#]#^#/#~#(#. <@_#:#<#L+0 I C W+[#}#. . . . . . . . . . ",
-" |#. . . . . . . . q+1#2#n@M+C m 3#*@4#)@5#6#7#8#9#0#a#b#c#d#e#f#g#I L h##.~+i#n@O j#k#l#m#N n#M+. 1@. . . . . . . . . . ",
-" . . . . . . . . . . N ;.c V+z+o#p#q#r#. . s#t#u#O O P P X+C P v#2#w#w#x#K+. z L+j#N X+O j#y y#. . z#A#. . . . . . . . . ",
-" . . . . . . . . . . B#0 . . . . . . . S q+q+. C#$.P P P j#P O X+M+O M+P N #.. D#M+O P P O P K E#. . F#G#. p.. . . . . . . ",
-" . . . . . . . . . . . S . . . . . . . . . . . H#j#M+P O X+X+P X+C j#P N O n#;.N O M+O j#O P K N . I#J#K#L#. . . . . . . . ",
-" . . S . ;@. . . . . . . . . . M#P r@K X+O X+M+M+N N j#M+P O j#L+P j#O X+N O j#r@u#N#O#P#@@. . . . . . . . ",
-" . Q#R#. + . . . . . . . . S#*@M+r@M+j#j#j#O C j#L+O C O K L+j#O O P M+N O j#j#M+M+;.#.[#n#T#U#V#. . . ",
-" . W#|.. p.. . . . . . . . . @.r@X+P P j#j#O P K L+N C C M+X+N N O =@K N X+M+X+j#O P O C X+X+;.X#2#Y#. ",
-" . Z#j.. + . . . . . . . . q@W+u#O r@C j#j#M+X+M+j#M+2#r@K O j#0 O N N `#P C N O =@M+M+K C n@n@r@m X#k ",
-" y.+ . . . . . . . . . K+ $R n@m O n@X+r@M+j#P r@r@L+P O X+O m d =@.$2#K L+C =@I I L+M+n@Q n@;.;.y B ;.)@",
-" +$. + . . . . . @$#$[#m r@;.Q ;.r@r@R Q N P O L+r@O P P M+$$O P O %$X+;.R B ;.W+A n#*@*.A n#3#3#*.n#3#m+",
-" {+. + . . &$T#z *.Q Q B Q B m m W+K R K Q L+P O X+*$n@B R B B B y y C+C+W+W+y y B B R R R Q r@X+K =$-$;$",
-" r+. . . . >$B R n@y n@W+B C+A R n#y n#3#3#W+3#3#C+y y ;.B B y y y C+C+B ;.;.;.Q C X+n@,$'$)$!$~${$]$^$<.",
-" . . . . . /$($n@C+B 3#A n#R W+;.R R R ;.y y 3#C+C+W+W+B m n@r@X+C K _$:$<$[$}$|$1$2$3$4$5$6$7$8$9$9$ ",
-" . . . . 0$# a$b$R W+W+C+B ;.R Q n@n@r@n@n@m y c$d$e$f$g$h$i$j$k$2$l$m$n$o$p$t+q$r$s$t$ ",
-" . . . u$# n.3$v$w$x$y$z$A$B$C$D$E$F$G$2$H$2$l$I$J$K$L$w+m.M$N$O$P$Q$Q$ ",
-" l.R$S$T$U$U$V$W$X$Y$Z$M$`$ %.%+%@%#%P$$% ",
-" 5.%%&% ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/data/supertuxkart_desktop.template b/data/supertuxkart_desktop.template
index 59d614cf1..aeb48ab70 100644
--- a/data/supertuxkart_desktop.template
+++ b/data/supertuxkart_desktop.template
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=SuperTuxKart
-Icon=@PREFIX@/share/pixmaps/supertuxkart_64.xpm
+Icon=@PREFIX@/share/pixmaps/supertuxkart_128.png
GenericName=A kart racing game
GenericName[de_DE]=Ein Kart-Rennspiel
GenericName[fr_FR]=Un jeu de karting
diff --git a/lib/irrlicht/changes.stk b/lib/irrlicht/changes.stk
index 2a9e1317e..bc454834d 100644
--- a/lib/irrlicht/changes.stk
+++ b/lib/irrlicht/changes.stk
@@ -5,8 +5,10 @@ The following changes have been made:
- drawall types
- materialtype override
- skies respect Z
-- partial backport to expose setCurrentRendertime in the scene mgr
+- partial backport to expose setCurrentRendertime in the scene mgr (upstream)
- a workaround for every other RTTs flipping
-- aabbox intersection support
+- aabbox intersection support (upstream)
- texture override
- non-triangle VBO support
+- extension order mismatch
+- support for some RG texture formats
diff --git a/lib/irrlicht/include/IImage.h b/lib/irrlicht/include/IImage.h
index 2cb1f8cf1..a2a93b252 100644
--- a/lib/irrlicht/include/IImage.h
+++ b/lib/irrlicht/include/IImage.h
@@ -111,6 +111,14 @@ public:
return 24;
case ECF_A8R8G8B8:
return 32;
+ case ECF_R8:
+ return 8;
+ case ECF_R8G8:
+ return 16;
+ case ECF_R16:
+ return 16;
+ case ECF_R16G16:
+ return 32;
case ECF_R16F:
return 16;
case ECF_G16R16F:
diff --git a/lib/irrlicht/include/SColor.h b/lib/irrlicht/include/SColor.h
index b61bbef97..8b6c2afa1 100644
--- a/lib/irrlicht/include/SColor.h
+++ b/lib/irrlicht/include/SColor.h
@@ -31,6 +31,12 @@ namespace video
//! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
ECF_A8R8G8B8,
+ //! The normalized non-float formats from the _rg extension
+ ECF_R8,
+ ECF_R8G8,
+ ECF_R16,
+ ECF_R16G16,
+
/** Floating Point formats. The following formats may only be used for render target textures. */
//! 16 bit floating point format using 16 bits for the red channel.
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
index a2ba02af2..938dfc5f8 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
+++ b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
@@ -4425,6 +4425,23 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
else
type = GL_UNSIGNED_BYTE;
break;
+ case ECF_R8G8:
+ // GL_ARB_texture_rg is considered always available in headers. No ifdefs.
+ fmt = GL_RG;
+ type = GL_UNSIGNED_BYTE;
+ break;
+ case ECF_R16G16:
+ fmt = GL_RG;
+ type = GL_UNSIGNED_SHORT;
+ break;
+ case ECF_R8:
+ fmt = GL_RED;
+ type = GL_UNSIGNED_BYTE;
+ break;
+ case ECF_R16:
+ fmt = GL_RED;
+ type = GL_UNSIGNED_SHORT;
+ break;
case ECF_R16F:
if (FeatureAvailable[IRR_ARB_texture_rg])
fmt = GL_RED;
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h b/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h
index 109e2430b..435ed2368 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h
+++ b/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h
@@ -562,8 +562,8 @@ class COpenGLExtensionHandler
IRR_ARB_fragment_shader,
IRR_ARB_framebuffer_object,
IRR_ARB_framebuffer_sRGB,
- IRR_ARB_geometry_shader4,
IRR_ARB_get_program_binary,
+ IRR_ARB_geometry_shader4,
IRR_ARB_gpu_shader5,
IRR_ARB_gpu_shader_fp64,
IRR_ARB_half_float_pixel,
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp b/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
index 7eea57cf4..03cbbdebd 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
+++ b/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
@@ -159,6 +159,28 @@ GLint COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat(ECOLOR_FORMAT
type=GL_UNSIGNED_INT_8_8_8_8_REV;
internalformat = GL_RGBA;
break;
+ // _rg formats.
+ case ECF_R8:
+ colorformat = GL_RED;
+ type = GL_UNSIGNED_BYTE;
+ internalformat = GL_R8;
+ break;
+ case ECF_R16:
+ colorformat = GL_RED;
+ type = GL_UNSIGNED_SHORT;
+ internalformat = GL_R16;
+ break;
+ case ECF_R8G8:
+ colorformat = GL_RG;
+ type = GL_UNSIGNED_BYTE;
+ internalformat = GL_RG8;
+ break;
+ case ECF_R16G16:
+ colorformat = GL_RG;
+ type = GL_UNSIGNED_SHORT;
+ internalformat = GL_RG16;
+ break;
+
// Floating Point texture formats. Thanks to Patryk "Nadro" Nadrowski.
case ECF_R16F:
{
diff --git a/sources.cmake b/sources.cmake
index 1228d1ec5..f1b8187b2 100644
--- a/sources.cmake
+++ b/sources.cmake
@@ -288,6 +288,7 @@ src/utils/log.cpp
src/utils/profiler.cpp
src/utils/random_generator.cpp
src/utils/string_utils.cpp
+src/utils/time.cpp
src/utils/translation.cpp
src/utils/vec3.cpp
)
diff --git a/src/Makefile.am b/src/Makefile.am
index ec510b3bb..16177fb07 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -510,6 +510,7 @@ supertuxkart_SOURCES = \
utils/string_utils.hpp \
utils/synchronised.hpp \
utils/time.hpp \
+ utils/time.cpp \
utils/translation.cpp \
utils/translation.hpp \
utils/utf8.h \
diff --git a/src/addons/addon.cpp b/src/addons/addon.cpp
index 864261a7e..515b9e03d 100644
--- a/src/addons/addon.cpp
+++ b/src/addons/addon.cpp
@@ -162,7 +162,7 @@ void Addon::writeXML(std::ofstream *out_stream)
// ----------------------------------------------------------------------------
std::string Addon::getDateAsString() const
{
- return Time::toString(m_date);
+ return StkTime::toString(m_date);
} // getDateAsString
// ----------------------------------------------------------------------------
diff --git a/src/addons/addon.hpp b/src/addons/addon.hpp
index 3e5002aaf..f04465da3 100644
--- a/src/addons/addon.hpp
+++ b/src/addons/addon.hpp
@@ -99,7 +99,7 @@ private:
* in the addons.xml file. */
bool m_still_exists;
/** Date when the addon was added. */
- Time::TimeType m_date;
+ StkTime::TimeType m_date;
/** A description of this addon. */
core::stringw m_description;
/** The URL of the icon (relative to the server) */
@@ -171,7 +171,7 @@ public:
// ------------------------------------------------------------------------
/** Returns the date (in seconds since epoch) when the addon was
* uploaded. */
- Time::TimeType getDate() const { return m_date; }
+ StkTime::TimeType getDate() const { return m_date; }
// ------------------------------------------------------------------------
/** Returns a user readable date as a string. */
std::string getDateAsString() const;
diff --git a/src/addons/network_http.cpp b/src/addons/network_http.cpp
index 2646e19f8..da8587a4b 100644
--- a/src/addons/network_http.cpp
+++ b/src/addons/network_http.cpp
@@ -270,7 +270,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
bool download = UserConfigParams::m_news_last_updated==0 ||
UserConfigParams::m_news_last_updated
+UserConfigParams::m_news_frequency
- < Time::getTimeSinceEpoch() || forceRefresh;
+ < StkTime::getTimeSinceEpoch() || forceRefresh;
if(!download)
{
@@ -303,7 +303,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
{
std::string xml_file = file_manager->getAddonsFile("news.xml");
if(download)
- UserConfigParams::m_news_last_updated = Time::getTimeSinceEpoch();
+ UserConfigParams::m_news_last_updated = StkTime::getTimeSinceEpoch();
const XMLNode *xml = new XMLNode(xml_file);
// A proper news file has at least a version number, mtime, and
@@ -319,7 +319,7 @@ CURLcode NetworkHttp::init(bool forceRefresh)
status = downloadFileInternal(&r);
if(status==CURLE_OK)
UserConfigParams::m_news_last_updated =
- Time::getTimeSinceEpoch();
+ StkTime::getTimeSinceEpoch();
delete xml;
xml = new XMLNode(xml_file);
}
@@ -416,7 +416,7 @@ CURLcode NetworkHttp::loadAddonsList(const XMLNode *xml,
bool forceRefresh)
{
std::string addon_list_url("");
- Time::TimeType mtime(0);
+ StkTime::TimeType mtime(0);
const XMLNode *include = xml->getNode("include");
if(include)
{
@@ -456,7 +456,7 @@ CURLcode NetworkHttp::loadAddonsList(const XMLNode *xml,
{
std::string xml_file = file_manager->getAddonsFile("addons.xml");
if(download)
- UserConfigParams::m_addons_last_updated=Time::getTimeSinceEpoch();
+ UserConfigParams::m_addons_last_updated=StkTime::getTimeSinceEpoch();
const XMLNode *xml = new XMLNode(xml_file);
addons_manager->initOnline(xml);
if(UserConfigParams::logAddons())
diff --git a/src/addons/news_manager.cpp b/src/addons/news_manager.cpp
index eb75f7abd..5f70e4f92 100644
--- a/src/addons/news_manager.cpp
+++ b/src/addons/news_manager.cpp
@@ -50,7 +50,7 @@ NewsManager::~NewsManager()
*/
void NewsManager::init()
{
- UserConfigParams::m_news_last_updated = Time::getTimeSinceEpoch();
+ UserConfigParams::m_news_last_updated = StkTime::getTimeSinceEpoch();
std::string xml_file = file_manager->getAddonsFile("news.xml");
const XMLNode *xml = new XMLNode(xml_file);
diff --git a/src/audio/sfx_openal.cpp b/src/audio/sfx_openal.cpp
index 123b15b99..22a340851 100644
--- a/src/audio/sfx_openal.cpp
+++ b/src/audio/sfx_openal.cpp
@@ -20,11 +20,11 @@
#if HAVE_OGGVORBIS
#include "audio/sfx_openal.hpp"
+
#include "audio/sfx_buffer.hpp"
+#include "config/user_config.hpp"
+#include "io/file_manager.hpp"
#include "race/race_manager.hpp"
-#include
-#include
-#include
#ifdef __APPLE__
# include
@@ -32,8 +32,16 @@
# include
#endif
-#include "config/user_config.hpp"
-#include "io/file_manager.hpp"
+#include
+#include
+#include
+
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define isnan _isnan
+#else
+# include
+#endif
+
SFXOpenAL::SFXOpenAL(SFXBuffer* buffer, bool positional, float gain, bool ownsBuffer) : SFXBase()
{
@@ -121,7 +129,7 @@ bool SFXOpenAL::init()
*/
void SFXOpenAL::speed(float factor)
{
- if(!m_ok) return;
+ if(!m_ok || isnan(factor)) return;
//OpenAL only accepts pitches in the range of 0.5 to 2.0
if(factor > 2.0f)
diff --git a/src/config/player.cpp b/src/config/player.cpp
index dacbcc19d..542d56972 100644
--- a/src/config/player.cpp
+++ b/src/config/player.cpp
@@ -79,7 +79,7 @@ void PlayerProfile::incrementUseFrequency()
//------------------------------------------------------------------------------
int64_t PlayerProfile::generateUniqueId(const char* playerName)
{
- return ((int64_t)(Time::getTimeSinceEpoch()) << 32) |
+ return ((int64_t)(StkTime::getTimeSinceEpoch()) << 32) |
((rand() << 16) & 0xFFFF0000) |
(StringUtils::simpleHash(playerName) & 0xFFFF);
}
diff --git a/src/config/user_config.cpp b/src/config/user_config.cpp
index 5b508ff7c..ee4cff379 100644
--- a/src/config/user_config.cpp
+++ b/src/config/user_config.cpp
@@ -398,7 +398,7 @@ void IntUserConfigParam::findYourDataInAnAttributeOf(const XMLNode* node)
} // findYourDataInAnAttributeOf
// ============================================================================
-TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
+TimeUserConfigParam::TimeUserConfigParam(StkTime::TimeType default_value,
const char* param_name,
const char* comment)
{
@@ -410,7 +410,7 @@ TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
} // TimeUserConfigParam
// ----------------------------------------------------------------------------
-TimeUserConfigParam::TimeUserConfigParam(Time::TimeType default_value,
+TimeUserConfigParam::TimeUserConfigParam(StkTime::TimeType default_value,
const char* param_name,
GroupUserConfigParam* group,
const char* comment)
diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp
index 2a7cbdd88..fcc0b34c1 100644
--- a/src/config/user_config.hpp
+++ b/src/config/user_config.hpp
@@ -171,14 +171,14 @@ public:
// ============================================================================
class TimeUserConfigParam : public UserConfigParam
{
- Time::TimeType m_value;
- Time::TimeType m_default_value;
+ StkTime::TimeType m_value;
+ StkTime::TimeType m_default_value;
public:
- TimeUserConfigParam(Time::TimeType default_value, const char* param_name,
+ TimeUserConfigParam(StkTime::TimeType default_value, const char* param_name,
const char* comment = NULL);
- TimeUserConfigParam(Time::TimeType default_value, const char* param_name,
+ TimeUserConfigParam(StkTime::TimeType default_value, const char* param_name,
GroupUserConfigParam* group, const char* comment=NULL);
void write(XMLWriter& stream) const;
@@ -187,10 +187,10 @@ public:
irr::core::stringw toString() const;
void revertToDefaults() { m_value = m_default_value; }
- operator Time::TimeType() const { return m_value; }
- Time::TimeType& operator=(const Time::TimeType& v)
+ operator StkTime::TimeType() const { return m_value; }
+ StkTime::TimeType& operator=(const StkTime::TimeType& v)
{ m_value = v; return m_value; }
- Time::TimeType& operator=(const TimeUserConfigParam& v)
+ StkTime::TimeType& operator=(const TimeUserConfigParam& v)
{ m_value = (int)v; return m_value; }
}; // TimeUserConfigParam
diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp
index fc8ffc356..968170014 100644
--- a/src/graphics/camera.cpp
+++ b/src/graphics/camera.cpp
@@ -442,19 +442,12 @@ void Camera::getCameraSettings(float *above_kart, float *cam_angle,
*/
void Camera::update(float dt)
{
- if (UserConfigParams::m_graphical_effects)
- {
- if (m_rain)
- {
- m_rain->setPosition( getCameraSceneNode()->getPosition() );
- m_rain->update(dt);
- }
- } // UserConfigParams::m_graphical_effects
-
+ float above_kart, cam_angle, side_way, distance;
+ bool smoothing;
// The following settings give a debug camera which shows the track from
// high above the kart straight down.
- if(UserConfigParams::m_camera_debug)
+ if (UserConfigParams::m_camera_debug)
{
core::vector3df xyz = m_kart->getXYZ().toIrrVector();
m_camera->setTarget(xyz);
@@ -464,24 +457,18 @@ void Camera::update(float dt)
// To view inside tunnels (FIXME 27>15 why??? makes no sense
// - the kart should not be visible, but it works)
m_camera->setNearValue(27.0);
- return;
}
- if(m_mode==CM_FINAL)
+ else if (m_mode==CM_FINAL)
{
handleEndCamera(dt);
- return;
}
- float above_kart, cam_angle, side_way, distance;
- bool smoothing;
- getCameraSettings(&above_kart, &cam_angle, &side_way, &distance,
- &smoothing);
-
// If an explosion is happening, stop moving the camera,
// but keep it target on the kart.
- if(dynamic_cast(m_kart->getKartAnimation()))
+ else if (dynamic_cast(m_kart->getKartAnimation()))
{
+ getCameraSettings(&above_kart, &cam_angle, &side_way, &distance, &smoothing);
// The camera target needs to be 'smooth moved', otherwise
// there will be a noticable jump in the first frame
@@ -495,10 +482,19 @@ void Camera::update(float dt)
current_target += ((wanted_target-current_target)*m_target_speed)*dt;
m_camera->setTarget(current_target);
- return;
}
- positionCamera(dt, above_kart, cam_angle, side_way, distance, smoothing);
+ else
+ {
+ getCameraSettings(&above_kart, &cam_angle, &side_way, &distance, &smoothing);
+ positionCamera(dt, above_kart, cam_angle, side_way, distance, smoothing);
+ }
+
+ if (UserConfigParams::m_graphical_effects && m_rain)
+ {
+ m_rain->setPosition( getCameraSceneNode()->getPosition() );
+ m_rain->update(dt);
+ } // UserConfigParams::m_graphical_effects
} // update
// ----------------------------------------------------------------------------
diff --git a/src/guiengine/abstract_top_level_container.cpp b/src/guiengine/abstract_top_level_container.cpp
index 1210ace7d..c8ed60363 100644
--- a/src/guiengine/abstract_top_level_container.cpp
+++ b/src/guiengine/abstract_top_level_container.cpp
@@ -19,6 +19,7 @@
#include "guiengine/engine.hpp"
#include "guiengine/scalable_font.hpp"
#include "guiengine/widget.hpp"
+#include "graphics/irr_driver.hpp"
#include "io/file_manager.hpp"
#include "utils/ptr_vector.hpp"
@@ -28,10 +29,10 @@
using namespace GUIEngine;
+using namespace irr;
using namespace core;
using namespace gui;
using namespace io;
-using namespace irr;
using namespace scene;
using namespace video;
diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp
index 57e0e2dbf..14aefdb75 100644
--- a/src/guiengine/skin.cpp
+++ b/src/guiengine/skin.cpp
@@ -1557,9 +1557,9 @@ void Skin::drawListSelection(const core::recti &rect, Widget* widget,
void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
Widget* widget)
{
- bool isSelected =(((ListWidget*)widget->m_event_handler)->m_selected_column
- == widget);
-
+ bool isSelected =
+ (((ListWidget*)widget->m_event_handler)->m_selected_column == widget &&
+ ((ListWidget*)widget->m_event_handler)->m_sort_default == false);
drawBoxFromStretchableTexture(widget, rect,
(isSelected ? SkinConfig::m_render_params["list_header::down"]
@@ -1572,10 +1572,11 @@ void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
ITexture* img;
if (((ListWidget*)widget->m_event_handler)->m_sort_desc)
img =
- SkinConfig::m_render_params["list_sort_down::neutral"].getImage();
+ SkinConfig::m_render_params["list_sort_up::neutral"].getImage();
else
img =
- SkinConfig::m_render_params["list_sort_up::neutral"].getImage();
+ SkinConfig::m_render_params["list_sort_down::neutral"].getImage();
+
core::recti destRect(rect.UpperLeftCorner,
core::dimension2di(rect.getHeight(),
rect.getHeight()));
diff --git a/src/guiengine/widgets/CGUIEditBox.cpp b/src/guiengine/widgets/CGUIEditBox.cpp
index cc548d655..264f8cf48 100644
--- a/src/guiengine/widgets/CGUIEditBox.cpp
+++ b/src/guiengine/widgets/CGUIEditBox.cpp
@@ -26,9 +26,9 @@
*/
-Time::TimeType getTime()
+StkTime::TimeType getTime()
{
- return Time::getTimeSinceEpoch();
+ return StkTime::getTimeSinceEpoch();
}
//! constructor
diff --git a/src/guiengine/widgets/CGUIEditBox.h b/src/guiengine/widgets/CGUIEditBox.h
index c2cf7c5aa..763780c9a 100644
--- a/src/guiengine/widgets/CGUIEditBox.h
+++ b/src/guiengine/widgets/CGUIEditBox.h
@@ -149,7 +149,7 @@ using namespace gui;
gui::IGUIFont *OverrideFont, *LastBreakFont;
IOSOperator* Operator;
- Time::TimeType BlinkStartTime;
+ StkTime::TimeType BlinkStartTime;
s32 CursorPos;
s32 HScrollPos, VScrollPos; // scroll position in characters
u32 Max;
diff --git a/src/guiengine/widgets/CGUISTKListBox.cpp b/src/guiengine/widgets/CGUISTKListBox.cpp
index c23e88475..9c6b597aa 100644
--- a/src/guiengine/widgets/CGUISTKListBox.cpp
+++ b/src/guiengine/widgets/CGUISTKListBox.cpp
@@ -115,7 +115,7 @@ void CGUISTKListBox::removeItem(u32 id)
else if ((u32)Selected > id)
{
Selected -= 1;
- selectTime = (u32)Time::getTimeSinceEpoch();
+ selectTime = (u32)StkTime::getTimeSinceEpoch();
}
Items.erase(id);
@@ -205,7 +205,7 @@ void CGUISTKListBox::setSelected(s32 id)
else
Selected = id;
- selectTime = (u32)Time::getTimeSinceEpoch();
+ selectTime = (u32)StkTime::getTimeSinceEpoch();
recalculateScrollPos();
}
@@ -397,7 +397,7 @@ bool CGUISTKListBox::OnEvent(const SEvent& event)
void CGUISTKListBox::selectNew(s32 ypos, bool onlyHover)
{
- u32 now = (u32)Time::getTimeSinceEpoch();
+ u32 now = (u32)StkTime::getTimeSinceEpoch();
s32 oldSelected = Selected;
Selected = getItemAt(AbsoluteRect.UpperLeftCorner.X, ypos);
@@ -511,7 +511,7 @@ void CGUISTKListBox::draw()
iconPos, &clientClip,
hasItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) ?
getItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_ICON_HIGHLIGHT),
- selectTime, (u32)Time::getTimeSinceEpoch(), false, true);
+ selectTime, (u32)StkTime::getTimeSinceEpoch(), false, true);
}
else
{
@@ -520,7 +520,7 @@ void CGUISTKListBox::draw()
iconPos,
&clientClip,
hasItemOverrideColor(i, EGUI_LBC_ICON) ? getItemOverrideColor(i, EGUI_LBC_ICON) : getItemDefaultColor(EGUI_LBC_ICON),
- 0 , (i==Selected) ? (u32)Time::getTimeSinceEpoch() : 0, false, true);
+ 0 , (i==Selected) ? (u32)StkTime::getTimeSinceEpoch() : 0, false, true);
}
textRect.UpperLeftCorner.X += ItemsIconWidth;
}
diff --git a/src/guiengine/widgets/list_widget.cpp b/src/guiengine/widgets/list_widget.cpp
index 7aad575f0..f5a74d563 100644
--- a/src/guiengine/widgets/list_widget.cpp
+++ b/src/guiengine/widgets/list_widget.cpp
@@ -41,6 +41,7 @@ ListWidget::ListWidget() : Widget(WTYPE_LIST)
m_listener = NULL;
m_selected_column = NULL;
m_sort_desc = true;
+ m_sort_default = true;
}
// -----------------------------------------------------------------------------
@@ -358,6 +359,8 @@ void ListWidget::elementRemoved()
}
m_header_elements.clearAndDeleteAll();
m_selected_column = NULL;
+ m_sort_desc = true;
+ m_sort_default = true;
}
// -----------------------------------------------------------------------------
@@ -413,12 +416,22 @@ EventPropagation ListWidget::transmitEvent(Widget* w,
if (originator.find(m_properties[PROP_ID] + "_column_") != std::string::npos)
{
- int col = originator[ (m_properties[PROP_ID] + "_column_").size() ] - '0';
+ if (m_sort_col != originator[(m_properties[PROP_ID] + "_column_").size()] - '0')
+ {
+ m_sort_desc = false;
+ m_sort_default = false;
+ }
+ else
+ {
+ m_sort_default = m_sort_desc && !m_sort_default;
+ if (!m_sort_default) m_sort_desc = !m_sort_desc;
+ }
- m_selected_column = m_header_elements.get(col);
+ m_sort_col = originator[(m_properties[PROP_ID] + "_column_").size()] - '0';
+ m_selected_column = m_header_elements.get(m_sort_col);
/** \brief Allows sort icon to change depending on sort order **/
- m_sort_desc = !m_sort_desc;
+
/*
for (int n=0; n()->setPressed(true);
*/
- if (m_listener) m_listener->onColumnClicked(col);
+ if (m_listener) m_listener->onColumnClicked(m_sort_col);
return EVENT_BLOCK;
}
diff --git a/src/guiengine/widgets/list_widget.hpp b/src/guiengine/widgets/list_widget.hpp
index c56cd450a..267df0f63 100644
--- a/src/guiengine/widgets/list_widget.hpp
+++ b/src/guiengine/widgets/list_widget.hpp
@@ -64,6 +64,12 @@ namespace GUIEngine
/** \brief whether this list is sorted in descending order */
bool m_sort_desc;
+ /** true when deault sorting is enabled */
+ bool m_sort_default;
+
+ /** index of column*/
+ int m_sort_col;
+
struct Column
{
irr::core::stringw m_text;
diff --git a/src/ide/vc10/supertuxkart.vcxproj b/src/ide/vc10/supertuxkart.vcxproj
index 569fe9653..1cfd3073b 100644
--- a/src/ide/vc10/supertuxkart.vcxproj
+++ b/src/ide/vc10/supertuxkart.vcxproj
@@ -313,6 +313,7 @@
+
diff --git a/src/ide/vc10/supertuxkart.vcxproj.filters b/src/ide/vc10/supertuxkart.vcxproj.filters
index 18d447b9c..d07936927 100644
--- a/src/ide/vc10/supertuxkart.vcxproj.filters
+++ b/src/ide/vc10/supertuxkart.vcxproj.filters
@@ -870,6 +870,9 @@
Source Files\guiengine\widgets
+
+ Source Files\utils
+
diff --git a/src/ide/vc9/supertuxkart.vcproj b/src/ide/vc9/supertuxkart.vcproj
index 1a807b8e3..2e8d12cea 100644
--- a/src/ide/vc9/supertuxkart.vcproj
+++ b/src/ide/vc9/supertuxkart.vcproj
@@ -757,6 +757,10 @@
RelativePath="..\..\utils\string_utils.cpp"
>
+
+
diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp
index c56184bdd..8a37d854a 100644
--- a/src/input/input_manager.cpp
+++ b/src/input/input_manager.cpp
@@ -21,6 +21,7 @@
#include "guiengine/event_handler.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/screen.hpp"
+#include "graphics/irr_driver.hpp"
#include "input/device_manager.hpp"
#include "input/input.hpp"
#include "karts/controller/controller.hpp"
diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp
index 949fb7bb4..8c7cecdb9 100644
--- a/src/io/file_manager.cpp
+++ b/src/io/file_manager.cpp
@@ -244,7 +244,7 @@ FileManager::~FileManager()
}
struct stat mystat;
stat(full_path.c_str(), &mystat);
- Time::TimeType current = Time::getTimeSinceEpoch();
+ StkTime::TimeType current = StkTime::getTimeSinceEpoch();
if(current - mystat.st_ctime <24*3600)
{
if(UserConfigParams::logAddons())
diff --git a/src/items/rubber_ball.cpp b/src/items/rubber_ball.cpp
index ffef9e407..0fcac3240 100644
--- a/src/items/rubber_ball.cpp
+++ b/src/items/rubber_ball.cpp
@@ -222,7 +222,7 @@ void RubberBall::getNextControlPoint()
int next = getSuccessorToHitTarget(m_last_aimed_graph_node, &dist);
float d = QuadGraph::get()->getDistanceFromStart(next)-f;
- while(d0)
+ while(d=0)
{
next = getSuccessorToHitTarget(next, &dist);
d = QuadGraph::get()->getDistanceFromStart(next)-f;
diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp
index 5a97dc88f..38d6bef75 100644
--- a/src/karts/kart.cpp
+++ b/src/karts/kart.cpp
@@ -33,6 +33,7 @@
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/explosion.hpp"
+#include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/particle_emitter.hpp"
#include "graphics/particle_kind.hpp"
@@ -124,6 +125,7 @@ Kart::Kart (const std::string& ident, unsigned int world_kart_id,
m_jump_time = 0;
m_is_jumping = false;
m_min_nitro_time = 0.0f;
+ m_fire_clicked = 0;
m_view_blocked_by_plunger = 0;
m_has_caught_nolok_bubblegum = false;
@@ -1145,16 +1147,17 @@ void Kart::update(float dt)
updatePhysics(dt);
- if(m_controls.m_fire && !m_kart_animation)
+ if(!m_controls.m_fire) m_fire_clicked = 0;
+
+ if(m_controls.m_fire && !m_fire_clicked && !m_kart_animation)
{
// use() needs to be called even if there currently is no collecteable
// since use() can test if something needs to be switched on/off.
m_powerup->use() ;
World::getWorld()->onFirePressed(getController());
m_bubble_drop = true;
+ m_fire_clicked = 1;
}
- // Reset the fire button
- m_controls.m_fire = 0;
/* (TODO: add back when properly done)
for (int n = 0; n < SFXManager::NUM_CUSTOMS; n++)
diff --git a/src/karts/kart.hpp b/src/karts/kart.hpp
index e81a14708..1a6609408 100644
--- a/src/karts/kart.hpp
+++ b/src/karts/kart.hpp
@@ -135,6 +135,9 @@ private:
/** The torque to apply after hitting a bubble gum. */
float m_bubblegum_torque;
+
+ /** True if fire button was pushed and not released */
+ bool m_fire_clicked;
diff --git a/src/main.cpp b/src/main.cpp
index bd13b920d..573a18ea4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -196,6 +196,8 @@
#include "utils/log.hpp"
#include "utils/translation.hpp"
+static void cleanSuperTuxKart();
+
// ============================================================================
// gamepad visualisation screen
// ============================================================================
@@ -1098,8 +1100,12 @@ int handleCmdLine(int argc, char **argv)
#endif
else
{
+ // invalid param needs to go to console
+ UserConfigParams::m_log_errors_to_console = true;
+
Log::error("main", "Invalid parameter: %s.\n", argv[i] );
cmdLineHelp(argv[0]);
+ cleanSuperTuxKart();
return 0;
}
} // for i updateConfigIfRelevant();
diff --git a/src/main_loop.cpp b/src/main_loop.cpp
index b836d11d9..4bfd9415d 100644
--- a/src/main_loop.cpp
+++ b/src/main_loop.cpp
@@ -82,7 +82,7 @@ float MainLoop::getLimitedDt()
int wait_time = 1000/max_fps - 1000/current_fps;
if(wait_time < 1) wait_time = 1;
- Time::sleep(wait_time);
+ StkTime::sleep(wait_time);
}
else break;
}
diff --git a/src/modes/cutscene_world.cpp b/src/modes/cutscene_world.cpp
index 2646d3ea1..6f1b7571d 100644
--- a/src/modes/cutscene_world.cpp
+++ b/src/modes/cutscene_world.cpp
@@ -198,7 +198,7 @@ void CutsceneWorld::update(float dt)
curr->reset();
}
m_time = 0.01f;
- m_time_at_second_reset = Time::getRealTime();
+ m_time_at_second_reset = StkTime::getRealTime();
m_second_reset = true;
}
else if (m_second_reset)
@@ -213,7 +213,7 @@ void CutsceneWorld::update(float dt)
}
//m_time_at_second_reset = m_time;
- m_time_at_second_reset = Time::getRealTime();
+ m_time_at_second_reset = StkTime::getRealTime();
m_time = 0.01f;
}
else
@@ -221,7 +221,7 @@ void CutsceneWorld::update(float dt)
// this way of calculating time and dt is more in line with what
// irrlicht does andprovides better synchronisation
double prev_time = m_time;
- double now = Time::getRealTime();
+ double now = StkTime::getRealTime();
m_time = now - m_time_at_second_reset;
dt = (float)(m_time - prev_time);
}
diff --git a/src/modes/soccer_world.cpp b/src/modes/soccer_world.cpp
index 35d2ca51a..9bd42f8ba 100644
--- a/src/modes/soccer_world.cpp
+++ b/src/modes/soccer_world.cpp
@@ -23,6 +23,7 @@
#include "audio/music_manager.hpp"
#include "audio/sfx_base.hpp"
#include "io/file_manager.hpp"
+#include "graphics/irr_driver.hpp"
#include "karts/abstract_kart.hpp"
#include "karts/kart.hpp"
#include "karts/kart_model.hpp"
@@ -104,9 +105,9 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
{
//I18N: soccer mode
m_race_gui->addMessage(_("GOAL!"), NULL,
- /* time */ 3.0f,
+ /* time */ 5.0f,
video::SColor(255,255,255,255),
- /*important*/ true,
+ /*important*/ false,
/*big font*/ true);
m_team_goals[first_goal ? 0 : 1]++;
//printf("Score:\nTeam One %d : %d Team Two\n", m_team_goals[0], m_team_goals[1]);
@@ -389,11 +390,11 @@ AbstractKart *SoccerWorld::createKart(const std::string &kart_ident, int index,
int posIndex = index;
if(race_manager->getLocalKartInfo(index).getSoccerTeam() == SOCCER_TEAM_RED)
{
- if(index % 2 != 0) posIndex += 1;
+ if(index % 2 != 1) posIndex += 1;
}
else if(race_manager->getLocalKartInfo(index).getSoccerTeam() == SOCCER_TEAM_BLUE)
{
- if(index % 2 != 1) posIndex += 1;
+ if(index % 2 != 0) posIndex += 1;
}
int position = index+1;
btTransform init_pos = m_track->getStartTransform(posIndex);
diff --git a/src/modes/soccer_world.hpp b/src/modes/soccer_world.hpp
index e6a1fff06..91d512de3 100644
--- a/src/modes/soccer_world.hpp
+++ b/src/modes/soccer_world.hpp
@@ -1,97 +1,92 @@
-//
-// SuperTuxKart - a fun racing game with go-kart
-// Copyright (C) 2004 SuperTuxKart-Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 3
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#ifndef SOCCER_WORLD_HPP
-#define SOCCER_WORLD_HPP
-
-#include "modes/world_with_rank.hpp"
-#include "states_screens/race_gui_base.hpp"
-#include "karts/abstract_kart.hpp"
-
-
-#include
-
-#include
-
-#define CLEAR_SPAWN_RANGE 5
-
-class PhysicalObject;
-class AbstractKart;
-class Controller;
-
-/**
- * \brief An implementation of World, to provide the soccer game mode
- * \ingroup modes
- */
-class SoccerWorld : public WorldWithRank
-{
-private:
- /** Number of goals each team scored
- */
- int m_team_goals[NB_SOCCER_TEAMS];
- /** Number of goals needed to win
- */
- int m_goal_target;
- /** Whether or not goals can be scored (they are disabled when a point is scored
- and re-enabled when the next game can be played)*/
- bool m_can_score_points;
- SFXBase *m_goal_sound;
-
- /** Team karts */
-
-
-public:
-
- SoccerWorld();
- virtual ~SoccerWorld() {}
-
- virtual void init();
-
- // clock events
- virtual bool isRaceOver();
- virtual void terminateRace();
-
- // overriding World methods
- virtual void reset();
-
- virtual bool useFastMusicNearEnd() const { return false; }
- virtual void getKartsDisplayInfo(
- std::vector *info);
- int getScore(unsigned int i);
- virtual bool raceHasLaps(){ return false; }
- virtual void moveKartAfterRescue(AbstractKart* kart);
-
- virtual const std::string& getIdent() const;
-
- virtual void update(float dt);
-
- virtual void countdownReachedZero();
-
- void onCheckGoalTriggered(bool first_goal);
- int getTeamLeader(unsigned int i);
-
-private:
- void initKartList();
-protected:
- virtual AbstractKart *createKart(const std::string &kart_ident, int index,
- int local_player_id, int global_player_id,
- RaceManager::KartType type);
-}; // SoccerWorld
-
-
-#endif
+//
+// SuperTuxKart - a fun racing game with go-kart
+// Copyright (C) 2004 SuperTuxKart-Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 3
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#ifndef SOCCER_WORLD_HPP
+#define SOCCER_WORLD_HPP
+
+#include "modes/world_with_rank.hpp"
+#include "states_screens/race_gui_base.hpp"
+#include "karts/abstract_kart.hpp"
+
+
+#include
+
+#include
+
+#define CLEAR_SPAWN_RANGE 5
+
+class PhysicalObject;
+class AbstractKart;
+class Controller;
+
+/**
+ * \brief An implementation of World, to provide the soccer game mode
+ * \ingroup modes
+ */
+class SoccerWorld : public WorldWithRank
+{
+private:
+ /** Number of goals each team scored */
+ int m_team_goals[NB_SOCCER_TEAMS];
+ /** Number of goals needed to win */
+ int m_goal_target;
+ /** Whether or not goals can be scored (they are disabled when a point is scored
+ and re-enabled when the next game can be played)*/
+ bool m_can_score_points;
+ SFXBase *m_goal_sound;
+
+public:
+
+ SoccerWorld();
+ virtual ~SoccerWorld() {}
+
+ virtual void init();
+
+ // clock events
+ virtual bool isRaceOver();
+ virtual void terminateRace();
+
+ // overriding World methods
+ virtual void reset();
+
+ virtual bool useFastMusicNearEnd() const { return false; }
+ virtual void getKartsDisplayInfo(
+ std::vector *info);
+ int getScore(unsigned int i);
+ virtual bool raceHasLaps(){ return false; }
+ virtual void moveKartAfterRescue(AbstractKart* kart);
+
+ virtual const std::string& getIdent() const;
+
+ virtual void update(float dt);
+
+ virtual void countdownReachedZero();
+
+ void onCheckGoalTriggered(bool first_goal);
+ int getTeamLeader(unsigned int i);
+
+private:
+ void initKartList();
+protected:
+ virtual AbstractKart *createKart(const std::string &kart_ident, int index,
+ int local_player_id, int global_player_id,
+ RaceManager::KartType type);
+}; // SoccerWorld
+
+
+#endif
diff --git a/src/modes/world.cpp b/src/modes/world.cpp
index 26e4a33b7..8f39b5cee 100644
--- a/src/modes/world.cpp
+++ b/src/modes/world.cpp
@@ -741,6 +741,7 @@ void World::updateWorld(float dt)
race_manager->setNumKarts( 1 );
race_manager->setTrack( "tutorial" );
race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY);
+ race_manager->setReverseTrack(false);
// Use keyboard 0 by default (FIXME: let player choose?)
InputDevice* device = input_manager->getDeviceList()->getKeyboard(0);
diff --git a/src/network/protocol_manager.cpp b/src/network/protocol_manager.cpp
index 282287646..110e49822 100644
--- a/src/network/protocol_manager.cpp
+++ b/src/network/protocol_manager.cpp
@@ -34,7 +34,7 @@ void* protocolManagerUpdate(void* data)
while(manager && !manager->exit())
{
manager->update();
- Time::sleep(2);
+ StkTime::sleep(2);
}
return NULL;
}
@@ -45,7 +45,7 @@ void* protocolManagerAsynchronousUpdate(void* data)
while(manager && !manager->exit())
{
manager->asynchronousUpdate();
- Time::sleep(2);
+ StkTime::sleep(2);
}
manager->m_asynchronous_thread_running = false;
return NULL;
@@ -82,10 +82,8 @@ ProtocolManager::~ProtocolManager()
void ProtocolManager::abort()
{
pthread_mutex_unlock(&m_exit_mutex); // will stop the update function
- while (m_asynchronous_thread_running) // wait the thread to finish before we delete all mutexes etc..
- {
- Time::sleep(2);
- }
+ pthread_join(*m_asynchronous_update_thread, NULL);
+
pthread_mutex_lock(&m_events_mutex);
pthread_mutex_lock(&m_protocols_mutex);
pthread_mutex_lock(&m_asynchronous_protocols_mutex);
@@ -153,7 +151,7 @@ void ProtocolManager::notifyEvent(Event* event)
if (protocols_ids.size() != 0)
{
EventProcessingInfo epi;
- epi.arrival_time = Time::getTimeSinceEpoch();
+ epi.arrival_time = StkTime::getTimeSinceEpoch();
epi.event = event2;
epi.protocols_ids = protocols_ids;
m_events_to_process.push_back(epi); // add the event to the queue
@@ -346,7 +344,7 @@ bool ProtocolManager::propagateEvent(EventProcessingInfo* event, bool synchronou
index++;
}
}
- if (event->protocols_ids.size() == 0 || (Time::getTimeSinceEpoch()-event->arrival_time) >= TIME_TO_KEEP_EVENTS)
+ if (event->protocols_ids.size() == 0 || (StkTime::getTimeSinceEpoch()-event->arrival_time) >= TIME_TO_KEEP_EVENTS)
{
// because we made a copy of the event
delete event->event->peer; // no more need of that
diff --git a/src/network/protocols/connect_to_peer.cpp b/src/network/protocols/connect_to_peer.cpp
index 4cffc0f06..907999c9e 100644
--- a/src/network/protocols/connect_to_peer.cpp
+++ b/src/network/protocols/connect_to_peer.cpp
@@ -97,7 +97,7 @@ void ConnectToPeer::asynchronousUpdate()
char data[] = "aloha_stk\0";
host->sendRawPacket((uint8_t*)(data), 10, broadcast_address);
Log::info("ConnectToPeer", "Broadcast aloha sent.");
- Time::sleep(1);
+ StkTime::sleep(1);
broadcast_address.ip = 0x7f000001; // 127.0.0.1 (localhost)
broadcast_address.port = m_peer_address.port;
host->sendRawPacket((uint8_t*)(data), 10, broadcast_address);
diff --git a/src/network/protocols/connect_to_server.cpp b/src/network/protocols/connect_to_server.cpp
index 7cd6da09c..c9b70ae7c 100644
--- a/src/network/protocols/connect_to_server.cpp
+++ b/src/network/protocols/connect_to_server.cpp
@@ -243,9 +243,9 @@ void ConnectToServer::asynchronousUpdate()
case CONNECTING: // waiting the server to answer our connection
{
static double timer = 0;
- if (Time::getRealTime() > timer+5.0) // every 5 seconds
+ if (StkTime::getRealTime() > timer+5.0) // every 5 seconds
{
- timer = Time::getRealTime();
+ timer = StkTime::getRealTime();
NetworkManager::getInstance()->connect(m_server_address);
Log::info("ConnectToServer", "Trying to connect to %u:%u", m_server_address.ip, m_server_address.port);
}
diff --git a/src/network/protocols/kart_update_protocol.cpp b/src/network/protocols/kart_update_protocol.cpp
index 0dbf40dae..67d351cd4 100644
--- a/src/network/protocols/kart_update_protocol.cpp
+++ b/src/network/protocols/kart_update_protocol.cpp
@@ -71,7 +71,7 @@ void KartUpdateProtocol::update()
if (!World::getWorld())
return;
static double time = 0;
- double current_time = Time::getRealTime();
+ double current_time = StkTime::getRealTime();
if (current_time > time + 0.1) // 10 updates per second
{
time = current_time;
diff --git a/src/network/protocols/lobby_room_protocol.hpp b/src/network/protocols/lobby_room_protocol.hpp
index b0c5b2578..e288eaaaf 100644
--- a/src/network/protocols/lobby_room_protocol.hpp
+++ b/src/network/protocols/lobby_room_protocol.hpp
@@ -28,7 +28,7 @@
class RaceConfig
{
int m_world_type;
-}
+};
/*!
* \class LobbyRoomProtocol
diff --git a/src/network/protocols/ping_protocol.cpp b/src/network/protocols/ping_protocol.cpp
index 7cfa790bc..7fd5232ed 100644
--- a/src/network/protocols/ping_protocol.cpp
+++ b/src/network/protocols/ping_protocol.cpp
@@ -38,9 +38,9 @@ void PingProtocol::setup()
void PingProtocol::asynchronousUpdate()
{
- if (Time::getRealTime() > m_last_ping_time+m_delay_between_pings)
+ if (StkTime::getRealTime() > m_last_ping_time+m_delay_between_pings)
{
- m_last_ping_time = Time::getRealTime();
+ m_last_ping_time = StkTime::getRealTime();
uint8_t data = 0;
NetworkManager::getInstance()->getHost()->sendRawPacket(&data, 1, m_ping_dst);
Log::info("PingProtocol", "Ping message sent");
diff --git a/src/network/protocols/server_lobby_room_protocol.cpp b/src/network/protocols/server_lobby_room_protocol.cpp
index f0d8db68b..b4fa3eebb 100644
--- a/src/network/protocols/server_lobby_room_protocol.cpp
+++ b/src/network/protocols/server_lobby_room_protocol.cpp
@@ -164,9 +164,9 @@ void ServerLobbyRoomProtocol::checkIncomingConnectionRequests()
{
// first poll every 5 seconds
static double last_poll_time = 0;
- if (Time::getRealTime() > last_poll_time+10.0)
+ if (StkTime::getRealTime() > last_poll_time+10.0)
{
- last_poll_time = Time::getRealTime();
+ last_poll_time = StkTime::getRealTime();
TransportAddress addr = NetworkManager::getInstance()->getPublicAddress();
Online::XMLRequest* request = new Online::XMLRequest();
request->setURL((std::string)UserConfigParams::m_server_multiplayer + "address-management.php");
diff --git a/src/network/protocols/synchronization_protocol.cpp b/src/network/protocols/synchronization_protocol.cpp
index dfbad7d1b..23eb8921f 100644
--- a/src/network/protocols/synchronization_protocol.cpp
+++ b/src/network/protocols/synchronization_protocol.cpp
@@ -96,7 +96,7 @@ bool SynchronizationProtocol::notifyEventAsynchronous(Event* event)
Log::warn("SynchronizationProtocol", "The sequence# %u isn't known.", sequence);
return true;
}
- double current_time = Time::getRealTime();
+ double current_time = StkTime::getRealTime();
m_total_diff[peer_id] += current_time - m_pings[peer_id][sequence];
Log::verbose("SynchronizationProtocol", "InstantPing is %u",
(unsigned int)((current_time - m_pings[peer_id][sequence])*1000));
@@ -121,8 +121,8 @@ void SynchronizationProtocol::setup()
void SynchronizationProtocol::asynchronousUpdate()
{
- static double timer = Time::getRealTime();
- double current_time = Time::getRealTime();
+ static double timer = StkTime::getRealTime();
+ double current_time = StkTime::getRealTime();
if (m_countdown_activated)
{
m_countdown -= (current_time - m_last_countdown_update);
@@ -178,6 +178,6 @@ void SynchronizationProtocol::startCountdown(int ms_countdown)
{
m_countdown_activated = true;
m_countdown = (double)(ms_countdown)/1000.0;
- m_last_countdown_update = Time::getRealTime();
+ m_last_countdown_update = StkTime::getRealTime();
Log::info("SynchronizationProtocol", "Countdown started with value %f", m_countdown);
}
diff --git a/src/network/server_network_manager.cpp b/src/network/server_network_manager.cpp
index dde90a334..7e917d9a5 100644
--- a/src/network/server_network_manager.cpp
+++ b/src/network/server_network_manager.cpp
@@ -67,7 +67,7 @@ void* waitInput2(void* data)
uint32_t id = ProtocolManager::getInstance()->requestStart(new StopServer());
while(ProtocolManager::getInstance()->getProtocolState(id) != PROTOCOL_STATE_TERMINATED)
{
- Time::sleep(1);
+ StkTime::sleep(1);
}
main_loop->abort();
diff --git a/src/network/stk_host.cpp b/src/network/stk_host.cpp
index 163cd5400..2ad40aeac 100644
--- a/src/network/stk_host.cpp
+++ b/src/network/stk_host.cpp
@@ -43,9 +43,9 @@ void STKHost::logPacket(const NetworkString ns, bool incoming)
return;
pthread_mutex_lock(&m_log_mutex);
if (incoming)
- fprintf(m_log_file, "[%d\t] <-- ", (int)(Time::getRealTime()));
+ fprintf(m_log_file, "[%d\t] <-- ", (int)(StkTime::getRealTime()));
else
- fprintf(m_log_file, "[%d\t] --> ", (int)(Time::getRealTime()));
+ fprintf(m_log_file, "[%d\t] --> ", (int)(StkTime::getRealTime()));
for (int i = 0; i < ns.size(); i++)
{
fprintf(m_log_file, "%d.", ns[i]);
@@ -170,10 +170,7 @@ void STKHost::stopListening()
if(m_listening_thread)
{
pthread_mutex_unlock(&m_exit_mutex); // will stop the update function on its next update
- while (m_listening == true)
- {
- Time::sleep(1);
- }
+ pthread_join(*m_listening_thread, NULL); // wait the thread to end
}
}
@@ -210,7 +207,7 @@ uint8_t* STKHost::receiveRawPacket()
{
i++;
len = recv(m_host->socket,(char*)buffer,2048, 0);
- Time::sleep(1);
+ StkTime::sleep(1);
}
STKHost::logPacket(NetworkString(std::string((char*)(buffer), len)), true);
return buffer;
@@ -236,7 +233,7 @@ uint8_t* STKHost::receiveRawPacket(TransportAddress* sender)
{
i++;
len = recvfrom(m_host->socket, (char*)buffer, 2048, 0, (struct sockaddr*)(&addr), &from_len);
- Time::sleep(1); // wait 1 millisecond between two checks
+ StkTime::sleep(1); // wait 1 millisecond between two checks
}
if (len == SOCKET_ERROR)
{
@@ -284,7 +281,7 @@ uint8_t* STKHost::receiveRawPacket(TransportAddress sender, int max_tries)
uint32_t addr2 = sender.ip;
uint32_t addr3 = ntohl(addr1);
uint32_t addr4 = ntohl(addr2);
- Time::sleep(1); // wait 1 millisecond between two checks
+ StkTime::sleep(1); // wait 1 millisecond between two checks
if (i >= max_tries && max_tries != -1)
{
Log::verbose("STKHost", "No answer from the server on %u.%u.%u.%u:%u", (m_host->address.host&0xff),
diff --git a/src/online/messages.cpp b/src/online/messages.cpp
index 3aaf3ea9a..672b4d6e0 100644
--- a/src/online/messages.cpp
+++ b/src/online/messages.cpp
@@ -92,7 +92,7 @@ namespace Online
// ------------------------------------------------------------------------
irr::core::stringw loadingDots(bool spaces, float interval, int max_dots)
{
- int nr_dots = int(floor(Time::getRealTime() * (1 / interval))) % (max_dots+1);
+ int nr_dots = int(floor(StkTime::getRealTime() * (1 / interval))) % (max_dots+1);
return irr::core::stringw((std::string(nr_dots,'.') + std::string(max_dots-nr_dots,' ')).c_str());
}
} // namespace messages
diff --git a/src/online/request.cpp b/src/online/request.cpp
index f13ba0222..62429ce6a 100644
--- a/src/online/request.cpp
+++ b/src/online/request.cpp
@@ -18,6 +18,7 @@
#include "online/http_manager.hpp"
#include "utils/translation.hpp"
+#include "utils/constants.hpp"
#ifdef WIN32
# include
diff --git a/src/online/servers_manager.cpp b/src/online/servers_manager.cpp
index 128165a4d..6184a91b4 100644
--- a/src/online/servers_manager.cpp
+++ b/src/online/servers_manager.cpp
@@ -72,7 +72,7 @@ namespace Online{
ServersManager::RefreshRequest * ServersManager::refreshRequest(bool request_now) const
{
RefreshRequest * request = NULL;
- if(Time::getRealTime() - m_last_load_time.getAtomic() > SERVER_REFRESH_INTERVAL)
+ if(StkTime::getRealTime() - m_last_load_time.getAtomic() > SERVER_REFRESH_INTERVAL)
{
request = new RefreshRequest();
request->setURL((std::string)UserConfigParams::m_server_multiplayer + "client-user.php");
@@ -93,7 +93,7 @@ namespace Online{
{
addServer(new Server(*servers_xml->getNode(i)));
}
- m_last_load_time.setAtomic((float)Time::getRealTime());
+ m_last_load_time.setAtomic((float)StkTime::getRealTime());
}
//FIXME error message
}
diff --git a/src/physics/irr_debug_drawer.cpp b/src/physics/irr_debug_drawer.cpp
index 690790545..4937ad284 100644
--- a/src/physics/irr_debug_drawer.cpp
+++ b/src/physics/irr_debug_drawer.cpp
@@ -18,6 +18,7 @@
#include "physics/irr_debug_drawer.hpp"
+#include "graphics/irr_driver.hpp"
#include "karts/abstract_kart.hpp"
#include "modes/world.hpp"
diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp
index 976f829ac..dd3007ff6 100644
--- a/src/physics/physics.cpp
+++ b/src/physics/physics.cpp
@@ -20,6 +20,7 @@
#include "animations/three_d_animation.hpp"
#include "karts/abstract_kart.hpp"
+#include "graphics/irr_driver.hpp"
#include "karts/kart_properties.hpp"
#include "karts/rescue_animation.hpp"
#include "items/flyable.hpp"
diff --git a/src/states_screens/addons_screen.cpp b/src/states_screens/addons_screen.cpp
index 5bb26cc46..419cb2f8e 100644
--- a/src/states_screens/addons_screen.cpp
+++ b/src/states_screens/addons_screen.cpp
@@ -137,6 +137,8 @@ void AddonsScreen::init()
m_reloading = false;
m_sort_desc = true;
+ m_sort_default = true;
+ m_sort_col = 0;
getWidget("category")->setDeactivated();
@@ -205,8 +207,8 @@ void AddonsScreen::loadList()
GUIEngine::SpinnerWidget* w_filter_date =
getWidget("filter_date");
int date_index = w_filter_date->getValue();
- Time::TimeType date = Time::getTimeSinceEpoch();
- date = Time::addInterval(date,
+ StkTime::TimeType date = StkTime::getTimeSinceEpoch();
+ date = StkTime::addInterval(date,
-m_date_filters[date_index].year,
-m_date_filters[date_index].month,
-m_date_filters[date_index].day);
@@ -238,7 +240,7 @@ void AddonsScreen::loadList()
continue;
// Filter by date.
- if (date_index != 0 && Time::compareTime(date, addon.getDate()) > 0)
+ if (date_index != 0 && StkTime::compareTime(date, addon.getDate()) > 0)
continue;
// Filter by name, designer and description.
@@ -381,14 +383,30 @@ void AddonsScreen::loadList()
// ----------------------------------------------------------------------------
void AddonsScreen::onColumnClicked(int column_id)
{
+ if (m_sort_col != column_id)
+ {
+ m_sort_desc = false;
+ m_sort_default = false;
+ }
+ else
+ {
+ m_sort_default = m_sort_desc && !m_sort_default;
+ if (!m_sort_default) m_sort_desc = !m_sort_desc;
+ }
+
+ m_sort_col = column_id;
+
switch(column_id)
{
- case 0: Addon::setSortOrder(Addon::SO_NAME); break;
- case 1: Addon::setSortOrder(Addon::SO_DATE); break;
+ case 0:
+ Addon::setSortOrder(m_sort_default ? Addon::SO_DEFAULT : Addon::SO_NAME);
+ break;
+ case 1:
+ Addon::setSortOrder(m_sort_default ? Addon::SO_DEFAULT : Addon::SO_DATE);
+ break;
default: assert(0); break;
} // switch
/** \brief Toggle the sort order after column click **/
- m_sort_desc = !m_sort_desc;
loadList();
} // onColumnClicked
diff --git a/src/states_screens/addons_screen.hpp b/src/states_screens/addons_screen.hpp
index d78a2cac8..a454545b2 100644
--- a/src/states_screens/addons_screen.hpp
+++ b/src/states_screens/addons_screen.hpp
@@ -77,6 +77,10 @@ private:
/** \brief To check (and set) if sort order is descending **/
bool m_sort_desc;
+ bool m_sort_default;
+
+ int m_sort_col;
+
/** List of date filters **/
std::vector m_date_filters;
diff --git a/src/states_screens/dialogs/select_challenge.cpp b/src/states_screens/dialogs/select_challenge.cpp
index c8267be1b..23b0a0b4a 100644
--- a/src/states_screens/dialogs/select_challenge.cpp
+++ b/src/states_screens/dialogs/select_challenge.cpp
@@ -17,6 +17,7 @@
#include "challenges/unlock_manager.hpp"
#include "config/user_config.hpp"
+#include "graphics/irr_driver.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/widgets/icon_button_widget.hpp"
#include "guiengine/widgets/label_widget.hpp"
diff --git a/src/states_screens/help_screen_1.cpp b/src/states_screens/help_screen_1.cpp
index e54da3e39..d1a632ff0 100644
--- a/src/states_screens/help_screen_1.cpp
+++ b/src/states_screens/help_screen_1.cpp
@@ -58,6 +58,7 @@ void HelpScreen1::eventCallback(Widget* widget, const std::string& name, const i
race_manager->setNumKarts( 1 );
race_manager->setTrack( "tutorial" );
race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY);
+ race_manager->setReverseTrack(false);
// Use keyboard 0 by default (FIXME: let player choose?)
InputDevice* device = input_manager->getDeviceList()->getKeyboard(0);
diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp
index a32836c6f..486706f16 100644
--- a/src/states_screens/main_menu_screen.cpp
+++ b/src/states_screens/main_menu_screen.cpp
@@ -309,6 +309,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
race_manager->setNumKarts( 1 );
race_manager->setTrack( "tutorial" );
race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY);
+ race_manager->setReverseTrack(false);
// Use keyboard 0 by default (FIXME: let player choose?)
InputDevice* device = input_manager->getDeviceList()->getKeyboard(0);
diff --git a/src/states_screens/race_gui.cpp b/src/states_screens/race_gui.cpp
index 92621f463..c6beea20e 100644
--- a/src/states_screens/race_gui.cpp
+++ b/src/states_screens/race_gui.cpp
@@ -602,11 +602,11 @@ void RaceGUI::drawEnergyMeter(int x, int y, const AbstractKart *kart,
} // drawEnergyMeter
//-----------------------------------------------------------------------------
+
void RaceGUI::drawSpeedAndEnergy(const AbstractKart* kart,
const core::recti &viewport,
const core::vector2df &scaling)
{
-
float minRatio = std::min(scaling.X, scaling.Y);
const int SPEEDWIDTH = 128;
int meter_width = (int)(SPEEDWIDTH*minRatio);
@@ -722,7 +722,14 @@ void RaceGUI::drawSpeedAndEnergy(const AbstractKart* kart,
pos.LowerRightCorner.X=(int)(offset.X + 0.8f*meter_width);
pos.LowerRightCorner.Y=(int)(offset.X - 0.5f*meter_height);
- gui::ScalableFont* font = GUIEngine::getLargeFont();
+ gui::ScalableFont* font;
+
+ if (pos.getWidth() > 55)
+ font = GUIEngine::getLargeFont();
+ else if (pos.getWidth() > 40)
+ font = GUIEngine::getFont();
+ else
+ font = GUIEngine::getSmallFont();
static video::SColor color = video::SColor(255, 255, 255, 255);
char str[256];
diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp
index eb81b1f0f..fa44c6861 100644
--- a/src/states_screens/race_result_gui.cpp
+++ b/src/states_screens/race_result_gui.cpp
@@ -35,6 +35,7 @@
#include "modes/cutscene_world.hpp"
#include "modes/demo_world.hpp"
#include "modes/overworld.hpp"
+#include "modes/soccer_world.hpp"
#include "modes/world_with_rank.hpp"
#include "race/highscores.hpp"
#include "states_screens/feature_unlocked.hpp"
@@ -784,6 +785,12 @@ void RaceResultGUI::determineGPLayout()
void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
unsigned int n, bool display_points)
{
+ SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld();
+ bool isSoccerMode = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
+ int m_team_goals[2] = {soccerWorld->getScore(0), soccerWorld->getScore(1)};
+
+ if (isSoccerMode && n > 0) return;
+
RowInfo *ri = &(m_all_row_infos[n]);
video::SColor color = ri->m_is_player_kart
? video::SColor(255,255,0, 0 )
@@ -804,7 +811,8 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
// First draw the icon
// -------------------
- if(ri->m_kart_icon)
+
+ if(ri->m_kart_icon && !isSoccerMode)
{
core::recti source_rect(core::vector2di(0,0),
ri->m_kart_icon->getSize());
@@ -819,12 +827,35 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
// Draw the name
// -------------
- core::recti pos_name(current_x, y,
- UserConfigParams::m_width, y+m_distance_between_rows);
- m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL,
- true /* ignoreRTL */);
- current_x += m_width_kart_name + m_width_column_space;
+ if (!isSoccerMode)
+ {
+ core::recti pos_name(current_x, y,
+ UserConfigParams::m_width, y+m_distance_between_rows);
+ m_font->draw(ri->m_kart_name, pos_name, color, false, false, NULL,
+ true /* ignoreRTL */);
+ current_x += m_width_kart_name + m_width_column_space;
+ }
+ // Draw name of team which won in soccer mode
+ // ------------------------------------------
+ if (isSoccerMode)
+ {
+ core::stringw text;
+ core::recti pos_name(current_x, y,
+ UserConfigParams::m_width, y+m_distance_between_rows);
+
+ if (m_team_goals[0] > m_team_goals[1])
+ text = core::stringw(_("Red team won"));
+ else if (m_team_goals[0] < m_team_goals[1])
+ text = core::stringw(_("Blue team won"));
+ else
+ text = core::stringw(_("Draw"));
+
+ m_font->draw(text, pos_name, color, false, false, NULL, true /* ignoreRTL */);
+ core::dimension2du rect = m_font->getDimension(text.c_str());
+ current_x += rect.Width + m_width_column_space;
+ }
+
// Draw the time except in FTL mode
// --------------------------------
if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_FOLLOW_LEADER)
@@ -868,6 +899,15 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
m_font->draw(point_inc_string, dest_rect, color, false, false, NULL,
true /* ignoreRTL */);
}
+
+ if (isSoccerMode)
+ {
+ char score[256];
+ sprintf(score, "%d : %d", m_team_goals[0], m_team_goals[1]);
+ core::recti dest_rect = core::recti(current_x, y, current_x+100, y+10);
+ m_font->draw(score, dest_rect, color, false, false, NULL,
+ true /* ignoreRTL */);
+ }
} // displayOneEntry
diff --git a/src/states_screens/race_setup_screen.cpp b/src/states_screens/race_setup_screen.cpp
index 0f2a26430..c984ec7e2 100644
--- a/src/states_screens/race_setup_screen.cpp
+++ b/src/states_screens/race_setup_screen.cpp
@@ -19,6 +19,7 @@
#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"
#include "guiengine/widgets/spinner_widget.hpp"
+#include "input/input_manager.hpp"
#include "io/file_manager.hpp"
#include "race/race_manager.hpp"
#include "states_screens/arenas_screen.hpp"
@@ -222,6 +223,7 @@ void RaceSetupScreen::onGameModeChanged()
void RaceSetupScreen::init()
{
Screen::init();
+ input_manager->setMasterPlayerOnly(true);
RibbonWidget* w = getWidget("difficulty");
assert( w != NULL );
@@ -288,6 +290,7 @@ void RaceSetupScreen::init()
}
#ifdef ENABLE_SOCCER_MODE
+if (race_manager->getNumLocalPlayers() > 1 || UserConfigParams::m_artist_debug_mode)
{
irr::core::stringw name5 = irr::core::stringw(
RaceManager::getNameOf(RaceManager::MINOR_MODE_SOCCER)) + L"\n";
diff --git a/src/states_screens/soccer_setup_screen.cpp b/src/states_screens/soccer_setup_screen.cpp
index 8805236de..c20636dbe 100644
--- a/src/states_screens/soccer_setup_screen.cpp
+++ b/src/states_screens/soccer_setup_screen.cpp
@@ -35,7 +35,7 @@ using namespace GUIEngine;
DEFINE_SCREEN_SINGLETON( SoccerSetupScreen );
#define KART_CONTINUOUS_ROTATION_SPEED 35.f
-#define KART_CONFIRMATION_ROTATION_SPEED 4.f
+#define KART_CONFIRMATION_ROTATION_SPEED 0.f
#define KART_CONFIRMATION_TARGET_ANGLE 10.f
// -----------------------------------------------------------------------------
@@ -57,6 +57,7 @@ void SoccerSetupScreen::eventCallback(Widget* widget, const std::string& name, c
{
StateManager::get()->pushScreen( ArenasScreen::getInstance() );
race_manager->setMaxGoal(getWidget("goalamount")->getValue());
+ input_manager->setMasterPlayerOnly(true);
}
else if (name == "back")
{
@@ -147,7 +148,7 @@ void SoccerSetupScreen::init()
bt_continue->setDeactivated();
// We need players to be able to choose their teams
- input_manager->getDeviceList()->setAssignMode(ASSIGN);
+ //~ input_manager->getDeviceList()->setAssignMode(ASSIGN);
input_manager->setMasterPlayerOnly(false);
}
@@ -244,7 +245,7 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions( PlayerAction acti
ButtonWidget* bt_continue = getWidget("continue");
if(areAllKartsConfirmed())
{
- bt_continue->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
+ //~ bt_continue->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
bt_continue->setActivated();
for(int i=0 ; i < nb_players ; i++)
diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp
index bca42f20b..96e922791 100644
--- a/src/tracks/track.cpp
+++ b/src/tracks/track.cpp
@@ -499,7 +499,7 @@ void Track::loadQuadGraph(unsigned int mode_id, const bool reverse)
m_minimap_x_scale = float(m_mini_map_size.Width) / float(m_mini_map->getSize().Width);
m_minimap_y_scale = float(m_mini_map_size.Height) / float(m_mini_map->getSize().Height);
}
- else
+ else
{
m_minimap_x_scale = 0;
m_minimap_y_scale = 0;
@@ -1153,7 +1153,7 @@ bool Track::loadMainTrack(const XMLNode &root)
convertTrackToBullet(m_all_nodes[i]);
}
- // Now convert all objects that are only used for the physics
+ // Now convert all objects that are only used for the physics
// (like invisible walls).
for(unsigned int i=0; icastRay(kart->getXYZ(), to, &hit_point,
+ bool over_ground = m_track_mesh->castRay(kart->getXYZ(), to, &hit_point,
&m, &normal);
const Vec3 &xyz = kart->getXYZ();
if(!over_ground || !m)
@@ -2084,7 +2084,7 @@ bool Track::findGround(AbstractKart *kart)
// too long.
if(xyz.getY() - hit_point.getY() > 5)
{
- Log::warn("physics",
+ Log::warn("physics",
"Kart at (%f %f %f) is too high above ground at (%f %f %f)",
xyz.getX(),xyz.getY(),xyz.getZ(),
hit_point.getX(),hit_point.getY(),hit_point.getZ());
diff --git a/src/tracks/track_object.cpp b/src/tracks/track_object.cpp
index dd49b482c..53a649854 100644
--- a/src/tracks/track_object.cpp
+++ b/src/tracks/track_object.cpp
@@ -19,6 +19,7 @@
#include "tracks/track_object.hpp"
#include "animations/three_d_animation.hpp"
+#include "graphics/irr_driver.hpp"
#include "io/file_manager.hpp"
#include "io/xml_node.hpp"
#include "input/device_manager.hpp"
diff --git a/src/tracks/track_object_presentation.cpp b/src/tracks/track_object_presentation.cpp
index c041005e8..e2a27a1e7 100644
--- a/src/tracks/track_object_presentation.cpp
+++ b/src/tracks/track_object_presentation.cpp
@@ -20,6 +20,7 @@
#include "audio/sfx_base.hpp"
#include "audio/sfx_buffer.hpp"
+#include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/particle_emitter.hpp"
#include "graphics/particle_kind_manager.hpp"
diff --git a/src/utils/log.cpp b/src/utils/log.cpp
index b73c8aa68..c86ddb44c 100644
--- a/src/utils/log.cpp
+++ b/src/utils/log.cpp
@@ -165,7 +165,7 @@ void Log::printMessage(int level, const char *component, const char *format,
}
// If we don't have a console file, write to stdout and hope for the best
- if(!m_file_stdout ||
+ if(!m_file_stdout || level >= LL_WARN ||
UserConfigParams::m_log_errors_to_console) // log to console & file
{
VALIST out;
diff --git a/src/utils/time.cpp b/src/utils/time.cpp
new file mode 100644
index 000000000..de032b412
--- /dev/null
+++ b/src/utils/time.cpp
@@ -0,0 +1,29 @@
+//
+// SuperTuxKart - a fun racing game with go-kart
+// Copyright (C) 2004 Steve Baker
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 3
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include "utils/time.hpp"
+#include "graphics/irr_driver.hpp"
+
+/** Returns a time based on an arbitrary 'epoch' (e.g. could be start
+ * time of the application, 1.1.1970, ...).
+ * The value is a double precision floating point value in seconds.
+ */
+double StkTime::getRealTime(long startAt)
+{
+ return irr_driver->getRealTime()/1000.0;
+} // getTimeSinceEpoch
diff --git a/src/utils/time.hpp b/src/utils/time.hpp
index 94bbef876..abeccd017 100644
--- a/src/utils/time.hpp
+++ b/src/utils/time.hpp
@@ -31,9 +31,9 @@
#endif
#include
-#include "graphics/irr_driver.hpp"
+#include
-class Time
+class StkTime
{
public:
typedef time_t TimeType;
@@ -83,10 +83,7 @@ public:
* time of the application, 1.1.1970, ...).
* The value is a double precision floating point value in seconds.
*/
- static double getRealTime(long startAt=0)
- {
- return irr_driver->getDevice()->getTimer()->getRealTime()/1000.0;
- }; // getTimeSinceEpoch
+ static double getRealTime(long startAt=0);
// ------------------------------------------------------------------------
/**