You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:37:22
|
Author: Fredrik Klasson <sci...@gm...>
Date: Tue Oct 18 17:09:18 2011 +0200
Enhancement of the translation wiki helper script
* ISO-639-3T language codes now supported IFF no ISO-369-1 code exists for the language (+ fallback to "Unkown" if no language name can be determinated). Fixes Austrian not being recognized.
* Propper die function (errors to stderr)
* The location of the ISO-639 can now be overriden (handy for cygwin on windows ;)
* Some small sanity checks for file existence added
* Last change date now really is (the relative author) date of the PO-file. Afaik the date of the actual change, not commit (or when the script was last run, which was the previous date reported)
---
tools/scripts/translation_wiki_helper.sh | 101 +++++++++++++++++++++++------
1 files changed, 80 insertions(+), 21 deletions(-)
diff --git a/tools/scripts/translation_wiki_helper.sh b/tools/scripts/translation_wiki_helper.sh
index d8c837b..e6c3107 100755
--- a/tools/scripts/translation_wiki_helper.sh
+++ b/tools/scripts/translation_wiki_helper.sh
@@ -7,11 +7,28 @@ TOT=
UNT=
FUZ=
TPC=
+ISO_639_XML="/usr/share/xml/iso-codes/iso_639.xml"
+
+die(){
+ echo "$*" >&2
+ exit -1
+}
+
+show_usage(){
+ echo "USAGE: $0 <--overview|--infoboxes [lang]> [--iso-639 file]"
+ echo
+ echo " --overview Generates the language overview table."
+ echo " --infoboxes [lang] The two letter ISO-369-1 langauge code used in the PO"
+ echo " filename, or the 3-letter terminology code (ISO-639-2T),"
+ echo " if no two letter code exits. If none is given infoboxes"
+ echo " for all languages found is generated."
+ echo " [--iso-639 file] Override the location of the ISO-639-1 XML database."
+ echo " This defaults to: /usr/share/xml/iso-codes/iso_639.xml"
+}
if [[ "$(basename $PWD)" != "performous" ]] || [[ ! -d ".git" ]] ; then
- echo "Error: Not in the performous root dir!"
echo "This script must be run from the perfourmous source folder"
- exit
+ die "Error: Not in the performous root dir!"
fi
# Colorize
@@ -42,14 +59,35 @@ colorize(){
# This assumes the file /usr/share/xml/iso-codes/iso_639.xml exists
# and has a very strict format (not only valid XML!)
get_full_language_name(){
- if [[ ! -f /usr/share/xml/iso-codes/iso_639.xml ]] ; then
- echo "<!> Missing /usr/share/xml/iso-codes/iso_639.xml"
- echo "FATAL ERROR: Missing ISO-639-1 mappings."
- exit -1
+ if [[ ! -f "$ISO_639_XML" ]] ; then
+ echo "<!> Missing file \"$(basename "$ISO_639_XML")\""
+ die "FATAL ERROR: Missing ISO-639 mappings."
fi
+ # Note assumptions about the XML file formatting:
+ # (lines marked with * are the important ones, -/... is ignored data)
+ # - <iso_639_entry - <iso_639_entry
+ # - ... - ...
+ # * iso_639_1_code="xx" -- XOR -- * iso_639_2T_code="xxx"
+ # * name="Xyzuvw; ..." /> * name="Xyzuvw; ..." />
+
# only pick the first name if many (see XML for examples on eg "nl")
- grep -A1 "iso_639_1_code=\"$1\"" /usr/share/xml/iso-codes/iso_639.xml | grep name | sed -re 's:[ \t]*name="([^;\"]+).*:\1:'
+ NAME=$(grep -A1 "iso_639_1_code=\"$1\"" "$ISO_639_XML" | grep name | sed -re 's:[ \t]*name="([^;\"]+).*:\1:')
+ if [[ -z "$NAME" ]] ; then
+ # Try the 3-letter terminology form before giving up
+ # <http://www.opentag.com/xfaq_lang.htm>
+ NAME=$(grep -A1 "iso_639_2T_code=\"$1\"" "$ISO_639_XML" | grep name= | sed -re 's:[ \t]*name="([^;\"]+).*:\1:')
+
+ if [[ -z "$NAME" ]] ; then
+ # causes: no 2 or 3 letter code exists, or both exists and the 3 letter
+ # version was used (causing -A1 to give the iso_639_1_code line, grepping
+ # for name= will fail => NAME="")
+
+ # Fall back to something other than an empty string
+ NAME="Unkown"
+ fi
+ fi
+ echo "$NAME"
}
# get_translator_field: ISO-369-1 Lang × STRING -> STRING
@@ -123,9 +161,10 @@ update_vars(){
# internal use by generate_overview
overview_wikify(){
- YYYY_MM_DD="$(LC_ALL=C date +%F)"
I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
+ YYYY_MM_DD="$(LC_ALL=C git log -1 --format="%ar" lang/$I_LANG.po)"
LONG_LANG="$(get_full_language_name "$I_LANG")"
+ [[ $? -eq 0 ]] || die "$LONG_LANG"
update_vars "$I_LANG"
# find overview translation comments (if any)
@@ -152,11 +191,12 @@ EOH
}
generate_infoboxes(){
- YYYY_MM_DD="$(LC_ALL=C date +%F)"
+ I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
+ YYYY_MM_DD="$(LC_ALL=C git log -1 --format="%ci" lang/$I_LANG.po)"
OUT="$( LC_ALL=C msgfmt --statistics "$1" 2>&1 )"
- I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
LONG_LANG="$(get_full_language_name "$I_LANG")"
+ [[ $? -eq 0 ]] || die "$LONG_LANG"
update_vars "$I_LANG"
STATUS="$(get_translator_fields "$I_LANG" "STATUS")"
@@ -166,24 +206,43 @@ generate_infoboxes(){
}
if [[ "$1" == "--overview" ]] ; then
+ if [[ "$2" == "--iso-639" ]] && [[ -n "$3" ]] ; then
+ [[ -f "$3" ]] || die "The <$3> doesn't exist!"
+ ISO_639_XML="$3"
+ elif [[ $# -ne 1 ]] ; then
+ show_usage
+ die "Error: Invalid commandline."
+ fi
generate_overview
elif [[ "$1" == "--infoboxes" ]] ; then
- if [[ -z "$2" ]] ; then
+ L="$2"
+
+ shift # of the --infoboxes arg
+ if [[ "$L" == "--iso-639" ]] ; then
+ # lang to --infoboxes was omitted, clear it.
+ L=""
+ else
+ shift # of the lang argument
+ fi
+
+ if [[ $# -eq 2 ]] && [[ "$1" == "--iso-639" ]] && [[ -n "$1" ]] ; then
+ [[ -f "$2" ]] || die "The <$2> doesn't exist!"
+ ISO_639_XML="$2"
+ elif [[ $# -ne 0 ]] ; then
+ show_usage
+ die "Error: Invalid commandline."
+ fi
+
+ if [[ -z "$L" ]] ; then
for a in $(ls -1 lang/*po) ; do
generate_infoboxes "$a"
done
else
- if [[ -d lang ]] && [[ ! -f "lang/${2}.po" ]] ; then
- echo "There is no translation (.po) file for <$2>!"
- exit -1
+ if [[ -d lang ]] && [[ ! -f "lang/${L}.po" ]] ; then
+ die "There is no translation (.po) file for <$L>!"
fi
- generate_infoboxes "$2"
+ generate_infoboxes "$L"
fi
else
- echo "USAGE: $0 <--overview|--infoboxes [lang]>"
- echo
- echo " --overview Generates the language overview table."
- echo " --inforboxes [lang] The two letter ISO-369-1 langauge code used in the PO"
- echo " filename. If none is given infoboxes for all languages"
- echo " found is generated."
+ show_usage
fi
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:37:08
|
Author: Fredrik Klasson <sci...@gm...>
Date: Tue Oct 18 15:32:15 2011 +0200
Sanity checking: make sure the PO-file exists.
---
tools/scripts/translation_wiki_helper.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/scripts/translation_wiki_helper.sh b/tools/scripts/translation_wiki_helper.sh
index 6a50324..d8c837b 100755
--- a/tools/scripts/translation_wiki_helper.sh
+++ b/tools/scripts/translation_wiki_helper.sh
@@ -173,7 +173,10 @@ elif [[ "$1" == "--infoboxes" ]] ; then
generate_infoboxes "$a"
done
else
- # FIXME: make sure $2 is sane.
+ if [[ -d lang ]] && [[ ! -f "lang/${2}.po" ]] ; then
+ echo "There is no translation (.po) file for <$2>!"
+ exit -1
+ fi
generate_infoboxes "$2"
fi
else
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:51
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Sep 19 12:49:38 2011 +0300 libpng voidp API change --- game/image.hh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/game/image.hh b/game/image.hh index 58a63a3..d50b1ae 100644 --- a/game/image.hh +++ b/game/image.hh @@ -26,7 +26,7 @@ namespace { } void loadPNG_internal(png_structp pngPtr, png_infop infoPtr, std::ifstream& file, std::vector<unsigned char>& image, std::vector<png_bytep>& rows, unsigned& w, unsigned& h) { if (setjmp(png_jmpbuf(pngPtr))) throw std::runtime_error("Reading PNG failed"); - png_set_read_fn(pngPtr,(voidp)&file, readPngHelper); + png_set_read_fn(pngPtr,(png_voidp)&file, readPngHelper); png_read_info(pngPtr, infoPtr); png_set_expand(pngPtr); // Expand everything to RGB(A) png_set_strip_16(pngPtr); // Strip everything down to 8 bit/component |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:43
|
Author: Tapio Vierros <tap...@gm...> Date: Tue Aug 23 19:06:33 2011 +0300 Merge branch 'master' of git://git.performous.org/gitroot/performous/performous --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:37
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Aug 23 19:05:43 2011 +0300
Fixed loading screen rendering.
---
game/screen.hh | 3 +++
game/screenmanager.cc | 14 +++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/game/screen.hh b/game/screen.hh
index 1ea4fbd..64d3e29 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -62,6 +62,8 @@ class ScreenManager: public Singleton <ScreenManager> {
/// Draw a loading progress indication
void loading(std::string const& message, float progress);
+ /// Internal rendering function for loading indicator
+ void drawLoading();
/// Draw an error notification and quit
void fatalError(std::string const& message);
/// Set a message to flash in current screen
@@ -97,6 +99,7 @@ class ScreenManager: public Singleton <ScreenManager> {
std::string m_message;
AnimValue m_messagePopup;
SvgTxtTheme m_textMessage;
+ float m_loadingProgress;
Surface m_logo;
AnimValue m_logoAnim;
// Dialog members
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index 6087d2c..5b289b8 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -16,7 +16,7 @@ ScreenManager::ScreenManager(Window& _window):
m_window(_window), m_finished(false), newScreen(), currentScreen(),
m_timeToFadeIn(), m_timeToFadeOut(), m_timeToShow(), m_message(),
m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("message_text.svg"), config["graphic/text_lod"].f()),
- m_logo(getThemePath("logo.svg")), m_logoAnim(0.0, 0.5)
+ m_loadingProgress(0.0f), m_logo(getThemePath("logo.svg")), m_logoAnim(0.0, 0.5)
{
m_textMessage.dimensions.middle().center(-0.05);
}
@@ -49,23 +49,27 @@ void ScreenManager::drawScreen() {
drawNotifications();
}
-
void ScreenManager::loading(std::string const& message, float progress) {
// TODO: Create a better one, this is quite ugly
flashMessage(message + " " + boost::lexical_cast<std::string>(int(round(progress*100))) + "%", 0.0f, 1.0f, 1.0f);
+ m_loadingProgress = progress;
m_window.blank();
+ m_window.render(boost::bind(&ScreenManager::drawLoading, this));
+ m_window.swap();
+}
+
+void ScreenManager::drawLoading() {
drawLogo();
drawNotifications();
const int maxi = 20;
const float x = 0.3;
const float spacing = 0.01;
const float sq_size = (2*x - (maxi-1)*spacing) / maxi;
- for (int i = 0; i <= progress * maxi; ++i) {
- ColorTrans c(Color(0.2f, 0.7f, 0.7f, (progress + 1)*0.5f));
+ for (int i = 0; i <= m_loadingProgress * maxi; ++i) {
+ ColorTrans c(Color(0.2f, 0.7f, 0.7f, (m_loadingProgress + 1)*0.5f));
UseShader shader(getShader("color"));
glutil::Square(-x + i * (sq_size + spacing), 0, sq_size/2, true);
}
- m_window.swap();
}
void ScreenManager::fatalError(std::string const& message) {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:29
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 22:44:41 2011 +0300 Gitignore robustness. --- .gitignore | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index 74a1780..ba51859 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ build build32 build64 -CMakeLists.txt.user +CMakeLists.txt.user* |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:21
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 22:11:28 2011 +0300 Synced most translations from sources. --- lang/ast.po | 837 ++++++++++++++++++++++++++++++++++++++------------------- lang/da.po | 827 +++++++++++++++++++++++++++++-------------------------- lang/de.po | 814 +++++++++++++++++++++++++++++-------------------------- lang/es.po | 846 ++++++++++++++++++++++++++++++--------------------------- lang/fr.po | 834 ++++++++++++++++++++++++++++++-------------------------- lang/hu.po | 755 +++++++++++++++++++++++++++------------------------ lang/it.po | 788 ++++++++++++++++++++++++++++------------------------- lang/ja.po | 792 ++++++++++++++++++++++++++++------------------------- lang/nl.po | 835 ++++++++++++++++++++++++++++++-------------------------- lang/pl.po | 836 ++++++++++++++++++++++++++++++-------------------------- lang/sv.po | 878 +++++++++++++++++++++++++++++++---------------------------- 11 files changed, 4917 insertions(+), 4125 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:12
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 22:02:38 2011 +0300 Updated performous.pot --- lang/performous.pot | 696 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 497 insertions(+), 199 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:36:05
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 21:55:22 2011 +0300 Added Qt Creator's CMakeLists.txt.user to gitignore. --- .gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 4497982..74a1780 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build build32 build64 +CMakeLists.txt.user |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:57
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 21:54:21 2011 +0300 Added Asturian translation. --- lang/ast.po | 578 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 578 insertions(+), 0 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:50
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 21:53:13 2011 +0300 Update FI translation. --- lang/fi.po | 418 +++++++++++++++++++++++++++++++++--------------------------- 1 files changed, 228 insertions(+), 190 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:42
|
Author: Tapio Vierros <tap...@gm...>
Date: Mon Aug 1 21:46:05 2011 +0300
Fixed xml_gettext.sh to reflect changes in schema.xml
---
tools/scripts/xml_gettext.sh | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/tools/scripts/xml_gettext.sh b/tools/scripts/xml_gettext.sh
index 7c6b8e1..2f59120 100755
--- a/tools/scripts/xml_gettext.sh
+++ b/tools/scripts/xml_gettext.sh
@@ -4,27 +4,27 @@
# See instructions in lang/README.
#
# As long as the xml files are well-formed XML documents with
-# locale blocks like the following one (from scheme.xml) this
+# entry blocks like the following one (from scheme.xml) this
# script should have no problems extracting the strings.
-# <locale name="C">
+# <entry ...>
# <short>Karaoke mode</short>
# <long>Hide pitch wave, notes and scoring.</long>
-# </locale>
+# </entry>
# adds a line to the temporary source file
append_temp_src(){
echo "$*" >> "$TEMP_SRC"
}
-# match <locale name="C">, ignoring allowed whitespace.
-match_locale_start(){
- echo "$1" | grep -qE '^[[:space:]]*<[[:space:]]*locale[[:space:]]+name="C"[[:space:]]*>[[:space:]]*$'
+# match <entry, ignoring allowed whitespace.
+match_entry_start(){
+ echo "$1" | grep -qE '^[[:space:]]*<[[:space:]]*entry.*>[[:space:]]*$'
return $?
}
-# match </locale>, ignoring allowed whitespace.
-match_locale_end(){
- echo "$1" | grep -qE '^[[:space:]]*<[[:space:]]*/[[:space:]]*locale>[[:space:]]*$'
+# match </entry>, ignoring allowed whitespace.
+match_entry_end(){
+ echo "$1" | grep -qE '^[[:space:]]*<[[:space:]]*/[[:space:]]*entry>[[:space:]]*$'
return $?
}
@@ -58,24 +58,24 @@ process_xml(){
do
line_no=$(($line_no + 1))
- # A simple 2-state automata, either we're in a <locale/>-block
+ # A simple 2-state automata, either we're in a <entry/>-block
# or we're not. Limited detection and bail-out on malformed XML
if [[ $IN_BLOCK -eq 1 ]] ; then
- match_locale_end "$line"
+ match_entry_end "$line"
if [[ $? -eq 0 ]] ; then
IN_BLOCK=0
else
process_locale_block_line "$line"
fi
- # <locale...> with out </locale> found:
- match_locale_start "$line" && (echo "Malformed XML $file:$line_no: Opening locale-tag found while already inside a locale block." >&2 ;exit -1)
+ # <entry...> with out </entry> found:
+ match_entry_start "$line" && (echo "Malformed XML $file:$line_no: Opening entry-tag found while already inside an entry block." >&2 ;exit -1)
else
- # </locale> with out <locale> found:
- match_locale_end "$line" && (echo "Malformed XML $file:$line_no:: Closing locale-tag without prior opening tag." >&2 ;exit -1)
+ # </entry> with out <entry> found:
+ match_entry_end "$line" && (echo "Malformed XML $file:$line_no:: Closing entry-tag without prior opening tag." >&2 ;exit -1)
- match_locale_start "$line"
+ match_entry_start "$line"
if [[ $? -eq 0 ]] ; then
IN_BLOCK=1
fi
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:34
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 1 21:44:31 2011 +0300 Typo fix. --- data/schema.xml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/data/schema.xml b/data/schema.xml index a9ca5cc..ac324e6 100644 --- a/data/schema.xml +++ b/data/schema.xml @@ -110,7 +110,7 @@ to save the current settings to XML. <ui unit=" %" /> <limits min="0" max="100" step="2" /> <short>Stereo3D separation</short> - <long>The strenght of the effect. Experiment with different settings for best results.</long> + <long>The strength of the effect. Experiment with different settings for best results.</long> </entry> <entry name="graphic/video" type="bool" value="true"> <short>Video playback</short> |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:26
|
Author: sajjadg <saj...@gm...> Date: Mon Aug 1 18:47:25 2011 -0400 This is the Persian language translation. fa is for farsi the locale name for language --- lang/fa.po | 565 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 565 insertions(+), 0 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:18
|
Author: sajjadg <saj...@gm...> Date: Mon Aug 1 03:25:05 2011 -0400 Update for The Persian Language Translation. It's almost complete with just 3 fuzzy strings. --- lang/fa.po | 283 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 279 insertions(+), 4 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:35:10
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jul 24 22:06:42 2011 +0200
Fixed compilation for old glew versions but enables compilation on Ubuntu anyway
---
game/video_driver.cc | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 6a92ce1..1e8935a 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -12,6 +12,25 @@
#include <fstream>
#include <SDL.h>
+#ifndef GLEW_ARB_viewport_array
+# define GLEW_ARB_viewport_array GL_FALSE
+# define glViewportIndexedf(index, x, y, w, h) {}
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+#ifndef GLEW_VERSION_3_3
+# define GLEW_VERSION_3_3 GL_FALSE
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+#ifndef GLEW_VERSION_4_1
+# define GLEW_VERSION_4_1 GL_FALSE
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+
+/*
+/home/yoda/performous/game/video_driver.cc: In member function âid Window::render(boost::function<void()>)â/home/yoda/performous/game/video_driver.cc:193:43: error: âViewportIndexedfâas not declared in this scope
+/home/yoda/performous/game/video_driver.cc: In member function âid Window::view(unsigned int)â/home/yoda/performous/game/video_driver.cc:256:46: error: âViewportIndexedfâas not declared in this scope
+*/
+
namespace {
unsigned s_width;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:34:56
|
Author: Federico Pietta <f.p...@gm...>
Date: Thu Jul 21 00:03:10 2011 +0200
Update Debian dependences
---
cmake/performous-packaging.cmake | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/performous-packaging.cmake b/cmake/performous-packaging.cmake
index 1cbb865..0327ebe 100644
--- a/cmake/performous-packaging.cmake
+++ b/cmake/performous-packaging.cmake
@@ -68,11 +68,11 @@ if(UNIX)
# Debian
if("${LSB_DISTRIB}" MATCHES "Debian5.*")
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-dev, libavcodec51, libavformat52, libswscale0, libmagick++10, libxml++2.6-2, libglew1.5")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.42.0, libboost-program-options1.42.0, libboost-regex1.42.0, libboost-filesystem1.42.0, libboost-date-time1.42.0, libavcodec51, libavformat52, libswscale0, libmagick++10, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
endif("${LSB_DISTRIB}" MATCHES "Debian5.*")
if("${LSB_DISTRIB}" MATCHES "Debiantesting")
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-dev, libavcodec52, libavformat52, libswscale0, libmagick++3, libxml++2.6-2, libglew1.5")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.46.1, libboost-program-options1.46.1, libboost-regex1.46.1, libboost-filesystem1.46.1, libboost-date-time1.46.1, libavcodec52, libavformat52, libswscale0, libmagick++3, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
endif("${LSB_DISTRIB}" MATCHES "Debiantesting")
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:34:48
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Jul 8 11:20:59 2011 +0300
Enable sRGB framebuffer and textures for proper gamma-correct blending (if sRGB is available), glColor values need to be made darker now. Using floating-point linear formats in FBOs.
---
game/fbo.hh | 4 ++--
game/surface.cc | 7 ++++---
game/video_driver.cc | 1 +
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/fbo.hh b/game/fbo.hh
index f3773bd..856695a 100644
--- a/game/fbo.hh
+++ b/game/fbo.hh
@@ -11,11 +11,11 @@ class FBO: boost::noncopyable {
FBO(unsigned w, unsigned h) {
{
UseTexture tex(m_texture);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_FLOAT, NULL);
}
{
UseTexture tex(m_depth);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT24, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
}
// Create FBO
glGenFramebuffersEXT(1, &m_fbo);
diff --git a/game/surface.cc b/game/surface.cc
index d24ca16..5b7078b 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -79,6 +79,7 @@ namespace {
if (it != pixFormats.m.end()) return it->second;
throw std::logic_error("Unknown pixel format");
}
+ GLint internalFormat() { return GL_EXT_framebuffer_sRGB ? GL_SRGB_ALPHA : GL_RGBA; }
}
void Texture::load(unsigned int width, unsigned int height, pix::Format format, unsigned char const* buffer, float ar) {
@@ -103,7 +104,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
// Load the data into texture
if ((isPow2(width) && isPow2(height)) || GLEW_ARB_texture_non_power_of_two) { // Can directly load the texture
- glTexImage2D(type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
} else {
int newWidth = prevPow2(width);
int newHeight = prevPow2(height);
@@ -114,7 +115,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
// (1) no repeat => cannot texture
// (2) coordinates not normalized => would require special hackery elsewhere
// Just don't do it in Surface class, thanks. -Tronic
- glTexImage2D(type(), 0, GL_RGBA, newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
+ glTexImage2D(type(), 0, internalFormat(), newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
}
glGenerateMipmap(type());
}
@@ -129,7 +130,7 @@ void Surface::load(unsigned int width, unsigned int height, pix::Format format,
UseTexture texture(m_texture);
PixFmt const& f = getPixFmt(format);
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
- glTexImage2D(m_texture.type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(m_texture.type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
}
void Surface::draw() const {
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 568e219..6a92ce1 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -244,6 +244,7 @@ void Window::view(unsigned num) {
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND);
+ if (GL_EXT_framebuffer_sRGB) glEnable(GL_FRAMEBUFFER_SRGB);
shader("color").bind();
// Setup views
double vx = 0.5f * (screen->w - s_width);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:34:40
|
Author: Lasse Karkkainen <tro...@tr...> Date: Thu Jul 7 08:32:56 2011 +0300 Hack better guitar note lighting (eyecandy). Matrix system WIP and loading screens b0rked for now. --- data/shaders/core.frag | 30 +++++++++++++++++++++++++----- data/shaders/core.vert | 12 ++++++++++-- data/shaders/dancenote.vert | 5 +++-- data/shaders/stereo3d.geom | 3 +++ game/guitargraph.cc | 3 ++- game/video_driver.cc | 42 +++++++++++++++++++++++------------------- game/video_driver.hh | 4 +++- 7 files changed, 69 insertions(+), 30 deletions(-) diff --git a/data/shaders/core.frag b/data/shaders/core.frag index 9f5d966..6188127 100644 --- a/data/shaders/core.frag +++ b/data/shaders/core.frag @@ -12,6 +12,10 @@ in float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.ph varying vec3 normal; varying vec4 color; +#ifdef ENABLE_LIGHTING +varying vec3 lightDir; +#endif + #ifdef ENABLE_TEXTURING varying vec4 texCoord; #if ENABLE_TEXTURING == 1 @@ -41,13 +45,29 @@ void main() { #endif #ifdef ENABLE_LIGHTING - vec3 lightDir = normalize(vec3(-50.0, 5.0, -15.0)); - const vec3 ambient = vec3(0.1, 0.1, 0.1); + vec3 n = normalize(normal); + vec3 l = normalize(lightDir); + + // Diffuse + float diff = max(dot(n, l), 0.0); + float power = 1.0 - 0.02 * length(lightDir); + frag = vec4(frag.rgb * power * diff, frag.a); + +#endif + + frag = colorMatrix * frag; // Colorize + +#ifdef ENABLE_LIGHTING - float NdotL = max(dot(normalize(normal), lightDir), 0.0); - frag = vec4(ambient + frag.rgb * NdotL, frag.a); + // Specular + vec3 refl = reflect(-l, n); + float spec = dot(refl, n); + if (power > 0.0) { + power *= pow(spec, 100); + frag.rgb += vec3(power, power, power); + } #endif - gl_FragColor = colorMatrix * frag; + gl_FragColor = frag; } diff --git a/data/shaders/core.vert b/data/shaders/core.vert index 926ca9b..5b06c4a 100644 --- a/data/shaders/core.vert +++ b/data/shaders/core.vert @@ -2,7 +2,8 @@ //DEFINES -uniform mat4 positionMatrix; +uniform mat4 projMatrix; +uniform mat4 mvMatrix; uniform mat3 normalMatrix; attribute vec4 vertPos; @@ -10,6 +11,8 @@ attribute vec4 vertTexCoord; attribute vec3 vertNormal; attribute vec4 vertColor; +varying vec3 lightDir; +varying vec3 vLightDir; varying vec4 texCoord; varying vec4 vTexCoord; varying vec3 normal; @@ -18,7 +21,12 @@ varying vec4 color; varying vec4 vColor; void main() { - gl_Position = positionMatrix * vertPos; + //const vec3 lightPos = vec3(0.0, -2.94, 1.0); + const vec3 lightPos = vec3(-10.0, 2.0, 15.0); + + vec4 posEye = mvMatrix * vertPos; // Vertex position in eye space + gl_Position = projMatrix * posEye; // Vertex position in normalized device coordinates + vLightDir = lightDir = lightPos - posEye.xyz / posEye.w; // Light position relative to vertex vTexCoord = texCoord = vertTexCoord; vNormal = normal = normalize(normalMatrix * vertNormal); vColor = color = vertColor; diff --git a/data/shaders/dancenote.vert b/data/shaders/dancenote.vert index c9b9c92..837101a 100644 --- a/data/shaders/dancenote.vert +++ b/data/shaders/dancenote.vert @@ -1,6 +1,7 @@ #version 120 -uniform mat4 positionMatrix; +uniform mat4 projMatrix; +uniform mat4 mvMatrix; uniform mat3 normalMatrix; uniform int noteType; uniform float hitAnim; @@ -75,6 +76,6 @@ void main() { ); } - gl_Position = positionMatrix * (vec4(position, 0, 0) + trans * vertPos); + gl_Position = projMatrix * mvMatrix * (vec4(position, 0, 0) + trans * vertPos); } diff --git a/data/shaders/stereo3d.geom b/data/shaders/stereo3d.geom index c94adb1..66d1d0e 100644 --- a/data/shaders/stereo3d.geom +++ b/data/shaders/stereo3d.geom @@ -7,11 +7,13 @@ uniform float z0; layout(triangles) in; layout(triangle_strip, max_vertices = 6) out; +in vec3 vLightDir[]; in vec4 vTexCoord[]; in vec3 vNormal[]; in vec4 vColor[]; out float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.php?p=2401097 +out vec3 lightDir; out vec4 texCoord; out vec3 normal; out vec4 color; @@ -20,6 +22,7 @@ int i; void passthru() { gl_Position = gl_in[i].gl_Position; + lightDir = vLightDir[i]; texCoord = vTexCoord[i]; normal = vNormal[i]; color = vColor[i]; diff --git a/game/guitargraph.cc b/game/guitargraph.cc index f3519e9..aeb9d30 100644 --- a/game/guitargraph.cc +++ b/game/guitargraph.cc @@ -890,7 +890,8 @@ void GuitarGraph::drawNeckStuff(double time) { if (jumpanim == 1.0) m_drumJump.setTarget(0.0); if (jumpanim > 0) m = translate(vec3(0.0f, -m_drumJump.get() * 0.01, 0.0f)) * m; } - Transform trans(m); + //Transform trans(m); + ViewTrans trans(m); // Draw the neck { diff --git a/game/video_driver.cc b/game/video_driver.cc index e173d22..568e219 100644 --- a/game/video_driver.cc +++ b/game/video_driver.cc @@ -44,7 +44,7 @@ namespace { glmath::mat4 g_color = glmath::mat4::identity(); glmath::mat4 g_projection = glmath::mat4::identity(); - glmath::mat4 g_modelview = glmath::translate(glmath::vec3(0.0, 0.0, -z0)); + glmath::mat4 g_modelview = glmath::mat4::identity(); } @@ -155,12 +155,12 @@ void Window::updateColor() { void Window::updateTransforms() { using namespace glmath; - mat4 position = g_projection * g_modelview; mat3 normal(g_modelview); for (ShaderMap::iterator it = m_shaders.begin(); it != m_shaders.end(); ++it) { Shader& sh = *it->second; sh.bind(); - sh["positionMatrix"].setMat4(position); + sh["projMatrix"].setMat4(g_projection); + sh["mvMatrix"].setMat4(g_modelview); try { sh["normalMatrix"].setMat3(normal); } catch(...) {} // Not fatal if normalMatrix is missing (only 3d objects use it) @@ -315,6 +315,22 @@ void Window::screenshot() { std::clog << "video/info: Screenshot taken: " << filename << " (" << img.w << "x" << img.h << ")" << std::endl; } +ColorTrans::ColorTrans(Color const& c): m_old(g_color) { + using namespace glmath; + g_color = g_color * mat4::diagonal(vec4(c.r, c.g, c.b, c.a)); + ScreenManager::getSingletonPtr()->window().updateColor(); +} + +ColorTrans::ColorTrans(glmath::mat4 const& mat): m_old(g_color) { + g_color = g_color * mat; + ScreenManager::getSingletonPtr()->window().updateColor(); +} + +ColorTrans::~ColorTrans() { + g_color = m_old; + ScreenManager::getSingletonPtr()->window().updateColor(); +} + ViewTrans::ViewTrans(double offsetX, double offsetY, double frac): m_old(g_projection) { // Setup the projection matrix for 2D translates using namespace glmath; @@ -329,24 +345,13 @@ ViewTrans::ViewTrans(double offsetX, double offsetY, double frac): m_old(g_proje y1 -= persY; y2 -= persY; // Perspective projection + the rest of the offset in eye (world) space g_projection = frustum(f * x1, f * x2, f * y1, f * y2, near_, far_) - * translate(vec3(offsetX - persX, offsetY - persY, 0.0)); + * translate(vec3(offsetX - persX, offsetY - persY, -z0)); ScreenManager::getSingletonPtr()->window().updateTransforms(); } -ColorTrans::ColorTrans(Color const& c): m_old(g_color) { - using namespace glmath; - g_color = g_color * mat4::diagonal(vec4(c.r, c.g, c.b, c.a)); - ScreenManager::getSingletonPtr()->window().updateColor(); -} - -ColorTrans::ColorTrans(glmath::mat4 const& mat): m_old(g_color) { - g_color = g_color * mat; - ScreenManager::getSingletonPtr()->window().updateColor(); -} - -ColorTrans::~ColorTrans() { - g_color = m_old; - ScreenManager::getSingletonPtr()->window().updateColor(); +ViewTrans::ViewTrans(glmath::mat4 const& m): m_old(g_projection) { + g_projection = g_projection * m; + ScreenManager::getSingletonPtr()->window().updateTransforms(); } ViewTrans::~ViewTrans() { @@ -354,7 +359,6 @@ ViewTrans::~ViewTrans() { ScreenManager::getSingletonPtr()->window().updateTransforms(); } - Transform::Transform(glmath::mat4 const& m): m_old(g_modelview) { g_modelview = g_modelview * m; ScreenManager::getSingletonPtr()->window().updateTransforms(); diff --git a/game/video_driver.hh b/game/video_driver.hh index 54b1d50..3d38e1b 100644 --- a/game/video_driver.hh +++ b/game/video_driver.hh @@ -20,9 +20,11 @@ private: glmath::mat4 m_old; }; -/// Apply a subviewport with different perspective projection class ViewTrans { public: + /// Apply a translation on top of current viewport translation + ViewTrans(glmath::mat4 const& m); + /// Apply a subviewport with different perspective projection ViewTrans(double offsetX = 0.0, double offsetY = 0.0, double frac = 1.0); ~ViewTrans(); private: |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:34:32
|
Author: Tapio Vierros <tap...@gm...> Date: Sat Jul 2 18:45:30 2011 +0300 Fixed audio devices screen background image. --- themes/default/audiodevices_bg.svg | 196 ++---------------------------------- 1 files changed, 8 insertions(+), 188 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:29:43
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 22 22:29:18 2011 +0300
Reduce anaglyph saturation for better guitar gameplay
---
game/video_driver.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 37b8e56..07f796a 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -223,7 +223,7 @@ void Window::render(boost::function<void (void)> drawFunc) {
glerror.check("FBO->FB setup");
for (int num = 0; num < 2; ++num) {
{
- float saturation = 0.6; // (0..1)
+ float saturation = 0.5; // (0..1)
float col = (1.0 + 2.0 * saturation) / 3.0;
float gry = 0.5 * (1.0 - col);
bool out[3] = {}; // Which colors to output
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 18:52:42
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 22 21:52:09 2011 +0300
Fix stereo3d anaglyph modes. Apparently the blend mode is messed up by something, so we now set it later.
---
game/video_driver.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 1e8935a..37b8e56 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -239,15 +239,15 @@ void Window::render(boost::function<void (void)> drawFunc) {
}
}
}
+ // Render FBO with 1:1 pixels, properly filtered/positioned for 3d
+ ColorTrans c(colorMatrix);
+ Dimensions dim = Dimensions(double(w) / h).fixedWidth(1.0);
+ dim.center((num == 0 ? 0.25 : -0.25) * dim.h());
if (num == 1) {
// Right eye blends over the left eye
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
}
- // Render FBO with 1:1 pixels, properly filtered/positioned for 3d
- ColorTrans c(colorMatrix);
- Dimensions dim = Dimensions(double(w) / h).fixedWidth(1.0);
- dim.center((num == 0 ? 0.25 : -0.25) * dim.h());
fbo.getTexture().draw(dim, TexCoords(0.0, h, w, 0));
}
glerror.check("FBO->FB postcondition");
|
|
From: Fredrik K. <sci...@us...> - 2011-10-18 15:14:16
|
Author: Fredrik Klasson <sci...@gm...>
Date: Tue Oct 18 17:09:18 2011 +0200
Enhancement of the translation wiki helper script
* ISO-639-3T language codes now supported IFF no ISO-369-1 code exists for the language (+ fallback to "Unkown" if no language name can be determinated). Fixes Austrian not being recognized.
* Propper die function (errors to stderr)
* The location of the ISO-639 can now be overriden (handy for cygwin on windows ;)
* Some small sanity checks for file existence added
* Last change date now really is (the relative author) date of the PO-file. Afaik the date of the actual change, not commit (or when the script was last run, which was the previous date reported)
---
tools/scripts/translation_wiki_helper.sh | 101 +++++++++++++++++++++++------
1 files changed, 80 insertions(+), 21 deletions(-)
diff --git a/tools/scripts/translation_wiki_helper.sh b/tools/scripts/translation_wiki_helper.sh
index d8c837b..e6c3107 100755
--- a/tools/scripts/translation_wiki_helper.sh
+++ b/tools/scripts/translation_wiki_helper.sh
@@ -7,11 +7,28 @@ TOT=
UNT=
FUZ=
TPC=
+ISO_639_XML="/usr/share/xml/iso-codes/iso_639.xml"
+
+die(){
+ echo "$*" >&2
+ exit -1
+}
+
+show_usage(){
+ echo "USAGE: $0 <--overview|--infoboxes [lang]> [--iso-639 file]"
+ echo
+ echo " --overview Generates the language overview table."
+ echo " --infoboxes [lang] The two letter ISO-369-1 langauge code used in the PO"
+ echo " filename, or the 3-letter terminology code (ISO-639-2T),"
+ echo " if no two letter code exits. If none is given infoboxes"
+ echo " for all languages found is generated."
+ echo " [--iso-639 file] Override the location of the ISO-639-1 XML database."
+ echo " This defaults to: /usr/share/xml/iso-codes/iso_639.xml"
+}
if [[ "$(basename $PWD)" != "performous" ]] || [[ ! -d ".git" ]] ; then
- echo "Error: Not in the performous root dir!"
echo "This script must be run from the perfourmous source folder"
- exit
+ die "Error: Not in the performous root dir!"
fi
# Colorize
@@ -42,14 +59,35 @@ colorize(){
# This assumes the file /usr/share/xml/iso-codes/iso_639.xml exists
# and has a very strict format (not only valid XML!)
get_full_language_name(){
- if [[ ! -f /usr/share/xml/iso-codes/iso_639.xml ]] ; then
- echo "<!> Missing /usr/share/xml/iso-codes/iso_639.xml"
- echo "FATAL ERROR: Missing ISO-639-1 mappings."
- exit -1
+ if [[ ! -f "$ISO_639_XML" ]] ; then
+ echo "<!> Missing file \"$(basename "$ISO_639_XML")\""
+ die "FATAL ERROR: Missing ISO-639 mappings."
fi
+ # Note assumptions about the XML file formatting:
+ # (lines marked with * are the important ones, -/... is ignored data)
+ # - <iso_639_entry - <iso_639_entry
+ # - ... - ...
+ # * iso_639_1_code="xx" -- XOR -- * iso_639_2T_code="xxx"
+ # * name="Xyzuvw; ..." /> * name="Xyzuvw; ..." />
+
# only pick the first name if many (see XML for examples on eg "nl")
- grep -A1 "iso_639_1_code=\"$1\"" /usr/share/xml/iso-codes/iso_639.xml | grep name | sed -re 's:[ \t]*name="([^;\"]+).*:\1:'
+ NAME=$(grep -A1 "iso_639_1_code=\"$1\"" "$ISO_639_XML" | grep name | sed -re 's:[ \t]*name="([^;\"]+).*:\1:')
+ if [[ -z "$NAME" ]] ; then
+ # Try the 3-letter terminology form before giving up
+ # <http://www.opentag.com/xfaq_lang.htm>
+ NAME=$(grep -A1 "iso_639_2T_code=\"$1\"" "$ISO_639_XML" | grep name= | sed -re 's:[ \t]*name="([^;\"]+).*:\1:')
+
+ if [[ -z "$NAME" ]] ; then
+ # causes: no 2 or 3 letter code exists, or both exists and the 3 letter
+ # version was used (causing -A1 to give the iso_639_1_code line, grepping
+ # for name= will fail => NAME="")
+
+ # Fall back to something other than an empty string
+ NAME="Unkown"
+ fi
+ fi
+ echo "$NAME"
}
# get_translator_field: ISO-369-1 Lang × STRING -> STRING
@@ -123,9 +161,10 @@ update_vars(){
# internal use by generate_overview
overview_wikify(){
- YYYY_MM_DD="$(LC_ALL=C date +%F)"
I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
+ YYYY_MM_DD="$(LC_ALL=C git log -1 --format="%ar" lang/$I_LANG.po)"
LONG_LANG="$(get_full_language_name "$I_LANG")"
+ [[ $? -eq 0 ]] || die "$LONG_LANG"
update_vars "$I_LANG"
# find overview translation comments (if any)
@@ -152,11 +191,12 @@ EOH
}
generate_infoboxes(){
- YYYY_MM_DD="$(LC_ALL=C date +%F)"
+ I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
+ YYYY_MM_DD="$(LC_ALL=C git log -1 --format="%ci" lang/$I_LANG.po)"
OUT="$( LC_ALL=C msgfmt --statistics "$1" 2>&1 )"
- I_LANG="$(echo "$1" | sed -re 's:lang/([a-z]+)\.po:\1:')"
LONG_LANG="$(get_full_language_name "$I_LANG")"
+ [[ $? -eq 0 ]] || die "$LONG_LANG"
update_vars "$I_LANG"
STATUS="$(get_translator_fields "$I_LANG" "STATUS")"
@@ -166,24 +206,43 @@ generate_infoboxes(){
}
if [[ "$1" == "--overview" ]] ; then
+ if [[ "$2" == "--iso-639" ]] && [[ -n "$3" ]] ; then
+ [[ -f "$3" ]] || die "The <$3> doesn't exist!"
+ ISO_639_XML="$3"
+ elif [[ $# -ne 1 ]] ; then
+ show_usage
+ die "Error: Invalid commandline."
+ fi
generate_overview
elif [[ "$1" == "--infoboxes" ]] ; then
- if [[ -z "$2" ]] ; then
+ L="$2"
+
+ shift # of the --infoboxes arg
+ if [[ "$L" == "--iso-639" ]] ; then
+ # lang to --infoboxes was omitted, clear it.
+ L=""
+ else
+ shift # of the lang argument
+ fi
+
+ if [[ $# -eq 2 ]] && [[ "$1" == "--iso-639" ]] && [[ -n "$1" ]] ; then
+ [[ -f "$2" ]] || die "The <$2> doesn't exist!"
+ ISO_639_XML="$2"
+ elif [[ $# -ne 0 ]] ; then
+ show_usage
+ die "Error: Invalid commandline."
+ fi
+
+ if [[ -z "$L" ]] ; then
for a in $(ls -1 lang/*po) ; do
generate_infoboxes "$a"
done
else
- if [[ -d lang ]] && [[ ! -f "lang/${2}.po" ]] ; then
- echo "There is no translation (.po) file for <$2>!"
- exit -1
+ if [[ -d lang ]] && [[ ! -f "lang/${L}.po" ]] ; then
+ die "There is no translation (.po) file for <$L>!"
fi
- generate_infoboxes "$2"
+ generate_infoboxes "$L"
fi
else
- echo "USAGE: $0 <--overview|--infoboxes [lang]>"
- echo
- echo " --overview Generates the language overview table."
- echo " --inforboxes [lang] The two letter ISO-369-1 langauge code used in the PO"
- echo " filename. If none is given infoboxes for all languages"
- echo " found is generated."
+ show_usage
fi
|
|
From: Fredrik K. <sci...@us...> - 2011-10-18 15:14:02
|
Author: Fredrik Klasson <sci...@gm...>
Date: Tue Oct 18 15:32:15 2011 +0200
Sanity checking: make sure the PO-file exists.
---
tools/scripts/translation_wiki_helper.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/scripts/translation_wiki_helper.sh b/tools/scripts/translation_wiki_helper.sh
index 6a50324..d8c837b 100755
--- a/tools/scripts/translation_wiki_helper.sh
+++ b/tools/scripts/translation_wiki_helper.sh
@@ -173,7 +173,10 @@ elif [[ "$1" == "--infoboxes" ]] ; then
generate_infoboxes "$a"
done
else
- # FIXME: make sure $2 is sane.
+ if [[ -d lang ]] && [[ ! -f "lang/${2}.po" ]] ; then
+ echo "There is no translation (.po) file for <$2>!"
+ exit -1
+ fi
generate_infoboxes "$2"
fi
else
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-16 10:22:10
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Oct 16 13:21:31 2011 +0300
Fix XML writer not writing the last sentence.
---
songwriter-xml.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/songwriter-xml.cc b/songwriter-xml.cc
index 93e3dc6..e0f0d70 100644
--- a/songwriter-xml.cc
+++ b/songwriter-xml.cc
@@ -100,6 +100,7 @@ void SingStarXMLWriter::writeXML() {
ts += pauseLen;
}
}
+ root.appendChild(sentenceElem);
// Get the xml data
QString xml = doc.toString(4);
|