Skip to content
Snippets Groups Projects
Commit aae1dba9 authored by dg's avatar dg
Browse files

tad better

git-svn-id: http://svn.net-core.org/repos/t-engine4@2719 51575b47-30f0-44d4-a5cc-537603b46e54
parent 90a7a2d9
No related branches found
No related tags found
No related merge requests found
......@@ -739,7 +739,7 @@ function _M:display(nb_keyframes)
if self.fbo and self.mapfbo then
self.mapfbo:use(true)
if self.level.data.background then self.level.data.background(self.level, 0, 0, nb_keyframes) end
map:display(0, 0, nb_keyframes, true) -- Display at the base of the FBO and make sure to display everything as the shader will do smooth FOV over it
map:display(Map.tile_w, Map.tile_h, nb_keyframes, true) -- Display at the base of the FBO and make sure to display everything as the shader will do smooth FOV over it
map._map:updateSeensTexture()
if self.level.data.foreground then self.level.data.foreground(self.level, 0, 0, nb_keyframes) end
if self.level.data.weather_particle then self.state:displayWeather(self.level, self.level.data.weather_particle, nb_keyframes) end
......
......@@ -12,7 +12,10 @@ void main(void)
* seenscoords is arranged as this: (tile_w, tile_h, view_scene_w, view_scene_h)
* We offset by 1x1.25 tiles .. dont ask why, it just works :/
*/
vec2 seenscoord = vec2((((gl_TexCoord[0].x + seensinfo.r / texSize.x) / seensinfo.r)) * texSize.x / seensinfo.b, (((gl_TexCoord[0].y + (seensinfo.g * -1.5) / texSize.y) / seensinfo.g)) * texSize.y / seensinfo.a);
float v = -0.75;
if (seensinfo.g == 32.0) v = -0.50;
if (seensinfo.g == 16.0) v = -0.15;
vec2 seenscoord = vec2((((gl_TexCoord[0].x) / seensinfo.r)) * texSize.x / seensinfo.b, (((gl_TexCoord[0].y + (seensinfo.g * v) / texSize.y) / seensinfo.g)) * texSize.y / seensinfo.a);
vec4 seen = texture2D(seens, seenscoord);
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy);
gl_FragColor.r *= seen.r;
......
......@@ -1057,7 +1057,7 @@ static int map_to_screen(lua_State *L)
// If we use shaders for FOV display it means we must uses fbos for smooth scroll too
if (!always_show)
{
SMOOTH_SCROLL();
SMOOTH_SCROLL();
x -= animdx;
y -= animdy;
}
......
......@@ -82,6 +82,7 @@ typedef struct {
float oldmx, oldmy;
int move_step, move_max;
float used_mx, used_my;
float used_animdx, used_animdy;
int seensinfo_w;
int seensinfo_h;
} map_type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment