diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index bcb26d586..3af212185 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -245,8 +245,6 @@ void reset_highlight(void); void ovh_whiteoutgrab(int32_t restoreredwalls); int32_t inside_editor_curpos(int16_t sectnum); -int32_t inside_editor(const vec3_t *pos, int32_t searchx, int32_t searchy, int32_t zoom, - int32_t x, int32_t y, int16_t sectnum); void correct_sprite_yoffset(int32_t i); void inflineintersect(int32_t x1, int32_t y1, int32_t x2, int32_t y2, diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 83ba6bfef..4dc4f3624 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -1413,14 +1413,9 @@ static struct overheadstate int16_t splitstartwall; } ovh; -int32_t inside_editor_curpos(int16_t sectnum) -{ - // TODO: take care: mous[xy]plc global vs overheadeditor auto - return inside_editor(&pos, searchx,searchy, zoom, mousxplc,mousyplc, sectnum); -} -int32_t inside_editor(const vec3_t *pos, int32_t searchx, int32_t searchy, int32_t zoom, - int32_t x, int32_t y, int16_t sectnum) +static int32_t inside_editor(const vec3_t *pos, int32_t searchx, int32_t searchy, int32_t zoom, + int32_t x, int32_t y, int16_t sectnum) { if (!m32_sideview) return inside(x, y, sectnum); @@ -1456,6 +1451,13 @@ int32_t inside_editor(const vec3_t *pos, int32_t searchx, int32_t searchy, int32 } } +int32_t inside_editor_curpos(int16_t sectnum) +{ + // TODO: take care: mous[xy]plc global vs overheadeditor auto + return inside_editor(&pos, searchx,searchy, zoom, mousxplc,mousyplc, sectnum); +} + + static inline void drawline16base(int32_t bx, int32_t by, int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col) { drawline16(bx+x1, by+y1, bx+x2, by+y2, col); @@ -2015,15 +2017,17 @@ static void correct_ornamented_sprite(int32_t i, int32_t hitw) int32_t j; if (hitw >= 0) + { sprite[i].ang = (getangle(POINT2(hitw).x-wall[hitw].x, POINT2(hitw).y-wall[hitw].y)+512)&2047; - //Make sure sprite's in right sector - if (inside(sprite[i].x, sprite[i].y, sprite[i].sectnum) == 0) - { - j = wall[hitw].point2; - sprite[i].x -= ksgn(wall[j].y-wall[hitw].y); - sprite[i].y += ksgn(wall[j].x-wall[hitw].x); + //Make sure sprite's in right sector + if (inside(sprite[i].x, sprite[i].y, sprite[i].sectnum) != 1) + { + j = wall[hitw].point2; + sprite[i].x -= ksgn(wall[j].y-wall[hitw].y); + sprite[i].y += ksgn(wall[j].x-wall[hitw].x); + } } } @@ -6514,7 +6518,7 @@ end_join_sectors: // will add an inner loop for (j=numwalls+1; jsect = sec-sector; hit->wall = -1; hit->sprite = -1; hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1; @@ -11408,7 +11408,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat if (!thislastsec) { - if (inside(x1,y1,sec-sector) != 0) + if (inside(x1,y1,sec-sector) == 1) { hit->sect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1; @@ -11419,7 +11419,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat { for (i=clipinfo[curidx].qbeg; isect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1;