summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilesdl.cc
diff options
context:
space:
mode:
authorEnne Walker <ennewalker@users.sourceforge.net>2010-01-17 19:33:07 -0500
committerEnne Walker <ennewalker@users.sourceforge.net>2010-01-17 19:53:13 -0500
commit227420e531ae481224410978e01c834507cc61d2 (patch)
tree93b0bbe0f909bb20820a61e1836df1bb03736636 /crawl-ref/source/tilesdl.cc
parentf903462645b80653998fe987732752038be862d4 (diff)
downloadcrawl-ref-227420e531ae481224410978e01c834507cc61d2.tar.gz
crawl-ref-227420e531ae481224410978e01c834507cc61d2.zip
Tile transparency in water without overlays.
In order for jpeg's waves to work on deep water as well as shallow, we need to not use partially transparent overlays to simulate an actor or an item being submerged. Now, non-flying objects on water will be drawn transparently to blend with the water below. This should mostly look the same, except it will now work on top of waves and will not require a mask for each water type. As a nice side-effect, ghosts are now transparent again and the water on top of submerged objects now animates properly. See the comments in tilebuf.cc for details. The mask tile itself can be adjusted to change the water level, but the parameters to SubmergedTileBuffer will need to be changed to compensate depending on what the new art looks like.
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r--crawl-ref/source/tilesdl.cc55
1 files changed, 1 insertions, 54 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index ff6af904ab..5210eedf81 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -49,59 +49,6 @@ static int _screen_sizes[4][8] =
{800, 480, 3, 13, 12, 10, 13, 11}
};
-// Note: these defaults should match the OpenGL defaults
-GLState::GLState() :
- array_vertex(false),
- array_texcoord(false),
- array_colour(false),
- blend(false),
- texture(false)
-{
-}
-
-void GLStateManager::init()
-{
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glClearColor(0.0, 0.0, 0.0, 1.0f);
-}
-
-void GLStateManager::set(const GLState& state)
-{
- if (state.array_vertex)
- glEnableClientState(GL_VERTEX_ARRAY);
- else
- glDisableClientState(GL_VERTEX_ARRAY);
-
- if (state.array_texcoord)
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- else
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
- if (state.array_colour)
- {
- glEnableClientState(GL_COLOR_ARRAY);
- }
- else
- {
- glDisableClientState(GL_COLOR_ARRAY);
-
- // [enne] This should *not* be necessary, but the Linux OpenGL
- // driver that I'm using sets this to the last colour of the
- // colour array. So, we need to unset it here.
- glColor3f(1.0f, 1.0f, 1.0f);
- }
-
- if (state.texture)
- glEnable(GL_TEXTURE_2D);
- else
- glDisable(GL_TEXTURE_2D);
-
- if (state.blend)
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
-}
-
TilesFramework tiles;
TilesFramework::TilesFramework() :
@@ -486,7 +433,7 @@ void TilesFramework::resize()
glLoadIdentity();
// For ease, vertex positions are pixel positions.
- glOrtho(0, m_windowsz.x, m_windowsz.y, 0, 0, 100);
+ glOrtho(0, m_windowsz.x, m_windowsz.y, 0, -1000, 1000);
}
static unsigned char _get_modifiers(SDL_keysym &keysym)