summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 10:13:40 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 10:13:40 +0100
commiteb2e62609992ab8b47f8805f2bc2cafce271b66f (patch)
tree58d6c387f910e3a3348a6528127f4216b524ec57
parent05dc1666dc794ed6aa7f6568b768c652f8922c4e (diff)
parent8d06606835e3d01f537ebe96de8b216e64a1f969 (diff)
downloadmana-client-lpc2012.tar.gz
mana-client-lpc2012.tar.bz2
mana-client-lpc2012.tar.xz
mana-client-lpc2012.zip
Merge branch 'master' into lpc2012lpc2012
-rw-r--r--.gitignore4
-rw-r--r--AUTHORS1
-rw-r--r--CMakeLists.txt12
-rw-r--r--README.cmake2
-rw-r--r--mana.config1
-rw-r--r--mana.creator1
-rw-r--r--mana.files586
-rw-r--r--mana.includes3
-rw-r--r--po/ru.po837
-rw-r--r--src/CMakeLists.txt64
-rw-r--r--src/client.cpp131
-rw-r--r--src/client.h13
-rw-r--r--src/compoundsprite.cpp18
-rw-r--r--src/cpp0x_compat/cstdint10
-rw-r--r--src/event.cpp24
-rw-r--r--src/event.h24
-rw-r--r--src/game.cpp6
-rw-r--r--src/graphics.cpp451
-rw-r--r--src/graphics.h108
-rw-r--r--src/gui/gui.cpp18
-rw-r--r--src/gui/gui.h2
-rw-r--r--src/gui/sdlinput.cpp120
-rw-r--r--src/gui/sdlinput.h22
-rw-r--r--src/gui/setup.cpp6
-rw-r--r--src/gui/setup_keyboard.cpp4
-rw-r--r--src/gui/setup_video.cpp37
-rw-r--r--src/gui/socialwindow.cpp5
-rw-r--r--src/gui/tradewindow.h2
-rw-r--r--src/gui/truetypefont.cpp4
-rw-r--r--src/gui/viewport.cpp2
-rw-r--r--src/gui/widgets/button.cpp2
-rw-r--r--src/gui/widgets/desktop.cpp24
-rw-r--r--src/gui/widgets/dropdown.cpp2
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/playerbox.cpp2
-rw-r--r--src/gui/widgets/progressbar.cpp2
-rw-r--r--src/gui/widgets/scrollarea.cpp6
-rw-r--r--src/gui/widgets/tab.cpp2
-rw-r--r--src/gui/widgets/textfield.cpp46
-rw-r--r--src/gui/widgets/textfield.h6
-rw-r--r--src/gui/windowmenu.cpp2
-rw-r--r--src/guild.cpp2
-rw-r--r--src/joystick.cpp2
-rw-r--r--src/keyboardconfig.cpp6
-rw-r--r--src/keyboardconfig.h2
-rw-r--r--src/net/download.cpp2
-rw-r--r--src/net/manaserv/messagehandler.h2
-rw-r--r--src/net/manaserv/messagein.h5
-rw-r--r--src/net/tmwa/loginhandler.cpp2
-rw-r--r--src/net/tmwa/messagehandler.h2
-rw-r--r--src/net/tmwa/messagein.h5
-rw-r--r--src/net/tmwa/network.cpp4
-rw-r--r--src/net/tmwa/tradehandler.cpp5
-rw-r--r--src/openglgraphics.cpp85
-rw-r--r--src/openglgraphics.h9
-rw-r--r--src/party.cpp2
-rw-r--r--src/resources/ambientlayer.cpp22
-rw-r--r--src/resources/image.cpp291
-rw-r--r--src/resources/image.h58
-rw-r--r--src/resources/settingsmanager.cpp4
-rw-r--r--src/resources/theme.cpp4
-rw-r--r--src/sound.cpp4
-rw-r--r--src/utils/copynpaste.cpp310
-rw-r--r--src/utils/copynpaste.h10
-rw-r--r--src/utils/dtor.h6
-rw-r--r--src/utils/mutex.h4
-rw-r--r--src/utils/physfsrwops.h9
-rw-r--r--src/utils/stringutils.cpp2
-rw-r--r--src/vector.h8
-rwxr-xr-xupdate-creator.sh8
71 files changed, 1194 insertions, 2297 deletions
diff --git a/.gitignore b/.gitignore
index 83dbf8b3..e97a6c84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,7 +28,7 @@ packaging/windows/upx/*
data/music/*.ogg
# files created by Qt Creator
-mana.creator.user*
+CMakeLists.txt.user*
# files created by gtags
GPATH
@@ -53,4 +53,4 @@ Xcode/mana.xcodeproj/xcuserdata
Xcode/mana.xcodeproj/project.xcworkspace/xcuserdata
Xcode/mana-10.7.xcodeproj/xcuserdata
Xcode/mana-10.7.xcodeproj/project.xcworkspace/xcuserdata
-.DS_Store \ No newline at end of file
+.DS_Store
diff --git a/AUTHORS b/AUTHORS
index fe8f1aeb..e527ce42 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -64,6 +64,7 @@ Eugenio Favalli (Italian) <elvenprogrammer gmail.com>
Jonathan Kolberg (German) <bulldog98 freenet.de>
Jumpy (French) <antoinebcn hotmail.com>
jurkan (German) <jurkan gmx.de>
+Kenny690 <bio_editor mail.ru>
Kess Vargavind (Swedish) <vargavind gmail.com>
Leif Kildelund (Danish) <gonzo.dark gmail.com>
Matthias Hartmann (German) <hartmann.matthias gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20695d1b..6b0da2e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-CMAKE_POLICY(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
+CMAKE_POLICY(VERSION 3.1)
PROJECT(MANA)
@@ -7,6 +7,8 @@ IF (NOT VERSION)
SET(VERSION 0.6.1)
ENDIF()
+set (CMAKE_CXX_STANDARD 11)
+
STRING(REPLACE "." " " _VERSION ${VERSION})
SEPARATE_ARGUMENTS(_VERSION)
LIST(LENGTH _VERSION _LEN)
@@ -31,7 +33,6 @@ FIND_PACKAGE(Gettext)
OPTION(WITH_OPENGL "Enable OpenGL support" ON)
OPTION(ENABLE_NLS "Enable building of tranlations" ON)
OPTION(ENABLE_MANASERV "Enable Manaserv support" ON)
-OPTION(ENABLE_CPP0X "Enable use of C++0x features" OFF)
IF (WIN32)
SET(PKG_DATADIR ".")
@@ -39,9 +40,6 @@ IF (WIN32)
SET(LOCALEDIR ".")
CONFIGURE_FILE(src/winver.h.in src/winver.h)
ELSE (WIN32)
- IF (NOT OSX AND NOT BEOS)
- OPTION(USE_X11 "Use X11 Clipboard functionality" ON)
- ENDIF ()
SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/mana CACHE PATH "Mana datadir")
SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "Mana bindir")
@@ -76,6 +74,6 @@ IF(WIN32)
SET(CPACK_NSIS_DISPLAY_NAME "Mana")
SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/icons/mana.ico")
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/packaging/windows/setup_welcome.bmp")
- SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.manasource.org")
+ SET(CPACK_NSIS_URL_INFO_ABOUT "https://www.manasource.org")
ENDIF()
INCLUDE(CPack)
diff --git a/README.cmake b/README.cmake
index c9175fa5..b5691ff1 100644
--- a/README.cmake
+++ b/README.cmake
@@ -143,6 +143,6 @@ In your mana directory:
$ export CC=/usr/bin/clang
$ export CXX=/usr/bin/clang++
-$ cmake -DENABLE_CPP0X=OFF
+$ cmake .
$ make
$ src/mana
diff --git a/mana.config b/mana.config
deleted file mode 100644
index 63f90c97..00000000
--- a/mana.config
+++ /dev/null
@@ -1 +0,0 @@
-#define USE_OPENGL
diff --git a/mana.creator b/mana.creator
deleted file mode 100644
index e94cbbd3..00000000
--- a/mana.creator
+++ /dev/null
@@ -1 +0,0 @@
-[General]
diff --git a/mana.files b/mana.files
deleted file mode 100644
index 8be24936..00000000
--- a/mana.files
+++ /dev/null
@@ -1,586 +0,0 @@
-CMakeLists.txt
-data/CMakeLists.txt
-data/fonts/CMakeLists.txt
-data/graphics/CMakeLists.txt
-data/graphics/gui/CMakeLists.txt
-data/graphics/gui/colors.xml
-data/graphics/gui/speechbubble.xml
-data/graphics/gui/window.xml
-data/graphics/images/CMakeLists.txt
-data/graphics/sprites/CMakeLists.txt
-data/graphics/sprites/error.xml
-data/help/CMakeLists.txt
-data/help/about.txt
-data/help/changes.txt
-data/help/commands.txt
-data/help/header.txt
-data/help/index.txt
-data/help/support.txt
-data/help/windows.txt
-data/icons/CMakeLists.txt
-data/sfx/CMakeLists.txt
-data/sfx/system/CMakeLists.txt
-docs/HACKING.txt
-docs/example.mana
-docs/items.txt
-docs/packages.txt
-docs/progression.txt
-libs/enet/CMakeLists.txt
-libs/enet/callbacks.c
-libs/enet/compress.c
-libs/enet/design.txt
-libs/enet/host.c
-libs/enet/include/enet/callbacks.h
-libs/enet/include/enet/enet.h
-libs/enet/include/enet/list.h
-libs/enet/include/enet/protocol.h
-libs/enet/include/enet/time.h
-libs/enet/include/enet/types.h
-libs/enet/include/enet/unix.h
-libs/enet/include/enet/utility.h
-libs/enet/include/enet/win32.h
-libs/enet/list.c
-libs/enet/packet.c
-libs/enet/peer.c
-libs/enet/protocol.c
-libs/enet/unix.c
-libs/enet/win32.c
-packaging/windows/portable.xml
-packaging/windows/readme.txt
-po/CMakeLists.txt
-src/CMakeLists.txt
-src/SDLMain.h
-src/actor.cpp
-src/actor.h
-src/actorsprite.cpp
-src/actorsprite.h
-src/actorspritemanager.cpp
-src/actorspritemanager.h
-src/animatedsprite.cpp
-src/animatedsprite.h
-src/animationparticle.cpp
-src/animationparticle.h
-src/avatar.cpp
-src/avatar.h
-src/being.cpp
-src/being.h
-src/channel.cpp
-src/channel.h
-src/channelmanager.cpp
-src/channelmanager.h
-src/chatlogger.cpp
-src/chatlogger.h
-src/client.cpp
-src/client.h
-src/commandhandler.cpp
-src/commandhandler.h
-src/compoundsprite.cpp
-src/compoundsprite.h
-src/configuration.cpp
-src/configuration.h
-src/defaults.cpp
-src/defaults.h
-src/effectmanager.cpp
-src/effectmanager.h
-src/emoteshortcut.cpp
-src/emoteshortcut.h
-src/equipment.h
-src/event.cpp
-src/event.h
-src/eventlistener.cpp
-src/eventlistener.h
-src/flooritem.cpp
-src/flooritem.h
-src/game.cpp
-src/game.h
-src/graphics.cpp
-src/graphics.h
-src/gui/beingpopup.cpp
-src/gui/beingpopup.h
-src/gui/buydialog.cpp
-src/gui/buydialog.h
-src/gui/buyselldialog.cpp
-src/gui/buyselldialog.h
-src/gui/changeemaildialog.cpp
-src/gui/changeemaildialog.h
-src/gui/changepassworddialog.cpp
-src/gui/changepassworddialog.h
-src/gui/charcreatedialog.cpp
-src/gui/charcreatedialog.h
-src/gui/charselectdialog.cpp
-src/gui/charselectdialog.h
-src/gui/chatwindow.cpp
-src/gui/chatwindow.h
-src/gui/confirmdialog.cpp
-src/gui/confirmdialog.h
-src/gui/connectiondialog.cpp
-src/gui/connectiondialog.h
-src/gui/customserverdialog.cpp
-src/gui/customserverdialog.h
-src/gui/debugwindow.cpp
-src/gui/debugwindow.h
-src/gui/emotepopup.cpp
-src/gui/emotepopup.h
-src/gui/equipmentwindow.cpp
-src/gui/equipmentwindow.h
-src/gui/focushandler.cpp
-src/gui/focushandler.h
-src/gui/gui.cpp
-src/gui/gui.h
-src/gui/helpwindow.cpp
-src/gui/helpwindow.h
-src/gui/inventorywindow.cpp
-src/gui/inventorywindow.h
-src/gui/itemamountwindow.cpp
-src/gui/itemamountwindow.h
-src/gui/itempopup.cpp
-src/gui/itempopup.h
-src/gui/logindialog.cpp
-src/gui/logindialog.h
-src/gui/minimap.cpp
-src/gui/minimap.h
-src/gui/minimapwindow.cpp
-src/gui/minimapwindow.h
-src/gui/ministatuswindow.cpp
-src/gui/ministatuswindow.h
-src/gui/npcdialog.cpp
-src/gui/npcdialog.h
-src/gui/npcpostdialog.cpp
-src/gui/npcpostdialog.h
-src/gui/okdialog.cpp
-src/gui/okdialog.h
-src/gui/outfitwindow.cpp
-src/gui/outfitwindow.h
-src/gui/palette.cpp
-src/gui/palette.h
-src/gui/popupmenu.cpp
-src/gui/popupmenu.h
-src/gui/quitdialog.cpp
-src/gui/quitdialog.h
-src/gui/recorder.cpp
-src/gui/recorder.h
-src/gui/register.cpp
-src/gui/register.h
-src/gui/sdlinput.cpp
-src/gui/sdlinput.h
-src/gui/selldialog.cpp
-src/gui/selldialog.h
-src/gui/serverdialog.cpp
-src/gui/serverdialog.h
-src/gui/setup.cpp
-src/gui/setup.h
-src/gui/setup_audio.cpp
-src/gui/setup_audio.h
-src/gui/setup_colors.cpp
-src/gui/setup_colors.h
-src/gui/setup_interface.cpp
-src/gui/setup_interface.h
-src/gui/setup_joystick.cpp
-src/gui/setup_joystick.h
-src/gui/setup_keyboard.cpp
-src/gui/setup_keyboard.h
-src/gui/setup_players.cpp
-src/gui/setup_players.h
-src/gui/setup_video.cpp
-src/gui/setup_video.h
-src/gui/shortcutwindow.cpp
-src/gui/shortcutwindow.h
-src/gui/skilldialog.cpp
-src/gui/skilldialog.h
-src/gui/socialwindow.cpp
-src/gui/socialwindow.h
-src/gui/specialswindow.cpp
-src/gui/specialswindow.h
-src/gui/speechbubble.cpp
-src/gui/speechbubble.h
-src/gui/statuswindow.cpp
-src/gui/statuswindow.h
-src/gui/textdialog.cpp
-src/gui/textdialog.h
-src/gui/textpopup.cpp
-src/gui/textpopup.h
-src/gui/tradewindow.cpp
-src/gui/tradewindow.h
-src/gui/truetypefont.cpp
-src/gui/truetypefont.h
-src/gui/unregisterdialog.cpp
-src/gui/unregisterdialog.h
-src/gui/updaterwindow.cpp
-src/gui/updaterwindow.h
-src/gui/viewport.cpp
-src/gui/viewport.h
-src/gui/widgets/avatarlistbox.cpp
-src/gui/widgets/avatarlistbox.h
-src/gui/widgets/browserbox.cpp
-src/gui/widgets/browserbox.h
-src/gui/widgets/button.cpp
-src/gui/widgets/button.h
-src/gui/widgets/channeltab.cpp
-src/gui/widgets/channeltab.h
-src/gui/widgets/chattab.cpp
-src/gui/widgets/chattab.h
-src/gui/widgets/checkbox.cpp
-src/gui/widgets/checkbox.h
-src/gui/widgets/container.cpp
-src/gui/widgets/container.h
-src/gui/widgets/desktop.cpp
-src/gui/widgets/desktop.h
-src/gui/widgets/dropdown.cpp
-src/gui/widgets/dropdown.h
-src/gui/widgets/emoteshortcutcontainer.cpp
-src/gui/widgets/emoteshortcutcontainer.h
-src/gui/widgets/flowcontainer.cpp
-src/gui/widgets/flowcontainer.h
-src/gui/widgets/icon.cpp
-src/gui/widgets/icon.h
-src/gui/widgets/inttextfield.cpp
-src/gui/widgets/inttextfield.h
-src/gui/widgets/itemcontainer.cpp
-src/gui/widgets/itemcontainer.h
-src/gui/widgets/itemlinkhandler.cpp
-src/gui/widgets/itemlinkhandler.h
-src/gui/widgets/itemshortcutcontainer.cpp
-src/gui/widgets/itemshortcutcontainer.h
-src/gui/widgets/label.cpp
-src/gui/widgets/label.h
-src/gui/widgets/layout.cpp
-src/gui/widgets/layout.h
-src/gui/widgets/layouthelper.cpp
-src/gui/widgets/layouthelper.h
-src/gui/widgets/linkhandler.h
-src/gui/widgets/listbox.cpp
-src/gui/widgets/listbox.h
-src/gui/widgets/passwordfield.cpp
-src/gui/widgets/passwordfield.h
-src/gui/widgets/playerbox.cpp
-src/gui/widgets/playerbox.h
-src/gui/widgets/popup.cpp
-src/gui/widgets/popup.h
-src/gui/widgets/progressbar.cpp
-src/gui/widgets/progressbar.h
-src/gui/widgets/progressindicator.cpp
-src/gui/widgets/progressindicator.h
-src/gui/widgets/radiobutton.cpp
-src/gui/widgets/radiobutton.h
-src/gui/widgets/resizegrip.cpp
-src/gui/widgets/resizegrip.h
-src/gui/widgets/scrollarea.cpp
-src/gui/widgets/scrollarea.h
-src/gui/widgets/setuptab.cpp
-src/gui/widgets/setuptab.h
-src/gui/widgets/shopitems.cpp
-src/gui/widgets/shopitems.h
-src/gui/widgets/shoplistbox.cpp
-src/gui/widgets/shoplistbox.h
-src/gui/widgets/shortcutcontainer.cpp
-src/gui/widgets/shortcutcontainer.h
-src/gui/widgets/slider.cpp
-src/gui/widgets/slider.h
-src/gui/widgets/spacer.cpp
-src/gui/widgets/spacer.h
-src/gui/widgets/tab.cpp
-src/gui/widgets/tab.h
-src/gui/widgets/tabbedarea.cpp
-src/gui/widgets/tabbedarea.h
-src/gui/widgets/table.cpp
-src/gui/widgets/table.h
-src/gui/widgets/tablemodel.cpp
-src/gui/widgets/tablemodel.h
-src/gui/widgets/textbox.cpp
-src/gui/widgets/textbox.h
-src/gui/widgets/textfield.cpp
-src/gui/widgets/textfield.h
-src/gui/widgets/textpreview.cpp
-src/gui/widgets/textpreview.h
-src/gui/widgets/vertcontainer.cpp
-src/gui/widgets/vertcontainer.h
-src/gui/widgets/whispertab.cpp
-src/gui/widgets/whispertab.h
-src/gui/widgets/window.cpp
-src/gui/widgets/window.h
-src/gui/widgets/windowcontainer.cpp
-src/gui/widgets/windowcontainer.h
-src/gui/windowmenu.cpp
-src/gui/windowmenu.h
-src/gui/worldselectdialog.cpp
-src/gui/worldselectdialog.h
-src/guichanfwd.h
-src/guild.cpp
-src/guild.h
-src/imageparticle.cpp
-src/imageparticle.h
-src/imagesprite.cpp
-src/imagesprite.h
-src/inventory.cpp
-src/inventory.h
-src/item.cpp
-src/item.h
-src/itemshortcut.cpp
-src/itemshortcut.h
-src/joystick.cpp
-src/joystick.h
-src/keyboardconfig.cpp
-src/keyboardconfig.h
-src/localplayer.cpp
-src/localplayer.h
-src/log.cpp
-src/log.h
-src/main.cpp
-src/main.h
-src/map.cpp
-src/map.h
-src/net/adminhandler.h
-src/net/charhandler.cpp
-src/net/charhandler.h
-src/net/chathandler.h
-src/net/download.cpp
-src/net/download.h
-src/net/gamehandler.h
-src/net/generalhandler.h
-src/net/guildhandler.h
-src/net/inventoryhandler.h
-src/net/logindata.h
-src/net/loginhandler.h
-src/net/manaserv/adminhandler.cpp
-src/net/manaserv/adminhandler.h
-src/net/manaserv/beinghandler.cpp
-src/net/manaserv/beinghandler.h
-src/net/manaserv/buysellhandler.cpp
-src/net/manaserv/buysellhandler.h
-src/net/manaserv/charhandler.cpp
-src/net/manaserv/charhandler.h
-src/net/manaserv/chathandler.cpp
-src/net/manaserv/chathandler.h
-src/net/manaserv/connection.cpp
-src/net/manaserv/connection.h
-src/net/manaserv/defines.h
-src/net/manaserv/effecthandler.cpp
-src/net/manaserv/effecthandler.h
-src/net/manaserv/gamehandler.cpp
-src/net/manaserv/gamehandler.h
-src/net/manaserv/generalhandler.cpp
-src/net/manaserv/generalhandler.h
-src/net/manaserv/guildhandler.cpp
-src/net/manaserv/guildhandler.h
-src/net/manaserv/internal.cpp
-src/net/manaserv/internal.h
-src/net/manaserv/inventoryhandler.cpp
-src/net/manaserv/inventoryhandler.h
-src/net/manaserv/itemhandler.cpp
-src/net/manaserv/itemhandler.h
-src/net/manaserv/loginhandler.cpp
-src/net/manaserv/loginhandler.h
-src/net/manaserv/manaserv_protocol.h
-src/net/manaserv/messagehandler.cpp
-src/net/manaserv/messagehandler.h
-src/net/manaserv/messagein.cpp
-src/net/manaserv/messagein.h
-src/net/manaserv/messageout.cpp
-src/net/manaserv/messageout.h
-src/net/manaserv/network.cpp
-src/net/manaserv/network.h
-src/net/manaserv/npchandler.cpp
-src/net/manaserv/npchandler.h
-src/net/manaserv/partyhandler.cpp
-src/net/manaserv/partyhandler.h
-src/net/manaserv/playerhandler.cpp
-src/net/manaserv/playerhandler.h
-src/net/manaserv/specialhandler.cpp
-src/net/manaserv/specialhandler.h
-src/net/manaserv/tradehandler.cpp
-src/net/manaserv/tradehandler.h
-src/net/messagehandler.h
-src/net/net.cpp
-src/net/net.h
-src/net/npchandler.h
-src/net/partyhandler.h
-src/net/playerhandler.h
-src/net/serverinfo.h
-src/net/specialhandler.h
-src/net/tmwa/adminhandler.cpp
-src/net/tmwa/adminhandler.h
-src/net/tmwa/beinghandler.cpp
-src/net/tmwa/beinghandler.h
-src/net/tmwa/buysellhandler.cpp
-src/net/tmwa/buysellhandler.h
-src/net/tmwa/charserverhandler.cpp
-src/net/tmwa/charserverhandler.h
-src/net/tmwa/chathandler.cpp
-src/net/tmwa/chathandler.h
-src/net/tmwa/gamehandler.cpp
-src/net/tmwa/gamehandler.h
-src/net/tmwa/generalhandler.cpp
-src/net/tmwa/generalhandler.h
-src/net/tmwa/gui/guildtab.cpp
-src/net/tmwa/gui/guildtab.h
-src/net/tmwa/gui/partytab.cpp
-src/net/tmwa/gui/partytab.h
-src/net/tmwa/guildhandler.cpp
-src/net/tmwa/guildhandler.h
-src/net/tmwa/inventoryhandler.cpp
-src/net/tmwa/inventoryhandler.h
-src/net/tmwa/itemhandler.cpp
-src/net/tmwa/itemhandler.h
-src/net/tmwa/loginhandler.cpp
-src/net/tmwa/loginhandler.h
-src/net/tmwa/messagehandler.cpp
-src/net/tmwa/messagehandler.h
-src/net/tmwa/messagein.cpp
-src/net/tmwa/messagein.h
-src/net/tmwa/messageout.cpp
-src/net/tmwa/messageout.h
-src/net/tmwa/network.cpp
-src/net/tmwa/network.h
-src/net/tmwa/npchandler.cpp
-src/net/tmwa/npchandler.h
-src/net/tmwa/partyhandler.cpp
-src/net/tmwa/partyhandler.h
-src/net/tmwa/playerhandler.cpp
-src/net/tmwa/playerhandler.h
-src/net/tmwa/protocol.h
-src/net/tmwa/specialhandler.cpp
-src/net/tmwa/specialhandler.h
-src/net/tmwa/token.h
-src/net/tmwa/tradehandler.cpp
-src/net/tmwa/tradehandler.h
-src/net/tradehandler.h
-src/net/worldinfo.h
-src/openglgraphics.cpp
-src/openglgraphics.h
-src/particle.cpp
-src/particle.h
-src/particlecontainer.cpp
-src/particlecontainer.h
-src/particleemitter.cpp
-src/particleemitter.h
-src/particleemitterprop.h
-src/party.cpp
-src/party.h
-src/playerinfo.cpp
-src/playerinfo.h
-src/playerrelations.cpp
-src/playerrelations.h
-src/position.cpp
-src/position.h
-src/properties.h
-src/resources/action.cpp
-src/resources/action.h
-src/resources/ambientlayer.cpp
-src/resources/ambientlayer.h
-src/resources/animation.cpp
-src/resources/animation.h
-src/resources/attributes.cpp
-src/resources/attributes.h
-src/resources/beinginfo.cpp
-src/resources/beinginfo.h
-src/resources/dye.cpp
-src/resources/dye.h
-src/resources/emotedb.cpp
-src/resources/emotedb.h
-src/resources/hairdb.cpp
-src/resources/hairdb.h
-src/resources/image.cpp
-src/resources/image.h
-src/resources/imageset.cpp
-src/resources/imageset.h
-src/resources/imagewriter.cpp
-src/resources/imagewriter.h
-src/resources/itemdb.cpp
-src/resources/itemdb.h
-src/resources/iteminfo.cpp
-src/resources/iteminfo.h
-src/resources/mapreader.cpp
-src/resources/mapreader.h
-src/resources/monsterdb.cpp
-src/resources/monsterdb.h
-src/resources/music.cpp
-src/resources/music.h
-src/resources/npcdb.cpp
-src/resources/npcdb.h
-src/resources/resource.cpp
-src/resources/resource.h
-src/resources/resourcemanager.cpp
-src/resources/resourcemanager.h
-src/resources/settingsmanager.cpp
-src/resources/settingsmanager.h
-src/resources/soundeffect.cpp
-src/resources/soundeffect.h
-src/resources/specialdb.cpp
-src/resources/specialdb.h
-src/resources/spritedef.cpp
-src/resources/spritedef.h
-src/resources/theme.cpp
-src/resources/theme.h
-src/resources/userpalette.cpp
-src/resources/userpalette.h
-src/resources/wallpaper.cpp
-src/resources/wallpaper.h
-src/rotationalparticle.cpp
-src/rotationalparticle.h
-src/shopitem.cpp
-src/shopitem.h
-src/simpleanimation.cpp
-src/simpleanimation.h
-src/sound.cpp
-src/sound.h
-src/sprite.h
-src/statuseffect.cpp
-src/statuseffect.h
-src/text.cpp
-src/text.h
-src/textmanager.cpp
-src/textmanager.h
-src/textparticle.cpp
-src/textparticle.h
-src/textrenderer.h
-src/tileset.h
-src/units.cpp
-src/units.h
-src/utils/base64.cpp
-src/utils/base64.h
-src/utils/copynpaste.cpp
-src/utils/copynpaste.h
-src/utils/dtor.h
-src/utils/gettext.h
-src/utils/mathutils.h
-src/utils/mkdir.cpp
-src/utils/mkdir.h
-src/utils/mutex.h
-src/utils/path.cpp
-src/utils/path.h
-src/utils/physfsrwops.c
-src/utils/physfsrwops.h
-src/utils/sha256.cpp
-src/utils/sha256.h
-src/utils/specialfolder.cpp
-src/utils/specialfolder.h
-src/utils/stringutils.cpp
-src/utils/stringutils.h
-src/utils/xml.cpp
-src/utils/xml.h
-src/utils/zlib.cpp
-src/utils/zlib.h
-src/variabledata.h
-src/vector.cpp
-src/vector.h
-src/winver.h
-tools/adler32.c
-tools/dyecmd/CMakeLists.txt
-tools/dyecmd/src/CMakeLists.txt
-tools/dyecmd/src/dye.cpp
-tools/dyecmd/src/dye.h
-tools/dyecmd/src/dyecmd.cpp
-tools/dyecmd/src/imagewriter.cpp
-tools/dyecmd/src/imagewriter.h
-tools/tmxcopy/base64.cpp
-tools/tmxcopy/base64.h
-tools/tmxcopy/map.cpp
-tools/tmxcopy/readme.txt
-tools/tmxcopy/tmx_random_fill.cpp
-tools/tmxcopy/tmxcollide.cpp
-tools/tmxcopy/tmxcopy.cpp
-tools/tmxcopy/tostring.h
-tools/tmxcopy/xmlutils.cpp
-tools/tmxcopy/xmlutils.h
-tools/tmxcopy/zlibutils.cpp
-tools/tmxcopy/zlibutils.h
diff --git a/mana.includes b/mana.includes
deleted file mode 100644
index eca337e1..00000000
--- a/mana.includes
+++ /dev/null
@@ -1,3 +0,0 @@
-src
-/usr/include/libxml2
-/usr/include/SDL
diff --git a/po/ru.po b/po/ru.po
index dd117c6d..3029ba80 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -2,41 +2,39 @@
# Copyright (c) 2008 Rosetta Contributors and Canonical Ltd 2008
# This file is distributed under the same license as the mana package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
+# Kenny690 <bio_editor@mail.ru>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: mana\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-02-08 16:46+0100\n"
-"PO-Revision-Date: 2011-02-23 01:02+0500\n"
-"Last-Translator: Mpa4Hu <ymen9@pisem.net>\n"
-"Language-Team: Russian <ru@li.org>\n"
+"PO-Revision-Date: 2013-06-15 14:34+0600\n"
+"Last-Translator: Kenny690 <bio_editor@mail.ru>\n"
+"Language-Team: русский <bio_editor@mail.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\n"
"X-Launchpad-Export-Date: 2010-03-05 19:28+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#: ../src/main.cpp:45
msgid " to the mana client."
-msgstr ""
+msgstr " клиента mana."
#: ../src/main.cpp:44
msgid " used to set custom parameters"
-msgstr ""
+msgstr " Используется для свободной настройки"
#: ../src/main.cpp:62
msgid " --chat-log-dir : Chat log dir to use"
-msgstr ""
+msgstr " --chat-log-dir : Директория для сохранения чата"
#: ../src/main.cpp:61
msgid " --localdata-dir : Directory to use as local data directory"
-msgstr ""
-" --localdata-dir : Директория для использования в качестве локальных "
-"данных"
+msgstr " --localdata-dir : Директория для сохранения локальных данных"
#: ../src/main.cpp:65
msgid " --no-opengl : Disable OpenGL for this session"
@@ -48,15 +46,15 @@ msgstr " --screenshot-dir : Директория для скриншотов
#: ../src/main.cpp:56
msgid " --update-host : Use this update host"
-msgstr " --update-host : Use this update host"
+msgstr " --update-host : Используйте для обновления хоста"
#: ../src/main.cpp:50
msgid " -C --config-dir : Configuration directory to use"
-msgstr " -C --config-dir : конфигурация директории"
+msgstr " -C --config-dir : конфигурация используемой директории"
#: ../src/main.cpp:57
msgid " -D --default : Choose default character server and character"
-msgstr " -D --default : Выберите сервер и персонажа по умолчанию"
+msgstr " -D --default : Выберать сервер и персонажа по умолчанию"
#: ../src/main.cpp:52
msgid " -P --password : Login with this password"
@@ -64,7 +62,7 @@ msgstr " -P --password : Войти с этим паролем"
#: ../src/main.cpp:51
msgid " -U --username : Login with this username"
-msgstr " -U --username : Войти с именем пользователя"
+msgstr " -U --username : Войти с эти именем пользователя"
#: ../src/main.cpp:53
msgid " -c --character : Login with this character"
@@ -80,7 +78,7 @@ msgstr " -h --help : Отображает этот текст"
#: ../src/main.cpp:55
msgid " -p --port : Login server port"
-msgstr " -p --port : порт сервера"
+msgstr " -p --port : Порт сервера"
#: ../src/main.cpp:54
msgid " -s --server : Login server name or IP"
@@ -88,16 +86,16 @@ msgstr " -s --server : Имя сервера или IP"
#: ../src/main.cpp:59
msgid " -u --skip-update : Skip the update downloads"
-msgstr " -u --skip-update : пропустить скачивание обновлений"
+msgstr " -u --skip-update : Пропустить скачивание обновлений"
#: ../src/main.cpp:48
msgid " -v --version : Display the version"
-msgstr " -v --version : показать версию"
+msgstr " -v --version : Показать версию"
#: ../src/net/manaserv/partyhandler.cpp:126
#, c-format
msgid " on invitation from %s"
-msgstr ""
+msgstr " приглашен пользователем %s"
#: ../src/gui/updaterwindow.cpp:421
msgid "##1 It is strongly recommended that"
@@ -105,26 +103,26 @@ msgstr "##1 Настоятельно рекомендуется"
#: ../src/gui/updaterwindow.cpp:419
msgid "##1 The update process is incomplete."
-msgstr "##1 Процесс обновления не завершен!"
+msgstr "##1 Процесс обновления не завершен."
#: ../src/gui/updaterwindow.cpp:423
msgid "##1 you try again later."
-msgstr "##1 попробуйте позднее."
+msgstr "##1 попробовать позднее."
#: ../src/net/tmwa/generalhandler.cpp:245
-#, fuzzy, no-c-format
+#, no-c-format
msgid "% Accuracy"
msgstr "% Точность"
#: ../src/net/tmwa/generalhandler.cpp:249
-#, fuzzy, no-c-format
+#, no-c-format
msgid "% Critical"
msgstr "% Критический"
#: ../src/net/tmwa/generalhandler.cpp:247
-#, fuzzy, no-c-format
+#, no-c-format
msgid "% Evade"
-msgstr "% Уварот"
+msgstr "% Уворот"
#: ../src/gui/debugwindow.cpp:59
#, c-format
@@ -139,22 +137,22 @@ msgstr "%d FPS (OpenGL)"
#: ../src/client.cpp:1160 ../src/client.cpp:1188
#, c-format
msgid "%s doesn't exist and can't be created! Exiting."
-msgstr ""
+msgstr "%s не существует и не может быть создан! Выход."
#: ../src/net/manaserv/chathandler.cpp:314
#, c-format
msgid "%s entered the channel."
-msgstr "%s вступил в канал"
+msgstr "%s вошел в канал."
#: ../src/gui/socialwindow.cpp:601
#, c-format
msgid "%s has invited you to join the %s party."
-msgstr "%s приглашает присоединиться к %s группе."
+msgstr "%s приглашает присоединиться к группе \"%s\"."
#: ../src/gui/socialwindow.cpp:558
#, c-format
msgid "%s has invited you to join the guild %s."
-msgstr "%s приглашает присоединиться в гильдию к %s ."
+msgstr "%s приглашает присоединиться в гильдию \"%s\"."
#: ../src/gui/socialwindow.cpp:596
#, c-format
@@ -164,27 +162,27 @@ msgstr "%s приглашает вас к себе в группу."
#: ../src/net/manaserv/chathandler.cpp:345
#, c-format
msgid "%s has kicked %s."
-msgstr ""
+msgstr "%s кикнул %s."
#: ../src/net/tmwa/partyhandler.cpp:247
#, c-format
msgid "%s has left your party."
-msgstr "%s вышел из группы"
+msgstr "%s вышел из группы."
#: ../src/net/manaserv/chathandler.cpp:335
#, c-format
msgid "%s has set mode %s on user %s."
-msgstr ""
+msgstr "%s использовал %s на пользователе %s."
#: ../src/net/tmwa/partyhandler.cpp:120
#, c-format
msgid "%s is already a member of a party."
-msgstr "%s уже является членом группы"
+msgstr "%s уже является членом группы."
#: ../src/net/manaserv/partyhandler.cpp:157
-#, fuzzy, c-format
+#, c-format
msgid "%s is already in a party."
-msgstr "%s уже является членом группы"
+msgstr "%s уже является членом группы."
#: ../src/net/tmwa/partyhandler.cpp:369
#, c-format
@@ -197,14 +195,14 @@ msgid "%s is now a member of your party."
msgstr "%s теперь является членом вашей группы."
#: ../src/net/manaserv/partyhandler.cpp:128
-#, fuzzy, c-format
+#, c-format
msgid "%s joined the party%s."
-msgstr "%s теперь в группе."
+msgstr "%s присоединился к группе %s."
#: ../src/net/manaserv/chathandler.cpp:319
#, c-format
msgid "%s left the channel."
-msgstr ""
+msgstr "%s покинул канал."
#: ../src/net/tmwa/partyhandler.cpp:124
#, c-format
@@ -220,7 +218,7 @@ msgstr "%s отклонил ваше приглашение."
#: ../src/net/tmwa/tradehandler.cpp:110
#, c-format
msgid "%s wants to trade with you, do you accept?"
-msgstr "%s хочет торговатся с вами, вы принимаете?"
+msgstr "%s хочет поторговаться с вами, вы принимаете?"
#: ../src/gui/widgets/chattab.cpp:190
#, c-format
@@ -253,11 +251,11 @@ msgstr "-- Помощь --"
#: ../src/commandhandler.cpp:200
msgid "/announce > Global announcement (GM only)"
-msgstr "/announce > Глобальное извещение (доступно только админу)"
+msgstr "/announce > Глобальное извещение (доступно только для GM)"
#: ../src/commandhandler.cpp:181
msgid "/away > Tell the other whispering players you're away from keyboard."
-msgstr ""
+msgstr "/away > Сказать всем шепчущимся игрокам, что вы отошли."
#: ../src/commandhandler.cpp:172
msgid "/clear > Clears this window"
@@ -265,7 +263,7 @@ msgstr "/clear > Очищает это окно"
#: ../src/gui/widgets/whispertab.cpp:74
msgid "/close > Close the whisper tab"
-msgstr "/close > Закрыть вкладку перешептывания"
+msgstr "/close > Закрыть вкладку перешептывания."
#: ../src/commandhandler.cpp:190
msgid "/createparty > Create a new party"
@@ -273,7 +271,7 @@ msgstr "/createparty > Создать группу"
#: ../src/net/tmwa/gui/partytab.cpp:64
msgid "/exp > Show/change party experience sharing options"
-msgstr "/exp > Показать/Скрыть текущее состояние распределения опыта в группе"
+msgstr "/exp > Показать/скрыть текущее состояние распределения опыта в группе."
#: ../src/commandhandler.cpp:166
msgid "/help > Display this help"
@@ -281,15 +279,15 @@ msgstr "/help > Отображает этот текст"
#: ../src/net/tmwa/gui/guildtab.cpp:61 ../src/net/tmwa/gui/partytab.cpp:59
msgid "/help > Display this help."
-msgstr "/help > Показать сию справку"
+msgstr "/help > Показать эту справку"
#: ../src/gui/widgets/whispertab.cpp:72
msgid "/ignore > Ignore the other player"
-msgstr "/ignore > Игнорировать игрока"
+msgstr "/ignore > Игнорировать другого игрока"
#: ../src/commandhandler.cpp:184
msgid "/ignore > ignore a player"
-msgstr "/ignore > игнорировать игрока"
+msgstr "/ignore > Игнорировать игрока"
#: ../src/net/tmwa/gui/guildtab.cpp:62
msgid "/invite > Invite a player to your guild"
@@ -302,7 +300,7 @@ msgstr "/invite > Пригласить игрока в вашу группу"
#: ../src/net/tmwa/gui/partytab.cpp:63
msgid "/item > Show/change party item sharing options"
msgstr ""
-"/item > Показать/Скрыть текущее состояние распределения предметов в группе"
+"/item > Показать/cкрыть текущее состояние распределения предметов в группе"
#: ../src/commandhandler.cpp:188
msgid "/join > Join or create a channel"
@@ -310,15 +308,15 @@ msgstr "/join > Создать или присоединиться к канал
#: ../src/gui/widgets/channeltab.cpp:52
msgid "/kick > Kick a user from the channel"
-msgstr "/kick > Вышвырнуть пользователя с канала"
+msgstr "/kick > Кикнуть пользователя с канала"
#: ../src/net/tmwa/gui/guildtab.cpp:64
msgid "/kick > Kick some one from the guild you are in"
-msgstr "/kick > Вышвырнуть кого-либо из вашей текущей гильдии"
+msgstr "/kick > Кикнуть кого-либо из вашей текущей гильдии"
#: ../src/net/tmwa/gui/partytab.cpp:62
msgid "/kick > Kick some one from the party you are in"
-msgstr "/kick > Вышвырнуть кого-либо из вашей текущей группы"
+msgstr "/kick > Кикнуть кого-либо из вашей текущей группы"
#: ../src/net/tmwa/gui/guildtab.cpp:63
msgid "/leave > Leave the guild you are in"
@@ -330,7 +328,7 @@ msgstr "/leave > Покинуть текущую группу"
#: ../src/commandhandler.cpp:187
msgid "/list > Display all public channels"
-msgstr "/list > Показать список каналов"
+msgstr "/list > Показать список публичных каналов"
#: ../src/commandhandler.cpp:170
msgid "/me > Tell something about yourself"
@@ -351,16 +349,16 @@ msgstr "Пригласить пользователя на канал"
#: ../src/commandhandler.cpp:197
msgid "/present > Get list of players present (sent to chat log, if logging)"
msgstr ""
-"/present > Показывает список игроков он-лайн (посылается в окно чата, если "
+"/present > Показывает список игроков онлайн (посылается в окно чата, если "
"включен лог)"
#: ../src/commandhandler.cpp:179
msgid "/q > Alias of query"
-msgstr "/q> Вариант query"
+msgstr "/q> Псевдоним запроса"
#: ../src/commandhandler.cpp:177
msgid "/query > Makes a tab for private messages with another user"
-msgstr "/query> Создает вкладку для чата с пользователем."
+msgstr "/query> Создает вкладку для приватного чата с пользователем."
#: ../src/gui/widgets/channeltab.cpp:50
msgid "/quit > Leave a channel"
@@ -372,7 +370,7 @@ msgstr "/record > Записывать чат во внешний файл"
#: ../src/commandhandler.cpp:195
msgid "/toggle > Determine whether <return> toggles the chat log"
-msgstr ""
+msgstr "/toggle > Определяет переключает ли <return> чат."
#: ../src/gui/widgets/channeltab.cpp:49
msgid "/topic > Set the topic of the current channel"
@@ -380,7 +378,7 @@ msgstr "/topic > Задать тему текущего канала"
#: ../src/gui/widgets/whispertab.cpp:73
msgid "/unignore > Stop ignoring the other player"
-msgstr "/unignore > Прекратить игнорировать игрока"
+msgstr "/unignore > Прекратить игнорировать другого игрока"
#: ../src/commandhandler.cpp:185
msgid "/unignore > stop ignoring a player"
@@ -404,7 +402,7 @@ msgstr "/whisper > Вариант команды msg"
#: ../src/commandhandler.cpp:169
msgid "/who > Display number of online users"
-msgstr "/who > Отображает количество пользователей он-лайн"
+msgstr "/who > Отображает количество пользователей онлайн"
#: ../src/gui/outfitwindow.cpp:66
msgid "<"
@@ -415,20 +413,24 @@ msgid ""
"<policy> can be one of \"1\", \"yes\", \"true\" to enable experience "
"sharing, or \"0\", \"no\", \"false\" to disable experience sharing."
msgstr ""
+"<policy> Может быть только \"1\", \"yes\", \"true\" чтобы включить передачу "
+"опыта или \"0\", \"no\", \"false\" для прекращения передачи опыта."
#: ../src/net/tmwa/gui/partytab.cpp:87
msgid ""
"<policy> can be one of \"1\", \"yes\", \"true\" to enable item sharing, or "
"\"0\", \"no\", \"false\" to disable item sharing."
msgstr ""
+"<policy> может быть только \"1\", \"yes\", \"true\" для включения передачи "
+"предметов, или \"0\", \"no\", \"false\" для отключения передачи предметов."
#: ../src/commandhandler.cpp:308
msgid ""
"<state> can be one of \"1\", \"yes\", \"true\" to turn the toggle on, or "
"\"0\", \"no\", \"false\" to turn the toggle off."
msgstr ""
-"<режим> может быть \"1\", \"yes\", \"true\" дабы включить опцию или \"0\", "
-"\"no\", \"false\" чтобы выключить."
+"<state> может быть \"1\", \"yes\", \"true\" для включения опции или \"0\", "
+"\"no\", \"false\" для выключения."
#: ../src/gui/outfitwindow.cpp:67
msgid ">"
@@ -447,14 +449,13 @@ msgid "Accept Party Invite"
msgstr "Принять приглашение в группу"
#: ../src/gui/socialwindow.cpp:463
-#, fuzzy
msgid "Accepted guild invite"
-msgstr "Принять приглашение в гильдию"
+msgstr "Принятое приглашение в гильдию"
#: ../src/gui/socialwindow.cpp:444
#, c-format
msgid "Accepted party invite from %s."
-msgstr "Принято приглашение от %s."
+msgstr "Принято приглашение в группу от %s."
#: ../src/game.cpp:709
msgid "Accepting incoming trade requests"
@@ -462,12 +463,11 @@ msgstr "Принимать предложения о торговле"
#: ../src/net/manaserv/tradehandler.cpp:95
msgid "Accepting incoming trade requests."
-msgstr "Входящих запросов торговли принимаются."
+msgstr "Принимать предложения о торговле."
#: ../src/net/tmwa/charserverhandler.cpp:103
msgid "Access denied. Most likely, there are too many players on this server."
-msgstr ""
-"Отказано в доступе. Скорее всего, слишком много игроков на этом сервере."
+msgstr "Отказано в доступе. Скорее всего, на сервере слишком много игроков."
#: ../src/gui/charselectdialog.cpp:120
msgid "Account and Character Management"
@@ -483,21 +483,21 @@ msgstr "Учётная запись заблокирована"
#: ../src/net/tmwa/loginhandler.cpp:162
msgid "Account expired."
-msgstr ""
+msgstr "Учётной записи просрочена."
#: ../src/net/manaserv/loginhandler.cpp:129
#: ../src/net/manaserv/loginhandler.cpp:160
msgid "Account not connected. Please login first."
-msgstr ""
+msgstr "Аккаунт не подключен. Пожалуйста, сперва залогиньтесь."
#: ../src/net/tmwa/loginhandler.cpp:86
msgid "Account was not found. Please re-login."
-msgstr ""
+msgstr "Аккаунт не найден. Пожалуйста залогиньтесь снова."
#: ../src/gui/changeemaildialog.cpp:49 ../src/gui/changepassworddialog.cpp:52
#, c-format
msgid "Account: %s"
-msgstr "Учётная запись: %s"
+msgstr "Аккаунт: %s"
#: ../src/gui/inventorywindow.cpp:107 ../src/gui/popupmenu.cpp:378
msgid "Activate"
@@ -508,13 +508,12 @@ msgid "Add"
msgstr "Добавить"
#: ../src/gui/serverdialog.cpp:211
-#, fuzzy
msgid "Add custom Server..."
-msgstr "Собственный сервер"
+msgstr "Добавить свой сервер"
#: ../src/gui/popupmenu.cpp:175
msgid "Add name to chat"
-msgstr "Добавить в чат"
+msgstr "Добавить имя в чат"
#: ../src/gui/popupmenu.cpp:194 ../src/gui/popupmenu.cpp:399
msgid "Add to chat"
@@ -522,7 +521,7 @@ msgstr "Добавить в чат"
#: ../src/gui/customserverdialog.cpp:55
msgid "Address:"
-msgstr ""
+msgstr "Адрес:"
#: ../src/net/manaserv/attributes.cpp:179
#: ../src/net/tmwa/generalhandler.cpp:231
@@ -530,9 +529,9 @@ msgid "Agility"
msgstr "Ловкость"
#: ../src/net/manaserv/attributes.cpp:186
-#, fuzzy, c-format
+#, c-format
msgid "Agility %+.1f"
-msgstr "Ловкость %+d"
+msgstr "Ловкость %+.1f"
#: ../src/net/tmwa/generalhandler.cpp:103
#, c-format
@@ -561,7 +560,7 @@ msgstr "Разрешить торговлю"
#: ../src/gui/setup_players.cpp:226
msgid "Allow whispers"
-msgstr "Разрешить шептание"
+msgstr "Разрешить шепот"
#: ../src/net/manaserv/loginhandler.cpp:95
#: ../src/net/manaserv/loginhandler.cpp:280
@@ -573,9 +572,8 @@ msgid "Already recording."
msgstr "Запись уже ведётся."
#: ../src/gui/setup_video.cpp:191
-#, fuzzy
msgid "Ambient FX:"
-msgstr "Эффекты окружающей среды"
+msgstr "Эффекты окружающей среды:"
#: ../src/net/tmwa/inventoryhandler.h:84
msgid "Ammo"
@@ -589,7 +587,7 @@ msgstr "Неизвестный член хотел сказать: %s"
#: ../src/net/manaserv/beinghandler.cpp:289
#: ../src/net/tmwa/playerhandler.cpp:113
msgid "Annihilated."
-msgstr "Уничтожены."
+msgstr "Аннигилированы."
#: ../src/gui/setup.cpp:52
msgid "Apply"
@@ -604,8 +602,8 @@ msgid ""
"Applying change to OpenGL requires restart. In case OpenGL messes up your "
"game graphics, restart the game with the command line option \"--no-opengl\"."
msgstr ""
-"Применение изменений в OpenGL требует перезапуски. В случае, если OpenGL не "
-"будет работать, перезагрузите игру с параметром командной строки \"--no-"
+"Переход к OpenGL требует перезагрузки. В случае, если из-за OpenGL "
+"изображение портится, перезагрузите игру из командной строки с опцией \"--no-"
"opengl\"."
#: ../src/gui/charselectdialog.cpp:73
@@ -615,7 +613,7 @@ msgstr "Вы уверены, что хотите удалить этого пе
#: ../src/gui/socialwindow.cpp:164
#, c-format
msgid "Are you sure you want to leave guild %s?"
-msgstr "Вы действительно хотите покинуть %s?"
+msgstr "Вы действительно хотите покинуть гильдию %s?"
#: ../src/gui/socialwindow.cpp:243
#, c-format
@@ -624,7 +622,7 @@ msgstr "Вы действительно хотите покинуть групп
#: ../src/net/tmwa/inventoryhandler.h:66
msgid "Arms"
-msgstr ""
+msgstr "Руки"
#: ../src/gui/setup_keyboard.cpp:89
msgid "Assign"
@@ -634,6 +632,7 @@ msgstr "Назначить"
#, c-format
msgid "At least one statis out of the permitted range: (%u - %u)."
msgstr ""
+"По крайней мере один статический объект вышел из дозволенной зоны: (%u - %u)"
#: ../src/keyboardconfig.cpp:45 ../src/net/tmwa/generalhandler.cpp:238
msgid "Attack"
@@ -651,7 +650,7 @@ msgstr "Атаковать %s"
#: ../src/gui/chatwindow.cpp:334
msgid "Attendance written to record log."
-msgstr ""
+msgstr "Посещаемость записана в журнал."
#: ../src/gui/setup_audio.cpp:47
msgid "Audio"
@@ -663,37 +662,36 @@ msgstr "Ошибка авторизации."
#: ../src/localplayer.cpp:1071
msgid "Away"
-msgstr ""
+msgstr "Отошел"
#: ../src/gui/popupmenu.cpp:101
#, c-format
msgid "Befriend %s"
-msgstr ""
+msgstr "Стать другом %s"
#: ../src/resources/userpalette.cpp:91
msgid "Being"
-msgstr ""
+msgstr "Местонахождения"
#: ../src/gui/debugwindow.cpp:136
-#, fuzzy
msgid "Being collision radius"
-msgstr "Радиус прокрутки"
+msgstr "Радиус местонахождения"
#: ../src/gui/debugwindow.cpp:138
msgid "Being path"
-msgstr ""
+msgstr "Путь до местонахождения"
#: ../src/gui/debugwindow.cpp:137
msgid "Being positions"
-msgstr ""
+msgstr "Позиция местонахождения"
#: ../src/net/tmwa/playerhandler.cpp:125
msgid "Bereft of life, you rest in peace."
-msgstr ""
+msgstr "Лишенный жизни, покойся с миром."
#: ../src/playerrelations.cpp:358 ../src/playerrelations.cpp.orig:344
msgid "Blink name"
-msgstr ""
+msgstr "Название вспышки"
#: ../src/gui/setup_colors.cpp:140
msgid "Blue:"
@@ -705,7 +703,7 @@ msgstr "Пузырьки с названиями"
#: ../src/gui/setup_interface.cpp:90
msgid "Bubbles, no names"
-msgstr "Пузырьки, без названий"
+msgstr "Пузырьки без названий"
#: ../src/gui/buydialog.cpp:50 ../src/gui/buydialog.cpp:79
#: ../src/gui/buyselldialog.cpp:47
@@ -734,8 +732,8 @@ msgid ""
"Cannot create a whisper tab for nick \"%s\"! It either already exists, or is "
"you."
msgstr ""
-"Невозможно создать вкладку для личного общения с игроком \"%s\"! Или вкладка "
-"уже создана, или этот игрок вы сами."
+"Невозможно создать вкладку для приватного общения с игроком \"%s\"! Или "
+"вкладка уже создана, или этот игрок: вы."
#: ../src/gui/socialwindow.cpp:620
msgid "Cannot create party. You are already in a party"
@@ -747,19 +745,19 @@ msgstr "Невозможно повысить умение!"
#: ../src/gui/widgets/whispertab.cpp:53
msgid "Cannot send empty chat!"
-msgstr "Низзя послать пустое сообщение!"
+msgstr "Нельзя послать пустое сообщение!"
#: ../src/commandhandler.cpp:400
msgid "Cannot send empty whispers!"
-msgstr "Нельзя отправлять пустые сообщения!"
+msgstr "Нельзя отправлять пустые личные сообщения!"
#: ../src/net/tmwa/specialhandler.cpp:160
msgid "Cannot shout!"
-msgstr ""
+msgstr "Нельзя кричать!"
#: ../src/net/tmwa/charserverhandler.cpp:107
msgid "Cannot use this ID."
-msgstr "Низзя использовать данный ID."
+msgstr "Нельзя использовать данный ID."
#: ../src/gui/tradewindow.cpp:103
msgid "Change"
@@ -801,7 +799,8 @@ msgstr "Переключение на OpenGL"
#: ../src/gui/widgets/channeltab.cpp:83
msgid "Channel operators can kick and op other users from the channel."
msgstr ""
-"Операторы канала могут вышвыривать пользователей и делать их операторами."
+"Операторы канала могут кикнуть или сделать операторами других пользователей "
+"канала."
#: ../src/net/tmwa/chathandler.cpp:265 ../src/net/tmwa/chathandler.cpp:271
#: ../src/net/tmwa/chathandler.cpp:276 ../src/net/tmwa/chathandler.cpp:281
@@ -833,7 +832,7 @@ msgstr "Данные персонажа слишком высоки."
#: ../src/net/manaserv/charhandler.cpp:164
msgid "Character's stats are too low."
-msgstr "Данные персонажа слишком низки"
+msgstr "Данные персонажа слишком низки."
#: ../src/gui/chatwindow.cpp:92
msgid "Chat"
@@ -852,13 +851,12 @@ msgid "Choose"
msgstr "Выбрать"
#: ../src/gui/worldselectdialog.cpp:77
-#, fuzzy
msgid "Choose World"
-msgstr "Выберите сервер"
+msgstr "Выберите Мир"
#: ../src/gui/serverdialog.cpp:188
msgid "Choose Your Server"
-msgstr "Выберите сервер"
+msgstr "Выберите Сервер"
#: ../src/gui/socialwindow.cpp:541
msgid "Choose your guild's name."
@@ -876,11 +874,12 @@ msgstr "Очистить запись"
msgid ""
"Client registration is not allowed. Please contact server administration."
msgstr ""
+"Регистрация клиентов не разрешена. Пожалуйста, проконтактируйте "
+"администратора."
#: ../src/net/tmwa/loginhandler.cpp:172
-#, fuzzy
msgid "Client too old."
-msgstr "Версия клиента устарела."
+msgstr "Клиент устарел."
#: ../src/net/manaserv/loginhandler.cpp:274
#: ../src/net/manaserv/loginhandler.cpp:311
@@ -893,7 +892,7 @@ msgstr "Закрыть"
#: ../src/gui/debugwindow.cpp:135
msgid "Collision tiles"
-msgstr ""
+msgstr "Тайлы с коллизией."
#: ../src/gui/setup_colors.cpp:52
msgid "Colors"
@@ -904,14 +903,12 @@ msgid "Command: /announce <msg>"
msgstr "Команда: /announce <сообщение>"
#: ../src/commandhandler.cpp:273
-#, fuzzy
msgid "Command: /away"
-msgstr "Команда: /who"
+msgstr "Команда: /away"
#: ../src/commandhandler.cpp:270
-#, fuzzy
msgid "Command: /away <afk reason>"
-msgstr "Команда: /w <ник> <сообщение>"
+msgstr "Команда: /away <причина ухода>"
#: ../src/commandhandler.cpp:227
msgid "Command: /clear"
@@ -927,11 +924,11 @@ msgstr "Комманда: /createparty <имя_группы>"
#: ../src/net/tmwa/gui/partytab.cpp:100
msgid "Command: /exp"
-msgstr ""
+msgstr "Команда: /exp"
#: ../src/net/tmwa/gui/partytab.cpp:95
msgid "Command: /exp <policy>"
-msgstr ""
+msgstr "Команда: /exp <политика>"
#: ../src/commandhandler.cpp:208
msgid "Command: /help"
@@ -947,19 +944,19 @@ msgstr "Команда: /ignore"
#: ../src/commandhandler.cpp:232
msgid "Command: /ignore <player>"
-msgstr "Комманда: /ignore <пользователь>"
+msgstr "Команда: /ignore <пользователь>"
#: ../src/net/tmwa/gui/guildtab.cpp:73 ../src/net/tmwa/gui/partytab.cpp:73
msgid "Command: /invite <nick>"
-msgstr "Комманда: /invite <игрок>"
+msgstr "Команда: /invite <ник>"
#: ../src/net/tmwa/gui/partytab.cpp:90
msgid "Command: /item"
-msgstr ""
+msgstr "Команда: /item"
#: ../src/net/tmwa/gui/partytab.cpp:85
msgid "Command: /item <policy>"
-msgstr ""
+msgstr "Команда: /item <политика>"
#: ../src/commandhandler.cpp:238
msgid "Command: /join <channel>"
@@ -967,11 +964,11 @@ msgstr "Команда: /join <канал>"
#: ../src/gui/widgets/channeltab.cpp:88
msgid "Command: /kick <nick>"
-msgstr "Комманда: /kick <имя персонажа>"
+msgstr "Команда: /kick <имя персонажа>"
#: ../src/net/tmwa/gui/guildtab.cpp:80 ../src/net/tmwa/gui/partytab.cpp:80
msgid "Command: /leave"
-msgstr "Комманда: /leave"
+msgstr "Команда: /leave"
#: ../src/commandhandler.cpp:244
msgid "Command: /list"
@@ -979,23 +976,23 @@ msgstr "Команда: /list"
#: ../src/commandhandler.cpp:249
msgid "Command: /me <message>"
-msgstr "Комманда: /me <сообщение>"
+msgstr "Команда: /me <сообщение>"
#: ../src/commandhandler.cpp:254
msgid "Command: /msg <nick> <message>"
-msgstr "Комманда: /msg <имя персонажа> <сообщение>"
+msgstr "Команда: /msg <имя персонажа> <сообщение>"
#: ../src/gui/widgets/channeltab.cpp:79
msgid "Command: /op <nick>"
-msgstr "Комманда: /op <имя>"
+msgstr "Команда: /op <имя>"
#: ../src/commandhandler.cpp:283
msgid "Command: /party <nick>"
-msgstr "Комманда: /party <имя>"
+msgstr "Команда: /party <имя>"
#: ../src/commandhandler.cpp:290
msgid "Command: /present"
-msgstr "Комманда: /present"
+msgstr "Команда: /present"
#: ../src/commandhandler.cpp:264
msgid "Command: /q <nick>"
@@ -1007,7 +1004,7 @@ msgstr "Команда: /query <имя персонажа>"
#: ../src/gui/widgets/channeltab.cpp:72
msgid "Command: /quit"
-msgstr "Комманда: /quit"
+msgstr "Команда: /quit"
#: ../src/commandhandler.cpp:300
msgid "Command: /record"
@@ -1023,19 +1020,19 @@ msgstr "Команда: /toggle"
#: ../src/commandhandler.cpp:305
msgid "Command: /toggle <state>"
-msgstr "Комманда: /toggle <режим>"
+msgstr "Команда: /toggle <режим>"
#: ../src/gui/widgets/channeltab.cpp:67
msgid "Command: /topic <message>"
-msgstr "Комманда: /topic <сообщение>"
+msgstr "Команда: /topic <сообщение>"
#: ../src/commandhandler.cpp:316 ../src/gui/widgets/whispertab.cpp:95
msgid "Command: /unignore <player>"
-msgstr "Комманда: /unignore <имя_игрока>"
+msgstr "Команда: /unignore <имя_игрока>"
#: ../src/gui/widgets/channeltab.cpp:62
msgid "Command: /users"
-msgstr "Комманды: /users"
+msgstr "Команда: /users"
#: ../src/commandhandler.cpp:256
msgid "Command: /w <nick> <message>"
@@ -1105,16 +1102,16 @@ msgstr "Соединение..."
#: ../src/net/tmwa/network.cpp:405
msgid "Connection to server terminated. "
-msgstr "Подключение к карт прекращено"
+msgstr "Подключение к серверу прекращено."
#: ../src/keyboardconfig.cpp:84
msgid "Copy Outfit"
-msgstr ""
+msgstr "Скопировать наряд"
#: ../src/gui/statuswindow.cpp:260
-#, fuzzy, c-format
+#, c-format
msgid "Correction points: %d"
-msgstr "Очков навыков: %d"
+msgstr "Очков корректировки: %d"
#: ../src/game.cpp:937
msgid "Could Not Load Map"
@@ -1125,9 +1122,8 @@ msgid "Could not create party."
msgstr "Не удалось создать группу."
#: ../src/net/tmwa/guildhandler.cpp:296
-#, fuzzy
msgid "Could not invite user to guild."
-msgstr "Не удалось пригласить пользователя в гильдию."
+msgstr "Невозможно пригласить пользователя в гильдию."
#: ../src/net/tmwa/specialhandler.cpp:157
msgid "Could not join party!"
@@ -1135,7 +1131,7 @@ msgstr "Невозможно присоединиться к группе!"
#: ../src/net/tmwa/specialhandler.cpp:211
msgid "Could not steal anything..."
-msgstr "Нечего не удалось украсть..."
+msgstr "Ничего не удалось украсть..."
#: ../src/gui/charcreatedialog.cpp:85 ../src/gui/charselectdialog.cpp:416
#: ../src/gui/socialwindow.cpp:330
@@ -1157,7 +1153,7 @@ msgstr "Создать группу"
#: ../src/gui/socialwindow.cpp:503
#, c-format
msgid "Creating guild called %s."
-msgstr "Создаетса гилдия %s."
+msgstr "Создание гильдии под названием %s."
#: ../src/gui/socialwindow.cpp:496
msgid "Creating guild failed, please choose a shorter name."
@@ -1166,11 +1162,11 @@ msgstr "Создание гильдии не удалось, пожалуйст
#: ../src/gui/socialwindow.cpp:526
#, c-format
msgid "Creating party called %s."
-msgstr "Создание группи %s."
+msgstr "Создание группы %s."
#: ../src/gui/socialwindow.cpp:519
msgid "Creating party failed, please choose a shorter name."
-msgstr "Создание группи не удалось, пожалуйста, выберите более короткое имя."
+msgstr "Создание группы не удалось, пожалуйста, выберите более короткое имя."
#: ../src/resources/userpalette.cpp:105
msgid "Critical Hit"
@@ -1224,7 +1220,6 @@ msgid "Delete"
msgstr "Удалить"
#: ../src/gui/customserverdialog.cpp:58
-#, fuzzy
msgid "Description:"
msgstr "Описание: %s"
@@ -1234,9 +1229,9 @@ msgid "Dexterity"
msgstr "Ловкость"
#: ../src/net/manaserv/attributes.cpp:199
-#, fuzzy, c-format
+#, c-format
msgid "Dexterity %+.1f"
-msgstr "Ловкость %+d"
+msgstr "Ловкость %+.1f"
#: ../src/net/tmwa/generalhandler.cpp:106
#, c-format
@@ -1254,16 +1249,16 @@ msgstr "Отключить прозрачность (режим низкой н
#: ../src/gui/popupmenu.cpp:106
#, c-format
msgid "Disregard %s"
-msgstr ""
+msgstr "Игнорировать %s"
#: ../src/gui/setup_players.cpp:66
msgid "Disregarded"
-msgstr ""
+msgstr "Проигнорирован"
#: ../src/net/manaserv/beinghandler.cpp:287
#: ../src/net/tmwa/playerhandler.cpp:109
msgid "Do you want your possessions identified?"
-msgstr ""
+msgstr "Вы хотите, чтобы вашу собственность идентифицировали?"
#: ../src/gui/setup_audio.cpp:43
msgid "Download music"
@@ -1272,7 +1267,7 @@ msgstr "Скачать музыку"
#: ../src/gui/serverdialog.cpp:404
#, c-format
msgid "Downloading server list...%2.2f%%"
-msgstr "Загрузка список серверов...%2.2f%%"
+msgstr "Загрузка списка серверов...%2.2f%%"
#: ../src/gui/inventorywindow.cpp:381 ../src/gui/popupmenu.cpp:385
msgid "Drop"
@@ -1289,15 +1284,15 @@ msgstr "Дублированный логин."
#: ../src/client.cpp:941
msgid "Email Change"
-msgstr "Сменить E-MAIL"
+msgstr "Сменить email."
#: ../src/net/manaserv/loginhandler.cpp:320
msgid "Email address already exists."
-msgstr "E-mail уже зарегистрирован."
+msgstr "Email адрес уже зарегистрирован."
#: ../src/client.cpp:942
msgid "Email changed successfully!"
-msgstr "E-mail успешно изменена!"
+msgstr "E-mail успешно изменен!"
#: ../src/gui/register.cpp:100
msgid "Email:"
@@ -1323,12 +1318,11 @@ msgstr "Эмоция не удалась!"
#: ../src/net/tmwa/network.cpp:146
msgid "Empty address given to Network::connect()!"
-msgstr ""
+msgstr "Дан пустой адрес к Network::connect()!"
#: ../src/gui/setup_players.cpp:234
-#, fuzzy
msgid "Enable Chat log"
-msgstr "Низзя продать!"
+msgstr "Включить запись чата"
#: ../src/gui/setup_joystick.cpp:39
msgid "Enable joystick"
@@ -1340,7 +1334,7 @@ msgstr "Разрешить/Запретить торговлю"
#: ../src/net/manaserv/chathandler.cpp:229
msgid "End of channel list."
-msgstr ""
+msgstr "Конец списка каналов."
#: ../src/gui/changepassworddialog.cpp:110
msgid "Enter the old password first."
@@ -1357,7 +1351,7 @@ msgstr "Надеть"
#: ../src/net/tmwa/playerhandler.cpp:507
msgid "Equip arrows first."
-msgstr "Сначала оденьте стрелы"
+msgstr "Сначала экипируйте стрелы."
#: ../src/gui/equipmentwindow.cpp:54 ../src/gui/windowmenu.cpp:58
msgid "Equipment"
@@ -1365,7 +1359,7 @@ msgstr "Снаряжение"
#: ../src/keyboardconfig.cpp:73
msgid "Equipment Window"
-msgstr "Окно екипировки"
+msgstr "Окно экипировки"
#: ../src/client.cpp:1042 ../src/gui/changeemaildialog.cpp:156
#: ../src/gui/changepassworddialog.cpp:149 ../src/gui/charcreatedialog.cpp:194
@@ -1383,18 +1377,22 @@ msgid "Error creating guild."
msgstr "Ошибка создания гильдии"
#: ../src/client.cpp:1326
-#, fuzzy, c-format
+#, c-format
msgid ""
"Error creating updates directory!\n"
"(%s)"
-msgstr "Ошибка при создании директории обновления!"
+msgstr ""
+"Ошибка при создании директории обновления!\n"
+"(%s)"
#: ../src/client.cpp:1334
-#, fuzzy, c-format
+#, c-format
msgid ""
"Error creating updates directory!\n"
"(%s/%s)"
-msgstr "Ошибка при создании директории обновления!"
+msgstr ""
+"Ошибка при создании директории обновления!\n"
+"(%s/%s)"
#: ../src/net/manaserv/chathandler.cpp:211
msgid "Error joining channel."
@@ -1415,55 +1413,58 @@ msgstr "Сообщение об изменении опыта"
#: ../src/gui/statuswindow.cpp:126
msgid "Exp:"
-msgstr "Exp:"
+msgstr "Опыт:"
#: ../src/net/tmwa/gui/partytab.cpp:170 ../src/net/tmwa/partyhandler.cpp:179
msgid "Experience sharing disabled."
-msgstr ""
+msgstr "Передача опыта выключена."
#: ../src/net/tmwa/gui/partytab.cpp:167 ../src/net/tmwa/partyhandler.cpp:173
msgid "Experience sharing enabled."
-msgstr ""
+msgstr "Передача опыта включена."
#: ../src/net/tmwa/gui/partytab.cpp:173 ../src/net/tmwa/partyhandler.cpp:185
msgid "Experience sharing not possible."
-msgstr ""
+msgstr "Передача опыта невозможна."
#: ../src/net/tmwa/gui/partytab.cpp:176
msgid "Experience sharing unknown."
-msgstr ""
+msgstr "Передача опыта неизвестна."
#: ../src/gui/setup_video.cpp:171
msgid "FPS limit:"
-msgstr "FPS Предел:"
+msgstr "Лимит FPS:"
#: ../src/net/tmwa/tradehandler.cpp:211
msgid "Failed adding item for unknown reason."
-msgstr ""
+msgstr "Добавление предмета провалилось по неизвестным причинам."
#: ../src/net/tmwa/tradehandler.cpp:207
msgid "Failed adding item. Trade partner has no free slot."
-msgstr ""
+msgstr "Добавление предмета провалилось. Партнёр не имеет свободных слотов."
#: ../src/net/tmwa/tradehandler.cpp:202
msgid "Failed adding item. Trade partner is over weighted."
-msgstr ""
+msgstr "Добавление предмета провалилось. Партнёр перегружен."
#: ../src/gui/tradewindow.cpp:262
msgid "Failed adding item. You can not overlap one kind of item on the window."
msgstr ""
+"Добавление предмета провалилось. Вы не можете перекрыть один тип объекта на "
+"окне."
#: ../src/net/tmwa/charserverhandler.cpp:134
msgid "Failed to create character. Most likely the name is already taken."
-msgstr "Невозможно создать персонажа. Скорее всего, таке имя уже используется."
+msgstr ""
+"Создание персонажа провалилось. Скорее всего, такое имя уже используется."
#: ../src/net/tmwa/charserverhandler.cpp:151
msgid "Failed to delete character."
-msgstr "Невозможно удалить персонажа"
+msgstr "Удаление персонажа провалилось."
#: ../src/net/manaserv/guildhandler.cpp:209
msgid "Failed to promote member."
-msgstr ""
+msgstr "Активизирование участника провалилось."
#: ../src/gui/npcpostdialog.cpp:99
msgid "Failed to send as sender or letter invalid."
@@ -1484,12 +1485,12 @@ msgstr ""
msgid ""
"Failed to switch to windowed mode and restoration of old mode also failed!"
msgstr ""
-"Не удалось перейти в окновой режим и восстановить старый режим тоже не "
+"Не удалось перейти в оконный режим и восстановить старый режим тоже не "
"удалось!"
#: ../src/net/tmwa/inventoryhandler.cpp:287
msgid "Failed to use item."
-msgstr ""
+msgstr "Не удалось использовать предмет."
#: ../src/client.cpp:962
msgid "Farewell, come back any time..."
@@ -1497,7 +1498,7 @@ msgstr "Прощайте, возвращайтесь в любое время...
#: ../src/net/tmwa/inventoryhandler.h:72
msgid "Feet"
-msgstr ""
+msgstr "Ноги"
#: ../src/gui/charcreatedialog.cpp:88 ../src/gui/register.cpp:91
msgid "Female"
@@ -1508,9 +1509,8 @@ msgid "Finishing recording."
msgstr "Запись завершена."
#: ../src/gui/setup_interface.cpp:130
-#, fuzzy
msgid "Font size:"
-msgstr "Размер шрифта"
+msgstr "Размер шрифта:"
#: ../src/commandhandler.cpp:204
msgid "For more information, type /help <command>."
@@ -1552,7 +1552,7 @@ msgstr "Глобальное объявление:"
#: ../src/net/tmwa/generalhandler.cpp:209
msgid "Got disconnected from server!"
-msgstr "Отключено от сервера!"
+msgstr "Отключен от сервера!"
#: ../src/gui/setup_colors.cpp:125
msgid "Green:"
@@ -1560,7 +1560,7 @@ msgstr "Зеленый:"
#: ../src/gui/debugwindow.cpp:134
msgid "Grid"
-msgstr ""
+msgstr "Сетка"
#: ../src/gui/setup_interface.cpp:129
msgid "Gui opacity"
@@ -1573,12 +1573,11 @@ msgstr "Гильдия"
#: ../src/gui/socialwindow.cpp:139
#, c-format
msgid "Guild %s quit requested."
-msgstr ""
+msgstr "Выход из гильдия %s запрошен."
#: ../src/resources/userpalette.cpp:98
-#, fuzzy
msgid "Guild Members"
-msgstr "Гильдия"
+msgstr "Участники гильдия"
#: ../src/gui/socialwindow.cpp:540
msgid "Guild Name"
@@ -1603,7 +1602,7 @@ msgstr "HP %+d"
#: ../src/gui/statuswindow.cpp:121
msgid "HP:"
-msgstr "ЖО:"
+msgstr "Жизнь:"
#: ../src/gui/charcreatedialog.cpp:78
msgid "Hair color:"
@@ -1615,15 +1614,15 @@ msgstr "Стрижка:"
#: ../src/net/tmwa/inventoryhandler.h:80
msgid "Hand 1/2"
-msgstr ""
+msgstr "Рука 1/2"
#: ../src/net/tmwa/inventoryhandler.h:82
msgid "Hand 2/2"
-msgstr ""
+msgstr "Рука 2/2"
#: ../src/net/tmwa/inventoryhandler.h:68
msgid "Head"
-msgstr ""
+msgstr "Голова"
#: ../src/gui/helpwindow.cpp:37
msgid "Help"
@@ -1654,11 +1653,11 @@ msgstr "Если <канал> не существует, он будет соз
#: ../src/gui/widgets/channeltab.cpp:81 ../src/gui/widgets/channeltab.cpp:90
#: ../src/net/tmwa/gui/guildtab.cpp:75 ../src/net/tmwa/gui/partytab.cpp:75
msgid "If the <nick> has spaces in it, enclose it in double quotes (\")."
-msgstr "Если ник содержит пробелы, заключите его в кавычки (\")."
+msgstr "Если <ник> содержит пробелы, заключите его в кавычки (\")."
#: ../src/net/tmwa/playerhandler.cpp:126
msgid "If you weren't so animated, you'd be pushing up the daisies."
-msgstr ""
+msgstr "Если вы не были анимированы нормальны, вы будете стоять вверх ногами."
#: ../src/gui/widgets/channeltab.cpp:74
msgid "If you're the last person in the channel, it will be deleted."
@@ -1667,7 +1666,7 @@ msgstr "Если вы - последний пользователь канала
#: ../src/gui/popupmenu.cpp:109
#, c-format
msgid "Ignore %s"
-msgstr "Игнорировано %s"
+msgstr "Игнорировать %s"
#: ../src/keyboardconfig.cpp:104
msgid "Ignore input 1"
@@ -1679,7 +1678,7 @@ msgstr "Игнорировать ввод 2"
#: ../src/gui/setup_players.cpp:67
msgid "Ignored"
-msgstr "Игнорировано"
+msgstr "Проигнорировано"
#: ../src/game.cpp:704
msgid "Ignoring incoming trade requests"
@@ -1687,7 +1686,7 @@ msgstr "Игнорировать предложения о торговле"
#: ../src/net/manaserv/tradehandler.cpp:97
msgid "Ignoring incoming trade requests."
-msgstr "Входящих запросов торговли игнарируютса."
+msgstr "Игнорировать предложения о торговле."
#: ../src/gui/debugwindow.cpp:235 ../src/net/manaserv/charhandler.cpp:212
#: ../src/net/tmwa/charserverhandler.cpp:146
@@ -1712,9 +1711,9 @@ msgid "Intelligence"
msgstr "Интеллект"
#: ../src/net/manaserv/attributes.cpp:225
-#, fuzzy, c-format
+#, c-format
msgid "Intelligence %+.1f"
-msgstr "Интеллект %+d"
+msgstr "Интеллект %+.1f"
#: ../src/net/tmwa/generalhandler.cpp:105
#, c-format
@@ -1727,12 +1726,11 @@ msgstr "Интеллект:"
#: ../src/gui/setup_interface.cpp:120
msgid "Interface"
-msgstr ""
+msgstr "Интерфейс"
#: ../src/net/manaserv/charhandler.cpp:269
-#, fuzzy
msgid "Invalid character slot selected."
-msgstr "Персонаж удален"
+msgstr "Выбран неверный слот персонажа."
#: ../src/net/manaserv/charhandler.cpp:158
msgid "Invalid gender."
@@ -1751,9 +1749,8 @@ msgid "Invalid name."
msgstr "Неверное имя."
#: ../src/net/manaserv/charhandler.cpp:173
-#, fuzzy
msgid "Invalid slot number."
-msgstr "Неверное имя."
+msgstr "Неверный номер слота."
#: ../src/client.cpp:1294
#, c-format
@@ -1769,9 +1766,8 @@ msgid "Inventory Window"
msgstr "Окно инвентаря"
#: ../src/localplayer.cpp:916
-#, fuzzy
msgid "Inventory is full."
-msgstr "Инвентарь"
+msgstr "Инвентарь заполнен."
#: ../src/gui/socialwindow.cpp:331
msgid "Invite"
@@ -1794,17 +1790,18 @@ msgstr "Приглашение отправлено."
#: ../src/gui/socialwindow.cpp:126
#, c-format
msgid "Invited user %s to guild %s."
-msgstr "Пригласить игрока %s в гильдию %s."
+msgstr "Пользователь %s приглашен в гильдию %s."
#: ../src/gui/socialwindow.cpp:207 ../src/net/tmwa/partyhandler.cpp:331
#, c-format
msgid "Invited user %s to party."
-msgstr "Пользователь %s приглашен в группу"
+msgstr "Пользователь %s приглашен в группу"
#: ../src/net/tmwa/partyhandler.cpp:336
#, c-format
msgid "Inviting failed, because you can't see a player called %s."
-msgstr "Приглашение не удалось, потому что вы не можете видеть игрока %s."
+msgstr ""
+"Приглашение не удалось, потому что вы не видите игрока, которого зовёте %s."
#: ../src/keyboardconfig.cpp:58 ../src/keyboardconfig.cpp:59
#: ../src/keyboardconfig.cpp:60 ../src/keyboardconfig.cpp:61
@@ -1814,44 +1811,43 @@ msgstr "Приглашение не удалось, потому что вы н
#: ../src/keyboardconfig.cpp:68 ../src/keyboardconfig.cpp:69
#, c-format
msgid "Item Shortcut %d"
-msgstr "Комбинация клавиш предмета %d"
+msgstr "Горячая клавиша предмета %d"
#: ../src/keyboardconfig.cpp:77
msgid "Item Shortcut Window"
-msgstr "Окно комбинаций клавиш предметов"
+msgstr "Окно горячих клавиш на предметах"
#: ../src/localplayer.cpp:919
msgid "Item belongs to someone else."
-msgstr ""
+msgstr "Предмет принадлежит кому-то другому."
#: ../src/localplayer.cpp:915
msgid "Item is too far away"
-msgstr ""
+msgstr "Предмет находится слишком далеко"
#: ../src/localplayer.cpp:914
msgid "Item is too heavy."
-msgstr ""
+msgstr "Предмет слишком тяжелый."
#: ../src/net/tmwa/gui/partytab.cpp:135 ../src/net/tmwa/partyhandler.cpp:203
msgid "Item sharing disabled."
-msgstr ""
+msgstr "Передача предметов отключена."
#: ../src/net/tmwa/gui/partytab.cpp:132 ../src/net/tmwa/partyhandler.cpp:197
msgid "Item sharing enabled."
-msgstr ""
+msgstr "Передача предметов включена."
#: ../src/net/tmwa/gui/partytab.cpp:138 ../src/net/tmwa/partyhandler.cpp:209
msgid "Item sharing not possible."
-msgstr ""
+msgstr "Передача предметов невозможна."
#: ../src/net/tmwa/gui/partytab.cpp:141
msgid "Item sharing unknown."
-msgstr ""
+msgstr "Передача предметов неизвестна."
#: ../src/client.cpp:787
-#, fuzzy
msgid "ItemDB: Error while loading "
-msgstr "Ошибка во время загрузки %s"
+msgstr "ItemDB: Ошибка загрузки."
#: ../src/gui/statuswindow.cpp:163
msgid "Job:"
@@ -1866,11 +1862,14 @@ msgstr "Профессия: %d"
msgid ""
"Joining party failed, because the invitation has timed out on the server."
msgstr ""
+"Присоединение к группе провалилось, так как срок приглашения истёк на "
+"сервере."
#: ../src/net/manaserv/partyhandler.cpp:102
-#, fuzzy
msgid "Joining party failed, because the inviter has left the game."
-msgstr "Создание группи не удалось, пожалуйста, выберите более короткое имя."
+msgstr ""
+"Присоединение к группе провалилось, так как приглашавший вас пользователь "
+"вышел из игры."
#: ../src/gui/setup_joystick.cpp:41
msgid "Joystick"
@@ -1886,19 +1885,19 @@ msgstr "Клавиатура"
#: ../src/net/tmwa/adminhandler.cpp:64
msgid "Kick failed!"
-msgstr ""
+msgstr "Кик не удался."
#: ../src/gui/popupmenu.cpp:167
msgid "Kick monster"
-msgstr "Вышвырнуть монстра"
+msgstr "Кикнуть монстра"
#: ../src/gui/popupmenu.cpp:145
msgid "Kick player"
-msgstr ""
+msgstr "Кикнуть игрока"
#: ../src/net/tmwa/adminhandler.cpp:66
msgid "Kick succeeded!"
-msgstr ""
+msgstr "Кик успешно произведён!"
#: ../src/gui/setup_interface.cpp:62
msgid "Large"
@@ -1918,7 +1917,7 @@ msgstr "Покинуть группу?"
#: ../src/net/tmwa/inventoryhandler.h:70
msgid "Legs"
-msgstr ""
+msgstr "Ноги"
#: ../src/gui/statuswindow.cpp:117 ../src/gui/statuswindow.cpp:219
#: ../src/gui/statuswindow.cpp:267
@@ -1928,22 +1927,19 @@ msgstr "Уровень: %d"
#: ../src/net/manaserv/chathandler.cpp:217
msgid "Listing channels."
-msgstr "Запрос на присоединение к каналу."
+msgstr "Листинг каналов."
#: ../src/resources/userpalette.cpp:109
-#, fuzzy
msgid "Local Player Critical Hit"
-msgstr "Критический удар"
+msgstr "Локальный игрок совершает критический удар"
#: ../src/resources/userpalette.cpp:107
-#, fuzzy
msgid "Local Player Hits Monster"
-msgstr "Удары игрока по монстру"
+msgstr "Локальный игрок бьёт монстра"
#: ../src/resources/userpalette.cpp:111
-#, fuzzy
msgid "Local Player Miss"
-msgstr "Сохранить список игроков"
+msgstr "Локальный игрок пропал"
#: ../src/gui/setup_interface.cpp:108
msgid "Log NPC dialogue"
@@ -1959,12 +1955,12 @@ msgstr "Вход"
#: ../src/net/manaserv/loginhandler.cpp:286
msgid "Login attempt too soon after previous attempt."
-msgstr ""
+msgstr "Попытка логина произошла слишком рано с периода прошлой попытки."
#: ../src/net/manaserv/beinghandler.cpp:290
#: ../src/net/tmwa/playerhandler.cpp:115
msgid "Looks like you got your head handed to you."
-msgstr ""
+msgstr "Похоже что вам передали вашу голову."
#: ../src/net/tmwa/generalhandler.cpp:236
msgid "Luck"
@@ -2007,9 +2003,8 @@ msgid "MP:"
msgstr "Мана:"
#: ../src/net/tmwa/chathandler.cpp:230
-#, fuzzy
msgid "MVP player."
-msgstr "Игрок"
+msgstr "MVP Игрок."
#: ../src/gui/charcreatedialog.cpp:87 ../src/gui/register.cpp:90
msgid "Male"
@@ -2028,7 +2023,7 @@ msgstr "Карта: %s"
#: ../src/gui/statuswindow.cpp:395 ../src/gui/statuswindow.cpp:473
#: ../src/gui/statuswindow.cpp:507
msgid "Max"
-msgstr "Макс"
+msgstr "Максимальный"
#: ../src/gui/setup_interface.cpp:61
msgid "Medium"
@@ -2036,7 +2031,7 @@ msgstr "Средний"
#: ../src/gui/socialwindow.cpp:153
msgid "Member Invite to Guild"
-msgstr "Приглашение игрока в гильдию"
+msgstr "Пригласить пользователя в гильдию"
#: ../src/gui/socialwindow.cpp:232
msgid "Member Invite to Party"
@@ -2044,7 +2039,7 @@ msgstr "Пригласить пользователя в группу"
#: ../src/net/manaserv/guildhandler.cpp:204
msgid "Member was promoted successfully."
-msgstr ""
+msgstr "Пользователь был успешно приведён."
#: ../src/net/tmwa/playerhandler.cpp:254 ../src/net/tmwa/playerhandler.cpp:294
msgid "Message"
@@ -2060,7 +2055,7 @@ msgstr "Теперь сообщение закрывает чат."
#: ../src/keyboardconfig.cpp:75
msgid "Minimap Window"
-msgstr "Окно мини-карты"
+msgstr "Окно миникарты"
#: ../src/gui/debugwindow.cpp:101
#, c-format
@@ -2073,7 +2068,7 @@ msgstr "Промахи"
#: ../src/gui/serverdialog.cpp:212
msgid "Modify..."
-msgstr ""
+msgstr "Модифицирование..."
#: ../src/gui/statuswindow.cpp:118 ../src/gui/statuswindow.cpp:212
#: ../src/gui/statuswindow.cpp:244
@@ -2082,9 +2077,8 @@ msgid "Money: %s"
msgstr "Деньги: %s"
#: ../src/resources/userpalette.cpp:104
-#, fuzzy
msgid "Monster Hits Player"
-msgstr "Удары монстра по игроку"
+msgstr "Монстр бьёт игрока"
#: ../src/resources/userpalette.cpp:96
msgid "Monsters"
@@ -2092,7 +2086,7 @@ msgstr "Монстры"
#: ../src/gui/debugwindow.cpp:139
msgid "Mouse path"
-msgstr ""
+msgstr "Путь мыши"
#: ../src/keyboardconfig.cpp:42
msgid "Move Down"
@@ -2142,9 +2136,8 @@ msgid "Name: %s"
msgstr "Имя: %s"
#: ../src/net/tmwa/inventoryhandler.h:78
-#, fuzzy
msgid "Necklace"
-msgstr "Ожерелья"
+msgstr "Ожерелье"
#: ../src/gui/ministatuswindow.cpp:244
msgid "Need"
@@ -2152,11 +2145,11 @@ msgstr "Необходимо"
#: ../src/gui/widgets/channeltab.cpp:121
msgid "Need a user to kick!"
-msgstr ""
+msgstr "Необходим пользователь, чтобы кикнуть его."
#: ../src/gui/widgets/channeltab.cpp:114
msgid "Need a user to op!"
-msgstr ""
+msgstr "Необходим пользователь, чтобы сделать его оператором!"
#: ../src/game.cpp:364
msgid "Network Error"
@@ -2192,20 +2185,19 @@ msgstr "Нет"
#: ../src/commandhandler.cpp:407
msgid "No <nick> was given."
-msgstr ""
+msgstr "Не записан <ник>"
#: ../src/net/manaserv/charhandler.cpp:143
msgid "No empty slot."
-msgstr ""
+msgstr "Нет свободных слотов."
#: ../src/net/manaserv/charhandler.cpp:266
msgid "No gameservers are available."
-msgstr ""
+msgstr "Нет доступных игровых серверов."
#: ../src/gui/itempopup.cpp:135
-#, fuzzy
msgid "No item"
-msgstr "Неизвестный предмет"
+msgstr "Нет предмета"
#: ../src/net/tmwa/generalhandler.cpp:135
msgid "No servers available."
@@ -2221,16 +2213,17 @@ msgid ""
"No, kids. Your character did not really die. It... err... went to a better "
"place."
msgstr ""
-"Нет, дети. Ваш персонаж не умирает. Он ... ммм ... пошел к лучшей жызни."
+"Нет, дети. Ваш персонаж не умер, на самом деле. Он... Эм... Ушел в место по-"
+"лучше."
#: ../src/gui/setup_video.cpp:200 ../src/gui/setup_video.cpp:407
#: ../src/gui/setup_video.cpp:481
msgid "None"
-msgstr "ни один"
+msgstr "Ни один"
#: ../src/gui/debugwindow.cpp:142
msgid "Normal"
-msgstr ""
+msgstr "Нормальный"
#: ../src/gui/recorder.cpp:92
msgid "Not currently recording."
@@ -2243,7 +2236,7 @@ msgstr "Не авторизован."
#: ../src/net/tmwa/buysellhandler.cpp:109
msgid "Nothing to sell."
-msgstr "Нечего продавать..."
+msgstr "Нечего продавать."
#: ../src/gui/setup_audio.cpp:94
msgid "Notice"
@@ -2289,9 +2282,8 @@ msgid "Options:"
msgstr "Опции:"
#: ../src/resources/userpalette.cpp:103
-#, fuzzy
msgid "Other Player Hits Monster"
-msgstr "Удары игрока по монстру"
+msgstr "Другой игрок бьёт монстра"
#: ../src/resources/userpalette.cpp:92
msgid "Other Players' Names"
@@ -2301,43 +2293,40 @@ msgstr "Имена других игроков"
#: ../src/gui/outfitwindow.cpp:154
#, c-format
msgid "Outfit: %d"
-msgstr ""
+msgstr "Наряд: %d"
#: ../src/gui/inventorywindow.cpp:110 ../src/gui/outfitwindow.cpp:51
msgid "Outfits"
-msgstr ""
+msgstr "Наряды"
#: ../src/keyboardconfig.cpp:82
-#, fuzzy
msgid "Outfits Window"
-msgstr "Окно статуса"
+msgstr "Окно нарядов"
#: ../src/gui/setup_interface.cpp:128
msgid "Overhead text:"
-msgstr ""
+msgstr "Текст сверху:"
#: ../src/resources/userpalette.cpp:93
msgid "Own Name"
msgstr "Собственное имя"
#: ../src/gui/setup_video.cpp:459
-#, fuzzy
msgid "Particle Effect Settings Changed."
-msgstr "Эффекты частиц"
+msgstr "Опции эффектов частиц были изменены."
#: ../src/resources/userpalette.cpp:99
msgid "Particle Effects"
msgstr "Эффекты частиц"
#: ../src/gui/debugwindow.cpp:107
-#, fuzzy, c-format
+#, c-format
msgid "Particle count: %d"
-msgstr "Эффекты частиц"
+msgstr "Число частиц: %d"
#: ../src/gui/setup_video.cpp:192
-#, fuzzy
msgid "Particle detail:"
-msgstr "Качество частиц"
+msgstr "Качество частиц:"
#: ../src/gui/setup_video.cpp:169
msgid "Particle effects"
@@ -2350,28 +2339,29 @@ msgstr "Группа"
#: ../src/gui/socialwindow.cpp:218
#, c-format
msgid "Party %s quit requested."
-msgstr ""
+msgstr "Группа %s отставила запрос."
#: ../src/resources/userpalette.cpp:97
-#, fuzzy
msgid "Party Members"
-msgstr "Группа"
+msgstr "Участники Группы"
#: ../src/gui/socialwindow.cpp:625
msgid "Party Name"
-msgstr "имя группы"
+msgstr "Имя группы"
#: ../src/net/manaserv/partyhandler.cpp:152
msgid ""
"Party invitation rejected by server, because of too many invitations in a "
"short time."
msgstr ""
+"Приглашение в группу было отменено сервером, так как было послано слишком "
+"много приглашений в короткое время."
#: ../src/net/manaserv/partyhandler.cpp:75
#, c-format
msgid ""
"Party invite failed, because no player called %s is within the visual range."
-msgstr ""
+msgstr "Приглашение в группу провалилось, так как игрока %s нет в поле зрения."
#: ../src/commandhandler.cpp:448 ../src/net/tmwa/gui/partytab.cpp:109
msgid "Party name is missing."
@@ -2426,12 +2416,11 @@ msgstr "Игрок уже игнорируется!"
#: ../src/commandhandler.cpp:553
msgid "Player could not be ignored!"
-msgstr "Игрок не может быть игнорирован!"
+msgstr "Игрок не может быть проигнорирован!"
#: ../src/commandhandler.cpp:575
-#, fuzzy
msgid "Player could not be unignored!"
-msgstr "Низзя прошептать: пользователь игнорирует шептание..."
+msgstr "Невозможно перестать игнорировать пользователя!"
#: ../src/net/manaserv/charhandler.cpp:212
msgid "Player deleted."
@@ -2443,11 +2432,11 @@ msgstr "Игрок больше не игнорируется!"
#: ../src/commandhandler.cpp:551
msgid "Player successfully ignored!"
-msgstr "Игрок успешно игнорирован!"
+msgstr "Игрок успешно проигнорирован!"
#: ../src/commandhandler.cpp:568
msgid "Player wasn't ignored!"
-msgstr "Игрок не было игнорирован!"
+msgstr "Игрок не был проигнорирован!"
#: ../src/gui/setup_players.cpp:236
msgid "Players"
@@ -2459,29 +2448,26 @@ msgid "Players in this channel:"
msgstr "Игроки в этом канале:"
#: ../src/gui/customserverdialog.cpp:156
-#, fuzzy
msgid "Please at least type both the address and the port of the server."
-msgstr "Следует указать адрес и порт сервера."
+msgstr "Пожалуйста, укажите хотя бы вместе адрес и порт сервера."
#: ../src/gui/charcreatedialog.cpp:106 ../src/gui/charcreatedialog.cpp:264
#, c-format
msgid "Please distribute %d points"
-msgstr "Распределите очки (%d)"
+msgstr "Пожалуйста, распределите очки (%d)"
#: ../src/gui/charcreatedialog.cpp:269
#, c-format
msgid "Please remove %d points"
-msgstr "Снимите очки (%d)"
+msgstr "Пожалуйста, снимите очки (%d)"
#: ../src/gui/serverdialog.cpp:331
-#, fuzzy
msgid "Please select a custom server."
-msgstr "Пожалуйста, укажите имя."
+msgstr "Пожалуйста, выберите свой сервер."
#: ../src/gui/serverdialog.cpp:287
-#, fuzzy
msgid "Please select a server."
-msgstr "Пожалуйста, укажите имя."
+msgstr "Пожалуйста, выберите сервер."
#: ../src/commandhandler.cpp:461 ../src/commandhandler.cpp:538
#: ../src/commandhandler.cpp:560
@@ -2501,13 +2487,13 @@ msgid "Preparing download"
msgstr "Подготовка к загрузке"
#: ../src/gui/chatwindow.cpp:316
-#, fuzzy, c-format
+#, c-format
msgid "Present: %s; %d players are present."
-msgstr "%d игроков он-лайн."
+msgstr "Сейчас: %s; %d игроков онлайн."
#: ../src/net/manaserv/beinghandler.cpp:296
msgid "Press OK to respawn."
-msgstr ""
+msgstr "Нажмите OK для перерождения."
#: ../src/gui/setup_joystick.cpp:37 ../src/gui/setup_joystick.cpp:78
msgid "Press the button to start calibration"
@@ -2525,7 +2511,7 @@ msgstr "Цена: %s / Всего: %s"
#: ../src/playerrelations.cpp:342 ../src/playerrelations.cpp.orig:328
msgid "Print '...'"
-msgstr ""
+msgstr "Вывести '...'"
#: ../src/gui/tradewindow.cpp:53
msgid "Propose trade"
@@ -2538,7 +2524,7 @@ msgstr "Пульсирующий"
#: ../src/gui/setup_players.cpp:230
msgid "Put all whispers in tabs"
-msgstr "Личные сообщения во вкладках"
+msgstr "Распределить личные сообщения во вкладки."
#: ../src/gui/buydialog.cpp:80 ../src/gui/quitdialog.cpp:40
#: ../src/gui/quitdialog.cpp:42 ../src/gui/quitdialog.cpp:43
@@ -2579,12 +2565,11 @@ msgstr "Регистрация приостановлена"
#: ../src/net/tmwa/loginhandler.cpp:165
msgid "Rejected from server."
-msgstr "отклонены от сервера."
+msgstr "Отклонен от сервера."
#: ../src/gui/socialwindow.cpp:468
-#, fuzzy
msgid "Rejected guild invite."
-msgstr "Пользователь отклонил приглашение в гильдию."
+msgstr "Приглашение в гильдию отклонено."
#: ../src/gui/socialwindow.cpp:450
#, c-format
@@ -2602,7 +2587,7 @@ msgstr "Запомнить имя пользователя"
#: ../src/net/manaserv/tradehandler.cpp:115
#: ../src/net/tmwa/tradehandler.cpp:109
msgid "Request for Trade"
-msgstr ""
+msgstr "Запрос на торговлю"
#: ../src/net/tmwa/gamehandler.cpp:96
msgid "Request to quit denied!"
@@ -2635,7 +2620,7 @@ msgstr "Для вступления в силу выбранных настро
#: ../src/gui/setup_video.cpp:441
msgid "Restart your client for the change to take effect."
-msgstr "Перезегрузите игру дабы изменения вступили в силу"
+msgstr "Перезагрузите игру дабы изменения вступили в силу."
#: ../src/gui/inventorywindow.cpp:133 ../src/gui/popupmenu.cpp:397
msgid "Retrieve"
@@ -2647,17 +2632,15 @@ msgstr "Теперь Return переключает чат."
#: ../src/commandhandler.cpp:479
msgid "Return toggles chat."
-msgstr "Enter переключает вас на окно чата."
+msgstr "Return переключает вас на окно чата."
#: ../src/net/tmwa/inventoryhandler.h:74
-#, fuzzy
msgid "Ring 1/2"
-msgstr "Кольца"
+msgstr "Кольцо 1/2"
#: ../src/net/tmwa/inventoryhandler.h:76
-#, fuzzy
msgid "Ring 2/2"
-msgstr "Кольца"
+msgstr "Кольцо 2/2"
#: ../src/gui/setup_joystick.cpp:84
msgid "Rotate the stick"
@@ -2666,7 +2649,7 @@ msgstr "Вращайте рукоять"
#: ../src/net/manaserv/beinghandler.cpp:288
#: ../src/net/tmwa/playerhandler.cpp:111
msgid "Sadly, no trace of you was ever found..."
-msgstr "К сожалению, никаких ваших остатков не было найдено ..."
+msgstr "К сожалению ваши остатки больше не были найдены..."
#: ../src/game.cpp:332
msgid "Saving screenshot failed!"
@@ -2694,7 +2677,7 @@ msgstr "Прокрутить чат вверх"
#: ../src/gui/inventorywindow.cpp:88
msgid "Search:"
-msgstr ""
+msgstr "Поиск:"
#: ../src/net/tmwa/specialhandler.cpp:184
msgid "Seems you need more money... ;-)"
@@ -2702,7 +2685,7 @@ msgstr "Кажется, вам нужно больше денег... ;-)"
#: ../src/keyboardconfig.cpp:102
msgid "Select OK"
-msgstr "Выбрать Ok"
+msgstr "Выбрать OK"
#: ../src/gui/worldselectdialog.cpp:71
msgid "Select World"
@@ -2730,7 +2713,7 @@ msgstr "Сколько предметов продать."
#: ../src/net/manaserv/charhandler.cpp:224
msgid "Selection out of range."
-msgstr "Выбор вне зоне достижения"
+msgstr "Выбор вне зоны достижения"
#: ../src/gui/buyselldialog.cpp:47 ../src/gui/selldialog.cpp:50
#: ../src/gui/selldialog.cpp:77
@@ -2743,11 +2726,11 @@ msgstr "Отправить"
#: ../src/net/tmwa/loginhandler.cpp:182
msgid "Server overpopulated."
-msgstr ""
+msgstr "Сервер переполнен."
#: ../src/net/net.cpp:164
msgid "Server protocol unsupported"
-msgstr ""
+msgstr "Не поддерживаемый протокол сервера"
#: ../src/gui/customserverdialog.cpp:57
msgid "Server type:"
@@ -2774,9 +2757,8 @@ msgid "Shop"
msgstr "Магазин"
#: ../src/gui/windowmenu.cpp:70
-#, fuzzy
msgid "Shortcuts"
-msgstr "Клавиша"
+msgstr "Горячие клавиши"
#: ../src/commandhandler.cpp:505 ../src/commandhandler.cpp:514
msgid "Show IP: Off"
@@ -2799,14 +2781,12 @@ msgid "Show own name"
msgstr "Показать собственное имя"
#: ../src/gui/setup_interface.cpp:109
-#, fuzzy
msgid "Show pickup notification:"
-msgstr "Показать уведомление о подборе предмета"
+msgstr "Показать уведомление о подборе предметов"
#: ../src/gui/debugwindow.cpp:133
-#, fuzzy
msgid "Show:"
-msgstr "Показ IP: Включен"
+msgstr "Показать:"
#: ../src/keyboardconfig.cpp:55
msgid "Sit"
@@ -2833,7 +2813,7 @@ msgstr "Окно навыков"
#: ../src/gui/skilldialog.cpp:275
#, c-format
msgid "Skill points available: %d"
-msgstr ""
+msgstr "Доступные очки навыков: %d"
#: ../src/gui/skilldialog.cpp:215 ../src/gui/windowmenu.cpp:62
msgid "Skills"
@@ -2853,12 +2833,11 @@ msgstr "Улыбнуться"
#: ../src/gui/socialwindow.cpp:312 ../src/gui/windowmenu.cpp:68
msgid "Social"
-msgstr ""
+msgstr "Группы"
#: ../src/keyboardconfig.cpp:80
-#, fuzzy
msgid "Social Window"
-msgstr "Окно навыков"
+msgstr "Окно групп"
#: ../src/net/tmwa/generalhandler.cpp:139
msgid "Someone else is trying to use this account."
@@ -2870,36 +2849,32 @@ msgstr "Звук"
#: ../src/gui/setup_audio.cpp:106
msgid "Sound Engine"
-msgstr ""
+msgstr "Звуковой движок"
#: ../src/gui/debugwindow.cpp:143
-#, fuzzy
msgid "Special 1"
-msgstr "Специальные"
+msgstr "Специальные 1"
#: ../src/gui/debugwindow.cpp:144
-#, fuzzy
msgid "Special 2"
-msgstr "Специальные"
+msgstr "Специальные 2"
#: ../src/gui/debugwindow.cpp:145
-#, fuzzy
msgid "Special 3"
-msgstr "Специальные"
+msgstr "Специальные 3"
#: ../src/gui/specialswindow.cpp:79 ../src/gui/windowmenu.cpp:66
msgid "Specials"
msgstr "Специальные"
#: ../src/gui/debugwindow.cpp:141
-#, fuzzy
msgid "Specials:"
-msgstr "Специальные"
+msgstr "Специальные:"
#: ../src/gui/setup_colors.cpp:90 ../src/gui/setup_colors.cpp:91
#: ../src/gui/setup_colors.cpp:334
msgid "Spectrum"
-msgstr "спектр"
+msgstr "Спектр"
#: ../src/net/tmwa/generalhandler.cpp:145
msgid "Speed hack detected."
@@ -2911,7 +2886,7 @@ msgstr "Разделить"
#: ../src/localplayer.cpp:917
msgid "Stack is too big."
-msgstr ""
+msgstr "Стек слишком большой."
#: ../src/gui/recorder.cpp:105
msgid "Starting to record..."
@@ -2939,7 +2914,7 @@ msgstr "Прекратить атаку"
#: ../src/gui/recorder.h:40
msgid "Stop recording"
-msgstr ""
+msgstr "Прекратить запись"
#: ../src/gui/inventorywindow.cpp:60
msgid "Storage"
@@ -2955,9 +2930,9 @@ msgid "Strength"
msgstr "Сила"
#: ../src/net/manaserv/attributes.cpp:173
-#, fuzzy, c-format
+#, c-format
msgid "Strength %+.1f"
-msgstr "Сила %+d"
+msgstr "Сила %+.1f"
#: ../src/net/tmwa/generalhandler.cpp:102
#, c-format
@@ -2985,9 +2960,8 @@ msgid "Switch server"
msgstr "Сменить сервер"
#: ../src/gui/debugwindow.cpp:239
-#, fuzzy
msgid "Switches"
-msgstr "Сменить сервер"
+msgstr "Переключения"
#: ../src/gui/setup_video.cpp:334
msgid "Switching to Full Screen"
@@ -3041,35 +3015,35 @@ msgstr "Соединение с сервером потеряно."
#: ../src/gui/changeemaildialog.cpp:141
msgid "The email address entries mismatch."
-msgstr "Введенный E-mail адреса не совпадают."
+msgstr "Введенные email адреса не совпадают."
#: ../src/net/manaserv/loginhandler.cpp:163
msgid "The new email address already exists."
-msgstr "Введенный E-mail адрес уже зарегистрирован."
+msgstr "Введенный email адрес уже зарегистрирован."
#: ../src/gui/changeemaildialog.cpp:127
#, c-format
msgid "The new email address needs to be at least %d characters long."
-msgstr "Новый E-MAIL адрес должен содержать не менее %d символов."
+msgstr "Новый email адрес должен содержать не менее %d символов."
#: ../src/gui/changeemaildialog.cpp:134
#, c-format
msgid "The new email address needs to be less than %d characters long."
-msgstr "Новый E-MAIL адрес не должно содержать более %d символов."
+msgstr "Новый email адрес не должен содержать более %d символов."
#: ../src/gui/changepassworddialog.cpp:130
msgid "The new password entries mismatch."
-msgstr "Пароли не совпадают"
+msgstr "Пароли не совпадают."
#: ../src/gui/changepassworddialog.cpp:116
#, c-format
msgid "The new password needs to be at least %d characters long."
-msgstr "Новый пароль должен быть не менше %d символов."
+msgstr "Новый пароль должен имеет более %d символов."
#: ../src/gui/changepassworddialog.cpp:123
#, c-format
msgid "The new password needs to be less than %d characters long."
-msgstr "Новый пароль должен быть меньше, чем %d символов."
+msgstr "Новый пароль должен состоять из менее, чем %d символов."
#: ../src/gui/register.cpp:182 ../src/gui/unregisterdialog.cpp:117
#, c-format
@@ -3097,7 +3071,7 @@ msgstr "Этот аккаунт уже авторизован."
#: ../src/net/tmwa/gui/guildtab.cpp:81
msgid "This command causes the player to leave the guild."
-msgstr "Эта комманда заставляет игрока покинуть группу."
+msgstr "Эта комманда заставляет игрока покинуть гильдию."
#: ../src/net/tmwa/gui/partytab.cpp:81
msgid "This command causes the player to leave the party."
@@ -3105,20 +3079,19 @@ msgstr "Эта комманда заставляет игрока покинут
#: ../src/net/tmwa/gui/partytab.cpp:96
msgid "This command changes the party's experience sharing policy."
-msgstr ""
+msgstr "Эта команда меняет политику распределения опыта."
#: ../src/net/tmwa/gui/partytab.cpp:86
msgid "This command changes the party's item sharing policy."
-msgstr ""
+msgstr "Эта команда меняет политику распределения предметов."
#: ../src/commandhandler.cpp:274
-#, fuzzy
msgid "This command clears the away status and message."
-msgstr "Задает тему для <сообщение>."
+msgstr "Эта команда очищает AFK статус и сообщение."
#: ../src/commandhandler.cpp:228
msgid "This command clears the chat log of previous chat."
-msgstr "Эта команда очищает лог чата."
+msgstr "Эта команда очищает лог предыдущего чата."
#: ../src/gui/widgets/whispertab.cpp:85
msgid "This command closes the current whisper tab."
@@ -3126,7 +3099,7 @@ msgstr "Закрывает вкладку перешептывания"
#: ../src/commandhandler.cpp:279
msgid "This command creates a new party called <name>."
-msgstr "Эта комманда создает группу под названием <имя_группы>."
+msgstr "Эта команда создает группу под названием <имя_группы>."
#: ../src/commandhandler.cpp:209
msgid "This command displays a list of all commands available."
@@ -3146,15 +3119,15 @@ msgstr "Эта команда показывает число пользоват
#: ../src/net/tmwa/gui/partytab.cpp:101
msgid "This command displays the party's current experience sharing policy."
-msgstr ""
+msgstr "Эта команда показывает текущую политику распределения опыта в группе."
#: ../src/net/tmwa/gui/partytab.cpp:91
msgid "This command displays the party's current item sharing policy."
-msgstr ""
+msgstr "Эта команда показывает текущую политику передачи предметов в группе."
#: ../src/commandhandler.cpp:312
msgid "This command displays the return toggle status."
-msgstr ""
+msgstr "Эта команда показывает статус клавиши \"Enter\"."
#: ../src/commandhandler.cpp:301
msgid "This command finishes a recording session."
@@ -3165,8 +3138,8 @@ msgid ""
"This command gets a list of players within hearing and sends it to either "
"the record log if recording, or the chat log otherwise."
msgstr ""
-"Комманда получпет список всех игроков, которых вы слышите и посылает его "
-"либо в лог-файл (если включена такая опция), либо в окно чата."
+"Команда получает список всех игроков, которых вы слышите и посылает его либо "
+"в лог-файл (если включена такая опция), либо в окно чата."
#: ../src/commandhandler.cpp:233
msgid "This command ignores the given player regardless of current relations."
@@ -3175,31 +3148,32 @@ msgstr ""
#: ../src/gui/widgets/whispertab.cpp:90
msgid "This command ignores the other player regardless of current relations."
-msgstr "Эта команда не игнорирует игрока вне зависимости от текущих отношений."
+msgstr ""
+"Эта команда игнорирует другого игрока вне зависимости от текущих отношений."
#: ../src/commandhandler.cpp:284 ../src/net/tmwa/gui/partytab.cpp:74
msgid "This command invites <nick> to party with you."
-msgstr "Эта команда приглашает <имя персонажа> к вам в группу."
+msgstr "Эта команда приглашает <имя_персонажа> к вам в группу."
#: ../src/net/tmwa/gui/guildtab.cpp:74
msgid "This command invites <nick> to the guild you're in."
-msgstr "Эта команда приглашает <имя персонажа> к вам в гильдию."
+msgstr "Эта команда приглашает <имя_персонажа> к вам в гильдию."
#: ../src/gui/widgets/channeltab.cpp:73
msgid "This command leaves the current channel."
-msgstr "Комманда покидает текущий канал"
+msgstr "Эта команда покидает текущий канал"
#: ../src/gui/widgets/channeltab.cpp:80
msgid "This command makes <nick> a channel operator."
-msgstr "Эта комманда делает <пользователь> оператором канала."
+msgstr "Эта команда делает <пользователь> оператором канала."
#: ../src/gui/widgets/channeltab.cpp:89
msgid "This command makes <nick> leave the channel."
-msgstr ""
+msgstr "Эта команда заставляет <пользователя> покинуть чат."
#: ../src/commandhandler.cpp:239
msgid "This command makes you enter <channel>."
-msgstr "Команда для входа на <канал>."
+msgstr "Эта команда нужна для входа на <канал>."
#: ../src/commandhandler.cpp:222
msgid "This command sends the message <msg> to all players currently online."
@@ -3207,18 +3181,18 @@ msgstr "Эта команда посылает <сообщение> всем и
#: ../src/commandhandler.cpp:257
msgid "This command sends the text <message> to <nick>."
-msgstr "Эта команда посылает текст <сообщение> пользователю <nick>."
+msgstr "Эта команда посылает текст <сообщение> <пользователю>."
#: ../src/gui/widgets/channeltab.cpp:68
msgid "This command sets the topic to <message>."
-msgstr "Задает тему для <сообщение>."
+msgstr "Эта команда задает тему для <сообщения>."
#: ../src/commandhandler.cpp:306
msgid ""
"This command sets whether the return key should toggle the chat log, or "
"whether the chat log turns off automatically."
msgstr ""
-"Эта комманда устанавливает, будет ли нажатие клавиши Enter переключать лог "
+"Эта команда устанавливает, будет ли нажатие клавиши Enter переключать лог "
"чата или же он (лог) будет выключен автоматически."
#: ../src/commandhandler.cpp:245
@@ -3227,7 +3201,7 @@ msgstr "Эта команда показывает список всех кан
#: ../src/gui/widgets/channeltab.cpp:63
msgid "This command shows the users in this channel."
-msgstr "Эта комманда показывает пользователей канала"
+msgstr "Эта команда показывает пользователей канала"
#: ../src/commandhandler.cpp:298
msgid "This command starts recording the chat log to the file <filename>."
@@ -3236,12 +3210,12 @@ msgstr "Эта команда начнет протоколирование ок
#: ../src/commandhandler.cpp:317
msgid "This command stops ignoring the given player if they are being ignored"
msgstr ""
-"Эта команда останавливает игнорирование данного игрока, если они игнорируетса"
+"Эта команда останавливает игнорирование данного игрока, если он игнорируется"
#: ../src/gui/widgets/whispertab.cpp:96
msgid "This command stops ignoring the other player if they are being ignored."
msgstr ""
-"Эта команда прекращает игнорировать других игроков, если они игнорируютса."
+"Эта команда прекращает игнорировать других игроков, если они игнорируются."
#: ../src/commandhandler.cpp:250
msgid "This command tell others you are (doing) <msg>."
@@ -3249,12 +3223,12 @@ msgstr "Эта команда покажет другим игрокам, что
#: ../src/commandhandler.cpp:271
msgid "This command tells you're away from keyboard with the given reason."
-msgstr ""
+msgstr "Эта команда говорит, что вы отошли с данной вами причиной."
#: ../src/commandhandler.cpp:265
msgid "This command tries to make a tab for whispers betweenyou and <nick>."
msgstr ""
-"Эта команда создаст закладку для личного общения между вами и <имя игрока>."
+"Эта команда создаст закладку для личного общения между вами и <имя_игрока>."
#: ../src/gui/setup_colors.cpp:47
msgid "This is what the color looks like"
@@ -3265,10 +3239,12 @@ msgid ""
"This server is missing needed world data. Please contact the administrator"
"(s)."
msgstr ""
+"Этот сервер потерял необходимую информацию о мире. Пожалуйста "
+"проконтактируйте администратора(ов)."
#: ../src/net/tmwa/loginhandler.cpp:185
msgid "This user name is already taken."
-msgstr "Этот аккаунт уже зарегистрирован"
+msgstr "Это имя пользователя уже используется."
#: ../src/gui/setup_interface.cpp:59
msgid "Tiny"
@@ -3287,11 +3263,11 @@ msgstr "Переключится на чат"
#: ../src/net/manaserv/guildhandler.cpp:260
#, c-format
msgid "Topic: %s"
-msgstr ""
+msgstr "Тема: %s"
#: ../src/net/tmwa/inventoryhandler.h:64
msgid "Torso"
-msgstr ""
+msgstr "Торс"
#: ../src/gui/tradewindow.cpp:73 ../src/gui/tradewindow.cpp:74
msgid "Trade"
@@ -3357,7 +3333,7 @@ msgstr "Прозрачность включена"
#: ../src/localplayer.cpp:913
msgid "Tried to pick up nonexistent item."
-msgstr ""
+msgstr "Попытался поднять несуществующий предмет."
#: ../src/commandhandler.cpp:334
msgid "Type /help for a list of commands."
@@ -3377,11 +3353,11 @@ msgstr "Тип:"
#: ../src/net/tmwa/buysellhandler.cpp:123
msgid "Unable to buy."
-msgstr "Низзя купить!"
+msgstr "Нельзя купить."
#: ../src/net/tmwa/inventoryhandler.cpp:405
msgid "Unable to equip."
-msgstr "Низзя екипировать!"
+msgstr "Нельзя экипировать."
#: ../src/net/tmwa/network.cpp:335
msgid "Unable to resolve host \""
@@ -3389,11 +3365,11 @@ msgstr "Невозможно подключиться к хосту \""
#: ../src/net/tmwa/buysellhandler.cpp:131
msgid "Unable to sell."
-msgstr "Низзя продать!"
+msgstr "Нельзя продать."
#: ../src/net/tmwa/inventoryhandler.cpp:417
msgid "Unable to unequip."
-msgstr "Низзя разекипировать"
+msgstr "Нельзя снять."
#: ../src/gui/setup_keyboard.cpp:93
msgid "Unassign"
@@ -3406,35 +3382,33 @@ msgstr "Снять"
#: ../src/gui/outfitwindow.cpp:70
msgid "Unequip first"
-msgstr "Сначало снемите"
+msgstr "Сначала снимите."
#: ../src/net/manaserv/charhandler.cpp:272
#, c-format
msgid "Unhandled character select error message %i."
-msgstr ""
+msgstr "Ошибка при необработанном выборе игрока %i."
#: ../src/net/tmwa/tradehandler.cpp:154
msgid "Unhandled trade cancel packet."
-msgstr ""
+msgstr "Необработанный пакет отмены торговли."
#: ../src/gui/popupmenu.cpp:115 ../src/gui/popupmenu.cpp:124
#, c-format
msgid "Unignore %s"
-msgstr ""
+msgstr "Перестать игнорировать %s"
#: ../src/net/net.cpp:141
-#, fuzzy
msgid "Unknown Server Type! Exiting."
-msgstr "Вещь неизвестного типа"
+msgstr "Неизвестный тип сервера! Выход."
#: ../src/net/manaserv/chathandler.cpp:350
msgid "Unknown channel event."
msgstr "Неизвестная события канала."
#: ../src/net/tmwa/charserverhandler.cpp:110
-#, fuzzy
msgid "Unknown char-server failure."
-msgstr "Неизвестный предмет"
+msgstr "Неизвестный символ. Сервер провалился."
#: ../src/commandhandler.cpp:136 ../src/commandhandler.cpp:333
msgid "Unknown command."
@@ -3442,7 +3416,7 @@ msgstr "Неизвестная команда."
#: ../src/net/tmwa/generalhandler.cpp:151
msgid "Unknown connection error."
-msgstr "Неизвестный Глюк авторизации."
+msgstr "Неизвестная ошибка подключения"
#: ../src/net/manaserv/charhandler.cpp:227
#, c-format
@@ -3461,12 +3435,12 @@ msgstr "Неизвестная ошибка."
#: ../src/net/tmwa/guildhandler.cpp:316
msgid "Unknown guild invite response."
-msgstr ""
+msgstr "Неизвестный запрос на приглашение в гильдию."
#: ../src/net/tmwa/partyhandler.cpp:132
#, c-format
msgid "Unknown invite response for %s."
-msgstr ""
+msgstr "Неизвестный запрос на приглашение в гильдию для %s."
#: ../src/resources/itemdb.cpp:69
msgid "Unknown item"
@@ -3474,12 +3448,12 @@ msgstr "Неизвестный предмет"
#: ../src/localplayer.cpp:920
msgid "Unknown problem picking up item."
-msgstr ""
+msgstr "Неизвестная проблема при поднятии предмета."
#: ../src/gui/charselectdialog.cpp:145 ../src/gui/unregisterdialog.cpp:47
#: ../src/gui/unregisterdialog.cpp:55
msgid "Unregister"
-msgstr "Удалить регистрацию"
+msgstr "Удалить аккаунт"
#: ../src/client.cpp:961
msgid "Unregister Successful"
@@ -3487,7 +3461,7 @@ msgstr "Удаление аккаунта прошла успешно"
#: ../src/net/tmwa/loginhandler.cpp:156
msgid "Unregistered ID."
-msgstr "Незарегестрированый ID."
+msgstr "Незарегистрированный ID."
#: ../src/gui/skilldialog.cpp:230
msgid "Up"
@@ -3514,9 +3488,8 @@ msgid "Username already exists."
msgstr "Пользователь с таким именем уже существует."
#: ../src/net/tmwa/loginhandler.cpp:188
-#, fuzzy
msgid "Username permanently erased."
-msgstr "Пользователь с таким именем уже существует."
+msgstr "Пользователь перманентно удалён."
#: ../src/gui/setup_video.cpp:184
msgid "Video"
@@ -3532,9 +3505,9 @@ msgid "Vitality"
msgstr "Выносливость"
#: ../src/net/manaserv/attributes.cpp:212
-#, fuzzy, c-format
+#, c-format
msgid "Vitality %+.1f"
-msgstr "Выносливость %+d"
+msgstr "Выносливость %+.1f"
#: ../src/net/tmwa/generalhandler.cpp:104
#, c-format
@@ -3543,7 +3516,7 @@ msgstr "Выносливость %+d"
#: ../src/net/tmwa/charserverhandler.cpp:273
msgid "Vitality:"
-msgstr "Живучесть:"
+msgstr "Выносливость:"
#: ../src/gui/npcdialog.cpp:49
msgid "Waiting for server"
@@ -3555,7 +3528,7 @@ msgstr "Ожидание ответа от сервера..."
#: ../src/net/tmwa/specialhandler.cpp:208
msgid "Warp failed..."
-msgstr ""
+msgstr "Деформация провалилась..."
#: ../src/net/manaserv/beinghandler.cpp:277
#: ../src/net/tmwa/playerhandler.cpp:97
@@ -3564,7 +3537,7 @@ msgstr "Мы с сожалением сообщаем, что ваш персо
#: ../src/keyboardconfig.cpp:83
msgid "Wear Outfit"
-msgstr ""
+msgstr "Одеть наряд"
#: ../src/gui/inventorywindow.cpp:112
msgid "Weight:"
@@ -3587,12 +3560,12 @@ msgstr "Шептать %s"
#: ../src/net/tmwa/chathandler.cpp:87
#, c-format
msgid "Whisper could not be sent, %s is offline."
-msgstr "Низзя прошептать: %s оффлайн"
+msgstr "Нельзя прошептать: %s оффлайн"
#: ../src/net/tmwa/chathandler.cpp:96
#, c-format
msgid "Whisper could not be sent, ignored by %s."
-msgstr "Низзя прошептать: %s игнорирует шептание..."
+msgstr "Нельзя прошептать: %s игнорирует шептание..."
#: ../src/gui/chatwindow.cpp:504
#, c-format
@@ -3610,18 +3583,17 @@ msgid "Who would you like to invite to party %s?"
msgstr "Кого бы вы хотели пригласить в группу %s?"
#: ../src/net/manaserv/attributes.cpp:231
-#, fuzzy
msgid "Willpower"
-msgstr "Сила волиr:"
+msgstr "Сила воли:"
#: ../src/net/manaserv/attributes.cpp:238
-#, fuzzy, c-format
+#, c-format
msgid "Willpower %+.1f"
-msgstr "Сила волиr:"
+msgstr "Сила воли: %+.1f"
#: ../src/net/manaserv/loginhandler.cpp:92
msgid "Wrong magic_token."
-msgstr ""
+msgstr "Неправильный магический символ."
#: ../src/net/tmwa/loginhandler.cpp:159
msgid "Wrong password."
@@ -3633,7 +3605,7 @@ msgstr "Неверное имя пользователя или пароль."
#: ../src/net/manaserv/loginhandler.cpp:314
msgid "Wrong username, password or email address."
-msgstr "Неверное имя пользователя, пароль или адрес E-mail."
+msgstr "Неверное имя пользователя, пароль или адрес email."
#: ../src/gui/confirmdialog.cpp:42
msgid "Yes"
@@ -3645,12 +3617,13 @@ msgstr "Вы умерли"
#: ../src/net/tmwa/playerhandler.cpp:132
msgid "You are an ex-player."
-msgstr "Вы бывшый игрок."
+msgstr "Вы уже бывший игрок."
#: ../src/net/tmwa/playerhandler.cpp:255
msgid ""
"You are carrying more than half your weight. You are unable to regain health."
msgstr ""
+"Вы несёте больше половины возможного веса. Регенерация жизни недоступна."
#: ../src/net/manaserv/beinghandler.cpp:276
#: ../src/net/tmwa/playerhandler.cpp:96
@@ -3698,12 +3671,12 @@ msgstr "Вы были приглашены присоединиться к гр
#: ../src/gui/socialwindow.cpp:584
msgid "You have been invited you to join a party."
-msgstr "Вы были приглашены вступить в группу."
+msgstr "Вы были приглашены в группу."
#: ../src/net/tmwa/loginhandler.cpp:168
msgid ""
"You have been permanently banned from the game. Please contact the GM team."
-msgstr "Вы были заблокированы от игры. Пожалуйста, свяжитесь с командой GM."
+msgstr "Вы были перманентно забанены. Пожалуйста, свяжитесь с командой GM."
#: ../src/net/tmwa/loginhandler.cpp:175
#, c-format
@@ -3711,12 +3684,12 @@ msgid ""
"You have been temporarily banned from the game until %s.\n"
"Please contact the GM team via the forums."
msgstr ""
-"Вы были заблокированы от игры до %s.\n"
-"Пожалуйста, свяжитесь с командой GM с помощю форума"
+"Вы были временно забанены до %s.\n"
+"Пожалуйста, свяжитесь с командой GM с помощью форума"
#: ../src/net/tmwa/playerhandler.cpp:122
msgid "You have ceased to be."
-msgstr ""
+msgstr "Вы прекратили своё существование."
#: ../src/net/tmwa/partyhandler.cpp:237
msgid "You have left the party."
@@ -3724,7 +3697,7 @@ msgstr "Вы покинули группу."
#: ../src/net/tmwa/specialhandler.cpp:178
msgid "You have no memos!"
-msgstr ""
+msgstr "У вас нет заметок!"
#: ../src/net/tmwa/specialhandler.cpp:169
msgid "You have not yet reached a high enough lvl!"
@@ -3737,27 +3710,28 @@ msgstr ""
#: ../src/gui/setup_video.cpp:367 ../src/gui/setup_video.cpp:375
msgid "You must restart to apply changes."
-msgstr "Вы должны перезагрузитса, чтобы изменения вступили в силу."
+msgstr "Вы должны перезагрузиться, чтобы изменения вступили в силу."
#: ../src/net/tmwa/specialhandler.cpp:193
msgid "You need another blue gem!"
-msgstr ""
+msgstr "Вам нужен другой синий драгоценный камень!"
#: ../src/net/tmwa/specialhandler.cpp:190
msgid "You need another red gem!"
-msgstr ""
+msgstr "Вам нужен другой красный драгоценный камень!"
#: ../src/gui/logindialog.cpp:129
msgid "You need to use the website to register an account for this server."
msgstr ""
-"Вам необходимо использовать веб-сайт, чтобы зарегистрировать новый аккаунт"
+"Вам необходимо использовать веб-сайт, чтобы зарегистрировать новый аккаунт "
+"для этого сервера."
#: ../src/localplayer.cpp:938
#, c-format
msgid "You picked up %d [@@%d|%s@@]."
msgid_plural "You picked up %d [@@%d|%s@@]."
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "Вы подобрали %d [@@%d|%s@@]."
+msgstr[1] "Вы подобрали %d [@@%d|%s@@]."
#: ../src/net/tmwa/playerhandler.cpp:328
#, c-format
@@ -3768,15 +3742,15 @@ msgstr "Вы получили %s."
#: ../src/net/tmwa/playerhandler.cpp:117
msgid ""
"You screwed up again, dump your body down the tubes and get you another one."
-msgstr ""
+msgstr "Ты снова облажался, выбросил своё тело в трубу и взял другое."
#: ../src/net/manaserv/loginhandler.cpp:323
msgid "You took too long with the captcha or your response was incorrect."
-msgstr ""
+msgstr "Вы слишком долго разибрали капчу, либо ваш запрос был неверным."
#: ../src/net/tmwa/playerhandler.cpp:124
msgid "You're a stiff."
-msgstr ""
+msgstr "Ты труп."
#: ../src/net/tmwa/specialhandler.cpp:196
msgid "You're carrying to much to do this!"
@@ -3784,37 +3758,40 @@ msgstr "Вы несёте слишком много, чтобы сделать
#: ../src/net/tmwa/playerhandler.cpp:120
msgid "You're not dead yet. You're just resting."
-msgstr ""
+msgstr "Вы ещё не умерли. Просто отдыхаете."
#: ../src/net/tmwa/playerhandler.cpp:128
msgid "You're off the twig."
-msgstr ""
+msgstr "Вы упали с ветки."
#: ../src/net/tmwa/playerhandler.cpp:133
msgid "You're pining for the fjords."
-msgstr ""
+msgstr "Вы тоскует по фьордам."
#: ../src/net/tmwa/playerhandler.cpp:123
msgid "You've expired and gone to meet your maker."
-msgstr ""
+msgstr "Ваш срок окончился и вы встретили своего создателя."
#: ../src/net/tmwa/playerhandler.cpp:129
msgid "You've kicked the bucket."
-msgstr ""
+msgstr "Вы приказали долго жить."
#: ../src/net/tmwa/playerhandler.cpp:130
msgid ""
"You've shuffled off your mortal coil, run down the curtain and joined the "
"bleedin' choir invisibile."
msgstr ""
+"Вы осознали суть экзистенции, не выдержали тленности бытия, её "
+"несправедливости и иррациональности и в порыве безысходности решили привести "
+"себя к фатальному финалу."
#: ../src/net/tmwa/guildhandler.cpp:311
msgid "Your guild is full."
-msgstr "Ваша гильдия полна."
+msgstr "Ваша гильдия заполнена."
#: ../src/net/tmwa/playerhandler.cpp:127
msgid "Your metabolic processes are now history."
-msgstr ""
+msgstr "Ваши метаболические процессы - уже просто история."
#: ../src/gui/charcreatedialog.cpp:195
msgid "Your name needs to be at least 4 characters."
@@ -3825,15 +3802,15 @@ msgstr "Имя должно содержать не менее четырех с
msgid ""
"Your plan of breaking your enemies weapon by bashing it with your throat "
"failed."
-msgstr ""
+msgstr "Ваш план по перелому вражеского оружия своим горлом провалился."
#: ../src/main.cpp:43
msgid "[mana-file] : The mana file is an XML file (.mana)"
-msgstr ""
+msgstr "[mana-файл] : Файл mana - это XML файл (.mana)"
#: ../src/gui/setup_interface.cpp:113
msgid "as particle"
-msgstr ""
+msgstr "как частица"
#: ../src/gui/setup_video.cpp:136 ../src/gui/setup_video.cpp:150
msgid "high"
@@ -3849,11 +3826,11 @@ msgstr "низ."
#: ../src/main.cpp:42
msgid "mana [options] [mana-file]"
-msgstr ""
+msgstr "mana [опции] [mana-файл]"
#: ../src/gui/setup_video.cpp:151
msgid "max"
-msgstr "максимальное"
+msgstr "максимально"
#: ../src/gui/setup_video.cpp:149
msgid "medium"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b40eab7b..695fef36 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,9 +1,10 @@
-FIND_PACKAGE(SDL REQUIRED)
-FIND_PACKAGE(SDL_image REQUIRED)
-FIND_PACKAGE(SDL_mixer REQUIRED)
-FIND_PACKAGE(SDL_net REQUIRED)
-FIND_PACKAGE(SDL_ttf REQUIRED)
-FIND_PACKAGE(SDL_gfx REQUIRED)
+include(FindPkgConfig)
+pkg_check_modules(SDL2 REQUIRED sdl2>=2.0.1)
+pkg_check_modules(SDL2IMAGE REQUIRED SDL2_image)
+pkg_check_modules(SDL2MIXER REQUIRED SDL2_mixer)
+pkg_check_modules(SDL2NET REQUIRED SDL2_net)
+pkg_check_modules(SDL2TTF REQUIRED SDL2_ttf)
+pkg_check_modules(SDL2GFX REQUIRED SDL2_gfx)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PhysFS REQUIRED)
@@ -34,11 +35,6 @@ ENDIF()
SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
-IF (ENABLE_CPP0X)
- SET(FLAGS "${FLAGS} -std=c++0x -DENABLE_CPP0X=1")
-ELSE()
- INCLUDE_DIRECTORIES("cpp0x_compat")
-ENDIF()
IF (ENABLE_NLS)
SET(FLAGS "${FLAGS} -DENABLE_NLS=1")
@@ -69,8 +65,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
SET(EXTRA_LIBRARIES intl)
ENDIF()
-SET(GUICHAN_COMPONENTS "SDL")
-FIND_PACKAGE(Guichan REQUIRED ${GUICHAN_COMPONENTS})
+FIND_PACKAGE(Guichan REQUIRED)
IF (WITH_OPENGL)
FIND_PACKAGE(OpenGL REQUIRED)
@@ -79,20 +74,14 @@ IF (WITH_OPENGL)
MESSAGE(STATUS "OpenGL support enabled")
ENDIF (WITH_OPENGL)
-IF (USE_X11)
- FIND_PACKAGE(X11 REQUIRED)
- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
- SET(FLAGS "${FLAGS} -DUSE_X11")
-ENDIF (USE_X11)
-
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
- ${SDL_INCLUDE_DIR}
- ${SDLIMAGE_INCLUDE_DIR}
- ${SDLMIXER_INCLUDE_DIR}
- ${SDLNET_INCLUDE_DIR}
- ${SDLTTF_INCLUDE_DIR}
- ${SDLGFX_INCLUDE_DIR}
+ ${SDL2_INCLUDE_DIRS}
+ ${SDL2IMAGE_INCLUDE_DIRS}
+ ${SDL2MIXER_INCLUDE_DIRS}
+ ${SDL2NET_INCLUDE_DIRS}
+ ${SDL2TTF_INCLUDE_DIRS}
+ ${SDL2GFX_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${PHYSFS_INCLUDE_DIR}
${CURL_INCLUDE_DIR}
@@ -116,19 +105,6 @@ IF (MINGW)
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -O coff -o <OBJECT> <SOURCE>")
ENDIF()
-# Fix some stuff that gets not hidden by mainline modules
-MARK_AS_ADVANCED(PHYSFS_INCLUDE_DIR)
-MARK_AS_ADVANCED(PHYSFS_LIBRARY)
-MARK_AS_ADVANCED(SDLIMAGE_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLIMAGE_LIBRARY)
-MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
-MARK_AS_ADVANCED(SDLMIXER_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLMIXER_LIBRARY)
-MARK_AS_ADVANCED(SDLNET_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLNET_LIBRARY)
-MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDL_LIBRARY)
-
SET(SRCS
gui/widgets/avatarlistbox.cpp
gui/widgets/avatarlistbox.h
@@ -679,12 +655,12 @@ ENDIF(ENABLE_MANASERV)
TARGET_LINK_LIBRARIES(mana
${INTERNAL_LIBRARIES}
- ${SDLGFX_LIBRARIES}
- ${SDL_LIBRARY}
- ${SDLIMAGE_LIBRARY}
- ${SDLMIXER_LIBRARY}
- ${SDLNET_LIBRARY}
- ${SDLTTF_LIBRARY}
+ ${SDL2_LIBRARIES}
+ ${SDL2GFX_LIBRARIES}
+ ${SDL2IMAGE_LIBRARIES}
+ ${SDL2MIXER_LIBRARIES}
+ ${SDL2NET_LIBRARIES}
+ ${SDL2TTF_LIBRARIES}
${PNG_LIBRARIES}
${PHYSFS_LIBRARY}
${CURL_LIBRARIES}
diff --git a/src/client.cpp b/src/client.cpp
index 1489a0dc..0db7efa6 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -34,7 +34,6 @@
#endif
#include "playerrelations.h"
#include "sound.h"
-#include "statuseffect.h"
#include "units.h"
#include "gui/changeemaildialog.h"
@@ -66,12 +65,8 @@
#include "resources/chardb.h"
#include "resources/hairdb.h"
-#include "resources/emotedb.h"
#include "resources/image.h"
#include "resources/itemdb.h"
-#include "resources/monsterdb.h"
-#include "resources/specialdb.h"
-#include "resources/npcdb.h"
#include "resources/resourcemanager.h"
#include "resources/theme.h"
#include "resources/userpalette.h"
@@ -241,11 +236,6 @@ Client::Client(const Options &options):
}
atexit(SDL_Quit);
- SDL_EnableUNICODE(1);
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
-
- SDL_WM_SetCaption(branding.getValue("appName", "Mana").c_str(), NULL);
-
ResourceManager *resman = ResourceManager::getInstance();
if (!resman->setWriteDir(mLocalDataDir))
@@ -254,8 +244,6 @@ Client::Client(const Options &options):
"Exiting.", mLocalDataDir.c_str()));
}
- Image::SDLsetEnableAlphaCache(config.getValue("alphaCache", true));
-
#if defined __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
@@ -300,6 +288,39 @@ Client::Client(const Options &options):
// Add the local data directory to PhysicsFS search path
resman->addToSearchPath(mLocalDataDir, false);
+ bool useOpenGL = !mOptions.noOpenGL && (config.getValue("opengl", 1) == 1);
+
+ // Set up the transparency option for low CPU when not using OpenGL.
+ if (!useOpenGL && (config.getValue("disableTransparency", 0) == 1))
+ Image::SDLdisableTransparency();
+
+#ifdef USE_OPENGL
+ // Setup image loading for the right image format
+ Image::setLoadAsOpenGL(useOpenGL);
+
+ // Create the graphics context
+ graphics = useOpenGL ? new OpenGLGraphics : new Graphics;
+#else
+ // Create the graphics context
+ graphics = new Graphics;
+#endif
+
+ const int width = config.getIntValue("screenwidth");
+ const int height = config.getIntValue("screenheight");
+ const bool fullscreen = config.getBoolValue("screen");
+
+ // Try to set the desired video mode
+ if (!graphics->setVideoMode(width, height, fullscreen))
+ {
+ logger->error(strprintf("Couldn't set %dx%d video mode: %s",
+ width, height, SDL_GetError()));
+ }
+
+ SDL_SetWindowTitle(graphics->getTarget(),
+ branding.getValue("appName", "Mana").c_str());
+
+ Image::setRenderer(graphics->getRenderer());
+
std::string iconFile = branding.getValue("appIcon", "icons/mana");
#ifdef _WIN32
iconFile += ".ico";
@@ -325,42 +346,10 @@ Client::Client(const Options &options):
mIcon = IMG_Load(iconFile.c_str());
if (mIcon)
{
- SDL_SetAlpha(mIcon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE);
- SDL_WM_SetIcon(mIcon, NULL);
+ SDL_SetWindowIcon(graphics->getTarget(), mIcon);
}
#endif
- bool useOpenGL = !mOptions.noOpenGL && (config.getValue("opengl", 1) == 1);
-
- // Set up the transparency option for low CPU when not using OpenGL.
- if (!useOpenGL && (config.getValue("disableTransparency", 0) == 1))
- Image::SDLdisableTransparency();
-
-#ifdef USE_OPENGL
-
- // Setup image loading for the right image format
- Image::setLoadAsOpenGL(useOpenGL);
-
- // Create the graphics context
- graphics = useOpenGL ? new OpenGLGraphics : new Graphics;
-#else
- // Create the graphics context
- graphics = new Graphics;
-#endif
-
- const int width = config.getIntValue("screenwidth");
- const int height = config.getIntValue("screenheight");
- const int bpp = 0;
- const bool fullscreen = config.getBoolValue("screen");
- const bool hwaccel = config.getBoolValue("hwaccel");
-
- // Try to set the desired video mode
- if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel))
- {
- logger->error(strprintf("Couldn't set %dx%dx%d video mode: %s",
- width, height, bpp, SDL_GetError()));
- }
-
// Initialize for drawing
graphics->_beginDraw();
@@ -511,8 +500,12 @@ int Client::exec()
case SDL_KEYDOWN:
break;
- case SDL_VIDEORESIZE:
- handleVideoResize(event.resize.w, event.resize.h);
+ case SDL_WINDOWEVENT:
+ switch (event.window.event) {
+ case SDL_WINDOWEVENT_RESIZED:
+ handleVideoResize(event.window.data1, event.window.data2);
+ break;
+ }
break;
}
@@ -761,8 +754,7 @@ int Client::exec()
// Load XML databases
CharDB::load();
- if (itemDb)
- delete itemDb;
+ delete itemDb;
switch (Net::getNetworkType())
{
@@ -1375,25 +1367,15 @@ void Client::accountLogin(LoginData *loginData)
void Client::handleVideoResize(int width, int height)
{
- // Keep a minimum size. This isn't adhered to by the actual window, but
- // it keeps some window positions from getting messed up.
- width = std::max(640, width);
- height = std::max(360, height);
-
- if (graphics->changeVideoMode(width,
- height,
- graphics->getBpp(),
- false,
- graphics->getHWAccel()))
- {
- videoResized(graphics->getWidth(),
- graphics->getHeight());
+ graphics->videoResized(width, height);
- // Since everything appears to have worked out, remember to store the
- // new size in the configuration.
- config.setValue("screenwidth", width);
- config.setValue("screenheight", height);
- }
+ // The graphics width/height may be different due to scale
+ videoResized(graphics->getWidth(), graphics->getHeight());
+
+ // Since everything appears to have worked out, remember to store the
+ // new size in the configuration.
+ config.setValue("screenwidth", width);
+ config.setValue("screenheight", height);
}
void Client::videoResized(int width, int height)
@@ -1409,3 +1391,18 @@ void Client::videoResized(int width, int height)
if (mGame)
mGame->videoResized(width, height);
}
+
+bool Client::isActive()
+{
+ return !(SDL_GetWindowFlags(graphics->getTarget()) & SDL_WINDOW_MINIMIZED);
+}
+
+bool Client::hasInputFocus()
+{
+ return SDL_GetWindowFlags(graphics->getTarget()) & SDL_WINDOW_INPUT_FOCUS;
+}
+
+bool Client::hasMouseFocus()
+{
+ return SDL_GetWindowFlags(graphics->getTarget()) & SDL_WINDOW_MOUSE_FOCUS;
+}
diff --git a/src/client.h b/src/client.h
index 4ad5562d..28fd4445 100644
--- a/src/client.h
+++ b/src/client.h
@@ -29,7 +29,7 @@
#include <guichan/actionlistener.hpp>
#include <SDL.h>
-#include <SDL_framerate.h>
+#include <SDL2_framerate.h>
#include <string>
@@ -214,14 +214,9 @@ public:
*/
void videoResized(int width, int height);
- static bool isActive()
- { return SDL_GetAppState() & SDL_APPACTIVE; }
-
- static bool hasInputFocus()
- { return SDL_GetAppState() & SDL_APPINPUTFOCUS; }
-
- static bool hasMouseFocus()
- { return SDL_GetAppState() & SDL_APPMOUSEFOCUS; }
+ static bool isActive();
+ static bool hasInputFocus();
+ static bool hasMouseFocus();
private:
void initRootDir();
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp
index cd07ca51..0f231535 100644
--- a/src/compoundsprite.cpp
+++ b/src/compoundsprite.cpp
@@ -20,7 +20,6 @@
#include "compoundsprite.h"
-#include "game.h"
#include "graphics.h"
#include "map.h"
@@ -223,6 +222,7 @@ int CompoundSprite::getDuration() const
return duration;
}
+#if 0
static void updateValues(int &dimension, int &pos, int imgDimUL, int imgDimRD, int imgOffset)
{
// Handle going beyond the left/up
@@ -238,11 +238,18 @@ static void updateValues(int &dimension, int &pos, int imgDimUL, int imgDimRD, i
if (temp > dimension)
dimension = temp;
}
-
-#include "localplayer.h"
+#endif
void CompoundSprite::redraw() const
{
+#if 1 // TODO_SDL2: Does it make sense to implement CompoundSprite?
+ mWidth = mSprites.at(0)->getWidth();
+ mHeight = mSprites.at(0)->getHeight();
+ mOffsetX = 0;
+ mOffsetY = 0;
+ mNeedsRedraw = false;
+#else
+
#ifdef USE_OPENGL
// TODO OpenGL support
if (Image::getLoadAsOpenGL())
@@ -295,7 +302,7 @@ void CompoundSprite::redraw() const
int amask = 0xff000000;
#endif
- SDL_Surface *surface = SDL_CreateRGBSurface(SDL_HWSURFACE, mWidth, mHeight,
+ SDL_Surface *surface = SDL_CreateRGBSurface(0, mWidth, mHeight,
32, rmask, gmask, bmask, amask);
if (!surface)
@@ -322,7 +329,7 @@ void CompoundSprite::redraw() const
delete graphics;
- SDL_Surface *surfaceA = SDL_CreateRGBSurface(SDL_HWSURFACE, mWidth, mHeight,
+ SDL_Surface *surfaceA = SDL_CreateRGBSurface(0, mWidth, mHeight,
32, rmask, gmask, bmask, amask);
SDL_SetAlpha(surface, 0, SDL_ALPHA_OPAQUE);
@@ -338,4 +345,5 @@ void CompoundSprite::redraw() const
SDL_FreeSurface(surfaceA);
mNeedsRedraw = false;
+#endif
}
diff --git a/src/cpp0x_compat/cstdint b/src/cpp0x_compat/cstdint
deleted file mode 100644
index 05d56c6e..00000000
--- a/src/cpp0x_compat/cstdint
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Compatibility header used when the compiler doesn't support C++0x.
- *
- * While GCC 4.2.1 understands types like uint16_t by default, later versions
- * are more strict so here are some typedefs for types used in our code.
- */
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
diff --git a/src/event.cpp b/src/event.cpp
index 45e65fff..73099cc3 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -37,7 +37,7 @@ Event::~Event()
// Integers
-void Event::setInt(const std::string &key, int value) throw (BadEvent)
+void Event::setInt(const std::string &key, int value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -45,7 +45,7 @@ void Event::setInt(const std::string &key, int value) throw (BadEvent)
mData[key] = new IntData(value);
}
-int Event::getInt(const std::string &key) const throw (BadEvent)
+int Event::getInt(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
@@ -66,7 +66,7 @@ bool Event::hasInt(const std::string &key) const
// Strings
-void Event::setString(const std::string &key, const std::string &value) throw (BadEvent)
+void Event::setString(const std::string &key, const std::string &value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -74,7 +74,7 @@ void Event::setString(const std::string &key, const std::string &value) throw (B
mData[key] = new StringData(value);
}
-const std::string &Event::getString(const std::string &key) const throw (BadEvent)
+const std::string &Event::getString(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
@@ -96,7 +96,7 @@ bool Event::hasString(const std::string &key) const
// Floats
-void Event::setFloat(const std::string &key, double value) throw (BadEvent)
+void Event::setFloat(const std::string &key, double value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -104,7 +104,7 @@ void Event::setFloat(const std::string &key, double value) throw (BadEvent)
mData[key] = new FloatData(value);
}
-double Event::getFloat(const std::string &key) const throw (BadEvent)
+double Event::getFloat(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
@@ -125,7 +125,7 @@ bool Event::hasFloat(const std::string &key) const
// Booleans
-void Event::setBool(const std::string &key, bool value) throw (BadEvent)
+void Event::setBool(const std::string &key, bool value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -133,7 +133,7 @@ void Event::setBool(const std::string &key, bool value) throw (BadEvent)
mData[key] = new BoolData(value);
}
-bool Event::getBool(const std::string &key) const throw (BadEvent)
+bool Event::getBool(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
@@ -154,7 +154,7 @@ bool Event::hasBool(const std::string &key) const
// Items
-void Event::setItem(const std::string &key, Item *value) throw (BadEvent)
+void Event::setItem(const std::string &key, Item *value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -162,7 +162,7 @@ void Event::setItem(const std::string &key, Item *value) throw (BadEvent)
mData[key] = new ItemData(value);
}
-Item *Event::getItem(const std::string &key) const throw (BadEvent)
+Item *Event::getItem(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
@@ -183,7 +183,7 @@ bool Event::hasItem(const std::string &key) const
// Actors
-void Event::setActor(const std::string &key, ActorSprite *value) throw (BadEvent)
+void Event::setActor(const std::string &key, ActorSprite *value)
{
if (mData.find(key) != mData.end())
throw KEY_ALREADY_EXISTS;
@@ -191,7 +191,7 @@ void Event::setActor(const std::string &key, ActorSprite *value) throw (BadEvent
mData[key] = new ActorData(value);
}
-ActorSprite *Event::getActor(const std::string &key) const throw (BadEvent)
+ActorSprite *Event::getActor(const std::string &key) const
{
VariableMap::const_iterator it = mData.find(key);
if (it == mData.end())
diff --git a/src/event.h b/src/event.h
index f33e4c70..b785b16f 100644
--- a/src/event.h
+++ b/src/event.h
@@ -132,12 +132,12 @@ public:
/**
* Sets the given variable to the given integer, if it isn't already set.
*/
- void setInt(const std::string &key, int value) throw (BadEvent);
+ void setInt(const std::string &key, int value);
/**
* Returns the given variable if it is set and an integer.
*/
- int getInt(const std::string &key) const throw (BadEvent);
+ int getInt(const std::string &key) const;
/**
* Returns the given variable if it is set and an integer, returning the
@@ -156,12 +156,12 @@ public:
/**
* Sets the given variable to the given string, if it isn't already set.
*/
- void setString(const std::string &key, const std::string &value) throw (BadEvent);
+ void setString(const std::string &key, const std::string &value);
/**
* Returns the given variable if it is set and a string.
*/
- const std::string &getString(const std::string &key) const throw (BadEvent);
+ const std::string &getString(const std::string &key) const;
/**
* Returns the given variable if it is set and a string, returning the
@@ -182,12 +182,12 @@ public:
* Sets the given variable to the given floating-point, if it isn't already
* set.
*/
- void setFloat(const std::string &key, double value) throw (BadEvent);
+ void setFloat(const std::string &key, double value);
/**
* Returns the given variable if it is set and a floating-point.
*/
- double getFloat(const std::string &key) const throw (BadEvent);
+ double getFloat(const std::string &key) const;
/**
* Returns the given variable if it is set and a floating-point, returning
@@ -206,12 +206,12 @@ public:
/**
* Sets the given variable to the given boolean, if it isn't already set.
*/
- void setBool(const std::string &key, bool value) throw (BadEvent);
+ void setBool(const std::string &key, bool value);
/**
* Returns the given variable if it is set and a boolean.
*/
- bool getBool(const std::string &key) const throw (BadEvent);
+ bool getBool(const std::string &key) const;
/**
* Returns the given variable if it is set and a boolean, returning the
@@ -230,12 +230,12 @@ public:
/**
* Sets the given variable to the given Item, if it isn't already set.
*/
- void setItem(const std::string &key, Item *value) throw (BadEvent);
+ void setItem(const std::string &key, Item *value);
/**
* Returns the given variable if it is set and an Item.
*/
- Item *getItem(const std::string &key) const throw (BadEvent);
+ Item *getItem(const std::string &key) const;
/**
* Returns the given variable if it is set and an Item, returning the
@@ -254,12 +254,12 @@ public:
/**
* Sets the given variable to the given actor, if it isn't already set.
*/
- void setActor(const std::string &key, ActorSprite *value) throw (BadEvent);
+ void setActor(const std::string &key, ActorSprite *value);
/**
* Returns the given variable if it is set and an actor.
*/
- ActorSprite *getActor(const std::string &key) const throw (BadEvent);
+ ActorSprite *getActor(const std::string &key) const;
/**
* Returns the given variable if it is set and an actor, returning the
diff --git a/src/game.cpp b/src/game.cpp
index 824eb7d1..5b78bdb5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -42,7 +42,6 @@
#include "sound.h"
#include "gui/chatwindow.h"
-#include "gui/confirmdialog.h"
#include "gui/debugwindow.h"
#include "gui/equipmentwindow.h"
#include "gui/gui.h"
@@ -72,7 +71,6 @@
#include "gui/widgets/layout.h"
#include "net/gamehandler.h"
-#include "net/generalhandler.h"
#include "net/net.h"
#include "net/playerhandler.h"
@@ -403,10 +401,10 @@ void Game::handleInput()
{
bool used = false;
- if (event.type == SDL_VIDEORESIZE)
+ if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_RESIZED)
{
// Let the client deal with this one (it'll pass down from there)
- Client::instance()->handleVideoResize(event.resize.w, event.resize.h);
+ Client::instance()->handleVideoResize(event.window.data1, event.window.data2);
}
// Keyboard events (for discontinuous keys)
else if (event.type == SDL_KEYDOWN)
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 08b1b298..d5c1e1a0 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -19,8 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <cassert>
-
#include "graphics.h"
#include "log.h"
@@ -28,122 +26,96 @@
#include "utils/gettext.h"
-#include <SDL_gfxBlitFunc.h>
-#include <SDL/SDL_rotozoom.h>
-
-Graphics::Graphics():
- mWidth(0),
- mHeight(0),
- mScale(1),
- mBpp(0),
- mFullscreen(false),
- mHWAccel(false),
- mBlitMode(BLIT_NORMAL),
- mScreenSurface(0)
+#include <guichan/exception.hpp>
+
+Graphics::~Graphics()
{
- mTarget = 0;
+ _endDraw();
}
-Graphics::~Graphics()
+void Graphics::setTarget(SDL_Window *target)
{
_endDraw();
+
+ mTarget = target;
+
+ if (mTarget)
+ _beginDraw();
}
-bool Graphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
+bool Graphics::setVideoMode(int w, int h, bool fs)
{
logger->log("Setting video mode %dx%d %s",
w, h, fs ? "fullscreen" : "windowed");
- logger->log("Bits per pixel: %d", bpp);
-
- int displayFlags = SDL_ANYFORMAT;
+ int windowFlags = SDL_WINDOW_ALLOW_HIGHDPI;
if (fs)
- displayFlags |= SDL_FULLSCREEN;
+ windowFlags |= SDL_WINDOW_FULLSCREEN;
else
- displayFlags |= SDL_RESIZABLE;
+ windowFlags |= SDL_WINDOW_RESIZABLE;
- if (hwaccel)
- displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
- else
- displayFlags |= SDL_SWSURFACE;
+ // TODO_SDL2: Support SDL_WINDOW_FULLSCREEN_DESKTOP
- SDL_FreeSurface(mTarget);
- mTarget = 0;
+ SDL_Window *window = nullptr;
+ SDL_Renderer *renderer = nullptr;
+ SDL_CreateWindowAndRenderer(w, h, windowFlags, &window, &renderer);
- // Calculate scaling factor
- mScale = std::max(w / 640, h / 360);
+ if (!window)
+ return false;
- mScreenSurface = SDL_SetVideoMode(w, h, bpp, displayFlags);
- const SDL_PixelFormat& fmt = *(mScreenSurface->format);
- setTarget(SDL_CreateRGBSurface(SDL_SWSURFACE,
- w / mScale, h / mScale,
- fmt.BitsPerPixel,
- fmt.Rmask, fmt.Gmask, fmt.Bmask, 0));
+ SDL_SetWindowMinimumSize(window, 640, 360);
+ SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
- if (!mTarget)
- return false;
+ setTarget(window);
- mWidth = mTarget->w;
- mHeight = mTarget->h;
- mBpp = bpp;
+ mRenderer = renderer;
+ videoResized(w, h);
mFullscreen = fs;
- mHWAccel = hwaccel;
-
- char videoDriverName[64];
- if (SDL_VideoDriverName(videoDriverName, 64))
- logger->log("Using video driver: %s", videoDriverName);
+ if (const char *driver = SDL_GetCurrentVideoDriver())
+ logger->log("Using video driver: %s", driver);
else
- logger->log("Using video driver: unknown");
-
- const SDL_VideoInfo *vi = SDL_GetVideoInfo();
-
- logger->log("Possible to create hardware surfaces: %s",
- vi->hw_available ? "yes" : "no");
- logger->log("Window manager available: %s",
- vi->wm_available ? "yes" : "no");
- logger->log("Accelerated hardware to hardware blits: %s",
- vi->blit_hw ? "yes" : "no");
- logger->log("Accelerated hardware to hardware colorkey blits: %s",
- vi->blit_hw_CC ? "yes" : "no");
- logger->log("Accelerated hardware to hardware alpha blits: %s",
- vi->blit_hw_A ? "yes" : "no");
- logger->log("Accelerated software to hardware blits: %s",
- vi->blit_sw ? "yes" : "no");
- logger->log("Accelerated software to hardware colorkey blits: %s",
- vi->blit_sw_CC ? "yes" : "no");
- logger->log("Accelerated software to hardware alpha blits: %s",
- vi->blit_sw_A ? "yes" : "no");
- logger->log("Accelerated color fills: %s",
- vi->blit_fill ? "yes" : "no");
- logger->log("Available video memory: %d", vi->video_mem);
+ logger->log("Using video driver: not initialized");
+
+ SDL_RendererInfo info;
+
+ if (SDL_GetRendererInfo(mRenderer, &info) == 0) {
+ logger->log("Using renderer: %s", info.name);
+
+ logger->log("The renderer is a software fallback: %s",
+ (info.flags & SDL_RENDERER_SOFTWARE) ? "yes" : "no");
+ logger->log("The renderer is hardware accelerated: %s",
+ (info.flags & SDL_RENDERER_ACCELERATED) ? "yes" : "no");
+ logger->log("Vsync: %s",
+ (info.flags & SDL_RENDERER_PRESENTVSYNC) ? "on" : "off");
+ logger->log("Renderer supports rendering to texture: %s",
+ (info.flags & SDL_RENDERER_TARGETTEXTURE) ? "yes" : "no");
+ logger->log("Max texture size: %dx%d",
+ info.max_texture_width, info.max_texture_height);
+ }
return true;
}
-bool Graphics::changeVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
+bool Graphics::changeVideoMode(int w, int h, bool fs)
{
// Just return success if we're already in this mode
- if (mScreenSurface && mScreenSurface->w == w &&
- mScreenSurface->h == h &&
- mBpp == bpp &&
- mFullscreen == fs &&
- mHWAccel == hwaccel)
+ if (mWidth == w &&
+ mHeight == h &&
+ mFullscreen == fs)
return true;
_endDraw();
- bool success = setVideoMode(w, h, bpp, fs, hwaccel);
+ bool success = setVideoMode(w, h, fs);
- // If it didn't work, try to restore fallback resolution. If that doesn't
+ // If it didn't work, try to restore the previous mode. If that doesn't
// work either, we're in big trouble and bail out.
- if (!success)
- {
- if (!setVideoMode(640, 360, mBpp, mFullscreen, mHWAccel))
- {
+ if (!success) {
+ if (!setVideoMode(mWidth, mHeight, mFullscreen)) {
logger->error(_("Failed to change video mode and couldn't "
- "switch back to the fallback mode!"));
+ "switch back to the previous mode!"));
}
}
@@ -152,12 +124,36 @@ bool Graphics::changeVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
return success;
}
+void Graphics::videoResized(int w, int h)
+{
+ const int prevWidth = mWidth;
+ const int prevHeight = mHeight;
+
+ mScale = getScale(w, h);
+ mWidth = w / mScale;
+ mHeight = h / mScale;
+
+ if (mWidth != prevWidth || mHeight != prevHeight) {
+ if (mScreenTexture) {
+ SDL_DestroyTexture(mScreenTexture);
+ mScreenTexture = nullptr;
+ }
+
+ if (mScale > 1) {
+ auto pixelFormat = SDL_GetWindowPixelFormat(mTarget);
+ mScreenTexture = SDL_CreateTexture(mRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, mWidth, mHeight);
+ }
+
+ SDL_SetRenderTarget(mRenderer, mScreenTexture);
+ }
+}
+
bool Graphics::drawImage(Image *image, int x, int y)
{
- if (image)
- return drawImage(image, 0, 0, x, y, image->mBounds.w, image->mBounds.h);
- else
+ if (!image)
return false;
+
+ return drawImage(image, 0, 0, x, y, image->mBounds.w, image->mBounds.h);
}
bool Graphics::drawRescaledImage(Image *image, int srcX, int srcY,
@@ -167,15 +163,7 @@ bool Graphics::drawRescaledImage(Image *image, int srcX, int srcY,
bool useColor)
{
// Check that preconditions for blitting are met.
- if (!mTarget || !image)
- return false;
- if (!image->mSDLSurface)
- return false;
-
- Image *tmpImage = image->SDLgetScaledImage(desiredWidth, desiredHeight);
- bool returnValue = false;
-
- if (!tmpImage)
+ if (!mTarget || !image || !image->mTexture)
return false;
dstX += mClipStack.top().xOffset;
@@ -188,78 +176,37 @@ bool Graphics::drawRescaledImage(Image *image, int srcX, int srcY,
SDL_Rect srcRect;
dstRect.x = dstX; dstRect.y = dstY;
srcRect.x = srcX; srcRect.y = srcY;
- srcRect.w = tmpImage->getWidth();
- srcRect.h = tmpImage->getHeight();
-
- returnValue = !(SDL_BlitSurface(tmpImage->mSDLSurface, &srcRect,
- mTarget, &dstRect) < 0);
-
- tmpImage->decRef(Resource::DeleteImmediately);
+ srcRect.w = width;
+ srcRect.h = height;
+ dstRect.w = desiredWidth;
+ dstRect.h = desiredHeight;
- return returnValue;
+ return !(SDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect) < 0);
}
bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY,
- int width, int height, bool)
+ int width, int height, bool useColor)
{
- // Check that preconditions for blitting are met.
- if (!mTarget || !image || !image->mSDLSurface)
+ if (!image)
return false;
- dstX += mClipStack.top().xOffset;
- dstY += mClipStack.top().yOffset;
-
- srcX += image->mBounds.x;
- srcY += image->mBounds.y;
-
- SDL_Rect dstRect;
- SDL_Rect srcRect;
- dstRect.x = dstX; dstRect.y = dstY;
- srcRect.x = srcX; srcRect.y = srcY;
- srcRect.w = width;
- srcRect.h = height;
-
- if (mBlitMode == BLIT_NORMAL)
- return !(SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect) < 0);
- else
- return !(SDL_gfxBlitRGBA(image->mSDLSurface, &srcRect, mTarget, &dstRect) < 0);
+ return drawRescaledImage(image,
+ srcX, srcY,
+ dstX, dstY,
+ width, height,
+ width, height, useColor);
}
void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h)
{
// Check that preconditions for blitting are met.
- if (!mTarget || !image)
- return;
- if (!image->mSDLSurface)
+ if (!image)
return;
const int iw = image->getWidth();
const int ih = image->getHeight();
- if (iw == 0 || ih == 0)
- return;
-
- for (int py = 0; py < h; py += ih) // Y position on pattern plane
- {
- int dh = (py + ih >= h) ? h - py : ih;
- int srcY = image->mBounds.y;
- int dstY = y + py + mClipStack.top().yOffset;
-
- for (int px = 0; px < w; px += iw) // X position on pattern plane
- {
- int dw = (px + iw >= w) ? w - px : iw;
- int srcX = image->mBounds.x;
- int dstX = x + px + mClipStack.top().xOffset;
-
- SDL_Rect dstRect;
- SDL_Rect srcRect;
- dstRect.x = dstX; dstRect.y = dstY;
- srcRect.x = srcX; srcRect.y = srcY;
- srcRect.w = dw; srcRect.h = dh;
-
- SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect);
- }
- }
+ drawRescaledImagePattern(image, x, y, w, h, iw, ih);
}
void Graphics::drawRescaledImagePattern(Image *image,
@@ -268,50 +215,34 @@ void Graphics::drawRescaledImagePattern(Image *image,
int scaledWidth, int scaledHeight)
{
// Check that preconditions for blitting are met.
- if (!mTarget || !image)
- return;
- if (!image->mSDLSurface)
+ if (!mTarget || !image || !image->mTexture)
return;
if (scaledHeight == 0 || scaledWidth == 0)
return;
- Image *tmpImage = image->SDLgetScaledImage(scaledWidth, scaledHeight);
- if (!tmpImage)
- return;
-
- const int iw = tmpImage->getWidth();
- const int ih = tmpImage->getHeight();
-
- if (iw == 0 || ih == 0)
- {
- tmpImage->decRef(Resource::DeleteImmediately);
- return;
- }
-
- for (int py = 0; py < h; py += ih) // Y position on pattern plane
+ for (int py = 0; py < h; py += scaledHeight) // Y position on pattern plane
{
- int dh = (py + ih >= h) ? h - py : ih;
- int srcY = tmpImage->mBounds.y;
+ int dh = (py + scaledHeight >= h) ? h - py : scaledHeight;
+ int srcY = image->mBounds.y;
int dstY = y + py + mClipStack.top().yOffset;
- for (int px = 0; px < w; px += iw) // X position on pattern plane
+ for (int px = 0; px < w; px += scaledWidth) // X position on pattern plane
{
- int dw = (px + iw >= w) ? w - px : iw;
- int srcX = tmpImage->mBounds.x;
+ int dw = (px + scaledWidth >= w) ? w - px : scaledWidth;
+ int srcX = image->mBounds.x;
int dstX = x + px + mClipStack.top().xOffset;
SDL_Rect dstRect;
SDL_Rect srcRect;
dstRect.x = dstX; dstRect.y = dstY;
+ dstRect.w = dw; dstRect.h = dh;
srcRect.x = srcX; srcRect.y = srcY;
srcRect.w = dw; srcRect.h = dh;
- SDL_BlitSurface(tmpImage->mSDLSurface, &srcRect, mTarget, &dstRect);
+ SDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect);
}
}
-
- tmpImage->decRef(Resource::DeleteImmediately);
}
void Graphics::drawImageRect(int x, int y, int w, int h,
@@ -368,27 +299,16 @@ void Graphics::drawImageRect(int x, int y, int w, int h,
void Graphics::updateScreen()
{
- // Center viewport
- SDL_Rect dstRect;
- dstRect.x = (mScreenSurface->w-getWidth() * mScale) / 2;
- dstRect.y = (mScreenSurface->h-getHeight() * mScale) / 2;
-
- // Zoom in if necessary
- if (mScale > 1)
- {
- SDL_Surface *tmp = zoomSurface(mTarget, mScale, mScale, 0);
-
- // Copy temporary surface to screen
- SDL_BlitSurface(tmp, NULL, mScreenSurface, &dstRect);
- SDL_FreeSurface(tmp);
+ if (!mScreenTexture) {
+ // Simple case when we're rendering directly to the window
+ SDL_RenderPresent(mRenderer);
+ } else {
+ // Otherwise, we now render the screen surface to the window
+ SDL_SetRenderTarget(mRenderer, NULL);
+ SDL_RenderCopy(mRenderer, mScreenTexture, NULL, NULL);
+ SDL_RenderPresent(mRenderer);
+ SDL_SetRenderTarget(mRenderer, mScreenTexture);
}
- else
- {
- // Copy mTarget directly to screen
- SDL_BlitSurface(mTarget, NULL, mScreenSurface, &dstRect);
- }
-
- SDL_Flip(mScreenSurface);
}
SDL_Surface *Graphics::getScreenshot()
@@ -404,10 +324,145 @@ SDL_Surface *Graphics::getScreenshot()
#endif
int amask = 0x00000000;
- SDL_Surface *screenshot = SDL_CreateRGBSurface(SDL_SWSURFACE, mTarget->w,
- mTarget->h, 24, rmask, gmask, bmask, amask);
-
- SDL_BlitSurface(mTarget, NULL, screenshot, NULL);
+ SDL_Surface *screenshot = SDL_CreateRGBSurface(0, mWidth,
+ mHeight, 24, rmask, gmask, bmask, amask);
+ SDL_RenderReadPixels(mRenderer, NULL, SDL_PIXELFORMAT_RGB888, screenshot->pixels, screenshot->pitch);
return screenshot;
}
+
+bool Graphics::pushClipArea(gcn::Rectangle area)
+{
+ bool result = gcn::Graphics::pushClipArea(area);
+ updateSDLClipRect();
+ return result;
+}
+
+void Graphics::popClipArea()
+{
+ gcn::Graphics::popClipArea();
+ updateSDLClipRect();
+}
+
+void Graphics::updateSDLClipRect()
+{
+ if (mClipStack.empty())
+ {
+ SDL_RenderSetClipRect(mRenderer, NULL);
+ return;
+ }
+
+ const gcn::ClipRectangle &carea = mClipStack.top();
+ SDL_Rect rect;
+ rect.x = carea.x;
+ rect.y = carea.y;
+ rect.w = carea.width;
+ rect.h = carea.height;
+
+ SDL_RenderSetClipRect(mRenderer, &rect);
+}
+
+int Graphics::getScale(int w, int h)
+{
+ return std::max(w / 640, h / 360);
+}
+
+void Graphics::drawPoint(int x, int y)
+{
+ if (mClipStack.empty())
+ {
+ throw GCN_EXCEPTION("Clip stack is empty, perhaps you called a draw funtion outside of _beginDraw() and _endDraw()?");
+ }
+
+ const gcn::ClipRectangle &top = mClipStack.top();
+
+ x += top.xOffset;
+ y += top.yOffset;
+
+ if (!top.isPointInRect(x, y))
+ return;
+
+ SDL_SetRenderDrawColor(mRenderer,
+ (Uint8)(mColor.r),
+ (Uint8)(mColor.g),
+ (Uint8)(mColor.b),
+ (Uint8)(mColor.a));
+ SDL_RenderDrawPoint(mRenderer, x, y);
+}
+
+void Graphics::drawLine(int x1, int y1, int x2, int y2)
+{
+ if (mClipStack.empty())
+ {
+ throw GCN_EXCEPTION("Clip stack is empty, perhaps you called a draw funtion outside of _beginDraw() and _endDraw()?");
+ }
+
+ const gcn::ClipRectangle &top = mClipStack.top();
+
+ x1 += top.xOffset;
+ y1 += top.yOffset;
+ x2 += top.xOffset;
+ y2 += top.yOffset;
+
+ SDL_SetRenderDrawColor(mRenderer,
+ (Uint8)(mColor.r),
+ (Uint8)(mColor.g),
+ (Uint8)(mColor.b),
+ (Uint8)(mColor.a));
+ SDL_RenderDrawLine(mRenderer, x1, y1, x2, y2);
+}
+
+void Graphics::drawRectangle(const gcn::Rectangle &rectangle)
+{
+ if (mClipStack.empty())
+ {
+ throw GCN_EXCEPTION("Clip stack is empty, perhaps you called a draw funtion outside of _beginDraw() and _endDraw()?");
+ }
+
+ const gcn::ClipRectangle &top = mClipStack.top();
+
+ SDL_Rect rect;
+ rect.x = rectangle.x + top.xOffset;
+ rect.y = rectangle.y + top.yOffset;
+ rect.w = rectangle.width;
+ rect.h = rectangle.height;
+
+ SDL_SetRenderDrawColor(mRenderer,
+ (Uint8)(mColor.r),
+ (Uint8)(mColor.g),
+ (Uint8)(mColor.b),
+ (Uint8)(mColor.a));
+ SDL_RenderDrawRect(mRenderer, &rect);
+}
+
+void Graphics::fillRectangle(const gcn::Rectangle &rectangle)
+{
+ if (mClipStack.empty())
+ {
+ throw GCN_EXCEPTION("Clip stack is empty, perhaps you called a draw funtion outside of _beginDraw() and _endDraw()?");
+ }
+
+ const gcn::ClipRectangle &top = mClipStack.top();
+
+ gcn::Rectangle area = rectangle;
+ area.x += top.xOffset;
+ area.y += top.yOffset;
+
+ if(!area.isIntersecting(top))
+ {
+ return;
+ }
+
+ SDL_Rect rect;
+ rect.x = area.x;
+ rect.y = area.y;
+ rect.w = area.width;
+ rect.h = area.height;
+
+ SDL_SetRenderDrawColor(mRenderer,
+ (Uint8)(mColor.r),
+ (Uint8)(mColor.g),
+ (Uint8)(mColor.b),
+ (Uint8)(mColor.a));
+ SDL_RenderFillRect(mRenderer, &rect);
+}
diff --git a/src/graphics.h b/src/graphics.h
index 36a9adb9..f92374ec 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -22,13 +22,14 @@
#ifndef GRAPHICS_H
#define GRAPHICS_H
-#include <guichan/sdl/sdlgraphics.hpp>
+#include <SDL.h>
+
+#include <guichan/color.hpp>
+#include <guichan/graphics.hpp>
class Image;
class ImageRect;
-struct SDL_Surface;
-
static const int defaultScreenWidth = 800;
static const int defaultScreenHeight = 600;
@@ -49,8 +50,9 @@ static const int defaultScreenHeight = 600;
* Sections 0, 2, 6 and 8 will remain as is. 1, 3, 4, 5 and 7 will be
* repeated to fit the size of the widget.
*/
-struct ImageRect
+class ImageRect
{
+public:
enum ImagePosition
{
UPPER_LEFT = 0,
@@ -70,28 +72,36 @@ struct ImageRect
/**
* A central point of control for graphics.
*/
-class Graphics : public gcn::SDLGraphics
+class Graphics : public gcn::Graphics
{
public:
- enum BlitMode {
- BLIT_NORMAL = 0,
- BLIT_GFX
- };
-
- Graphics();
+ Graphics() = default;
virtual ~Graphics();
/**
+ * Sets the target SDL_Window to draw to. This funtion also pushes a
+ * clip areas corresponding to the dimension of the target.
+ *
+ * @param target the target to draw to.
+ */
+ virtual void setTarget(SDL_Window *target);
+
+ SDL_Window *getTarget() const { return mTarget; }
+ SDL_Renderer *getRenderer() const { return mRenderer; }
+
+ /**
* Try to create a window with the given settings.
*/
- virtual bool setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel);
+ virtual bool setVideoMode(int w, int h, bool fs);
/**
* Change the video mode. Can be used for switching to full screen,
* changing resolution or adapting after window resize.
*/
- bool changeVideoMode(int w, int h, int bpp, bool fs, bool hwaccel);
+ bool changeVideoMode(int w, int h, bool fs);
+
+ virtual void videoResized(int w, int h);
/**
* Blits an image onto the screen.
@@ -176,12 +186,6 @@ class Graphics : public gcn::SDLGraphics
drawImageRect(area.x, area.y, area.width, area.height, imgRect);
}
- void setBlitMode(BlitMode mode)
- { mBlitMode = mode; }
-
- BlitMode getBlitMode()
- { return mBlitMode; }
-
/**
* Updates the screen. This is done by either copying the buffer to the
* screen or swapping pages.
@@ -189,12 +193,12 @@ class Graphics : public gcn::SDLGraphics
virtual void updateScreen();
/**
- * Returns the width of the drawable surface.
+ * Returns the width of the screen.
*/
int getWidth() const { return mWidth; }
/**
- * Returns the height of the drawable surface.
+ * Returns the height of the screen.
*/
int getHeight() const { return mHeight; }
@@ -204,38 +208,60 @@ class Graphics : public gcn::SDLGraphics
int getScale() const { return mScale; }
/**
- * Returns the amount of bits per pixel that was requested (not the
- * actual amount that's currently active).
- */
- int getBpp() const { return mBpp; }
-
- /**
* Returns whether we're in a full screen mode.
*/
bool getFullscreen() const { return mFullscreen; }
/**
- * Returns whether old-fashioned SDL-based hardware acceleration was
- * requested (not whether it's currently active).
- */
- bool getHWAccel() const { return mHWAccel; }
-
- /**
* Takes a screenshot and returns it as SDL surface.
*/
virtual SDL_Surface *getScreenshot();
gcn::Font *getFont() const { return mFont; }
+ virtual bool pushClipArea(gcn::Rectangle area);
+
+ virtual void popClipArea();
+
+ virtual void drawImage(const gcn::Image *image,
+ int srcX,
+ int srcY,
+ int dstX,
+ int dstY,
+ int width,
+ int height) {} // not used
+
+ virtual void drawPoint(int x, int y);
+
+ virtual void drawLine(int x1, int y1, int x2, int y2);
+
+ virtual void drawRectangle(const gcn::Rectangle &rectangle);
+
+ virtual void fillRectangle(const gcn::Rectangle &rectangle);
+
+ virtual void setColor(const gcn::Color &color)
+ {
+ mColor = color;
+ }
+
+ virtual const gcn::Color &getColor() const
+ {
+ return mColor;
+ }
+
protected:
- int mWidth;
- int mHeight;
- int mScale;
- int mBpp;
- bool mFullscreen;
- bool mHWAccel;
- BlitMode mBlitMode;
- SDL_Surface *mScreenSurface;
+ void updateSDLClipRect();
+ int getScale(int w, int h);
+
+ int mWidth = 0;
+ int mHeight = 0;
+ int mScale = 1;
+ bool mFullscreen = false;
+ gcn::Color mColor;
+
+ SDL_Window *mTarget = nullptr;
+ SDL_Renderer *mRenderer = nullptr;
+ SDL_Texture *mScreenTexture = nullptr;
};
extern Graphics *graphics;
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 2e1d006e..cb6682bd 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -26,6 +26,7 @@
#include "gui/sdlinput.h"
#include "gui/truetypefont.h"
+#include "gui/widgets/textfield.h"
#include "gui/widgets/window.h"
#include "gui/widgets/windowcontainer.h"
@@ -190,6 +191,12 @@ void Gui::logic()
Palette::advanceGradients();
gcn::Gui::logic();
+
+ while (!guiInput->isTextQueueEmpty())
+ {
+ TextInput textInput = guiInput->dequeueTextInput();
+ handleTextInput(textInput);
+ }
}
void Gui::draw()
@@ -267,3 +274,14 @@ void Gui::handleMouseMoved(const gcn::MouseInput &mouseInput)
gcn::Gui::handleMouseMoved(mouseInput);
mMouseInactivityTimer = 0;
}
+
+void Gui::handleTextInput(const TextInput &textInput)
+{
+ if (auto focused = mFocusHandler->getFocused())
+ {
+ if (auto textField = dynamic_cast<TextField*>(focused))
+ {
+ textField->textInput(textInput);
+ }
+ }
+}
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 006987da..998b6ec8 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -26,6 +26,7 @@
#include <guichan/gui.hpp>
+class TextInput;
class Graphics;
class GuiConfigListener;
class ImageSet;
@@ -114,6 +115,7 @@ class Gui : public gcn::Gui
protected:
void handleMouseMoved(const gcn::MouseInput &mouseInput);
+ void handleTextInput(const TextInput &textInput);
private:
GuiConfigListener *mConfigListener;
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 46636d52..c0f24a7a 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -109,6 +109,23 @@ gcn::MouseInput SDLInput::dequeueMouseInput()
return mouseInput;
}
+bool SDLInput::isTextQueueEmpty() const
+{
+ return mTextInputQueue.empty();
+}
+
+TextInput SDLInput::dequeueTextInput()
+{
+ if (mTextInputQueue.empty())
+ {
+ throw GCN_EXCEPTION("The queue is empty.");
+ }
+
+ TextInput textInput(mTextInputQueue.front());
+ mTextInputQueue.pop();
+ return textInput;
+}
+
void SDLInput::pushInput(SDL_Event event)
{
gcn::KeyInput keyInput;
@@ -122,8 +139,8 @@ void SDLInput::pushInput(SDL_Event event)
keyInput.setShiftPressed(event.key.keysym.mod & KMOD_SHIFT);
keyInput.setControlPressed(event.key.keysym.mod & KMOD_CTRL);
keyInput.setAltPressed(event.key.keysym.mod & KMOD_ALT);
- keyInput.setMetaPressed(event.key.keysym.mod & KMOD_META);
- keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP0
+ keyInput.setMetaPressed(event.key.keysym.mod & KMOD_GUI);
+ keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP_0
&& event.key.keysym.sym <= SDLK_KP_EQUALS);
mKeyInputQueue.push(keyInput);
@@ -135,8 +152,8 @@ void SDLInput::pushInput(SDL_Event event)
keyInput.setShiftPressed(event.key.keysym.mod & KMOD_SHIFT);
keyInput.setControlPressed(event.key.keysym.mod & KMOD_CTRL);
keyInput.setAltPressed(event.key.keysym.mod & KMOD_ALT);
- keyInput.setMetaPressed(event.key.keysym.mod & KMOD_META);
- keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP0
+ keyInput.setMetaPressed(event.key.keysym.mod & KMOD_GUI);
+ keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP_0
&& event.key.keysym.sym <= SDLK_KP_EQUALS);
mKeyInputQueue.push(keyInput);
@@ -147,19 +164,7 @@ void SDLInput::pushInput(SDL_Event event)
mouseInput.setX(event.button.x);
mouseInput.setY(event.button.y);
mouseInput.setButton(convertMouseButton(event.button.button));
-
- if (event.button.button == SDL_BUTTON_WHEELDOWN)
- {
- mouseInput.setType(gcn::MouseInput::WHEEL_MOVED_DOWN);
- }
- else if (event.button.button == SDL_BUTTON_WHEELUP)
- {
- mouseInput.setType(gcn::MouseInput::WHEEL_MOVED_UP);
- }
- else
- {
- mouseInput.setType(gcn::MouseInput::PRESSED);
- }
+ mouseInput.setType(gcn::MouseInput::PRESSED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
break;
@@ -183,6 +188,35 @@ void SDLInput::pushInput(SDL_Event event)
mMouseInputQueue.push(mouseInput);
break;
+ case SDL_MOUSEWHEEL:
+ if (event.wheel.y) {
+#if SDL_VERSION_ATLEAST(2, 26, 0)
+ mouseInput.setX(event.wheel.mouseX);
+ mouseInput.setY(event.wheel.mouseY);
+#else
+ int x, y;
+ SDL_GetMouseState(&x, &y);
+ mouseInput.setX(x);
+ mouseInput.setY(y);
+#endif
+ mouseInput.setButton(gcn::MouseInput::EMPTY);
+ mouseInput.setType(event.wheel.y > 0 ? gcn::MouseInput::WHEEL_MOVED_UP
+ : gcn::MouseInput::WHEEL_MOVED_DOWN);
+ mouseInput.setTimeStamp(SDL_GetTicks());
+ mMouseInputQueue.push(mouseInput);
+ }
+ break;
+
+ case SDL_TEXTINPUT:
+ mTextInputQueue.emplace(event.text.text);
+ break;
+
+ // TODO_SDL2: This is now a window event
+ // case SDL_WINDOWEVENT:
+ // switch (event.window.event) {
+ // }
+ // break;
+#if 0
case SDL_ACTIVEEVENT:
/*
* This occurs when the mouse leaves the window and the Gui-chan
@@ -209,7 +243,7 @@ void SDLInput::pushInput(SDL_Event event)
mMouseInWindow = true;
}
break;
-
+#endif
} // end switch
}
@@ -231,9 +265,9 @@ int SDLInput::convertMouseButton(int button)
int SDLInput::convertKeyCharacter(SDL_Event event)
{
- SDL_keysym keysym = event.key.keysym;
+ SDL_Keysym keysym = event.key.keysym;
- int value = keysym.unicode;
+ int value = keysym.sym;
switch (keysym.sym)
{
@@ -265,16 +299,10 @@ int SDLInput::convertKeyCharacter(SDL_Event event)
value = Key::PAUSE;
break;
case SDLK_SPACE:
- // Special characters like ~ (tilde) ends up
- // with the keysym.sym SDLK_SPACE which
- // without this check would be lost. The check
- // is only valid on key down events in SDL.
- if (event.type == SDL_KEYUP || keysym.unicode == ' ')
- {
- value = Key::SPACE;
- }
+ value = Key::SPACE;
break;
case SDLK_ESCAPE:
+ case SDLK_AC_BACK:
value = Key::ESCAPE;
break;
case SDLK_DELETE:
@@ -292,7 +320,7 @@ int SDLInput::convertKeyCharacter(SDL_Event event)
case SDLK_PAGEUP:
value = Key::PAGE_UP;
break;
- case SDLK_PRINT:
+ case SDLK_PRINTSCREEN:
value = Key::PRINT_SCREEN;
break;
case SDLK_PAGEDOWN:
@@ -343,27 +371,21 @@ int SDLInput::convertKeyCharacter(SDL_Event event)
case SDLK_F15:
value = Key::F15;
break;
- case SDLK_NUMLOCK:
+ case SDLK_NUMLOCKCLEAR:
value = Key::NUM_LOCK;
break;
case SDLK_CAPSLOCK:
value = Key::CAPS_LOCK;
break;
- case SDLK_SCROLLOCK:
+ case SDLK_SCROLLLOCK:
value = Key::SCROLL_LOCK;
break;
- case SDLK_RMETA:
+ case SDLK_RGUI:
value = Key::RIGHT_META;
break;
- case SDLK_LMETA:
+ case SDLK_LGUI:
value = Key::LEFT_META;
break;
- case SDLK_LSUPER:
- value = Key::LEFT_SUPER;
- break;
- case SDLK_RSUPER:
- value = Key::RIGHT_SUPER;
- break;
case SDLK_MODE:
value = Key::ALT_GR;
break;
@@ -394,34 +416,34 @@ int SDLInput::convertKeyCharacter(SDL_Event event)
{
switch (keysym.sym)
{
- case SDLK_KP0:
+ case SDLK_KP_0:
value = Key::INSERT;
break;
- case SDLK_KP1:
+ case SDLK_KP_1:
value = Key::END;
break;
- case SDLK_KP2:
+ case SDLK_KP_2:
value = Key::DOWN;
break;
- case SDLK_KP3:
+ case SDLK_KP_3:
value = Key::PAGE_DOWN;
break;
- case SDLK_KP4:
+ case SDLK_KP_4:
value = Key::LEFT;
break;
- case SDLK_KP5:
+ case SDLK_KP_5:
value = 0;
break;
- case SDLK_KP6:
+ case SDLK_KP_6:
value = Key::RIGHT;
break;
- case SDLK_KP7:
+ case SDLK_KP_7:
value = Key::HOME;
break;
- case SDLK_KP8:
+ case SDLK_KP_8:
value = Key::UP;
break;
- case SDLK_KP9:
+ case SDLK_KP_9:
value = Key::PAGE_UP;
break;
default:
diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h
index 90f70df3..09bb788e 100644
--- a/src/gui/sdlinput.h
+++ b/src/gui/sdlinput.h
@@ -61,13 +61,15 @@
#include <queue>
-#include <SDL/SDL.h>
+#include <SDL.h>
#include <guichan/input.hpp>
#include <guichan/keyinput.hpp>
#include <guichan/mouseinput.hpp>
#include <guichan/platform.hpp>
+#include <string>
+
namespace Key
{
enum
@@ -122,6 +124,19 @@ namespace Key
};
}
+class TextInput
+{
+public:
+ TextInput(const char *text)
+ : mText(text)
+ {}
+
+ const std::string &getText() const { return mText; }
+
+private:
+ std::string mText;
+};
+
/**
* SDL implementation of Input.
*/
@@ -160,6 +175,10 @@ public:
virtual gcn::MouseInput dequeueMouseInput();
+ bool isTextQueueEmpty() const;
+
+ TextInput dequeueTextInput();
+
protected:
/**
* Converts a mouse button from SDL to a Guichan mouse button
@@ -181,6 +200,7 @@ protected:
std::queue<gcn::KeyInput> mKeyInputQueue;
std::queue<gcn::MouseInput> mMouseInputQueue;
+ std::queue<TextInput> mTextInputQueue;
bool mMouseDown;
bool mMouseInWindow;
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index c468490c..eb59c4ea 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -38,6 +38,8 @@
#include "utils/dtor.h"
#include "utils/gettext.h"
+#include <functional>
+
extern Window *statusWindow;
Setup::Setup():
@@ -103,12 +105,12 @@ void Setup::action(const gcn::ActionEvent &event)
if (event.getId() == "Apply")
{
setVisible(false);
- for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::apply));
+ for_each(mTabs.begin(), mTabs.end(), std::mem_fn(&SetupTab::apply));
}
else if (event.getId() == "Cancel")
{
setVisible(false);
- for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::cancel));
+ for_each(mTabs.begin(), mTabs.end(), std::mem_fn(&SetupTab::cancel));
}
else if (event.getId() == "Reset Windows")
{
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp
index 5e29519b..b66ba3aa 100644
--- a/src/gui/setup_keyboard.cpp
+++ b/src/gui/setup_keyboard.cpp
@@ -178,8 +178,8 @@ void Setup_Keyboard::refreshAssignedKey(int index)
caption = keyboard.getKeyCaption(index) + ": ";
else
{
- char *temp = SDL_GetKeyName(
- (SDLKey) keyboard.getKeyValue(index));
+ const char *temp = SDL_GetKeyName(
+ (SDL_Scancode) keyboard.getKeyValue(index));
caption = strprintf("%-25s",
(keyboard.getKeyCaption(index) + ": ").c_str()) + toString(temp);
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 5a697160..ac419de5 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -26,8 +26,6 @@
#include "game.h"
#include "graphics.h"
#include "localplayer.h"
-#include "log.h"
-#include "main.h"
#include "gui/okdialog.h"
@@ -38,8 +36,6 @@
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/slider.h"
#include "gui/widgets/spacer.h"
-#include "gui/widgets/textfield.h"
-#include "gui/widgets/dropdown.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -90,26 +86,21 @@ class ModeListModel : public gcn::ListModel
ModeListModel::ModeListModel()
{
/* Get available fullscreen/hardware modes */
- SDL_Rect **modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
-
- /* Check which modes are available */
- if (modes == (SDL_Rect **)0)
- logger->log("No modes available");
- else if (modes == (SDL_Rect **)-1)
- logger->log("All resolutions available");
- else
+ const int numModes = SDL_GetNumDisplayModes(0);
+ for (int i = 0; i < numModes; i++)
{
- for (int i = 0; modes[i]; ++i)
- {
- const int width = modes[i]->w;
- const int height = modes[i]->h;
+ SDL_DisplayMode mode;
+ if (SDL_GetDisplayMode(0, i, &mode) != 0)
+ continue;
- // Skip the unreasonably small modes
- if (width < 640 || height < 360)
- continue;
+ // Skip the unreasonably small modes
+ if (mode.w < 640 || mode.h < 360)
+ continue;
- mVideoModes.push_back(toString(width) + "x" + toString(height));
- }
+ // TODO_SDL2: Modes now dinstinguish between pixel format and refresh rate as well
+ // TODO_SDL2: Fullscreen mode needs display selection
+
+ mVideoModes.push_back(toString(mode.w) + "x" + toString(mode.h));
}
}
@@ -255,9 +246,7 @@ void Setup_Video::apply()
{
if (!graphics->changeVideoMode(screenWidth,
screenHeight,
- graphics->getBpp(),
- fullscreen,
- graphics->getHWAccel()))
+ fullscreen))
{
std::stringstream errorMessage;
if (fullscreen)
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 1b960d64..437f9d01 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -33,8 +33,6 @@
#include "gui/widgets/avatarlistbox.h"
#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
-#include "gui/widgets/container.h"
-#include "gui/widgets/label.h"
#include "gui/widgets/linkhandler.h"
#include "gui/widgets/popup.h"
#include "gui/widgets/scrollarea.h"
@@ -47,7 +45,6 @@
#include "resources/theme.h"
-#include "utils/dtor.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -618,7 +615,7 @@ void SocialWindow::showPartyCreate()
{
new OkDialog(_("Create Party"),
_("Cannot create party. You are already in a party"),
- this);
+ true, this);
return;
}
diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h
index 59ddcbdc..20da4574 100644
--- a/src/gui/tradewindow.h
+++ b/src/gui/tradewindow.h
@@ -117,7 +117,7 @@ class TradeWindow : public Window, gcn::ActionListener, gcn::SelectionListener
*/
void setStatus(Status s);
- typedef const std::auto_ptr<Inventory> InventoryPtr;
+ typedef const std::unique_ptr<Inventory> InventoryPtr;
InventoryPtr mMyInventory;
InventoryPtr mPartnerInventory;
diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp
index 620ba191..443adaa5 100644
--- a/src/gui/truetypefont.cpp
+++ b/src/gui/truetypefont.cpp
@@ -28,6 +28,7 @@
#include "utils/stringutils.h"
+#include <guichan/color.hpp>
#include <guichan/exception.hpp>
const unsigned int CACHE_SIZE = 256;
@@ -53,9 +54,10 @@ class TextChunk
void generate(TTF_Font *font)
{
SDL_Color sdlCol;
- sdlCol.b = color.b;
sdlCol.r = color.r;
sdlCol.g = color.g;
+ sdlCol.b = color.b;
+ sdlCol.a = color.a;
const char *str = getSafeUtf8String(text);
SDL_Surface *surface = TTF_RenderUTF8_Blended(
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 0f737fb0..b2945617 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -311,7 +311,7 @@ void Viewport::_followMouse()
if (mPlayerFollowMouse && button & SDL_BUTTON(1))
{
// We create a mouse event and send it to mouseDragged.
- Uint8 *keys = SDL_GetKeyState(NULL);
+ const Uint8 *keys = SDL_GetKeyboardState(NULL);
gcn::MouseEvent mouseEvent(NULL,
(keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT]),
false,
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 4a31fa63..9247f67a 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -182,7 +182,7 @@ Button::~Button()
{
for (int mode = 0; mode < BUTTON_COUNT; ++mode)
{
- for_each(mButton[mode].grid, mButton[mode].grid + 9,
+ std::for_each(mButton[mode].grid, mButton[mode].grid + 9,
dtor<Image*>());
}
delete[] mButton;
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index ec76f861..c9974fec 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -94,14 +94,9 @@ void Desktop::draw(gcn::Graphics *graphics)
if (mWallpaper)
{
- if (!Image::useOpenGL())
- g->drawImage(mWallpaper,
- (getWidth() - mWallpaper->getWidth()) / 2,
- (getHeight() - mWallpaper->getHeight()) / 2);
- else
- g->drawRescaledImage(mWallpaper, 0, 0, 0, 0,
- mWallpaper->getWidth(), mWallpaper->getHeight(),
- getWidth(), getHeight(), false);
+ g->drawRescaledImage(mWallpaper, 0, 0, 0, 0,
+ mWallpaper->getWidth(), mWallpaper->getHeight(),
+ getWidth(), getHeight(), false);
}
mBgSkin->setAlpha(1.0f);
@@ -168,19 +163,6 @@ void Desktop::setBestFittingWallpaper()
mWallpaper->decRef(Resource::DeleteImmediately);
mWallpaper = wallpaper;
-
- // In software mode we try to prescale the image for performance
- if (!wallpaper->useOpenGL() &&
- (wallpaper->getWidth() != width ||
- wallpaper->getHeight() != height))
- {
- if (Image *prescaled = wallpaper->SDLgetScaledImage(width, height))
- {
- // Make sure the original can be freed
- wallpaper->decRef();
- mWallpaper = prescaled;
- }
- }
}
else
{
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index e90f6073..101afaef 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -102,7 +102,7 @@ DropDown::~DropDown()
buttons[1][0]->decRef();
buttons[1][1]->decRef();
- for_each(skin.grid, skin.grid + 9, dtor<Image*>());
+ std::for_each(skin.grid, skin.grid + 9, dtor<Image*>());
}
delete mScrollArea;
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 3105a762..cdb2d3c4 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -92,7 +92,7 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics)
// Draw emote keyboard shortcut.
const char *key = SDL_GetKeyName(
- (SDLKey) keyboard.getKeyValue(keyboard.KEY_EMOTE_1 + i));
+ (SDL_Scancode) keyboard.getKeyValue(keyboard.KEY_EMOTE_1 + i));
graphics->setColor(Theme::getThemeColor(Theme::TEXT));
g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT);
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index f1690d43..396de3bd 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -86,7 +86,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics)
// Draw item keyboard shortcut.
const char *key = SDL_GetKeyName(
- (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_1 + i));
+ (SDL_Scancode) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_1 + i));
graphics->setColor(Theme::getThemeColor(Theme::TEXT));
g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT);
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 5c5976c1..4f341af0 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -75,7 +75,7 @@ PlayerBox::~PlayerBox()
if (instances == 0)
{
- for_each(background.grid, background.grid + 9, dtor<Image*>());
+ std::for_each(background.grid, background.grid + 9, dtor<Image*>());
}
}
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 27b194ff..4695f5ab 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -88,7 +88,7 @@ ProgressBar::~ProgressBar()
if (mInstances == 0)
{
- for_each(mBorder.grid, mBorder.grid + 9, dtor<Image*>());
+ std::for_each(mBorder.grid, mBorder.grid + 9, dtor<Image*>());
}
}
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index d5e824e1..c95adeaa 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -66,9 +66,9 @@ ScrollArea::~ScrollArea()
if (instances == 0)
{
- for_each(background.grid, background.grid + 9, dtor<Image*>());
- for_each(vMarker.grid, vMarker.grid + 9, dtor<Image*>());
- for_each(vMarkerHi.grid, vMarkerHi.grid + 9, dtor<Image*>());
+ std::for_each(background.grid, background.grid + 9, dtor<Image*>());
+ std::for_each(vMarker.grid, vMarker.grid + 9, dtor<Image*>());
+ std::for_each(vMarkerHi.grid, vMarkerHi.grid + 9, dtor<Image*>());
buttons[UP][0]->decRef();
buttons[UP][1]->decRef();
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 17b7108f..c8ed2141 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -76,7 +76,7 @@ Tab::~Tab()
{
for (int mode = 0; mode < TAB_COUNT; mode++)
{
- for_each(tabImg[mode].grid, tabImg[mode].grid + 9, dtor<Image*>());
+ std::for_each(tabImg[mode].grid, tabImg[mode].grid + 9, dtor<Image*>());
}
}
}
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index ec57f1c7..35ce09c5 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -24,7 +24,6 @@
#include "configuration.h"
#include "graphics.h"
-#include "gui/palette.h"
#include "gui/sdlinput.h"
#include "resources/image.h"
@@ -36,6 +35,8 @@
#include <guichan/font.hpp>
+#include <SDL.h>
+
#undef DELETE //Win32 compatibility hack
int TextField::instances = 0;
@@ -84,7 +85,7 @@ TextField::~TextField()
instances--;
if (instances == 0)
- for_each(skin.grid, skin.grid + 9, dtor<Image*>());
+ std::for_each(skin.grid, skin.grid + 9, dtor<Image*>());
}
void TextField::updateAlpha()
@@ -162,33 +163,7 @@ int TextField::getValue() const
void TextField::keyPressed(gcn::KeyEvent &keyEvent)
{
- int val = keyEvent.getKey().getValue();
-
- if (val >= 32)
- {
- int l;
- if (val < 128) l = 1; // 0xxxxxxx
- else if (val < 0x800) l = 2; // 110xxxxx 10xxxxxx
- else if (val < 0x10000) l = 3; // 1110xxxx 10xxxxxx 10xxxxxx
- else l = 4; // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-
- char buf[4];
- for (int i = 0; i < l; ++i)
- {
- buf[i] = val >> (6 * (l - i - 1));
- if (i > 0) buf[i] = (buf[i] & 63) | 128;
- }
-
- if (l > 1) buf[0] |= 255 << (8 - l);
-
- mText.insert(mCaretPosition, std::string(buf, buf + l));
- mCaretPosition += l;
- }
-
- /* In UTF-8, 10xxxxxx is only used for inner parts of characters. So skip
- them when processing key presses. */
-
- switch (val)
+ switch (keyEvent.getKey().getValue())
{
case Key::LEFT:
{
@@ -302,8 +277,9 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
return;
break;
- case 22: // Control code 22, SYNCHRONOUS IDLE, sent on Ctrl+v
- handlePaste();
+ case SDLK_v:
+ if (keyEvent.isControlPressed())
+ handlePaste();
break;
}
@@ -311,6 +287,12 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
fixScroll();
}
+void TextField::textInput(const TextInput &textInput)
+{
+ mText.insert(mCaretPosition, textInput.getText());
+ mCaretPosition += textInput.getText().length();
+}
+
void TextField::autoComplete()
{
if (mAutoComplete && mText.size() > 0)
@@ -383,7 +365,7 @@ void TextField::handlePaste()
std::string text = getText();
std::string::size_type caretPos = getCaretPosition();
- if (RetrieveBuffer(text, caretPos)) {
+ if (insertFromClipboard(text, caretPos)) {
setText(text);
setCaretPosition(caretPos);
}
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 94cada41..bf60cbc3 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -26,6 +26,7 @@
#include <vector>
+class TextInput;
class ImageRect;
class TextField;
@@ -116,6 +117,11 @@ class TextField : public gcn::TextField
void keyPressed(gcn::KeyEvent &keyEvent);
/**
+ * Handle text input (should possibly be new event in Guichan).
+ */
+ void textInput(const TextInput &textInput);
+
+ /**
* Set the minimum value for a range
*/
void setMinimum(int min) { mMinimum = min; }
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index a06415fb..ff75e5d1 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -167,7 +167,7 @@ static std::string createShortcutCaption(const std::string& text,
if (key != KeyboardConfig::KEY_NO_VALUE)
{
caption += " (";
- caption += SDL_GetKeyName((SDLKey) keyboard.getKeyValue(key));
+ caption += SDL_GetKeyName((SDL_Scancode) keyboard.getKeyValue(key));
caption += ")";
}
return caption;
diff --git a/src/guild.cpp b/src/guild.cpp
index 2beee4f5..714ca010 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -169,7 +169,7 @@ void Guild::setRights(short rights)
bool Guild::isMember(GuildMember *member) const
{
- if (member->mGuild > 0 && member->mGuild != this)
+ if (member->mGuild != nullptr && member->mGuild != this)
return false;
MemberList::const_iterator itr = mMembers.begin(),
diff --git a/src/joystick.cpp b/src/joystick.cpp
index cc6e532b..a1da181c 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -37,7 +37,7 @@ void Joystick::init()
joystickCount = SDL_NumJoysticks();
logger->log("%i joysticks/gamepads found", joystickCount);
for (int i = 0; i < joystickCount; i++)
- logger->log("- %s", SDL_JoystickName(i));
+ logger->log("- %s", SDL_JoystickNameForIndex(i));
}
Joystick::Joystick(int no):
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 0f4a46bf..39c99bc3 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -99,8 +99,8 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = {
{"keyChatNextTab", SDLK_RIGHTBRACKET, _("Next Chat Tab")},
{"keyOK", SDLK_SPACE, _("Select OK")},
{"keyQuit", SDLK_ESCAPE, _("Quit")},
- {"keyIgnoreInput1", SDLK_LSUPER, _("Ignore input 1")},
- {"keyIgnoreInput2", SDLK_RSUPER, _("Ignore input 2")}
+ {"keyIgnoreInput1", SDLK_LGUI, _("Ignore input 1")},
+ {"keyIgnoreInput2", SDLK_RGUI, _("Ignore input 2")}
};
void KeyboardConfig::init()
@@ -231,5 +231,5 @@ bool KeyboardConfig::isKeyActive(int index) const
void KeyboardConfig::refreshActiveKeys()
{
- mActiveKeys = SDL_GetKeyState(NULL);
+ mActiveKeys = SDL_GetKeyboardState(NULL);
}
diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h
index 8c744123..cb58dd90 100644
--- a/src/keyboardconfig.h
+++ b/src/keyboardconfig.h
@@ -227,7 +227,7 @@ class KeyboardConfig
KeyFunction mKey[KEY_TOTAL]; /**< Pointer to all the key data */
- uint8_t *mActiveKeys; /**< Stores a list of all the keys */
+ const uint8_t *mActiveKeys; /**< Stores a list of all the keys */
std::string mBindError;
};
diff --git a/src/net/download.cpp b/src/net/download.cpp
index bccba7a3..61cdf114 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -124,7 +124,7 @@ bool Download::start()
{
logger->log("Starting download: %s", mUrl.c_str());
- mThread = SDL_CreateThread(downloadThread, this);
+ mThread = SDL_CreateThread(downloadThread, "Download", this);
if (!mThread)
{
diff --git a/src/net/manaserv/messagehandler.h b/src/net/manaserv/messagehandler.h
index 6e0221cb..8949d34e 100644
--- a/src/net/manaserv/messagehandler.h
+++ b/src/net/manaserv/messagehandler.h
@@ -41,7 +41,7 @@ class MessageHandler : public Net::MessageHandler
virtual void handleMessage(MessageIn &msg) = 0;
};
-typedef const std::auto_ptr<MessageHandler> MessageHandlerPtr;
+typedef const std::unique_ptr<MessageHandler> MessageHandlerPtr;
} // namespace ManaServ
diff --git a/src/net/manaserv/messagein.h b/src/net/manaserv/messagein.h
index 89ae5ed8..1edc4fe7 100644
--- a/src/net/manaserv/messagein.h
+++ b/src/net/manaserv/messagein.h
@@ -52,7 +52,10 @@ class MessageIn
/**
* Returns the length of unread data.
*/
- unsigned int getUnreadLength() const { return mLength - mPos; }
+ unsigned int getUnreadLength() const
+ {
+ return (mPos < mLength) ? mLength - mPos : 0;
+ }
/**
* Reads an unsigned 8-bit integer from the message.
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 51c757cc..77b545fd 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -298,7 +298,7 @@ void LoginHandler::sendLoginRegister(const std::string &username,
const std::string &password)
{
MessageOut outMsg(0x0064);
- outMsg.writeInt32(0); // client version
+ outMsg.writeInt32(20); // client version
outMsg.writeString(username, 24);
outMsg.writeString(password, 24);
diff --git a/src/net/tmwa/messagehandler.h b/src/net/tmwa/messagehandler.h
index 2b1f5b7e..b598f896 100644
--- a/src/net/tmwa/messagehandler.h
+++ b/src/net/tmwa/messagehandler.h
@@ -49,7 +49,7 @@ class MessageHandler : public Net::MessageHandler
Network *mNetwork;
};
-typedef const std::auto_ptr<MessageHandler> MessageHandlerPtr;
+typedef const std::unique_ptr<MessageHandler> MessageHandlerPtr;
}
diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h
index 48121187..2f66ca28 100644
--- a/src/net/tmwa/messagein.h
+++ b/src/net/tmwa/messagein.h
@@ -50,7 +50,10 @@ class MessageIn
/**
* Returns the length of unread data.
*/
- unsigned int getUnreadLength() const { return mLength - mPos; }
+ unsigned int getUnreadLength() const
+ {
+ return (mPos < mLength) ? mLength - mPos : 0;
+ }
/**
* Reads an unsigned 8-bit integer from the message.
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 3a02deba..ed564b46 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -77,7 +77,7 @@ uint16_t packet_lengths[0x220] = {
11, 7,VAR, 67, 12, 18,114, 6, 3, 6, 26, 26, 26, 26, 2, 3,
// #0x01C0
2, 14, 10,VAR, 22, 22, 4, 2, 13, 97, 0, 9, 9, 29, 6, 28,
- 8, 14, 10, 35, 6, 8, 4, 11, 54, 53, 60, 2,VAR, 47, 33, 6,
+ 8, 14, 10, 35, 6,VAR, 4, 11, 54, 53, 60, 2,VAR, 47, 33, 6,
30, 8, 34, 14, 2, 6, 26, 2, 28, 81, 6, 10, 26, 2,VAR,VAR,
VAR,VAR, 20, 10, 32, 9, 34, 14, 2, 6, 48, 56,VAR, 4, 5, 10,
// #0x0200
@@ -159,7 +159,7 @@ bool Network::connect(ServerInfo server)
mToSkip = 0;
mState = CONNECTING;
- mWorkerThread = SDL_CreateThread(networkThread, this);
+ mWorkerThread = SDL_CreateThread(networkThread, "Network", this);
if (!mWorkerThread)
{
setError("Unable to create network worker thread");
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 40e37594..a02056a4 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -207,6 +207,11 @@ void TradeHandler::handleMessage(MessageIn &msg)
SERVER_NOTICE(_("Failed adding item. Trade "
"partner has no free slot."))
break;
+ case 3:
+ // Add item failed - non tradable item
+ SERVER_NOTICE(_("Failed adding item. You "
+ "cant trade this item."))
+ break;
default:
SERVER_NOTICE(_("Failed adding item for "
"unknown reason."))
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 28fd47f6..0b79e933 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -63,7 +63,13 @@ OpenGLGraphics::~OpenGLGraphics()
void OpenGLGraphics::setSync(bool sync)
{
+ if (mSync == sync)
+ return;
+
mSync = sync;
+
+ if (mContext)
+ SDL_GL_SetSwapInterval(sync ? 1 : 0);
}
void OpenGLGraphics::setReduceInputLag(bool reduceInputLag)
@@ -71,55 +77,59 @@ void OpenGLGraphics::setReduceInputLag(bool reduceInputLag)
mReduceInputLag = reduceInputLag;
}
-bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
+bool OpenGLGraphics::setVideoMode(int w, int h, bool fs)
{
logger->log("Setting video mode %dx%d %s",
w, h, fs ? "fullscreen" : "windowed");
- int displayFlags = SDL_ANYFORMAT | SDL_OPENGL;
+ // TODO_SDL2: Support SDL_WINDOW_ALLOW_HIGHDPI, but check handling of clip area
- const double targetRatio = (double) 640 / 360; // 1.77778
- const double requestedRatio = (double) w / h;
+ int windowFlags = SDL_WINDOW_OPENGL;
- if (requestedRatio < targetRatio) {
- // Screen is higher / narrower than target aspect ratio: calculate
- // scale based on height.
- mScale = (int) std::floor((double) h / 360);
- } else {
- mScale = (int) std::floor((double) w / 640);
- }
-
- mWidth = w / mScale;
- mHeight = h / mScale;
- mBpp = bpp;
- mFullscreen = fs;
- mHWAccel = hwaccel;
+ mScale = getScale(w, h);
if (fs)
{
- displayFlags |= SDL_FULLSCREEN;
+ windowFlags |= SDL_WINDOW_FULLSCREEN;
}
else
{
// Resizing currently not supported on Windows, where it would require
// reuploading all textures.
#if !defined(_WIN32)
- displayFlags |= SDL_RESIZABLE;
+ windowFlags |= SDL_WINDOW_RESIZABLE;
#endif
}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- if (!(mTarget = SDL_SetVideoMode(w, h, bpp, displayFlags)))
+ SDL_Window *window = SDL_CreateWindow("Mana",
+ SDL_WINDOWPOS_UNDEFINED,
+ SDL_WINDOWPOS_UNDEFINED,
+ w, h, windowFlags);
+ if (!window) {
+ logger->log("Failed to create window: %s", SDL_GetError());
return false;
+ }
+
+ SDL_SetWindowMinimumSize(window, 640, 360);
+
+ SDL_GLContext glContext = SDL_GL_CreateContext(window);
+ if (!glContext) {
+ logger->log("Failed to create OpenGL context: %s", SDL_GetError());
+ return false;
+ }
+
+ mTarget = window;
+ mContext = glContext;
+ mWidth = w / mScale;
+ mHeight = h / mScale;
+ mFullscreen = fs;
-#ifdef __APPLE__
if (mSync)
{
- const GLint VBL = 1;
- CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL);
+ SDL_GL_SetSwapInterval(1);
}
-#endif
// Setup OpenGL
glViewport(0, 0, mWidth * mScale, mHeight * mScale);
@@ -152,6 +162,19 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
return true;
}
+void OpenGLGraphics::videoResized(int w, int h)
+{
+ _endDraw();
+
+ mScale = getScale(w, h);
+ mWidth = w / mScale;
+ mHeight = h / mScale;
+
+ glViewport(0, 0, w, h);
+
+ _beginDraw();
+}
+
static inline void drawQuad(Image *image,
int srcX, int srcY, int dstX, int dstY,
int width, int height)
@@ -623,7 +646,7 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image,
void OpenGLGraphics::updateScreen()
{
- SDL_GL_SwapBuffers();
+ SDL_GL_SwapWindow(mTarget);
/*
* glFinish flushes all OpenGL commands and makes sure they have been
@@ -647,7 +670,7 @@ void OpenGLGraphics::_beginDraw()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho(0.0, (double) mWidth, (double) mHeight, 0.0, -1.0, 1.0);
+ glOrtho(0.0, (double)mWidth, (double)mHeight, 0.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -669,8 +692,8 @@ void OpenGLGraphics::_endDraw()
SDL_Surface* OpenGLGraphics::getScreenshot()
{
- int h = mTarget->h;
- int w = mTarget->w;
+ int w, h;
+ SDL_GL_GetDrawableSize(mTarget, &w, &h);
GLint pack = 1;
SDL_Surface *screenshot = SDL_CreateRGBSurface(
@@ -721,13 +744,14 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area)
transY = -mClipStack.top().yOffset;
}
+ // Skip Graphics::popClipArea since we don't need to interact with SDL2
bool result = gcn::Graphics::pushClipArea(area);
transX += mClipStack.top().xOffset;
transY += mClipStack.top().yOffset;
int x = (int) (mClipStack.top().x * mScale);
- int y = mTarget->h - (int) ((mClipStack.top().y +
+ int y = (int) ((mHeight - mClipStack.top().y -
mClipStack.top().height) * mScale);
int width = (int) (mClipStack.top().width * mScale);
int height = (int) (mClipStack.top().height * mScale);
@@ -741,13 +765,14 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area)
void OpenGLGraphics::popClipArea()
{
+ // Skip Graphics::popClipArea since we don't need to interact with SDL2
gcn::Graphics::popClipArea();
if (mClipStack.empty())
return;
int x = (int) (mClipStack.top().x * mScale);
- int y = mTarget->h - (int) ((mClipStack.top().y +
+ int y = (int) ((mHeight - mClipStack.top().y -
mClipStack.top().height) * mScale);
int width = (int) (mClipStack.top().width * mScale);
int height = (int) (mClipStack.top().height * mScale);
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index 63c32261..01bca360 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -37,8 +37,8 @@ class OpenGLGraphics : public Graphics
~OpenGLGraphics();
/**
- * Sets whether vertical refresh syncing is enabled. Takes effect after
- * the next call to setVideoMode(). Only implemented on MacOS for now.
+ * Sets whether vertical refresh syncing is enabled. Takes effect
+ * immediately.
*/
void setSync(bool sync);
bool getSync() const { return mSync; }
@@ -53,7 +53,9 @@ class OpenGLGraphics : public Graphics
void setReduceInputLag(bool reduceInputLag);
bool getReduceInputLag() const { return mReduceInputLag; }
- bool setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel);
+ bool setVideoMode(int w, int h, bool fs);
+
+ void videoResized(int w, int h);
bool drawImage(Image *image,
int srcX, int srcY,
@@ -118,6 +120,7 @@ class OpenGLGraphics : public Graphics
void drawQuadArrayii(int size);
+ SDL_GLContext mContext = nullptr;
GLfloat *mFloatTexArray;
GLint *mIntTexArray;
GLint *mIntVertArray;
diff --git a/src/party.cpp b/src/party.cpp
index 344bbdad..126a63c1 100644
--- a/src/party.cpp
+++ b/src/party.cpp
@@ -168,7 +168,7 @@ void Party::setRights(short rights)
bool Party::isMember(PartyMember *member) const
{
- if (member->mParty > 0 && member->mParty != this)
+ if (member->mParty != nullptr && member->mParty != this)
return false;
MemberList::const_iterator itr = mMembers.begin(),
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index c31afbac..301927f8 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -33,25 +33,6 @@ AmbientLayer::AmbientLayer(Image *img, float parallax,
mKeepRatio(keepRatio)
{
mImage->incRef();
-
- if (keepRatio && !mImage->useOpenGL()
- && defaultScreenWidth != 0
- && defaultScreenHeight != 0
- && graphics->getWidth() != defaultScreenWidth
- && graphics->getHeight() != defaultScreenHeight)
- {
- // Rescale the overlay to keep the ratio as if we were on
- // the default resolution...
- Image *rescaledOverlay = mImage->SDLgetScaledImage(
- (int) mImage->getWidth() / defaultScreenWidth * graphics->getWidth(),
- (int) mImage->getHeight() / defaultScreenHeight * graphics->getHeight());
-
- if (rescaledOverlay)
- {
- mImage->decRef();
- mImage = rescaledOverlay;
- }
- }
}
AmbientLayer::~AmbientLayer()
@@ -86,7 +67,7 @@ void AmbientLayer::update(int timePassed, float dx, float dy)
void AmbientLayer::draw(Graphics *graphics, int x, int y)
{
- if (!mImage->useOpenGL() || !mKeepRatio)
+ if (!mKeepRatio)
graphics->drawImagePattern(mImage,
(int) -mPosX, (int) -mPosY, x + (int) mPosX, y + (int) mPosY);
else
@@ -94,5 +75,4 @@ void AmbientLayer::draw(Graphics *graphics, int x, int y)
(int) -mPosX, (int) -mPosY, x + (int) mPosX, y + (int) mPosY,
(int) mImage->getWidth() / defaultScreenWidth * graphics->getWidth(),
(int) mImage->getHeight() / defaultScreenHeight * graphics->getHeight());
-
}
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 7e592198..6f2609b0 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -29,10 +29,8 @@
#endif
#include "log.h"
-#include "configuration.h"
#include <SDL_image.h>
-#include <SDL_rotozoom.h>
#ifdef USE_OPENGL
bool Image::mUseOpenGL = false;
@@ -40,47 +38,38 @@ bool Image::mPowerOfTwoTextures = true;
int Image::mTextureType = 0;
int Image::mTextureSize = 0;
#endif
-bool Image::mEnableAlphaCache = false;
// The low CPU mode is disabled per default
bool Image::mDisableTransparency = false;
-Image::Image(SDL_Surface *image, bool hasAlphaChannel, Uint8 *alphaChannel):
+SDL_Renderer *Image::mRenderer;
+
+Image::Image(SDL_Texture *texture, int width, int height):
mAlpha(1.0f),
- mSDLSurface(image),
- mAlphaChannel(alphaChannel),
- mHasAlphaChannel(hasAlphaChannel)
+ mTexture(texture)
{
#ifdef USE_OPENGL
mGLImage = 0;
#endif
- mUseAlphaCache = Image::mEnableAlphaCache;
-
mBounds.x = 0;
mBounds.y = 0;
+ mBounds.w = width;
+ mBounds.h = height;
- mLoaded = false;
+ mLoaded = mTexture != nullptr;
- if (mSDLSurface)
+ if (!mLoaded)
{
- mBounds.w = mSDLSurface->w;
- mBounds.h = mSDLSurface->h;
-
- mLoaded = true;
- }
- else
logger->log(
"Image::Image(SDL_Surface*): Couldn't load invalid Surface!");
+ }
}
#ifdef USE_OPENGL
Image::Image(GLuint glimage, int width, int height, int texWidth, int texHeight):
mAlpha(1.0f),
- mSDLSurface(0),
- mAlphaChannel(0),
- mHasAlphaChannel(true),
- mUseAlphaCache(false),
+ mTexture(0),
mGLImage(glimage),
mTexWidth(texWidth),
mTexHeight(texHeight)
@@ -140,10 +129,8 @@ Resource *Image::load(SDL_RWops *rw, Dye const &dye)
rgba.Gmask = 0x00FF0000; rgba.Gloss = 0; rgba.Gshift = 16;
rgba.Bmask = 0x0000FF00; rgba.Bloss = 0; rgba.Bshift = 8;
rgba.Amask = 0x000000FF; rgba.Aloss = 0; rgba.Ashift = 0;
- rgba.colorkey = 0;
- rgba.alpha = 255;
- SDL_Surface *surf = SDL_ConvertSurface(tmpImage, &rgba, SDL_SWSURFACE);
+ SDL_Surface *surf = SDL_ConvertSurface(tmpImage, &rgba, 0);
SDL_FreeSurface(tmpImage);
Uint32 *pixels = static_cast< Uint32 * >(surf->pixels);
@@ -173,34 +160,14 @@ Image *Image::load(SDL_Surface *tmpImage)
return _SDLload(tmpImage);
}
-void Image::SDLcleanCache()
-{
- ResourceManager *resman = ResourceManager::getInstance();
-
- for (std::map<float, SDL_Surface*>::iterator
- i = mAlphaCache.begin(), i_end = mAlphaCache.end();
- i != i_end; ++i)
- {
- if (mSDLSurface != i->second)
- resman->scheduleDelete(i->second);
- i->second = 0;
- }
- mAlphaCache.clear();
-}
-
void Image::unload()
{
mLoaded = false;
- if (mSDLSurface)
+ if (mTexture)
{
- SDLcleanCache();
- // Free the image surface.
- SDL_FreeSurface(mSDLSurface);
- mSDLSurface = NULL;
-
- delete[] mAlphaChannel;
- mAlphaChannel = NULL;
+ SDL_DestroyTexture(mTexture);
+ mTexture = NULL;
}
#ifdef USE_OPENGL
@@ -221,27 +188,6 @@ bool Image::useOpenGL()
#endif
}
-bool Image::hasAlphaChannel()
-{
- if (!mLoaded)
- return false;
-
-#ifdef USE_OPENGL
- if (mUseOpenGL)
- return true;
-#endif
-
- return mHasAlphaChannel;
-}
-
-SDL_Surface *Image::getByAlpha(float alpha)
-{
- std::map<float, SDL_Surface*>::iterator it = mAlphaCache.find(alpha);
- if (it != mAlphaCache.end())
- return (*it).second;
- return 0;
-}
-
void Image::setAlpha(float alpha)
{
if (!useOpenGL() && mDisableTransparency)
@@ -253,188 +199,26 @@ void Image::setAlpha(float alpha)
if (alpha < 0.0f || alpha > 1.0f)
return;
- if (mSDLSurface)
- {
- if (mUseAlphaCache)
- {
- SDL_Surface *surface = getByAlpha(mAlpha);
- if (!surface)
- {
- if (mAlphaCache.size() > 100)
- SDLcleanCache();
-
- mAlphaCache[mAlpha] = mSDLSurface;
- }
- surface = getByAlpha(alpha);
- if (surface)
- {
- mAlphaCache.erase(alpha);
- mSDLSurface = surface;
- mAlpha = alpha;
- return;
- }
- else
- {
- mSDLSurface = Image::SDLduplicateSurface(mSDLSurface);
- }
- }
-
- mAlpha = alpha;
-
- if (!hasAlphaChannel())
- {
- // Set the alpha value this image is drawn at
- SDL_SetAlpha(mSDLSurface, SDL_SRCALPHA, (int) (255 * mAlpha));
- }
- else
- {
- if (SDL_MUSTLOCK(mSDLSurface))
- SDL_LockSurface(mSDLSurface);
-
- // Precompute as much as possible
- int maxHeight = std::min((mBounds.y + mBounds.h), mSDLSurface->h);
- int maxWidth = std::min((mBounds.x + mBounds.w), mSDLSurface->w);
- int i = 0;
-
- for (int y = mBounds.y; y < maxHeight; y++)
- for (int x = mBounds.x; x < maxWidth; x++)
- {
- i = y * mSDLSurface->w + x;
- // Only change the pixel if it was visible at load time...
- Uint8 sourceAlpha = mAlphaChannel[i];
- if (sourceAlpha > 0)
- {
- Uint8 r, g, b, a;
- SDL_GetRGBA(((Uint32*) mSDLSurface->pixels)[i],
- mSDLSurface->format,
- &r, &g, &b, &a);
-
- a = (Uint8) (sourceAlpha * mAlpha);
-
- // Here is the pixel we want to set
- ((Uint32 *)(mSDLSurface->pixels))[i] =
- SDL_MapRGBA(mSDLSurface->format, r, g, b, a);
- }
- }
-
- if (SDL_MUSTLOCK(mSDLSurface))
- SDL_UnlockSurface(mSDLSurface);
- }
- }
- else
- {
- mAlpha = alpha;
- }
-}
-
-Image *Image::SDLgetScaledImage(int width, int height)
-{
- if (width == 0 || height == 0)
- return 0;
+ mAlpha = alpha;
- // Increase our reference count and return ourselves in case of same size
- if (width == getWidth() && height == getHeight())
+ if (mTexture)
{
- incRef();
- return this;
- }
-
- if (!mSDLSurface)
- return 0;
-
- ResourceManager *resman = ResourceManager::getInstance();
-
- // Generate a unique ID path for storing the scaled version in the
- // resource manager.
- std::string idPath = getIdPath();
- idPath += ":scaled:";
- idPath += toString(width);
- idPath += "x";
- idPath += toString(height);
-
- // Try whether a scaled version is already available
- Image *scaledImage = static_cast<Image*>(resman->get(idPath));
-
- if (!scaledImage)
- {
- // No scaled version with this size exists already, so create one
- SDL_Surface *scaledSurface = zoomSurface(mSDLSurface,
- (double) width / getWidth(),
- (double) height / getHeight(),
- 1);
-
- if (scaledSurface)
- {
- scaledImage = load(scaledSurface);
- SDL_FreeSurface(scaledSurface);
-
- // Place the scaled image in the resource manager
- resman->addResource(idPath, scaledImage);
- }
+ SDL_SetTextureAlphaMod(mTexture, (Uint8) (255 * mAlpha));
}
-
- return scaledImage;
}
-SDL_Surface* Image::SDLduplicateSurface(SDL_Surface* tmpImage)
+Image *Image::_SDLload(SDL_Surface *image)
{
- if (!tmpImage || !tmpImage->format)
+ if (!image || !mRenderer)
return NULL;
- return SDL_ConvertSurface(tmpImage, tmpImage->format, SDL_SWSURFACE);
+ SDL_Texture *texture = SDL_CreateTextureFromSurface(mRenderer, image);
+ return new Image(texture, image->w, image->h);
}
-Image *Image::_SDLload(SDL_Surface *tmpImage)
+void Image::setRenderer(SDL_Renderer *renderer)
{
- if (!tmpImage)
- return NULL;
-
- bool hasAlpha = false;
-
- // The alpha channel to be filled with alpha values
- Uint8 *alphaChannel = new Uint8[tmpImage->w * tmpImage->h];
-
- if (tmpImage->format->BitsPerPixel == 32)
- {
- // Figure out whether the image uses its alpha layer
- for (int i = 0; i < tmpImage->w * tmpImage->h; ++i)
- {
- Uint8 r, g, b, a;
- SDL_GetRGBA(
- ((Uint32*) tmpImage->pixels)[i],
- tmpImage->format,
- &r, &g, &b, &a);
-
- if (a != 255)
- hasAlpha = true;
-
- alphaChannel[i] = a;
- }
- }
-
- SDL_Surface *image;
-
- // Convert the surface to the current display format
- if (hasAlpha)
- image = SDL_DisplayFormatAlpha(tmpImage);
- else
- {
- image = SDL_DisplayFormat(tmpImage);
-
- // We also delete the alpha channel since
- // it's not used.
- delete[] alphaChannel;
- alphaChannel = NULL;
- }
-
- if (!image)
- {
- logger->log("Error: Image convert failed.");
- delete[] alphaChannel;
- return NULL;
- }
-
- return new Image(image, hasAlpha, alphaChannel);
+ mRenderer = renderer;
}
#ifdef USE_OPENGL
@@ -489,7 +273,7 @@ Image *Image::_GLload(SDL_Surface *image)
}
// Make sure the alpha channel is not used, but copied to destination
- SDL_SetAlpha(oldImage, 0, SDL_ALPHA_OPAQUE);
+ SDL_SetSurfaceBlendMode(oldImage, SDL_BLENDMODE_NONE);
SDL_BlitSurface(oldImage, NULL, image, NULL);
}
@@ -583,38 +367,24 @@ Image *Image::getSubImage(int x, int y, int width, int height)
mTexWidth, mTexHeight);
#endif
- return new SubImage(this, mSDLSurface,
+ return new SubImage(this, mTexture,
mBounds.x + x,
mBounds.y + y,
width, height);
}
-void Image::SDLterminateAlphaCache()
-{
- SDLcleanCache();
- mUseAlphaCache = false;
-}
-
//============================================================================
// SubImage Class
//============================================================================
-SubImage::SubImage(Image *parent, SDL_Surface *image,
+SubImage::SubImage(Image *parent, SDL_Texture *texture,
int x, int y, int width, int height):
- Image(image),
+ Image(texture, width, height),
mParent(parent)
{
if (mParent)
{
mParent->incRef();
- mParent->SDLterminateAlphaCache();
- mHasAlphaChannel = mParent->hasAlphaChannel();
- mAlphaChannel = mParent->SDLgetAlphaChannel();
- }
- else
- {
- mHasAlphaChannel = false;
- mAlphaChannel = 0;
}
// Set up the rectangle.
@@ -622,7 +392,6 @@ SubImage::SubImage(Image *parent, SDL_Surface *image,
mBounds.y = y;
mBounds.w = width;
mBounds.h = height;
- mUseAlphaCache = false;
}
#ifdef USE_OPENGL
@@ -644,10 +413,8 @@ SubImage::SubImage(Image *parent, GLuint image,
SubImage::~SubImage()
{
- // Avoid destruction of the image
- mSDLSurface = 0;
- // Avoid possible destruction of its alpha channel
- mAlphaChannel = 0;
+ // Avoid destruction of the texture
+ mTexture = nullptr;
#ifdef USE_OPENGL
mGLImage = 0;
#endif
diff --git a/src/resources/image.h b/src/resources/image.h
index b762bf2a..efe2262e 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -37,8 +37,6 @@
#include <SDL_opengl.h>
#endif
-#include <map>
-
class Dye;
class Position;
@@ -129,12 +127,6 @@ class Image : public Resource
*/
Image *getSubImage(int x, int y, int width, int height);
- /**
- * Tells if the image has got an alpha channel
- * @return true if it's true, false otherwise.
- */
- bool hasAlphaChannel();
-
// SDL only public functions
/**
@@ -146,31 +138,7 @@ class Image : public Resource
static bool SDLisTransparencyDisabled()
{ return mDisableTransparency; }
- /**
- * Gets an scaled instance of an image. The returned image is managed
- * by the ResourceManager.
- *
- * @param width The desired width of the scaled image.
- * @param height The desired height of the scaled image.
- *
- * @return An Image resource, or 0 on failure.
- */
- Image *SDLgetScaledImage(int width, int height);
-
- /**
- * Get the alpha Channel of a SDL surface.
- */
- Uint8 *SDLgetAlphaChannel() const
- { return mAlphaChannel; }
-
- SDL_Surface* SDLduplicateSurface(SDL_Surface* tmpImage);
-
- void SDLcleanCache();
-
- void SDLterminateAlphaCache();
-
- static void SDLsetEnableAlphaCache(bool n)
- { mEnableAlphaCache = n; }
+ static void setRenderer(SDL_Renderer *renderer);
#ifdef USE_OPENGL
@@ -204,30 +172,18 @@ class Image : public Resource
// -----------------------
/** SDL Constructor */
- Image(SDL_Surface *image, bool hasAlphaChannel = false,
- Uint8 *alphaChannel = NULL);
+ Image(SDL_Texture *texture, int width, int height);
- /** SDL_Surface to SDL_Surface Image loader */
+ /** SDL_Surface to SDL_Texture Image loader */
static Image *_SDLload(SDL_Surface *tmpImage);
- SDL_Surface *getByAlpha(float alpha);
-
- SDL_Surface *mSDLSurface;
-
- /** Alpha Channel pointer used for 32bit based SDL surfaces */
- Uint8 *mAlphaChannel;
- bool mHasAlphaChannel;
-
- /** Alpha cache: The cache stores a copy of the image
- for specific requested opacities, hence, increasing
- the image disply speed */
- std::map<float, SDL_Surface*> mAlphaCache;
- bool mUseAlphaCache;
- static bool mEnableAlphaCache;
+ SDL_Texture *mTexture;
/** Stores whether the transparency is disabled */
static bool mDisableTransparency;
+ static SDL_Renderer *mRenderer;
+
// -----------------------
// OpenGL protected members
// -----------------------
@@ -261,7 +217,7 @@ class Image : public Resource
class SubImage : public Image
{
public:
- SubImage(Image *parent, SDL_Surface *image,
+ SubImage(Image *parent, SDL_Texture *texture,
int x, int y, int width, int height);
#ifdef USE_OPENGL
SubImage(Image *parent, GLuint image, int x, int y,
diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp
index 940ebb59..a26fae9d 100644
--- a/src/resources/settingsmanager.cpp
+++ b/src/resources/settingsmanager.cpp
@@ -85,7 +85,8 @@ namespace SettingsManager
NPCDB::unload();
SpecialDB::unload();
MonsterDB::unload();
- itemDb->unload();
+ if (itemDb)
+ itemDb->unload();
hairDB.unload();
Attributes::unload();
}
@@ -209,4 +210,3 @@ namespace SettingsManager
}
}
-
diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp
index 8db05be9..84d6311b 100644
--- a/src/resources/theme.cpp
+++ b/src/resources/theme.cpp
@@ -88,8 +88,8 @@ void Skin::updateAlpha(float minimumOpacityAllowed)
void Skin::setAlpha(float alpha)
{
- for_each(mBorder.grid, mBorder.grid + 9,
- std::bind2nd(std::mem_fun(&Image::setAlpha), alpha));
+ std::for_each(mBorder.grid, mBorder.grid + 9,
+ [=] (Image *img) { img->setAlpha(alpha); });
mCloseImage->setAlpha(alpha);
mStickyImageUp->setAlpha(alpha);
diff --git a/src/sound.cpp b/src/sound.cpp
index 1af1f136..44f55cba 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -22,7 +22,6 @@
#include <SDL.h>
#include "configuration.h"
-#include "game.h"
#include "localplayer.h"
#include "log.h"
#include "sound.h"
@@ -112,7 +111,6 @@ void Sound::info()
{
SDL_version compiledVersion;
const SDL_version *linkedVersion;
- char driver[40] = "Unknown";
const char *format = "Unknown";
int rate = 0;
Uint16 audioFormat = 0;
@@ -121,7 +119,7 @@ void Sound::info()
MIX_VERSION(&compiledVersion);
linkedVersion = Mix_Linked_Version();
- SDL_AudioDriverName(driver, 40);
+ const char *driver = SDL_GetCurrentAudioDriver();
Mix_QuerySpec(&rate, &audioFormat, &channels);
switch (audioFormat)
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 2bb8fb49..ccb36d79 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -1,7 +1,6 @@
/*
- * Retrieve string pasted depending on OS mechanisms.
- * Copyright (C) 2001-2010 Wormux Team
- * Copyright (C) 2010-2012 The Mana Developers
+ * Clipboard Interaction.
+ * Copyright (C) 2010-2024 The Mana Developers
*
* This file is part of The Mana Client.
*
@@ -19,301 +18,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/*
- * IMPORTANT!
- *
- * This code was taken from Wormux svn trunk at Feb 25 2010. Please don't
- * make any unnecessary modifications, and try to sync up modifications
- * when possible.
- */
-
-#ifdef _MSC_VER
-# include "msvc/config.h"
-#elif defined(HAVE_CONFIG_H)
-# include "config.h"
-#endif
-
-#include <SDL_syswm.h>
-#include "copynpaste.h"
-
-#ifdef _WIN32
-bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
-{
- bool ret = false;
-
- if (!OpenClipboard(NULL))
- return false;
-
- HANDLE h = GetClipboardData(CF_UNICODETEXT);
- if (h)
- {
- LPCWSTR data = (LPCWSTR)GlobalLock(h);
+#include "utils/copynpaste.h"
- if (data)
- {
- int len = WideCharToMultiByte(CP_UTF8, 0, data, -1, NULL, 0, NULL, NULL);
- if (len > 0)
- {
- // Convert from UTF-16 to UTF-8
- void *temp = malloc(len);
- if (WideCharToMultiByte(CP_UTF8, 0, data, -1, (LPSTR)temp, len, NULL, NULL))
- {
- text.insert(pos, (char*)temp);
- pos += len-1;
- }
- free(temp);
- ret = true;
- }
- }
- GlobalUnlock(h);
- }
- else
- {
- h = GetClipboardData(CF_TEXT);
-
- if (h)
- {
- const char *data = (char*)GlobalLock(h);
- if (data)
- {
- text.insert(pos, data);
- pos += strlen(data);
- ret = true;
- }
- GlobalUnlock(h);
- }
- }
-
- CloseClipboard();
- return ret;
-}
-#elif defined(__APPLE__)
+#include <SDL.h>
-#ifdef Status
-#undef Status
-#endif
-
-#include <Carbon/Carbon.h>
-
-// Sorry for the very long code, all nicer OS X APIs are coded in Objective C and not C!
-// Also it does very thorough error handling
-bool GetDataFromPasteboard( PasteboardRef inPasteboard, char* flavorText /* out */, const int bufSize )
+bool insertFromClipboard(std::string &text, std::string::size_type &pos)
{
- OSStatus err = noErr;
- PasteboardSyncFlags syncFlags;
- ItemCount itemCount;
-
- syncFlags = PasteboardSynchronize( inPasteboard );
-
- //require_action( syncFlags & kPasteboardModified, PasteboardOutOfSync,
- // err = badPasteboardSyncErr );
-
- err = PasteboardGetItemCount( inPasteboard, &itemCount );
- require_noerr( err, CantGetPasteboardItemCount );
-
- for (UInt32 itemIndex = 1; itemIndex <= itemCount; itemIndex++)
- {
- PasteboardItemID itemID;
- CFArrayRef flavorTypeArray;
- CFIndex flavorCount;
-
- err = PasteboardGetItemIdentifier( inPasteboard, itemIndex, &itemID );
- require_noerr( err, CantGetPasteboardItemIdentifier );
-
- err = PasteboardCopyItemFlavors( inPasteboard, itemID, &flavorTypeArray );
- require_noerr( err, CantCopyPasteboardItemFlavors );
-
- flavorCount = CFArrayGetCount( flavorTypeArray );
-
- for (CFIndex flavorIndex = 0; flavorIndex < flavorCount; flavorIndex++)
- {
- CFStringRef flavorType;
- CFDataRef flavorData;
- CFIndex flavorDataSize;
- flavorType = (CFStringRef)CFArrayGetValueAtIndex(flavorTypeArray, flavorIndex);
-
- // we're only interested by text...
- if (UTTypeConformsTo(flavorType, CFSTR("public.utf8-plain-text")))
- {
- err = PasteboardCopyItemFlavorData( inPasteboard, itemID,
- flavorType, &flavorData );
- require_noerr( err, CantCopyFlavorData );
- flavorDataSize = CFDataGetLength( flavorData );
- flavorDataSize = (flavorDataSize<254) ? flavorDataSize : 254;
-
- if (flavorDataSize+2 > bufSize)
- {
- fprintf(stderr, "Cannot copy clipboard, contents is too big!\n");
- return false;
- }
-
- for (short dataIndex = 0; dataIndex <= flavorDataSize; dataIndex++)
- {
- char byte = *(CFDataGetBytePtr( flavorData ) + dataIndex);
- flavorText[dataIndex] = byte;
- }
-
- flavorText[flavorDataSize] = '\0';
- flavorText[flavorDataSize+1] = '\n';
-
- CFRelease (flavorData);
- return true;
- }
-
- continue;
- CantCopyFlavorData: fprintf(stderr, "Cannot copy clipboard, CantCopyFlavorData!\n");
- }
-
- CFRelease (flavorTypeArray);
- continue;
-
- CantCopyPasteboardItemFlavors: fprintf(stderr, "Cannot copy clipboard, CantCopyPasteboardItemFlavors!\n"); continue;
- CantGetPasteboardItemIdentifier: fprintf(stderr, "Cannot copy clipboard, CantGetPasteboardItemIdentifier!\n"); continue;
- }
- fprintf(stderr, "Cannot copy clipboard, found no acceptable flavour!\n");
- return false;
-
- CantGetPasteboardItemCount: fprintf(stderr, "Cannot copy clipboard, CantGetPasteboardItemCount!\n"); return false;
- //PasteboardOutOfSync: fprintf(stderr, "Cannot copy clipboard, PasteboardOutOfSync!\n"); return false;
-}
-
-bool getClipBoard(char* text /* out */, const int bufSize )
-{
- OSStatus err = noErr;
-
- PasteboardRef theClipboard;
- err = PasteboardCreate( kPasteboardClipboard, &theClipboard );
- require_noerr( err, PasteboardCreateFailed );
-
- if (!GetDataFromPasteboard(theClipboard, text, bufSize))
- {
- fprintf(stderr, "Cannot copy clipboard, GetDataFromPasteboardFailed!\n");
- return false;
- }
-
- CFRelease(theClipboard);
-
- return true;
-
- // ---- error handling
- PasteboardCreateFailed: fprintf(stderr, "Cannot copy clipboard, PasteboardCreateFailed!\n");
- CFRelease(theClipboard);
- return false;
-}
-
-bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
-{
- const int bufSize = 512;
- char buffer[bufSize];
-
- if (getClipBoard(buffer, bufSize))
- {
- text = buffer;
- pos += strlen(buffer);
- return true;
- }
- else
- {
- return false;
- }
-}
-
-#elif USE_X11
-static char* getSelection(Display *dpy, Window us, Atom selection)
-{
- int max_events = 50;
- Window owner = XGetSelectionOwner (dpy, selection);
- int ret;
-
- //printf("XConvertSelection on %s\n", XGetAtomName(dpy, selection));
- if (owner == None)
- {
- //printf("No owner\n");
- return NULL;
- }
- XConvertSelection(dpy, selection, XA_STRING, XA_PRIMARY, us, CurrentTime);
- XFlush(dpy);
-
- while (max_events--)
- {
- XEvent e;
-
- XNextEvent(dpy, &e);
- if(e.type == SelectionNotify)
- {
- //printf("Received %s\n", XGetAtomName(dpy, e.xselection.selection));
- if(e.xselection.property == None)
- {
- //printf("Couldn't convert\n");
- return NULL;
- }
-
- long unsigned len, left, dummy;
- int format;
- Atom type;
- unsigned char *data = NULL;
-
- XGetWindowProperty(dpy, us, e.xselection.property, 0, 0, False,
- AnyPropertyType, &type, &format, &len, &left, &data);
- if (left < 1)
- return NULL;
-
- ret = XGetWindowProperty(dpy, us, e.xselection.property, 0, left, False,
- AnyPropertyType, &type, &format, &len, &dummy, &data);
- if (ret != Success)
- {
- //printf("Failed to get property: %p on %lu\n", data, len);
- return NULL;
- }
-
- //printf(">>> Got %s: len=%lu left=%lu (event %i)\n", data, len, left, 50-max_events);
- return (char*)data;
- }
- }
- return NULL;
-}
-
-bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
-{
- SDL_SysWMinfo info;
-
- //printf("Retrieving buffer...\n");
- SDL_VERSION(&info.version);
- if ( SDL_GetWMInfo(&info) )
- {
- Display *dpy = info.info.x11.display;
- Window us = info.info.x11.window;
- char *data = NULL;
-
- if (!data)
- {
- data = getSelection(dpy, us, XA_PRIMARY);
- }
- if (!data)
- {
- data = getSelection(dpy, us, XA_SECONDARY);
- }
- if (!data)
- {
- Atom XA_CLIPBOARD = XInternAtom(dpy, "CLIPBOARD", 0);
- data = getSelection(dpy, us, XA_CLIPBOARD);
- }
- if (data)
- {
- // check cursor position
- if (pos > text.size()) {
- pos = text.size();
- }
-
- text.insert(pos, data);
- pos += strlen(data);
- XFree(data);
-
- return true;
- }
- }
- return false;
+ char *buf = SDL_GetClipboardText();
+ const size_t len = strlen(buf);
+ if (len > 0) {
+ text.insert(pos, buf);
+ pos += len;
+ }
+ SDL_free(buf);
+ return len > 0;
}
-#else
-bool RetrieveBuffer(std::string&, std::string::size_type&) { return false; }
-#endif
diff --git a/src/utils/copynpaste.h b/src/utils/copynpaste.h
index c2430e1c..b6aa0de0 100644
--- a/src/utils/copynpaste.h
+++ b/src/utils/copynpaste.h
@@ -1,7 +1,6 @@
/*
- * Retrieve string pasted depending on OS mechanisms.
- * Copyright (C) 2001-2010 Wormux Team
- * Copyright (C) 2010-2012 The Mana Developers
+ * Clipboard Interaction.
+ * Copyright (C) 2010-2024 The Mana Developers
*
* This file is part of The Mana Client.
*
@@ -25,10 +24,7 @@
* Attempts to retrieve text from the clipboard buffer and inserts it in
* \a text at position \pos. The characters are encoded in utf-8.
*
- * Implemented for Windows, X11 and Mac OS X.
- *
* @return <code>true</code> when successful or <code>false</code> when there
* was a problem retrieving the clipboard buffer.
*/
-bool RetrieveBuffer(std::string& text, std::string::size_type& pos);
-
+bool insertFromClipboard(std::string &text, std::string::size_type &pos);
diff --git a/src/utils/dtor.h b/src/utils/dtor.h
index 223b73ed..76c68725 100644
--- a/src/utils/dtor.h
+++ b/src/utils/dtor.h
@@ -23,18 +23,16 @@
#define UTILS_DTOR_H
#include <algorithm>
-#include <functional>
#include <utility>
template<typename T>
-struct dtor : public std::unary_function <T, void>
+struct dtor
{
void operator()(T &ptr) { delete ptr; }
};
template<typename T1, typename T2>
-struct dtor<std::pair<T1, T2> > :
-public std::unary_function <std::pair<T1, T2>, void>
+struct dtor<std::pair<T1, T2>>
{
void operator()(std::pair<T1, T2> &pair) { delete pair.second; }
};
diff --git a/src/utils/mutex.h b/src/utils/mutex.h
index f7f26233..d0120cfa 100644
--- a/src/utils/mutex.h
+++ b/src/utils/mutex.h
@@ -53,9 +53,7 @@ class MutexLocker
{
public:
MutexLocker(Mutex *mutex);
-#ifdef ENABLE_CPP0X
MutexLocker(MutexLocker&&);
-#endif
~MutexLocker();
private:
@@ -95,13 +93,11 @@ inline MutexLocker::MutexLocker(Mutex *mutex):
mMutex->lock();
}
-#ifdef ENABLE_CPP0X
inline MutexLocker::MutexLocker(MutexLocker&& rhs):
mMutex(rhs.mMutex)
{
rhs.mMutex = NULL;
}
-#endif
inline MutexLocker::~MutexLocker()
{
diff --git a/src/utils/physfsrwops.h b/src/utils/physfsrwops.h
index 406fba6f..8008b224 100644
--- a/src/utils/physfsrwops.h
+++ b/src/utils/physfsrwops.h
@@ -40,7 +40,7 @@ extern "C" {
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
* of the error can be gleaned from PHYSFS_getLastError().
*/
-__EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
+SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
/**
* Open a platform-independent filename for writing, and make it accessible
@@ -52,7 +52,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
* of the error can be gleaned from PHYSFS_getLastError().
*/
-__EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
+SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
/**
* Open a platform-independent filename for appending, and make it accessible
@@ -64,7 +64,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
* of the error can be gleaned from PHYSFS_getLastError().
*/
-__EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
+SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
/**
* Make a SDL_RWops from an existing PhysicsFS file handle. You should
@@ -76,7 +76,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
* of the error can be gleaned from PHYSFS_getLastError().
*/
-__EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);
+SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);
#ifdef __cplusplus
}
@@ -85,4 +85,3 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);
#endif /* include-once blocker */
/* end of physfsrwops.h ... */
-
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 4f27d41b..05f1bf7b 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -136,7 +136,7 @@ int compareStrI(const std::string &a, const std::string &b)
std::string::const_iterator itB = b.begin();
std::string::const_iterator endB = b.end();
- for (; itA < endA, itB < endB; ++itA, ++itB)
+ for (; itA < endA && itB < endB; ++itA, ++itB)
{
int comp = tolower(*itA) - tolower(*itB);
if (comp)
diff --git a/src/vector.h b/src/vector.h
index d181f938..25f6c120 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -60,6 +60,14 @@ class Vector
return x == 0.0f && y == 0.0f && z == 0.0f;
}
+ Vector &operator=(const Vector &v)
+ {
+ x = v.x;
+ y = v.y;
+ z = v.z;
+ return *this;
+ }
+
/**
* Scale vector operator.
*/
diff --git a/update-creator.sh b/update-creator.sh
deleted file mode 100755
index 259dcc21..00000000
--- a/update-creator.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-git ls-files \*.cpp \
- \*.c \
- \*.h \
- \*.txt \
- \*.xml \
- \*.mana \
- > mana.files