super-tux-commit Mailing List for Super Tux (Page 19)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Matze B. <mat...@us...> - 2004-11-23 22:49:29
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19877/lib/app Modified Files: tinygettext.cpp Log Message: don't annoy all the time with messages... Index: tinygettext.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/tinygettext.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tinygettext.cpp 23 Nov 2004 22:21:50 -0000 1.1 +++ tinygettext.cpp 23 Nov 2004 22:49:04 -0000 1.2 @@ -26,6 +26,8 @@ #include <errno.h> #include "tinygettext.h" +//#define TRANSLATION_DEBUG + namespace TinyGetText { /** Convert \a which is in \a from_charset to \a to_charset and return it */ @@ -390,10 +392,12 @@ } else { +#ifdef TRANSLATION_DEBUG std::cerr << "Warning: Couldn't translate: " << msgid << std::endl; std::cerr << "Candidates: " << std::endl; for (PluralEntries::iterator i = plural_entries.begin(); i != plural_entries.end(); ++i) std::cout << "'" << i->first << "'" << std::endl; +#endif if (plural2_1(num)) // default to english rules return msgid2; @@ -412,7 +416,9 @@ } else { +#ifdef TRANSLATION_DBEUG std::cout << "Error: Couldn't translate: " << msgid << std::endl; +#endif return msgid; } } |
From: Matze B. <mat...@us...> - 2004-11-23 22:44:58
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18568/src Modified Files: player.cpp Log Message: change jump default to space Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.201 retrieving revision 1.202 diff -u -d -r1.201 -r1.202 --- player.cpp 23 Nov 2004 16:47:25 -0000 1.201 +++ player.cpp 23 Nov 2004 22:44:31 -0000 1.202 @@ -73,7 +73,7 @@ keymap.right = SDLK_RIGHT; keymap.power = SDLK_LCTRL; - keymap.jump = SDLK_LALT; + keymap.jump = SDLK_SPACE; } void player_input_init(player_input_type* pplayer_input) |
From: Matze B. <mat...@us...> - 2004-11-23 22:23:43
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/lib/app Modified Files: gettext.h globals.cpp globals.h setup.cpp setup.h Added Files: tinygettext.cpp tinygettext.h Log Message: Goodbye gettext, Welcome TinyGetText --- NEW FILE: tinygettext.cpp --- // $Id: tinygettext.cpp,v 1.1 2004/11/23 22:21:50 matzebraun Exp $ // // TinyGetText - A small flexible gettext() replacement // Copyright (C) 2004 Ingo Ruhnke <gr...@gm...> // // 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 2 // 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 <sys/types.h> #include <iconv.h> #include <dirent.h> #include <fstream> #include <iostream> #include <ctype.h> #include <errno.h> #include "tinygettext.h" namespace TinyGetText { /** Convert \a which is in \a from_charset to \a to_charset and return it */ std::string convert(const std::string& text, const std::string& from_charset, const std::string& to_charset) { if (from_charset == to_charset) return text; iconv_t cd = iconv_open(to_charset.c_str(), from_charset.c_str()); size_t in_len = text.length(); size_t out_len = text.length()*2; char* out_orig = new char[out_len]; // FIXME: cross fingers that this is enough char* in_orig = new char[in_len+1]; strcpy(in_orig, text.c_str()); char* out = out_orig; char* in = in_orig; //std::cout << "IN: " << (int)in << " " << in_len << " " << (int)out << " " << out_len << std::endl; int retval = iconv(cd, &in, &in_len, &out, &out_len); //std::cout << "OUT: " << (int)in << " " << in_len << " " << (int)out << " " << out_len << std::endl; if (retval != 0) { std::cerr << strerror(errno) << std::endl; std::cerr << "Error: conversion from " << from_charset << " to " << to_charset << " went wrong: " << retval << std::endl; } iconv_close(cd); std::string ret(out_orig, out_len); delete[] out_orig; delete[] in_orig; return ret; } bool has_suffix(const std::string& lhs, const std::string rhs) { if (lhs.length() < rhs.length()) return false; else return lhs.compare(lhs.length() - rhs.length(), rhs.length(), rhs) == 0; } bool has_prefix(const std::string& lhs, const std::string rhs) { if (lhs.length() < rhs.length()) return false; else return lhs.compare(0, rhs.length(), rhs) == 0; } int plural1(int ) { return 0; } int plural2_1(int n) { return (n != 1); } int plural2_2(int n) { return (n > 1); } int plural3_lv(int n) { return (n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2); } int plural3_ga(int n) { return n==1 ? 0 : n==2 ? 1 : 2; } int plural3_lt(int n) { return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2); } int plural3_1(int n) { return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); } int plural3_sk(int n) { return (n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; } int plural3_pl(int n) { return (n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); } int plural3_sl(int n) { return (n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3); } /** Language Definitions */ //*{ LanguageDef lang_hu("hu", "Hungarian", 1, plural1); // "nplurals=1; plural=0;" LanguageDef lang_ja("ja", "Japanese", 1, plural1); // "nplurals=1; plural=0;" LanguageDef lang_ko("ko", "Korean", 1, plural1); // "nplurals=1; plural=0;" LanguageDef lang_tr("tr", "Turkish", 1, plural1); // "nplurals=1; plural=0;" LanguageDef lang_da("da", "Danish", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_nl("nl", "Dutch", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_en("en", "English", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_fo("fo", "Faroese", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_de("de", "German", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_nb("nb", "Norwegian Bokmal", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_no("no", "Norwegian", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_nn("nn", "Norwegian Nynorsk", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_sv("sv", "Swedish", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_et("et", "Estonian", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_fi("fi", "Finnish", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_el("el", "Greek", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_he("he", "Hebrew", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_it("it", "Italian", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_pt("pt", "Portuguese", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_es("es", "Spanish", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_eo("eo", "Esperanto", 2, plural2_1); // "nplurals=2; plural=(n != 1);" LanguageDef lang_fr("fr", "French", 2, plural2_2); // "nplurals=2; plural=(n > 1);" LanguageDef lang_pt_BR("pt_BR", "Brazilian", 2, plural2_2); // "nplurals=2; plural=(n > 1);" LanguageDef lang_lv("lv", "Latvian", 3, plural3_lv); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" LanguageDef lang_ga("ga", "Irish", 3, plural3_ga); // "nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;" LanguageDef lang_lt("lt", "Lithuanian", 3, plural3_lt); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" LanguageDef lang_hr("hr", "Croatian", 3, plural3_1); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" LanguageDef lang_cs("cs", "Czech", 3, plural3_1); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" LanguageDef lang_ru("ru", "Russian", 3, plural3_1); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" LanguageDef lang_uk("uk", "Ukrainian", 3, plural3_1); // "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" LanguageDef lang_sk("sk", "Slovak", 3, plural3_sk); // "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" LanguageDef lang_pl("pl", "Polish", 3, plural3_pl); // "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); LanguageDef lang_sl("sl", "Slovenian", 3, plural3_sl); // "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" //*} LanguageDef& get_language_def(const std::string& name) { if (name == "hu") return lang_hu; else if (name == "ja") return lang_ja; else if (name == "ko") return lang_ko; else if (name == "tr") return lang_tr; else if (name == "da") return lang_da; else if (name == "nl") return lang_nl; else if (name == "en") return lang_en; else if (name == "fo") return lang_fo; else if (name == "de") return lang_de; else if (name == "nb") return lang_nb; else if (name == "no") return lang_no; else if (name == "nn") return lang_nn; else if (name == "sv") return lang_sv; else if (name == "et") return lang_et; else if (name == "fi") return lang_fi; else if (name == "el") return lang_el; else if (name == "he") return lang_he; else if (name == "it") return lang_it; else if (name == "pt") return lang_pt; else if (name == "es") return lang_es; else if (name == "eo") return lang_eo; else if (name == "fr") return lang_fr; else if (name == "pt_BR") return lang_pt_BR; else if (name == "lv") return lang_lv; else if (name == "ga") return lang_ga; else if (name == "lt") return lang_lt; else if (name == "hr") return lang_hr; else if (name == "cs") return lang_cs; else if (name == "ru") return lang_ru; else if (name == "uk") return lang_uk; else if (name == "sk") return lang_sk; else if (name == "pl") return lang_pl; else if (name == "sl") return lang_sl; else return lang_en; } DictionaryManager::DictionaryManager() : current_dict(&empty_dict) { parseLocaleAliases(); // setup language from environment vars const char* lang = getenv("LC_ALL"); if(!lang) lang = getenv("LC_MESSAGES"); if(!lang) lang = getenv("LANG"); if(lang) set_language(lang); } void DictionaryManager::parseLocaleAliases() { // try to parse language alias list std::ifstream in("/usr/share/locale/locale.alias"); char c = ' '; while(in.good() && !in.eof()) { while(isspace(c) && !in.eof()) in.get(c); if(c == '#') { // skip comments while(c != '\n' && !in.eof()) in.get(c); continue; } std::string alias; while(!isspace(c) && !in.eof()) { alias += c; in.get(c); } while(isspace(c) && !in.eof()) in.get(c); std::string language; while(!isspace(c) && !in.eof()) { language += c; in.get(c); } if(in.eof()) break; set_language_alias(alias, language); } } Dictionary& DictionaryManager::get_dictionary(const std::string& spec) { std::string lang = get_language_from_spec(spec); Dictionaries::iterator i = dictionaries.find(get_language_from_spec(lang)); if (i != dictionaries.end()) { return i->second; } else // Dictionary for languages lang isn't loaded, so we load it { //std::cout << "get_dictionary: " << lang << std::endl; Dictionary& dict = dictionaries[lang]; dict.set_language(get_language_def(lang)); for (SearchPath::iterator p = search_path.begin(); p != search_path.end(); ++p) { DIR* dir = opendir(p->c_str()); if (!dir) { std::cerr << "Error: opendir() failed on " << *p << std::endl; } else { struct dirent* ent; while((ent = readdir(dir))) { if (std::string(ent->d_name) == lang + ".po") { std::string pofile = *p + "/" + ent->d_name; std::ifstream in(pofile.c_str()); if (!in) { std::cerr << "Error: Failure file opening: " << pofile << std::endl; } else { read_po_file(dict, in); } } } closedir(dir); } } return dict; } } std::set<std::string> DictionaryManager::get_languages() { std::set<std::string> languages; for (SearchPath::iterator p = search_path.begin(); p != search_path.end(); ++p) { DIR* dir = opendir(p->c_str()); if (!dir) { std::cerr << "Error: opendir() failed on " << *p << std::endl; } else { struct dirent* ent; while((ent = readdir(dir))) { if (has_suffix(ent->d_name, ".po")) { std::string filename = ent->d_name; languages.insert(filename.substr(0, filename.length()-3)); } } closedir(dir); } } return languages; } void DictionaryManager::set_language(const std::string& lang) { language = get_language_from_spec(lang); current_dict = & (get_dictionary(language)); } void DictionaryManager::set_language_alias(const std::string& alias, const std::string& language) { language_aliases.insert(std::make_pair(alias, language)); } std::string DictionaryManager::get_language_from_spec(const std::string& spec) { std::string lang = spec; Aliases::iterator i = language_aliases.find(lang); if(i != language_aliases.end()) { lang = i->second; } std::string::size_type s = lang.find_first_of("_."); if(s == std::string::npos) return lang; return std::string(lang, 0, s); } void DictionaryManager::add_directory(const std::string& pathname) { search_path.push_back(pathname); // cache is outdated now dictionaries.clear(); set_language(language); } //--------------------------------------------------------------------------- Dictionary::Dictionary(const LanguageDef& language_, const std::string& charset_) : language(language_), charset(charset_) { } Dictionary::Dictionary() : language(lang_en) { } std::string Dictionary::get_charset() const { return charset; } void Dictionary::set_charset(const std::string& charset_) { charset = charset_; } void Dictionary::set_language(const LanguageDef& lang) { language = lang; } std::string Dictionary::translate(const std::string& msgid, const std::string& msgid2, int num) { PluralEntries::iterator i = plural_entries.find(msgid); std::map<int, std::string>& msgstrs = i->second; if (i != plural_entries.end() && !msgstrs.empty()) { int g = language.plural(num); std::map<int, std::string>::iterator j = msgstrs.find(g); if (j != msgstrs.end()) { return j->second; } else { // Return the first translation, in case we can't translate the specific number return msgstrs.begin()->second; } } else { std::cerr << "Warning: Couldn't translate: " << msgid << std::endl; std::cerr << "Candidates: " << std::endl; for (PluralEntries::iterator i = plural_entries.begin(); i != plural_entries.end(); ++i) std::cout << "'" << i->first << "'" << std::endl; if (plural2_1(num)) // default to english rules return msgid2; else return msgid; } } std::string Dictionary::translate(const std::string& msgid) { Entries::iterator i = entries.find(msgid); if (i != entries.end() && !i->second.empty()) { return i->second; } else { std::cout << "Error: Couldn't translate: " << msgid << std::endl; return msgid; } } void Dictionary::add_translation(const std::string& msgid, const std::string& , const std::map<int, std::string>& msgstrs) { // Do we need msgid2 for anything? its after all supplied to the // translate call, so we just throw it away plural_entries[msgid] = msgstrs; } void Dictionary::add_translation(const std::string& msgid, const std::string& msgstr) { entries[msgid] = msgstr; } class POFileReader { private: struct Token { std::string keyword; std::string content; }; Dictionary& dict; std::string from_charset; std::string to_charset; std::string current_msgid; std::string current_msgid_plural; std::map<int, std::string> msgstr_plural; int line_num; enum { WANT_MSGID, WANT_MSGSTR, WANT_MSGSTR_PLURAL, WANT_MSGID_PLURAL } state; public: POFileReader(std::istream& in, Dictionary& dict_) : dict(dict_) { state = WANT_MSGID; line_num = 0; tokenize_po(in); } void parse_header(const std::string& header) { // Seperate the header in lines typedef std::vector<std::string> Lines; Lines lines; std::string::size_type start = 0; for(std::string::size_type i = 0; i < header.length(); ++i) { if (header[i] == '\n') { lines.push_back(header.substr(start, i - start)); start = i+1; } } for(Lines::iterator i = lines.begin(); i != lines.end(); ++i) { if (has_prefix(*i, "Content-Type: text/plain; charset=")) { from_charset = i->substr(strlen("Content-Type: text/plain; charset=")); } } if (from_charset.empty() || from_charset == "CHARSET") { std::cerr << "Error: Charset not specified for .po, fallback to ISO-8859-1" << std::endl; from_charset = "ISO-8859-1"; } to_charset = dict.get_charset(); if (to_charset.empty()) { // No charset requested from the dict, so we use the one from the .po to_charset = from_charset; dict.set_charset(from_charset); } } void add_token(const Token& token) { switch(state) { case WANT_MSGID: if (token.keyword == "msgid") { current_msgid = token.content; state = WANT_MSGID_PLURAL; } else if (token.keyword.empty()) { //std::cerr << "Got EOF, everything looks ok." << std::endl; } else { std::cerr << "tinygettext: expected 'msgid' keyword, got " << token.keyword << " at line " << line_num << std::endl; } break; case WANT_MSGID_PLURAL: if (token.keyword == "msgid_plural") { current_msgid_plural = token.content; state = WANT_MSGSTR_PLURAL; } else { state = WANT_MSGSTR; add_token(token); } break; case WANT_MSGSTR: if (token.keyword == "msgstr") { if (current_msgid == "") { // .po Header is hidden in the msgid with the empty string parse_header(token.content); } else { dict.add_translation(current_msgid, convert(token.content, from_charset, to_charset)); } state = WANT_MSGID; } else { std::cerr << "tinygettext: expected 'msgstr' keyword, got " << token.keyword << " at line " << line_num << std::endl; } break; case WANT_MSGSTR_PLURAL: if (has_prefix(token.keyword, "msgstr[")) { int num; if (sscanf(token.keyword.c_str(), "msgstr[%d]", &num) != 1) { std::cerr << "Error: Couldn't parse: " << token.keyword << std::endl; } else { msgstr_plural[num] = convert(token.content, from_charset, to_charset); } } else { dict.add_translation(current_msgid, current_msgid_plural, msgstr_plural); state = WANT_MSGID; add_token(token); } break; } } inline int getchar(std::istream& in) { int c = in.get(); if (c == '\n') line_num += 1; return c; } void tokenize_po(std::istream& in) { enum State { READ_KEYWORD, READ_CONTENT, READ_CONTENT_IN_STRING, SKIP_COMMENT }; State state = READ_KEYWORD; int c; Token token; while((c = getchar(in)) != EOF) { //std::cout << "Lexing char: " << char(c) << " " << state << std::endl; switch(state) { case READ_KEYWORD: if (c == '#') { state = SKIP_COMMENT; } else { // Read a new token token = Token(); do { // Read keyword token.keyword += c; } while((c = getchar(in)) != EOF && !isspace(c)); in.unget(); state = READ_CONTENT; } break; case READ_CONTENT: while((c = getchar(in)) != EOF) { if (c == '"') { // Found start of content state = READ_CONTENT_IN_STRING; break; } else if (isspace(c)) { // skip } else { // Read something that may be a keyword in.unget(); state = READ_KEYWORD; add_token(token); break; } } break; case READ_CONTENT_IN_STRING: if (c == '\\') { c = getchar(in); if (c != EOF) { if (c == 'n') token.content += '\n'; else if (c == 't') token.content += '\t'; else if (c == 'r') token.content += '\r'; else if (c == '"') token.content += '"'; else { std::cout << "Unhandled escape character: " << char(c) << std::endl; } } else { std::cout << "Unterminated string" << std::endl; } } else if (c == '"') { // Content string is terminated state = READ_CONTENT; } else { token.content += c; } break; case SKIP_COMMENT: if (c == '\n') state = READ_KEYWORD; break; } } add_token(token); } }; void read_po_file(Dictionary& dict_, std::istream& in) { POFileReader reader(in, dict_); } } // namespace TinyGetText /* EOF */ Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- setup.cpp 16 Nov 2004 20:37:30 -0000 1.16 +++ setup.cpp 23 Nov 2004 22:21:49 -0000 1.17 @@ -252,16 +252,21 @@ return sdirs; } -void Setup::info(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version) +void Setup::init(const std::string& _package_name, + const std::string& _package_symbol_name, + const std::string& _package_version) { -package_name = _package_name; -package_symbol_name = _package_symbol_name; -package_version = _package_version; + directories(); + dictionary_manager.add_directory(datadir + "/locale"); + + package_name = _package_name; + package_symbol_name = _package_symbol_name; + package_version = _package_version; } /* --- SETUP --- */ /* Set SuperTux configuration and save directories */ -void Setup::directories(void) +void Setup::directories() { std::string home; /* Get home directory (from $HOME variable)... if we can't determine it, Index: setup.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- setup.h 20 Nov 2004 22:14:20 -0000 1.10 +++ setup.h 23 Nov 2004 22:21:50 -0000 1.11 @@ -40,7 +40,7 @@ /// All you need to get an application up and running struct Setup { - static void info(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version); + static void init(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version); static void directories(void); static void general(void); static void general_free(); Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- globals.cpp 20 Nov 2004 22:14:20 -0000 1.10 +++ globals.cpp 23 Nov 2004 22:21:49 -0000 1.11 @@ -25,6 +25,9 @@ namespace SuperTux { +TinyGetText::DictionaryManager dictionary_manager; +TinyGetText::Dictionary* dictionary = 0; + /** The datadir prefix prepended when loading game data file */ std::string datadir; std::string package_symbol_name; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- globals.h 20 Nov 2004 22:14:20 -0000 1.9 +++ globals.h 23 Nov 2004 22:21:49 -0000 1.10 @@ -27,10 +27,14 @@ #include "SDL.h" #include "../video/font.h" +#include "tinygettext.h" namespace SuperTux { + extern TinyGetText::DictionaryManager dictionary_manager; + extern TinyGetText::Dictionary* dictionary; + class MouseCursor; extern std::string datadir; --- NEW FILE: tinygettext.h --- // $Id: tinygettext.h,v 1.1 2004/11/23 22:21:50 matzebraun Exp $ // // TinyGetText - A small flexible gettext() replacement // Copyright (C) 2004 Ingo Ruhnke <gr...@gm...> // // 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 2 // 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 HEADER_TINYGETTEXT_H #define HEADER_TINYGETTEXT_H #include <map> #include <vector> #include <set> #include <string> namespace TinyGetText { typedef int (*PluralFunc)(int n); struct LanguageDef { const char* code; const char* name; int nplural; PluralFunc plural; LanguageDef(const char* code_, const char* name_, int nplural_, PluralFunc plural_) : code(code_), name(name_), nplural(nplural_), plural(plural_) {} }; /** A simple dictionary class that mimics gettext() behaviour. Each Dictionary only works for a single language, for managing multiple languages and .po files at once use the DictionaryManager. */ class Dictionary { private: typedef std::map<std::string, std::string> Entries; Entries entries; typedef std::map<std::string, std::map<int, std::string> > PluralEntries; PluralEntries plural_entries; LanguageDef language; std::string charset; public: /** */ Dictionary(const LanguageDef& language_, const std::string& charset = ""); Dictionary(); /** Return the charset used for this dictionary */ std::string get_charset() const; /** Set a charset for this dictionary, this will NOT convert stuff, it is for information only, you have to convert stuff yourself when you add it with \a add_translation() */ void set_charset(const std::string& charset); /** Set the language that is used for this dictionary, this is mainly needed to evaluate plural forms */ void set_language(const LanguageDef& lang); /** Translate the string \a msgid to its correct plural form, based on the number of items given by \a num. \a msgid2 is \a msgid in plural form. */ std::string translate(const std::string& msgid, const std::string& msgid2, int num); /** Translate the string \a msgid. */ std::string translate(const std::string& msgid); /** Add a translation from \a msgid to \a msgstr to the dictionary, where \a msgid is the singular form of the message, msgid2 the plural form and msgstrs a table of translations. The right translation will be calculated based on the \a num argument to translate(). */ void add_translation(const std::string& msgid, const std::string& msgid2, const std::map<int, std::string>& msgstrs); /** Add a translation from \a msgid to \a msgstr to the dictionary */ void add_translation(const std::string& msgid, const std::string& msgstr); }; /** Manager class for dictionaries, you give it a bunch of directories with .po files and it will then automatically load the right file on demand depending on which language was set. */ class DictionaryManager { private: typedef std::map<std::string, Dictionary> Dictionaries; Dictionaries dictionaries; typedef std::vector<std::string> SearchPath; SearchPath search_path; typedef std::map<std::string, std::string> Aliases; Aliases language_aliases; std::string language; Dictionary* current_dict; Dictionary empty_dict; public: DictionaryManager(); /** Return the currently active dictionary, if none is set, an empty dictionary is returned. */ Dictionary& get_dictionary() { return *current_dict; } /** Get dictionary for lang */ Dictionary& get_dictionary(const std::string& langspec); /** Set a language based on a four? letter country code */ void set_language(const std::string& langspec); /** Define an alias for a language */ void set_language_alias(const std::string& alias, const std::string& lang); /** Add a directory to the search path for dictionaries */ void add_directory(const std::string& pathname); /** Return a set of the available languages in their country code */ std::set<std::string> get_languages(); private: void parseLocaleAliases(); /// returns the language part in a language spec (like de_DE.UTF-8 -> de) std::string get_language_from_spec(const std::string& spec); }; /** Read the content of the .po file given as \a in into the dictionary given as \a dict */ void read_po_file(Dictionary& dict, std::istream& in); LanguageDef& get_language_def(const std::string& name); } // namespace TinyGetText #endif /* EOF */ Index: gettext.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/gettext.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gettext.h 16 Nov 2004 20:37:30 -0000 1.2 +++ gettext.h 23 Nov 2004 22:21:46 -0000 1.3 @@ -1,6 +1,4 @@ -/* Convenience header for conditional use of GNU <libintl.h>. - Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. - +/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -19,65 +17,11 @@ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 -#ifdef HAVE_GETTEXT -# define _(String) gettext(String) -# define N_(String) gettext_noop(String) -#else -# define _(String) String -# define N_(String) String -#endif - -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS - -/* Get declarations of GNU message catalog functions. */ -#include <libintl.h> -// needed for LC_ALL constant -#include <locale.h> - -#else - -/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which - chokes if dcgettext is defined as a macro. So include it now, to make - later inclusions of <locale.h> a NOP. We don't include <libintl.h> - as well because people using "gettext.h" will not include <libintl.h>, - and also including <libintl.h> would fail on SunOS 4, whereas <locale.h> - is OK. */ -#if defined(__sun) -# include <locale.h> -#endif - -#ifndef gettext - -/* Disabled NLS. - The casts to 'const char *' serve the purpose of producing warnings - for invalid uses of the value returned from these functions. - On pre-ANSI systems without 'const', the config.h file is supposed to - contain "#define const". */ -# define gettext(Msgid) ((const char *) (Msgid)) -# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define textdomain(Domainname) ((const char *) (Domainname)) -# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) -# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) - -#endif - -#endif +#include "globals.h" -/* A pseudo function call that serves as a marker for the automated - extraction of messages, but does not call gettext(). The run-time - translation is done at a different place in the code. - The argument, String, should be a literal string. Concatenated strings - and other string expressions won't work. - The macro's expansion is not parenthesized, so that it is suitable as - initializer for static 'char[]' or 'const char[]' variables. */ -#define gettext_noop(String) String +#define _(String) \ + SuperTux::dictionary_manager.get_dictionary().translate(String).c_str() +#define ngettext(id, id2, num) \ + SuperTux::dictionary_manager.get_dictionary().translate(id, di2, num).c_str() #endif /* _LIBGETTEXT_H */ |
From: Matze B. <mat...@us...> - 2004-11-23 22:23:19
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/src Modified Files: leveleditor.cpp sector.cpp supertux.cpp timer.h Log Message: Goodbye gettext, Welcome TinyGetText Index: timer.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/timer.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- timer.h 20 Nov 2004 22:14:39 -0000 1.17 +++ timer.h 23 Nov 2004 22:22:14 -0000 1.18 @@ -17,7 +17,7 @@ * Set period to zero if you want to disable the timer. */ void start(float period, bool cyclic = false); - /** returns true if a period (or more) passed during the last tick command */ + /** returns true if a period (or more) passed */ bool check(); /** returns the period of the timer or 0 if it isn't started */ Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.169 retrieving revision 1.170 diff -u -d -r1.169 -r1.170 --- leveleditor.cpp 23 Nov 2004 16:47:25 -0000 1.169 +++ leveleditor.cpp 23 Nov 2004 22:21:51 -0000 1.170 @@ -935,7 +935,7 @@ char str[1024]; -char *text1[] = { +const char *text1[] = { _("This is the built-in level editor. Its aim is to be intuitive\n" "and simple to use, so it should be pretty straightforward.\n" "\n" @@ -971,7 +971,7 @@ "enemies and game objects in the bottom.\n") }; -char *text2[] = { +const char *text2[] = { _("The Foreground/Interactive/Background buttons may be used to\n" "see and edit the respective layer. Levels have three tiles layers:\n" "Foreground - tiles are drawn on top of everything and have no contact\n" @@ -1004,7 +1004,7 @@ "Webpage: http://pingus.seul.org/~grumbel/flexlay/") }; -char **text[] = { text1, text2 }; +const char **text[] = { text1, text2 }; bool done; Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- supertux.cpp 23 Nov 2004 15:34:45 -0000 1.31 +++ supertux.cpp 23 Nov 2004 22:22:14 -0000 1.32 @@ -49,18 +49,9 @@ try { #endif config = new MyConfig; + + Setup::init(PACKAGE_NAME, PACKAGE, PACKAGE_VERSION); - // we want translations only on messages - setlocale(LC_ALL, "C"); - setlocale(LC_MESSAGES, ""); - - (void) bindtextdomain(PACKAGE, LOCALEDIR); - (void) textdomain(PACKAGE); - (void) bind_textdomain_codeset(PACKAGE, "ISO-8859-1"); - - Setup::info(PACKAGE_NAME, PACKAGE, PACKAGE_VERSION); - - Setup::directories(); Setup::parseargs(argc, argv); Setup::audio(); Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- sector.cpp 23 Nov 2004 22:11:08 -0000 1.41 +++ sector.cpp 23 Nov 2004 22:22:14 -0000 1.42 @@ -162,8 +162,8 @@ return new FlyingPlatform(reader); #endif - std::cerr << "Unknown object type '" << name << "'.\n"; - return 0; + std::cerr << "Unknown object type '" << name << "'.\n"; + return 0; } void |
From: Matze B. <mat...@us...> - 2004-11-23 22:22:50
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639 Modified Files: Jamfile Makefile.am configure.ac Log Message: Goodbye gettext, Welcome TinyGetText Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- configure.ac 23 Nov 2004 19:36:27 -0000 1.38 +++ configure.ac 23 Nov 2004 22:21:22 -0000 1.39 @@ -78,7 +78,7 @@ AC_MSG_RESULT([no]) fi -AM_GNU_GETTEXT +AM_ICONV dnl =========================================================================== dnl Check for SDL @@ -127,10 +127,9 @@ AC_INIT_JAM AC_CONFIG_FILES([Jamconfig]) -AC_OUTPUT(Makefile intl/Makefile +AC_OUTPUT(Makefile src/Makefile data/Makefile - po/Makefile.in lib/Makefile) echo "" Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 23 Nov 2004 19:36:27 -0000 1.9 +++ Makefile.am 23 Nov 2004 22:21:22 -0000 1.10 @@ -1,4 +1,4 @@ -SUBDIRS = intl lib src data po +SUBDIRS = lib src data EXTRA_DIST = LEVELDESIGN TODO contrib/levelconverter-0.0.6_0.0.7.py autogen.sh ACLOCAL_AMFLAGS = -I mk/autoconf AUTOMAKE_OPTIONS = 1.6 dist-bzip2 Index: Jamfile =================================================================== RCS file: /cvsroot/super-tux/supertux/Jamfile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Jamfile 23 Nov 2004 19:36:27 -0000 1.2 +++ Jamfile 23 Nov 2004 22:21:22 -0000 1.3 @@ -8,10 +8,7 @@ UseAutoconf ; # for now... -Package [ Wildcard po : *.po *.in Changelog ] ; -Package [ Wildcard intl : *.c *.h ChangeLog VERSION Makefile.in ] ; Package INSTALL NEWS README COPYING AUTHORS ChangeLog ABOUT-NLS depcomp install-sh mkinstalldirs missing ; -Package Makefile.am src/Makefile.am lib/Makefile.am data/Makefile.am - po/Makefile.in.in intl/Makefile.in ; +Package Makefile.am src/Makefile.am lib/Makefile.am data/Makefile.am ; |
From: Matze B. <mat...@us...> - 2004-11-23 22:22:46
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/data Modified Files: Jamfile Log Message: Goodbye gettext, Welcome TinyGetText Index: Jamfile =================================================================== RCS file: /cvsroot/super-tux/supertux/data/Jamfile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Jamfile 23 Nov 2004 19:36:28 -0000 1.2 +++ Jamfile 23 Nov 2004 22:21:24 -0000 1.3 @@ -41,4 +41,4 @@ InstallData [ Wildcard *.txt ] ; InstallData [ Wildcard music : *.mod *.ogg ] : music ; InstallData [ Wildcard sound : *.wav ] : sound ; - +InstallData [ Wildcard locale : *.po ] : locale ; |
Update of /cvsroot/super-tux/supertux/intl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/intl Removed Files: ChangeLog Makefile.in VERSION bindtextdom.c config.charset dcgettext.c dcigettext.c dcngettext.c dgettext.c dngettext.c eval-plural.h explodename.c finddomain.c gettext.c gettextP.h gmo.h hash-string.h intl-compat.c l10nflist.c libgnuintl.h.in loadinfo.h loadmsgcat.c localcharset.c localcharset.h locale.alias localealias.c localename.c log.c ngettext.c os2compat.c os2compat.h osdep.c plural-exp.c plural-exp.h plural.c plural.y ref-add.sin ref-del.sin relocatable.c relocatable.h textdomain.c Log Message: Goodbye gettext, Welcome TinyGetText --- localcharset.c DELETED --- --- plural-exp.h DELETED --- --- os2compat.c DELETED --- --- ref-del.sin DELETED --- --- plural-exp.c DELETED --- --- localcharset.h DELETED --- --- Makefile.in DELETED --- --- config.charset DELETED --- --- os2compat.h DELETED --- --- hash-string.h DELETED --- --- localename.c DELETED --- --- VERSION DELETED --- --- gettext.c DELETED --- --- ngettext.c DELETED --- --- ref-add.sin DELETED --- --- finddomain.c DELETED --- --- dcgettext.c DELETED --- --- textdomain.c DELETED --- --- eval-plural.h DELETED --- --- intl-compat.c DELETED --- --- localealias.c DELETED --- --- plural.y DELETED --- --- loadinfo.h DELETED --- --- dcigettext.c DELETED --- --- ChangeLog DELETED --- --- plural.c DELETED --- --- l10nflist.c DELETED --- --- bindtextdom.c DELETED --- --- gettextP.h DELETED --- --- libgnuintl.h.in DELETED --- --- log.c DELETED --- --- relocatable.h DELETED --- --- locale.alias DELETED --- --- explodename.c DELETED --- --- dcngettext.c DELETED --- --- relocatable.c DELETED --- --- loadmsgcat.c DELETED --- --- dgettext.c DELETED --- --- gmo.h DELETED --- --- dngettext.c DELETED --- --- osdep.c DELETED --- |
From: Marek M. <wa...@us...> - 2004-11-23 22:12:01
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10472/data/levels/test Modified Files: bonusblock.stl Log Message: added trigger to display (and later count) secret areas Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bonusblock.stl 23 Nov 2004 02:00:31 -0000 1.1 +++ bonusblock.stl 23 Nov 2004 22:11:05 -0000 1.2 @@ -1,8 +1,8 @@ ;; Generated by Flexlay Editor (supertux-level (version 2) - (name "No Name") - (author "No Author") + (name "Bonus Block Test") + (author "SuperTux Team") (time 999) (sector (name "main") @@ -11,6 +11,7 @@ (gravity 10.000000) (background (image "arctis.jpg") (speed 0.5)) + (secretarea (x 64) (y 896) (message "You found a secret area!")) (spawn-points (name "main") (x 100) @@ -51,7 +52,7 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )) (tilemap |
From: Marek M. <wa...@us...> - 2004-11-23 22:11:59
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10472/src Modified Files: sector.cpp Log Message: added trigger to display (and later count) secret areas Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- sector.cpp 22 Nov 2004 23:47:49 -0000 1.40 +++ sector.cpp 23 Nov 2004 22:11:08 -0000 1.41 @@ -55,6 +55,7 @@ #include "badguy/mriceblock.h" #include "badguy/mrbomb.h" #include "trigger/sequence_trigger.h" +#include "trigger/secretarea_trigger.h" Sector* Sector::_current = 0; @@ -135,6 +136,8 @@ return partsys; } else if(name == "door") { return new Door(reader); + } else if(name == "secretarea") { + return new SecretAreaTrigger(reader); } else if(name == "platform") { return new Platform(reader); } else if(name == "jumpy" || name == "money") { |
From: Marek M. <wa...@us...> - 2004-11-23 22:11:21
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10472/src/trigger Added Files: secretarea_trigger.cpp secretarea_trigger.h Log Message: added trigger to display (and later count) secret areas --- NEW FILE: secretarea_trigger.h --- #ifndef __SECRETAREA_TRIGGER_H__ #define __SECRETAREA_TRIGGER_H__ #include "trigger_base.h" #include "serializable.h" #include "resources.h" #include "video/drawing_context.h" #include "app/globals.h" class SecretAreaTrigger : public TriggerBase, public Serializable { public: SecretAreaTrigger(LispReader& reader); SecretAreaTrigger(const Vector& pos, const std::string& sequence); ~SecretAreaTrigger(); void write(LispWriter& writer); void event(Player& player, EventType type); void draw(DrawingContext& context); private: EventType triggerevent; std::string message; int show_message; }; #endif --- NEW FILE: secretarea_trigger.cpp --- #include <config.h> #include "secretarea_trigger.h" #include "utils/lispwriter.h" #include "gameloop.h" SecretAreaTrigger::SecretAreaTrigger(LispReader& reader) { reader.read_float("x", bbox.p1.x); reader.read_float("y", bbox.p1.y); bbox.set_size(32, 32); reader.read_string("message", message); } SecretAreaTrigger::SecretAreaTrigger(const Vector& pos, const std::string& secretarea) { bbox.set_pos(pos); bbox.set_size(32, 32); triggerevent = EVENT_TOUCH; show_message = 0; } SecretAreaTrigger::~SecretAreaTrigger() { } void SecretAreaTrigger::write(LispWriter& writer) { writer.start_list("secretarea"); writer.write_float("x", bbox.p1.x); writer.write_float("y", bbox.p1.y); writer.write_float("width", bbox.get_width()); writer.write_float("height", bbox.get_height()); writer.write_string("message", message); writer.end_list("secretarea"); } void SecretAreaTrigger::draw(DrawingContext& context) { if (show_message == 1) { context.draw_center_text(gold_text, message, Vector(0, screen->h/2 - gold_text->get_height()/2), LAYER_GUI); std::cout<<message<<std::endl; } } void SecretAreaTrigger::event(Player& , EventType type) { if(type == triggerevent) { show_message = 1; } } |
From: Matze B. <mat...@us...> - 2004-11-23 21:58:26
|
Update of /cvsroot/super-tux/supertux/data/locale In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6939/locale Log Message: Directory /cvsroot/super-tux/supertux/data/locale added to the repository |
From: Matze B. <mat...@us...> - 2004-11-23 19:36:49
|
Update of /cvsroot/super-tux/supertux/mk/jam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4130/mk/jam Modified Files: application.jam autoconf.jam build.jam helper.jam install.jam library.jam subdir.jam Added Files: package.jam Log Message: add a dist target to jam Index: subdir.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/subdir.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- subdir.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ subdir.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -3,9 +3,9 @@ # (until jampeople accept my patches :-/ ) #============================================================================ -LOCATE_OBJECTS ?= $(top_builddir)/out/$(target) ; +LOCATE_OBJECTS ?= $(top_builddir)/build/$(target) ; LOCATE_TARGETS ?= $(top_builddir) ; -LOCATE_DOCS ?= $(top_builddir)/out ; +LOCATE_DOCS ?= $(top_builddir)/build ; SUBDIRRULES += FixSubDirPath ; @@ -16,6 +16,9 @@ { LOCATE_SOURCE = [ ConcatDirs $(LOCATE_OBJECTS) $(SUBDIR_TOKENS) ] ; LOCATE_TARGET = [ ConcatDirs $(LOCATE_OBJECTS) $(SUBDIR_TOKENS) ] ; + + # We need to package the Jamfile (a bit hacky here...) + Package Jamfile ; } # fix bug in Jambase where SubInclude in the middle of a jam file made it break --- NEW FILE: package.jam --- #============================================================================ # Rules for creating distribution packages #============================================================================ PACKAGE_FILES = ; PACKAGE_FILE = $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 ; PACKAGE_DIR = $(PACKAGE_NAME)-$(PACKAGE_VERSION) ; LOCATE_DISTTEMP ?= $(top_builddir)/build/dist ; ## Package files ## Add files to distribution package rule Package { for i in $(<) { local target = $(i:R=$(LOCATE_DISTTEMP)/$(PACKAGE_DIR)/$(SUBDIR)) ; local dir = $(i:DR=$(LOCATE_DISTTEMP)/$(PACKAGE_DIR)/$(SUBDIR)) ; local source = $(i:G=$(SOURCE_GRIST:E)_PACKAGE) ; MkDir $(dir) ; Copy $(target) : $(source) ; LOCATE on $(source) = $(SUBDIR) ; Depends $(target) : $(dir) ; Depends $(target) : $(source) ; Depends $(PACKAGE_FILE) : $(target) ; } } actions TarBz2 { tar -c --bzip2 -C $(LOCATE_DISTTEMP) -f $(<) $(PACKAGE_DIR) } TarBz2 $(PACKAGE_FILE) ; Depends dist : $(PACKAGE_FILE) ; Index: build.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/build.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- build.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ build.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -11,6 +11,8 @@ include $(jamrulesdir)/helper.jam ; include $(jamrulesdir)/subdir.jam ; +include $(jamrulesdir)/package.jam ; + include $(jamrulesdir)/variant.jam ; include $(jamrulesdir)/resource.jam ; Index: helper.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/helper.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- helper.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ helper.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -167,7 +167,7 @@ ## Copy source file to target. actions Copy { - $(CP) $(>) $(<) + $(CP) "$(>)" "$(<)" } actions ignore Move Index: library.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/library.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- library.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ library.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -59,7 +59,7 @@ # Generate install rules if ! [ IsElem noinstall : $(3) ] { - install_targets = [ DoInstall $(target) : $(libdir) ] ; + install_targets = [ DoInstall $(target) : $(libdir) : $(INSTALL) : nopackage ] ; Depends install_lib : $(install_targets) ; } @@ -117,6 +117,12 @@ CFlags $(<) : $(CFLAGS) $(LIBRARY_CFLAGS) ; C++Flags $(<) : $(C++FLAGS) $(LIBRARY_C++FLAGS) ; LFlags $(<) : $(LFLAGS) $(LIBRARY_LFLAGS) ; + + # Sources are part of the package + if ! [ IsElem nopackage : $(3) ] + { + Package $(sources) ; + } } ## LibraryVersion Index: autoconf.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/autoconf.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- autoconf.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ autoconf.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -1,15 +1,25 @@ # Clean rules for autoconf generated stuff -# construct some clean targets -Clean distclean : config.log config.status config.cache aclocal.m4 - Jamconfig config.h out.txt log.txt stamp-h1 - libtool ; -CleanDir distclean : autom4te.cache out ; -Depends distclean : clean ; +## Setup some stuff that makes usage of autoconf easier +rule UseAutoconf +{ + # construct some clean targets + Clean distclean : config.log config.status config.cache aclocal.m4 + Jamconfig config.h out.txt log.txt stamp-h1 + libtool ; + CleanDir distclean : autom4te.cache out ; + Depends distclean : clean ; -Clean cvsclean : configure aclocal.m4 config.h.in Jamconfig.in ; -Depends cvsclean : distclean ; + Clean cvsclean : configure aclocal.m4 config.h.in Jamconfig.in ; + Depends cvsclean : distclean ; -Help clean : "Cleanup objectfiles and targets" ; -Help distclean : "Cleanup objectfiles and build configuration" ; -Help cvsclean : "Cleanup all objectfiles, buildconfig and generated files." ; + Help clean : "Cleanup objectfiles and targets" ; + Help distclean : "Cleanup objectfiles and build configuration" ; + Help cvsclean : + "Cleanup all objectfiles, buildconfig and generated files." ; + Package autogen.sh configure.ac configure config.h.in + Jamrules Jamconfig.in ; + Package [ Wildcard mk/jam : *.jam ] [ Wildcard mk/autoconf : *.m4 ] + mk/autoconf/config.guess mk/autoconf/config.sub + mk/autoconf/install-sh ; +} Index: install.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/install.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- install.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ install.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -85,7 +85,7 @@ } } -## DoInstall sourcename : directories [ : installapp ] +## DoInstall sourcename : directories [ : installapp ] [ : options ] ## Creates a new installtarget for the given sources. The target(s) are ## returned as function result. rule DoInstall @@ -96,7 +96,7 @@ gdir = $(dir:G=dir) ; MkDir $(gdir) ; - for i in $(1) { + for i in $(<) { target = $(i:BSR=$(dir):G=install) ; targets += $(target) ; Depends $(target) : $(gdir) $(i) ; @@ -109,6 +109,11 @@ } } + # We want to package all files we install + if ! [ IsElem nopackage : $(4) ] { + Package $(<) ; + } + Always $(targets) ; return $(targets) ; } Index: application.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/application.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- application.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ application.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -24,55 +24,63 @@ ## all target. rule Application { - # check options - CheckOptions noinstall console independent : $(3) : $(<) ; + # check options + CheckOptions noinstall console independent : $(3) : $(<) ; - local target = [ ConstructApplicationTarget $(<) : $(3) ] ; - local sources = [ DoSourceGrist $(>) ] ; - local objects = [ CompileObjects $(sources) ] ; + local target = [ ConstructApplicationTarget $(<) : $(3) ] ; + local sources = [ DoSourceGrist $(>) ] ; + local objects = [ CompileObjects $(sources) ] ; - $(<)_TYPE = application ; - $(<)_OBJECTS = $(objects) ; - $(<)_SOURCES = $(sources) ; - $(<)_TARGET = $(target) ; - $(<)_OPTIONS = $(3) ; - $(<)_INSTALLTARGET = ; + $(<)_TYPE = application ; + $(<)_OBJECTS = $(objects) ; + $(<)_SOURCES = $(sources) ; + $(<)_TARGET = $(target) ; + $(<)_OPTIONS = $(3) ; + $(<)_INSTALLTARGET = ; - # create target clean rule - Always $(<)clean ; - NotFile $(<)clean ; - Clean $(<)clean : $(objects) ; # create target clean rule - Depends clean : $(<)clean ; + # create target clean rule + Always $(<)clean ; + NotFile $(<)clean ; + Clean $(<)clean : $(objects) ; # create target clean rule + Depends clean : $(<)clean ; - # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X) - if $(target) != $(<) - { - Depends $(<) : $(target) ; - NotFile $(<) ; - } + # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X) + if $(target) != $(<) + { + Depends $(<) : $(target) ; + NotFile $(<) ; + } - # make dependency on apps target - if ! [ IsElem independent : $(3) ] - { - Depends apps : $(<) ; - } + # make dependency on apps target + if ! [ IsElem independent : $(3) ] + { + Depends apps : $(<) ; + } - # construct Install target - if ! [ IsElem noinstall : $(3) ] - { - $(<)_INSTALLTARGET = [ DoInstall $(target) : $(bindir) : $(INSTALL_PROGRAM) ] ; - Depends install_bin : $($(<)_INSTALLTARGET) ; - } + # construct Install target + if ! [ IsElem noinstall : $(3) ] + { + $(<)_INSTALLTARGET = [ + DoInstall $(target) : $(bindir) : $(INSTALL_PROGRAM) : nopackage + ] ; + Depends install_bin : $($(<)_INSTALLTARGET) ; + } - # Link - MakeLocate $(target) : $(LOCATE_TARGETS) ; - SystemLinkApplication $(<) : $(objects) : $(3) ; + # Link + MakeLocate $(target) : $(LOCATE_TARGETS) ; + SystemLinkApplication $(<) : $(objects) : $(3) ; - # Import default flags - CppFlags $(<) : $(CPPFLAGS) $(APPLICTION_CPPFLAGS) ; - CFlags $(<) : $(CFLAGS) $(APPLICATION_CFLAGS) ; - C++Flags $(<) : $(C++FLAGS) $(APPLICATION_C++FLAGS) ; - LFlags $(<) : $(LFLAGS) $(APPLICATION_LFLAGS) ; + # Import default flags + CppFlags $(<) : $(CPPFLAGS) $(APPLICTION_CPPFLAGS) ; + CFlags $(<) : $(CFLAGS) $(APPLICATION_CFLAGS) ; + C++Flags $(<) : $(C++FLAGS) $(APPLICATION_C++FLAGS) ; + LFlags $(<) : $(LFLAGS) $(APPLICATION_LFLAGS) ; + + # Sources are part of the package + if ! [ IsElem nopackage : $(3) ] + { + Package $(sources) ; + } } #---------------------------------------------------------------------------- |
From: Matze B. <mat...@us...> - 2004-11-23 19:36:47
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4130 Modified Files: Jamfile Makefile.am autogen.sh configure.ac Log Message: add a dist target to jam Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- configure.ac 23 Nov 2004 16:47:22 -0000 1.37 +++ configure.ac 23 Nov 2004 19:36:27 -0000 1.38 @@ -127,7 +127,7 @@ AC_INIT_JAM AC_CONFIG_FILES([Jamconfig]) -AC_OUTPUT(Makefile m4/Makefile intl/Makefile +AC_OUTPUT(Makefile intl/Makefile src/Makefile data/Makefile po/Makefile.in Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 20 Jul 2004 18:00:43 -0000 1.8 +++ Makefile.am 23 Nov 2004 19:36:27 -0000 1.9 @@ -1,4 +1,4 @@ -SUBDIRS = intl m4 lib src data po +SUBDIRS = intl lib src data po EXTRA_DIST = LEVELDESIGN TODO contrib/levelconverter-0.0.6_0.0.7.py autogen.sh -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I mk/autoconf AUTOMAKE_OPTIONS = 1.6 dist-bzip2 Index: Jamfile =================================================================== RCS file: /cvsroot/super-tux/supertux/Jamfile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Jamfile 23 Nov 2004 16:47:22 -0000 1.1 +++ Jamfile 23 Nov 2004 19:36:27 -0000 1.2 @@ -5,3 +5,13 @@ SubInclude TOP src ; SubInclude TOP data ; +UseAutoconf ; + +# for now... +Package [ Wildcard po : *.po *.in Changelog ] ; +Package [ Wildcard intl : *.c *.h ChangeLog VERSION Makefile.in ] ; +Package INSTALL NEWS README COPYING AUTHORS ChangeLog ABOUT-NLS depcomp + install-sh mkinstalldirs missing ; + +Package Makefile.am src/Makefile.am lib/Makefile.am data/Makefile.am + po/Makefile.in.in intl/Makefile.in ; Index: autogen.sh =================================================================== RCS file: /cvsroot/super-tux/supertux/autogen.sh,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- autogen.sh 23 Nov 2004 16:47:22 -0000 1.11 +++ autogen.sh 23 Nov 2004 19:36:27 -0000 1.12 @@ -6,6 +6,10 @@ exit 1 fi +autoheader +libtoolize --force +aclocal -I mk/autoconf + # generate Jamconfig.in autoconf --trace=AC_SUBST \ | sed -e 's/configure.ac:[0-9]*:AC_SUBST:\([^:]*\).*/\1 ?= "@\1@" ;/g' \ @@ -19,9 +23,6 @@ # see AUTOMAKE_OPTIONS in Makefile.am export WANT_AUTOMAKE=1.6 -autoheader -libtoolize --force -aclocal -I mk/autoconf automake --copy --add-missing autoconf |
From: Matze B. <mat...@us...> - 2004-11-23 19:36:44
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4130/data Modified Files: Jamfile Log Message: add a dist target to jam Index: Jamfile =================================================================== RCS file: /cvsroot/super-tux/supertux/data/Jamfile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Jamfile 23 Nov 2004 16:47:23 -0000 1.1 +++ Jamfile 23 Nov 2004 19:36:28 -0000 1.2 @@ -9,6 +9,7 @@ images/intro images/leveleditor images/map + images/shared images/shared/smalltux images/shared/bigtux images/status |
From: Ingo R. <gr...@us...> - 2004-11-23 16:49:24
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30254 Modified Files: tile_manager.h Log Message: let the TileManager always return a valid tile in case of error Index: tile_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tile_manager.h 20 Nov 2004 22:14:39 -0000 1.5 +++ tile_manager.h 23 Nov 2004 16:49:13 -0000 1.6 @@ -70,7 +70,16 @@ const Tile* get(uint32_t id) const { assert(id < tiles.size()); - return tiles[id]; + Tile* t = tiles[id]; + if (t) + { + return t; + } + else + { + std::cout << "TileManager: Invalid tile: " << id << std::endl; + return tiles[0]; + } } uint32_t get_max_tileid() const |
Update of /cvsroot/super-tux/supertux/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30180/m4 Removed Files: Makefile.am acx_pthread.m4 ax_check_gl.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 sdl.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 Log Message: no need for m4 dir anymore --- sdl.m4 DELETED --- --- iconv.m4 DELETED --- --- nls.m4 DELETED --- --- po.m4 DELETED --- --- intdiv0.m4 DELETED --- --- lib-ld.m4 DELETED --- --- ulonglong.m4 DELETED --- --- acx_pthread.m4 DELETED --- --- lcmessage.m4 DELETED --- --- inttypes-pri.m4 DELETED --- --- glibc21.m4 DELETED --- --- lib-link.m4 DELETED --- --- inttypes_h.m4 DELETED --- --- progtest.m4 DELETED --- --- stdint_h.m4 DELETED --- --- uintmax_t.m4 DELETED --- --- codeset.m4 DELETED --- --- gettext.m4 DELETED --- --- Makefile.am DELETED --- --- inttypes.m4 DELETED --- --- isc-posix.m4 DELETED --- --- ax_check_gl.m4 DELETED --- --- lib-prefix.m4 DELETED --- |
From: Matze B. <mat...@us...> - 2004-11-23 16:48:05
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/lib/video Modified Files: drawing_context.cpp surface.cpp surface.h Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/drawing_context.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- drawing_context.cpp 23 Nov 2004 02:00:32 -0000 1.11 +++ drawing_context.cpp 23 Nov 2004 16:47:24 -0000 1.12 @@ -79,6 +79,22 @@ surfacepartrequest->size = size; surfacepartrequest->source = source; surfacepartrequest->surface = surface; + + // clip on screen borders + if(request.pos.x < 0) { + surfacepartrequest->size.x += request.pos.x; + if(surfacepartrequest->size.x <= 0) + return; + surfacepartrequest->source.x -= request.pos.x; + request.pos.x = 0; + } + if(request.pos.y < 0) { + surfacepartrequest->size.y += request.pos.y; + if(surfacepartrequest->size.y <= 0) + return; + surfacepartrequest->source.y -= request.pos.y; + request.pos.y = 0; + } request.request_data = surfacepartrequest; drawingrequests.push_back(request); Index: surface.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- surface.h 20 Oct 2004 21:08:50 -0000 1.8 +++ surface.h 23 Nov 2004 16:47:24 -0000 1.9 @@ -17,7 +17,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #ifndef SUPERTUX_TEXTURE_H #define SUPERTUX_TEXTURE_H @@ -25,7 +24,7 @@ #include <list> #ifndef NOOPENGL -#include "SDL_opengl.h" +#include <SDL_opengl.h> #endif #include "SDL.h" @@ -122,8 +121,6 @@ /** Reload the surface, which is necesarry in case of a mode swich */ void reload(); - void resize(int widht, int height); - void apply_filter(int filter, Color color = Color(0,0,0)); }; @@ -148,8 +145,6 @@ virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; - int resize(int w_, int h_); - SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function virtual void apply_filter(int filter, Color color = Color(0,0,0)) = 0; Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- surface.cpp 23 Nov 2004 02:00:32 -0000 1.16 +++ surface.cpp 23 Nov 2004 16:47:24 -0000 1.17 @@ -37,7 +37,8 @@ Surface::Surfaces Surface::surfaces; SurfaceData::SurfaceData(SDL_Surface* temp, bool use_alpha_) - : type(SURFACE), surface(0), use_alpha(use_alpha_) + : type(SURFACE), surface(0), use_alpha(use_alpha_), + x(0), y(0), w(0), h(0) { // Copy the given surface and make sure that it is not stored in // video memory @@ -254,58 +255,41 @@ } void -Surface::resize(int w_, int h_) -{ - if (impl) - { - w = w_; - h = h_; - if (impl->resize(w_,h_) == -2) - reload(); - } -} - -void apply_filter_to_surface(SDL_Surface* surface, int filter, Color color) { -if(filter == HORIZONTAL_FLIP_FILTER) - { - SDL_Surface* sur_copy = sdl_surface_from_sdl_surface(surface, true); - SDL_BlitSurface(surface, NULL, sur_copy, NULL); - SDL_SetAlpha(sur_copy,0,0); + if(filter == HORIZONTAL_FLIP_FILTER) { + SDL_Surface* sur_copy = sdl_surface_from_sdl_surface(surface, true); + SDL_BlitSurface(surface, NULL, sur_copy, NULL); + SDL_SetAlpha(sur_copy,0,0); - SDL_Rect src, dst; - src.y = dst.y = 0; - src.w = dst.w = 1; - src.h = dst.h = sur_copy->h; - for(int x = 0; x < sur_copy->w; x++) + SDL_Rect src, dst; + src.y = dst.y = 0; + src.w = dst.w = 1; + src.h = dst.h = sur_copy->h; + for(int x = 0; x < sur_copy->w; x++) { - src.x = x; dst.x = sur_copy->w-1 - x; - SDL_BlitSurface(sur_copy, &src, surface, &dst); + src.x = x; dst.x = sur_copy->w-1 - x; + SDL_BlitSurface(sur_copy, &src, surface, &dst); } - SDL_FreeSurface(sur_copy); - } -else if(filter == MASK_FILTER) - { - SDL_Surface* sur_copy = sdl_surface_from_sdl_surface(surface, true); + SDL_FreeSurface(sur_copy); + } else if(filter == MASK_FILTER) { + SDL_Surface* sur_copy = sdl_surface_from_sdl_surface(surface, true); - Uint8 r,g,b,a; + Uint8 r,g,b,a; - SDL_LockSurface(sur_copy); - for(int x = 0; x < sur_copy->w; x++) - for(int y = 0; y < sur_copy->h; y++) - { - SDL_GetRGBA(getpixel(sur_copy,x,y), sur_copy->format, &r,&g,&b,&a); - if(a != 0) - { - putpixel(sur_copy, x,y, color.map_rgba(sur_copy)); + SDL_LockSurface(sur_copy); + for(int x = 0; x < sur_copy->w; x++) + for(int y = 0; y < sur_copy->h; y++) { + SDL_GetRGBA(getpixel(sur_copy,x,y), sur_copy->format, &r,&g,&b,&a); + if(a != 0) { + putpixel(sur_copy, x,y, color.map_rgba(sur_copy)); } } - SDL_UnlockSurface(sur_copy); + SDL_UnlockSurface(sur_copy); - SDL_BlitSurface(sur_copy, NULL, surface, NULL); - SDL_FreeSurface(sur_copy); + SDL_BlitSurface(sur_copy, NULL, surface, NULL); + SDL_FreeSurface(sur_copy); } } @@ -329,19 +313,12 @@ src.w = w; src.h = h; - conv = SDL_CreateRGBSurface(temp->flags, w, h, temp->format->BitsPerPixel, + conv = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, temp->format->BitsPerPixel, temp->format->Rmask, temp->format->Gmask, temp->format->Bmask, temp->format->Amask); - /* #if SDL_BYTEORDER == SDL_BIG_ENDIAN - 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff); - #else - - 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); - #endif*/ - SDL_SetAlpha(temp,0,0); SDL_BlitSurface(temp, &src, conv, NULL); @@ -480,20 +457,6 @@ return sdl_surface; } -int SurfaceImpl::resize(int w_, int h_) -{ - w = w_; - h = h_; - SDL_Rect dest; - dest.x = 0; - dest.y = 0; - dest.w = w; - dest.h = h; - int ret = SDL_SoftStretch(sdl_surface, NULL, - sdl_surface, &dest); - return ret; -} - #ifndef NOOPENGL SurfaceOpenGL::SurfaceOpenGL(SDL_Surface* surf, bool use_alpha) { @@ -1089,4 +1052,3 @@ SurfaceSDL::~SurfaceSDL() {} -/* EOF */ |
From: Matze B. <mat...@us...> - 2004-11-23 16:48:04
|
Update of /cvsroot/super-tux/supertux/lib/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/lib/utils Modified Files: configfile.h Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: configfile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/configfile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configfile.h 6 Aug 2004 11:43:08 -0000 1.5 +++ configfile.h 23 Nov 2004 16:47:23 -0000 1.6 @@ -30,8 +30,10 @@ public: void load (); void save (); - virtual void customload(LispReader& reader) {}; - virtual void customsave(FILE * config) {}; + virtual void customload(LispReader& ) + {}; + virtual void customsave(FILE* ) + {}; }; extern Config* config; |
From: Matze B. <mat...@us...> - 2004-11-23 16:48:02
|
Update of /cvsroot/super-tux/supertux/contrib/tilemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/contrib/tilemanager Modified Files: Application.cs TileSet.cs Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: Application.cs =================================================================== RCS file: /cvsroot/super-tux/supertux/contrib/tilemanager/Application.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Application.cs 23 Nov 2004 02:00:29 -0000 1.5 +++ Application.cs 23 Nov 2004 16:47:23 -0000 1.6 @@ -254,8 +254,18 @@ return; } foreach(Tile tile in Selection) { - if(tile.ID != -1) - tile.ID = id++; + if(tile.ID == -1) + continue; + + int oldid = tile.ID; + tile.ID = id++; + // remap in all tilegroups... + foreach(TileGroup tilegroup in tileset.TileGroups) { + int idx = tilegroup.Tiles.IndexOf(oldid); + if(idx >= 0) { + tilegroup.Tiles[idx] = tile.ID; + } + } } FillTileList(); SelectionChanged(); Index: TileSet.cs =================================================================== RCS file: /cvsroot/super-tux/supertux/contrib/tilemanager/TileSet.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TileSet.cs 22 Nov 2004 01:52:34 -0000 1.2 +++ TileSet.cs 23 Nov 2004 16:47:23 -0000 1.3 @@ -30,7 +30,8 @@ break; case "tiles": do { - Tiles.Add(parser.IntegerValue); + if(!Tiles.Contains(parser.IntegerValue)) + Tiles.Add(parser.IntegerValue); } while(parser.Parse() && parser.Type == Parser.LispType.INTEGER); break; |
From: Matze B. <mat...@us...> - 2004-11-23 16:48:02
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597 Modified Files: autogen.sh configure.ac Added Files: Jamfile Jamrules Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- configure.ac 20 Nov 2004 22:14:18 -0000 1.36 +++ configure.ac 23 Nov 2004 16:47:22 -0000 1.37 @@ -11,7 +11,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.54]) -AC_INIT(SuperTux, 0.2-cvs) +AC_INIT(supertux, 0.2-cvs) AC_CONFIG_HEADERS(config.h) AC_CONFIG_SRCDIR([src/supertux.cpp]) AC_CANONICAL_TARGET @@ -39,12 +39,14 @@ dnl =========================================================================== dnl Give advanced users some options to play with +VARIANT=optimize AC_MSG_CHECKING(for gprof mode) AC_ARG_ENABLE(gprof, AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]), [enable_gprof=$enableval], [enable_gprof=no]) if test "$enable_gprof" = "yes"; then - CXXFLAGS="$CXXFLAGS -pg" + #CXXFLAGS="$CXXFLAGS -pg" + VARIANT=profile AC_MSG_RESULT([enabled]) else AC_MSG_RESULT([disabled]) @@ -56,12 +58,15 @@ [enable_debug=$enableval], [enable_debug=no]) if test "$enable_debug" = "yes"; then AC_DEFINE([DEBUG], 1, [define to compile in debug checks]) - CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3" + #CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3" + VARIANT=debug AC_MSG_RESULT([enabled]) else - CXXFLAGS="$CXXFLAGS -O2 -g" + #CXXFLAGS="$CXXFLAGS -O2 -g" + VARIANT=optimize AC_MSG_RESULT([disabled]) fi +AC_SUBST([VARIANT]) AC_MSG_CHECKING(wether OpenGL should be used) AC_ARG_ENABLE(opengl, @@ -81,37 +86,47 @@ AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) -CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" -CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS $SDL_LIBS" -GL_LIBS="-lGL" -dnl Checks for additional libraries. -AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,, - AC_MSG_ERROR([SDL_mixer library required])) +NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2], + NP_LANG_PROGRAM([#include <SDL_mixer.h> +#if MIX_MAJOR_VERSION < 1 +# error SDLMix too old +#else +# if MIX_MAJOR_VERSION == 1 +# if MIX_MINOR_VERSION < 2 +# error SDLMix too old +# endif +# endif +#endif], [Mix_OpenAudio(0, 0, 0, 0);]), + [], [-lSDL_mixer], + [], + [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])], + [$SDL_CFLAGS], [$SDL_LIBS]) -AC_CHECK_LIB(SDL_image, IMG_Load,, - AC_MSG_ERROR([SDL_image library required])) +NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2], + NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]), + [], [-lSDL_image], + [], + [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])], + [$SDL_CFLAGS], [$SDL_LIBS]) if test "$enable_opengl" = "yes"; then AX_CHECK_GL fi if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then - CXXFLAGS="$CXXFLAGS -DNOOPENGL" - enable_opengl=no + GL_AVAILABLE="no" + AC_DEFINE([NOOPENGL],, [Define if opengl should not be used]) else - CFLAGS="$CFLAGS $GL_CFLAGS" - CXXFLAGS="$CXXFLAGS $GL_CFLAGS" - LIBS="$LIBS $GL_LIBS" + GL_AVAILABLE="yes" fi - -AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing])) - -CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'" +AC_SUBST([GL_AVAILABLE]) dnl Checks for library functions. AC_CHECK_FUNCS(mkdir strdup strstr) +AC_INIT_JAM +AC_CONFIG_FILES([Jamconfig]) + AC_OUTPUT(Makefile m4/Makefile intl/Makefile src/Makefile data/Makefile @@ -125,5 +140,3 @@ echo " Debug Mode: $enable_debug" echo " OpenGL Support: $enable_opengl" echo "" - -# EOF # --- NEW FILE: Jamrules --- if ! $(top_builddir) { top_builddir = $(TOP) ; } top_srcdir = $(TOP) ; JAMCONFIG ?= $(top_builddir)/Jamconfig ; include $(JAMCONFIG) ; if ! $(JAMCONFIG_READ) { EXIT "Couldn't find config. Please run 'configure' first." ; } if $(USE_STLPORT_DEBUG) { CPPFLAGS += -I/usr/include/stlport ; CPPFLAGS += -D_STLP_DEBUG=1 -D_STLP_DEBUG_UNINITIALIZED=1 ; CPPFLAGS += -D_STLP_SHRED_BYTE=0xA3 ; LIBS += -lstlport_gcc_debug ; } COMPILER_CFLAGS += -Wall -W ; COMPILER_CFLAGS_optimize += -O3 -g3 ; COMPILER_C++FLAGS_optimize += -O3 -g3 ; COMPILER_LFLAGS_optimize += -O3 -g3 ; COMPILER_CFLAGS_debug += -DDEBUG -Werror -g3 ; COMPILER_CXXFLAGS_debug += -DDEBUG -Werror -g3 ; COMPILER_LFLAGS_debug += -g3 ; COMPILER_CFLAGS_profile += -O2 -g3 -pg ; COMPILER_CXXFLAGS_profile += -O2 -g3 -pg ; COMPILER_LFLAGS_profile += -g3 -pg ; LINK = $(CXX) ; # Include build rules include $(TOP)/mk/jam/build.jam ; # Include Dirs IncludeDir $(top_builddir) ; # for config.h IncludeDir lib src ; Index: autogen.sh =================================================================== RCS file: /cvsroot/super-tux/supertux/autogen.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- autogen.sh 18 Nov 2004 23:52:49 -0000 1.10 +++ autogen.sh 23 Nov 2004 16:47:22 -0000 1.11 @@ -1,5 +1,19 @@ #!/bin/sh +# Correct working directory? +if test ! -f configure.ac ; then + echo "*** Please invoke this script from directory containing configure.ac." + exit 1 +fi + +# generate Jamconfig.in +autoconf --trace=AC_SUBST \ + | sed -e 's/configure.ac:[0-9]*:AC_SUBST:\([^:]*\).*/\1 ?= "@\1@" ;/g' \ + > Jamconfig.in +sed -e 's/.*BACKSLASH.*//' -i Jamconfig.in +echo 'INSTALL ?= "@INSTALL@" ;' >> Jamconfig.in +echo 'JAMCONFIG_READ = yes ;' >> Jamconfig.in + # we need a minimum of automake 1.6 and automake 1.8 seems to be buggy # this doesn't seem to work well # see AUTOMAKE_OPTIONS in Makefile.am @@ -7,7 +21,7 @@ autoheader libtoolize --force -aclocal -I m4 +aclocal -I mk/autoconf automake --copy --add-missing autoconf --- NEW FILE: Jamfile --- SubDir TOP ; # Decend into subdirs SubInclude TOP lib ; SubInclude TOP src ; SubInclude TOP data ; |
From: Matze B. <mat...@us...> - 2004-11-23 16:47:37
|
Update of /cvsroot/super-tux/supertux/src/object In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/src/object Modified Files: coin.cpp flower.cpp invisible_block.cpp oneup.cpp platform.cpp Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: platform.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/platform.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- platform.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ platform.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -26,7 +26,7 @@ } HitResponse -Platform::collision(GameObject& object, const CollisionHit& hit) +Platform::collision(GameObject& , const CollisionHit& ) { #if 0 if(typeid(object) == typeid(Player)) { @@ -38,7 +38,7 @@ } void -Platform::action(float elapsed_time) +Platform::action(float ) { // just some test code... if(state == 0) { Index: invisible_block.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/invisible_block.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- invisible_block.cpp 22 Nov 2004 23:47:51 -0000 1.1 +++ invisible_block.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -20,7 +20,7 @@ } void -InvisibleBlock::hit(Player& player) +InvisibleBlock::hit(Player& ) { if(visible) return; Index: flower.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/flower.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flower.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ flower.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -39,7 +39,7 @@ } HitResponse -Flower::collision(GameObject& other, const CollisionHit& hit) +Flower::collision(GameObject& other, const CollisionHit& ) { Player* player = dynamic_cast<Player*>(&other); if(!player) Index: coin.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/coin.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- coin.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ coin.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -31,7 +31,7 @@ } HitResponse -Coin::collision(GameObject& other, const CollisionHit& hit) +Coin::collision(GameObject& other, const CollisionHit& ) { Player* player = dynamic_cast<Player*>(&other); if(player == 0) Index: oneup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/oneup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- oneup.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ oneup.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -33,7 +33,7 @@ } HitResponse -OneUp::collision(GameObject& other, const CollisionHit& hit) +OneUp::collision(GameObject& other, const CollisionHit& ) { Player* player = dynamic_cast<Player*> (&other); if(player) { |
From: Matze B. <mat...@us...> - 2004-11-23 16:47:37
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/src/trigger Modified Files: door.cpp sequence_trigger.cpp sequence_trigger.h trigger_base.cpp Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: door.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/door.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- door.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ door.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -87,7 +87,7 @@ } void -Door::event(Player& player, EventType type) +Door::event(Player& , EventType type) { if(type == EVENT_ACTIVATE) { sprite->set_action("open"); Index: sequence_trigger.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/sequence_trigger.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sequence_trigger.h 20 Nov 2004 22:14:40 -0000 1.1 +++ sequence_trigger.h 23 Nov 2004 16:47:26 -0000 1.2 @@ -7,7 +7,7 @@ class SequenceTrigger : public TriggerBase, public Serializable { public: - SequenceTrigger(LispReader& reader, const std::string& sequence); + SequenceTrigger(LispReader& reader); SequenceTrigger(const Vector& pos, const std::string& sequence); ~SequenceTrigger(); Index: trigger_base.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/trigger_base.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- trigger_base.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ trigger_base.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -48,7 +48,7 @@ } HitResponse -TriggerBase::collision(GameObject& other, const CollisionHit& collhit) +TriggerBase::collision(GameObject& other, const CollisionHit& ) { Player* player = dynamic_cast<Player*> (&other); if(player) { Index: sequence_trigger.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/sequence_trigger.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sequence_trigger.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ sequence_trigger.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -4,9 +4,9 @@ #include "utils/lispwriter.h" #include "gameloop.h" -SequenceTrigger::SequenceTrigger(LispReader& reader, - const std::string& sequence) +SequenceTrigger::SequenceTrigger(LispReader& reader) { + (void) reader; // TODO } @@ -38,7 +38,7 @@ } void -SequenceTrigger::event(Player& player, EventType type) +SequenceTrigger::event(Player& , EventType type) { if(type == triggerevent) { GameSession::current()->start_sequence(sequence_name); |
From: Matze B. <mat...@us...> - 2004-11-23 16:47:37
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/src/badguy Modified Files: badguy.cpp bomb.cpp bouncing_snowball.cpp jumpy.cpp mrbomb.cpp mriceblock.cpp snowball.cpp spiky.cpp Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: bomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bomb.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bomb.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ bomb.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -18,13 +18,13 @@ } void -Bomb::write(LispWriter& writer) +Bomb::write(LispWriter& ) { // bombs are only temporarily so don't write them out... } HitResponse -Bomb::collision_solid(GameObject& other, const CollisionHit& hit) +Bomb::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) physic.set_velocity_y(0); @@ -33,7 +33,7 @@ } HitResponse -Bomb::collision_player(Player& player, const CollisionHit& hit) +Bomb::collision_player(Player& player, const CollisionHit& ) { if(state == 1) { player.kill(Player::SHRINK); @@ -42,7 +42,7 @@ } void -Bomb::active_action(float elapsed_time) +Bomb::active_action(float ) { switch(state) { case 0: Index: bouncing_snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bouncing_snowball.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bouncing_snowball.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ bouncing_snowball.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -40,7 +40,7 @@ } HitResponse -BouncingSnowball::collision_solid(GameObject& other, const CollisionHit& hit) +BouncingSnowball::collision_solid(GameObject& , const CollisionHit& hit) { if(hit.normal.y < -.5) { // hit floor physic.set_velocity_y(JUMPSPEED); Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- badguy.cpp 22 Nov 2004 23:47:50 -0000 1.3 +++ badguy.cpp 23 Nov 2004 16:47:26 -0000 1.4 @@ -81,7 +81,7 @@ } void -BadGuy::inactive_action(float elapsed_time) +BadGuy::inactive_action(float ) { } @@ -118,7 +118,7 @@ } HitResponse -BadGuy::collision_solid(GameObject& other, const CollisionHit& hit) +BadGuy::collision_solid(GameObject& , const CollisionHit& ) { return FORCE_MOVE; } @@ -139,13 +139,13 @@ } HitResponse -BadGuy::collision_badguy(BadGuy& other, const CollisionHit& hit) +BadGuy::collision_badguy(BadGuy& , const CollisionHit& ) { return FORCE_MOVE; } bool -BadGuy::collision_squished(Player& player) +BadGuy::collision_squished(Player& ) { return false; } Index: mriceblock.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mriceblock.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mriceblock.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ mriceblock.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -46,7 +46,7 @@ } HitResponse -MrIceBlock::collision_solid(GameObject& other, const CollisionHit& hit) +MrIceBlock::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) { // floor or roof physic.set_velocity_y(0); Index: snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- snowball.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ snowball.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -39,7 +39,7 @@ } HitResponse -SnowBall::collision_solid(GameObject& other, const CollisionHit& hit) +SnowBall::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) { // hit floor or roof? physic.set_velocity_y(0); Index: jumpy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/jumpy.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jumpy.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ jumpy.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -24,7 +24,7 @@ } HitResponse -Jumpy::collision_solid(GameObject& other, const CollisionHit& hit) +Jumpy::collision_solid(GameObject& , const CollisionHit& hit) { // hit floor? if(hit.normal.y < -.5) { Index: mrbomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mrbomb.cpp 20 Nov 2004 22:14:39 -0000 1.1 +++ mrbomb.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -41,7 +41,7 @@ } HitResponse -MrBomb::collision_solid(GameObject& other, const CollisionHit& hit) +MrBomb::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) { // hit floor or roof? physic.set_velocity_y(0); Index: spiky.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/spiky.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spiky.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ spiky.cpp 23 Nov 2004 16:47:26 -0000 1.2 @@ -31,7 +31,7 @@ } HitResponse -Spiky::collision_solid(GameObject& other, const CollisionHit& hit) +Spiky::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) { // hit floor or roof? physic.set_velocity_y(0); |
From: Matze B. <mat...@us...> - 2004-11-23 16:47:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/src Modified Files: leveleditor.cpp player.cpp Added Files: Jamfile Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.200 retrieving revision 1.201 diff -u -d -r1.200 -r1.201 --- player.cpp 23 Nov 2004 02:00:51 -0000 1.200 +++ player.cpp 23 Nov 2004 16:47:25 -0000 1.201 @@ -1010,7 +1010,7 @@ } void -Player::bounce(BadGuy& badguy) +Player::bounce(BadGuy& ) { //Make sure we stopped flapping flapping = false; --- NEW FILE: Jamfile --- SubDir TOP src ; Application supertux : [ Wildcard *.cpp *.h ] [ Wildcard object : *.cpp *.h ] [ Wildcard badguy : *.cpp *.h ] [ Wildcard trigger : *.cpp *.h ] ; LinkWith supertux : supertuxlib ; ExternalLibs supertux : SDL SDLMIXER SDLIMAGE GL ; Help supertux : "Build the supertux executable" ; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- leveleditor.cpp 23 Nov 2004 02:00:33 -0000 1.168 +++ leveleditor.cpp 23 Nov 2004 16:47:25 -0000 1.169 @@ -855,6 +855,7 @@ void LevelEditor::change(int x, int y, int newtile, int layer) { + (void) layer; // find the tilemap of the current layer, and then change the tile if(x < 0 || (unsigned int)x >= sector->solids->get_width()*32 || y < 0 || (unsigned int)y >= sector->solids->get_height()*32) |
From: Matze B. <mat...@us...> - 2004-11-23 16:47:33
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29597/data Added Files: Jamfile Log Message: added jam build system, please try it out - the advantage would be that it already supports all the stuff we need --- NEW FILE: Jamfile --- SubDir TOP data ; IMAGEPATHS = images images/background images/fonts images/highscore images/icons images/intro images/leveleditor images/map images/shared/smalltux images/shared/bigtux images/status images/tilesets images/title images/worldmap ; for p in $(IMAGEPATHS) { InstallData [ Wildcard $(p) : *.png *.jpg *.xpm *.strf *.ico *.stgt *.stwt ] : $(p) ; } LEVELPATHS = levels/bonus1 levels/contribs levels/misc levels/test levels/world1 levels/world2 levels/worldmap ; for p in $(LEVELPATHS) { InstallData [ Wildcard $(p) : info *.stl *.stwm ] : $(p) ; } InstallData [ Wildcard *.txt ] ; InstallData [ Wildcard music : *.mod *.ogg ] : music ; InstallData [ Wildcard sound : *.wav ] : sound ; |