# HG changeset patch # User Xeli # Date 1321114009 -3600 # Node ID d14adf1c772104bf0bf06b0f9d5dd9a0dd633045 # Parent 1998ff75321ae2fa265e56d79b9611c7d979127a# Parent 07d83af9d2a86985ff7b8a30412e888ae76a16f8 merge...i think diff -r 1998ff75321a -r d14adf1c7721 ChangeLog.txt --- a/ChangeLog.txt Sat Nov 12 15:48:55 2011 +0100 +++ b/ChangeLog.txt Sat Nov 12 17:06:49 2011 +0100 @@ -1,6 +1,37 @@ + features * bugfixes +0.9.16 -> 0.9.17: + + New theme, Cave + + New voicepack, Hillbilly + + More attractive mission screen with previews + + Chat timestamping, links, input history, tab completion + + Customisable chat by dragging a .css file, see file generated by the /saveStyleSheet command + + Errors/warnings in chat instead of popup boxes + + Mousewheel to change hog/weapon counts in game creation + + Refresh DLC page on access, display notice if DLC page is not accessible + + Team colours changed, again + + Land texture on maps using mask of black + + Spread clouds/flakes over near/far layers for more 3D + + Team coloured RC/airstrike + + Icy girders/bridges on Snow/Christmas themes, support for ice land type (blue in mask) + + Sticky mines, mines activate 1s after use in infinite attack mode + + Grenades/bazooka/melon pieces/ballgun now kicked by explosions + + Minor theme optimisation, Optional SkyR + + Camera follows melon, clusterbomb, gas cloud + * Vertical movement should be restricted for small displays, camera will try less hard to keep hog in centre + * Keep mouse from jumping around when ammo menu is active + * Hogs can now move after trapping another hog in a portal loop + * ctrl-w no longer closes engine window + * Fix bugs in blowtorch angle/direction + * Fix playing notes on the piano + * Fix some colours in greyscale 3D + * Fix Lua overrides of map config + * Girders no longer make windows in tunnels + * Prevent some more escaping through border, firepunch, pickhammer + * Many frontend bugfixes, code cleanup. Crash in game abort, flake clipping, invalid state on room close + * Many other engine bugfixes. SDL event crasher, timebox crasher, birdy hang, desync on quits, crash in birdy eggshell, clouds on Deep Space theme, etc + 0.9.15 -> 0.9.16: + In-game chat now supports backspace-repeat and Escape to close the text input area + Team status bars shrunk/made translucent if they take up a significant portion of the screen diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/hwconsts.h Sat Nov 12 17:06:49 2011 +0100 @@ -110,14 +110,27 @@ 0xffffef00, /. yellow ./ \ // add new colors here 0 }*/ -#define HW_TEAMCOLOR_ARRAY { 0xffd12b42, /* red */ \ +/* +#define HW_TEAMCOLOR_ARRAY { 0xffd12b42, /. red ./ \ + 0xff4980c1, /. blue ./ \ + 0xff6ab530, /. green ./ \ + 0xffbc64c4, /. purple ./ \ + 0xffe76d14, /. orange ./ \ + 0xff3fb6e6, /. cyan ./ \ + 0xffe3e90c, /. yellow ./ \ + 0xff61d4ac, /. mint ./ \ + 0xfff1c3e1, /. pink ./ \ + // add new colors here + 0 }*/ +/* another set. this one is a merge of mikade/bugq colours w/ a bit of channel feedback */ +#define HW_TEAMCOLOR_ARRAY { 0xffff0204, /* red */ \ 0xff4980c1, /* blue */ \ - 0xff6ab530, /* green */ \ - 0xffbc64c4, /* purple */ \ - 0xffe76d14, /* orange */ \ - 0xff3fb6e6, /* cyan */ \ - 0xffe3e90c, /* yellow */ \ - 0xff61d4ac, /* mint */ \ - 0xfff1c3e1, /* pink */ \ + 0xff1de6ba, /* teal */ \ + 0xffb541ef, /* purple */ \ + 0xffe55bb0, /* pink */ \ + 0xff20bf00, /* green */ \ + 0xfffe8b0e, /* orange */ \ + 0xff5f3605, /* brown */ \ + 0xffffff01, /* yellow */ \ /* add new colors here */ \ 0 } diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/hwform.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -755,6 +755,9 @@ hwnet->NewNick(newNick); config->setValue("net/nick", newNick); config->updNetNick(); + + ui.pageRoomsList->setUser(nick); + ui.pageNetGame->setUser(nick); } void HWForm::NetAuthFailed() @@ -800,8 +803,6 @@ hwnet=0; } - ui.pageRoomsList->chatWidget->clear(); - hwnet = new HWNewNet(); GoToPage(ID_PAGE_CONNECTING); @@ -939,6 +940,10 @@ config->setValue("net/nick",nick); config->updNetNick(); } + + ui.pageRoomsList->setUser(nick); + ui.pageNetGame->setUser(nick); + hwnet->Connect(hostName, port, nick); } @@ -997,6 +1002,9 @@ delete pnetserver; pnetserver = 0; } + + if(hwnet) + hwnet->Disconnect(); } void HWForm::ForcedDisconnect(const QString & reason) @@ -1166,7 +1174,7 @@ ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() ).toString(); - CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); + CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/hwform.h Sat Nov 12 17:06:49 2011 +0100 @@ -157,11 +157,11 @@ ID_PAGE_DRAWMAP = 20, ID_PAGE_DATADOWNLOAD = 21 }; - QPointer game; - QPointer pnetserver; - QPointer pRegisterServer; - QPointer editedTeam; - QPointer hwnet; + QPointer game; + QPointer pnetserver; + QPointer pRegisterServer; + QPointer editedTeam; + QPointer hwnet; HWNamegen * namegen; AmmoSchemeModel * ammoSchemeModel; QStack PagesStack; diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/main.cpp diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/res/Star.png Binary file QTfrontend/res/Star.png has changed diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/res/css/chat.css --- a/QTfrontend/res/css/chat.css Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/res/css/chat.css Sat Nov 12 17:06:49 2011 +0100 @@ -8,22 +8,42 @@ * see http://doc.qt.nokia.com/4.5/richtext-html-subset.html#css-properties * * In the QTfrontend of hedgewars also display:none; will work for class names - * that start with msg_ and .TimeStamp - as long as they are referenced - * directly and not within any hierachy. + * that start with msg_ and .timestamp - as long as they are referenced + * directly and not within any class hierachy. + * Note: Will only effect new lines! * ****************************************************************************** * * This file can be stored at different locations, but it will be read only * once, based on first file found in this order: * - * /Data/css/chat.css - * /css/chat.css - * + * /Data/css/chat.css ( create/see full path with: /saveStyleSheet ) + * /css/chat.css + * * *****************************************************************************/ +/* valid color values + * + * transparent (no color) + * + * colorname + * (a word that is the name of a valid color) + * available colors: http://www.w3.org/TR/SVG/types.html#ColorKeywords + * examples: red, steelblue, mintcream + * + * #RRGGBB + * (hexadecimal additive red-green-blue, max is ff, min 00, half is 80) + * examples: #ffff00 (yellow), #808080 (gray) + * + * rgb(r, g, b) + * (decimal additive red-green-blue, max is 255, min 0, half is 128) + * examples: rgb(135, 206, 250) (lightskyblue) + */ + + /* links */ -a { color:#c8c8ff; } +a { color: #c8c8ff; } /* appearance of the whole chat */ /* body { color: white; background-color: #000000; } */ @@ -48,6 +68,9 @@ .msg_FriendAction { color: #ff00ff; } .msg_FriendAction .nick { color: #ff30ff; } +/* uncomment next line to disable join and leave messages of non-friends */ +/* .msg_UserJoin { display:none; } */ + /* timestamps */ .timestamp { color: #e0d8e0; @@ -58,15 +81,15 @@ /* display: none; */ } +/* .timestamp:hours { display: none; } */ +.timestamp:seconds { display: none; } + /* you can also set timestamp style for different msg types */ .msg_FriendChat .timestamp { color: #ffffff; } /* messages that contain your nickname */ .highlight { } -.highlight .nick { color: red; } /* nicknames in highlighted messages */ - -/* uncomment next line to disable join and leave messages of non-friends */ -/* .msg_UserJoin { display:none; } */ +.highlight .nick { color: #ff0000; } /* nicknames in highlighted messages */ /* system messages */ .msg_Error { color: #ff0000; } diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/res/css/qt.css --- a/QTfrontend/res/css/qt.css Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/res/css/qt.css Sat Nov 12 17:06:49 2011 +0100 @@ -11,9 +11,9 @@ * This file can be stored at different locations, but it will be read only * once, based on first file found in this order: * - * /Data/css/qt.css - * /css/qt.css - * (:/res/css/qt.css) + * /Data/css/qt.css + * /css/qt.css + * (:/res/css/qt.css) * *****************************************************************************/ @@ -30,6 +30,8 @@ selection-color: #00351d; } +a { color:#c8c8ff; } + QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox, QComboBox QAbstractItemView, QMenu::item { background-color: rgba(13, 5, 68, 70%); diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/team.cpp --- a/QTfrontend/team.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/team.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -28,10 +28,10 @@ #include "hats.h" HWTeam::HWTeam(const QString & teamname) : - QObject(0) - , m_difficulty(0) - , m_numHedgehogs(4) - , m_isNetTeam(false) + QObject(0) + , m_difficulty(0) + , m_numHedgehogs(4) + , m_isNetTeam(false) { m_name = teamname; OldTeamName = m_name; @@ -55,9 +55,9 @@ } HWTeam::HWTeam(const QStringList& strLst) : - QObject(0) - , m_numHedgehogs(4) - , m_isNetTeam(true) + QObject(0) + , m_numHedgehogs(4) + , m_isNetTeam(true) { // net teams are configured from QStringList if(strLst.size() != 23) throw HWTeamConstructException(); @@ -82,7 +82,7 @@ } HWTeam::HWTeam() : - QObject(0) + QObject(0) , m_difficulty(0) , m_numHedgehogs(4) , m_isNetTeam(false) @@ -110,51 +110,51 @@ } HWTeam::HWTeam(const HWTeam & other) : - QObject(0) - , OldTeamName(other.OldTeamName) - , m_name(other.m_name) - , m_grave(other.m_grave) - , m_fort(other.m_fort) - , m_flag(other.m_flag) - , m_voicepack(other.m_voicepack) - , m_hedgehogs(other.m_hedgehogs) - , m_difficulty(other.m_difficulty) - , m_binds(other.m_binds) - , m_numHedgehogs(other.m_numHedgehogs) - , m_color(other.m_color) - , m_isNetTeam(other.m_isNetTeam) - , m_owner(other.m_owner) - , m_campaignProgress(other.m_campaignProgress) - , m_rounds(other.m_rounds) - , m_wins(other.m_wins) -// , AchievementProgress(other.AchievementProgress) + QObject(0) + , OldTeamName(other.OldTeamName) + , m_name(other.m_name) + , m_grave(other.m_grave) + , m_fort(other.m_fort) + , m_flag(other.m_flag) + , m_voicepack(other.m_voicepack) + , m_hedgehogs(other.m_hedgehogs) + , m_difficulty(other.m_difficulty) + , m_binds(other.m_binds) + , m_numHedgehogs(other.m_numHedgehogs) + , m_color(other.m_color) + , m_isNetTeam(other.m_isNetTeam) + , m_owner(other.m_owner) + , m_campaignProgress(other.m_campaignProgress) + , m_rounds(other.m_rounds) + , m_wins(other.m_wins) +// , AchievementProgress(other.AchievementProgress) { } HWTeam & HWTeam::operator = (const HWTeam & other) { - if(this != &other) - { - OldTeamName = other.OldTeamName; - m_name = other.m_name; - m_grave = other.m_grave; - m_fort = other.m_fort; - m_flag = other.m_flag; - m_voicepack = other.m_voicepack; -// m_hedgehogs = other.m_hedgehogs; - m_difficulty = other.m_difficulty; -// m_binds = other.m_binds; - m_numHedgehogs = other.m_numHedgehogs; - m_color = other.m_color; - m_isNetTeam = other.m_isNetTeam; - m_owner = other.m_owner; - m_campaignProgress = other.m_campaignProgress; - m_rounds = other.m_rounds; - m_wins = other.m_wins; - } + if(this != &other) + { + OldTeamName = other.OldTeamName; + m_name = other.m_name; + m_grave = other.m_grave; + m_fort = other.m_fort; + m_flag = other.m_flag; + m_voicepack = other.m_voicepack; +// m_hedgehogs = other.m_hedgehogs; + m_difficulty = other.m_difficulty; +// m_binds = other.m_binds; + m_numHedgehogs = other.m_numHedgehogs; + m_color = other.m_color; + m_isNetTeam = other.m_isNetTeam; + m_owner = other.m_owner; + m_campaignProgress = other.m_campaignProgress; + m_rounds = other.m_rounds; + m_wins = other.m_wins; + } - return *this; + return *this; } bool HWTeam::loadFromFile() diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/team.h --- a/QTfrontend/team.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/team.h Sat Nov 12 17:06:49 2011 +0100 @@ -44,7 +44,7 @@ // class representing a team class HWTeam : public QObject { - Q_OBJECT + Q_OBJECT public: @@ -52,7 +52,7 @@ HWTeam(const QString & teamname); HWTeam(const QStringList& strLst); HWTeam(); - HWTeam(const HWTeam & other); + HWTeam(const HWTeam & other); // file operations static HWTeam loadFromFile(const QString & teamName); @@ -96,9 +96,9 @@ QStringList teamGameConfig(quint32 InitHealth) const; // comparison operators - bool operator == (const HWTeam& t1) const; - bool operator < (const HWTeam& t1) const; - HWTeam & operator = (const HWTeam & other); + bool operator == (const HWTeam& t1) const; + bool operator < (const HWTeam& t1) const; + HWTeam & operator = (const HWTeam & other); private: @@ -112,11 +112,11 @@ QString m_flag; QString m_voicepack; HWHog m_hedgehogs[HEDGEHOGS_PER_TEAM]; - quint8 m_difficulty; + quint8 m_difficulty; BindAction m_binds[BINDS_NUMBER]; // class members that contain info for the current game setup - quint8 m_numHedgehogs; + quint8 m_numHedgehogs; QColor m_color; bool m_isNetTeam; QString m_owner; diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/page/pagenetgame.cpp --- a/QTfrontend/ui/page/pagenetgame.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/page/pagenetgame.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -174,3 +174,7 @@ leRoomName->setVisible(isMaster); } +void PageNetGame::setUser(const QString & nickname) +{ + pChatWidget->setUser(nickname); +} diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/page/pagenetgame.h --- a/QTfrontend/ui/page/pagenetgame.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/page/pagenetgame.h Sat Nov 12 17:06:49 2011 +0100 @@ -59,6 +59,7 @@ public slots: void setReadyStatus(bool isReady); + void setUser(const QString & nickname); void onUpdateClick(); void setMasterMode(bool isMaster); diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/page/pageroomslist.cpp --- a/QTfrontend/ui/page/pageroomslist.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/page/pageroomslist.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -446,3 +446,8 @@ { lblCount->setText(tr("%1 players online", 0, cnt).arg(cnt)); } + +void PageRoomsList::setUser(const QString & nickname) +{ + chatWidget->setUser(nickname); +} diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/page/pageroomslist.h --- a/QTfrontend/ui/page/pageroomslist.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/page/pageroomslist.h Sat Nov 12 17:06:49 2011 +0100 @@ -49,8 +49,9 @@ QLabel * lblCount; public slots: + void setAdmin(bool); void setRoomsList(const QStringList & list); - void setAdmin(bool); + void setUser(const QString & nickname); void updateNickCounter(int cnt); signals: diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/page/pagetraining.cpp --- a/QTfrontend/ui/page/pagetraining.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/page/pagetraining.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -79,7 +79,7 @@ pageLayout->addWidget(lstMissions, 1, 0, 1, 2); // span 2 columns // let's not make the list use more space than needed - lstMissions->setFixedWidth(360); + lstMissions->setFixedWidth(400); pageLayout->setAlignment(lstMissions, Qt::AlignHCenter); return pageLayout; @@ -139,6 +139,7 @@ // preload mission info for current locale m_info = new QSettings(infoFile, QSettings::IniFormat, this); + m_info->setIniCodec("UTF-8"); QStringList missionList = dataMgr.entryList( diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/widget/bgwidget.cpp --- a/QTfrontend/ui/widget/bgwidget.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/widget/bgwidget.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -19,9 +19,10 @@ #include "bgwidget.h" -SpritePosition::SpritePosition(QWidget * parent, int sh) +SpritePosition::SpritePosition(QWidget * parent, int sw, int sh) { wParent = parent; + iSpriteWidth = sw; iSpriteHeight = sh; reset(); } @@ -36,15 +37,32 @@ fY += fYMov; iAngle += 4; if (iAngle >= 360) iAngle = 0; - if (fY > wParent->height()) reset(); + if ((fX - fXMov) > wParent->width()) reset(); + else if ((fY - fYMov) > wParent->height()) reset(); } void SpritePosition::reset() { - fY = -1 * iSpriteHeight; - fX = (qrand() % ((int)(wParent->width() * 1.5))) - wParent->width()/2; + // random movement values fYMov = ((qrand() % 400)+300) / 100.0f; - fXMov = fYMov * 0.2f+((qrand()%100)/100.0f * 0.6f); //so between 0.2 and 0.6, or 0.5 +/- 0.3 + fXMov = fYMov * 0.2f+((qrand()%100)/100.0f * 0.6f); //so between 0.2 and 0.8, or 0.5 +/- 0.3 + + // random respawn locations + int tmp = fXMov * (wParent->height() / fYMov); + fX = (qrand() % (wParent->width() + tmp)) - tmp; + + // adjust respawn location to be next to (but outside) the parent's limits + if (fX > -iSpriteWidth) + { + fY = -1 * iSpriteHeight; + } + else + { + fY = qrand() % wParent->height(); + fX = -iSpriteWidth; + } + + // random initial angle iAngle = qrand() % 360; } @@ -71,9 +89,9 @@ setAutoFillBackground(false); - for (int i = 0; i < SPRITE_MAX; i++) spritePositions[i] = new SpritePosition(this, sprite.height()); + for (int i = 0; i < SPRITE_MAX; i++) spritePositions[i] = new SpritePosition(this, sprite.width(), sprite.height()); - for (int i = 0; i < 360; i++) + for (int i = 0; i < 90; i++) { rotatedSprites[i] = new QImage(sprite.width(), sprite.height(), QImage::Format_ARGB32); rotatedSprites[i]->fill(0); @@ -85,7 +103,7 @@ // p.setRenderHint(QPainter::Antialiasing); p.setRenderHint(QPainter::SmoothPixmapTransform); p.translate(translate.x(), translate.y()); - p.rotate(i); + p.rotate(4 * i); p.translate(-1*translate.x(), -1*translate.y()); p.drawImage(0, 0, sprite); } @@ -98,7 +116,7 @@ BGWidget::~BGWidget() { for (int i = 0; i < SPRITE_MAX; i++) delete spritePositions[i]; - for (int i = 0; i < 360; i++) delete rotatedSprites[i]; + for (int i = 0; i < 90; i++) delete rotatedSprites[i]; delete timerAnimation; } @@ -107,13 +125,15 @@ Q_UNUSED(event); QPainter p; + p.begin(this); - //p.setRenderHint(QPainter::Antialiasing); + for (int i = 0; i < SPRITE_MAX; i++) { QPoint point = spritePositions[i]->pos(); - p.drawImage(point.x(), point.y(), *rotatedSprites[spritePositions[i]->getAngle()]); + p.drawImage(point.x(), point.y(), *rotatedSprites[spritePositions[i]->getAngle()/4]); } + p.end(); } @@ -121,9 +141,13 @@ { for (int i = 0; i < SPRITE_MAX; i++) { - // bottom edge of star *seems* clipped, but in fact, if I switch to just plain old repaint()/update() it is still clipped - artifact of transform? As for 5, is arbitrary number. 4 was noticeably clipping, 5 seemed same as update() - I assume extra room is due to rotation and value really should be calculated proportional to width/height - update(spritePositions[i]->pos().x(),spritePositions[i]->pos().y(), sprite.width()+5, sprite.height()+5); + QPoint oldPos = spritePositions[i]->pos(); spritePositions[i]->move(); + QPoint newPos = spritePositions[i]->pos(); + + int xdiff = newPos.x() - oldPos.x(); + int ydiff = newPos.y() - oldPos.y(); + update(oldPos.x(), oldPos.y(), xdiff+sprite.width(), ydiff+sprite.height()); } } diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/widget/bgwidget.h --- a/QTfrontend/ui/widget/bgwidget.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/widget/bgwidget.h Sat Nov 12 17:06:49 2011 +0100 @@ -28,14 +28,14 @@ #include #include -#define SPRITE_MAX 12 +#define SPRITE_MAX 10 #define ANIMATION_INTERVAL 40 class SpritePosition { public: - SpritePosition(QWidget * parent, int sh); + SpritePosition(QWidget * parent, int sw, int sh); ~SpritePosition(); private: float fX; @@ -45,6 +45,7 @@ int iAngle; QWidget * wParent; int iSpriteHeight; + int iSpriteWidth; public: void move(); void reset(); diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/widget/chatwidget.cpp --- a/QTfrontend/ui/widget/chatwidget.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/widget/chatwidget.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -34,6 +34,8 @@ #include #include +#include + #include "HWDataManager.h" #include "hwconsts.h" @@ -103,6 +105,7 @@ QString * HWChatWidget::s_styleSheet = NULL; QStringList * HWChatWidget::s_displayNone = NULL; bool HWChatWidget::s_isTimeStamped = true; +QString HWChatWidget::s_tsFormat = ":mm:ss"; const QString & HWChatWidget::styleSheet() { @@ -173,6 +176,7 @@ QStringList victims = QString(style). remove(displayed). // remove visible stuff + trimmed(). split(split). // get a list of the names filter(nohierarchy). // only direct class names replaceInStrings(QRegExp("^."),""); // crop . @@ -183,6 +187,17 @@ s_isTimeStamped = false; victims.removeAll("timestamp"); } + else + { + s_isTimeStamped = true; + s_tsFormat = + ((victims.contains("timestamp:hours"))?"":"hh:") + + QString("mm") + + ((victims.contains("timestamp:seconds"))?"":":ss"); + } + + victims.removeAll("timestamp:hours"); + victims.removeAll("timestamp:seconds"); victims.removeDuplicates(); @@ -235,8 +250,11 @@ if (notify) m_helloSound = HWDataManager::instance().findFileForRead( "Sounds/voices/Classic/Hello.ogg"); + m_hilightSound = HWDataManager::instance().findFileForRead( - "Sounds/1C.ogg"); + "Sounds/beep.ogg"); + + //m_hilightSound = m_helloSound;//"Sounds/beep.ogg"; } mainLayout.setSpacing(1); @@ -468,12 +486,17 @@ saveList(friendsList, nick.toLower() + "_friends.txt"); } + void HWChatWidget::returnPressed() { QStringList lines = chatEditLine->text().split('\n'); chatEditLine->rememberCurrentText(); foreach (const QString &line, lines) { + // skip empty/whitespace lines + if (line.trimmed().isEmpty()) + continue; + if (!parseCommand(line)) emit chatLine(line); } @@ -483,13 +506,14 @@ // "link" nick, but before that encode it in base64 to make sure it can't // intefere with html/url syntax the nick is put as querystring as putting // it as host would convert it to it's lower case variant -QString HWChatWidget::linkedNick(const QString & nickName) +QString HWChatWidget::linkedNick(const QString & nickname) { - if (nickName != m_userNick) + if (nickname != m_userNick) return QString("%2").arg( - QString(nickName.toUtf8().toBase64())).arg(nickName); - else - return QString("%1").arg(nickName); + QString(nickname.toUtf8().toBase64())).arg(Qt::escape(nickname)); + + // unlinked nick (if own one) + return QString("%1").arg(Qt::escape(nickname)); } @@ -539,7 +563,8 @@ bool isHL = false; - if ((!nick.isEmpty()) && (nick != m_userNick)) + if ((c != 3) && (!nick.isEmpty()) && + (nick != m_userNick) && (!m_userNick.isEmpty())) { QString lcStr = str.toLower(); @@ -568,7 +593,7 @@ { QString tsMarkUp = "[%1] "; QTime now = QDateTime::currentDateTime().time(); - line = tsMarkUp.arg(now.toString(":mm:ss")) + line; + line = tsMarkUp.arg(now.toString(s_tsFormat)) + line; } line = QString("%2").arg(cssClass).arg(line); @@ -637,7 +662,6 @@ chatText->clear(); chatStrings.clear(); chatNicks->clear(); - m_userNick = gameSettings->value("net/nick","").toString(); // clear and re compile regexp for highlighting m_highlights.clear(); @@ -686,7 +710,10 @@ { QListWidgetItem * curritem = chatNicks->currentItem(); if (curritem) + { + displayNotice(tr("Kicking %1 ...").arg(Qt::escape(curritem->text()))); emit kick(curritem->text()); + } } void HWChatWidget::onBan() @@ -899,7 +926,7 @@ setStyleSheet(style); chatText->document()->setDefaultStyleSheet(*s_styleSheet); displayNotice(tr("Stylesheet imported from %1").arg(path)); - displayNotice(tr("Enter %1 if you want to use the current styleSheet in future, enter %2 to reset!").arg("/saveStyleSheet").arg("/discardStyleSheet")); + displayNotice(tr("Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!").arg("/saveStyleSheet").arg("/discardStyleSheet")); if (file.isOpen()) file.close(); @@ -971,3 +998,11 @@ return false; } + + +void HWChatWidget::setUser(const QString & nickname) +{ + m_userNick = nickname; + nickRemoved(nickname); + clear(); +} diff -r 1998ff75321a -r d14adf1c7721 QTfrontend/ui/widget/chatwidget.h --- a/QTfrontend/ui/widget/chatwidget.h Sat Nov 12 15:48:55 2011 +0100 +++ b/QTfrontend/ui/widget/chatwidget.h Sat Nov 12 17:06:49 2011 +0100 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "SDLInteraction.h" @@ -78,6 +79,7 @@ void displayError(const QString & message); void displayNotice(const QString & message); void displayWarning(const QString & message); + void setUser(const QString & nickname); protected: virtual void dragEnterEvent(QDragEnterEvent * event); @@ -87,6 +89,7 @@ static QString * s_styleSheet; static QStringList * s_displayNone; static bool s_isTimeStamped; + static QString s_tsFormat; static const QRegExp URLREGEXP; static void setStyleSheet(const QString & styleSheet = ""); @@ -99,7 +102,7 @@ bool parseCommand(const QString & line); void discardStyleSheet(); void saveStyleSheet(); - QString linkedNick(const QString & nickName); + QString linkedNick(const QString & nickname); public slots: void onChatString(const QString& str); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/GSHandlers.inc Sat Nov 12 17:06:49 2011 +0100 @@ -385,7 +385,8 @@ Gear^.X := Gear^.X + Gear^.dX; Gear^.Y := Gear^.Y + Gear^.dY; - CheckGearDrowning(Gear); + if Gear^.Kind <> gtBee then + CheckGearDrowning(Gear); //if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) < _0_0002) and if ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_02.QWordValue) and (not isFalling) then @@ -841,16 +842,18 @@ var t: hwFloat; gX,gY,i: LongInt; - nuw: boolean; + uw, nuw: boolean; flower: PVisualGear; -const uw: boolean = false; begin AllInactive := false; gX := hwRound(Gear^.X); gY := hwRound(Gear^.Y); - nuw := (cWaterLine < gy + Gear^.Radius); - if nuw and not uw then + uw := (Gear^.Tag <> 0); // was bee underwater last tick? + nuw := (cWaterLine < gy + Gear^.Radius); // is bee underwater now? + + // if water entered or left + if nuw <> uw then begin AddVisualGear(gX, cWaterLine, vgtSplash); AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet); @@ -858,36 +861,43 @@ AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet); AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet); StopSound(Gear^.SoundChannel); - Gear^.SoundChannel := LoopSound(sndBeeWater); - uw := nuw - end - else if not nuw and uw then + if nuw then begin - AddVisualGear(gX, cWaterLine, vgtSplash); - StopSound(Gear^.SoundChannel); + Gear^.SoundChannel := LoopSound(sndBeeWater); + Gear^.Tag := 1; + end + else + begin Gear^.SoundChannel := LoopSound(sndBee); - uw := nuw + Gear^.Tag := 0; end; - - - if (GameTicks and $F) = 0 then + end; + + + if Gear^.Timer = 0 then + Gear^.RenderTimer:= false + else begin - if (GameTicks and $30) = 0 then - AddVisualGear(gX, gY, vgtBeeTrace); - Gear^.dX := Gear^.Elasticity * (Gear^.dX + _0_000064 * (Gear^.Target.X - gX)); - Gear^.dY := Gear^.Elasticity * (Gear^.dY + _0_000064 * (Gear^.Target.Y - gY)); - // make sure new speed isn't higher than original one (which we stored in Friction variable) - t := Gear^.Friction / Distance(Gear^.dX, Gear^.dY); - Gear^.dX := Gear^.dX * t; - Gear^.dY := Gear^.dY * t; + if (GameTicks and $F) = 0 then + begin + if (GameTicks and $30) = 0 then + AddVisualGear(gX, gY, vgtBeeTrace); + Gear^.dX := Gear^.Elasticity * (Gear^.dX + _0_000064 * (Gear^.Target.X - gX)); + Gear^.dY := Gear^.Elasticity * (Gear^.dY + _0_000064 * (Gear^.Target.Y - gY)); + // make sure new speed isn't higher than original one (which we stored in Friction variable) + t := Gear^.Friction / Distance(Gear^.dX, Gear^.dY); + Gear^.dX := Gear^.dX * t; + Gear^.dY := Gear^.dY * t; + end; + + Gear^.X := Gear^.X + Gear^.dX; + Gear^.Y := Gear^.Y + Gear^.dY; + end; - Gear^.X := Gear^.X + Gear^.dX; - Gear^.Y := Gear^.Y + Gear^.dY; CheckCollision(Gear); - dec(Gear^.Timer); - if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then + if ((Gear^.State and gstCollision) <> 0) then begin StopSound(Gear^.SoundChannel); doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); @@ -908,6 +918,19 @@ end; DeleteGear(Gear); end; + + if (Gear^.Timer > 0) then + dec(Gear^.Timer) + else + begin + if nuw then + begin + StopSound(Gear^.SoundChannel); + CheckGearDrowning(Gear); + end + else + doStepFallingGear(Gear); + end; end; procedure doStepBee(Gear: PGear); @@ -1262,8 +1285,7 @@ inc(i, 1) end; - if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9) - , lfIndestructible) then + if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), lfIndestructible) then begin Gear^.X := Gear^.X + Gear^.dX; Gear^.Y := Gear^.Y + _1_9; @@ -1278,14 +1300,20 @@ end else begin - Gear^.dY := Gear^.dY + cGravity; - Gear^.Y := Gear^.Y + Gear^.dY; + if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y + Gear^.dY + cGravity), lfIndestructible) then + begin + Gear^.dY := Gear^.dY + cGravity; + Gear^.Y := Gear^.Y + Gear^.dY + end; if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1 end; Gear^.X := Gear^.X + HHGear^.dX; - HHGear^.X := Gear^.X; - HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius); + if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)-cHHRadius, lfIndestructible) then + begin + HHGear^.X := Gear^.X; + HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius) + end; if (Gear^.Message and gmAttack) <> 0 then if (Gear^.State and gsttmpFlag) <> 0 then Gear^.Timer := 1 @@ -1401,10 +1429,13 @@ end; if b then - DrawTunnel(HHGear^.X - Gear^.dX * cHHRadius, HHGear^.Y - _4 - Gear^.dY * cHHRadius + hwAbs( - Gear^.dY) * 7, + begin + DrawTunnel(HHGear^.X + Gear^.dX * cHHRadius, + HHGear^.Y + Gear^.dY * cHHRadius - _1 - + ((hwAbs(Gear^.dX) / (hwAbs(Gear^.dX) + hwAbs(Gear^.dY))) * _0_5 * 7), Gear^.dX, Gear^.dY, - cHHRadius * 5, cHHRadius * 2 + 7); + cHHStepTicks, cHHRadius * 2 + 7); + end; if (TurnTimeLeft = 0) or (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then begin @@ -3623,7 +3654,8 @@ Gear^.X := HHGear^.X; Gear^.Y := HHGear^.Y; // For some reason I need to reapply followgear here, something else grabs it otherwise. - if not bShowAmmoMenu and not CurrentTeam^.ExtDriven then FollowGear := HHGear; + // This is probably not needed anymore + if not CurrentTeam^.ExtDriven then FollowGear := HHGear; if not isUnderWater and hasBorder and ((HHGear^.X < _0) or (hwRound(HHGear^.X) > LAND_WIDTH)) then HHGear^.dY.isNegative:= false; if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear); @@ -3754,7 +3786,8 @@ Gear^.X := HHGear^.X; Gear^.Y := HHGear^.Y - int2hwFloat(32); // For some reason I need to reapply followgear here, something else grabs it otherwise. - if not bShowAmmoMenu then FollowGear := HHGear; + // this is probably not needed anymore + if not CurrentTeam^.ExtDriven then FollowGear := HHGear; if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear); @@ -4377,9 +4410,9 @@ odY: hwFloat; begin AllInactive := false; - if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^. - Message and gmSlot) <> 0) then - begin + if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and + ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then + begin case CurrentHedgehog^.Gear^.MsgParam of 0: PlaySound(sndPiano0); 1: PlaySound(sndPiano1); @@ -4394,18 +4427,18 @@ AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote); CurrentHedgehog^.Gear^.MsgParam := 0; CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gmSlot; - end; + end; if (*((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or*) (Gear^.Pos = 5) then - // bounce up to 10 times (3 times on gameflagged solid land) before dropping past landscape - begin + begin Gear^.dY := Gear^.dY + cGravity * 2; Gear^.Y := Gear^.Y + Gear^.dY; CheckGearDrowning(Gear); if (Gear^.State and gstDrowning) <> 0 then - begin + begin + OnUsedAmmo(CurrentHedgehog^); if CurrentHedgehog^.Gear <> nil then - begin + begin // Drown the hedgehog. Could also just delete it, but hey, this gets a caption CurrentHedgehog^.Gear^.Active := true; CurrentHedgehog^.Gear^.X := Gear^.X; @@ -4413,19 +4446,20 @@ CurrentHedgehog^.Unplaced := false; if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft; TurnTimeLeft:= 0 + end; + ResumeMusic end; - ResumeMusic + exit end; - exit - end; odY:= Gear^.dY; doStepFallingGear(Gear); if (Gear^.State and gstDrowning) <> 0 then - begin + begin + OnUsedAmmo(CurrentHedgehog^); if CurrentHedgehog^.Gear <> nil then - begin + begin // Drown the hedgehog. Could also just delete it, but hey, this gets a caption CurrentHedgehog^.Gear^.Active := true; CurrentHedgehog^.Gear^.X := Gear^.X; @@ -4433,20 +4467,20 @@ CurrentHedgehog^.Unplaced := false; if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft; TurnTimeLeft:= 0 - end; + end; ResumeMusic - end + end else if (Gear^.State and gstCollision) <> 0 then begin - r0 := GetRandom(21); - r1 := GetRandom(21); - doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear^.Hedgehog, 0); - doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear^.Hedgehog, 0); - doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound); - for r0:= 0 to 4 do - AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote); - Gear^.dY := odY * -1 + cGravity * 2; - Gear^.Pos := Gear^.Pos + 1; + r0 := GetRandom(21); + r1 := GetRandom(21); + doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear^.Hedgehog, 0); + doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear^.Hedgehog, 0); + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound); + for r0:= 0 to 4 do + AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote); + Gear^.dY := odY * -1 + cGravity * 2; + Gear^.Pos := Gear^.Pos + 1; end else Gear^.dY := Gear^.dY + cGravity * 2; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/HHHandlers.inc Sat Nov 12 17:06:49 2011 +0100 @@ -181,6 +181,7 @@ if ((State and gstHHDriven) <> 0)and ((State and (gstAttacked or gstHHChooseTarget)) = 0) and (((State and gstMoving) = 0) or + (Power > 0) or (CurAmmoType = amTeleport) or // Allow attacks while moving on ammo with AltAttack ((CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)) or @@ -355,8 +356,7 @@ amBazooka, amSnowball, amBee, amSMine, amMortar, amWatermelon, - amHellishBomb, amDrill, - amPiano: FollowGear:= newGear; + amHellishBomb, amDrill: FollowGear:= newGear; amShotgun, amPickHammer, amRope, amDEagle, @@ -371,7 +371,7 @@ amJetpack, amBirdy, amFlamethrower, amLandGun, amResurrector, amStructure, - amTardis: CurAmmoGear:= newGear; + amTardis, amPiano: CurAmmoGear:= newGear; end; if (CurAmmoType = amMine) or (CurAmmoType = amSMine) and (GameFlags and gfInfAttack <> 0) then newGear^.FlightTime:= GameTicks + 1000; if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then @@ -771,6 +771,7 @@ Gear^.dY:= _0; Gear^.dX:= _0; Gear^.State:= Gear^.State and not gstMoving; + while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1; exit end; isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1); @@ -816,7 +817,10 @@ if ((Gear^.State and gstMoving) <> 0) then begin - if land and lfIce <> 0 then Gear^.dX:= Gear^.dX * (_1 - (_1 - Gear^.Friction) / _2) + if land and lfIce <> 0 then + begin + Gear^.dX:= Gear^.dX * (_1 - (_1 - Gear^.Friction) / _2) + end else Gear^.dX:= Gear^.dX * Gear^.Friction; end end; @@ -841,10 +845,12 @@ if hwAbs(Gear^.dX) > _0_02 then Gear^.dX:= -Gear^.Elasticity * Gear^.dX else begin Gear^.State:= Gear^.State and not gstMoving; + while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1; SetLittle(Gear^.dX) end else begin Gear^.State:= Gear^.State and not gstMoving; + while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1; SetLittle(Gear^.dX) end else if (hwAbs(Gear^.dX) > cLittle) @@ -857,6 +863,7 @@ begin Gear^.State:= Gear^.State and not gstWinner; Gear^.State:= Gear^.State and not gstMoving; + while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1; SetLittle(Gear^.dX); Gear^.dY:= _0 end else Gear^.State:= Gear^.State or gstMoving; @@ -876,7 +883,10 @@ Gear^.Y:= Gear^.Y + _1 end; CheckGearDrowning(Gear); - if (Gear^.State and gstDrowning) <> 0 then isCursorVisible:= false + // hide target cursor if current hog is drowning + if (Gear^.State and gstDrowning) <> 0 then + if (CurrentHedgehog^.Gear = Gear) then + isCursorVisible:= false end; if (hwAbs(Gear^.dY) > _0) and (Gear^.FlightTime > 0) and ((GameFlags and gfLowGravity) = 0) then @@ -1098,7 +1108,9 @@ procedure doStepHedgehog(Gear: PGear); (* var x,y,tx,ty: LongInt; - tdX, tdY, slope: hwFloat; *) + tdX, tdY, slope: hwFloat; + land: Word; *) +var slope: hwFloat; begin if (Gear^.Message and gmDestroy) <> 0 then begin @@ -1116,32 +1128,28 @@ else doStepHedgehogDriven(Gear) end; - -if ((GameTicks mod 50) = 0) and (Gear^.State and (gstMoving or gstHHJumping or gstHHHJump) = 0) and ((Gear^.Message and gmAllStoppable) = 0) and - (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then +if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0) and + (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0) and + not Gear^.dY.isNegative and + (GameTicks mod (100*hwRound(cMaxWindSpeed/(cGravity/2))) = 0) and + (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then begin - if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)+cHHRadius, lfIce) then - begin - Gear^.dX.QWordValue:= Gear^.dX.QWordValue + cGravity.QWordValue * 75; - Gear^.State:= Gear^.State or gstMoving; - end + slope:= CalcSlopeBelowGear(Gear); + Gear^.dX:=Gear^.dX+slope*_0_07; + if slope.QWordValue <> 0 then Gear^.State:= Gear^.State or gstMoving; (* - // check land slope, and impart a dX based on it - tdX:= Gear^.dX; - tdY:= Gear^.dY; - Gear^.dX:= _0; - Gear^.dY:= _1; - x := hwRound(Gear^.X); - y := hwRound(Gear^.Y); - tx := 0; - ty := 0; - if not CalcSlopeTangent(Gear, x, y+cHHRadius, tx, ty, 255) then - begin - slope:= _1/DistanceI(tx,ty); - AddFileLog(FloatToStr(tdX)+ ' == '+FloatToStr(slope)); - tdX:= tdX + (cGravity * slope / _10) // this will need tuning - end; - Gear^.dX:= tdX; - Gear^.dY:= tdY *) - end; + x:= hwRound(Gear^.X); + y:= hwRound(Gear^.Y); + AddVisualGear(x, y, vgtSmokeTrace); + AddVisualGear(x - hwRound(_5*slope), y + hwRound(_5*slope), vgtSmokeTrace); + AddVisualGear(x + hwRound(_5*slope), y - hwRound(_5*slope), vgtSmokeTrace); + AddVisualGear(x - hwRound(_20 * slope), y + hwRound(_20 * slope), vgtSmokeTrace); + AddVisualGear(x + hwRound(_20 * slope), y - hwRound(_20 * slope), vgtSmokeTrace); + AddVisualGear(x - hwRound(_30 * slope), y + hwRound(_30 * slope), vgtSmokeTrace); + AddVisualGear(x + hwRound(_30 * slope), y - hwRound(_30 * slope), vgtSmokeTrace); + AddVisualGear(x - hwRound(_40 * slope), y + hwRound(_40 * slope), vgtSmokeTrace); + AddVisualGear(x + hwRound(_40 * slope), y - hwRound(_40 * slope), vgtSmokeTrace); + AddVisualGear(x - hwRound(_50 * slope), y + hwRound(_50 * slope), vgtSmokeTrace); + AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *) + end end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/SDLh.pas Sat Nov 12 17:06:49 2011 +0100 @@ -83,7 +83,7 @@ SDL_ImageLibName = 'SDL_image'; SDL_NetLibName = 'SDL_net'; {$ELSE} - SDLLibName = 'SDL'; + SDLLibName = 'libSDL.so'; SDL_TTFLibName = 'libSDL_ttf.so'; SDL_MixerLibName = 'libSDL_mixer.so'; SDL_ImageLibName = 'libSDL_image.so'; @@ -109,6 +109,7 @@ SDL_INIT_NOPARACHUTE = $00100000; SDL_INIT_EVERYTHING = $0000FFFF; + SDL_ALLEVENTS = $FFFFFFFF; SDL_APPINPUTFOCUS = $02; SDL_BUTTON_WHEELUP = 4; SDL_BUTTON_WHEELDOWN = 5; @@ -141,9 +142,15 @@ SDL_FINGERDOWN = $700; SDL_FINGERUP = $701; SDL_FINGERMOTION = $702; - //TODO: implement otheer event types + SDL_TOUCHBUTTONDOWN = $703; + SDL_TOUCHBUTTONUP = $704; + SDL_DOLLARGESTURE = $800; + SDL_DOLLARRECORD = $801; + SDL_MULTIGESTURE = $802; + SDL_CLIPBOARDUPDATE = $900; SDL_USEREVENT = $8000; SDL_LASTEVENT = $FFFF; + // no compatibility events $7000 // SDL_Surface flags SDL_SWSURFACE = $00000000; //*< Not used */ @@ -233,8 +240,6 @@ SDL_HWPALETTE = $20000000; SDL_DOUBLEBUF = $40000000; SDL_FULLSCREEN = $80000000; - - SDL_ALLEVENTS = $FFFFFFFF; {$ENDIF} {$IFDEF ENDIAN_LITTLE} @@ -291,6 +296,10 @@ /////////////////////// TYPE DEFINITIONS /////////////////////// ///////////////////////////////////////////////////////////////// +// two important reference points for the wanderers of this area +// http://www.freepascal.org/docs-html/ref/refsu5.html +// http://www.freepascal.org/docs-html/prog/progsu144.html + type {$IFDEF SDL13} PSDL_Window = Pointer; @@ -316,15 +325,15 @@ PSDL_PixelFormat = ^TSDL_PixelFormat; TSDL_PixelFormat = record {$IFDEF SDL13} - format: Longword; - palette: Pointer; // actually it is a PSDL_Palette + format: LongWord; + palette: Pointer; BitsPerPixel : Byte; BytesPerPixel: Byte; padding: array[0..1] of Byte; - RMask : Longword; - GMask : Longword; - BMask : Longword; - AMask : Longword; + RMask : LongWord; + GMask : LongWord; + BMask : LongWord; + AMask : LongWord; Rloss : Byte; Gloss : Byte; Bloss : Byte; @@ -347,11 +356,11 @@ Gshift: Byte; Bshift: Byte; Ashift: Byte; - RMask : Longword; - GMask : Longword; - BMask : Longword; - AMask : Longword; - colorkey: Longword; + RMask : LongWord; + GMask : LongWord; + BMask : LongWord; + AMask : LongWord; + colorkey: LongWord; alpha: Byte; {$ENDIF} end; @@ -360,10 +369,10 @@ PSDL_Surface = ^TSDL_Surface; TSDL_Surface = record - flags : Longword; + flags : LongWord; format: PSDL_PixelFormat; w, h : LongInt; - pitch : Word; + pitch : {$IFDEF SDL13}LongInt{$ELSE}Word{$ENDIF}; pixels: Pointer; offset: LongInt; {$IFDEF SDL13} @@ -379,12 +388,12 @@ PSDL_Color = ^TSDL_Color; TSDL_Color = record - case byte of + case Byte of 0: ( r: Byte; g: Byte; b: Byte; unused: Byte; ); - 1: ( value: Longword; ); + 1: ( value: LongWord; ); end; @@ -395,8 +404,8 @@ TClose = function( context: PSDL_RWops ): LongInt; cdecl; TStdio = record - autoclose: {$IFDEF SDL13}boolean{$ELSE}LongInt{$ENDIF}; - fp: pointer; + autoclose: {$IFDEF SDL13}Boolean{$ELSE}LongInt{$ENDIF}; + fp: Pointer; end; TMem = record @@ -414,7 +423,7 @@ read: TRead; write: TWrite; close: TClose; - type_: Longword; + type_: LongWord; case Byte of 0: (stdio: TStdio); 1: (mem: TMem); @@ -428,31 +437,84 @@ TSDL_KeySym = record scancode: LongInt; sym: LongInt; - modifier: Smallint; - unicode: LongInt; + modifier: Word; + unicode: LongWord; end; TSDL_WindowEvent = record - type_: LongInt; - windowID: LongInt; - event: byte; - padding1, padding2, padding3: byte; + type_: LongWord; + windowID: LongWord; + event: Byte; + padding1, padding2, padding3: Byte; data1, data2: LongInt; end; + + // available in sdl12 but not exposed + TSDL_TextEditingEvent = record + type_: LongWord; + windowID: LongWord; + text: array[0..31] of Byte; + start, lenght: LongInt; + end; + + // available in sdl12 but not exposed + TSDL_TextInputEvent = record + type_: LongWord; + windowID: LongWord; + text: array[0..31] of Byte; + end; + + TSDL_TouchFingerEvent = record + type_: LongWord; + windowId: LongWord; + touchId: Int64; + fingerId: Int64; + state, padding1, padding2, padding3: Byte; + x, y: Word; + dx, dy: SmallInt; + pressure: Word; + end; + + TSDL_TouchButtonEvent = record + type_: LongWord; + windowId: LongWord; + touchId: Int64; + state, button, padding1, padding2: Byte; + end; + + TSDL_MultiGestureEvent = record + type_: LongWord; + windowId: LongWord; + touchId: Int64; + dTheta, dDist, x, y: Single; + numFingers, padding: Word; + end; + + TSDL_DollarGestureEvent = record + type_: LongWord; + windowId: LongWord; + touchId: Int64; + gesturedId: Int64; + numFingers: LongWord; + error: Single; + end; + + TSDL_SysWMEvent = record + type_: LongWord; + msg: Pointer; + end; {$ELSE} TSDL_KeySym = record scancode: Byte; - sym: Longword; - modifier: Longword; + sym: LongWord; + modifier: LongWord; unicode: Word; end; - // these two are present in sdl1.3 but only for backward compatibility - // and in 1.3 type_ is LongInt, not byte TSDL_ActiveEvent = record - type_: byte; - gain: byte; - state: byte; + type_: Byte; + gain: Byte; + state: Byte; end; TSDL_ResizeEvent = record @@ -463,88 +525,74 @@ TSDL_KeyboardEvent = record {$IFDEF SDL13} - type_: LongInt; - windowID: LongInt; - state, repeat_, padding2, padding3: byte; + type_: LongWord; + windowID: LongWord; + state, repeat_, padding2, padding3: Byte; {$ELSE} - type_: byte; - which: byte; - state: byte; + type_, which, state: Byte; {$ENDIF} keysym: TSDL_KeySym; end; -//TODO: implement SDL_TextEditingEvent + SDL_TextInputEvent for sdl13 - - // this structure is wrong but the correct version makes the game hang TSDL_MouseMotionEvent = record - which: byte; - state: byte; {$IFDEF SDL13} - type_: LongInt; - windowID: LongInt; - padding1, padding2: byte; + type_: LongWord; + windowID: LongWord; + state, padding1, padding2, padding3: Byte; x, y, z, xrel, yrel : LongInt; - pressure, pressure_max, pressure_min, - rotation, tilt, cursor: LongInt; {$ELSE} - type_: byte; - x, y, xrel, yrel : word; + type_, which, state: Byte; + x, y, xrel, yrel : Word; {$ENDIF} end; TSDL_MouseButtonEvent = record {$IFDEF SDL13} - type_: LongInt; - windowID: LongInt; + type_: LongWord; + windowID: LongWord; + buttonm, state, padding1, padding2: Byte; x, y: LongInt; - padding1: byte; {$ELSE} - type_, - which, - button, - state: byte; - x, y: word; + type_, which, button, state: Byte; + x, y: Word; {$ENDIF} end; + TSDL_MouseWheelEvent = record + type_: LongWord; {$IFDEF SDL13} - TSDL_MouseWheelEvent = record - type_: LongInt; - windowID: LongInt; + windowID: LongWord; +{$ELSE} which: Byte; x, y: LongInt; end; -//TODO: implement SDL_ProximityEvent -{$ENDIF} - TSDL_JoyAxisEvent = record - type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; + type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; which: Byte; axis: Byte; {$IFDEF SDL13} padding1, padding2: Byte; value: LongInt; {$ELSE} - value: Smallint; + value: SmallInt; {$ENDIF} end; TSDL_JoyBallEvent = record - type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; + type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; which: Byte; ball: Byte; {$IFDEF SDL13} padding1, padding2: Byte; xrel, yrel: LongInt; {$ELSE} - xrel, yrel: Smallint; + xrel, yrel: SmallInt; {$ENDIF} end; TSDL_JoyHatEvent = record - type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; + type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; which: Byte; hat: Byte; value: Byte; @@ -554,7 +602,7 @@ end; TSDL_JoyButtonEvent = record - type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; + type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; which: Byte; button: Byte; state: Byte; @@ -579,13 +627,13 @@ //TODO: implement SDL_TouchButtonEvent, SDL_MultiGestureEvent, SDL_DollarGestureEvent TSDL_QuitEvent = record - type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; + type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; end; TSDL_UserEvent = record {$IFDEF SDL13} - type_: LongInt; - windowID: LongInt; + type_: LongWord; + windowID: LongWord; {$ELSE} type_: Byte; {$ENDIF} @@ -601,8 +649,8 @@ SDL_WINDOWEVENT: (window: TSDL_WindowEvent); SDL_KEYDOWN, SDL_KEYUP: (key: TSDL_KeyboardEvent); - SDL_TEXTEDITING, - SDL_TEXTINPUT: (edit: byte); + SDL_TEXTEDITING: (edit: TSDL_TextEditingEvent); + SDL_TEXTINPUT: (tedit: TSDL_TextInputEvent); SDL_MOUSEMOTION: (motion: TSDL_MouseMotionEvent); SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP: (button: TSDL_MouseButtonEvent); @@ -617,10 +665,18 @@ SDL_FINGERDOWN:(tfinger: TSDL_TouchFingerEvent); SDL_QUITEV: (quit: TSDL_QuitEvent); SDL_USEREVENT: (user: TSDL_UserEvent); - //TODO: implement other events + SDL_SYSWMEVENT: (syswm: TSDL_SysWMEvent); + SDL_FINGERDOWN, + SDL_FINGERUP, + SDL_FINGERMOTION: (tfinger: TSDL_TouchFingerEvent); + SDL_TOUCHBUTTONUP, + SDL_TOUCHBUTTONDOWN: (tbutton: TSDL_TouchButtonEvent); + SDL_MULTIGESTURE: (mgesture: TSDL_MultiGestureEvent); + SDL_DOLLARGESTURE: (dgesture: TSDL_DollarGestureEvent); + SDL_ALLEVENTS: (foo: shortstring); {$ELSE} case Byte of - SDL_NOEVENT: (type_: byte); + SDL_NOEVENT: (type_: Byte); SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent); SDL_KEYDOWN, SDL_KEYUP: (key: TSDL_KeyboardEvent); @@ -635,13 +691,12 @@ SDL_QUITEV: (quit: TSDL_QuitEvent); //SDL_SYSWMEVENT,SDL_EVENT_RESERVEDA,SDL_EVENT_RESERVEDB SDL_VIDEORESIZE: (resize: TSDL_ResizeEvent); + SDL_ALLEVENTS: (foo: shortstring); {$ENDIF} end; - TSDL_EventFilter = function( event : PSDL_Event ): Integer; cdecl; - PByteArray = ^TByteArray; TByteArray = array[0..65535] of Byte; PLongWordArray = ^TLongWordArray; @@ -677,7 +732,7 @@ ); {$IFDEF SDL13} - TSDL_ArrayByteOrder = ( // array component order, low byte -> high byte + TSDL_ArrayByteOrder = ( // array component order, low Byte -> high Byte SDL_ARRAYORDER_NONE, SDL_ARRAYORDER_RGB, SDL_ARRAYORDER_RGBA, @@ -701,9 +756,9 @@ {* SDL_mixer *} PMixChunk = ^TMixChunk; TMixChunk = record - allocated: Longword; + allocated: LongWord; abuf : PByte; - alen : Longword; + alen : LongWord; volume : PByte; end; TMusic = (MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3); @@ -711,13 +766,13 @@ TMidiSong = record samples : LongInt; - events : pointer; + events : Pointer; end; TMusicUnion = record case Byte of 0: ( midi : TMidiSong ); - 1: ( ogg : pointer); + 1: ( ogg : Pointer); end; PMixMusic = ^TMixMusic; @@ -726,7 +781,7 @@ {* SDL_net *} TIPAddress = record - host: Longword; + host: LongWord; port: Word; end; @@ -752,16 +807,12 @@ {* SDL *} -function SDL_Init(flags: Longword): LongInt; cdecl; external SDLLibName; +function SDL_Init(flags: LongWord): LongInt; cdecl; external SDLLibName; function SDL_InitSubSystem(flags: LongWord): LongInt; cdecl; external SDLLibName; procedure SDL_Quit; cdecl; external SDLLibName; -function SDL_VideoDriverName(var namebuf; maxlen: LongInt): PChar; cdecl; external SDLLibName; -function SDL_EnableUNICODE(enable: LongInt): LongInt; cdecl; external SDLLibName; -function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; cdecl; external SDLLibName; - -procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; -function SDL_GetTicks: Longword; cdecl; external SDLLibName; +procedure SDL_Delay(msec: LongWord); cdecl; external SDLLibName; +function SDL_GetTicks: LongWord; cdecl; external SDLLibName; function SDL_MustLock(Surface: PSDL_Surface): Boolean; function SDL_LockSurface(Surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; @@ -769,23 +820,23 @@ function SDL_GetError: PChar; cdecl; external SDLLibName; -function SDL_SetVideoMode(width, height, bpp: LongInt; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; -function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; -function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; +function SDL_SetVideoMode(width, height, bpp: LongInt; flags: LongWord): PSDL_Surface; cdecl; external SDLLibName; +function SDL_CreateRGBSurface(flags: LongWord; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName; +function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName; procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; -function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; -function SDL_SetAlpha(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; +function SDL_SetColorKey(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName; +function SDL_SetAlpha(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName; function SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: LongInt): PSDL_Surface; cdecl; external SDLLibName; function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; -function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): LongInt; cdecl; external SDLLibName; -procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: Longword); cdecl; external SDLLibName; +function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: LongWord): LongInt; cdecl; external SDLLibName; +procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: LongWord); cdecl; external SDLLibName; function SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName; -procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; -procedure SDL_GetRGBA(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b, a: PByte); cdecl; external SDLLibName; -function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): Longword; cdecl; external SDLLibName; -function SDL_MapRGBA(format: PSDL_PixelFormat; r, g, b, a: Byte): Longword; cdecl; external SDLLibName; +procedure SDL_GetRGB(pixel: LongWord; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; +procedure SDL_GetRGBA(pixel: LongWord; fmt: PSDL_PixelFormat; r, g, b, a: PByte); cdecl; external SDLLibName; +function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): LongWord; cdecl; external SDLLibName; +function SDL_MapRGBA(format: PSDL_PixelFormat; r, g, b, a: Byte): LongWord; cdecl; external SDLLibName; function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; @@ -794,11 +845,12 @@ function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; {$IFDEF SDL13} -function SDL_CreateWindow(title: PChar; x,y,w,h, flags: LongInt): PSDL_Window; cdecl; external SDLLibName; -function SDL_CreateRenderer(window: PSDL_Window; index, flags: LongInt): PSDL_Renderer; cdecl; external SDLLibName; +function SDL_CreateWindow(title: PChar; x,y,w,h: LongInt; flags: LongWord): PSDL_Window; cdecl; external SDLLibName; +function SDL_CreateRenderer(window: PSDL_Window; index: LongInt; flags: LongWord): PSDL_Renderer; cdecl; external SDLLibName; function SDL_DestroyWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName; function SDL_DestroyRenderer(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; procedure SDL_SetWindowSize(window: PSDL_Window; w, h: LongInt); cdecl; external SDLLibName; +function SDL_GetCurrentVideoDriver:Pchar; cdecl; external SDLLibName; function SDL_GL_CreateContext(window: PSDL_Window): PSDL_GLContext; cdecl; external SDLLibName; procedure SDL_GL_DeleteContext(context: PSDL_GLContext); cdecl; external SDLLibName; @@ -809,44 +861,40 @@ function SDL_GetNumVideoDisplays: LongInt; cdecl; external SDLLibName; procedure SDL_ShowWindow(window: PSDL_Window); cdecl; external SDLLibName; -function SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r,g,b,a: byte): LongInt; cdecl; external SDLLibName; +function SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r,g,b,a: Byte): LongInt; cdecl; external SDLLibName; function SDL_GetRenderer(window: PSDL_Window): PSDL_Renderer; cdecl; external SDLLibName; function SDL_RenderFillRect(renderer: PSDL_Renderer; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; function SDL_RenderClear(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; procedure SDL_RenderPresent(renderer: PSDL_Renderer); cdecl; external SDLLibName; -function SDL_RenderReadPixels(renderer: PSDL_Renderer; rect: PSDL_Rect; format: LongInt; pixels: pointer; pitch: LongInt): LongInt; cdecl; external SDLLibName; +function SDL_RenderReadPixels(renderer: PSDL_Renderer; rect: PSDL_Rect; format: LongInt; pixels: Pointer; pitch: LongInt): LongInt; cdecl; external SDLLibName; function SDL_RenderSetViewport(window: PSDL_Window; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; -function SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName; function SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; -function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; -function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; - +function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): Boolean; cdecl; external SDLLibName; procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName; -function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName; +function SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName; +procedure SDL_StartTextInput; cdecl; external SDLLibName; -function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongInt): LongInt; cdecl; external SDLLibName; +function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName; {$ELSE} -function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: Longword): LongInt; cdecl; external SDLLibName; +function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName; {$ENDIF} function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; -function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; +function SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName; procedure SDL_PumpEvents; cdecl; external SDLLibName; function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; function SDL_WaitEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; -procedure SDL_SetEventFilter( filter : TSDL_EventFilter ); cdecl; external SDLLibName; +procedure SDL_SetEventFilter(filter: TSDL_EventFilter); cdecl; external SDLLibName; function SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName; -procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : byte); cdecl; external SDLLibName; +procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : Byte); cdecl; external SDLLibName; procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; function SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; -function SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName; -procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName; function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; @@ -880,14 +928,17 @@ {* Compatibility between SDL-1.2 and SDL-1.3 *} procedure SDL_WarpMouse(x, y: Word); {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF} function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF}; -function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF} +function SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF} procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF} +function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF} +function SDL_EnableUNICODE(enable: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF} +function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF} (* SDL_ttf *) function TTF_Init: LongInt; cdecl; external SDL_TTFLibName; procedure TTF_Quit; cdecl; external SDL_TTFLibName; -function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; out w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName; +function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; w, h: PLongInt): LongInt; cdecl; external SDL_TTFLibName; function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName; function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName; @@ -953,13 +1004,13 @@ function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName; -procedure SDLNet_Write16(value: Word; buf: pointer); -procedure SDLNet_Write32(value: LongWord; buf: pointer); -function SDLNet_Read16(buf: pointer): Word; -function SDLNet_Read32(buf: pointer): LongWord; +procedure SDLNet_Write16(value: Word; buf: Pointer); +procedure SDLNet_Write32(value: LongWord; buf: Pointer); +function SDLNet_Read16(buf: Pointer): Word; +function SDLNet_Read32(buf: Pointer): LongWord; implementation -uses uVariables; +uses strings, uVariables; {$IFDEF SDL13} // this needs to be reimplemented because in SDL_compat.c the window is the one created in the SDL_SetVideoMode @@ -968,8 +1019,31 @@ begin SDL_WarpMouseInWindow(SDLwindow, x, y); end; + +function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; +var name : PChar = nil; +begin + name:= SDL_GetCurrentVideoDriver(); + if (name <> nil) and (namebuf <> nil) then + begin + strlcopy(namebuf, name, maxlen); + exit(namebuf) + end; + exit(name); +end; + +function SDL_EnableUNICODE(enable: LongInt): LongInt; +begin + SDL_StartTextInput(); + exit(0); +end; + +function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; +begin + exit(0); +end; {$ELSE} -function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; +function SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; const conversionFormat: TSDL_PixelFormat = ( palette: nil; BitsPerPixel: 32; BytesPerPixel: 4; Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0; @@ -1019,13 +1093,13 @@ end; {$ENDIF} -procedure SDLNet_Write16(value: Word; buf: pointer); +procedure SDLNet_Write16(value: Word; buf: Pointer); begin PByteArray(buf)^[1]:= value; PByteArray(buf)^[0]:= value shr 8 end; -procedure SDLNet_Write32(value: LongWord; buf: pointer); +procedure SDLNet_Write32(value: LongWord; buf: Pointer); begin PByteArray(buf)^[3]:= value; PByteArray(buf)^[2]:= value shr 8; @@ -1033,13 +1107,13 @@ PByteArray(buf)^[0]:= value shr 24 end; -function SDLNet_Read16(buf: pointer): Word; +function SDLNet_Read16(buf: Pointer): Word; begin SDLNet_Read16:= PByteArray(buf)^[1] or (PByteArray(buf)^[0] shl 8) end; -function SDLNet_Read32(buf: pointer): LongWord; +function SDLNet_Read32(buf: Pointer): LongWord; begin SDLNet_Read32:= PByteArray(buf)^[3] or (PByteArray(buf)^[2] shl 8) or diff -r 1998ff75321a -r d14adf1c7721 hedgewars/VGSHandlers.inc --- a/hedgewars/VGSHandlers.inc Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/VGSHandlers.inc Sat Nov 12 17:06:49 2011 +0100 @@ -79,7 +79,8 @@ if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else if round(X) > cRightScreenBorder then X:= X - cScreenSpace; // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards? - if round(Y) - 225 > LAND_HEIGHT then Y:= Y - (1024 + 300); // TODO - configure in theme (jellies for example could use limited range) + if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then Y:= Y - (1024 + 300) // TODO - configure in theme (jellies for example could use limited range) + else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then Y:= Y - (1024 + 25); Timer:= 0; tdX:= 0; tdY:= 0 diff -r 1998ff75321a -r d14adf1c7721 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/hwengine.pas Sat Nov 12 17:06:49 2011 +0100 @@ -116,15 +116,11 @@ s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks); playSound(sndShutter); -{$IFNDEF IPHONEOS} - if not MakeScreenshot(s) then - begin + if MakeScreenshot(s) then WriteLnToConsole('Screenshot saved: ' + s) + else begin WriteLnToConsole('Screenshot failed.'); AddChatString(#5 + 'screen capture failed (lack of memory or write permissions)'); - end - else -{$ENDIF} - WriteLnToConsole('Screenshot saved: ' + s); + end end; end; @@ -149,11 +145,8 @@ /////////////////// procedure MainLoop; -{$WARNINGS OFF} -// disable "Some fields weren't initialized" warning -const event: TSDL_Event = (); -{$WARNINGS ON} -var PrevTime, CurrTime: Longword; +var event: TSDL_Event; + PrevTime, CurrTime: Longword; {$IFDEF SDL13} previousGameState: TGameState; {$ELSE} @@ -263,8 +256,10 @@ begin {$IFDEF HWLIBRARY} cBits:= 32; + cFullScreen:= false; cTimerInterval:= 8; - cFullScreen:= {$IFDEF MOBILE}true{$ELSE}false{$ENDIF}; + PathPrefix:= 'Data'; + UserPathPrefix:= '../Documents'; cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF}; val(gameArgs[0], ipcPort); val(gameArgs[1], cScreenWidth); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uAI.pas Sat Nov 12 17:06:49 2011 +0100 @@ -267,8 +267,7 @@ WalkMe:= BackMe; Walk(@WalkMe); - if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(1000); - + if (StartTicks > GameTicks - 1500) and (not StopThinking) then SDL_Delay(1000); if BestActions.Score < -1023 then begin BestActions.Count:= 0; @@ -286,9 +285,7 @@ end; PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking; Think:= 0; - -InterlockedDecrement(hasThread); - +InterlockedDecrement(hasThread) end; procedure StartThink(Me: PGear); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uChat.pas --- a/hedgewars/uChat.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uChat.pas Sat Nov 12 17:06:49 2011 +0100 @@ -84,7 +84,7 @@ font:= CheckCJKFont(str, fnt16); w:= 0; h:= 0; // avoid compiler hints -TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), w, h); +TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), @w, @h); resSurface:= SDL_CreateRGBSurface(0, toPowerOf2(w), toPowerOf2(h), 32, RMask, GMask, BMask, AMask); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uCollisions.pas Sat Nov 12 17:06:49 2011 +0100 @@ -52,7 +52,8 @@ function TestRectancleForObstacle(x1, y1, x2, y2: LongInt; landOnly: boolean): boolean; -function CalcSlopeTangentBelowGear(Gear: PGear; var outDeltaX, outDeltaY: LongInt): boolean; +// returns: negative sign if going downhill to left, value is steepness (noslope/error = _0, 45° = _0_5) +function CalcSlopeBelowGear(Gear: PGear): hwFloat; function CalcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): Boolean; implementation @@ -403,7 +404,7 @@ if (dx.QWordValue > _0_995.QWordValue ) or (dy.QWordValue > _0_995.QWordValue ) then begin // scale - s := _1 / Distance(dx,dy); + s := _0_995 / Distance(dx,dy); dx := s * dx; dy := s * dy; end; @@ -519,17 +520,12 @@ exit(true); end; -function CalcSlopeTangentBelowGear(Gear: PGear; var outDeltaX, outDeltaY: LongInt): boolean; +function CalcSlopeBelowGear(Gear: PGear): hwFloat; var dx, dy: hwFloat; - collX, i, y, x, gx: LongInt; + collX, i, y, x, gx, sdx, sdy: LongInt; isColl, succ: Boolean; begin -// save original dx/dy -dx:= Gear^.dX; -dy:= Gear^.dY; -Gear^.dX.QWordValue:= 0; -Gear^.dY:= _1; y:= hwRound(Gear^.Y) + Gear^.Radius; gx:= hwRound(Gear^.X); @@ -553,15 +549,32 @@ end; if isColl then - succ := CalcSlopeTangent(Gear, collX, y, outDeltaX, outDeltaY, 255) -else - succ := false; + begin + // save original dx/dy + dx := Gear^.dX; + dy := Gear^.dY; + + Gear^.dX.QWordValue:= 0; + Gear^.dX.isNegative:= (collX >= gx); + Gear^.dY:= _1; + + sdx:= 0; + sdy:= 0; + succ := CalcSlopeTangent(Gear, collX, y, sdx, sdy, 255); -// restore original dx/dy -Gear^.dX:= dx; -Gear^.dY:= dy; + // restore original dx/dy + Gear^.dX := dx; + Gear^.dY := dy; -CalcSlopeTangentBelowGear := succ; + if succ and (sdx <> 0) and (sdy <> 0) then + begin + dx := int2hwFloat(sdy) / (abs(sdx) + abs(sdy)); + dx.isNegative := (sdx * sdy) < 0; + exit (dx); + end; + end; + +CalcSlopeBelowGear := _0; end; procedure initModule; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uCommandHandlers.pas Sat Nov 12 17:06:49 2011 +0100 @@ -130,6 +130,7 @@ begin if s[1]='"' then Delete(s, 1, 1); if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); +cScriptName:= s; ScriptLoad(s) end; @@ -457,7 +458,7 @@ InitStepsFlags:= InitStepsFlags or cifMap end; -ScriptLoad(s) +ScriptLoad('Maps/' + s + '/map.lua') end; procedure chSetTheme(var s: shortstring); @@ -526,7 +527,7 @@ else begin AddCaption('Auto Camera On', $CCCCCC, capgrpVolume); bShowFinger:= true; - FollowGear:= CurrentHedgehog^.Gear; + if not CurrentHedgehog^.Unplaced then FollowGear:= CurrentHedgehog^.Gear; autoCameraOn:= true end end; @@ -614,7 +615,7 @@ RegisterVariable('seed' , vtCommand, @chSetSeed , false); RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); - RegisterVariable('maze_size',vtLongInt, @cMazeSize , false); + RegisterVariable('maze_size',vtLongInt, @cTemplateFilter, false); RegisterVariable('delay' , vtLongInt, @cInactDelay , false); RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uFloat.pas Sat Nov 12 17:06:49 2011 +0100 @@ -116,6 +116,7 @@ _0_01: hwFloat = (isNegative: false; QWordValue: 42949673); _0_02: hwFloat = (isNegative: false; QWordValue: 85899345); _0_03: hwFloat = (isNegative: false; QWordValue: 128849018); + _0_07: hwFloat = (isNegative: false; QWordValue: 300647710); _0_08: hwFloat = (isNegative: false; QWordValue: 343597383); _0_1: hwFloat = (isNegative: false; QWordValue: 429496730); _0_15: hwFloat = (isNegative: false; QWordValue: 644245094); @@ -321,7 +322,7 @@ str(z.Round, cstr); if z.Frac <> 0 then begin - str(z.Frac / $100000000:1:15, tmpstr); + str(z.Frac / $100000000:1:10, tmpstr); delete(tmpstr, 1, 2); cstr:= cstr + '.' + tmpstr end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uGame.pas --- a/hedgewars/uGame.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uGame.pas Sat Nov 12 17:06:49 2011 +0100 @@ -78,7 +78,7 @@ AddVisualGear(0, 0, vgtTeamHealthSorter); AddVisualGear(0, 0, vgtSmoothWindBar); {$IFDEF IPHONEOS}InitIPC;{$ENDIF} - uMobile.SaveFinished(); + uMobile.SaveLoadingEnded(); end; end else ProcessGears diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uGears.pas Sat Nov 12 17:06:49 2011 +0100 @@ -320,7 +320,7 @@ gear^.Timer:= 500; gear^.RenderTimer:= true; gear^.Elasticity:= _0_9; - gear^.Tag:= getRandom(32); + gear^.Tag:= 0; end; gtSeduction: begin gear^.Radius:= 250; @@ -1290,7 +1290,7 @@ gtMelonPiece, gtGrenade, gtClusterBomb, - gtCluster, + // gtCluster, too game breaking I think gtSMine, gtCase, gtTarget, @@ -1314,8 +1314,17 @@ if ((Mask and EXPLDoNotTouchAny) = 0) and (((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog)) then begin DeleteCI(Gear); - Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX); - Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY); + if Gear^.Kind <> gtHedgehog then + begin + Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX)/Gear^.Density; + Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY)/Gear^.Density; + end + else + begin + Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX); + Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY); + end; + Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser); if not Gear^.Invulnerable then Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uGearsRender.pas Sat Nov 12 17:06:49 2011 +0100 @@ -897,15 +897,15 @@ Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); if Gear^.Tag = -1 then begin - DrawRotatedTextureF(SpritesData[sprPlane].Texture, 1, 0, 0, x, y, 0, -1, SpritesData[sprPlane].Width, SpritesData[sprPlane].Height, DxDy2Angle(Gear^.dX, Gear^.dY) + 90); + DrawRotatedF(sprPlane, x, y, 0, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90); Tint($FF, $FF, $FF, $FF); - DrawRotatedTextureF(SpritesData[sprPlane].Texture, 1, 0, 0, x, y, 1, -1, SpritesData[sprPlane].Width, SpritesData[sprPlane].Height, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) + DrawRotatedF(sprPlane, x, y, 1, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) end else begin - DrawRotatedTextureF(SpritesData[sprPlane].Texture, 1, 0, 0, x, y, 0, 0, SpritesData[sprPlane].Width, SpritesData[sprPlane].Height, DxDy2Angle(Gear^.dY, Gear^.dX)); + DrawRotatedF(sprPlane, x, y, 0, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); Tint($FF, $FF, $FF, $FF); - DrawRotatedTextureF(SpritesData[sprPlane].Texture, 1, 0, 0, x, y, 1, 0, SpritesData[sprPlane].Width, SpritesData[sprPlane].Height, DxDy2Angle(Gear^.dY, Gear^.dX)) + DrawRotatedF(sprPlane, x, y, 1, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) end end; gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); @@ -983,13 +983,19 @@ gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); - gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); + gtFlame: if Gear^.Tag and 1 = 0 then + DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) + else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); gtParachute: begin DrawSprite(sprParachute, x - 24, y - 48, 0); DrawAltWeapon(Gear, x + 1, y - 3) end; - gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 0) - else DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 1); + gtAirAttack: begin + Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); + DrawRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); + Tint($FF, $FF, $FF, $FF); + DrawRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); + end; gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtTeleport: begin HHGear:= Gear^.Hedgehog^.Gear; @@ -1051,10 +1057,10 @@ begin Tint($FF, $FF, $FF, $10); for i:= 8 downto 1 do - DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0); + DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128); Tint($FF, $FF, $FF, $FF) end; - DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y, 0, 1, 128, 128, 0); + DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128); end; gtPoisonCloud: begin if Gear^.Timer < 1020 then diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uIO.pas Sat Nov 12 17:06:49 2011 +0100 @@ -40,7 +40,7 @@ procedure doPut(putX, putY: LongInt; fromAI: boolean); implementation -uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug, uMobile; +uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug; type PCmd = ^TCmd; TCmd = packed record @@ -175,8 +175,6 @@ s: shortstring absolute buf; begin -uMobile.SaveBegan(); - // set RDNLY on file open filemode:= 0; {$I-} diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uLand.pas Sat Nov 12 17:06:49 2011 +0100 @@ -36,7 +36,7 @@ implementation uses uConsole, uStore, uRandom, uLandObjects, uIO, uLandTexture, sysutils, - uVariables, uUtils, uCommands, Adler32, uDebug, uLandPainted; + uVariables, uUtils, uCommands, Adler32, uDebug, uLandPainted, uTextures; operator=(const a, b: direction) c: Boolean; begin @@ -302,6 +302,7 @@ // freed in freeModule() below LandBackSurface:= LoadImage(UserPathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent); if LandBackSurface = nil then LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent); + if (LandBackSurface <> nil) and cGrayScale then Surface2GrayScale(LandBackSurface); tmpsurf:= LoadImage(UserPathz[ptCurrTheme] + '/Border', ifIgnoreCaps or ifTransparent); if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Border', ifCritical or ifIgnoreCaps or ifTransparent); @@ -855,7 +856,7 @@ end; begin -case cMazeSize of +case cTemplateFilter of 0: begin cellsize := small_cell_size; maze_inverted := false; @@ -1180,7 +1181,8 @@ begin // freed in freeModule() below LandBackSurface:= LoadImage(UserPathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent); - if LandBackSurface = nil then LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent) + if LandBackSurface = nil then LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent); + if (LandBackSurface <> nil) and cGrayScale then Surface2GrayScale(LandBackSurface) end; end; if (tmpsurf <> nil) then @@ -1439,7 +1441,7 @@ adler:= 1; for i:= 0 to LAND_HEIGHT-1 do Adler32Update(adler, @Land[i,0], LAND_WIDTH); - s:= 'M' + IntToStr(adler); + s:= 'M' + IntToStr(adler) + cScriptName; chLandCheck(s); SendIPCRaw(@s[0], Length(s) + 1) diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uLandObjects.pas Sat Nov 12 17:06:49 2011 +0100 @@ -392,6 +392,26 @@ begin AddProgress; +// Set default water greyscale values +if cGrayScale then + begin + for i:= 0 to 3 do + begin + t:= round(SDWaterColorArray[i].r * RGB_LUMINANCE_RED + SDWaterColorArray[i].g * RGB_LUMINANCE_GREEN + SDWaterColorArray[i].b * RGB_LUMINANCE_BLUE); + if t > 255 then t:= 255; + SDWaterColorArray[i].r:= t; + SDWaterColorArray[i].g:= t; + SDWaterColorArray[i].b:= t + end; + for i:= 0 to 1 do + begin + t:= round(WaterColorArray[i].r * RGB_LUMINANCE_RED + WaterColorArray[i].g * RGB_LUMINANCE_GREEN + WaterColorArray[i].b * RGB_LUMINANCE_BLUE); + if t > 255 then t:= 255; + WaterColorArray[i].r:= t; + WaterColorArray[i].g:= t; + WaterColorArray[i].b:= t + end + end; s:= UserPathz[ptCurrTheme] + '/' + cThemeCFGFilename; if not FileExists(s) then s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename; @@ -445,6 +465,14 @@ c2.g:= StrToInt(Trim(Copy(s, 1, Pred(i)))); Delete(s, 1, i); c2.b:= StrToInt(Trim(s)); + if cGrayScale then + begin + t:= round(SkyColor.r * RGB_LUMINANCE_RED + SkyColor.g * RGB_LUMINANCE_GREEN + SkyColor.b * RGB_LUMINANCE_BLUE); + if t > 255 then t:= 255; + c2.r:= t; + c2.g:= t; + c2.b:= t + end; cExplosionBorderColor:= c2.value or AMask; end else if key = 'water-top' then @@ -588,6 +616,8 @@ vobFallSpeed:= StrToInt(Trim(s)); end; end + else if key = 'flatten-flakes' then cFlattenFlakes:= true + else if key = 'flatten-clouds' then cFlattenClouds:= true else if key = 'sd-water-top' then begin i:= Pos(',', s); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uMisc.pas Sat Nov 12 17:06:49 2011 +0100 @@ -53,21 +53,21 @@ f: file; // Windows Bitmap Header head: array[0..53] of Byte = ( - $42, $4D, // identifier ("BM") - 0, 0, 0, 0, // file size - 0, 0, 0, 0, // reserved - 54, 0, 0, 0, // starting offset - 40, 0, 0, 0, // header size - 0, 0, 0, 0, // width - 0, 0, 0, 0, // height - 1, 0, // color planes - 24, 0, // bit depth - 0, 0, 0, 0, // compression method (uncompressed) - 0, 0, 0, 0, // image size - 96, 0, 0, 0, // horizontal resolution - 96, 0, 0, 0, // vertical resolution - 0, 0, 0, 0, // number of colors (all) - 0, 0, 0, 0 // number of important colors + $42, $4D, // identifier ("BM") + 0, 0, 0, 0, // file size + 0, 0, 0, 0, // reserved + 54, 0, 0, 0, // starting offset + 40, 0, 0, 0, // header size + 0, 0, 0, 0, // width + 0, 0, 0, 0, // height + 1, 0, // color planes + 32, 0, // bit depth + 0, 0, 0, 0, // compression method (uncompressed) + 0, 0, 0, 0, // image size + 96, 0, 0, 0, // horizontal resolution + 96, 0, 0, 0, // vertical resolution + 0, 0, 0, 0, // number of colors (all) + 0, 0, 0, 0 // number of important colors ); begin // flash @@ -75,7 +75,7 @@ ScreenFadeValue:= sfMax; ScreenFadeSpeed:= 5; -size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 3; +size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 4; p:= GetMem(size); // memory could not be allocated @@ -86,7 +86,6 @@ end; // update header information and file name - filename:= UserPathPrefix + '/Screenshots/' + filename + '.bmp'; head[$02]:= (size + 54) and $ff; @@ -106,9 +105,8 @@ head[$24]:= (size shr 16) and $ff; head[$25]:= (size shr 24) and $ff; -//remember that opengles operates on a single surface, so GL_FRONT *should* be implied -//glReadBuffer(GL_FRONT); -glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGR, GL_UNSIGNED_BYTE, p); +// read pixel from the front buffer +glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGRA, GL_UNSIGNED_BYTE, p); {$IOCHECKS OFF} Assign(f, filename); @@ -128,7 +126,6 @@ {$IOCHECKS ON} FreeMem(p, size); - MakeScreenshot:= success; end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uMobile.pas --- a/hedgewars/uMobile.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uMobile.pas Sat Nov 12 17:06:49 2011 +0100 @@ -24,11 +24,9 @@ {$IFDEF IPHONEOS} (* iOS calls written in ObjcExports.m *) procedure clearView; cdecl; external; -procedure startSpinningProgress; cdecl; external; -procedure stopSpinningProgress; cdecl; external; -procedure saveBeganSynching; cdecl; external; +procedure startLoadingIndicator; cdecl; external; +procedure stopLoadingIndicator; cdecl; external; procedure saveFinishedSynching; cdecl; external; -procedure setGameRunning(arg: boolean); cdecl; external; procedure updateVisualsNewTurn; cdecl; external; function isApplePhone: Boolean; cdecl; external; procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external; @@ -40,8 +38,7 @@ procedure GameLoaded; inline; procedure AmmoUpdate; // do not inline procedure NewTurnBeginning; inline; -procedure SaveBegan; inline; -procedure SaveFinished; inline; +procedure SaveLoadingEnded; inline; implementation uses uVariables; @@ -71,14 +68,14 @@ procedure GameLoading; inline; begin {$IFDEF IPHONEOS} - startSpinningProgress(); + startLoadingIndicator(); {$ENDIF} end; procedure GameLoaded; inline; begin {$IFDEF IPHONEOS} - stopSpinningProgress(); + stopLoadingIndicator(); {$ENDIF} end; @@ -101,14 +98,7 @@ AmmoUpdate(); end; -procedure SaveBegan; inline; -begin -{$IFDEF IPHONEOS} - saveBeganSynching(); -{$ENDIF} -end; - -procedure SaveFinished; inline; +procedure SaveLoadingEnded; inline; begin {$IFDEF IPHONEOS} saveFinishedSynching(); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uRender.pas Sat Nov 12 17:06:49 2011 +0100 @@ -147,11 +147,9 @@ glPushMatrix; glTranslatef(X, Y, 0); +if Dir = 0 then Dir:= 1; -if Dir < 0 then - glRotatef(Angle, 0, 0, -1) -else - glRotatef(Angle, 0, 0, 1); +glRotatef(Angle, 0, 0, Dir); glTranslatef(Dir*OffsetX, OffsetY, 0); glScalef(Scale, Scale, 1); @@ -159,10 +157,7 @@ // Any reason for this call? And why only in t direction, not s? //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -if Dir < 0 then - hw:= w div -2 -else - hw:= w div 2; +hw:= w div (2 div Dir); nx:= round(Texture^.w / w); // number of horizontal frames ny:= round(Texture^.h / h); // number of vertical frames diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uRenderUtils.pas --- a/hedgewars/uRenderUtils.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uRenderUtils.pas Sat Nov 12 17:06:49 2011 +0100 @@ -68,7 +68,7 @@ clr: TSDL_Color; finalRect: TSDL_Rect; begin - TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h); + TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h); finalRect.x:= X; finalRect.y:= Y; finalRect.w:= w + FontBorder * 2 + 4; @@ -173,7 +173,7 @@ if length(s) = 0 then s:= ' '; font:= CheckCJKFont(s, font); w:= 0; h:= 0; // avoid compiler hints - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h); + TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h); finalSurface:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2, 32, RMask, GMask, BMask, AMask); @@ -229,7 +229,7 @@ if length(s) = 0 then s:= '...'; font:= CheckCJKFont(s, font); w:= 0; h:= 0; // avoid compiler hints - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h); + TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h); if w<8 then w:= 8; j:= 0; if (length(s) > 20) then @@ -248,7 +248,7 @@ while s[prevpos+1] = ' ' do inc(prevpos); substr:= copy(s, prevpos+1, pos-prevpos-1); i:= 0; j:= 0; - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), i, j); + TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), @i, @j); if i > w then w:= i; prevpos:= pos; end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uScript.pas Sat Nov 12 17:06:49 2011 +0100 @@ -1627,23 +1627,24 @@ // pop game variables ParseCommand('seed ' + ScriptGetString('Seed'), true); -ParseCommand('template_filter ' + IntToStr(ScriptGetInteger('TemplateFilter')), true); -ParseCommand('mapgen ' + IntToStr(ScriptGetInteger('MapGen')), true); -ParseCommand('$gmflags ' + ScriptGetString('GameFlags'), true); -ParseCommand('$turntime ' + ScriptGetString('TurnTime'), true); -ParseCommand('$casefreq ' + ScriptGetString('CaseFreq'), true); -ParseCommand('$healthprob ' + ScriptGetString('HealthCaseProb'), true); -ParseCommand('$hcaseamount ' + ScriptGetString('HealthCaseAmount'), true); -ParseCommand('$damagepct ' + ScriptGetString('DamagePercent'), true); -ParseCommand('$minesnum ' + ScriptGetString('MinesNum'), true); -ParseCommand('$minestime ' + ScriptGetString('MinesTime'), true); -ParseCommand('$minedudpct ' + ScriptGetString('MineDudPercent'), true); -ParseCommand('$explosives ' + ScriptGetString('Explosives'), true); -ParseCommand('$delay ' + ScriptGetString('Delay'), true); -ParseCommand('$ready ' + ScriptGetString('Ready'), true); -ParseCommand('$sd_turns ' + ScriptGetString('SuddenDeathTurns'), true); -ParseCommand('$waterrise ' + ScriptGetString('WaterRise'), true); -ParseCommand('$healthdec ' + ScriptGetString('HealthDecrease'), true); +cTemplateFilter := ScriptGetInteger('TemplateFilter'); +cMapGen := ScriptGetInteger('MapGen'); +GameFlags := ScriptGetInteger('GameFlags'); +cHedgehogTurnTime:= ScriptGetInteger('TurnTime'); +cCaseFactor := ScriptGetInteger('CaseFreq'); +cHealthCaseProb := ScriptGetInteger('HealthCaseProb'); +cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount'); +cDamagePercent := ScriptGetInteger('DamagePercent'); +cLandMines := ScriptGetInteger('MinesNum'); +cMinesTime := ScriptGetInteger('MinesTime'); +cMineDudPercent := ScriptGetInteger('MineDudPercent'); +cExplosives := ScriptGetInteger('Explosives'); +cInactDelay := ScriptGetInteger('Delay'); +cReadyDelay := ScriptGetInteger('Ready'); +cSuddenDTurns := ScriptGetInteger('SuddenDeathTurns'); +cWaterRise := ScriptGetInteger('WaterRise'); +cHealthDecrease := ScriptGetInteger('HealthDecrease'); + if ScriptGetString('Map') <> '' then ParseCommand('map ' + ScriptGetString('Map'), true); if ScriptGetString('Theme') <> '' then diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uStats.pas --- a/hedgewars/uStats.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uStats.pas Sat Nov 12 17:06:49 2011 +0100 @@ -129,7 +129,7 @@ else if AmmoDamagingUsed then AddVoice(sndMissed, PreviousTeam^.voicepack) - else if (AmmoUsedCount > 0) and not isTurnSkipped then + else if (AmmoUsedCount > 0) and (not isTurnSkipped) then // nothing ? else if isTurnSkipped then begin diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uStore.pas Sat Nov 12 17:06:49 2011 +0100 @@ -56,7 +56,7 @@ finalRect: TSDL_Rect; begin w:= 0; h:= 0; // avoid compiler hints -TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h); +TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h); finalRect.x:= X + FontBorder + 2; finalRect.y:= Y + FontBorder; finalRect.w:= w + FontBorder * 2 + 4; @@ -796,13 +796,13 @@ // TODO: Recheck height/position calculation // get caption's dimensions -TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(caption), i, j); +TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(caption), @i, @j); // width adds 36 px (image + space) w:= i + 36 + wa; h:= j + ha; // get sub caption's dimensions -TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(subcaption), i, j); +TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(subcaption), @i, @j); // width adds 36 px (image + space) if w < (i + 36 + wa) then w:= i + 36 + wa; inc(h, j + ha); @@ -815,7 +815,7 @@ SplitByChar(tmpline, tmpdesc, '|'); if tmpline <> '' then begin - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), i, j); + TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), @i, @j); if w < (i + wa) then w:= i + wa; inc(h, j + ha) end @@ -824,7 +824,7 @@ if extra <> '' then begin // get extra label's dimensions - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(extra), i, j); + TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(extra), @i, @j); if w < (i + wa) then w:= i + wa; inc(h, j + ha); end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uTextures.pas --- a/hedgewars/uTextures.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uTextures.pas Sat Nov 12 17:06:49 2011 +0100 @@ -23,6 +23,7 @@ uses SDLh, uTypes; function NewTexture(width, height: Longword; buf: Pointer): PTexture; +procedure Surface2GrayScale(surf: PSDL_Surface); function Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture; procedure FreeTexture(tex: PTexture); @@ -98,6 +99,26 @@ SetTextureParameters(true); end; +procedure Surface2GrayScale(surf: PSDL_Surface); +var tw, x, y: Longword; + fromP4: PLongWordArray; +begin +fromP4:= Surf^.pixels; +for y:= 0 to Pred(Surf^.h) do + begin + for x:= 0 to Pred(Surf^.w) do + begin + tw:= fromP4^[x]; + tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED + + (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN + + (tw shr BShift and $FF) * RGB_LUMINANCE_BLUE); + if tw > 255 then tw:= 255; + tw:= (tw and $FF shl RShift) or (tw and $FF shl BShift) or (tw and $FF shl GShift) or (fromP4^[x] and AMask); + fromP4^[x]:= tw; + end; + fromP4:= @(fromP4^[Surf^.pitch div 4]) + end; +end; function Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture; var tw, th, x, y: Longword; tmpp: pointer; @@ -133,22 +154,8 @@ fromP4:= Surf^.pixels; -if cGrayScale then - for y:= 0 to Pred(Surf^.h) do - begin - for x:= 0 to Pred(Surf^.w) do - begin - tw:= fromP4^[x]; - tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED + - (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN + - (tw shr BShift and $FF) * RGB_LUMINANCE_BLUE); - if tw > 255 then tw:= 255; - tw:= (tw and $FF shl RShift) or (tw and $FF shl BShift) or (tw and $FF shl GShift) or (fromP4^[x] and AMask); - fromP4^[x]:= tw; - end; - fromP4:= @(fromP4^[Surf^.pitch div 4]) - end; - +if cGrayScale then Surface2GrayScale(Surf); + if (not SupportNPOTT) and (not (isPowerOf2(Surf^.w) and isPowerOf2(Surf^.h))) then begin tw:= toPowerOf2(Surf^.w); diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uTypes.pas Sat Nov 12 17:06:49 2011 +0100 @@ -32,7 +32,7 @@ type HwColor4f = record - r, g, b, a: byte + r, g, b, a: byte; end; // Possible states of the game diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uVariables.pas Sat Nov 12 17:06:49 2011 +0100 @@ -46,6 +46,8 @@ PathPrefix : shortstring = './'; UserPathPrefix : shortstring = './'; cShowFPS : boolean = false; + cFlattenFlakes : boolean = false; + cFlattenClouds : boolean = false; cAltDamage : boolean = true; cReducedQuality : LongWord = rqNone; UserNick : shortstring = ''; @@ -83,7 +85,6 @@ cMineDudPercent : LongWord; cTemplateFilter : LongInt; cMapGen : LongInt; - cMazeSize : LongInt; cRopePercent : LongWord; cGetAwayTime : LongWord; @@ -126,6 +127,7 @@ cLandMines : Longword; cExplosives : Longword; + cScriptName : shortstring; cSeed : shortstring; cVolumeDelta : LongInt; cHasFocus : boolean; @@ -345,7 +347,7 @@ (FileName: 'AirBomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAirBomb (FileName: 'Airplane'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; - Width: 254; Height: 101; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAirplane + Width: 256; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAirplane (FileName: 'amAirplane'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; Width: 64; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAmAirplane (FileName: 'amGirder'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil; @@ -1209,8 +1211,7 @@ ammoprop_NeedTarget or ammoprop_AttackingPut or ammoprop_DontHold or - ammoprop_NotBorder or - ammoprop_SetBounce; + ammoprop_NotBorder; Count: 1; NumPerTurn: 0; Timer: 0; @@ -2338,7 +2339,7 @@ framel, framer, depthl, depthr: GLuint; texl, texr: GLuint; - VisualGearLayers: array[0..3] of PVisualGear; + VisualGearLayers: array[0..6] of PVisualGear; lastVisualGearByUID: PVisualGear; vobFrameTicks, vobFramesCount, vobCount: Longword; vobVelocity, vobFallSpeed: LongInt; @@ -2465,7 +2466,6 @@ cMineDudPercent := 0; cTemplateFilter := 0; cMapGen := 0; // MAPGEN_REGULAR - cMazeSize := 0; cHedgehogTurnTime := 45000; cMinesTime := 3000; cMaxAIThinkTime := 9000; @@ -2505,6 +2505,7 @@ isFirstFrame := true; isSEBackup := true; autoCameraOn := true; + cScriptName := ''; cSeed := ''; cVolumeDelta := 0; cHasFocus := true; @@ -2555,10 +2556,13 @@ PathPrefix := './'; UserPathPrefix := './'; cShowFPS := false; + cFlattenFlakes := false; + cFlattenClouds := false; cAltDamage := true; cReducedQuality := rqNone; UserNick := ''; recordFileName := ''; + cScriptName := ''; cReadyDelay := 5000; cStereoMode := smNone; end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uVisualGears.pas Sat Nov 12 17:06:49 2011 +0100 @@ -337,14 +337,21 @@ if State <> 0 then gear^.State:= State; case Gear^.Kind of - vgtFlake: if random(2) = 0 then gear^.Layer:= 0 // 50% - else if random(2) = 0 then gear^.Layer:= 1 // 25% - else gear^.Layer:= random(2)+2; // 12.5% each + vgtFlake: if cFlattenFlakes then gear^.Layer:= 0 + else if random(3) = 0 then gear^.Layer:= 0 // 33% - far back + else if random(3) = 0 then gear^.Layer:= 4 // 22% - mid-distance + else if random(3) <> 0 then gear^.Layer:= 5 // 30% - just behind land + else if random(2) = 0 then gear^.Layer:= 6 // 7% - just in front of land + else gear^.Layer:= 2; // 7% - close up - // 0: this layer is very distant in the background when stereo + vgtCloud: if cFlattenClouds then gear^.Layer:= 5 + else if random(3) = 0 then gear^.Layer:= 0 + else gear^.Layer:= random(2) + 4; + + // 0: this layer is very distant in the background when in stereo vgtTeamHealthSorter, - vgtSmoothWindBar, - vgtCloud: gear^.Layer:= 0; + vgtSmoothWindBar: gear^.Layer:= 0; + // 1: this layer is on the land level (which is close but behind the screen plane) when stereo vgtSmokeTrace, @@ -413,7 +420,7 @@ begin if Steps = 0 then exit; -for i:= 0 to 3 do +for i:= 0 to 6 do begin t:= VisualGearLayers[i]; while t <> nil do @@ -427,47 +434,32 @@ procedure KickFlakes(Radius, X, Y: LongInt); var Gear, t: PVisualGear; - dmg: LongInt; + dmg, i: LongInt; begin if (vobCount = 0) or (vobCount > 200) then exit; -t:= VisualGearLayers[1]; -while t <> nil do - begin - Gear:= t; - if Gear^.Kind = vgtFlake then - begin - // Damage calc from doMakeExplosion - dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); - if dmg > 1 then +for i:= 2 to 6 do + if i <> 3 then + begin + t:= VisualGearLayers[i]; + while t <> nil do begin - Gear^.tdX:= 0.02 * dmg + 0.01; - if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; - Gear^.tdY:= 0.02 * dmg + 0.01; - if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; - Gear^.Timer:= 200 + Gear:= t; + if Gear^.Kind = vgtFlake then + begin + // Damage calc from doMakeExplosion + dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); + if dmg > 1 then + begin + Gear^.tdX:= 0.02 * dmg + 0.01; + if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; + Gear^.tdY:= 0.02 * dmg + 0.01; + if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; + Gear^.Timer:= 200 + end + end; + t:= Gear^.NextGear end - end; - t:= Gear^.NextGear - end; -t:= VisualGearLayers[3]; -while t <> nil do - begin - Gear:= t; - if Gear^.Kind = vgtFlake then - begin - // Damage calc from doMakeExplosion - dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5); - if dmg > 1 then - begin - Gear^.tdX:= 0.02 * dmg + 0.01; - if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX; - Gear^.tdY:= 0.02 * dmg + 0.01; - if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY; - Gear^.Timer:= 200 - end - end; - t:= Gear^.NextGear - end + end end; procedure DrawVisualGears(Layer: LongWord); @@ -484,20 +476,36 @@ begin if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); case Gear^.Kind of - vgtFlake: if SuddenDeathDmg then - if vobSDVelocity = 0 then - DrawTextureF(SpritesData[sprSDFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) - else - DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + vgtCloud: if SuddenDeathDmg then + DrawTextureF(SpritesData[sprSDCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) else - if vobVelocity = 0 then - DrawTextureF(SpritesData[sprFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) + DrawTextureF(SpritesData[sprCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); + vgtFlake: if cFlattenFlakes then + begin + if SuddenDeathDmg then + if vobSDVelocity = 0 then + DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else - DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); - vgtCloud: if SuddenDeathDmg then - DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + if vobVelocity = 0 then + DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + end else - DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); + begin + if SuddenDeathDmg then + if vobSDVelocity = 0 then + DrawTextureF(SpritesData[sprSDFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) + else + DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + else + if vobVelocity = 0 then + DrawTextureF(SpritesData[sprFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) + else + DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + end; end; if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF); Gear:= Gear^.NextGear @@ -527,7 +535,7 @@ end; if (cReducedQuality and rqAntiBoom) = 0 then case Gear^.Kind of - vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 0, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); + vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 1, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height); vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame); vgtDust: if Gear^.State = 1 then DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame) @@ -560,6 +568,7 @@ tinted:= false; if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); case Gear^.Kind of +(* vgtFlake: if SuddenDeathDmg then if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) @@ -569,7 +578,7 @@ if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*) vgtSpeechBubble: begin if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then begin @@ -686,7 +695,81 @@ if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); Gear:= Gear^.NextGear end - end + end; + // this layer is half-way between the screen plane (depth = 0) when in stereo, and the land + 4: begin + Gear:= VisualGearLayers[4]; + while Gear <> nil do + begin + if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); + case Gear^.Kind of + vgtCloud: if SuddenDeathDmg then + DrawTextureF(SpritesData[sprSDCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height) + else + DrawTextureF(SpritesData[sprCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height); + vgtFlake: if SuddenDeathDmg then + if vobSDVelocity = 0 then + DrawTextureF(SpritesData[sprSDFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) + else + DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + else + if vobVelocity = 0 then + DrawTextureF(SpritesData[sprFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) + else + DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); + end; + if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); + Gear:= Gear^.NextGear + end + end; + // this layer is on the screen plane (depth = 0) when stereo, but just behind the land + 5: begin + Gear:= VisualGearLayers[5]; + while Gear <> nil do + begin + if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); + case Gear^.Kind of + vgtCloud: if SuddenDeathDmg then + DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame); + vgtFlake: if SuddenDeathDmg then + if vobSDVelocity = 0 then + DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + else + if vobVelocity = 0 then + DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + end; + if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); + Gear:= Gear^.NextGear + end + end; + // this layer is on the screen plane (depth = 0) when stereo, but just in front of the land + 6: begin + Gear:= VisualGearLayers[6]; + while Gear <> nil do + begin + if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint); + case Gear^.Kind of + vgtFlake: if SuddenDeathDmg then + if vobSDVelocity = 0 then + DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + else + if vobVelocity = 0 then + DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) + else + DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + end; + if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); + Gear:= Gear^.NextGear + end + end; end; end; @@ -762,7 +845,7 @@ begin if (cReducedQuality and rqKillFlakes) <> 0 then exit; if vobCount = vobSDCount then exit; -for i:= 0 to 3 do +for i:= 0 to 6 do begin vg:= VisualGearLayers[i]; while vg <> nil do @@ -785,14 +868,14 @@ procedure initModule; var i: LongWord; begin -for i:= 0 to 3 do +for i:= 0 to 6 do VisualGearLayers[i]:= nil; end; procedure freeModule; var i: LongWord; begin -for i:= 0 to 3 do +for i:= 0 to 6 do while VisualGearLayers[i] <> nil do DeleteVisualGear(VisualGearLayers[i]); end; diff -r 1998ff75321a -r d14adf1c7721 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sat Nov 12 15:48:55 2011 +0100 +++ b/hedgewars/uWorld.pas Sat Nov 12 17:06:49 2011 +0100 @@ -74,10 +74,11 @@ const cStereo_Sky = 0.0500; cStereo_Horizon = 0.0250; + cStereo_MidDistance = 0.0175; cStereo_Water_distant = 0.0125; cStereo_Land = 0.0075; cStereo_Water_near = 0.0025; - cStereo_Outside = 0.0400; + cStereo_Outside = -0.0400; procedure InitWorld; var i, t: LongInt; @@ -184,9 +185,17 @@ WorldDx:= - (LAND_WIDTH div 2) + cScreenWidth div 2; WorldDy:= - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2); AMSlotSize:= 33; -{$IFDEF MOBILE} -AMxOffset:= 10; -AMyOffset:= 10 + 123; // moved downwards +{$IFDEF IPHONEOS} +if isPhone() then + begin + AMxOffset:= -30 + cScreenHeight div 2; + AMyOffset:= 10; + end +else + begin + AMxOffset:= AMSlotSize + cScreenHeight div 2; + AMyOffset:= -10 + cScreenWidth div 3; + end; AMWidth:= (cMaxSlotAmmoIndex + 1) * AMSlotSize + AMxOffset; {$ELSE} AMxOffset:= 10; @@ -210,205 +219,201 @@ Slot, Pos, STurns: LongInt; Ammo: PHHAmmo; begin -if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then - bShowAmmoMenu:= false; -if bShowAmmoMenu then - begin - FollowGear:= nil; - if AMxShift = AMWidth then prevPoint.X:= 0; - if (cReducedQuality and rqSlowMenu) <> 0 then - AMxShift:= 0 - else - if AMxShift > MENUSPEED then - dec(AMxShift, MENUSPEED) - else - AMxShift:= 0; - end else - begin - if AMxShift = 0 then - begin - CursorPoint.X:= cScreenWidth shr 1; - CursorPoint.Y:= cScreenHeight shr 1; - prevPoint:= CursorPoint; - end; - if (cReducedQuality and rqSlowMenu) <> 0 then - AMxShift:= AMWidth - else - if AMxShift < (AMWidth - MENUSPEED) then - inc(AMxShift, MENUSPEED) - else - AMxShift:= AMWidth; - end; -Ammo:= nil; -if (CurrentTeam <> nil) and (CurrentHedgehog <> nil) and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then - Ammo:= CurrentHedgehog^.Ammo -else if (LocalAmmo <> -1) then - Ammo:= GetAmmoByNum(LocalAmmo); -Pos:= -1; -if Ammo = nil then - begin - bShowAmmoMenu:= false; - exit - end; -SlotsNum:= 0; -x:= (cScreenWidth shr 1) - AMWidth + AMxShift; + if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or + ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then + bShowAmmoMenu:= false; -{$IFDEF MOBILE} -Slot:= cMaxSlotIndex; -x:= x - cOffsetY; -y:= AMyOffset; -dec(y, BORDERSIZE); -DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); -for i:= 0 to cMaxSlotAmmoIndex do - DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); -DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); -inc(y, BORDERSIZE); - -for i:= 0 to cMaxSlotIndex do - if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then + if bShowAmmoMenu then + // show ammo menu begin - if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i; - inc(SlotsNum); - DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); - t:= 0; - g:= 0; - while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do + FollowGear:= nil; + if AMxShift = AMWidth then prevPoint.X:= 0; + if (cReducedQuality and rqSlowMenu) <> 0 then AMxShift:= 0 + else + if AMxShift > MENUSPEED then dec(AMxShift, MENUSPEED) + else AMxShift:= 0; + end + else + // hide ammo menu + begin + if AMxShift = 0 then begin - DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); - if (Ammo^[i, t].AmmoType <> amNothing) then - begin - STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; - - if STurns >= 0 then - begin - DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); - end else - DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - if (Slot = i) - and (CursorPoint.X >= x + g * AMSlotSize) - and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then - begin - if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); - Pos:= t; - end; - inc(g) - end; - inc(t) + CursorPoint.X:= cScreenWidth shr 1; + CursorPoint.Y:= cScreenHeight shr 1; + prevPoint:= CursorPoint; end; - for g:= g to cMaxSlotAmmoIndex do - DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); - DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); - inc(y, AMSlotSize); + if (cReducedQuality and rqSlowMenu) <> 0 then AMxShift:= AMWidth+2 + else + if AMxShift < (AMWidth - MENUSPEED) then inc(AMxShift, MENUSPEED) + else AMxShift:= AMWidth; end; -DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); -for i:= 0 to cMaxSlotAmmoIndex do - DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); -DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); -{$ELSE} -Slot:= 0; -y:= cScreenHeight - AMyOffset; -DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); -for i:= 0 to cMaxSlotAmmoIndex + 1 do - DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); -DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); -dec(y, AMSlotSize); -DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); -for i:= 0 to cMaxSlotAmmoIndex do - DrawSprite(sprAMSlot, x + i * AMSlotSize, y, 2); -DrawSprite(sprAMSlot, x + (cMaxSlotAmmoIndex + 1) * AMSlotSize, y, 1); -DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); - -for i:= cMaxSlotIndex downto 0 do - if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then + // give the assigned ammo to hedgehog + Ammo:= nil; + if (CurrentTeam <> nil) and (CurrentHedgehog <> nil) and + (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then + Ammo:= CurrentHedgehog^.Ammo + else if (LocalAmmo <> -1) then + Ammo:= GetAmmoByNum(LocalAmmo); + Pos:= -1; + if Ammo = nil then begin - if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i; - dec(y, AMSlotSize); - inc(SlotsNum); - DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); - DrawSprite(sprAMSlot, x, y, 1); - DrawSprite(sprAMSlotKeys, x, y + 1, i); - t:= 0; - g:= 1; - while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do - begin - DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); - if (Ammo^[i, t].AmmoType <> amNothing) then - begin - STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; + bShowAmmoMenu:= false; + exit + end; + SlotsNum:= 0; + x:= (cScreenWidth shr 1) - AMWidth + AMxShift; + +{$IFDEF IPHONEOS} + Slot:= cMaxSlotIndex; + x:= x - cOffsetY; + y:= AMyOffset; + dec(y, BORDERSIZE); + DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); + for i:= 0 to cMaxSlotAmmoIndex do + DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); + DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); + inc(y, BORDERSIZE); - if STurns >= 0 then + for i:= 0 to cMaxSlotIndex do + if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then + begin + if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i; + inc(SlotsNum); + DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); + t:= 0; + g:= 0; + while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do + begin + DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); + if (Ammo^[i, t].AmmoType <> amNothing) then begin - DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); - end else - DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - if (Slot = i) - and (CursorPoint.X >= x + g * AMSlotSize) - and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then - begin - if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); - Pos:= t; + STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; + + if STurns >= 0 then + begin + DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); + end + else + DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + if (Slot = i) and (CursorPoint.X >= x + g * AMSlotSize) and + (CursorPoint.X <= x + (g + 1) * AMSlotSize) then + begin + if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); + Pos:= t; + end; + inc(g) end; - inc(g) - end; inc(t) end; - for g:= g to cMaxSlotAmmoIndex + 1 do - DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); - DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); - end; + + DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); + for i:= 0 to cMaxSlotAmmoIndex do + DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); + DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); +{$ELSE} + Slot:= 0; + y:= cScreenHeight - AMyOffset; + DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2); + for i:= 0 to cMaxSlotAmmoIndex + 1 do + DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1); + DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3); + dec(y, AMSlotSize); + DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); + for i:= 0 to cMaxSlotAmmoIndex do + DrawSprite(sprAMSlot, x + i * AMSlotSize, y, 2); + DrawSprite(sprAMSlot, x + (cMaxSlotAmmoIndex + 1) * AMSlotSize, y, 1); + DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); -dec(y, BORDERSIZE); -DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); -for i:= 0 to cMaxSlotAmmoIndex + 1 do - DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); -DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); -{$ENDIF} + for i:= cMaxSlotIndex downto 0 do + if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then + begin + if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i; + dec(y, AMSlotSize); + inc(SlotsNum); + DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0); + DrawSprite(sprAMSlot, x, y, 1); + DrawSprite(sprAMSlotKeys, x, y + 1, i); + t:= 0; + g:= 1; + while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do + begin + DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); + if (Ammo^[i, t].AmmoType <> amNothing) then + begin + STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; -if (Pos >= 0) then - begin - if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then - begin - if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then - begin - amSel:= Ammo^[Slot, Pos].AmmoType; - RenderWeaponTooltip(amSel) + if STurns >= 0 then + begin + DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns); + end else + DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + if (Slot = i) and (CursorPoint.X >= x + g * AMSlotSize) and + (CursorPoint.X <= x + (g + 1) * AMSlotSize) then + begin + if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0); + Pos:= t; + end; + inc(g) + end; + inc(t) + end; + for g:= g to cMaxSlotAmmoIndex + 1 do + DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1); + DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1); end; -{$IFDEF MOBILE} - DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); - - if Ammo^[Slot, Pos].Count < AMMO_INFINITE then - DrawTexture(cScreenWidth div 2 + AMxOffset - 45, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); -{$ELSE} - DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); - if Ammo^[Slot, Pos].Count < AMMO_INFINITE then - DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); + dec(y, BORDERSIZE); + DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0); + for i:= 0 to cMaxSlotAmmoIndex + 1 do + DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0); + DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1); {$ENDIF} - if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then + if (Pos >= 0) then + begin + if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then begin - bShowAmmoMenu:= false; - SetWeapon(Ammo^[Slot, Pos].AmmoType); - bSelected:= false; - FreeWeaponTooltip; - exit - end; - end - end -else - FreeWeaponTooltip; -if (WeaponTooltipTex <> nil) and (AMxShift = 0) then -{$IFDEF MOBILE} - ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, AMyOffset - 1); + if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then + begin + amSel:= Ammo^[Slot, Pos].AmmoType; + RenderWeaponTooltip(amSel) + end; + +{$IFDEF IPHONEOS} + DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); + if Ammo^[Slot, Pos].Count < AMMO_INFINITE then + DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + 163, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); {$ELSE} - ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, Min(y + 1, cScreenHeight - WeaponTooltipTex^.h - 40)); + DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); + if Ammo^[Slot, Pos].Count < AMMO_INFINITE then + DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]); {$ENDIF} -bSelected:= false; -if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) + if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then + begin + bShowAmmoMenu:= false; + SetWeapon(Ammo^[Slot, Pos].AmmoType); + bSelected:= false; + FreeWeaponTooltip; + exit + end; + end + end + else + FreeWeaponTooltip; + + if (WeaponTooltipTex <> nil) and (AMxShift = 0) then +{$IFDEF IPHONEOS} + ShowWeaponTooltip(-WeaponTooltipTex^.w div 2, 100); +{$ELSE} + ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, Min(y + 1, cScreenHeight - WeaponTooltipTex^.h - 40)); +{$ENDIF} + + bSelected:= false; + if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) end; procedure DrawWater(Alpha: byte; OffsetY: LongInt); @@ -790,6 +795,8 @@ end; DrawVisualGears(0); + ChangeDepth(RM, -cStereo_MidDistance); + DrawVisualGears(4); if (cReducedQuality and rq2DWater) = 0 then begin @@ -808,6 +815,7 @@ DrawWaves(-1, 100, - (cWaveHeight + (cWaveHeight shr 1)), 0); changeDepth(RM, cStereo_Land); + DrawVisualGears(5); DrawLand(WorldDx, WorldDy); DrawWater(255, 0); @@ -836,6 +844,7 @@ DrawVisualGears(1); DrawGears; + DrawVisualGears(6); if SuddenDeathDmg then DrawWater(cSDWaterOpacity, 0) @@ -1201,21 +1210,21 @@ uCursor.updatePosition(); {$ENDIF} z:= round(200/zoom); -if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then +if not PlacingHogs and (FollowGear <> nil) and not isCursorVisible and not bShowAmmoMenu and not fastUntilLag then if (not autoCameraOn) or ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then - begin + begin FollowGear:= nil; prevPoint:= CursorPoint; exit - end + end else - begin + begin CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx) div 8; if isPhone() or (cScreenHeight < 600) or ((hwSign(FollowGear^.dY) * z) < 10) then CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + WorldDy)) div 8 else CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + hwSign(FollowGear^.dY) * z + WorldDy)) div 8; - end; + end; wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater; if WorldDy < wdy then WorldDy:= wdy; @@ -1327,7 +1336,6 @@ procedure HideMission; begin missionTimer:= 0; - if missionTex <> nil then FreeTexture(missionTex); end; procedure ShakeCamera(amount: LongInt); diff -r 1998ff75321a -r d14adf1c7721 project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp --- a/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp Sat Nov 12 17:06:49 2011 +0100 @@ -127,9 +127,10 @@ // Touch extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeTouch( JNIEnv* env, jclass jcls, - jint action, jint pointerId, jfloat x, jfloat y, jfloat p) + jint touch_device_id_in, jint pointer_finger_id_in, + jint action, jfloat x, jfloat y, jfloat p) { - Android_OnTouch(action, pointerId, x, y, p); + Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p); } // Accelerometer diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/Appirater.m --- a/project_files/HedgewarsMobile/Classes/Appirater.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/Appirater.m Sat Nov 12 17:06:49 2011 +0100 @@ -37,7 +37,6 @@ #import "Appirater.h" #import #import -#import "ServerSetup.h" NSString *const kAppiraterLaunchDate = @"kAppiraterLaunchDate"; NSString *const kAppiraterLaunchCount = @"kAppiraterLaunchCount"; @@ -106,7 +105,7 @@ launchCount > LAUNCHES_UNTIL_PROMPT && !declinedToRate && !ratedApp) { - if ([ServerSetup isNetworkReachable]) { // check if they can reach the app store + if ([HWUtils isNetworkReachable]) { // check if they can reach the app store willShowPrompt = YES; [self performSelectorOnMainThread:@selector(showPrompt) withObject:nil waitUntilDone:NO]; } diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/DefinesAndMacros.h --- a/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h Sat Nov 12 17:06:49 2011 +0100 @@ -55,6 +55,7 @@ #define WEAPONS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Weapons/"] #define SCHEMES_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Schemes/"] #define SAVES_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Saves/"] +#define SCREENSHOTS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Screenshots/"] #define GRAPHICS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/"] #define ICONS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Icons/"] @@ -79,5 +80,3 @@ #define IS_NOT_VERY_POWERFUL(x) ([x hasPrefix:@"iPad1"] || [x hasPrefix:@"iPhone2"] || [x hasPrefix:@"iPod3"] || [x hasPrefix:@"iPod4"]) #define IS_VERY_POWERFUL(x) (IS_NOT_POWERFUL(x) == NO && IS_NOT_VERY_POWERFUL(x) == NO) -#define UIVIEW_HW_SDLVIEW [[[[UIApplication sharedApplication] keyWindow] subviews] objectAtIndex:0] - diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h --- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h Sat Nov 12 17:06:49 2011 +0100 @@ -32,21 +32,21 @@ id delegate; NSOutputStream *stream; - NSInteger ipcPort; // Port on which engine will listen - TCPsocket csd; // Client socket descriptor + TCPsocket csd; + NSInteger enginePort; } @property (nonatomic,assign) id delegate; @property (nonatomic,retain) NSOutputStream *stream; -@property (assign) NSInteger ipcPort; @property (assign) TCPsocket csd; +@property (assign) NSInteger enginePort; -(id) init; --(id) initOnPort:(NSInteger) port; --(void) spawnThread:(NSString *)onSaveFile; --(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; ++(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; ++(NSInteger) activeEnginePort; + -(void) engineProtocol:(id) object; -(void) gameHasEndedWithStats:(NSArray *)stats; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m --- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Sat Nov 12 17:06:49 2011 +0100 @@ -25,23 +25,20 @@ #define BUFFER_SIZE 255 // like in original frontend +static NSInteger activeEnginePort; + @implementation EngineProtocolNetwork -@synthesize delegate, stream, ipcPort, csd; +@synthesize delegate, stream, csd, enginePort; -(id) init { if (self = [super init]) { self.delegate = nil; - self.ipcPort = 0; self.csd = NULL; self.stream = nil; + self.enginePort = [HWUtils randomPort]; } - return self; -} - --(id) initOnPort:(NSInteger) port { - if (self = [self init]) - self.ipcPort = port; + activeEnginePort = self.enginePort; return self; } @@ -60,17 +57,20 @@ #pragma mark - #pragma mark Spawner functions --(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary { - self.stream = (onSaveFile) ? [[NSOutputStream alloc] initToFileAtPath:onSaveFile append:YES] : nil; - [self.stream open]; ++(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary { + EngineProtocolNetwork *proto = [[EngineProtocolNetwork alloc] init]; + proto.stream = (onSaveFile) ? [[NSOutputStream alloc] initToFileAtPath:onSaveFile append:YES] : nil; + [proto.stream open]; + // +detachNewThreadSelector retain/release self automatically [NSThread detachNewThreadSelector:@selector(engineProtocol:) - toTarget:self + toTarget:proto withObject:dictionary]; + [proto release]; } --(void) spawnThread:(NSString *)onSaveFile { - [self spawnThread:onSaveFile withOptions:nil]; ++(NSInteger) activeEnginePort { + return activeEnginePort; } #pragma mark - @@ -249,18 +249,18 @@ } // Resolving the host using NULL make network interface to listen - if (SDLNet_ResolveHost(&ip, NULL, ipcPort) < 0 && !clientQuit) { + if (SDLNet_ResolveHost(&ip, NULL, self.enginePort) < 0 && !clientQuit) { DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError()); clientQuit = YES; } // Open a connection with the IP provided (listen on the host's port) if (!(sd = SDLNet_TCP_Open(&ip)) && !clientQuit) { - DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), ipcPort); + DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), self.enginePort); clientQuit = YES; } - DLog(@"Waiting for a client on port %d", ipcPort); + DLog(@"Waiting for a client on port %d", self.enginePort); while (csd == NULL) csd = SDLNet_TCP_Accept(sd); SDLNet_TCP_Close(sd); @@ -393,7 +393,8 @@ } break; case 'q': - // game ended, can remove the savefile and the trailing overlay (when dualhead) + // game ended, can remove the savefile and present the statistics of the match + [HWUtils setGameStatus:gsEnded]; [self gameHasEndedWithStats:statsArray]; break; case 'Q': diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ExtraCategories.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.h Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,65 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2010 Vittorio Giovara + * + * 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; version 2 of the License + * + * 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. + * + * File created on 25/10/2011. + */ + + +#import + + +@interface UIScreen (safe) + +-(CGFloat) safeScale; + +@end + + +@interface UITableView (backgroundColor) + +-(void) setBackgroundColorForAnyTable:(UIColor *)color; + +@end + + +@interface UIColor (HWColors) + ++(UIColor *)darkYellowColor; ++(UIColor *)lightYellowColor; ++(UIColor *)darkBlueColor; ++(UIColor *)darkBlueColorTransparent; ++(UIColor *)blackColorTransparent; + +@end + + +@interface UILabel (quickStyle) + +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title; +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth; +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth + withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor; + +@end + + +@interface NSString (MD5) + +-(NSString *)MD5hash; + +@end + diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ExtraCategories.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.m Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,146 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2010 Vittorio Giovara + * + * 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; version 2 of the License + * + * 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. + * + * File created on 25/10/2011. + */ + + +#import "ExtraCategories.h" +#import +#import + + +#pragma mark - +@implementation UIScreen (safe) + +-(CGFloat) safeScale { + CGFloat theScale = 1.0f; + if ([self respondsToSelector:@selector(scale)]) + theScale = [self scale]; + return theScale; +} + +@end + + +#pragma mark - +@implementation UITableView (backgroundColor) + +-(void) setBackgroundColorForAnyTable:(UIColor *) color { + if ([self respondsToSelector:@selector(backgroundView)]) { + UIView *backView = [[UIView alloc] initWithFrame:self.frame]; + backView.backgroundColor = color; + self.backgroundView = backView; + [backView release]; + self.backgroundColor = [UIColor clearColor]; + } else + self.backgroundColor = color; +} + +@end + + +#pragma mark - +@implementation UIColor (HWColors) + ++(UIColor *)darkYellowColor { + return [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xC0/255 blue:0 alpha:1]; +} + ++(UIColor *)lightYellowColor { + return [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1]; +} + ++(UIColor *)darkBlueColor { + return [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1]; +} + +// older devices don't get any transparency for performance reasons ++(UIColor *)darkBlueColorTransparent { + return [UIColor colorWithRed:(CGFloat)0x0F/255 + green:0 + blue:(CGFloat)0x55/255 + alpha:IS_NOT_POWERFUL([HWUtils modelType]) ? 1 : 0.6f]; +} + ++(UIColor *)blackColorTransparent { + return [UIColor colorWithRed:0 + green:0 + blue:0 + alpha:IS_NOT_POWERFUL([HWUtils modelType]) ? 1 : 0.65f]; +} + +@end + + +#pragma mark - +@implementation UILabel (quickStyle) + +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title { + return [self initWithFrame:frame + andTitle:title + withBorderWidth:1.5f + withBorderColor:[UIColor darkYellowColor] + withBackgroundColor:[UIColor darkBlueColor]]; +} + +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth { + return [self initWithFrame:frame + andTitle:title + withBorderWidth:borderWidth + withBorderColor:[UIColor darkYellowColor] + withBackgroundColor:[UIColor darkBlueColorTransparent]]; +} + +-(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth + withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor{ + UILabel *theLabel = [self initWithFrame:frame]; + theLabel.backgroundColor = backColor; + + if (title != nil) { + theLabel.text = title; + theLabel.textColor = [UIColor lightYellowColor]; + theLabel.textAlignment = UITextAlignmentCenter; + theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; + } + + [theLabel.layer setBorderWidth:borderWidth]; + [theLabel.layer setBorderColor:borderColor.CGColor]; + [theLabel.layer setCornerRadius:8.0f]; + [theLabel.layer setMasksToBounds:YES]; + + return theLabel; +} + +@end + + +#pragma mark - +@implementation NSString (MD5) + +-(NSString *)MD5hash { + const char *cStr = [self UTF8String]; + unsigned char result[16]; + CC_MD5( cStr, strlen(cStr), result ); + return [NSString stringWithFormat: + @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + result[0], result[1], result[2], result[3], result[4], result[5], + result[6], result[7], result[8], result[9], result[10], result[11], + result[12], result[13], result[14], result[15]]; +} + +@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -210,7 +210,7 @@ script = self.schemeWeaponConfigViewController.scriptCommand; // create the configuration file that is going to be sent to engine - NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys: self.mapConfigViewController.seedCommand,@"seed_command", self.mapConfigViewController.templateFilterCommand,@"templatefilter_command", self.mapConfigViewController.mapGenCommand,@"mapgen_command", @@ -223,9 +223,8 @@ script,@"mission_command", nil]; - GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self]; - [bridge startLocalGame:gameDictionary]; - [bridge release]; + [GameInterfaceBridge startLocalGame:gameDictionary]; + [gameDictionary release]; } -(void) loadNiceHogs { diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h Sat Nov 12 17:06:49 2011 +0100 @@ -20,41 +20,16 @@ #import -#import "EngineProtocolNetwork.h" -typedef enum {gtNone, gtLocal, gtSave, gtMission, gtNet} TGameType; -typedef enum {gsNone, gsInGame, gsEnded, gsInterrupted} TGameStatus; - -@class OverlayViewController; -@interface GameInterfaceBridge : NSObject { - UIViewController *parentController; - OverlayViewController *overlayController; - - NSString *savePath; - EngineProtocolNetwork *engineProtocol; - - NSInteger ipcPort; // Port on which engine will listen - TGameType gameType; +@interface GameInterfaceBridge : NSObject { + UIView *blackView; } -@property (assign) UIViewController *parentController; -@property (nonatomic,retain) NSString *savePath; - -@property (nonatomic,retain) OverlayViewController *overlayController; -@property (nonatomic,retain) EngineProtocolNetwork *engineProtocol; - -@property (assign) NSInteger ipcPort; -@property (assign) TGameType gameType; +@property (nonatomic,retain) UIView *blackView; - --(id) initWithController:(id) viewController; --(void) startLocalGame:(NSDictionary *)withOptions; --(void) startSaveGame:(NSString *)atPath; --(void) startMissionGame:(NSString *)withScript; - --(void) prepareEngineLaunch; --(void) engineLaunch; --(void) gameHasEndedWithStats:(NSArray *)stats; ++(void) startLocalGame:(NSDictionary *)withOptions; ++(void) startSaveGame:(NSString *)atPath; ++(void) startMissionGame:(NSString *)withScript; @end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m --- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -239,9 +239,6 @@ cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@""); switchContent.on = [[settings objectForKey:@"classic_menu"] boolValue]; switchContent.tag = 60; - // remove this when classic ammomenu works on iphone as well - if (IS_IPAD() == NO) - switchContent.enabled = NO; break; default: DLog(@"Nope"); diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/HWUtils.h --- a/project_files/HedgewarsMobile/Classes/HWUtils.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/HWUtils.h Sat Nov 12 17:06:49 2011 +0100 @@ -21,12 +21,24 @@ #import +typedef enum {gtNone, gtLocal, gtSave, gtMission, gtNet} TGameType; +typedef enum {gsNone, gsLoading, gsInGame, gsEnded} TGameStatus; + @interface HWUtils : NSObject { } ++(TGameType) gameType; ++(void) setGameType:(TGameType) type; ++(TGameStatus) gameStatus; ++(void) setGameStatus:(TGameStatus) status; ++(BOOL) isGameLaunched; ++(BOOL) isGameRunning; + +(NSString *)modelType; +(NSArray *)teamColors; ++(NSInteger) randomPort; ++(BOOL) isNetworkReachable; +(void) releaseCache; @end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/HWUtils.m --- a/project_files/HedgewarsMobile/Classes/HWUtils.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/HWUtils.m Sat Nov 12 17:06:49 2011 +0100 @@ -22,13 +22,47 @@ #import "HWUtils.h" #import #import +#import +#import #import "hwconsts.h" +#import "EngineProtocolNetwork.h" static NSString *cachedModel = nil; static NSArray *cachedColors = nil; +static TGameType gameType = gtNone; +static TGameStatus gameStatus = gsNone; + @implementation HWUtils +#pragma mark - +#pragma mark game status and type info ++(TGameType) gameType { + return gameType; +} + ++(void) setGameType:(TGameType) type { + gameType = type; +} + ++(TGameStatus) gameStatus { + return gameStatus; +} + ++(void) setGameStatus:(TGameStatus) status { + gameStatus = status; +} + ++(BOOL) isGameLaunched { + return ((gameStatus == gsLoading) || (gameStatus == gsInGame)); +} + ++(BOOL) isGameRunning { + return (gameStatus == gsInGame); +} + +#pragma mark - +#pragma mark Helper Functions +(NSString *)modelType { if (cachedModel == nil) { size_t size; @@ -60,9 +94,53 @@ return cachedColors; } ++(NSInteger) randomPort { + srandom(time(NULL)); + NSInteger res = (random() % 64511) + 1024; + // recall self until you get a free port + if (res == NETGAME_DEFAULT_PORT || res == [EngineProtocolNetwork activeEnginePort]) + return [self randomPort]; + else + return res; +} + ++(BOOL) isNetworkReachable { + // Create zero addy + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + // Recover reachability flags + SCNetworkReachabilityRef defaultRouteReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); + SCNetworkReachabilityFlags flags; + + BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags); + CFRelease(defaultRouteReachability); + + if (!didRetrieveFlags) { + NSLog(@"Error. Could not recover network reachability flags"); + return NO; + } + + BOOL isReachable = flags & kSCNetworkFlagsReachable; + BOOL needsConnection = flags & kSCNetworkFlagsConnectionRequired; + BOOL nonWiFi = flags & kSCNetworkReachabilityFlagsTransientConnection; + + NSURL *testURL = [NSURL URLWithString:@"http://www.apple.com/"]; + NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL + cachePolicy:NSURLRequestReloadIgnoringLocalCacheData + timeoutInterval:20.0]; + NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:nil]; + BOOL testResult = testConnection ? YES : NO; + [testConnection release]; + + return ((isReachable && !needsConnection) || nonWiFi) ? testResult : NO; +} + +(void) releaseCache { - releaseAndNil(cachedModel); - releaseAndNil(cachedColors); + [cachedModel release], cachedModel = nil; + [cachedColors release], cachedColors = nil; } @end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.h Sat Nov 12 17:06:49 2011 +0100 @@ -28,13 +28,11 @@ MainMenuViewController *mainViewController; UIWindow *uiwindow; UIWindow *secondWindow; - BOOL isInGame; } @property (nonatomic,retain) MainMenuViewController *mainViewController; @property (nonatomic,retain) UIWindow *uiwindow; @property (nonatomic,retain) UIWindow *secondWindow; -@property (assign) BOOL isInGame; +(HedgewarsAppDelegate *)sharedAppDelegate; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Sat Nov 12 17:06:49 2011 +0100 @@ -34,7 +34,7 @@ @end @implementation HedgewarsAppDelegate -@synthesize mainViewController, uiwindow, secondWindow, isInGame; +@synthesize mainViewController, uiwindow, secondWindow; // convenience method +(HedgewarsAppDelegate *)sharedAppDelegate { @@ -48,7 +48,6 @@ mainViewController = nil; uiwindow = nil; secondWindow = nil; - isInGame = NO; } return self; } @@ -92,7 +91,7 @@ -(void) applicationDidReceiveMemoryWarning:(UIApplication *)application { [HWUtils releaseCache]; // don't stop music if it is playing - if (self.isInGame) { + if ([HWUtils isGameLaunched]) { [AudioManagerController releaseCache]; } MSG_MEMCLEAN(); @@ -101,7 +100,7 @@ // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return -(void) applicationWillResignActive:(UIApplication *)application { - if (self.isInGame && [[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f) + if ([HWUtils isGameLaunched] && [[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f) HW_terminate(NO); [super applicationWillResignActive:application]; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/InGameMenuViewController.h --- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h Sat Nov 12 17:06:49 2011 +0100 @@ -23,14 +23,11 @@ @interface InGameMenuViewController : UITableViewController { - NSArray *menuList; - BOOL shouldTakeScreenshot; + } -@property (nonatomic,retain) NSArray *menuList; -(void) present; -(void) dismiss; -//-(void) saveCurrentScreenToPhotoAlbum:(UIAlertView *)alert; @end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/InGameMenuViewController.m --- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -23,46 +23,18 @@ #import "SDL_sysvideo.h" #import "SDL_uikitkeyboard.h" +//FIXME: add a proper #import when this is exposed in SDL +extern UIView *SDL_getUikitView(void *); #define VIEW_HEIGHT 200 @implementation InGameMenuViewController -@synthesize menuList; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { return rotationManager(interfaceOrientation); } --(void) didReceiveMemoryWarning { - self.menuList = nil; - [super didReceiveMemoryWarning]; -} - --(void) viewDidLoad { - NSArray *array = [[NSArray alloc] initWithObjects: - NSLocalizedString(@"Show Help", @""), - NSLocalizedString(@"Tag", @""), -// NSLocalizedString(@"Snapshot",@""), - NSLocalizedString(@"End Game", @""), - nil]; - self.menuList = array; - [array release]; - - [super viewDidLoad]; -} - --(void) viewDidUnload { - self.menuList = nil; - MSG_DIDUNLOAD(); - [super viewDidUnload]; -} - --(void) dealloc { - releaseAndNil(menuList); - [super dealloc]; -} - #pragma mark - #pragma mark animating -(void) present { @@ -87,27 +59,6 @@ } SDL_iPhoneKeyboardHide((SDL_Window *)HW_getSDLWindow()); - - /* - if (shouldTakeScreenshot) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Please wait" - message:nil - delegate:nil - cancelButtonTitle:nil - otherButtonTitles:nil]; - [alert show]; - UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] - initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; - indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 45); - [indicator startAnimating]; - [alert addSubview:indicator]; - [indicator release]; - - // all these hacks because of the PAUSE caption on top of everything... - [self performSelector:@selector(saveCurrentScreenToPhotoAlbum:) withObject:alert afterDelay:0.3]; - } - */ - shouldTakeScreenshot = NO; } #pragma mark - @@ -118,18 +69,26 @@ -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; -// return 4; } -(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"CellIdentifier"; + NSInteger row = [indexPath row]; + NSString *cellTitle; + if (row == 0) + cellTitle = NSLocalizedString(@"Show Help", @""); + else if (row == 1) + cellTitle = NSLocalizedString(@"Tag", @""); + else + cellTitle = NSLocalizedString(@"End Game", @""); + UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (nil == cell) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; } - cell.textLabel.text = [self.menuList objectAtIndex:[indexPath row]]; + cell.textLabel.text = cellTitle; if (IS_IPAD()) cell.textLabel.textAlignment = UITextAlignmentCenter; @@ -139,7 +98,6 @@ -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIActionSheet *actionSheet; -// UIAlertView *alert; switch ([indexPath row]) { case 0: @@ -152,25 +110,12 @@ break; case 2: -/* - alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Going to take a screenshot",@"") - message:NSLocalizedString(@"The game snapshot will be placed in your Photo Album and it will be taken as soon as the pause menu is dismissed",@"") - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"") - otherButtonTitles:nil]; - [alert show]; - [alert release]; - shouldTakeScreenshot = YES; - - break; - case 3: -*/ actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Are you reeeeeally sure?", @"") delegate:self cancelButtonTitle:NSLocalizedString(@"Well, maybe not...", @"") destructiveButtonTitle:NSLocalizedString(@"Of course!", @"") otherButtonTitles:nil]; - [actionSheet showInView:(IS_IPAD() ? self.view : UIVIEW_HW_SDLVIEW)]; + [actionSheet showInView:(IS_IPAD() ? self.view : SDL_getUikitView(HW_getSDLWindow()))]; [actionSheet release]; break; @@ -191,63 +136,4 @@ } } -//TODO: check this is still needed since we switched to SDL_GL_CreateContext() -/* -#pragma mark - -#pragma mark save screenshot -//by http://www.bit-101.com/blog/?p=1861 -// callback for CGDataProviderCreateWithData -void releaseData(void *info, const void *data, size_t dataSize) { - DLog(@"freeing raw data\n"); - free((void *)data); -} - -// callback for UIImageWriteToSavedPhotosAlbum --(void) image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { - DLog(@"Save finished\n"); - [image release]; - UIAlertView *alert = (UIAlertView *)contextInfo; - [alert dismissWithClickedButtonIndex:0 animated:YES]; - [alert release]; -} - -// the resolution of the buffer is always equal to the hardware device even if scaled --(void) saveCurrentScreenToPhotoAlbum:(UIAlertView *)alert { - CGRect screenRect = [[UIScreen mainScreen] bounds]; - int width = screenRect.size.width; - int height = screenRect.size.height; - - NSInteger size = width * height * 4; - GLubyte *buffer = (GLubyte *) malloc(size * sizeof(GLubyte)); - GLubyte *buffer_flipped = (GLubyte *) malloc(size * sizeof(GLubyte)); - - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - HW_screenshot(); - // flip the data as glReadPixels here reads upside down - for(int y = 0; y #import @@ -69,7 +68,7 @@ IPaddress ip; BOOL serverQuit = NO; static uint8_t map[128*32]; - int port = [ServerSetup randomPort]; + int port = [HWUtils randomPort]; if (SDLNet_Init() < 0) { DLog(@"SDLNet_Init: %s", SDLNet_GetError()); diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m --- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -74,9 +74,7 @@ [AudioManagerController playBackSound]; [[self parentViewController] dismissModalViewControllerAnimated:YES]; } else { - GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self]; - [bridge startMissionGame:self.missionName]; - [bridge release]; + [GameInterfaceBridge startMissionGame:self.missionName]; } } diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ObjcExports.h --- a/project_files/HedgewarsMobile/Classes/ObjcExports.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/ObjcExports.h Sat Nov 12 17:06:49 2011 +0100 @@ -23,16 +23,13 @@ } -+(void) initialize; ++(void) setGrenadeTime:(NSInteger) value; ++(NSInteger) grenadeTime; @end -BOOL isGameRunning(void); -void setGameRunning(BOOL value); -NSInteger cachedGrenadeTime(void); void clearView(void); -void setGrenadeTime(NSInteger value); BOOL isApplePhone(void); void startSpinningProgress(void); diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ObjcExports.m --- a/project_files/HedgewarsMobile/Classes/ObjcExports.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m Sat Nov 12 17:06:49 2011 +0100 @@ -23,11 +23,9 @@ #import "OverlayViewController.h" #import "AmmoMenuViewController.h" +//FIXME: add a proper #import when this is exposed in SDL +extern UIView *SDL_getUikitView(void *); -// actual game started (controls should be enabled) -static BOOL gameRunning; -// black screen present -static BOOL savedGame; // cache the grenade time static NSInteger grenadeTime; // the reference to the newMenu instance @@ -35,32 +33,16 @@ @implementation ObjcExports -+(void) initialize { - overlay_instance = [OverlayViewController mainOverlay]; - gameRunning = NO; - savedGame = NO; - grenadeTime = 2; ++(void) setGrenadeTime:(NSInteger) value { + grenadeTime = value; +} + ++(NSInteger) grenadeTime { + return grenadeTime; } @end -#pragma mark - -#pragma mark functions called by objc code -BOOL inline isGameRunning() { - return gameRunning; -} - -void inline setGameRunning(BOOL value) { - gameRunning = value; -} - -NSInteger cachedGrenadeTime() { - return grenadeTime; -} - -void inline setGrenadeTime(NSInteger value) { - grenadeTime = value; -} #pragma mark - #pragma mark functions called by pascal code @@ -68,24 +50,54 @@ return (IS_IPAD() == NO); } -void startSpinningProgress() { - gameRunning = NO; - overlay_instance.lowerIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; +void startLoadingIndicator() { + // this is the first ojbc function called by engine, so we have to initialize some variables here + overlay_instance = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil]; + // in order to get rotation events we have to insert the view inside the first view of the second window + //TODO: when multihead make sure that overlay is displayed in the touch-enabled window + [SDL_getUikitView(HW_getSDLWindow()) addSubview:overlay_instance.view]; + grenadeTime = 2; + if ([HWUtils gameType] == gtSave) { + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + + overlay_instance.view.backgroundColor = [UIColor blackColor]; + overlay_instance.view.alpha = 0.75; + overlay_instance.view.userInteractionEnabled = NO; + } CGPoint center = overlay_instance.view.center; - overlay_instance.lowerIndicator.center = (IS_DUALHEAD() ? center : CGPointMake(center.x, center.y * 5/3)); + CGPoint loaderCenter = ((IS_DUALHEAD() || [HWUtils gameType] == gtSave) ? center : CGPointMake(center.x, center.y * 5/3)); - [overlay_instance.lowerIndicator startAnimating]; - [overlay_instance.view addSubview:overlay_instance.lowerIndicator]; - [overlay_instance.lowerIndicator release]; + overlay_instance.loadingIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + overlay_instance.loadingIndicator.hidesWhenStopped = YES; + overlay_instance.loadingIndicator.center = loaderCenter; + [overlay_instance.loadingIndicator startAnimating]; + [overlay_instance.view addSubview:overlay_instance.loadingIndicator]; + [overlay_instance.loadingIndicator release]; } -void stopSpinningProgress() { - [overlay_instance.lowerIndicator stopAnimating]; - [overlay_instance.lowerIndicator removeFromSuperview]; +void stopLoadingIndicator() { HW_zoomSet(1.7); - if (savedGame == NO) - gameRunning = YES; + if ([HWUtils gameType] != gtSave) { + [overlay_instance.loadingIndicator stopAnimating]; + [overlay_instance.loadingIndicator removeFromSuperview]; + [HWUtils setGameStatus:gsInGame]; + } +} + +void saveFinishedSynching() { + [UIView beginAnimations:@"fading from save synch" context:NULL]; + [UIView setAnimationDuration:1]; + overlay_instance.view.backgroundColor = [UIColor clearColor]; + overlay_instance.view.alpha = 1; + overlay_instance.view.userInteractionEnabled = YES; + [UIView commitAnimations]; + + [overlay_instance.loadingIndicator stopAnimating]; + [overlay_instance.loadingIndicator performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; + + [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; + [HWUtils setGameStatus:gsInGame]; } void clearView() { @@ -105,40 +117,6 @@ grenadeTime = 2; } -void saveBeganSynching() { - savedGame = YES; - stopSpinningProgress(); - [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; - - overlay_instance.view.backgroundColor = [UIColor blackColor]; - overlay_instance.view.alpha = 0.75; - overlay_instance.view.userInteractionEnabled = NO; - - overlay_instance.savesIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; - - overlay_instance.savesIndicator.center = overlay_instance.view.center; - overlay_instance.savesIndicator.hidesWhenStopped = YES; - - [overlay_instance.savesIndicator startAnimating]; - [overlay_instance.view addSubview:overlay_instance.savesIndicator]; - [overlay_instance.savesIndicator release]; -} - -void saveFinishedSynching() { - [UIView beginAnimations:@"fading from save synch" context:NULL]; - [UIView setAnimationDuration:1]; - overlay_instance.view.backgroundColor = [UIColor clearColor]; - overlay_instance.view.alpha = 1; - overlay_instance.view.userInteractionEnabled = YES; - [UIView commitAnimations]; - - [overlay_instance.savesIndicator stopAnimating]; - [overlay_instance.savesIndicator performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; - - [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; - gameRunning = YES; -} - void updateVisualsNewTurn(void) { [overlay_instance.amvc updateAmmoVisuals]; } diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/OverlayViewController.h --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h Sat Nov 12 17:06:49 2011 +0100 @@ -49,8 +49,7 @@ NSInteger initialScreenCount; // various other widgets - UIActivityIndicatorView *lowerIndicator; - UIActivityIndicatorView *savesIndicator; + UIActivityIndicatorView *loadingIndicator; UIButton *confirmButton; UISegmentedControl *grenadeTimeSegment; } @@ -59,8 +58,7 @@ @property (nonatomic,retain) InGameMenuViewController *popupMenu; @property (nonatomic,retain) HelpPageViewController *helpPage; @property (nonatomic,retain) AmmoMenuViewController *amvc; -@property (nonatomic,retain) UIActivityIndicatorView *lowerIndicator; -@property (nonatomic,retain) UIActivityIndicatorView *savesIndicator; +@property (nonatomic,retain) UIActivityIndicatorView *loadingIndicator; @property (nonatomic,retain) UIButton *confirmButton; @property (nonatomic,retain) UISegmentedControl *grenadeTimeSegment; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/OverlayViewController.m --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -36,7 +36,7 @@ static OverlayViewController *mainOverlay; @implementation OverlayViewController -@synthesize popoverController, popupMenu, helpPage, amvc, initialScreenCount, lowerIndicator, savesIndicator, +@synthesize popoverController, popupMenu, helpPage, amvc, initialScreenCount, loadingIndicator, confirmButton, grenadeTimeSegment; #pragma mark - @@ -53,8 +53,7 @@ isAttacking = NO; isPopoverVisible = NO; initialScreenCount = (IS_DUALHEAD() ? 2 : 1); - lowerIndicator = nil; - savesIndicator = nil; + loadingIndicator = nil; mainOverlay = self; } return self; @@ -119,8 +118,7 @@ [self dismissPopover]; self.popoverController = nil; self.amvc = nil; - self.lowerIndicator = nil; - self.savesIndicator = nil; + self.loadingIndicator = nil; MSG_DIDUNLOAD(); [super viewDidUnload]; } @@ -132,10 +130,8 @@ self.helpPage = nil; if (self.amvc.view.superview == nil) self.amvc = nil; - if (self.lowerIndicator.superview == nil) - self.lowerIndicator = nil; - if (self.savesIndicator.superview == nil) - self.savesIndicator = nil; + if (self.loadingIndicator.superview == nil) + self.loadingIndicator = nil; if (self.confirmButton.superview == nil) self.confirmButton = nil; if (self.grenadeTimeSegment.superview == nil) @@ -153,8 +149,7 @@ releaseAndNil(helpPage); releaseAndNil(popoverController); releaseAndNil(amvc); - releaseAndNil(lowerIndicator); - releaseAndNil(savesIndicator); + releaseAndNil(loadingIndicator); releaseAndNil(confirmButton); releaseAndNil(grenadeTimeSegment); // dimTimer is autoreleased @@ -191,7 +186,7 @@ #pragma mark overlay appearance // nice transition for dimming, should be called only by the timer himself -(void) dimOverlay { - if (isGameRunning()) { + if ([HWUtils isGameRunning]) { [UIView beginAnimations:@"overlay dim" context:NULL]; [UIView setAnimationDuration:0.6]; self.view.alpha = 0.2; @@ -209,13 +204,15 @@ [self.popupMenu performSelectorOnMainThread:@selector(dismiss) withObject:nil waitUntilDone:YES]; [self.popoverController performSelectorOnMainThread:@selector(dismissPopoverAnimated:) withObject:nil waitUntilDone:YES]; [self.view performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES]; + mainOverlay = nil; } #pragma mark - #pragma mark overlay user interaction // dim the overlay when there's no more input for a certain amount of time -(IBAction) buttonReleased:(id) sender { - if (isGameRunning() == NO) + if ([HWUtils isGameRunning] == NO) return; UIButton *theButton = (UIButton *)sender; @@ -248,7 +245,7 @@ -(IBAction) buttonPressed:(id) sender { [self activateOverlay]; - if (isGameRunning() == NO) + if ([HWUtils isGameRunning] == NO) return; if (isPopoverVisible) @@ -333,9 +330,9 @@ -(void) setGrenadeTime:(id) sender { UISegmentedControl *theSegment = (UISegmentedControl *)sender; - if (cachedGrenadeTime() != theSegment.selectedSegmentIndex) { + if ([ObjcExports grenadeTime] != theSegment.selectedSegmentIndex) { HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1); - setGrenadeTime(theSegment.selectedSegmentIndex); + [ObjcExports setGrenadeTime:theSegment.selectedSegmentIndex]; } } @@ -401,7 +398,7 @@ #pragma mark - #pragma mark Custom touch event handling -(BOOL) shouldIgnoreTouch:(NSSet *)allTouches { - if (isGameRunning() == NO) + if ([HWUtils isGameRunning] == NO) return YES; // ignore activity near the dpad and buttons @@ -441,10 +438,14 @@ HW_zoomReset(); break; case 2: - // pinching - first = [[allTouches allObjects] objectAtIndex:0]; - second = [[allTouches allObjects] objectAtIndex:1]; - initialDistanceForPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]); + if (2 == [[[allTouches allObjects] objectAtIndex:0] tapCount]) + HW_screenshot(); + else { + // pinching + first = [[allTouches allObjects] objectAtIndex:0]; + second = [[allTouches allObjects] objectAtIndex:1]; + initialDistanceForPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]); + } break; default: break; @@ -512,7 +513,7 @@ [grenadeSegment release]; } self.grenadeTimeSegment.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50); - self.grenadeTimeSegment.selectedSegmentIndex = cachedGrenadeTime(); + self.grenadeTimeSegment.selectedSegmentIndex = [ObjcExports grenadeTime]; self.grenadeTimeSegment.alpha = 1; [self.view addSubview:self.grenadeTimeSegment]; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/RestoreViewController.m --- a/project_files/HedgewarsMobile/Classes/RestoreViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/RestoreViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -36,14 +36,13 @@ if (theButton.tag != 0) { [AudioManagerController playClickSound]; - [self.parentViewController dismissModalViewControllerAnimated:NO]; [[NSNotificationCenter defaultCenter] postNotificationName:@"launchRestoredGame" object:nil]; } else { [AudioManagerController playBackSound]; [defaults setObject:@"" forKey:@"savedGamePath"]; [defaults synchronize]; - [self.parentViewController dismissModalViewControllerAnimated:YES]; } + [self.parentViewController dismissModalViewControllerAnimated:YES]; } -(void) viewDidLoad { diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/SavedGamesViewController.h --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h Sat Nov 12 17:06:49 2011 +0100 @@ -22,19 +22,16 @@ #import #import "EditableCellView.h" -@class GameInterfaceBridge; @interface SavedGamesViewController : UIViewController { UITableView *tableView; NSMutableArray *listOfSavegames; NSInteger numberOfItems; - GameInterfaceBridge *interfaceBridge; } @property (nonatomic,retain) IBOutlet UITableView *tableView; @property (nonatomic,retain) NSMutableArray *listOfSavegames; -@property (nonatomic,retain) GameInterfaceBridge *interfaceBridge; @property (assign) NSInteger numberOfItems; -(IBAction) buttonPressed:(id) sender; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/SavedGamesViewController.m --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -24,7 +24,7 @@ @implementation SavedGamesViewController -@synthesize tableView, listOfSavegames, interfaceBridge, numberOfItems; +@synthesize tableView, listOfSavegames, numberOfItems; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { return rotationManager(interfaceOrientation); @@ -189,13 +189,7 @@ self.numberOfItems++; [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone]; - if (self.interfaceBridge == nil) { - GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self]; - self.interfaceBridge = bridge; - [bridge release]; - } - - [self.interfaceBridge startSaveGame:currentFilePath]; + [GameInterfaceBridge startSaveGame:currentFilePath]; [currentFilePath release]; } @@ -219,8 +213,6 @@ #pragma mark Memory Management -(void) didReceiveMemoryWarning { self.listOfSavegames = nil; - // don't nil this one or it won't be able to send messages - //self.interfaceBridge = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; } @@ -228,7 +220,6 @@ -(void) viewDidUnload { self.tableView = nil; self.listOfSavegames = nil; - self.interfaceBridge = nil; MSG_DIDUNLOAD(); [super viewDidUnload]; } @@ -236,7 +227,6 @@ -(void) dealloc { releaseAndNil(tableView); releaseAndNil(listOfSavegames); - releaseAndNil(interfaceBridge); [super dealloc]; } diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -329,7 +329,7 @@ #pragma mark - #pragma mark Memory management -(void) didReceiveMemoryWarning { - if ([[HedgewarsAppDelegate sharedAppDelegate] isInGame]) { + if ([HWUtils isGameLaunched]) { self.tableView = nil; self.lastIndexPath_sc = nil; self.lastIndexPath_we = nil; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.h Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,42 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2011 Vittorio Giovara + * + * 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; version 2 of the License + * + * 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. + * + * File created on 16/12/2010. + */ + + +#import +#import "SDL_net.h" +//#import "EngineProtocolNetwork.h" + +@interface ServerProtocolNetwork : NSObject { + NSInteger serverPort; + NSString *serverAddress; + TCPsocket ssd; +} + +@property (assign) TCPsocket ssd; +@property (assign) NSInteger serverPort; +@property (nonatomic,retain) NSString *serverAddress; + +-(id) init; +-(id) init:(NSInteger) onPort withAddress:(NSString *)address; +-(id) initOnPort:(NSInteger) port; +-(id) initToAddress:(NSString *)address; ++(ServerProtocolNetwork *)openServerConnection; + +@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Classes/ServerProtocolNetwork.m Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,214 @@ +/* + * Hedgewars-iOS, a Hedgewars port for iOS devices + * Copyright (c) 2009-2011 Vittorio Giovara + * + * 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; version 2 of the License + * + * 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. + * + * File created on 10/01/2010. + */ + + +#import "ServerProtocolNetwork.h" +#import "hwconsts.h" + +#define BUFFER_SIZE 256 + +static ServerProtocolNetwork *serverConnection; + +@implementation ServerProtocolNetwork +@synthesize serverPort, serverAddress, ssd; + +#pragma mark - +#pragma mark init and class methods +-(id) init:(NSInteger) onPort withAddress:(NSString *)address { + if (self = [super init]) { + self.serverPort = onPort; + self.serverAddress = address; + } + serverConnection = self; + return self; +} + +-(id) init { + return [self init:NETGAME_DEFAULT_PORT withAddress:@"netserver.hedgewars.org"]; +} + +-(id) initOnPort:(NSInteger) port { + return [self init:port withAddress:@"netserver.hedgewars.org"]; +} + +-(id) initToAddress:(NSString *)address { + return [self init:NETGAME_DEFAULT_PORT withAddress:address]; +} + +-(void) dealloc { + releaseAndNil(serverAddress); + serverConnection = nil; + [super dealloc]; +} + ++(ServerProtocolNetwork *)openServerConnection { + ServerProtocolNetwork *connection = [[ServerProtocolNetwork alloc] init]; + [NSThread detachNewThreadSelector:@selector(serverProtocol) + toTarget:connection + withObject:nil]; + [connection retain]; // retain count here is +2 + return connection; +} + +#pragma mark - +#pragma mark Communication layer +-(int) sendToServer:(NSString *)command { + NSString *message = [[NSString alloc] initWithFormat:@"%@\n\n",command]; + int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message length]); + [message release]; + return result; +} + +-(int) sendToServer:(NSString *)command withArgument:(NSString *)argument { + NSString *message = [[NSString alloc] initWithFormat:@"%@\n%@\n\n",command,argument]; + int result = SDLNet_TCP_Send(self.ssd, [message UTF8String], [message length]); + [message release]; + return result; +} + +-(void) serverProtocol { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + IPaddress ip; + BOOL clientQuit = NO; + char *buffer = (char *)malloc(sizeof(char)*BUFFER_SIZE); + int dim = BUFFER_SIZE; + uint8_t msgSize; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + if (SDLNet_Init() < 0) { + DLog(@"SDLNet_Init: %s", SDLNet_GetError()); + clientQuit = YES; + } + + // Resolving the host using NULL make network interface to listen + if (SDLNet_ResolveHost(&ip, [self.serverAddress UTF8String] , self.serverPort) < 0 && !clientQuit) { + DLog(@"SDLNet_ResolveHost: %s", SDLNet_GetError()); + clientQuit = YES; + } + + // Open a connection with the IP provided (listen on the host's port) + if (!(self.ssd = SDLNet_TCP_Open(&ip)) && !clientQuit) { + DLog(@"SDLNet_TCP_Open: %s %d", SDLNet_GetError(), self.serverPort); + clientQuit = YES; + } + + DLog(@"Found server on port %d", self.serverPort); + while (!clientQuit) { + int index = 0; + BOOL exitBufferLoop = NO; + memset(buffer, '\0', dim); + + while (exitBufferLoop != YES) { + msgSize = SDLNet_TCP_Recv(self.ssd, &buffer[index], 2); + + // exit in case of error + if (msgSize <= 0) { + DLog(@"SDLNet_TCP_Recv: %s", SDLNet_GetError()); + clientQuit = YES; + break; + } + + // update index position and check for End-Of-Message + index += msgSize; + if (strncmp(&buffer[index-2], "\n\n", 2) == 0) { + exitBufferLoop = YES; + } + + // if message is too big allocate new space + if (index >= dim) { + dim += BUFFER_SIZE; + buffer = (char *)realloc(buffer, dim); + if (buffer == NULL) { + clientQuit = YES; + break; + } + } + } + + NSString *bufferedMessage = [[NSString alloc] initWithBytes:buffer length:index-2 encoding:NSASCIIStringEncoding]; + NSArray *listOfCommands = [bufferedMessage componentsSeparatedByString:@"\n"]; + [bufferedMessage release]; + NSString *command = [listOfCommands objectAtIndex:0]; + DLog(@"size = %d, %@", index-2, listOfCommands); + if ([command isEqualToString:@"PING"]) { + if ([listOfCommands count] > 1) + [self sendToServer:@"PONG" withArgument:[listOfCommands objectAtIndex:1]]; + else + [self sendToServer:@"PONG"]; + DLog(@"PONG"); + } + else if ([command isEqualToString:@"NICK"]) { + //what is this for? + } + else if ([command isEqualToString:@"PROTO"]) { + //what is this for? + } + else if ([command isEqualToString:@"ROOM"]) { + //TODO: stub + } + else if ([command isEqualToString:@"LOBBY:LEFT"]) { + //TODO: stub + } + else if ([command isEqualToString:@"LOBBY:JOINED"]) { + //TODO: stub + } + else if ([command isEqualToString:@"ASKPASSWORD"]) { + NSString *pwd = [defaults objectForKey:@"password"]; + [self sendToServer:@"PASSWORD" withArgument:pwd]; + } + else if ([command isEqualToString:@"CONNECTED"]) { + int netProto; + char *versionStr; + HW_versionInfo(&netProto, &versionStr); + NSString *nick = [defaults objectForKey:@"username"]; + [self sendToServer:@"NICK" withArgument:nick]; + [self sendToServer:@"PROTO" withArgument:[NSString stringWithFormat:@"%d",netProto]]; + } + else if ([command isEqualToString:@"SERVER_MESSAGE"]) { + DLog(@"%@", [listOfCommands objectAtIndex:1]); + } + else if ([command isEqualToString:@"WARNING"]) { + if ([listOfCommands count] > 1) + DLog(@"Server warning - %@", [listOfCommands objectAtIndex:1]); + else + DLog(@"Server warning - unknown"); + } + else if ([command isEqualToString:@"ERROR"]) { + DLog(@"Server error - %@", [listOfCommands objectAtIndex:1]); + } + else if ([command isEqualToString:@"BYE"]) { + //TODO: handle "Reconnected too fast" + DLog(@"Server disconnected, reason: %@", [listOfCommands objectAtIndex:1]); + clientQuit = YES; + } + else { + DLog(@"Unknown/Unsupported message received: %@", command); + } + } + DLog(@"Server closed connection, ending thread"); + + free(buffer); + SDLNet_TCP_Close(self.ssd); + SDLNet_Quit(); + + [pool release]; +} + +@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ServerSetup.h --- a/project_files/HedgewarsMobile/Classes/ServerSetup.h Sat Nov 12 15:48:55 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * Hedgewars-iOS, a Hedgewars port for iOS devices - * Copyright (c) 2009-2011 Vittorio Giovara - * - * 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; version 2 of the License - * - * 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. - * - * File created on 16/12/2010. - */ - - -#import -#import "SDL_net.h" - -@interface ServerSetup : NSObject { - NSDictionary *systemSettings; - - TCPsocket sd; // External socket descriptor -} - -+(NSInteger) randomPort; -+(BOOL) isNetworkReachable; - -@property (nonatomic, retain) NSDictionary *systemSettings; - -@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/ServerSetup.m --- a/project_files/HedgewarsMobile/Classes/ServerSetup.m Sat Nov 12 15:48:55 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -/* - * Hedgewars-iOS, a Hedgewars port for iOS devices - * Copyright (c) 2009-2011 Vittorio Giovara - * - * 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; version 2 of the License - * - * 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. - * - * File created on 10/01/2010. - */ - - -#import "ServerSetup.h" -#import -#import - -#import "hwconsts.h" - -#define BUFFER_SIZE 256 - -@implementation ServerSetup -@synthesize systemSettings; - - -+(NSInteger) randomPort { - srandom(time(NULL)); - NSInteger res = (random() % 64511) + 1024; - return (res == NETGAME_DEFAULT_PORT) ? [ServerSetup randomPort] : res; -} - -+(BOOL) isNetworkReachable { - // Create zero addy - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - // Recover reachability flags - SCNetworkReachabilityRef defaultRouteReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); - SCNetworkReachabilityFlags flags; - - BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags); - CFRelease(defaultRouteReachability); - - if (!didRetrieveFlags) { - NSLog(@"Error. Could not recover network reachability flags"); - return NO; - } - - BOOL isReachable = flags & kSCNetworkFlagsReachable; - BOOL needsConnection = flags & kSCNetworkFlagsConnectionRequired; - BOOL nonWiFi = flags & kSCNetworkReachabilityFlagsTransientConnection; - - NSURL *testURL = [NSURL URLWithString:@"http://www.apple.com/"]; - NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL - cachePolicy:NSURLRequestReloadIgnoringLocalCacheData - timeoutInterval:20.0]; - NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:nil]; - BOOL testResult = testConnection ? YES : NO; - [testConnection release]; - - return ((isReachable && !needsConnection) || nonWiFi) ? testResult : NO; -} - --(id) init { - if (self = [super init]) { - self.systemSettings = nil; //nsuserdefault - } - return self; -} - --(void) dealloc { - - [super dealloc]; -} - --(int) sendToServer:(NSString *)command { - NSString *message = [[NSString alloc] initWithFormat:@"%@\n\n",command]; - int result = SDLNet_TCP_Send(sd, [message UTF8String], [message length]); - [message release]; - return result; -} - --(int) sendToServer:(NSString *)command withArgument:(NSString *)argument { - NSString *message = [[NSString alloc] initWithFormat:@"%@\n%@\n\n",command,argument]; - int result = SDLNet_TCP_Send(sd, [message UTF8String], [message length]); - [message release]; - return result; -} - --(void) serverProtocol { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - IPaddress ip; - BOOL clientQuit = NO; - char *buffer = (char *)malloc(sizeof(char)*BUFFER_SIZE); - int dim = BUFFER_SIZE; - uint8_t msgSize; - - if (SDLNet_Init() < 0) { - DLog(@"SDLNet_Init: %s", SDLNet_GetError()); - clientQuit = YES; - } - - // Resolving the host using NULL make network interface to listen - if (SDLNet_ResolveHost(&ip, "netserver.hedgewars.org", NETGAME_DEFAULT_PORT) < 0 && !clientQuit) { - DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError()); - clientQuit = YES; - } - - // Open a connection with the IP provided (listen on the host's port) - if (!(sd = SDLNet_TCP_Open(&ip)) && !clientQuit) { - DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), NETGAME_DEFAULT_PORT); - clientQuit = YES; - } - - DLog(@"Found server on port %d", NETGAME_DEFAULT_PORT); - while (!clientQuit) { - int index = 0; - BOOL exitBufferLoop = NO; - memset(buffer, '\0', dim); - - while (exitBufferLoop != YES) { - msgSize = SDLNet_TCP_Recv(sd, &buffer[index], 2); - - // exit in case of error - if (msgSize <= 0) { - DLog(@"SDLNet_TCP_Recv: %s", SDLNet_GetError()); - clientQuit = YES; - break; - } - - // update index position and check for End-Of-Message - index += msgSize; - if (strncmp(&buffer[index-2], "\n\n", 2) == 0) { - exitBufferLoop = YES; - } - - // if message is too big allocate new space - if (index >= dim) { - dim += BUFFER_SIZE; - buffer = (char *)realloc(buffer, dim); - if (buffer == NULL) { - clientQuit = YES; - break; - } - } - } - - NSString *bufferedMessage = [[NSString alloc] initWithBytes:buffer length:index-2 encoding:NSASCIIStringEncoding]; - NSArray *listOfCommands = [bufferedMessage componentsSeparatedByString:@"\n"]; - [bufferedMessage release]; - NSString *command = [listOfCommands objectAtIndex:0]; - DLog(@"size = %d, %@", index-2, listOfCommands); - if ([command isEqualToString:@"PING"]) { - if ([listOfCommands count] > 1) - [self sendToServer:@"PONG" withArgument:[listOfCommands objectAtIndex:1]]; - else - [self sendToServer:@"PONG"]; - DLog(@"PONG"); - } - else if ([command isEqualToString:@"NICK"]) { - //what is this for? - } - else if ([command isEqualToString:@"PROTO"]) { - //what is this for? - } - else if ([command isEqualToString:@"ROOM"]) { - //TODO: stub - } - else if ([command isEqualToString:@"LOBBY:LEFT"]) { - //TODO: stub - } - else if ([command isEqualToString:@"LOBBY:JOINED"]) { - //TODO: stub - } - else if ([command isEqualToString:@"ASKPASSWORD"]) { - NSString *pwd = [self.systemSettings objectForKey:@"password"]; - [self sendToServer:@"PASSWORD" withArgument:pwd]; - } - else if ([command isEqualToString:@"CONNECTED"]) { - int netProto; - char *versionStr; - HW_versionInfo(&netProto, &versionStr); - NSString *nick = [self.systemSettings objectForKey:@"username"]; - [self sendToServer:@"NICK" withArgument:nick]; - [self sendToServer:@"PROTO" withArgument:[NSString stringWithFormat:@"%d",netProto]]; - } - else if ([command isEqualToString:@"SERVER_MESSAGE"]) { - DLog(@"%@", [listOfCommands objectAtIndex:1]); - } - else if ([command isEqualToString:@"WARNING"]) { - if ([listOfCommands count] > 1) - DLog(@"Server warning - %@", [listOfCommands objectAtIndex:1]); - else - DLog(@"Server warning - unknown"); - } - else if ([command isEqualToString:@"ERROR"]) { - DLog(@"Server error - %@", [listOfCommands objectAtIndex:1]); - } - else if ([command isEqualToString:@"BYE"]) { - //TODO: handle "Reconnected too fast" - DLog(@"Server disconnected, reason: %@", [listOfCommands objectAtIndex:1]); - clientQuit = YES; - } - else { - DLog(@"Unknown/Unsupported message received: %@", command); - } - } - DLog(@"Server closed connection, ending thread"); - - free(buffer); - SDLNet_TCP_Close(sd); - SDLNet_Quit(); - - [pool release]; -} - -@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m --- a/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/SettingsBaseViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -284,5 +284,18 @@ [super dealloc]; } + +-(void) viewWillDisappear:(BOOL)animated { + // this will send -viewWillDisappear: only the active view + [self.tabController viewWillDisappear:animated]; + // let's send that to every page, even though only GeneralSettingsViewController needs it + [generalSettingsViewController viewWillDisappear:animated]; + [teamSettingsViewController viewWillDisappear:animated]; + [weaponSettingsViewController viewWillDisappear:animated]; + [schemeSettingsViewController viewWillDisappear:animated]; + [supportViewController viewWillDisappear:animated]; + [super viewWillDisappear:animated]; +} + @end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m --- a/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -68,7 +68,6 @@ self.baseController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width); [self.view addSubview:self.baseController.view]; - // here setting activeController is not needed as the event is kept active by the uitabbarcontroller } [super viewDidLoad]; @@ -104,26 +103,31 @@ #pragma mark - -#pragma mark additional methods as we're using a UINavigationController programmatically +#pragma mark view event management propagation +// every time we add a uiviewcontroller programmatically we need to take care of propgating such messages // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/ -(void) viewWillAppear:(BOOL)animated { + [self.activeController viewWillAppear:animated]; + [self.baseController viewWillAppear:animated]; [super viewWillAppear:animated]; - [self.activeController viewWillAppear:animated]; } -(void) viewWillDisappear:(BOOL)animated { + [self.activeController viewWillDisappear:animated]; + [self.baseController viewWillDisappear:animated]; [super viewWillDisappear:animated]; - [self.activeController viewWillDisappear:animated]; } -(void) viewDidAppear:(BOOL)animated { + [self.activeController viewDidAppear:animated]; + [self.baseController viewDidAppear:animated]; [super viewDidLoad]; - [self.activeController viewDidAppear:animated]; } -(void) viewDidDisappear:(BOOL)animated { + [self.activeController viewDidDisappear:animated]; + [self.baseController viewDidDisappear:animated]; [super viewDidUnload]; - [self.activeController viewDidDisappear:animated]; } diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Classes/TeamConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Sat Nov 12 17:06:49 2011 +0100 @@ -271,11 +271,6 @@ #pragma mark - #pragma mark Memory management -(void) didReceiveMemoryWarning { - if ([[HedgewarsAppDelegate sharedAppDelegate] isInGame]) { - self.listOfSelectedTeams = nil; - self.listOfAllTeams = nil; - self.tableView = nil; - } self.cachedContentsOfDir = nil; MSG_MEMCLEAN(); [super didReceiveMemoryWarning]; diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/ExtraCategories.h --- a/project_files/HedgewarsMobile/ExtraCategories.h Sat Nov 12 15:48:55 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * Hedgewars-iOS, a Hedgewars port for iOS devices - * Copyright (c) 2009-2010 Vittorio Giovara - * - * 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; version 2 of the License - * - * 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. - * - * File created on 25/10/2011. - */ - - -#import - - -@interface UIScreen (safe) - --(CGFloat) safeScale; - -@end - - -@interface UITableView (backgroundColor) - --(void) setBackgroundColorForAnyTable:(UIColor *)color; - -@end - - -@interface UIColor (HWColors) - -+(UIColor *)darkYellowColor; -+(UIColor *)lightYellowColor; -+(UIColor *)darkBlueColor; -+(UIColor *)darkBlueColorTransparent; -+(UIColor *)blackColorTransparent; - -@end - - -@interface UILabel (quickStyle) - --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title; --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth; --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth - withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor; - -@end - - -@interface NSString (MD5) - --(NSString *)MD5hash; - -@end \ No newline at end of file diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/ExtraCategories.m --- a/project_files/HedgewarsMobile/ExtraCategories.m Sat Nov 12 15:48:55 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* - * Hedgewars-iOS, a Hedgewars port for iOS devices - * Copyright (c) 2009-2010 Vittorio Giovara - * - * 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; version 2 of the License - * - * 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. - * - * File created on 25/10/2011. - */ - - -#import "ExtraCategories.h" -#import -#import - - -@implementation UIScreen (safe) - --(CGFloat) safeScale { - CGFloat theScale = 1.0f; - if ([self respondsToSelector:@selector(scale)]) - theScale = [self scale]; - return theScale; -} - -@end - - -@implementation UITableView (backgroundColor) - --(void) setBackgroundColorForAnyTable:(UIColor *) color { - if ([self respondsToSelector:@selector(backgroundView)]) { - UIView *backView = [[UIView alloc] initWithFrame:self.frame]; - backView.backgroundColor = color; - self.backgroundView = backView; - [backView release]; - self.backgroundColor = [UIColor clearColor]; - } else - self.backgroundColor = color; -} - -@end - - -@implementation UIColor (HWColors) - -+(UIColor *)darkYellowColor { - return [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xC0/255 blue:0 alpha:1]; -} - -+(UIColor *)lightYellowColor { - return [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1]; -} - -+(UIColor *)darkBlueColor { - return [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1]; -} - -// older devices don't get any transparency for performance reasons -+(UIColor *)darkBlueColorTransparent { - return [UIColor colorWithRed:(CGFloat)0x0F/255 - green:0 - blue:(CGFloat)0x55/255 - alpha:IS_NOT_POWERFUL([HWUtils modelType]) ? 1 : 0.6f]; -} - -+(UIColor *)blackColorTransparent { - return [UIColor colorWithRed:0 - green:0 - blue:0 - alpha:IS_NOT_POWERFUL([HWUtils modelType]) ? 1 : 0.65f]; -} - -@end - - -@implementation UILabel (quickStyle) - --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title { - return [self initWithFrame:frame - andTitle:title - withBorderWidth:1.5f - withBorderColor:[UIColor darkYellowColor] - withBackgroundColor:[UIColor darkBlueColor]]; -} - --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth { - return [self initWithFrame:frame - andTitle:title - withBorderWidth:borderWidth - withBorderColor:[UIColor darkYellowColor] - withBackgroundColor:[UIColor darkBlueColorTransparent]]; -} - --(UILabel *)initWithFrame:(CGRect)frame andTitle:(NSString *)title withBorderWidth:(CGFloat) borderWidth - withBorderColor:(UIColor *)borderColor withBackgroundColor:(UIColor *)backColor{ - UILabel *theLabel = [self initWithFrame:frame]; - theLabel.backgroundColor = backColor; - - if (title != nil) { - theLabel.text = title; - theLabel.textColor = [UIColor lightYellowColor]; - theLabel.textAlignment = UITextAlignmentCenter; - theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; - } - - [theLabel.layer setBorderWidth:borderWidth]; - [theLabel.layer setBorderColor:borderColor.CGColor]; - [theLabel.layer setCornerRadius:8.0f]; - [theLabel.layer setMasksToBounds:YES]; - - return theLabel; -} - -@end - - -@implementation NSString (MD5) - --(NSString *)MD5hash { - const char *cStr = [self UTF8String]; - unsigned char result[16]; - CC_MD5( cStr, strlen(cStr), result ); - return [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - result[0], result[1], result[2], result[3], result[4], result[5], - result[6], result[7], result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15]]; -} - -@end diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Nov 12 17:06:49 2011 +0100 @@ -231,7 +231,7 @@ 61DF0EDC1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61DF0EDB1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib */; }; 61DF0F211284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61DF0F201284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib */; }; 61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; }; - 61E2E12E12BAAEE30051B659 /* ServerSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 61E2E12D12BAAEE30051B659 /* ServerSetup.m */; }; + 61E2E12E12BAAEE30051B659 /* ServerProtocolNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 61E2E12D12BAAEE30051B659 /* ServerProtocolNetwork.m */; }; 61E2F7441283752C00E12521 /* fb.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E2F7421283752C00E12521 /* fb.png */; }; 61E2F7451283752C00E12521 /* tw.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E2F7431283752C00E12521 /* tw.png */; }; 61E5D68D12AB006F00566F29 /* uLandPainted.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E5D68C12AB006F00566F29 /* uLandPainted.pas */; }; @@ -595,8 +595,8 @@ 61C28D3D142D380400DA16C2 /* AudioManagerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioManagerController.h; path = Classes/AudioManagerController.h; sourceTree = ""; }; 61C28D3E142D380400DA16C2 /* AudioManagerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AudioManagerController.m; path = Classes/AudioManagerController.m; sourceTree = ""; }; 61CADE321402EE290030C3EB /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; - 61D0BDF71457508C0011A899 /* ExtraCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtraCategories.h; sourceTree = ""; }; - 61D0BDF81457508C0011A899 /* ExtraCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtraCategories.m; sourceTree = ""; }; + 61D0BDF71457508C0011A899 /* ExtraCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtraCategories.h; path = Classes/ExtraCategories.h; sourceTree = ""; }; + 61D0BDF81457508C0011A899 /* ExtraCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtraCategories.m; path = Classes/ExtraCategories.m; sourceTree = ""; }; 61D2059F127CDD1100ABD83E /* ObjcExports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjcExports.h; path = Classes/ObjcExports.h; sourceTree = ""; }; 61D205A0127CDD1100ABD83E /* ObjcExports.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ObjcExports.m; path = Classes/ObjcExports.m; sourceTree = ""; }; 61D3D2A41290E03A003CE7C3 /* irc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = irc.png; path = Resources/Icons/irc.png; sourceTree = ""; }; @@ -605,8 +605,8 @@ 61DF0EDB1284DF2300F3F10B /* HelpPageLobbyViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageLobbyViewController-iPhone.xib"; sourceTree = ""; }; 61DF0F201284F72A00F3F10B /* HelpPageInGameViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = "HelpPageInGameViewController-iPhone.xib"; sourceTree = ""; }; 61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; }; - 61E2E12C12BAAEE30051B659 /* ServerSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerSetup.h; sourceTree = ""; }; - 61E2E12D12BAAEE30051B659 /* ServerSetup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServerSetup.m; sourceTree = ""; }; + 61E2E12C12BAAEE30051B659 /* ServerProtocolNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerProtocolNetwork.h; sourceTree = ""; }; + 61E2E12D12BAAEE30051B659 /* ServerProtocolNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServerProtocolNetwork.m; sourceTree = ""; }; 61E2F7421283752C00E12521 /* fb.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = fb.png; path = Resources/Icons/fb.png; sourceTree = ""; }; 61E2F7431283752C00E12521 /* tw.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = tw.png; path = Resources/Icons/tw.png; sourceTree = ""; }; 61E5D68C12AB006F00566F29 /* uLandPainted.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uLandPainted.pas; path = ../../hedgewars/uLandPainted.pas; sourceTree = SOURCE_ROOT; }; @@ -688,8 +688,8 @@ 61EDB5AF135B3F97009B29A6 /* GameInterfaceBridge.m */, 616591E611CA9BA200D6E256 /* EngineProtocolNetwork.h */, 616591E711CA9BA200D6E256 /* EngineProtocolNetwork.m */, - 61E2E12C12BAAEE30051B659 /* ServerSetup.h */, - 61E2E12D12BAAEE30051B659 /* ServerSetup.m */, + 61E2E12C12BAAEE30051B659 /* ServerProtocolNetwork.h */, + 61E2E12D12BAAEE30051B659 /* ServerProtocolNetwork.m */, ); path = Classes; sourceTree = ""; @@ -726,14 +726,12 @@ 61DE91561258B76800B80214 /* Custom UIs */, 61AC067212B2E32D000B52A2 /* Appirater.h */, 61AC067312B2E32D000B52A2 /* Appirater.m */, + 61006F93128DE31F00EBA7F7 /* CreationChamber.h */, + 61006F94128DE31F00EBA7F7 /* CreationChamber.m */, 6165929C11CA9E2F00D6E256 /* HedgewarsAppDelegate.h */, 6165929D11CA9E2F00D6E256 /* HedgewarsAppDelegate.m */, 61D2059F127CDD1100ABD83E /* ObjcExports.h */, 61D205A0127CDD1100ABD83E /* ObjcExports.m */, - 61006F93128DE31F00EBA7F7 /* CreationChamber.h */, - 61006F94128DE31F00EBA7F7 /* CreationChamber.m */, - 6165922411CA9BD500D6E256 /* CGPointUtils.h */, - 6165922311CA9BD500D6E256 /* CGPointUtils.c */, ); name = "Other Sources"; sourceTree = ""; @@ -1106,6 +1104,8 @@ children = ( 61C28D3D142D380400DA16C2 /* AudioManagerController.h */, 61C28D3E142D380400DA16C2 /* AudioManagerController.m */, + 6165922411CA9BD500D6E256 /* CGPointUtils.h */, + 6165922311CA9BD500D6E256 /* CGPointUtils.c */, 61D0BDF71457508C0011A899 /* ExtraCategories.h */, 61D0BDF81457508C0011A899 /* ExtraCategories.m */, 6165922511CA9BD500D6E256 /* HWUtils.h */, @@ -1644,7 +1644,7 @@ 61E5D68D12AB006F00566F29 /* uLandPainted.pas in Sources */, 61F544C712AF1748007FD913 /* HoldTableViewCell.m in Sources */, 61AC067412B2E32D000B52A2 /* Appirater.m in Sources */, - 61E2E12E12BAAEE30051B659 /* ServerSetup.m in Sources */, + 61E2E12E12BAAEE30051B659 /* ServerProtocolNetwork.m in Sources */, 61B7A33812CC21080086B604 /* StatsPageViewController.m in Sources */, 61EDB5B0135B3F97009B29A6 /* GameInterfaceBridge.m in Sources */, 61A976B3136F668500DD9878 /* uCursor.pas in Sources */, diff -r 1998ff75321a -r d14adf1c7721 project_files/HedgewarsMobile/SDL-50560ca58f80.patch --- a/project_files/HedgewarsMobile/SDL-50560ca58f80.patch Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/HedgewarsMobile/SDL-50560ca58f80.patch Sat Nov 12 17:06:49 2011 +0100 @@ -1,6 +1,6 @@ diff -r 50560ca58f80 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Mon Oct 24 23:18:53 2011 -0400 -+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Tue Oct 25 22:13:19 2011 +0200 ++++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Wed Nov 02 09:22:08 2011 +0100 @@ -1596,9 +1596,12 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; @@ -31,7 +31,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; diff -r 50560ca58f80 include/SDL_config_iphoneos.h --- a/include/SDL_config_iphoneos.h Mon Oct 24 23:18:53 2011 -0400 -+++ b/include/SDL_config_iphoneos.h Tue Oct 25 22:13:19 2011 +0200 ++++ b/include/SDL_config_iphoneos.h Wed Nov 02 09:22:08 2011 +0100 @@ -106,7 +106,7 @@ /* enable iPhone version of Core Audio driver */ #define SDL_AUDIO_DRIVER_COREAUDIO 1 @@ -63,7 +63,7 @@ See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed diff -r 50560ca58f80 src/video/uikit/SDL_uikitopenglview.m --- a/src/video/uikit/SDL_uikitopenglview.m Mon Oct 24 23:18:53 2011 -0400 -+++ b/src/video/uikit/SDL_uikitopenglview.m Tue Oct 25 22:13:19 2011 +0200 ++++ b/src/video/uikit/SDL_uikitopenglview.m Wed Nov 02 09:22:08 2011 +0100 @@ -114,8 +114,8 @@ // !!! FIXME: use the screen this is on! @@ -86,15 +86,176 @@ } - (void)setCurrentContext +diff -r 50560ca58f80 src/video/uikit/SDL_uikitvideo.m +--- a/src/video/uikit/SDL_uikitvideo.m Mon Oct 24 23:18:53 2011 -0400 ++++ b/src/video/uikit/SDL_uikitvideo.m Wed Nov 02 09:22:08 2011 +0100 +@@ -178,7 +178,7 @@ + + // UIScreenMode showed up in 3.2 (the iPad and later). We're + // misusing this supports_multiple_displays flag here for that. +- if (!SDL_UIKit_supports_multiple_displays) { ++ if (SDL_UIKit_supports_multiple_displays) { + UIScreenMode *uimode = [uiscreen currentMode]; + [uimode retain]; // once for the desktop_mode + [uimode retain]; // once for the current_mode +@@ -200,10 +200,8 @@ + { + _this->gl_config.driver_loaded = 1; + +- NSString *reqSysVer = @"3.2"; +- NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; +- if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) +- SDL_UIKit_supports_multiple_displays = YES; ++ // this tells us whether we are running on ios >= 3.2 ++ SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)]; + + // Add the main screen. + UIScreen *uiscreen = [UIScreen mainScreen]; +diff -r 50560ca58f80 src/video/uikit/SDL_uikitview.m +--- a/src/video/uikit/SDL_uikitview.m Mon Oct 24 23:18:53 2011 -0400 ++++ b/src/video/uikit/SDL_uikitview.m Wed Nov 02 09:22:08 2011 +0100 +@@ -311,7 +311,7 @@ + /* iPhone keyboard addition functions */ + #if SDL_IPHONE_KEYBOARD + +-SDL_uikitview * getWindowView(SDL_Window * window) ++SDL_uikitview *SDL_getUikitView(SDL_Window *window) + { + if (window == NULL) { + SDL_SetError("Window does not exist"); +@@ -328,9 +328,9 @@ + return view; + } + +-int SDL_iPhoneKeyboardShow(SDL_Window * window) ++int SDL_iPhoneKeyboardShow(SDL_Window *window) + { +- SDL_uikitview *view = getWindowView(window); ++ SDL_uikitview *view = SDL_getUikitView(window); + if (view == nil) { + return -1; + } +@@ -339,9 +339,9 @@ + return 0; + } + +-int SDL_iPhoneKeyboardHide(SDL_Window * window) ++int SDL_iPhoneKeyboardHide(SDL_Window *window) + { +- SDL_uikitview *view = getWindowView(window); ++ SDL_uikitview *view = SDL_getUikitView(window); + if (view == nil) { + return -1; + } +@@ -350,9 +350,9 @@ + return 0; + } + +-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) ++SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window) + { +- SDL_uikitview *view = getWindowView(window); ++ SDL_uikitview *view = SDL_getUikitView(window); + if (view == nil) { + return 0; + } +@@ -360,9 +360,9 @@ + return view.keyboardVisible; + } + +-int SDL_iPhoneKeyboardToggle(SDL_Window * window) ++int SDL_iPhoneKeyboardToggle(SDL_Window *window) + { +- SDL_uikitview *view = getWindowView(window); ++ SDL_uikitview *view = SDL_getUikitView(window); + if (view == nil) { + return -1; + } +@@ -380,24 +380,24 @@ + + /* stubs, used if compiled without keyboard support */ + +-int SDL_iPhoneKeyboardShow(SDL_Window * window) ++int SDL_iPhoneKeyboardShow(SDL_Window *window) + { + SDL_SetError("Not compiled with keyboard support"); + return -1; + } + +-int SDL_iPhoneKeyboardHide(SDL_Window * window) ++int SDL_iPhoneKeyboardHide(SDL_Window *window) + { + SDL_SetError("Not compiled with keyboard support"); + return -1; + } + +-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) ++SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window) + { + return 0; + } + +-int SDL_iPhoneKeyboardToggle(SDL_Window * window) ++int SDL_iPhoneKeyboardToggle(SDL_Window *window) + { + SDL_SetError("Not compiled with keyboard support"); + return -1; diff -r 50560ca58f80 src/video/uikit/SDL_uikitviewcontroller.m --- a/src/video/uikit/SDL_uikitviewcontroller.m Mon Oct 24 23:18:53 2011 -0400 -+++ b/src/video/uikit/SDL_uikitviewcontroller.m Tue Oct 25 22:13:19 2011 +0200 -@@ -145,7 +145,7 @@ - frame.origin.x = 0; - frame.origin.y = 0; ++++ b/src/video/uikit/SDL_uikitviewcontroller.m Wed Nov 02 09:22:08 2011 +0100 +@@ -28,8 +28,8 @@ + + #include "SDL_uikitwindow.h" + +-#import "SDL_uikitviewcontroller.h" +- ++#include "SDL_uikitviewcontroller.h" ++#include "SDL_uikitvideo.h" + + @implementation SDL_uikitviewcontroller -- [uiwindow setFrame:frame]; -+ [uiwindow setFrame:[[UIScreen mainScreen] bounds]]; +@@ -116,38 +116,17 @@ + const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation]; + SDL_WindowData *data = self->window->driverdata; + UIWindow *uiwindow = data->uiwindow; +- UIScreen *uiscreen = [uiwindow screen]; ++ UIScreen *uiscreen; ++ if (SDL_UIKit_supports_multiple_displays) ++ uiscreen = [uiwindow screen]; ++ else ++ uiscreen = [UIScreen mainScreen]; + const int noborder = self->window->flags & SDL_WINDOW_BORDERLESS; + CGRect frame = noborder ? [uiscreen bounds] : [uiscreen applicationFrame]; +- const CGSize size = frame.size; +- int w, h; +- +- switch (toInterfaceOrientation) { +- case UIInterfaceOrientationPortrait: +- case UIInterfaceOrientationPortraitUpsideDown: +- w = (size.width < size.height) ? size.width : size.height; +- h = (size.width > size.height) ? size.width : size.height; +- break; +- +- case UIInterfaceOrientationLandscapeLeft: +- case UIInterfaceOrientationLandscapeRight: +- w = (size.width > size.height) ? size.width : size.height; +- h = (size.width < size.height) ? size.width : size.height; +- break; +- +- default: +- SDL_assert(0 && "Unexpected interface orientation!"); +- return; +- } +- +- frame.size.width = w; +- frame.size.height = h; +- frame.origin.x = 0; +- frame.origin.y = 0; + + [uiwindow setFrame:frame]; [data->view updateFrame]; - SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h); +- SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h); ++ SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, frame.size.width, frame.size.height); } + + @end diff -r 1998ff75321a -r d14adf1c7721 project_files/hedgewars.pro --- a/project_files/hedgewars.pro Sat Nov 12 15:48:55 2011 +0100 +++ b/project_files/hedgewars.pro Sat Nov 12 17:06:49 2011 +0100 @@ -70,9 +70,9 @@ ../QTfrontend/ui/widget/weaponItem.h \ ../QTfrontend/ui/widget/gamecfgwidget.h \ ../QTfrontend/ui/widget/mapContainer.h \ - ../QTfrontend/ui/widget/HistoryLineEdit.h \ + ../QTfrontend/ui/widget/HistoryLineEdit.h \ ../QTfrontend/ui/widget/SmartLineEdit.h \ - ../QTfrontend/util/HWDataManager.h \ + ../QTfrontend/util/HWDataManager.h \ ../QTfrontend/net/netregister.h \ ../QTfrontend/net/netserver.h \ ../QTfrontend/net/netudpwidget.h \ @@ -147,7 +147,7 @@ ../QTfrontend/ui/widget/mapContainer.cpp \ ../QTfrontend/ui/widget/HistoryLineEdit.cpp \ ../QTfrontend/ui/widget/SmartLineEdit.cpp \ - ../QTfrontend/util/HWDataManager.cpp \ + ../QTfrontend/util/HWDataManager.cpp \ ../QTfrontend/net/tcpBase.cpp \ ../QTfrontend/net/netregister.cpp \ ../QTfrontend/net/proto.cpp \ @@ -166,7 +166,7 @@ ../QTfrontend/HWApplication.cpp \ ../QTfrontend/hwform.cpp \ ../QTfrontend/main.cpp \ - ../QTfrontend/util/SDLInteraction.cpp \ + ../QTfrontend/util/SDLInteraction.cpp \ ../QTfrontend/team.cpp \ ../QTfrontend/ui_hwform.cpp \ ../QTfrontend/hwconsts.cpp diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Graphics/Airplane.png Binary file share/hedgewars/Data/Graphics/Airplane.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Graphics/Progress.png Binary file share/hedgewars/Data/Graphics/Progress.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Graphics/SuddenDeath/SDFlake.png Binary file share/hedgewars/Data/Graphics/SuddenDeath/SDFlake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_ar.ts --- a/share/hedgewars/Data/Locale/hedgewars_ar.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_ar.ts Sat Nov 12 17:06:49 2011 +0100 @@ -64,24 +64,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 تم حذفة من قائمة الترك + %1 *** %2 تم حذفة من قائمة الترك %1 *** %2 has been added to your ignore list - %1 *** %2 تم اضافته الى قائمة النرك + %1 *** %2 تم اضافته الى قائمة النرك %1 *** %2 has been removed from your friends list - %1 *** %2 تم حذقه الى قائمة الاصدقاء + %1 *** %2 تم حذقه الى قائمة الاصدقاء %1 *** %2 has been added to your friends list - %1 *** %2 تم حذفة من قائمة الاصدقاء + %1 *** %2 تم حذفة من قائمة الاصدقاء + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -132,6 +184,40 @@ Demo name: + + Game aborted + + + + Password + كلمة السر + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + اسم اللاعب + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -258,7 +344,7 @@ Password - كلمة السر + كلمة السر Your nickname %1 is @@ -287,21 +373,11 @@ %1 *** %2 خرج - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - Nickname - اسم اللاعب - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + اسم اللاعب + + + User quit @@ -359,7 +435,7 @@ Cancel - الغاء + الغاء @@ -484,6 +560,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -969,10 +1052,6 @@ متاهة عشوائية - State: - - - Rules: @@ -1167,7 +1246,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - نمط التدريب، تحت التطوير + نمط التدريب، تحت التطوير Demos (Watch recorded demos) @@ -1178,7 +1257,22 @@ تحميل - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1474,7 +1568,7 @@ This program is distributed under the GNU General Public License - This program is distributed under the GNU General Public License + This program is distributed under the GNU General Public License Developers: @@ -1633,10 +1727,6 @@ - Game Options - - - Style @@ -1652,6 +1742,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_bg.ts --- a/share/hedgewars/Data/Locale/hedgewars_bg.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_bg.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Когато тази настройка е включена, при избирането на игрова схема автоматично ще се избере оръжие + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 беше премахнат от списъка с игнорирани + %1 *** %2 беше премахнат от списъка с игнорирани %1 *** %2 has been added to your ignore list - %1 *** %2 беше добавен към списъка с игнорирани + %1 *** %2 беше добавен към списъка с игнорирани %1 *** %2 has been removed from your friends list - %1 *** %2 беше премахнат от списъка с приятели + %1 *** %2 беше премахнат от списъка с приятели %1 *** %2 has been added to your friends list - %1 *** %2 беше добавен към списъка с приятели + %1 *** %2 беше добавен към списъка с приятели + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,43 @@ Demo name: + + Game aborted + + + + Password + Парола + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Прякорът ви %1 е +регистриран на Hedgewars.org +Моля въдете паролата си по-долу +или изберете друг прякор в настройките на играта: + + + No password supplied. + + + + Nickname + Прякор + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -249,7 +338,7 @@ Password - Парола + Парола Quit reason: @@ -280,20 +369,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Прякорът ви %1 е + Прякорът ви %1 е регистриран на Hedgewars.org Моля въдете паролата си по-долу или изберете друг прякор в настройките на играта: Nickname - Прякор - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Прякор + + + User quit @@ -343,7 +429,7 @@ Cancel - Отказ + Отказ @@ -462,6 +548,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -933,7 +1026,7 @@ State: - Състояние: + Състояние: Rules: @@ -1123,7 +1216,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Тренировка (упражнете уменията си в редица тренировъчни мисии). В ПРОЦЕС НА РАЗРАБОТКА + Тренировка (упражнете уменията си в редица тренировъчни мисии). В ПРОЦЕС НА РАЗРАБОТКА Demos (Watch recorded demos) @@ -1135,7 +1228,26 @@ Campaign Mode (...). IN DEVELOPMENT - Режим кампания (...). В ПРОЦЕС НА РАЗРАБОТКА + Режим кампания (...). В ПРОЦЕС НА РАЗРАБОТКА + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1454,7 +1566,7 @@ This program is distributed under the GNU General Public License - Тази програма се разпространява под GNU (the GNU General Public License) лиценз + Тази програма се разпространява под GNU (the GNU General Public License) лиценз Resolution @@ -1589,10 +1701,6 @@ Стерео режим - Game Options - - - Style @@ -1608,6 +1716,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_cs.ts --- a/share/hedgewars/Data/Locale/hedgewars_cs.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_cs.ts Sat Nov 12 17:06:49 2011 +0100 @@ -64,24 +64,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Pokud je tato volba aktivována, výběr herního schématu vybere automaticky i zbraňové schéma + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 byl odstraněn ze seznamu ignorovaných + %1 *** %2 byl odstraněn ze seznamu ignorovaných %1 *** %2 has been added to your ignore list - %1 *** %2 byl přidán na seznam ignorovaných + %1 *** %2 byl přidán na seznam ignorovaných %1 *** %2 has been removed from your friends list - %1 *** %2 byl odstraněn ze seznamu přátel + %1 *** %2 byl odstraněn ze seznamu přátel %1 *** %2 has been added to your friends list - %1 *** %2 byl přidán na seznam přátel + %1 *** %2 byl přidán na seznam přátel + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -132,6 +184,43 @@ Demo name: + + Game aborted + + + + Password + Heslo + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Tvoje přezdívka %1 je +registrovaná na Hedgewars.org +Prosím, zadej své heslo +nebo si v konfiguraci vyber jinou přezdívku: + + + No password supplied. + + + + Nickname + Přezdívka + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -258,7 +347,7 @@ Password - Heslo + Heslo %1 *** %2 has joined the room @@ -281,20 +370,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Tvoje přezdívka %1 je + Tvoje přezdívka %1 je registrovaná na Hedgewars.org Prosím, zadej své heslo nebo si v konfiguraci vyber jinou přezdívku: Nickname - Přezdívka - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Přezdívka + + + User quit @@ -344,7 +430,7 @@ Cancel - Zrušit + Zrušit @@ -469,6 +555,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -947,7 +1040,7 @@ State: - Stav: + Stav: Rules: @@ -1142,7 +1235,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Výcvikový mód (Procvič si schopnosti v řadě tréningových misí). VE VÝVOJI + Výcvikový mód (Procvič si schopnosti v řadě tréningových misí). VE VÝVOJI Demos (Watch recorded demos) @@ -1154,7 +1247,26 @@ Campaign Mode (...). IN DEVELOPMENT - Mód tažení (...). VE VÝVOJI + Mód tažení (...). VE VÝVOJI + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1437,7 +1549,7 @@ This program is distributed under the GNU General Public License - Tento program je poskytovaný pod GNU General Public licencí + Tento program je poskytovaný pod GNU General Public licencí Developers: @@ -1608,10 +1720,6 @@ Duální vykreslování - Game Options - - - Style @@ -1627,6 +1735,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_de.ts --- a/share/hedgewars/Data/Locale/hedgewars_de.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_de.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Wenn diese Option aktiviert ist, wird durch Auswählen eines Spielprofils auch automatisch Waffen ausgewählt + + Game Options + Spieloptionen + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 wurde aus deiner Ignorierliste entfernt + %1 *** %2 wurde aus deiner Ignorierliste entfernt %1 *** %2 has been added to your ignore list - %1 *** %2 wurde in deine Ignorierliste aufgenommen + %1 *** %2 wurde in deine Ignorierliste aufgenommen %1 *** %2 has been removed from your friends list - %1 *** %2 wurde aus deiner Freundesliste entfernt + %1 *** %2 wurde aus deiner Freundesliste entfernt %1 *** %2 has been added to your friends list - %1 *** %2 wurde in deine Freundesliste aufgenommen + %1 *** %2 wurde in deine Freundesliste aufgenommen + + + %1 has been removed from your ignore list + %1 wurde aus deiner Ignorierliste entfernt + + + %1 has been added to your ignore list + %1 wurde in deine Ignorierliste aufgenommen + + + %1 has been removed from your friends list + %1 wurde aus deiner Freundesliste entfernt + + + %1 has been added to your friends list + %1 wurde in deine Freundesliste aufgenommen + + + Stylesheet imported from %1 + Style-Sheet aus %1 importiert + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + Gib %1 ein wenn du das jetzige Style-Sheet in Zukunft weiterverwenden willst, gib %2 ein um es zurückzusetzen! + + + Couldn't read %1 + Konnte %1 nicht lesen + + + StyleSheet discarded + Style-Sheet verworfen + + + StyleSheet saved to %1 + Style-Sheet wurde nach %1 gesichert + + + Failed to save StyleSheet to %1 + Style-Sheet konnte nich nach %1 gesichert werden + + + %1 is not a valid command! + %1 ist kein gültiger Befehl! + + + Kicking %1 ... + %1 wird rausgeworfen ... @@ -131,6 +183,48 @@ Demo name: Demo-Name: + + Game aborted + Spiel abgebrochen + + + Password + Passwort + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Dein Spitzname '%1' wurde +auf Hedgewars.org registriert. + +Bitte gib dein Passwort ein oder +wähle einen anderen Spitznamen +in den Spieloptionen: + + + No password supplied. + Kein Passwort + + + Nickname + Spitzname + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Jemand verwendet +deinen Spiznamen %1 +bereits auf dem Server. +Bitte wähle einen anderen Spitznamen: + + + No nickname supplied. + Kein Spitznahme angegeben. + HWGame @@ -261,7 +355,7 @@ Password - Passwort + Passwort Your nickname %1 is @@ -295,7 +389,7 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Dein Spitzname '%1' wurde + Dein Spitzname '%1' wurde auf Hedgewars.org registriert. Bitte gib dein Passwort ein oder @@ -303,18 +397,22 @@ Nickname - Spitzname + Spitzname Some one already uses your nickname %1 on the server. Please pick another nickname: - Jemand verwendet + Jemand verwendet deinen Spiznamen %1 bereits auf dem Server. Bitte wähle einen anderen Spitznamen: + + User quit + Benutzer ist gegangen + KB @@ -370,7 +468,7 @@ Cancel - Abbrechen + Abbrechen @@ -503,6 +601,13 @@ + PageInGame + + In game... + Im Spiel... + + + PageMain Local Game (Play a game on a single computer) @@ -1011,7 +1116,7 @@ State: - Status: + Status: Rules: @@ -1205,7 +1310,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Trainingsmodus (Verbessere dein Können in verschiedenen Trainingsmissionen). IN ENTWICKLUNG + Trainingsmodus (Verbessere dein Können in verschiedenen Trainingsmissionen). IN ENTWICKLUNG Demos (Watch recorded demos) @@ -1217,7 +1322,26 @@ Campaign Mode (...). IN DEVELOPMENT - Kampagnenmodus (...) IN ENTWICKLUNG + Kampagnenmodus (...) IN ENTWICKLUNG + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + Trainingsmodus (Verbessere deine Fähigkeiten in verschiedenen Trainingsmissionen) + + + + PageTraining + + No description available + Keine Beschreibung verfügbar + + + Select a mission! + Wähle eine Mission! @@ -1500,7 +1624,7 @@ QLabel This program is distributed under the GNU General Public License - Dieses Programm ist unter der GNU General Public License veröffentlicht + Dieses Programm ist unter der GNU General Public License veröffentlicht Developers: @@ -1678,7 +1802,7 @@ Game Options - Spieloptionen + Spieloptionen Style @@ -1696,6 +1820,10 @@ % Get Away Time % Rückzugszeit + + This program is distributed under the GNU General Public License v2 + Dieses Spiel wird unter den Bedingungen der GNU General Public License v2 verbreitet + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_en.ts --- a/share/hedgewars/Data/Locale/hedgewars_en.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_en.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 has been removed from your ignore list + %1 *** %2 has been removed from your ignore list %1 *** %2 has been added to your ignore list - %1 *** %2 has been added to your ignore list + %1 *** %2 has been added to your ignore list %1 *** %2 has been removed from your friends list - %1 *** %2 has been removed from your friends list + %1 *** %2 has been removed from your friends list %1 *** %2 has been added to your friends list - %1 *** %2 has been added to your friends list + %1 *** %2 has been added to your friends list + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,43 @@ Demo name: + + Game aborted + + + + Password + Password + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + No password supplied. + + + + Nickname + Nickname + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -257,7 +346,7 @@ Password - Password + Password Your nickname %1 is @@ -290,20 +379,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Your nickname %1 is + Your nickname %1 is registered on Hedgewars.org Please provide your password below or pick another nickname in game config: Nickname - Nickname - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Nickname + + + User quit @@ -361,7 +447,7 @@ Cancel - Cancel + Cancel @@ -490,6 +576,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -972,10 +1065,6 @@ - State: - - - Rules: @@ -1182,7 +1271,18 @@ Load (Load a previously saved game) - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1478,7 +1578,7 @@ This program is distributed under the GNU General Public License - This program is distributed under the GNU General Public License + This program is distributed under the GNU General Public License Developers: @@ -1637,10 +1737,6 @@ - Game Options - - - Style @@ -1656,6 +1752,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_es.ts --- a/share/hedgewars/Data/Locale/hedgewars_es.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_es.ts Sat Nov 12 17:06:49 2011 +0100 @@ -67,24 +67,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Cuando esta opción esté activada escoger un modo de juego escogerá el set de armas correspondiente + + Game Options + Opciones de juego + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 ha sido eliminado de tu lista de ignorados + %1 *** %2 ha sido eliminado de tu lista de ignorados %1 *** %2 has been added to your ignore list - %1 *** %2 has sido añadido a tu lista de ignorados + %1 *** %2 has sido añadido a tu lista de ignorados %1 *** %2 has been removed from your friends list - %1 *** %2 ha sido eliminado de tu lista de amigos + %1 *** %2 ha sido eliminado de tu lista de amigos %1 *** %2 has been added to your friends list - %1 *** %2 ha sido añadido a tu lista de amigos + %1 *** %2 ha sido añadido a tu lista de amigos + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -135,6 +187,46 @@ Demo name: Nombre de la demo: + + Game aborted + + + + Password + Contraseña + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + El nick %1 ya está registrado +en Hedgewars.org. Por favor, +introduce ahora tu clave de acceso +o elige otro nick en las preferencias del juego: + + + No password supplied. + + + + Nickname + Nick + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Ya hay alguien conectado +como %1 en estos momentos +en el servidor. +Por favor, introduce otro nick: + + + No nickname supplied. + + HWGame @@ -265,7 +357,7 @@ Password - Contraseña + Contraseña Your nickname %1 is @@ -298,25 +390,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - El nick %1 ya está registrado + El nick %1 ya está registrado en Hedgewars.org. Por favor, introduce ahora tu clave de acceso o elige otro nick en las preferencias del juego: Nickname - Nick + Nick Some one already uses your nickname %1 on the server. Please pick another nickname: - Ya hay alguien conectado + Ya hay alguien conectado como %1 en estos momentos en el servidor. Por favor, introduce otro nick: + + User quit + + KB @@ -372,7 +468,7 @@ Cancel - Cancelar + Cancelar @@ -509,6 +605,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1017,7 +1120,7 @@ State: - Estado: + Estado: Rules: @@ -1215,7 +1318,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Entrenamiento (Practica tus habilidades en diversas misiones de entrenamiento). EN DESARROLLO + Entrenamiento (Practica tus habilidades en diversas misiones de entrenamiento). EN DESARROLLO Demos (Watch recorded demos) @@ -1227,7 +1330,26 @@ Campaign Mode (...). IN DEVELOPMENT - Campaña (...) EN DESARROLLO + Campaña (...) EN DESARROLLO + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1542,7 +1664,7 @@ QLabel This program is distributed under the GNU General Public License - Este programa está distribuido bajo la licencia GNU General Public License + Este programa está distribuido bajo la licencia GNU General Public License Developers: @@ -1731,7 +1853,7 @@ Game Options - Opciones de juego + Opciones de juego Style @@ -1749,6 +1871,10 @@ % Get Away Time % duración de retirada + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_fi.ts --- a/share/hedgewars/Data/Locale/hedgewars_fi.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_fi.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 on poistanut sinut huomiotta jättö-listaltaan + %1 *** %2 on poistanut sinut huomiotta jättö-listaltaan %1 *** %2 has been added to your ignore list - %1 *** %2 on lisännyt sinut huomiotta jättö-listalleen + %1 *** %2 on lisännyt sinut huomiotta jättö-listalleen %1 *** %2 has been removed from your friends list - %1 *** %2 on poistanut sinut kaverilistaltaan + %1 *** %2 on poistanut sinut kaverilistaltaan %1 *** %2 has been added to your friends list - %1 *** %2 on lisännyt sinut kaverilistalleen + %1 *** %2 on lisännyt sinut kaverilistalleen + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,43 @@ Demo name: + + Game aborted + + + + Password + Salasana + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Nimimerkkisi %1 on +rekisteröity Hedgewars.org-sivustolla +Ole hyvä ja syötä salasanasi +tai aseta eri nimimerkki asetuksissa: + + + No password supplied. + + + + Nickname + Nimimerkki + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -257,7 +346,7 @@ Password - Salasana + Salasana Your nickname %1 is @@ -290,20 +379,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Nimimerkkisi %1 on + Nimimerkkisi %1 on rekisteröity Hedgewars.org-sivustolla Ole hyvä ja syötä salasanasi tai aseta eri nimimerkki asetuksissa: Nickname - Nimimerkki - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Nimimerkki + + + User quit @@ -361,7 +447,7 @@ Cancel - Peruuta + Peruuta @@ -494,6 +580,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1002,7 +1095,7 @@ State: - Tila: + Tila: Rules: @@ -1200,7 +1293,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Harjoittelu (Harjoita taitojasi harjoitustasoissa). KEHITYKSEN ALLA + Harjoittelu (Harjoita taitojasi harjoitustasoissa). KEHITYKSEN ALLA Demos (Watch recorded demos) @@ -1212,7 +1305,26 @@ Campaign Mode (...). IN DEVELOPMENT - Kampanja-tila (...). KEHITYS KESKEN + Kampanja-tila (...). KEHITYS KESKEN + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1535,7 +1647,7 @@ This program is distributed under the GNU General Public License - Tätä ohjelmaa levitetään GNU General Public Licence-lisensisn alla + Tätä ohjelmaa levitetään GNU General Public Licence-lisensisn alla Developers: @@ -1694,10 +1806,6 @@ - Game Options - - - Style @@ -1713,6 +1821,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_fr.ts --- a/share/hedgewars/Data/Locale/hedgewars_fr.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_fr.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Une fois cette option activée, choisir les paramètres de jeu sélectionne automatiquement les armes correspondantes + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 a été enlevé de votre liste de personnes ignorées + %1 *** %2 a été enlevé de votre liste de personnes ignorées %1 *** %2 has been added to your ignore list - %1 *** %2 a été ajouté dans votre liste de personnes ignorées + %1 *** %2 a été ajouté dans votre liste de personnes ignorées %1 *** %2 has been removed from your friends list - %1 *** %2 a été enlevé à votre liste d'amis + %1 *** %2 a été enlevé à votre liste d'amis %1 *** %2 has been added to your friends list - %1 *** %2 a été ajouté à votre liste d'amis + %1 *** %2 a été ajouté à votre liste d'amis + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,43 @@ Demo name: + + Game aborted + + + + Password + Mot de passe + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Votre pseudo %1 est +enregistré sur Hedgewars.org +Veuillez fournir votre mot de passe +ou choisir un nouveau pseudo : + + + No password supplied. + + + + Nickname + Pseudo + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -257,7 +346,7 @@ Password - Mot de passe + Mot de passe Your nickname %1 is @@ -290,20 +379,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Votre pseudo %1 est + Votre pseudo %1 est enregistré sur Hedgewars.org Veuillez fournir votre mot de passe ou choisir un nouveau pseudo : Nickname - Pseudo - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Pseudo + + + User quit @@ -361,7 +447,7 @@ Cancel - Annuler + Annuler @@ -494,6 +580,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -985,7 +1078,7 @@ State: - État : + État : Rules: @@ -1182,7 +1275,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Missions d'entraînement (Pratiquez vos talents dans une série de missions d'entraînement). EN DÉVELOPPEMENT + Missions d'entraînement (Pratiquez vos talents dans une série de missions d'entraînement). EN DÉVELOPPEMENT Demos (Watch recorded demos) @@ -1194,7 +1287,26 @@ Campaign Mode (...). IN DEVELOPMENT - Mode Campagne (...). EN DÉVELOPPEMENT + Mode Campagne (...). EN DÉVELOPPEMENT + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1481,7 +1593,7 @@ This program is distributed under the GNU General Public License - Ce programme est distribué sous la licence GNU GPL (General Public License) + Ce programme est distribué sous la licence GNU GPL (General Public License) Resolution @@ -1652,10 +1764,6 @@ Rendu stéréo - Game Options - - - Style @@ -1671,6 +1779,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_hu.ts --- a/share/hedgewars/Data/Locale/hedgewars_hu.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_hu.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,24 +62,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 eltávolítva a figyelmen kívül hagyottak listájáról + %1 *** %2 eltávolítva a figyelmen kívül hagyottak listájáról %1 *** %2 has been added to your ignore list - %1 *** %2 hozzáadva a figyelmen kívül hagyottak listájához + %1 *** %2 hozzáadva a figyelmen kívül hagyottak listájához %1 *** %2 has been removed from your friends list - %1 *** %2 eltávolítva a barátlistáról + %1 *** %2 eltávolítva a barátlistáról %1 *** %2 has been added to your friends list - %1 *** %2 hozzáadva a barátlistádhoz + %1 *** %2 hozzáadva a barátlistádhoz + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -130,6 +182,40 @@ Demo name: + + Game aborted + + + + Password + JElszó + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + Becenév + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -256,7 +342,7 @@ Password - JElszó + JElszó Your nickname %1 is @@ -285,21 +371,11 @@ %1 *** %2 távozott - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - Nickname - Becenév - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Becenév + + + User quit @@ -357,7 +433,7 @@ Cancel - Mégse + Mégse @@ -478,6 +554,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -958,10 +1041,6 @@ Véletlen labirintus - State: - - - Rules: @@ -1155,7 +1234,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Gyakorlás (fejleszd magad a gyakorlóküldetéseken keresztül). FEJLESZTÉS ALATT + Gyakorlás (fejleszd magad a gyakorlóküldetéseken keresztül). FEJLESZTÉS ALATT Demos (Watch recorded demos) @@ -1166,7 +1245,22 @@ Betöltés (korábbi mentett állás visszatöltése) - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1462,7 +1556,7 @@ This program is distributed under the GNU General Public License - Ez a program a GNU General Public License alatt terjesztett + Ez a program a GNU General Public License alatt terjesztett Developers: @@ -1627,10 +1721,6 @@ - Game Options - - - Style @@ -1646,6 +1736,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_it.ts --- a/share/hedgewars/Data/Locale/hedgewars_it.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_it.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Quando questa opzione è attiva, la scelta di uno schema di gioco selezionerà automaticamente le armi appropriate + + Game Options + Opzioni di gioco + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 è stato rimosso dalla tua lista ignorati + %1 *** %2 è stato rimosso dalla tua lista ignorati %1 *** %2 has been added to your ignore list - %1 *** %2 è stato aggiunto alla tua lista ignorati + %1 *** %2 è stato aggiunto alla tua lista ignorati %1 *** %2 has been removed from your friends list - %1 *** %2 è stato rimosso dalla tua lista amici + %1 *** %2 è stato rimosso dalla tua lista amici %1 *** %2 has been added to your friends list - %1 *** %2 è stato aggiunto alla tua lista amici + %1 *** %2 è stato aggiunto alla tua lista amici + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,46 @@ Demo name: Nome della demo: + + Game aborted + + + + Password + Password + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Il nickname %1 è +registrato su Hedgewars.org +Per favore inserisci la tua password +o scegli un altro nickname: + + + No password supplied. + + + + Nickname + Nickname + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Qualcun altro sta usando + il tuo nickname %1 +sul server. +Per favore scelto un altro nickname: + + + No nickname supplied. + + HWGame @@ -261,7 +353,7 @@ Password - Password + Password Your nickname %1 is @@ -294,25 +386,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Il nickname %1 è + Il nickname %1 è registrato su Hedgewars.org Per favore inserisci la tua password o scegli un altro nickname: Nickname - Nickname + Nickname Some one already uses your nickname %1 on the server. Please pick another nickname: - Qualcun altro sta usando + Qualcun altro sta usando il tuo nickname %1 sul server. Per favore scelto un altro nickname: + + User quit + + KB @@ -368,7 +464,7 @@ Cancel - Annulla + Annulla @@ -501,6 +597,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -989,7 +1092,7 @@ State: - Stato: + Stato: Rules: @@ -1187,7 +1290,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Modalità Allenamento (Allena le tue abilità in una gamma di missioni). IN SVILUPPO + Modalità Allenamento (Allena le tue abilità in una gamma di missioni). IN SVILUPPO Demos (Watch recorded demos) @@ -1199,7 +1302,26 @@ Campaign Mode (...). IN DEVELOPMENT - Modalità Campagna. IN SVILUPPO + Modalità Campagna. IN SVILUPPO + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1392,7 +1514,7 @@ Top-Bottom - Dall'alto in basso + Dall'alto in basso Wiggle @@ -1490,7 +1612,7 @@ This program is distributed under the GNU General Public License - Questo programma è distribuito sotto licenza GNU General Public License + Questo programma è distribuito sotto licenza GNU General Public License Developers: @@ -1664,7 +1786,7 @@ Game Options - Opzioni di gioco + Opzioni di gioco Style @@ -1682,6 +1804,10 @@ % Get Away Time % tempo regalo + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_ja.ts --- a/share/hedgewars/Data/Locale/hedgewars_ja.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_ja.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,24 +62,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon このオプションを有効にして、しくみを選ぶと武器を自動選択 + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 さんは無視リストから削除されています + %1 *** %2 さんは無視リストから削除されています %1 *** %2 has been added to your ignore list - %1 *** %2 さんは無視リストに追加されています + %1 *** %2 さんは無視リストに追加されています %1 *** %2 has been removed from your friends list - %1 *** %2 さんは友達リストから削除されています + %1 *** %2 さんは友達リストから削除されています %1 *** %2 has been added to your friends list - %1 *** %2 さんは友達リストに追加されています + %1 *** %2 さんは友達リストに追加されています + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -130,6 +182,44 @@ Demo name: + + Game aborted + + + + Password + パスワード + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + あなたの「%1」というニック名は +Hedgewars.orgに登録されました。 +下にパスワードを入力して、または +ゲーム構成に別の名を選択してください: + + + + No password supplied. + + + + Nickname + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -256,7 +346,7 @@ Password - パスワード + パスワード %1 *** %2 has joined the room @@ -279,21 +369,14 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - あなたの「%1」というニック名は + あなたの「%1」というニック名は Hedgewars.orgに登録されました。 下にパスワードを入力して、または ゲーム構成に別の名を選択してください: - Nickname - - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + User quit @@ -343,7 +426,7 @@ Cancel - キャンセル + キャンセル @@ -452,6 +535,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -918,10 +1008,6 @@ - State: - - - Rules: @@ -1107,7 +1193,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - 訓練モード (訓練任務で上達) 開発中 + 訓練モード (訓練任務で上達) 開発中 Demos (Watch recorded demos) @@ -1118,7 +1204,22 @@ ロード (その前保存したゲームをやる) - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1410,7 +1511,7 @@ This program is distributed under the GNU General Public License - This program is distributed under the GNU General Public License + This program is distributed under the GNU General Public License Developers: @@ -1569,10 +1670,6 @@ - Game Options - - - Style @@ -1588,6 +1685,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_ko.ts --- a/share/hedgewars/Data/Locale/hedgewars_ko.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_ko.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,23 +62,59 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget - %1 *** %2 has been removed from your ignore list - - - - %1 *** %2 has been added to your ignore list - - - - %1 *** %2 has been removed from your friends list - - - - %1 *** %2 has been added to your friends list + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... @@ -126,6 +162,40 @@ Demo name: + + Game aborted + + + + Password + + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -251,10 +321,6 @@ - Password - - - %1 *** %2 has joined the room @@ -271,21 +337,7 @@ - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - - Nickname - - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + User quit @@ -333,10 +385,6 @@ Connecting... - - Cancel - - PageDrawMap @@ -440,6 +488,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -906,10 +961,6 @@ - State: - - - Rules: @@ -1094,10 +1145,6 @@ - Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - - - Demos (Watch recorded demos) @@ -1106,7 +1153,22 @@ - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1389,10 +1451,6 @@ - This program is distributed under the GNU General Public License - - - Developers: @@ -1549,10 +1607,6 @@ - Game Options - - - Style @@ -1568,6 +1622,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_lt.ts --- a/share/hedgewars/Data/Locale/hedgewars_lt.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_lt.ts Sat Nov 12 17:06:49 2011 +0100 @@ -4,12 +4,12 @@ AmmoSchemeModel - + new - + copy of @@ -17,18 +17,18 @@ DrawMapWidget - - + + File error - + Cannot open file '%1' for writing - + Cannot read file '%1' @@ -36,12 +36,12 @@ FreqSpinBox - + Never - + Every %1 turn @@ -53,27 +53,32 @@ GameCFGWidget - + + Game Options + + + + Edit schemes - + Edit weapons - + When this option is enabled selecting a game scheme will auto-select a weapon - + Error - + Illegal ammo scheme @@ -81,80 +86,161 @@ HWChatWidget - - %1 *** %2 has been removed from your ignore list - - - - - %1 *** %2 has been added to your ignore list - - - - - %1 *** %2 has been removed from your friends list - - - - - %1 *** %2 has been added to your friends list + + Kicking %1 ... + + + + + %1 has been removed from your ignore list + + + + + %1 has been added to your ignore list + + + + + %1 has been removed from your friends list + + + + + %1 has been added to your friends list + + + + + Stylesheet imported from %1 + + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + + Couldn't read %1 + + + + + StyleSheet discarded + + + + + StyleSheet saved to %1 + + + + + Failed to save StyleSheet to %1 + + + + + %1 is not a valid command! HWForm - - + + DefaultTeam - - + + Game aborted + + + + + Error + + Please select record from the list above + + + + + OK + + + + + Password + + + - Please select record from the list above - - - - - OK - - - - + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + + No password supplied. + + + + + Nickname + + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + + No nickname supplied. + + + + Unable to start the server - - + + Cannot save record to file %1 - + Hedgewars Demo File File Types - + Hedgewars Save File File Types - + Demo name - + Demo name: @@ -162,12 +248,12 @@ HWGame - + en.txt lt.txt - + Cannot open demofile %1 @@ -175,92 +261,92 @@ HWMapContainer - + Map - + Filter - + All - + Small - + Medium - + Large - + Cavern - + Wacky - + Type - + Small tunnels - + Medium tunnels - + Large tunnels - + Small floating islands - + Medium floating islands - + Large floating islands - + Themes - + Seed - + Set @@ -268,17 +354,17 @@ HWNetServersModel - + Title - + IP - + Port @@ -286,78 +372,57 @@ HWNewNet - + + User quit + + + + The host was not found. Please check the host name and port settings. - + Connection refused - + Room destroyed - + You got kicked - + %1 *** %2 has joined the room - + %1 *** %2 has joined - - + + %1 *** %2 has left - - + + %1 *** %2 has left (%3) - - Password - - - - - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - - + Quit reason: - - - Nickname - - - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: - - KB @@ -370,37 +435,37 @@ PageAdmin - + Fetch data - + Server message for latest version: - + Server message for previous versions: - + Latest version protocol number: - + MOTD preview: - + Clear Accounts Cache - + Set data @@ -408,57 +473,52 @@ PageConnecting - + Connecting... - - - Cancel - - PageDrawMap - + Undo - + Clear - + Load - + Save - + Load drawn map - - + + Drawn Maps - - + + All files - + Save drawn map @@ -466,12 +526,12 @@ PageEditTeam - + General - + Advanced @@ -479,27 +539,27 @@ PageGameStats - + Details - + Health graph - + Ranking - + The best shot award was won by <b>%1</b> with <b>%2</b> pts. - + The best killer is <b>%1</b> with <b>%2</b> kills in a turn. @@ -508,7 +568,7 @@ - + A total of <b>%1</b> hedgehog(s) were killed during this round. @@ -517,7 +577,7 @@ - + (%1 kill) @@ -526,7 +586,7 @@ - + <b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts. @@ -535,7 +595,7 @@ - + <b>%1</b> killed <b>%2</b> of his own hedgehogs. @@ -544,7 +604,7 @@ - + <b>%1</b> was scared and skipped turn <b>%2</b> times. @@ -554,312 +614,320 @@ + PageInGame + + + In game... + + + + PageMain - + Local Game (Play a game on a single computer) - + Network Game (Play a game across a network) - + Downloadable Content - + Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together. Tips - + Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water. Tips - + If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death! Tips - + Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo! Tips - + If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/. Tips - + You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked. Tips - + By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them. Tips - + Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support! Tips - + Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work! Tips - + Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like! Tips - + Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund! Tips - + From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance. Tips - + Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us! Tips - + Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux. Tips - + Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option. Tips - + Connect one or more gamepads before starting the game to be able to assign their controls to your teams. Tips - + Create an account on %1 to keep others from using your most favourite nickname while playing on the official server. Tips - + While playing you should give yourself a short break at least once an hour. Tips - + If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance. Tips - + If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers. Tips - + We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know! Tips - + Especially while playing online be polite and always remember there might be some minors playing with or against you as well! Tips - + Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game! Tips - + The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing. Tips - + You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead! Tips - + Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well. Tips - + No hedgehogs were harmed in making this game. Tips - + There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump. Tips - + Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving. Tips - + Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once. Tips - + Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this. Tips - + The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once. Tips - + The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well. Tips - + The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power. Tips - + Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water. Tips - + The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground. Tips - + If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion. Tips - + The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early. Tips - + The Flame Thrower is a weapon but it can be used for tunnel digging as well. Tips - + Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms. Tips - + Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits. Tips - + Like Hedgewars? Become a fan on %1 or follow us on %2! Tips - + Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online. Tips - + Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice! Tips - + Keep your video card drivers up to date to avoid issues playing the game. Tips - + You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser. Tips - + You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand. Tips - + You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand. Tips - + You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand. Tips @@ -868,7 +936,7 @@ PageMultiplayer - + Start @@ -876,12 +944,12 @@ PageNet - + Error - + Please select server from the list above @@ -889,22 +957,22 @@ PageNetGame - + Control - + Error - + Please enter room name - + OK @@ -912,12 +980,12 @@ PageNetType - + LAN game - + Official server @@ -925,52 +993,52 @@ PageOptions - + New team - + Edit team - + Delete team - + You can't edit teams from team selection. Go back to main menu to add, edit or delete teams. - + New scheme - + Edit scheme - + Delete scheme - + New weapon set - + Edit weapon set - + Delete weapon set @@ -978,42 +1046,42 @@ PagePlayDemo - - - - + + + + Error - - + + Please select record from the list - - + + OK - + Rename dialog - + Enter new file name: - + Cannot rename to - + Cannot delete file @@ -1021,69 +1089,64 @@ PageRoomsList - + Room Name: - - State: - - - - + Rules: - + Weapons: - + Search: - + Create - + Join - + Refresh - + Clear - + Admin features - + This game is in lobby. You may join and start playing once the game starts. - + This game is in progress. You may join and spectate now but you'll have to wait for the game to end to start playing. - + There are %1 clients connected to this room. @@ -1092,7 +1155,7 @@ - + There are %1 teams participating in this room. @@ -1101,70 +1164,70 @@ - + %1 is the host. He may adjust settings and start the game. - + Random Map - + Random Maze - + Games may be played on precreated or randomized maps. - + The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism. - + The Weapon Scheme defines available weapons and their ammunition count. - - + + Error - + Please enter room name - - + + OK - + Please select room from the list - + Warning - + The game you are trying to join has started. Do you still want to join the room? - + %1 players online @@ -1176,152 +1239,152 @@ PageScheme - + Defend your fort and destroy the opponents, two team colours max! - + Teams will start on opposite sides of the terrain, two team colours max! - + Land can not be destroyed! - + Add an indestructible border around the terrain - + Lower gravity - + Assisted aiming with laser sight - + All hogs have a personal forcefield - + All (living) hedgehogs are fully restored at the end of turn - + Gain 80% of the damage you do back in health - + Share your opponents pain, share their damage - + Your hogs are unable to move, put your artillery skills to the test - + Order of play is random instead of in room order. - + Play with a King. If he dies, your side dies. - + Take turns placing your hedgehogs before the start of play. - + Ammo is shared between all teams that share a colour. - + Disable girders when generating random maps. - + Disable land objects when generating random maps. - + AI respawns on death. - + Attacking does not end your turn. - + Weapons are reset to starting values each turn. - + Each hedgehog has its own ammo. It does not share with the team. - + You will not have to worry about wind anymore. - + Wind will affect almost everything. - + Teams in each clan take successive turns sharing their turn time. - + Add an indestructible border along the bottom - + Random - + Seconds - + Copy - + New - + Delete @@ -1329,22 +1392,22 @@ PageSelectWeapon - + Default - + New - + Copy - + Delete @@ -1352,97 +1415,110 @@ PageSinglePlayer - + Simple Game (a quick game against the computer, settings are chosen for you) - + Multiplayer (play a hotseat game against your friends, or AI teams) - - Campaign Mode (...). IN DEVELOPMENT - - - - - Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - - - - + + Campaign Mode (...) + + + + + Training Mode (Practice your skills in a range of training missions) + + + + Demos (Watch recorded demos) - + Load (Load a previously saved game) + PageTraining + + + No description available + + + + + Select a mission! + + + + QAction - + Info - + Kick - + Ban - + Follow - - + + Ignore - - + + Add friend - + Unignore - + Remove friend - + Update - + Restrict Joins - + Restrict Team Additions - + Start @@ -1450,62 +1526,62 @@ QCheckBox - + Show ammo menu tooltips - + Alternative damage show - + Append date and time to record file name - + Check for updates at startup - + Frontend fullscreen - + Frontend effects - + Enable frontend sounds - + Enable frontend music - + Fullscreen - + Enable sound - + Enable music - + Show FPS @@ -1513,142 +1589,140 @@ QComboBox - - - + + Mission - + generated map... - + generated maze... - + hand drawn map... - + Human - + Level - - + Community - + (System default) - + Disabled - + Red/Cyan - + Cyan/Red - + Red/Blue - + Blue/Red - + Red/Green - + Green/Red - + Side-by-side - + Top-Bottom - + Wiggle - + Red/Cyan grayscale - + Cyan/Red grayscale - + Red/Blue grayscale - + Blue/Red grayscale - + Red/Green grayscale - + Green/Red grayscale - - - + + + Any - + In lobby - + In progress @@ -1656,62 +1730,62 @@ QGroupBox - + Team Members - + Team Settings - + Fort - + Key binds - + Net game - + Teams - + Schemes and Weapons - + Misc - + Audio/Graphic options - + Game Modifiers - + Basic Settings - + Playing teams @@ -1719,243 +1793,238 @@ QLabel - + Version - - This program is distributed under the GNU General Public License - - - - + + This program is distributed under the GNU General Public License v2 + + + + Developers: - + Art: - + Sounds: - + Translations: - + Special thanks: - - Game Options - - - - + Style - + Scheme - - + + Weapons - + Host: - + Port: - + Name - + Type - + Grave - + Flag - + Voice - + Tip: - + This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk! - + Server name: - + Server port: - + Game scheme - + Net nick - + Password - + Locale - + Resolution - + Quality - + Stereo rendering - + Initial sound volume - + FPS limit - + Restart game to apply - + Damage Modifier - + Turn Time - + Initial Health - + Sudden Death Timeout - + Sudden Death Water Rise - + Sudden Death Health Decrease - + % Rope Length - + Crate Drops - + % Health Crates - + Health in Crates - + Mines Time - + Mines - + % Dud Mines - + Explosives - + % Get Away Time - + Scheme Name: @@ -1963,14 +2032,14 @@ QLineEdit - - + + unnamed - - + + hedgehog %1 @@ -1986,82 +2055,84 @@ QMessageBox - + + Teams - + + Really delete this team? - - + + Schemes - + Can not delete default scheme '%1'! - + Network - + Connection to server is lost - + All file associations have been set. - + File association failed. - + Error - + Failed to open data directory: %1 Please check your installation - + Really delete this game scheme? - - - + + + Weapons - + Can not overwrite default weapon set '%1'! - + Can not delete default weapon set '%1'! - + Really delete this weapon set? @@ -2069,27 +2140,27 @@ QObject - + Error - + Cannot create directory %1 - + OK - + Nickname - + Please enter your nickname @@ -2097,96 +2168,97 @@ QPushButton - - + + default - + OK - + Cancel - + more - - + + + Go! - + Random Team - - + + Setup - + Start server - + Connect - + Update - + Specify - + Ready - + Start - + Associate file extensions - - + + Play demo - + Rename - + Delete - + Load @@ -2194,37 +2266,37 @@ QTableWidget - + Room Name - + C - + T - + Owner - + Map - + Rules - + Weapons @@ -2232,34 +2304,34 @@ SelWeaponWidget - + Weapon set - + Probabilities - + Ammo in boxes - + Delays - - + + new - - + + copy of @@ -2267,18 +2339,18 @@ TCPBase - - + + Error - + Unable to start the server: %1. - + Unable to run engine: %1 ( @@ -2286,127 +2358,127 @@ ToggleButtonWidget - + Fort Mode - + Divide Teams - + Solid Land - + Add Border - + Low Gravity - + Laser Sight - + Invulnerable - + Reset Health - + Vampirism - + Karma - + Artillery - + Random Order - + King - + Place Hedgehogs - + Clan Shares Ammo - + Disable Girders - + Disable Land Objects - + AI Survival Mode - + Unlimited Attacks - + Reset Weapons - + Per Hedgehog Ammo - + Disable Wind - + More Wind - + Tag Team - + Add Bottom Border @@ -2728,44 +2800,44 @@ binds (keys) - + Axis - - + + (Up) - - + + (Down) - + Hat - + (Left) - + (Right) - + Button - + Keyboard diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_nl.ts --- a/share/hedgewars/Data/Locale/hedgewars_nl.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_nl.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,23 +63,59 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget - %1 *** %2 has been removed from your ignore list - - - - %1 *** %2 has been added to your ignore list - - - - %1 *** %2 has been removed from your friends list - - - - %1 *** %2 has been added to your friends list + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... @@ -127,6 +163,40 @@ Demo name: + + Game aborted + + + + Password + + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -252,10 +322,6 @@ - Password - - - Your nickname %1 is registered on Hedgewars.org Please provide your password @@ -282,21 +348,7 @@ - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - - Nickname - - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + User quit @@ -344,10 +396,6 @@ Connecting... - - Cancel - - PageDrawMap @@ -457,6 +505,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -925,10 +980,6 @@ - State: - - - Rules: @@ -1114,10 +1165,6 @@ - Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - - - Demos (Watch recorded demos) @@ -1126,7 +1173,22 @@ - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1409,10 +1471,6 @@ - This program is distributed under the GNU General Public License - - - Developers: @@ -1569,10 +1627,6 @@ - Game Options - - - Style @@ -1588,6 +1642,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_pl.ts --- a/share/hedgewars/Data/Locale/hedgewars_pl.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_pl.ts Sat Nov 12 17:06:49 2011 +0100 @@ -68,24 +68,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Kiedy ta opcja jest włączona, wybór ustawień gry zmienia uzbrojenie na odpowiednie + + Game Options + Opcje + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 został usunięty z listy ignorowanych + %1 *** %2 został usunięty z listy ignorowanych %1 *** %2 has been added to your ignore list - %1 *** %2 został dodany do listy ignorowanych + %1 *** %2 został dodany do listy ignorowanych %1 *** %2 has been removed from your friends list - %1 *** %2 został usunięty z listy przyjaciół + %1 *** %2 został usunięty z listy przyjaciół %1 *** %2 has been added to your friends list - %1 *** %2 został dodany do listy przyjaciół + %1 *** %2 został dodany do listy przyjaciół + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -136,6 +188,46 @@ Demo name: Nazwa demo: + + Game aborted + + + + Password + Hasło + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Twój nick %1 jest zarejestrowany +na Hedgewars.org +Proszę podać hasło bądź zmienić nick +w ustawieniach gry: + + + No password supplied. + + + + Nickname + Nick + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Ktoś właśnie używa +tego nicku %1 +na serwerze. +Przoszę wybrać nowy nick: + + + No nickname supplied. + + HWGame @@ -266,7 +358,7 @@ Password - Hasło + Hasło Your nickname %1 is @@ -299,25 +391,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Twój nick %1 jest zarejestrowany + Twój nick %1 jest zarejestrowany na Hedgewars.org Proszę podać hasło bądź zmienić nick w ustawieniach gry: Nickname - Nick + Nick Some one already uses your nickname %1 on the server. Please pick another nickname: - Ktoś właśnie używa + Ktoś właśnie używa tego nicku %1 na serwerze. Przoszę wybrać nowy nick: + + User quit + + KB @@ -373,7 +469,7 @@ Cancel - Anuluj + Anuluj @@ -518,6 +614,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1043,7 +1146,7 @@ State: - Stan: + Stan: Rules: @@ -1208,7 +1311,7 @@ Add an indestructible border along the bottom - >Dodaje niezniszczalną ramkę u dołu mapy + >Dodaje niezniszczalną ramkę u dołu mapy @@ -1242,7 +1345,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Trening (sprawdź swoje umiejętności podczas misji treningowych). W PRODUKCJI + Trening (sprawdź swoje umiejętności podczas misji treningowych). W PRODUKCJI Demos (Watch recorded demos) @@ -1254,7 +1357,26 @@ Campaign Mode (...). IN DEVELOPMENT - Kampania (...). W PRODUKCJI + Kampania (...). W PRODUKCJI + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1569,7 +1691,7 @@ QLabel This program is distributed under the GNU General Public License - Ten program jest rozprowadzany na zasadach powszechnej licencji publicznej GNU + Ten program jest rozprowadzany na zasadach powszechnej licencji publicznej GNU Developers: @@ -1761,7 +1883,7 @@ Game Options - Opcje + Opcje Style @@ -1779,6 +1901,10 @@ % Get Away Time Czas na ucieczkę w % + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_pt_BR.ts --- a/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Quando esta opção está habilitada a seleção de um esquema de jogo implicará em auto seleção do esquema de armas + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 foi removido da sua lista de ignorados + %1 *** %2 foi removido da sua lista de ignorados %1 *** %2 has been added to your ignore list - %1 *** %2 foi adicionado a sua lista de ignorados + %1 *** %2 foi adicionado a sua lista de ignorados %1 *** %2 has been removed from your friends list - %1 *** %2 foi removido da sua lista de amigos + %1 *** %2 foi removido da sua lista de amigos %1 *** %2 has been added to your friends list - %1 *** %2 foi adicionado a sua lista de amigos + %1 *** %2 foi adicionado a sua lista de amigos + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,43 @@ Demo name: + + Game aborted + + + + Password + Senha + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Seu apelido %1 é +registrado no Hedgewars.org +Por favor, forneça sua senha +ou escolha outro apelido: + + + No password supplied. + + + + Nickname + Apelido + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -258,7 +347,7 @@ Password - Senha + Senha Your nickname %1 is @@ -291,20 +380,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Seu apelido %1 é + Seu apelido %1 é registrado no Hedgewars.org Por favor, forneça sua senha ou escolha outro apelido: Nickname - Apelido - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + Apelido + + + User quit @@ -354,7 +440,7 @@ Cancel - Cancelar + Cancelar @@ -541,6 +627,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1065,7 +1158,7 @@ State: - Estado: + Estado: Rules: @@ -1263,7 +1356,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Modo de Treino (Pratique suas habilidades nas missões de treino). EM DESENVOLVIMENTO + Modo de Treino (Pratique suas habilidades nas missões de treino). EM DESENVOLVIMENTO Demos (Watch recorded demos) @@ -1275,7 +1368,26 @@ Campaign Mode (...). IN DEVELOPMENT - Modo Campanha (...) EM DESENVOLVIMENTO + Modo Campanha (...) EM DESENVOLVIMENTO + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1590,7 +1702,7 @@ QLabel This program is distributed under the GNU General Public License - Este programa é distribuido sob a Licensa Pública GNU + Este programa é distribuido sob a Licensa Pública GNU Developers: @@ -1775,10 +1887,6 @@ - Game Options - - - Style @@ -1794,6 +1902,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_pt_PT.ts --- a/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Com esta opção activada o esquema de jogo irá automaticamente seleccionar uma arma + + Game Options + Opções de Jogo + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 foi removido da tua Ignore List + %1 *** %2 foi removido da tua Ignore List %1 *** %2 has been added to your ignore list - %1 *** %2 foi adicionado à tua Ignore List + %1 *** %2 foi adicionado à tua Ignore List %1 *** %2 has been removed from your friends list - %1 *** %2 foi removido da tua lista de amigos + %1 *** %2 foi removido da tua lista de amigos %1 *** %2 has been added to your friends list - %1 *** %2 foi adicionado à tua lista de amigos + %1 *** %2 foi adicionado à tua lista de amigos + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,45 @@ Demo name: Nome do demo: + + Game aborted + + + + Password + Password + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + O nome de utilizador %1 está +registado em Hedgewars.org +Por favor digite a sua palavra passe ou escolha +outro nome de utilizador no menu de configuração: + + + No password supplied. + + + + Nickname + Nome de utilizador + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + O nome de utilizador %1 +já está a ser utilizado no servidor. +Por favor escolha outro nome de utilizador. + + + No nickname supplied. + + HWGame @@ -257,7 +348,7 @@ Password - Password + Password Your nickname %1 is @@ -290,24 +381,28 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - O nome de utilizador %1 está + O nome de utilizador %1 está registado em Hedgewars.org Por favor digite a sua palavra passe ou escolha outro nome de utilizador no menu de configuração: Nickname - Nome de utilizador + Nome de utilizador Some one already uses your nickname %1 on the server. Please pick another nickname: - O nome de utilizador %1 + O nome de utilizador %1 já está a ser utilizado no servidor. Por favor escolha outro nome de utilizador. + + User quit + + KB @@ -363,7 +458,7 @@ Cancel - Cancelar + Cancelar @@ -496,6 +591,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -980,7 +1082,7 @@ State: - Estado: + Estado: Rules: @@ -1174,7 +1276,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Modo de Treino (pratica as tuas capacidades numa variedade de missões de treino). EM DESENVOLVIMENTO + Modo de Treino (pratica as tuas capacidades numa variedade de missões de treino). EM DESENVOLVIMENTO Demos (Watch recorded demos) @@ -1186,7 +1288,26 @@ Campaign Mode (...). IN DEVELOPMENT - Modo Campanha (...) EM DESENVOLVIMENTO + Modo Campanha (...) EM DESENVOLVIMENTO + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1481,7 +1602,7 @@ This program is distributed under the GNU General Public License - Este programa é distribuído sob a GNU General Public License + Este programa é distribuído sob a GNU General Public License Developers: @@ -1641,7 +1762,7 @@ Game Options - Opções de Jogo + Opções de Jogo Style @@ -1659,6 +1780,10 @@ % Get Away Time % Tempo Para Retirar + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_ru.ts --- a/share/hedgewars/Data/Locale/hedgewars_ru.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_ru.ts Sat Nov 12 17:06:49 2011 +0100 @@ -68,24 +68,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon При включении этой опции выбор настроек игры автоматически выберет схему оружия + + Game Options + Настройки игры + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 был удалён из вашего списка игнорирования + %1 *** %2 был удалён из вашего списка игнорирования %1 *** %2 has been added to your ignore list - %1 *** %2 был добавлен в ваш список игнорирования + %1 *** %2 был добавлен в ваш список игнорирования %1 *** %2 has been removed from your friends list - %1 *** %2 был удалён из вашего списка друзей + %1 *** %2 был удалён из вашего списка друзей %1 *** %2 has been added to your friends list - %1 *** %2 был добавлен в ваш список друзей + %1 *** %2 был добавлен в ваш список друзей + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -136,6 +188,46 @@ Demo name: + + Game aborted + + + + Password + Пароль + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Ваше имя пользователя %1 +зарегистрировано на сайте hedgewars.org +Пожалуйста, укажите ваш пароль в поле ввода внизу +или выберите иное имя пользователя в настройках игры: + + + No password supplied. + + + + Nickname + Псевдоним + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Кто-то на этом сервере +уже использует +ваш псевдоним %1. +Выберите другой псевдоним: + + + No nickname supplied. + + HWGame @@ -262,7 +354,7 @@ Password - Пароль + Пароль Your nickname %1 is @@ -295,25 +387,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Ваше имя пользователя %1 + Ваше имя пользователя %1 зарегистрировано на сайте hedgewars.org Пожалуйста, укажите ваш пароль в поле ввода внизу или выберите иное имя пользователя в настройках игры: Nickname - Псевдоним + Псевдоним Some one already uses your nickname %1 on the server. Please pick another nickname: - Кто-то на этом сервере + Кто-то на этом сервере уже использует ваш псевдоним %1. Выберите другой псевдоним: + + User quit + + KB @@ -369,7 +465,7 @@ Cancel - Отмена + Отмена @@ -510,6 +606,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -995,7 +1098,7 @@ State: - Состояние: + Состояние: Rules: @@ -1194,7 +1297,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Тренировка (тренируйте своё мастерство в тренировочных миссиях) В РАЗРАБОТКЕ + Тренировка (тренируйте своё мастерство в тренировочных миссиях) В РАЗРАБОТКЕ Demos (Watch recorded demos) @@ -1206,7 +1309,26 @@ Campaign Mode (...). IN DEVELOPMENT - Режим прохождения кампании. В РАЗРАБОТКЕ + Режим прохождения кампании. В РАЗРАБОТКЕ + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1501,7 +1623,7 @@ This program is distributed under the GNU General Public License - Эта программа распространяется на условиях лицензии GNU (the GNU General Public License) + Эта программа распространяется на условиях лицензии GNU (the GNU General Public License) Resolution @@ -1671,7 +1793,7 @@ Game Options - Настройки игры + Настройки игры Style @@ -1689,6 +1811,10 @@ % Get Away Time % времени ухода + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_sk.ts --- a/share/hedgewars/Data/Locale/hedgewars_sk.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_sk.ts Sat Nov 12 17:06:49 2011 +0100 @@ -68,24 +68,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Keď je vybraná táto voľba výberom hernej schémy vyberiete automaticky aj zbraň + + Game Options + Voľby hry + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 bol(a) odstránený(á) zo zoznamu ignorovaných + %1 *** %2 bol(a) odstránený(á) zo zoznamu ignorovaných %1 *** %2 has been added to your ignore list - %1 *** %2 bol(a) pridaný(á) do zoznamu ignorovaných + %1 *** %2 bol(a) pridaný(á) do zoznamu ignorovaných %1 *** %2 has been removed from your friends list - %1 *** %2 bol(a) odstránený(á) zo zoznamu priateľov + %1 *** %2 bol(a) odstránený(á) zo zoznamu priateľov %1 *** %2 has been added to your friends list - %1 *** %2 bol(a) pridaný(á) do zoznamu priateľov + %1 *** %2 bol(a) pridaný(á) do zoznamu priateľov + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -136,6 +188,48 @@ Demo name: + + Game aborted + + + + Password + Heslo + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Prezývka %1, ktorú ste +si vybrali je registrovaná na +Hedgewars.org. +Prosím, napíšte heslo do poľa +nižšie alebo si zvoľte inú prezývku +v nastaveniach hry: + + + No password supplied. + + + + Nickname + Prezývka + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Niekto už používa +vašu prezývku %1 +na serveri. +Prosím vyberte si inú prezývku: + + + No nickname supplied. + + HWGame @@ -262,7 +356,7 @@ Password - Heslo + Heslo Your nickname %1 is @@ -295,7 +389,7 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Prezývka %1, ktorú ste + Prezývka %1, ktorú ste si vybrali je registrovaná na Hedgewars.org. Prosím, napíšte heslo do poľa @@ -304,18 +398,22 @@ Nickname - Prezývka + Prezývka Some one already uses your nickname %1 on the server. Please pick another nickname: - Niekto už používa + Niekto už používa vašu prezývku %1 na serveri. Prosím vyberte si inú prezývku: + + User quit + + KB @@ -371,7 +469,7 @@ Cancel - Zrušiť + Zrušiť @@ -516,6 +614,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1036,7 +1141,7 @@ State: - Stav: + Stav: Rules: @@ -1235,7 +1340,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Tréningový režim (vylepšujte si svoje zručnosti v rade tréningových misií). VO VÝVOJI + Tréningový režim (vylepšujte si svoje zručnosti v rade tréningových misií). VO VÝVOJI Demos (Watch recorded demos) @@ -1247,7 +1352,26 @@ Campaign Mode (...). IN DEVELOPMENT - Režim kampane (...) VO VÝVOJI + Režim kampane (...) VO VÝVOJI + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1570,7 +1694,7 @@ This program is distributed under the GNU General Public License - Tento program je distribuovaný podľa podmienok GNU General Publice License + Tento program je distribuovaný podľa podmienok GNU General Publice License Developers: @@ -1749,7 +1873,7 @@ Game Options - Voľby hry + Voľby hry Style @@ -1767,6 +1891,10 @@ % Get Away Time % času na útek + + This program is distributed under the GNU General Public License v2 + + QLineEdit @@ -2140,7 +2268,7 @@ Add Bottom Border - Pridať spodný okraj + diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_sv.ts --- a/share/hedgewars/Data/Locale/hedgewars_sv.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_sv.ts Sat Nov 12 17:06:49 2011 +0100 @@ -63,24 +63,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon När det här valet är aktivt kommer vapnen att ändras när du ändrar spelschema + + Game Options + Spelinställningar + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 har tagits bort från din ignoreringslista + %1 *** %2 har tagits bort från din ignoreringslista %1 *** %2 has been added to your ignore list - %1 *** %2 har lagts till i din ignoreringslista + %1 *** %2 har lagts till i din ignoreringslista %1 *** %2 has been removed from your friends list - %1 *** %2 har tagits bort från din kompislista + %1 *** %2 har tagits bort från din kompislista %1 *** %2 has been added to your friends list - %1 *** %2 har lagts till i din kompislista + %1 *** %2 har lagts till i din kompislista + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -131,6 +183,46 @@ Demo name: Demonamn: + + Game aborted + + + + Password + Lösenord + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Ditt smeknamn (%1) är +registrerat på Hedgewars.org +Var god ange ditt lösenord eller välj +ett annat smeknamn i spelinställningarna: + + + No password supplied. + + + + Nickname + Smeknamn + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Någon använder redan +ditt smeknamn %1 +på servern. +Välj ett annat smeknamn: + + + No nickname supplied. + + HWGame @@ -257,7 +349,7 @@ Password - Lösenord + Lösenord Your nickname %1 is @@ -290,25 +382,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Ditt smeknamn (%1) är + Ditt smeknamn (%1) är registrerat på Hedgewars.org Var god ange ditt lösenord eller välj ett annat smeknamn i spelinställningarna: Nickname - Smeknamn + Smeknamn Some one already uses your nickname %1 on the server. Please pick another nickname: - Någon använder redan + Någon använder redan ditt smeknamn %1 på servern. Välj ett annat smeknamn: + + User quit + + KB @@ -364,7 +460,7 @@ Cancel - Avbryt + Avbryt @@ -501,6 +597,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1009,7 +1112,7 @@ State: - Status: + Status: Rules: @@ -1207,7 +1310,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Träningsläge (öva dina färdigheter i en rad träningsuppdrag). UNDER UTVECKLING + Träningsläge (öva dina färdigheter i en rad träningsuppdrag). UNDER UTVECKLING Demos (Watch recorded demos) @@ -1219,7 +1322,26 @@ Campaign Mode (...). IN DEVELOPMENT - Kampanjläge (...). UNDER UTVECKLING + Kampanjläge (...). UNDER UTVECKLING + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1534,7 +1656,7 @@ QLabel This program is distributed under the GNU General Public License - Detta program distribueras under GNU General Public License + Detta program distribueras under GNU General Public License Developers: @@ -1716,7 +1838,7 @@ Game Options - Spelinställningar + Spelinställningar Style @@ -1734,6 +1856,10 @@ % Get Away Time % flykttid + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_tr_TR.ts --- a/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,23 +62,59 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget - %1 *** %2 has been removed from your ignore list + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list - %1 *** %2 has been added to your ignore list + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - %1 *** %2 has been removed from your friends list + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 - %1 *** %2 has been added to your friends list + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... @@ -130,6 +166,40 @@ Demo name: + + Game aborted + + + + Password + Parola + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -256,7 +326,7 @@ Password - Parola + Parola %1 *** %2 has joined the room @@ -275,21 +345,7 @@ - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - - Nickname - - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + User quit @@ -347,7 +403,7 @@ Cancel - İptal + İptal @@ -456,6 +512,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -922,10 +985,6 @@ - State: - - - Rules: @@ -1119,7 +1178,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Talim Modu (Bir takım talimlere katılarak kirpilerinizi eğitin). YAPIM AŞAMASINDA + Talim Modu (Bir takım talimlere katılarak kirpilerinizi eğitin). YAPIM AŞAMASINDA Demos (Watch recorded demos) @@ -1130,7 +1189,22 @@ Yükle (Kaydedilmiş bir oyunu yükleyin) - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1422,7 +1496,7 @@ This program is distributed under the GNU General Public License - Bu program GNU Genel Kamu Lisansı'yla dağıtılmaktadır + Bu program GNU Genel Kamu Lisansı'yla dağıtılmaktadır Developers: @@ -1581,10 +1655,6 @@ - Game Options - - - Style @@ -1600,6 +1670,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_uk.ts --- a/share/hedgewars/Data/Locale/hedgewars_uk.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_uk.ts Sat Nov 12 17:06:49 2011 +0100 @@ -64,24 +64,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon Коли ввімкнена ця опція при виборі схеми гри зброя буде вибрана автоматично + + Game Options + Параметри гри + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 був видалений з вашого списку ігнорування + %1 *** %2 був видалений з вашого списку ігнорування %1 *** %2 has been added to your ignore list - %1 *** %2 був доданий до вашого списку ігнорування + %1 *** %2 був доданий до вашого списку ігнорування %1 *** %2 has been removed from your friends list - %1 *** %2 був видалений з вашого списку друзів + %1 *** %2 був видалений з вашого списку друзів %1 *** %2 has been added to your friends list - %1 *** %2 був доданий до вашого списку друзів + %1 *** %2 був доданий до вашого списку друзів + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -132,6 +184,46 @@ Demo name: + + Game aborted + + + + Password + Пароль + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + Ваш нік %1 вже +зареєстрований на Hedgewars.org +Введіть ваш пароль нижче або +виберіть інший нік в налаштуваннях гри: + + + No password supplied. + + + + Nickname + + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + Хтось вже використовує + нікнейм %1 +на сервері. +Виберіть інший нікнейм: + + + No nickname supplied. + + HWGame @@ -258,7 +350,7 @@ Password - Пароль + Пароль Your nickname %1 is @@ -291,25 +383,29 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - Ваш нік %1 вже + Ваш нік %1 вже зареєстрований на Hedgewars.org Введіть ваш пароль нижче або виберіть інший нік в налаштуваннях гри: Nickname - Нікнейм + Нікнейм Some one already uses your nickname %1 on the server. Please pick another nickname: - Хтось вже використовує + Хтось вже використовує нікнейм %1 на сервері. Виберіть інший нікнейм: + + User quit + + KB @@ -365,7 +461,7 @@ Cancel - Скасувати + Скасувати @@ -506,6 +602,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -991,7 +1094,7 @@ State: - Стан: + Стан: Rules: @@ -1190,7 +1293,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - Режим Навчання (практика в цілому ряді навчальних місій). В РОЗРОБЦІ + Режим Навчання (практика в цілому ряді навчальних місій). В РОЗРОБЦІ Demos (Watch recorded demos) @@ -1202,7 +1305,26 @@ Campaign Mode (...). IN DEVELOPMENT - Режим Кампанії (...). В РОЗРОБЦІ + Режим Кампанії (...). В РОЗРОБЦІ + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1497,7 +1619,7 @@ This program is distributed under the GNU General Public License - Ця программа розповсюджується на умовах ліцензії GNU General Public License + Ця программа розповсюджується на умовах ліцензії GNU General Public License Developers: @@ -1657,7 +1779,7 @@ Game Options - Параметри гри + Параметри гри Style @@ -1675,6 +1797,10 @@ % Get Away Time % Час Тікати + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_zh_CN.ts --- a/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,24 +62,76 @@ When this option is enabled selecting a game scheme will auto-select a weapon 使用此项则游戏框架自动选择武器配备 + + Game Options + + HWChatWidget %1 *** %2 has been removed from your ignore list - %1 *** %2 已经从您的忽略列表中移除 + %1 *** %2 已经从您的忽略列表中移除 %1 *** %2 has been added to your ignore list - %1 *** %2 已经添加到您的忽略列表中 + %1 *** %2 已经添加到您的忽略列表中 %1 *** %2 has been removed from your friends list - %1 *** %2 已经从您的朋友列表中移除 + %1 *** %2 已经从您的朋友列表中移除 %1 *** %2 has been added to your friends list - %1 *** %2 已经添加到您的朋友列表中 + %1 *** %2 已经添加到您的朋友列表中 + + + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list + + + + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! + + + + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 + + + + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... + @@ -130,6 +182,43 @@ Demo name: + + Game aborted + + + + Password + 密码 + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + 您的昵称%1 +在Hedgewars.org已注册 +请输入您的密码 +或从游戏配置中选择另一个昵称: + + + No password supplied. + + + + Nickname + 昵称 + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -256,7 +345,7 @@ Password - 密码 + 密码 Your nickname %1 is @@ -289,20 +378,17 @@ registered on Hedgewars.org Please provide your password below or pick another nickname in game config: - 您的昵称%1 + 您的昵称%1 在Hedgewars.org已注册 请输入您的密码 或从游戏配置中选择另一个昵称: Nickname - 昵称 - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + 昵称 + + + User quit @@ -360,7 +446,7 @@ Cancel - 取消 + 取消 @@ -489,6 +575,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -1015,7 +1108,7 @@ State: - 游戏状态 + 游戏状态 Rules: @@ -1212,7 +1305,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - 训练模式 (一系列训练任务)。开发中 + 训练模式 (一系列训练任务)。开发中 Demos (Watch recorded demos) @@ -1224,7 +1317,26 @@ Campaign Mode (...). IN DEVELOPMENT - 战役模式 ——开发中 + 战役模式 ——开发中 + + + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! + @@ -1539,7 +1651,7 @@ This program is distributed under the GNU General Public License - This program is distributed under the GNU General Public License + This program is distributed under the GNU General Public License Resolution @@ -1710,10 +1822,6 @@ - Game Options - - - Style @@ -1729,6 +1837,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/hedgewars_zh_TW.ts --- a/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts Sat Nov 12 17:06:49 2011 +0100 @@ -62,23 +62,59 @@ When this option is enabled selecting a game scheme will auto-select a weapon + + Game Options + + HWChatWidget - %1 *** %2 has been removed from your ignore list + %1 has been removed from your ignore list + + + + %1 has been added to your ignore list + + + + %1 has been removed from your friends list - %1 *** %2 has been added to your ignore list + %1 has been added to your friends list + + + + Stylesheet imported from %1 + + + + Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset! - %1 *** %2 has been removed from your friends list + Couldn't read %1 + + + + StyleSheet discarded + + + + StyleSheet saved to %1 - %1 *** %2 has been added to your friends list + Failed to save StyleSheet to %1 + + + + %1 is not a valid command! + + + + Kicking %1 ... @@ -130,6 +166,40 @@ Demo name: + + Game aborted + + + + Password + 密碼 + + + Your nickname %1 is +registered on Hedgewars.org +Please provide your password below +or pick another nickname in game config: + + + + No password supplied. + + + + Nickname + 匿稱 + + + Some one already uses + your nickname %1 +on the server. +Please pick another nickname: + + + + No nickname supplied. + + HWGame @@ -256,7 +326,7 @@ Password - 密碼 + 密碼 Your nickname %1 is @@ -285,21 +355,11 @@ %1***%2已經離開 - Your nickname %1 is -registered on Hedgewars.org -Please provide your password below -or pick another nickname in game config: - - - Nickname - 匿稱 - - - Some one already uses - your nickname %1 -on the server. -Please pick another nickname: + 匿稱 + + + User quit @@ -357,7 +417,7 @@ Cancel - 取消 + 取消 @@ -478,6 +538,13 @@ + PageInGame + + In game... + + + + PageMain Local Game (Play a game on a single computer) @@ -946,10 +1013,6 @@ - State: - - - Rules: @@ -1143,7 +1206,7 @@ Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT - 訓練模式 (一系列訓練任務)。開發中 + 訓練模式 (一系列訓練任務)。開發中 Demos (Watch recorded demos) @@ -1154,7 +1217,22 @@ 讀取 (讀取之前保存的遊戲) - Campaign Mode (...). IN DEVELOPMENT + Campaign Mode (...) + + + + Training Mode (Practice your skills in a range of training missions) + + + + + PageTraining + + No description available + + + + Select a mission! @@ -1442,7 +1520,7 @@ This program is distributed under the GNU General Public License - This program is distributed under the GNU General Public License + This program is distributed under the GNU General Public License Resolution @@ -1609,10 +1687,6 @@ - Game Options - - - Style @@ -1628,6 +1702,10 @@ % Get Away Time + + This program is distributed under the GNU General Public License v2 + + QLineEdit diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/missions_de.txt --- a/share/hedgewars/Data/Locale/missions_de.txt Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Locale/missions_de.txt Sat Nov 12 17:06:49 2011 +0100 @@ -5,9 +5,9 @@ Basic_Training_-_Grenade.desc="Vergiss nicht: Stift ziehen UND werfen!" Basic_Training_-_Shotgun.name=Training: Schrotflinte - Grundlagen -Basic_Training_-_Shotgun.desc="Zuerst schieen, dann fragen!" +Basic_Training_-_Shotgun.desc="Zuerst schießen, dann fragen!" -Basic_Training_-_Sniper_Rifle.name=Training: Scharfschtzengewehr - Grundlagen +Basic_Training_-_Sniper_Rifle.name=Training: Scharfschützengewehr - Grundlagen Basic_Training_-_Sniper_Rifle.desc="Boom, headshot!" User_Mission_-_Dangerous_Ducklings.name=Mission: Dangerous Ducklings @@ -20,13 +20,13 @@ User_Mission_-_Teamwork.desc="Ab und zu... tut Liebe weh." User_Mission_-_Spooky_Tree.name=Mission: Spukiger Baum -User_Mission_-_Spooky_Tree.desc="Viele Kisten hier drauen. Ich hoffe jedenfalls, dass dieser Vogel hier nicht hungrig wird." +User_Mission_-_Spooky_Tree.desc="Viele Kisten hier draußen. Ich hoffe jedenfalls, dass dieser Vogel hier nicht hungrig wird." User_Mission_-_Bamboo_Thicket.name=Mission: Bambusdickicht User_Mission_-_Bamboo_Thicket.desc="Tod von oben." User_Mission_-_That_Sinking_Feeling.name=Mission: That Sinking Feeling -User_Mission_-_That_Sinking_Feeling.desc="Hier steht einen das Wasser ganz schn schnell bis zu Hals. Viele sind hieran gescheitert. Kannst du alle Igel retten?" +User_Mission_-_That_Sinking_Feeling.desc="Hier steht einen das Wasser ganz schön schnell bis zu Hals. Viele sind hieran gescheitert. Kannst du alle Igel retten?" -User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton und die Hngematte -User_Mission_-_Newton_and_the_Hammock.desc="Nicht vergessen Igelinge: Die Geschwindigkeit eines Krpers bleibt konstant, es sei denn es wirkt eine uere Kraft wird auf ihn ein! +User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton und die Hängematte +User_Mission_-_Newton_and_the_Hammock.desc="Nicht vergessen Igelinge: Die Geschwindigkeit eines Körpers bleibt konstant, es sei denn es wirkt eine äußere Kraft wird auf ihn ein!" diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Locale/missions_ru.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Locale/missions_ru.txt Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,32 @@ +Basic_Training_-_Bazooka.name=Базовое упражнение с базукой +Basic_Training_-_Bazooka.desc="Ключевой момент - использование ветра с пользой для себя!" + +Basic_Training_-_Grenade.name=Базовое упражнение с гранатой +Basic_Training_-_Grenade.desc="Запомни: выдерни чеку и бросай!" + +Basic_Training_-_Shotgun.name=Базовое упражнение с ружьём +Basic_Training_-_Shotgun.desc="Стреляй, все вопросы потом!" + +Basic_Training_-_Sniper_Rifle.name=Базовое упражнение со снайперской винтовкой +Basic_Training_-_Sniper_Rifle.desc="БАХ, в яблочко!" + +User_Mission_-_Dangerous_Ducklings.name=Миссия: Dangerous Ducklings +User_Mission_-_Dangerous_Ducklings.desc="Ну что, новобранцы! Пора на практике проверить, чему вы научились на базовых упражнениях!" + +User_Mission_-_Diver.name=Миссия: Ныряльщик +User_Mission_-_Diver.desc="This 'amphibious assault' thing is harder than it looks..." + +User_Mission_-_Teamwork.name=Миссия: Командная работа +User_Mission_-_Teamwork.desc="Иногда любовь ранит." + +User_Mission_-_Spooky_Tree.name=Миссия: Зловещее дерево +User_Mission_-_Spooky_Tree.desc="Здесь много ящиков. Конечно, я уверен, что эта птица не голодна." + +User_Mission_-_Bamboo_Thicket.name=Миссия: Bamboo Thicket +User_Mission_-_Bamboo_Thicket.desc="Смерть приходит сверху." + +User_Mission_-_That_Sinking_Feeling.name=Миссия: That Sinking Feeling +User_Mission_-_That_Sinking_Feeling.desc="Вода быстро поднимается, а время ограничено. Многие пытались без успеха. Сможешь ли ты спасти всех?" + +User_Mission_-_Newton_and_the_Hammock.name=Миссия: Ньютон и гамак +User_Mission_-_Newton_and_the_Hammock.desc="Ежата, запомните: Скорость тела остаётся постоянной, пока к нему не применяется внешняя сила!" diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sat Nov 12 17:06:49 2011 +0100 @@ -1,6 +1,6 @@ ------------------------------------------ --- RACER 0.4 +-- RACER 0.5 -- map-independant racing script -- by mikade ----------------------------------------- @@ -52,6 +52,15 @@ -- update user feedback -- add more sounds +------- +-- 0.5 +------- + +-- fix ghost disappearing if hog falls in water or somehow dies +-- lengthen ghost tracking interval to improve performance on slower machines +-- increase waypoint limit to 8 +-- allow for persistent showmission information + ----------------------------- -- SCRIPT BEGINS ----------------------------- @@ -116,7 +125,11 @@ local wpActive = {} local wpRad = 450 --75 local wpCount = 0 -local wpLimit = 5 +local wpLimit = 8 + +local roundN +local lastRound +local RoundHasChanged ------------------- -- general methods @@ -317,31 +330,50 @@ end +function onNewRound() + + roundNumber = roundNumber + 1 + + totalComment = "" + for i = 0, (TeamsCount-1) do + if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] + teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") + totalComment = totalComment .. teamComment[i] + elseif teamNameArr[i] == " " then + teamComment[i] = "|" + end + end + + ShowMission( loc("RACER"), + loc("STATUS UPDATE"), + loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. + loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) + + -- end game if its at round limit + if roundNumber == roundLimit then + for i = 0, (numhhs-1) do + if GetHogClan(hhs[i]) ~= bestClan then + SetEffect(hhs[i], heResurrectable, false) + SetHealth(hhs[i],0) + end + end + gameOver = true + TurnTimeLeft = 1 + end + +end + function CheckForNewRound() - if GetHogClan(CurrentHedgehog) == firstClan then - - roundNumber = roundNumber + 1 + ------------- + ------ new + ------------- - totalComment = "" - for i = 0, (TeamsCount-1) do - if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] - teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") - totalComment = totalComment .. teamComment[i] - elseif teamNameArr[i] == " " then - teamComment[i] = "|" - end - end - - ShowMission( loc("RACER"), - loc("STATUS UPDATE"), - loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. - loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) - - -- end game if its at round limit - if roundNumber == roundLimit then + --[[turnN = turnN + 1 + if gameBegun == false then + if turnN == 2 then for i = 0, (numhhs-1) do - if GetHogClan(hhs[i]) ~= bestClan then + if hhs[i] ~= nil then SetEffect(hhs[i], heResurrectable, false) SetHealth(hhs[i],0) end @@ -349,7 +381,39 @@ gameOver = true TurnTimeLeft = 1 end + else + + end]] + + --[[if roundBegun == true then + + if RoundHasChanged == true then + roundN = roundN + 1 + RoundHasChanged = false + onNewRound() + end + + if lastRound ~= TotalRounds then -- new round, but not really + + if RoundHasChanged == false then + RoundHasChanged = true + end + + end + + AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) + + lastRound = TotalRounds + + end]] + + ------------ + ----- old + ------------ + + if GetHogClan(CurrentHedgehog) == firstClan then + onNewRound() end end @@ -402,6 +466,11 @@ function onGameStart() + + roundN = 0 + lastRound = TotalRounds + RoundHasChanged = false -- true + RebuildTeamInfo() ShowMission ( @@ -413,8 +482,6 @@ "", 4, 4000 ) - - end function PlaceWayPoint(x,y) @@ -490,7 +557,7 @@ -- airstrike detected, convert this into a potential waypoint spot if cGear ~= nil then x,y = GetGearTarget(cGear) - + DeleteGear(cGear) if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then @@ -525,7 +592,8 @@ SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) FollowGear(CurrentHedgehog) - ShowMission("...", "...", "...", 2, 1) + + HideMission() else -- still in placement mode @@ -546,7 +614,7 @@ --ghost gTimer = gTimer + 1 - if gTimer == 15 then + if gTimer == 40 then gTimer = 0 HandleGhost() end @@ -584,6 +652,10 @@ AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) + if gear == CurrentHedgehog then + DisableTumbler() + end + -- if the player stops and "dies" or flies into water, stop him racing --[[if gear == CurrentHedgehog then DisableTumbler() diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Sat Nov 12 17:06:49 2011 +0100 @@ -5,7 +5,7 @@ --------------------------------------------------- --------------------------------------------------- --------------------------------------------------- ---- Space Invasion Code Follows (0.9) +--- Space Invasion Code Follows (1.0) --------------------------------------------------- --------------------------------------------------- -- VERSION HISTORY @@ -86,7 +86,7 @@ -- Boss Slayer (Destroy 2 blue circles for +25 points) -- Shield Master (disolve 5 shells for +10 points) --- Shield Miser (don't use your shield at all (2.5*roundkills)+2 points) +-- Shield Miser (don't use your shield at all (3.5*roundkills)+2 points) -- Depleted Kamikaze! (kamikaze into a blue/red circ when you are out of ammo) 5pts -- Timed Kamikaze! (kamikaze into a blue/red circ when you only have 5s left) 10pts @@ -122,6 +122,16 @@ -- experimental radar (it's INTERACTIVE and math-heavy :D) (visual gears are safe... right? D:) -- bugfix and balance for multishot +------------------------ +-- version 1.0 +------------------------ + +-- if only version numbers actually worked like this, wouldn't that be awful :D + +-- added surfer achievement +-- increased value of shield miser by 1 point per kill (OP?) + + -------------------------- --notes for later -------------------------- @@ -152,6 +162,7 @@ AddCaption(LOC_NOT("BOOM! +50 points!"),0xffba00ff,capgrpVolume) AddCaption(LOC_NOT("BOOM! BOOM! BOOM! +100 points!"),0xffba00ff,capgrpVolume) AddCaption(LOC_NOT("Accuracy Bonus! +15 points!"),0xffba00ff,capgrpVolume) +AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume) ----------------- capgrpMessage @@ -207,6 +218,10 @@ local sdName = {} local sdKills = {} +local roundN = 0 +local lastRound +local RoundHasChanged = true + -------------------------- -- hog and team tracking variales -------------------------- @@ -223,6 +238,7 @@ local teamComment = {} local teamScore = {} local teamCircsKilled = {} +local teamSurfer = {} -- stats variables --local teamRed = {} @@ -240,6 +256,7 @@ local chainLength = 0 local shotsFired = 0 local shotsHit = 0 +local SurfTime = 0 --------------------- -- tumbler goods @@ -382,6 +399,7 @@ teamIndex[i] = 0 teamScore[i] = 0 teamCircsKilled[i] = 0 + teamSurfer[i] = false end numTeams = 0 @@ -445,7 +463,7 @@ function AwardKills(t) roundKills = roundKills + 1 - + for i = 0,(TeamsCount-1) do if teamClan[i] == GetHogClan(CurrentHedgehog) then teamCircsKilled[i] = teamCircsKilled[i] + 1 @@ -533,36 +551,66 @@ end +function onNewRound() + roundNumber = roundNumber + 1 + + CommentOnScore() + + -- end game if its at round limit + if roundNumber == roundLimit then + + for i = 0, (TeamsCount-1) do + if teamScore[i] > bestScore then + bestScore = teamScore[i] + bestClan = teamClan[i] + end + end + + for i = 0, (numhhs-1) do + if GetHogClan(hhs[i]) ~= bestClan then + SetEffect(hhs[i], heResurrectable, false) + SetHealth(hhs[i],0) + end + end + gameOver = true + TurnTimeLeft = 0 --1 + TimeLeft = 0 + end +end + -- gaudy racer function CheckForNewRound() + ---------- + -- new + ---------- + + --[[if gameBegun == true then + + if RoundHasChanged == true then + roundN = roundN + 1 + RoundHasChanged = false + onNewRound() + end + + if lastRound ~= TotalRounds then -- new round, but not really + + if RoundHasChanged == false then + RoundHasChanged = true + end + + end + + --AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) + lastRound = TotalRounds + + end]] + + ---------- + -- old + ---------- if GetHogClan(CurrentHedgehog) == firstClan then - - roundNumber = roundNumber + 1 - - CommentOnScore() - - -- end game if its at round limit - if roundNumber == roundLimit then - - for i = 0, (TeamsCount-1) do - if teamScore[i] > bestScore then - bestScore = teamScore[i] - bestClan = teamClan[i] - end - end - - for i = 0, (numhhs-1) do - if GetHogClan(hhs[i]) ~= bestClan then - SetEffect(hhs[i], heResurrectable, false) - SetHealth(hhs[i],0) - end - end - gameOver = true - TurnTimeLeft = 0 --1 - TimeLeft = 0 - end - + onNewRound() end end @@ -730,7 +778,7 @@ function onHJump() - if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) and + if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) and (rAlpha == 255) and (radShotsLeft > 0) then rPingTimer = 0 rAlpha = 0 @@ -833,6 +881,7 @@ CreateMeSomeCircles() RebuildTeamInfo() -- control + lastRound = TotalRounds end @@ -867,6 +916,7 @@ shotsHit = 0 chainLength = 0 chainCounter = 0 + SurfTime = 12 ------------------------- -- gaudy racer @@ -1024,12 +1074,8 @@ --nw WriteLnToConsole("Player is out of luck") if shieldMiser == true then - - p = (roundKills*2.5) - ((roundKills*2.5)%1) + 2 - --p = (roundKills*2.5) + 2 - --if (p%2 ~= 0) then - -- p = p -0.5 - --end + + p = (roundKills*3.5) - ((roundKills*3.5)%1) + 2 AddCaption(loc("Shield Miser!") .." +" .. p .." ".. loc("points") .. "!",0xffba00ff,capgrpAmmoinfo) AwardPoints(p) @@ -1073,6 +1119,30 @@ -------------- -------------- + ------------------------ + -- surfer achievement + ------------------------ + + if (WaterLine - GetY(CurrentHedgehog)) < 15 then + SurfTime = SurfTime -1 + end + + if SurfTime ~= 12 then + + SurfTime = SurfTime - 1 + if SurfTime <= 0 then + for i = 0,(TeamsCount-1) do + if teamClan[i] == GetHogClan(CurrentHedgehog) and (teamSurfer[i] == false) then + teamSurfer[i] = true + SurfTime = 12 + AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume) + AwardPoints(15) + end + end + end + end + + dx, dy = GetGearVelocity(CurrentHedgehog) --WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy) @@ -1123,7 +1193,7 @@ end --WriteLnToConsole("End of GameTick") - + end function onGearResurrect(gear) @@ -1211,31 +1281,31 @@ function DoHorribleThings(cUID) - -- maybe + -- maybe -- add a check to draw it inside the circ and not past it if -- it is closer than 150 or w/e - -- work out the distance to the target + -- work out the distance to the target g1X, g1Y = GetGearPosition(CurrentHedgehog) g2X, g2Y = vCircX[cUID], vCircY[cUID] - q = g1X - g2X - w = g1Y - g2Y + q = g1X - g2X + w = g1Y - g2Y r = math.sqrt( (q*q) + (w*w) ) --alternate - - - opp = w + + + opp = w if opp < 0 then opp = opp*-1 end -- work out the angle (theta) to the target t = math.deg ( math.asin(opp / r) ) - - -- based on the radius of the radar, calculate what x/y displacement should be + + -- based on the radius of the radar, calculate what x/y displacement should be NR = 150 -- radius at which to draw circs NX = math.cos( math.rad(t) ) * NR - NY = math.sin( math.rad(t) ) * NR - + NY = math.sin( math.rad(t) ) * NR + -- displace xy based on where this thing actually is if q > 0 then rCircX[cUID] = g1X - NX @@ -1248,7 +1318,7 @@ else rCircY[cUID] = g1Y + NY end - + end function PlayerIsFine() @@ -1573,7 +1643,7 @@ g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(rCirc[i]) SetVisualGearValues(rCirc[i], 0, 0, g3, g4, g5, g6, g7, g8, g9, vCircCol[i]-0x000000ff) - + vCircActive[i] = true -- new @@ -1816,25 +1886,25 @@ end]] - + if rAlpha ~= 255 then - + rPingTimer = rPingTimer + 1 if rPingTimer == 100 then - rPingTimer = 0 - + rPingTimer = 0 + rAlpha = rAlpha + 5 if rAlpha >= 255 then rAlpha = 255 - end + end end - + end for i = 0,(vCCount-1) do --if (vCircActive[i] == true) then - SetVisualGearValues(rCirc[i], rCircX[i], rCircY[i], 100, 255, 1, 10, 0, 40, 3, vCircCol[i]-rAlpha) + SetVisualGearValues(rCirc[i], rCircX[i], rCircY[i], 100, 255, 1, 10, 0, 40, 3, vCircCol[i]-rAlpha) --end vCounter[i] = vCounter[i] + 1 @@ -1987,8 +2057,8 @@ vCircX[i] = vCircX[i] + vCircDX[i] vCircY[i] = vCircY[i] + vCircDY[i] - if (CurrentHedgehog ~= nil) and (rAlpha ~= 255) then - DoHorribleThings(i)--(i, g1X, g1Y, g2X, g2Y, dist) + if (CurrentHedgehog ~= nil) and (rAlpha ~= 255) then + DoHorribleThings(i)--(i, g1X, g1Y, g2X, g2Y, dist) end end diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/beep.ogg Binary file share/hedgewars/Data/Sounds/beep.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/CMakeLists.txt --- a/share/hedgewars/Data/Sounds/voices/CMakeLists.txt Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Sounds/voices/CMakeLists.txt Sat Nov 12 17:06:49 2011 +0100 @@ -9,6 +9,7 @@ Singer Surfer Default_uk + HillBilly ) add_subdirectory(${dir}) endforeach(dir) diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Byebye.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Byebye.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Sounds/voices/HillBilly/CMakeLists.txt Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,41 @@ +file(GLOB VoiceSounds +Boring.ogg +Byebye.ogg +Comeonthen.ogg +Coward.ogg +Enemydown.ogg +Firstblood.ogg +Firepunch*.ogg +Flawless.ogg +Hello.ogg +Hurry.ogg +Illgetyou.ogg +Incoming.ogg +Jump*.ogg +JustYouwait.ogg +Kamikaze.ogg +Laugh.ogg +Melon.ogg +Missed.ogg +Nooo.ogg +Nutter.ogg +Ooff*.ogg +Oops.ogg +Ow*.ogg +PoisonCough.ogg +PoisonMoan.ogg +Reinforcements.ogg +Sameteam.ogg +Stupid.ogg +Takecover.ogg +Traitor.ogg +Uh-oh.ogg +Victory.ogg +Watchit.ogg +Yessir.ogg +Youllregretthat.ogg +) + +install(FILES + ${VoiceSounds} + DESTINATION ${SHAREPATH}Data/Sounds/voices/HillBilly) diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Comeonthen.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Comeonthen.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Coward.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Coward.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Enemydown.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Enemydown.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch1.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch1.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch2.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch2.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch3.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch3.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch4.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch4.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch5.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch5.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch6.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firepunch6.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Firstblood.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Firstblood.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Flawless.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Flawless.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Hello.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Hello.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Hurry.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Hurry.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Illgetyou.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Illgetyou.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Incoming.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Incoming.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Jump1.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Jump1.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Jump2.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Jump2.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Jump3.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Jump3.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Kamikaze.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Kamikaze.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Laugh.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Laugh.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Melon.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Melon.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Missed.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Missed.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Nooo.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Nooo.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Nutter.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Nutter.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ooff1.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ooff1.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ooff2.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ooff2.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ooff3.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ooff3.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Oops.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Oops.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ow1.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ow1.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ow2.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ow2.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ow3.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ow3.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Ow4.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Ow4.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/PoisonCough.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/PoisonCough.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/PoisonMoan.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/PoisonMoan.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Reinforcements.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Reinforcements.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Sameteam.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Sameteam.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Stupid.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Stupid.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Takecover.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Takecover.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Traitor.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Traitor.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Uh-oh.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Uh-oh.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Victory.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Victory.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Watchit.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Watchit.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Yessir.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Yessir.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/Youllregretthat.ogg Binary file share/hedgewars/Data/Sounds/voices/HillBilly/Youllregretthat.ogg has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Sounds/voices/HillBilly/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Sounds/voices/HillBilly/readme.txt Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,10 @@ +Hedgewars Hillbilly Sound Pack v2 +sloan2189@gmail.com + + + +What can I say? I got bored and decided to add a little West Virginia to the game. + +This version has better quality audio, and the oofs, fireballs, oops, and ows were replaced as well. + +Enjoy. diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Castle/Flake.png Binary file share/hedgewars/Data/Themes/Castle/Flake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Christmas/Flake.png Binary file share/hedgewars/Data/Themes/Christmas/Flake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Golf/Flake.png Binary file share/hedgewars/Data/Themes/Golf/Flake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Halloween/theme.cfg --- a/share/hedgewars/Data/Themes/Halloween/theme.cfg Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Themes/Halloween/theme.cfg Sat Nov 12 17:06:49 2011 +0100 @@ -8,3 +8,4 @@ object = Rock, 3, 65, 258, 175, 2, 1, 0, 0, 240, 215 object = RockShort, 3, 0, 165, 163, 2, 1, 0, 0, 163, 140 flakes = 20, 7, 130, 0, 5 +flatten-flakes = yes diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Nature/Flake.png Binary file share/hedgewars/Data/Themes/Nature/Flake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Snow/Flake.png Binary file share/hedgewars/Data/Themes/Snow/Flake.png has changed diff -r 1998ff75321a -r d14adf1c7721 share/hedgewars/Data/Themes/Underwater/theme.cfg --- a/share/hedgewars/Data/Themes/Underwater/theme.cfg Sat Nov 12 15:48:55 2011 +0100 +++ b/share/hedgewars/Data/Themes/Underwater/theme.cfg Sat Nov 12 17:06:49 2011 +0100 @@ -5,6 +5,7 @@ water-opacity = $FF music = underwater.ogg clouds = 9 +flatten-clouds = yes object = anchor, 3, 65, 258, 80, 2, 1, 0, 0, 240, 215 object = clam, 3, 60, 131, 16, 2, 1, 0, 0, 150, 117 object = crab, 3, 78, 256, 96, 2, 1, 3, 60, 237, 155 diff -r 1998ff75321a -r d14adf1c7721 tools/PascalParser.hs --- a/tools/PascalParser.hs Sat Nov 12 15:48:55 2011 +0100 +++ b/tools/PascalParser.hs Sat Nov 12 17:06:49 2011 +0100 @@ -1,98 +1,545 @@ module PascalParser where -import Text.ParserCombinators.Parsec +import Text.Parsec.Expr +import Text.Parsec.Char +import Text.Parsec.Token +import Text.Parsec.Language +import Text.Parsec.Prim +import Text.Parsec.Combinator +import Text.Parsec.String import Control.Monad +import Data.Char data PascalUnit = - Program Identificator Implementation FunctionBody - | Unit Identificator Interface Implementation (Maybe Initialize) (Maybe Finalize) + Program Identifier Implementation + | Unit Identifier Interface Implementation (Maybe Initialize) (Maybe Finalize) deriving Show - data Interface = Interface Uses TypesAndVars deriving Show -data Implementation = Implementation Uses TypesAndVars Functions +data Implementation = Implementation Uses TypesAndVars + deriving Show +data Identifier = Identifier String + deriving Show +data TypesAndVars = TypesAndVars [TypeVarDeclaration] + deriving Show +data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl + | VarDeclaration Bool ([Identifier], TypeDecl) (Maybe Expression) + | FunctionDeclaration Identifier TypeDecl (Maybe Phrase) deriving Show -data Functions = Functions [Function] +data TypeDecl = SimpleType Identifier + | RangeType Range + | Sequence [Identifier] + | ArrayDecl Range TypeDecl + | RecordType [TypeVarDeclaration] + | PointerTo TypeDecl + | String + | UnknownType + deriving Show +data Range = Range Identifier + | RangeFromTo Expression Expression + deriving Show +data Initialize = Initialize String deriving Show -data Function = Function String +data Finalize = Finalize String + deriving Show +data Uses = Uses [Identifier] deriving Show -data Identificator = Identificator String +data Phrase = ProcCall Identifier [Expression] + | IfThenElse Expression Phrase (Maybe Phrase) + | WhileCycle Expression Phrase + | RepeatCycle Expression [Phrase] + | ForCycle Identifier Expression Expression Phrase + | WithBlock Expression Phrase + | Phrases [Phrase] + | SwitchCase Expression [(Expression, Phrase)] (Maybe Phrase) + | Assignment Reference Expression + deriving Show +data Expression = Expression String + | PrefixOp String Expression + | PostfixOp String Expression + | BinOp String Expression Expression + | StringLiteral String + | CharCode String + | NumberLiteral String + | HexNumber String + | Reference Reference + | Null deriving Show -data FunctionBody = FunctionBody String - deriving Show -data TypesAndVars = TypesAndVars String +data Reference = ArrayElement [Expression] Reference + | FunCall [Expression] Reference + | SimpleReference Identifier + | Dereference Reference + | RecordField Reference Reference + | Address Reference deriving Show -data Initialize = Initialize Functions - deriving Show -data Finalize = Finalize Functions - deriving Show -data Uses = Uses [Identificator] - deriving Show + +pascalLanguageDef + = emptyDef + { commentStart = "(*" + , commentEnd = "*)" + , commentLine = "//" + , nestedComments = False + , identStart = letter <|> oneOf "_" + , identLetter = alphaNum <|> oneOf "_." + , reservedNames = [ + "begin", "end", "program", "unit", "interface" + , "implementation", "and", "or", "xor", "shl" + , "shr", "while", "do", "repeat", "until", "case", "of" + , "type", "var", "const", "out", "array", "packed" + , "procedure", "function", "with", "for", "to" + , "downto", "div", "mod", "record", "set", "nil" + , "string", "shortstring" + ] + , reservedOpNames= [] + , caseSensitive = False + } + +pas = patch $ makeTokenParser pascalLanguageDef + where + patch tp = tp {stringLiteral = sl} + sl = do + (char '\'') + s <- (many $ noneOf "'") + (char '\'') + ss <- many $ do + (char '\'') + s' <- (many $ noneOf "'") + (char '\'') + return $ '\'' : s' + comments + return $ concat (s:ss) + +comments = do + spaces + skipMany $ do + comment + spaces -parsePascalUnit :: String -> Either ParseError PascalUnit -parsePascalUnit = parse pascalUnit "unit" - where - comments = skipMany (comment >> spaces) - identificator = do - spaces - l <- letter <|> oneOf "_" - ls <- many (alphaNum <|> oneOf "_") - spaces - return $ Identificator (l:ls) +pascalUnit = do + comments + u <- choice [program, unit] + comments + return u + +comment = choice [ + char '{' >> manyTill anyChar (try $ char '}') + , (try $ string "(*") >> manyTill anyChar (try $ string "*)") + , (try $ string "//") >> manyTill anyChar (try newline) + ] + +iD = do + i <- liftM Identifier (identifier pas) + comments + return i + +unit = do + string "unit" >> comments + name <- iD + semi pas + comments + int <- interface + impl <- implementation + comments + return $ Unit name int impl Nothing Nothing - pascalUnit = do - spaces - comments - u <- choice [program, unit] - comments - spaces - return u + +reference = buildExpressionParser table term "reference" + where + term = comments >> choice [ + parens pas reference + , char '@' >> reference >>= return . Address + , iD >>= return . SimpleReference + ] "simple reference" - comment = choice [ - char '{' >> manyTill anyChar (try $ char '}') - , string "(*" >> manyTill anyChar (try $ string "*)") - , string "//" >> manyTill anyChar (try newline) + table = [ + [Postfix $ (parens pas) (option [] parameters) >>= return . FunCall] + , [Postfix (char '^' >> return Dereference)] + , [Postfix $ (brackets pas) (commaSep1 pas $ expression) >>= return . ArrayElement] + , [Infix (try (char '.' >> notFollowedBy (char '.')) >> return RecordField) AssocLeft] + ] + + +varsDecl1 = varsParser sepEndBy1 +varsDecl = varsParser sepEndBy +varsParser m endsWithSemi = do + vs <- m (aVarDecl endsWithSemi) (semi pas) + return vs + +aVarDecl endsWithSemi = do + when (not endsWithSemi) $ + optional $ choice [ + try $ string "var" + , try $ string "const" + , try $ string "out" ] + comments + ids <- do + i <- (commaSep1 pas) $ (try iD "variable declaration") + char ':' + return i + comments + t <- typeDecl "variable type declaration" + comments + init <- option Nothing $ do + char '=' + comments + e <- expression + comments + return (Just e) + return $ VarDeclaration False (ids, t) init - unit = do - name <- unitName - spaces + +constsDecl = do + vs <- many1 (try (aConstDecl >>= \i -> semi pas >> return i) >>= \i -> comments >> return i) + comments + return vs + where + aConstDecl = do + comments + i <- iD "const declaration" + optional $ do + char ':' + comments + t <- typeDecl + return () + char '=' + comments + e <- expression comments - int <- string "interface" >> interface - manyTill anyChar (try $ string "implementation") - spaces + return $ VarDeclaration False ([i], UnknownType) (Just e) + +typeDecl = choice [ + char '^' >> typeDecl >>= return . PointerTo + , try (string "shortstring") >> return String + , arrayDecl + , recordDecl + , rangeDecl >>= return . RangeType + , sequenceDecl >>= return . Sequence + , identifier pas >>= return . SimpleType . Identifier + ] "type declaration" + where + arrayDecl = do + try $ string "array" + comments + char '[' + r <- rangeDecl + char ']' + comments + string "of" + comments + t <- typeDecl + return $ ArrayDecl r t + recordDecl = do + optional $ (try $ string "packed") >> comments + try $ string "record" + comments + vs <- varsDecl True + string "end" + return $ RecordType vs + sequenceDecl = (parens pas) $ (commaSep pas) iD + +typesDecl = many (aTypeDecl >>= \t -> comments >> return t) + where + aTypeDecl = do + i <- try $ do + i <- iD "type declaration" + comments + char '=' + return i + comments + t <- typeDecl + comments + semi pas comments - impl <- implementation - return $ Unit name int impl Nothing Nothing - where - unitName = between (string "unit") (char ';') identificator + return $ TypeDeclaration i t + +rangeDecl = choice [ + try $ rangeft + , iD >>= return . Range + ] "range declaration" + where + rangeft = do + e1 <- expression + string ".." + e2 <- expression + return $ RangeFromTo e1 e2 + +typeVarDeclaration isImpl = (liftM concat . many . choice) [ + varSection, + constSection, + typeSection, + funcDecl, + procDecl + ] + where + varSection = do + try $ string "var" + comments + v <- varsDecl1 True + comments + return v + + constSection = do + try $ string "const" + comments + c <- constsDecl + comments + return c - interface = do - spaces + typeSection = do + try $ string "type" + comments + t <- typesDecl + comments + return t + + procDecl = do + try $ string "procedure" + comments + i <- iD + optional $ do + char '(' + varsDecl False + char ')' + comments + char ';' + b <- if isImpl then + do + comments + optional $ typeVarDeclaration True + comments + liftM Just functionBody + else + return Nothing + comments + return $ [FunctionDeclaration i UnknownType b] + + funcDecl = do + try $ string "function" comments - u <- uses - return $ Interface u (TypesAndVars "") + i <- iD + optional $ do + char '(' + varsDecl False + char ')' + comments + char ':' + comments + ret <- typeDecl + comments + char ';' + comments + b <- if isImpl then + do + optional $ typeVarDeclaration True + comments + liftM Just functionBody + else + return Nothing + return $ [FunctionDeclaration i ret Nothing] + +program = do + string "program" + comments + name <- iD + (char ';') + comments + impl <- implementation + comments + return $ Program name impl + +interface = do + string "interface" + comments + u <- uses + comments + tv <- typeVarDeclaration False + comments + return $ Interface u (TypesAndVars tv) - program = do - name <- programName - spaces +implementation = do + string "implementation" + comments + u <- uses + comments + tv <- typeVarDeclaration True + string "end." + comments + return $ Implementation u (TypesAndVars tv) + +expression = buildExpressionParser table term "expression" + where + term = comments >> choice [ + parens pas $ expression + , try $ integer pas >>= return . NumberLiteral . show + , stringLiteral pas >>= return . StringLiteral + , char '#' >> many digit >>= return . CharCode + , char '$' >> many hexDigit >>= return . HexNumber + , try $ string "nil" >> return Null + , reference >>= return . Reference + ] "simple expression" + + table = [ + [ Infix (char '*' >> return (BinOp "*")) AssocLeft + , Infix (char '/' >> return (BinOp "/")) AssocLeft + , Infix (try (string "div") >> return (BinOp "div")) AssocLeft + , Infix (try (string "mod") >> return (BinOp "mod")) AssocLeft + ] + , [ Infix (char '+' >> return (BinOp "+")) AssocLeft + , Infix (char '-' >> return (BinOp "-")) AssocLeft + , Prefix (char '-' >> return (PrefixOp "-")) + ] + , [ Infix (try (string "<>") >> return (BinOp "<>")) AssocNone + , Infix (try (string "<=") >> return (BinOp "<=")) AssocNone + , Infix (try (string ">=") >> return (BinOp ">=")) AssocNone + , Infix (char '<' >> return (BinOp "<")) AssocNone + , Infix (char '>' >> return (BinOp ">")) AssocNone + , Infix (char '=' >> return (BinOp "=")) AssocNone + ] + , [ Infix (try $ string "and" >> return (BinOp "and")) AssocLeft + , Infix (try $ string "or" >> return (BinOp "or")) AssocLeft + , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft + ] + , [ Infix (try $ string "shl" >> return (BinOp "and")) AssocNone + , Infix (try $ string "shr" >> return (BinOp "or")) AssocNone + ] + , [Prefix (try (string "not") >> return (PrefixOp "not"))] + ] + +phrasesBlock = do + try $ string "begin" + comments + p <- manyTill phrase (try $ string "end") + comments + return $ Phrases p + +phrase = do + o <- choice [ + phrasesBlock + , ifBlock + , whileCycle + , repeatCycle + , switchCase + , withBlock + , forCycle + , (try $ reference >>= \r -> string ":=" >> return r) >>= \r -> expression >>= return . Assignment r + , procCall + ] + optional $ char ';' + comments + return o + +ifBlock = do + try $ string "if" + comments + e <- expression + comments + string "then" + comments + o1 <- phrase + comments + o2 <- optionMaybe $ do + try $ string "else" comments - impl <- implementation - return $ Program name impl (FunctionBody "") - where - programName = between (string "program") (char ';') identificator + o <- phrase + comments + return o + return $ IfThenElse e o1 o2 - implementation = do - u <- uses - manyTill anyChar (try $ string "end.") - return $ Implementation u (TypesAndVars "") (Functions []) +whileCycle = do + try $ string "while" + comments + e <- expression + comments + string "do" + comments + o <- phrase + return $ WhileCycle e o + +withBlock = do + try $ string "with" + comments + e <- expression + comments + string "do" + comments + o <- phrase + return $ WithBlock e o + +repeatCycle = do + try $ string "repeat" + comments + o <- many phrase + string "until" + comments + e <- expression + comments + return $ RepeatCycle e o - uses = liftM Uses (option [] u) - where - u = do - string "uses" - spaces - u <- (identificator >>= \i -> spaces >> return i) `sepBy1` (char ',' >> spaces) - char ';' - spaces - return u +forCycle = do + try $ string "for" + comments + i <- iD + comments + string ":=" + comments + e1 <- expression + comments + choice [string "to", string "downto"] + comments + e2 <- expression + comments + string "do" + comments + p <- phrase + comments + return $ ForCycle i e1 e2 p + +switchCase = do + try $ string "case" + comments + e <- expression + comments + string "of" + comments + cs <- many1 aCase + o2 <- optionMaybe $ do + try $ string "else" + comments + o <- phrase + comments + return o + string "end" + return $ SwitchCase e cs o2 + where + aCase = do + e <- expression + comments + char ':' + comments + p <- phrase + comments + return (e, p) + +procCall = do + i <- iD + p <- option [] $ (parens pas) parameters + return $ ProcCall i p + +parameters = (commaSep pas) expression "parameters" + +functionBody = do + p <- phrasesBlock + char ';' + comments + return p + +uses = liftM Uses (option [] u) + where + u = do + string "uses" + comments + u <- (iD >>= \i -> comments >> return i) `sepBy1` (char ',' >> comments) + char ';' + comments + return u diff -r 1998ff75321a -r d14adf1c7721 tools/pas2c.hs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/pas2c.hs Sat Nov 12 17:06:49 2011 +0100 @@ -0,0 +1,95 @@ +module Pas2C where + +import PascalParser +import Text.PrettyPrint.HughesPJ +import Data.Maybe +import Data.Char + + +pascal2C :: PascalUnit -> Doc +pascal2C (Unit unitName interface implementation init fin) = implementation2C implementation + + +implementation2C :: Implementation -> Doc +implementation2C (Implementation uses tvars) = typesAndVars2C tvars + + +typesAndVars2C :: TypesAndVars -> Doc +typesAndVars2C (TypesAndVars ts) = vcat $ map tvar2C ts + + +tvar2C :: TypeVarDeclaration -> Doc +tvar2C (FunctionDeclaration (Identifier name) returnType Nothing) = + type2C returnType <+> text (name ++ "();") + + +tvar2C (FunctionDeclaration (Identifier name) returnType (Just phrase)) = + type2C returnType <+> text (name ++ "()") + $$ + phrase2C phrase +tvar2C _ = empty + +type2C :: TypeDecl -> Doc +type2C UnknownType = text "void" +type2C _ = text "<>" + +phrase2C :: Phrase -> Doc +phrase2C (Phrases p) = text "{" $+$ (nest 4 . vcat . map phrase2C $ p) $+$ text "}" +phrase2C (ProcCall (Identifier name) params) = text name <> parens (hsep . punctuate (char ',') . map expr2C $ params) <> semi +phrase2C (IfThenElse (expr) phrase1 mphrase2) = text "if" <> parens (expr2C expr) $+$ (phrase2C . wrapPhrase) phrase1 $+$ elsePart + where + elsePart | isNothing mphrase2 = empty + | otherwise = text "else" $$ (phrase2C . wrapPhrase) (fromJust mphrase2) +phrase2C (Assignment ref expr) = ref2C ref <> text " = " <> expr2C expr <> semi +phrase2C (WhileCycle expr phrase) = text "while" <> parens (expr2C expr) $$ (phrase2C $ wrapPhrase phrase) +phrase2C (SwitchCase expr cases mphrase) = text "switch" <> parens (expr2C expr) <> text "of" $+$ (nest 4 . vcat . map case2C) cases + where + case2C :: (Expression, Phrase) -> Doc + case2C (e, p) = text "case" <+> parens (expr2C e) <> char ':' <> nest 4 (phrase2C p $+$ text "break;") +{- + | RepeatCycle Expression Phrase + | ForCycle + -} +phrase2C _ = empty + +wrapPhrase p@(Phrases _) = p +wrapPhrase p = Phrases [p] + +expr2C :: Expression -> Doc +expr2C (Expression s) = text s +expr2C (BinOp op expr1 expr2) = parens $ (expr2C expr1) <+> op2C op <+> (expr2C expr2) +expr2C (NumberLiteral s) = text s +expr2C (HexNumber s) = text "0x" <> (text . map toLower $ s) +expr2C (StringLiteral s) = doubleQuotes $ text s +expr2C (Reference ref) = ref2C ref +expr2C (PrefixOp op expr) = op2C op <+> expr2C expr + {- + | PostfixOp String Expression + | CharCode String + -} +expr2C _ = empty + + +ref2C :: Reference -> Doc +ref2C (ArrayElement exprs ref) = ref2C ref <> (brackets . hcat) (punctuate comma $ map expr2C exprs) +ref2C (SimpleReference (Identifier name)) = text name +ref2C (RecordField (Dereference ref1) ref2) = ref2C ref1 <> text "->" <> ref2C ref2 +ref2C (RecordField ref1 ref2) = ref2C ref1 <> text "." <> ref2C ref2 +ref2C (Dereference ref) = parens $ text "*" <> ref2C ref +ref2C (FunCall params ref) = ref2C ref <> parens (hsep . punctuate (char ',') . map expr2C $ params) +ref2C (Address ref) = text "&" <> ref2C ref + +op2C "or" = text "|" +op2C "and" = text "&" +op2C "not" = text "!" +op2C "xor" = text "^" +op2C "div" = text "/" +op2C "mod" = text "%" +op2C "shl" = text "<<" +op2C "shr" = text ">>" +op2C "<>" = text "!=" +op2C "=" = text "==" +op2C a = text a + +maybeVoid "" = "void" +maybeVoid a = a