summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2011-11-17 20:22:17 -0600
committerDavid Athay <ko2fan@gmail.com>2011-11-17 20:22:17 -0600
commit41a8c0406301fdb3d92374774066837c42eed112 (patch)
treeb0e2ef0862d38057ec3ed045500ca463b120109d
parentcd0caeb87a10bc8ed645223c7155c9576b6fb102 (diff)
parent965cad21750b45206ceea4523d94b7ec92bb8ac6 (diff)
downloadmana-0.5.tar.gz
mana-0.5.tar.bz2
mana-0.5.tar.xz
mana-0.5.zip
Merge branch '0.5' of github.com:mana/mana into 0.50.5
-rw-r--r--CMakeLists.txt2
-rw-r--r--NEWS7
-rw-r--r--README2
-rw-r--r--data/help/changes.txt13
-rw-r--r--data/help/header.txt4
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/main.h2
-rw-r--r--src/map.cpp13
-rw-r--r--src/map.h2
-rw-r--r--src/openglgraphics.cpp77
-rw-r--r--src/openglgraphics.h2
-rw-r--r--src/winver.h4
12 files changed, 76 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a139d66..ba1f306a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ CMAKE_POLICY(VERSION 2.6)
PROJECT(MANA)
IF (NOT VERSION)
- SET(VERSION 0.5.2)
+ SET(VERSION 0.5.3)
ENDIF()
STRING(REPLACE "." " " _VERSION ${VERSION})
diff --git a/NEWS b/NEWS
index cca5d461..a6ebfce8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+0.5.3 (11 September 2011)
+- Fixed endless loop when a sprite definition promises too many images
+- Fixed crash when selecting a character that has a Dark Talisman equipped
+- Fixed drawing glitch with overwide tiles
+- Fixed scaling of overlays in OpenGL mode
+- Fixed building without OpenGL
+
0.5.2 (17 April 2011)
- Removed NPC "Thanks for buying/selling" messages from the chat
- Added a few missing authentication failure reasons
diff --git a/README b/README
index 6e62d537..a3b0258f 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
THE MANA CLIENT
===============
- Version: 0.5.2 Date: 2011-04-17
+ Version: 0.5.3 Date: 2011-09-11
Development team:
- See AUTHORS file for a list
diff --git a/data/help/changes.txt b/data/help/changes.txt
index 2453a608..33fb2845 100644
--- a/data/help/changes.txt
+++ b/data/help/changes.txt
@@ -3,6 +3,11 @@
##3 === RECENT CHANGES ===
+ 0.5.3 (11 September 2011)
+ - Fixed endless loop when a sprite definition promises too many images
+ - Fixed crash when selecting a character that has a Dark Talisman equipped
+ - Fixed building without OpenGL
+
0.5.2 (17 April 2011)
- Removed NPC "Thanks for buying/selling" messages from the chat
- Added a few missing authentication failure reasons
@@ -142,11 +147,3 @@
- Fixed inability to chat while talking to NPCs
- Updated Swedish translation
- 0.0.28 (25 January 2009)
- - Added support for animated map tiles
- - Added support for internationalization, plus many translations
- - Added support for TrueType fonts
- - Trade window is now resizable
- - Obscure precise home directory name when making screenshots
- - Fixed follow-parent of nested and being-following particle emitters
-
diff --git a/data/help/header.txt b/data/help/header.txt
index 505ae25c..52ecedae 100644
--- a/data/help/header.txt
+++ b/data/help/header.txt
@@ -1,8 +1,8 @@
-##1 M A N A S O U R C E
+##1 M A N A C L I E N T
##1 ==========================================
- ##2Version:##6 0.5.2 ##2Date:##3 17 April 2011
+ ##2Version:##6 0.5.3 ##2Date:##3 11 September 2011
##2 Website: http://manasource.org
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 35af94fb..7b64d404 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -649,6 +649,7 @@ TARGET_LINK_LIBRARIES(mana
${CURL_LIBRARIES}
${LIBXML2_LIBRARIES}
${GUICHAN_LIBRARIES}
+ ${X11_LIBRARIES}
${OPENGL_LIBRARIES}
${LIBINTL_LIBRARIES}
${EXTRA_LIBRARIES})
diff --git a/src/main.h b/src/main.h
index b1db3258..681fd9c8 100644
--- a/src/main.h
+++ b/src/main.h
@@ -55,7 +55,7 @@
#elif defined WIN32
#include "winver.h"
#elif defined __APPLE__
-#define PACKAGE_VERSION "0.5.2"
+#define PACKAGE_VERSION "0.5.3"
#endif
#ifdef PACKAGE_VERSION
diff --git a/src/map.cpp b/src/map.cpp
index f845f2ff..9e6d865d 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -120,8 +120,10 @@ Image* MapLayer::getTile(int x, int y) const
return mTiles[x + y * mWidth];
}
-void MapLayer::draw(Graphics *graphics, int startX, int startY,
- int endX, int endY, int scrollX, int scrollY,
+void MapLayer::draw(Graphics *graphics,
+ int startX, int startY,
+ int endX, int endY,
+ int scrollX, int scrollY,
const MapSprites &sprites, int debugFlags) const
{
startX -= mX;
@@ -178,7 +180,8 @@ void MapLayer::draw(Graphics *graphics, int startX, int startY,
Map::Map(int width, int height, int tileWidth, int tileHeight):
mWidth(width), mHeight(height),
mTileWidth(tileWidth), mTileHeight(tileHeight),
- mMaxTileHeight(height),
+ mMaxTileHeight(tileHeight),
+ mMaxTileWidth(tileWidth),
mDebugFlags(MAP_NORMAL),
mOnClosedList(1), mOnOpenList(2),
mLastScrollX(0.0f), mLastScrollY(0.0f)
@@ -281,6 +284,8 @@ void Map::addTileset(Tileset *tileset)
if (tileset->getHeight() > mMaxTileHeight)
mMaxTileHeight = tileset->getHeight();
+ if (tileset->getWidth() > mMaxTileWidth)
+ mMaxTileWidth = tileset->getWidth();
}
bool spriteCompare(const Sprite *a, const Sprite *b)
@@ -304,7 +309,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY)
// Calculate range of tiles which are on-screen
int endPixelY = graphics->getHeight() + scrollY + mTileHeight - 1;
endPixelY += mMaxTileHeight - mTileHeight;
- int startX = scrollX / mTileWidth;
+ int startX = (scrollX - mMaxTileWidth + mTileWidth) / mTileWidth;
int startY = scrollY / mTileHeight;
int endX = (graphics->getWidth() + scrollX + mTileWidth - 1) / mTileWidth;
int endY = endPixelY / mTileHeight;
diff --git a/src/map.h b/src/map.h
index 9fc32232..2e0eb614 100644
--- a/src/map.h
+++ b/src/map.h
@@ -360,7 +360,7 @@ class Map : public Properties
int mWidth, mHeight;
int mTileWidth, mTileHeight;
- int mMaxTileHeight;
+ int mMaxTileHeight, mMaxTileWidth;
MetaTile *mMetaTiles;
Layers mLayers;
Tilesets mTilesets;
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 7818e9d2..33346b47 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -480,24 +480,26 @@ void OpenGLGraphics::drawImagePattern(Image *image, int x, int y, int w, int h)
static_cast<GLubyte>(mColor.a));
}
-void OpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y,
- int w, int h, int scaledWidth,
+void OpenGLGraphics::drawRescaledImagePattern(Image *image,
+ int x, int y,
+ int w, int h,
+ int scaledWidth,
int scaledHeight)
{
if (!image)
return;
+ if (scaledWidth == 0 || scaledHeight == 0)
+ return;
+
const int srcX = image->mBounds.x;
const int srcY = image->mBounds.y;
- const int iw = scaledWidth;
- const int ih = scaledHeight;
+ const int iw = image->getWidth();
+ const int ih = image->getHeight();
if (iw == 0 || ih == 0)
return;
- const float tw = static_cast<float>(image->getTextureWidth());
- const float th = static_cast<float>(image->getTextureHeight());
-
glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha);
bindTexture(Image::mTextureType, image->mGLImage);
@@ -507,23 +509,31 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y,
unsigned int vp = 0;
const unsigned int vLimit = vertexBufSize * 4;
- float texX1 = static_cast<float>(srcX) / tw;
- float texY1 = static_cast<float>(srcY) / th;
-
// Draw a set of textured rectangles
if (image->getTextureType() == GL_TEXTURE_2D)
{
- for (int py = 0; py < h; py += ih)
+ const float tw = static_cast<float>(image->getTextureWidth());
+ const float th = static_cast<float>(image->getTextureHeight());
+
+ const float texX1 = static_cast<float>(srcX) / tw;
+ const float texY1 = static_cast<float>(srcY) / th;
+
+ const float tFractionW = iw / tw;
+ const float tFractionH = ih / th;
+
+ for (int py = 0; py < h; py += scaledHeight)
{
- const int height = (py + ih >= h) ? h - py : ih;
+ const int height = (py + scaledHeight >= h) ? h - py : scaledHeight;
const int dstY = y + py;
- for (int px = 0; px < w; px += iw)
+ for (int px = 0; px < w; px += scaledWidth)
{
- int width = (px + iw >= w) ? w - px : iw;
+ int width = (px + scaledWidth >= w) ? w - px : scaledWidth;
int dstX = x + px;
+ const float visibleFractionW = (float) width / scaledWidth;
+ const float visibleFractionH = (float) height / scaledHeight;
- float texX2 = static_cast<float>(srcX + width) / tw;
- float texY2 = static_cast<float>(srcY + height) / th;
+ const float texX2 = texX1 + tFractionW * visibleFractionW;
+ const float texY2 = texY1 + tFractionH * visibleFractionH;
mFloatTexArray[vp + 0] = texX1;
mFloatTexArray[vp + 1] = texY1;
@@ -540,14 +550,14 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y,
mIntVertArray[vp + 0] = dstX;
mIntVertArray[vp + 1] = dstY;
- mIntVertArray[vp + 2] = dstX + scaledWidth;
+ mIntVertArray[vp + 2] = dstX + width;
mIntVertArray[vp + 3] = dstY;
- mIntVertArray[vp + 4] = dstX + scaledWidth;
- mIntVertArray[vp + 5] = dstY + scaledHeight;
+ mIntVertArray[vp + 4] = dstX + width;
+ mIntVertArray[vp + 5] = dstY + height;
mIntVertArray[vp + 6] = dstX;
- mIntVertArray[vp + 7] = dstY + scaledHeight;
+ mIntVertArray[vp + 7] = dstY + height;
vp += 8;
if (vp >= vLimit)
@@ -562,38 +572,41 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image, int x, int y,
}
else
{
- for (int py = 0; py < h; py += ih)
+ const float scaleFactorW = (float) scaledWidth / iw;
+ const float scaleFactorH = (float) scaledHeight / ih;
+
+ for (int py = 0; py < h; py += scaledHeight)
{
- const int height = (py + ih >= h) ? h - py : ih;
+ const int height = (py + scaledHeight >= h) ? h - py : scaledHeight;
const int dstY = y + py;
- for (int px = 0; px < w; px += iw)
+ for (int px = 0; px < w; px += scaledWidth)
{
- int width = (px + iw >= w) ? w - px : iw;
+ int width = (px + scaledWidth >= w) ? w - px : scaledWidth;
int dstX = x + px;
mIntTexArray[vp + 0] = srcX;
mIntTexArray[vp + 1] = srcY;
- mIntTexArray[vp + 2] = srcX + width;
+ mIntTexArray[vp + 2] = srcX + width / scaleFactorW;
mIntTexArray[vp + 3] = srcY;
- mIntTexArray[vp + 4] = srcX + width;
- mIntTexArray[vp + 5] = srcY + height;
+ mIntTexArray[vp + 4] = srcX + width / scaleFactorW;
+ mIntTexArray[vp + 5] = srcY + height / scaleFactorH;
mIntTexArray[vp + 6] = srcX;
- mIntTexArray[vp + 7] = srcY + height;
+ mIntTexArray[vp + 7] = srcY + height / scaleFactorH;
mIntVertArray[vp + 0] = dstX;
mIntVertArray[vp + 1] = dstY;
- mIntVertArray[vp + 2] = dstX + scaledWidth;
+ mIntVertArray[vp + 2] = dstX + width;
mIntVertArray[vp + 3] = dstY;
- mIntVertArray[vp + 4] = dstX + scaledWidth;
- mIntVertArray[vp + 5] = dstY + scaledHeight;
+ mIntVertArray[vp + 4] = dstX + width;
+ mIntVertArray[vp + 5] = dstY + height;
mIntVertArray[vp + 6] = dstX;
- mIntVertArray[vp + 7] = dstY + scaledHeight;
+ mIntVertArray[vp + 7] = dstY + height;
vp += 8;
if (vp >= vLimit)
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index ee96e19c..73adbdc1 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -30,7 +30,6 @@
#define NO_SDL_GLEXT
#include <SDL_opengl.h>
-#endif
class OpenGLGraphics : public Graphics
{
@@ -129,5 +128,6 @@ class OpenGLGraphics : public Graphics
bool mColorAlpha;
bool mSync;
};
+#endif //USE_OPENGL
#endif
diff --git a/src/winver.h b/src/winver.h
index 89b7004f..7f9d3f8d 100644
--- a/src/winver.h
+++ b/src/winver.h
@@ -1,6 +1,6 @@
/* VERSION DEFINITIONS */
#define VER_MAJOR 0
#define VER_MINOR 5
-#define VER_RELEASE 2
+#define VER_RELEASE 3
#define VER_BUILD 0
-#define PACKAGE_VERSION "0.5.2.0"
+#define PACKAGE_VERSION "0.5.3.0"