diff --git a/game/engine/Map.lua b/game/engine/Map.lua index 502d2ce5c3de1bf43dd7dd248a7d9f7274d4ffdb..5be7363fce35ccf517b716f93c30f2b03da8e7a2 100644 --- a/game/engine/Map.lua +++ b/game/engine/Map.lua @@ -457,12 +457,12 @@ end --- Sets a grid as seen and remembered -- Used by FOV code -function _M:apply(x, y) +function _M:apply(x, y, v) if x < 0 or x >= self.w or y < 0 or y >= self.h then return end if self.lites[x + y * self.w] then - self.seens[x + y * self.w] = true + self.seens[x + y * self.w] = v or 1 self.has_seens[x + y * self.w] = true - self._map:setSeen(x, y, true) + self._map:setSeen(x, y, v or 1) self.remembers[x + y * self.w] = true self._map:setRemember(x, y, true) end @@ -470,26 +470,26 @@ end --- Sets a grid as seen, lited and remembered -- Used by FOV code -function _M:applyLite(x, y) +function _M:applyLite(x, y, v) if x < 0 or x >= self.w or y < 0 or y >= self.h then return end if self.lites[x + y * self.w] or self:checkEntity(x, y, TERRAIN, "always_remember") then self.remembers[x + y * self.w] = true self._map:setRemember(x, y, true) end - self.seens[x + y * self.w] = true + self.seens[x + y * self.w] = v or 1 self.has_seens[x + y * self.w] = true - self._map:setSeen(x, y, true) + self._map:setSeen(x, y, v or 1) end --- Sets a grid as seen if ESP'ed -- Used by FOV code -function _M:applyESP(x, y) +function _M:applyESP(x, y, v) if not self.actor_player then return end if x < 0 or x >= self.w or y < 0 or y >= self.h then return end local a = self(x, y, ACTOR) if a and self.actor_player:canSee(a, false, 0) then - self.seens[x + y * self.w] = true - self._map:setSeen(x, y, true) + self.seens[x + y * self.w] = v or 1 + self._map:setSeen(x, y, v or 1) end end diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 7b4446bab8df36aef608200af34a036e6e08996e..a46ff133c597f28c09bea36c489376d3312f59f5 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -150,10 +150,14 @@ function _M:playerFOV() if not game.zone.wilderness then self:computeFOV(self.esp.range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y) end, true, true) end -- Compute both the normal and the lite FOV, using cache if game.zone.wilderness_see_radius then - self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:apply(x, y) end, true, false, true) + self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) + game.level.map:apply(x, y, math.max((20 - math.sqrt(sqdist)) / 14, 0.6)) + end, true, false, true) self:computeFOV(game.zone.wilderness_see_radius, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y) end, true, true, true) else - self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:apply(x, y) end, true, false, true) + self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) + game.level.map:apply(x, y, math.max((20 - math.sqrt(sqdist)) / 14, 0.6)) + end, true, false, true) self:computeFOV(self.lite, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y) end, true, true, true) end diff --git a/game/modules/tome/data/birth/classes/archer.lua b/game/modules/tome/data/birth/classes/archer.lua index b2b4045ca130e0a0ceb8b721737abefc6b0316f5..4d5e613fb096b434101f09a207adfb79e2e87d58 100644 --- a/game/modules/tome/data/birth/classes/archer.lua +++ b/game/modules/tome/data/birth/classes/archer.lua @@ -98,7 +98,7 @@ newBirthDescriptor{ }, copy = { equipment = resolvers.equip{ id=true, - {type="weapon", subtype="sling", name="elm sling", autoreq=true}, + {type="weapon", subtype="sling", name="rough leather sling", autoreq=true}, {type="ammo", subtype="shot", name="iron shot", autoreq=true}, }, }, diff --git a/game/modules/tome/data/general/objects/slings.lua b/game/modules/tome/data/general/objects/slings.lua index 9fca9a50bb6fd2ff8330a7d20d26fec4f799a3c1..c01ae835e6f3054feaa6cbb5e4903a8dfe0d6f40 100644 --- a/game/modules/tome/data/general/objects/slings.lua +++ b/game/modules/tome/data/general/objects/slings.lua @@ -30,7 +30,7 @@ newEntity{ } newEntity{ base = "BASE_SLING", - name = "elm sling", + name = "rough leather sling", level_range = {1, 10}, require = { stat = { dex=11 }, }, cost = 5, @@ -40,7 +40,7 @@ newEntity{ base = "BASE_SLING", } newEntity{ base = "BASE_SLING", - name = "ash sling", + name = "cured leather sling", level_range = {10, 20}, require = { stat = { dex=16 }, }, cost = 10, @@ -50,7 +50,7 @@ newEntity{ base = "BASE_SLING", } newEntity{ base = "BASE_SLING", - name = "yew sling", + name = "hardened leather sling", level_range = {20, 30}, require = { stat = { dex=24 }, }, cost = 15, @@ -60,7 +60,7 @@ newEntity{ base = "BASE_SLING", } newEntity{ base = "BASE_SLING", - name = "elven-wood sling", + name = "reinforced leather sling", level_range = {30, 40}, require = { stat = { dex=35 }, }, cost = 25, @@ -70,7 +70,7 @@ newEntity{ base = "BASE_SLING", } newEntity{ base = "BASE_SLING", - name = "dragonbone sling", + name = "drakeskin leather sling", level_range = {40, 50}, require = { stat = { dex=48 }, }, cost = 35, diff --git a/src/map.c b/src/map.c index 5db22ca8a9c27a8c0a86572ceb463da63293fd7f..e760deede3947a60affb0b2124afaf3be7e5a233 100644 --- a/src/map.c +++ b/src/map.c @@ -74,7 +74,7 @@ static int map_new(lua_State *L) map->grids_actor = calloc(w, sizeof(map_texture*)); map->grids_trap = calloc(w, sizeof(map_texture*)); map->grids_object = calloc(w, sizeof(map_texture*)); - map->grids_seens = calloc(w, sizeof(bool*)); + map->grids_seens = calloc(w, sizeof(float*)); map->grids_remembers = calloc(w, sizeof(bool*)); map->grids_lites = calloc(w, sizeof(bool*)); map->minimap = calloc(w, sizeof(unsigned char*)); @@ -87,7 +87,7 @@ static int map_new(lua_State *L) map->grids_actor[i] = calloc(h, sizeof(map_texture)); map->grids_object[i] = calloc(h, sizeof(map_texture)); map->grids_trap[i] = calloc(h, sizeof(map_texture)); - map->grids_seens[i] = calloc(h, sizeof(bool)); + map->grids_seens[i] = calloc(h, sizeof(float)); map->grids_remembers[i] = calloc(h, sizeof(bool)); map->grids_lites[i] = calloc(h, sizeof(bool)); map->minimap[i] = calloc(h, sizeof(unsigned char)); @@ -224,7 +224,7 @@ static int map_set_grid(lua_State *L) float a_g = lua_tonumber(L, 18); float a_b = lua_tonumber(L, 19); - unsigned char mm = lua_tonumber(L, 8); + unsigned char mm = lua_tonumber(L, 20); if (x < 0 || y < 0 || x >= map->w || y >= map->h) return 0; @@ -257,7 +257,7 @@ static int map_set_seen(lua_State *L) map_type *map = (map_type*)auxiliar_checkclass(L, "core{map}", 1); int x = luaL_checknumber(L, 2); int y = luaL_checknumber(L, 3); - bool v = lua_toboolean(L, 4); + float v = lua_tonumber(L, 4); if (x < 0 || y < 0 || x >= map->w || y >= map->h) return 0; map->grids_seens[x][y] = v; @@ -295,7 +295,7 @@ static int map_clean_seen(lua_State *L) for (i = 0; i < map->w; i++) for (j = 0; j < map->h; j++) - map->grids_seens[i][j] = FALSE; + map->grids_seens[i][j] = 0; return 0; } @@ -353,15 +353,16 @@ static int map_to_screen(lua_State *L) { if (map->grids_seens[i][j]) { + a = map->shown_a * map->grids_seens[i][j]; if (map->multidisplay) { if (map->grids_terrain[i][j].texture) { map_texture *m = &(map->grids_terrain[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_terrain[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -374,9 +375,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_trap[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_trap[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -389,9 +390,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_object[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_object[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -404,9 +405,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_actor[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_actor[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -422,9 +423,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_actor[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_actor[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -437,9 +438,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_object[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_object[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -452,9 +453,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_trap[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_trap[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -467,9 +468,9 @@ static int map_to_screen(lua_State *L) { map_texture *m = &(map->grids_terrain[i][j]); if (m->tint_r < 1 || m->tint_g < 1 || m->tint_b < 1) - glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, map->shown_a); + glColor4f((map->shown_r + m->tint_r)/2, (map->shown_g + m->tint_g)/2, (map->shown_b + m->tint_b)/2, a); else - glColor4f(map->shown_r, map->shown_g, map->shown_b, map->shown_a); + glColor4f(map->shown_r, map->shown_g, map->shown_b, a); glBindTexture(GL_TEXTURE_2D, map->grids_terrain[i][j].texture); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); @@ -519,7 +520,6 @@ static int minimap_to_screen(lua_State *L) float transp = luaL_checknumber(L, 8); int i = 0, j = 0; - glColor4f(1, 1, 1, 0.5f); for (i = mdx; i < mdx + mdw; i++) { for (j = mdy; j < mdy + mdh; j++) @@ -538,80 +538,80 @@ static int minimap_to_screen(lua_State *L) { glBindTexture(GL_TEXTURE_2D, map->mm_level_change); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_HOSTILE) && map->mm_hostile) { glBindTexture(GL_TEXTURE_2D, map->mm_hostile); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_NEUTRAL) && map->mm_neutral) { glBindTexture(GL_TEXTURE_2D, map->mm_neutral); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_FRIEND) && map->mm_friend) { glBindTexture(GL_TEXTURE_2D, map->mm_friend); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_TRAP) && map->mm_trap) { glBindTexture(GL_TEXTURE_2D, map->mm_trap); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_OBJECT) && map->mm_object) { glBindTexture(GL_TEXTURE_2D, map->mm_object); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_BLOCK) && map->mm_block) { glBindTexture(GL_TEXTURE_2D, map->mm_block); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_FLOOR) && map->mm_floor) { glBindTexture(GL_TEXTURE_2D, map->mm_floor); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } } @@ -622,30 +622,30 @@ static int minimap_to_screen(lua_State *L) { glBindTexture(GL_TEXTURE_2D, map->mm_level_change); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_BLOCK) && map->mm_block) { glBindTexture(GL_TEXTURE_2D, map->mm_block); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } else if ((map->minimap[i][j] & MM_FLOOR) && map->mm_floor) { glBindTexture(GL_TEXTURE_2D, map->mm_floor); glBegin(GL_QUADS); - glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-99); - glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-99); - glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-99); - glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-99); + glTexCoord2f(0,0); glVertex3f(0 +dx, 0 +dy,-96); + glTexCoord2f(1,0); glVertex3f(map->minimap_gridsize +dx, 0 +dy,-96); + glTexCoord2f(1,1); glVertex3f(map->minimap_gridsize +dx, map->minimap_gridsize +dy,-96); + glTexCoord2f(0,1); glVertex3f(0 +dx, map->minimap_gridsize +dy,-96); glEnd(); } } diff --git a/src/map.h b/src/map.h index 1eb3fb4f5824ce11e06cf00f5edc986cb6fbaace..78d5e952ba89377b33d0fbf43fdab62d14a329f5 100644 --- a/src/map.h +++ b/src/map.h @@ -35,7 +35,7 @@ typedef struct { map_texture **grids_actor; map_texture **grids_object; map_texture **grids_trap; - bool **grids_seens; + float **grids_seens; bool **grids_remembers; bool **grids_lites; unsigned char **minimap;