mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 15:40:58 +00:00
- Floatify smoothratio
for DrawOverheadMap()
.
This commit is contained in:
parent
5e410ff738
commit
01d185dc6b
11 changed files with 20 additions and 20 deletions
|
@ -593,7 +593,7 @@ static void renderDrawMapView(const DVector2& cpos, const DVector2& cangvect, co
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const smoothratio)
|
void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const interpfrac)
|
||||||
{
|
{
|
||||||
if (am_followplayer || follow.X == INT_MAX)
|
if (am_followplayer || follow.X == INT_MAX)
|
||||||
{
|
{
|
||||||
|
@ -614,7 +614,7 @@ void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const s
|
||||||
|
|
||||||
drawredlines(follow, avect, xydim);
|
drawredlines(follow, avect, xydim);
|
||||||
drawwhitelines(follow, avect, xydim);
|
drawwhitelines(follow, avect, xydim);
|
||||||
if (!gi->DrawAutomapPlayer(plxy, follow, follow_a, xydim, gZoom, smoothratio))
|
if (!gi->DrawAutomapPlayer(plxy, follow, follow_a, xydim, gZoom, interpfrac))
|
||||||
DrawPlayerArrow(follow, follow_a, gZoom, pl_angle);
|
DrawPlayerArrow(follow, follow_a, gZoom, pl_angle);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ extern BitArray show2dwall;
|
||||||
void SerializeAutomap(FSerializer& arc);
|
void SerializeAutomap(FSerializer& arc);
|
||||||
void ClearAutomap();
|
void ClearAutomap();
|
||||||
void MarkSectorSeen(sectortype* sect);
|
void MarkSectorSeen(sectortype* sect);
|
||||||
void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const smoothratio);
|
void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const interpfrac);
|
||||||
bool AM_Responder(event_t* ev, bool last);
|
bool AM_Responder(event_t* ev, bool last);
|
||||||
void drawlinergb(const DVector2& v1, const DVector2& v2, PalEntry p);
|
void drawlinergb(const DVector2& v1, const DVector2& v2, PalEntry p);
|
||||||
void DrawAutomapAlignmentFacing(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col);
|
void DrawAutomapAlignmentFacing(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col);
|
||||||
|
|
|
@ -107,7 +107,7 @@ struct GameInterface
|
||||||
virtual void NextLevel(MapRecord* map, int skill) {}
|
virtual void NextLevel(MapRecord* map, int skill) {}
|
||||||
virtual void NewGame(MapRecord* map, int skill, bool special = false) {}
|
virtual void NewGame(MapRecord* map, int skill, bool special = false) {}
|
||||||
virtual void LevelCompleted(MapRecord* map, int skill) {}
|
virtual void LevelCompleted(MapRecord* map, int skill) {}
|
||||||
virtual bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio) { return false; }
|
virtual bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) { return false; }
|
||||||
virtual void SetTileProps(int tile, int surf, int vox, int shade) {}
|
virtual void SetTileProps(int tile, int surf, int vox, int shade) {}
|
||||||
virtual fixed_t playerHorizMin() { return IntToFixed(-200); }
|
virtual fixed_t playerHorizMin() { return IntToFixed(-200); }
|
||||||
virtual fixed_t playerHorizMax() { return IntToFixed(200); }
|
virtual fixed_t playerHorizMax() { return IntToFixed(200); }
|
||||||
|
|
|
@ -133,7 +133,7 @@ struct GameInterface : public ::GameInterface
|
||||||
void NewGame(MapRecord* sng, int skill, bool) override;
|
void NewGame(MapRecord* sng, int skill, bool) override;
|
||||||
void NextLevel(MapRecord* map, int skill) override;
|
void NextLevel(MapRecord* map, int skill) override;
|
||||||
void LevelCompleted(MapRecord* map, int skill) override;
|
void LevelCompleted(MapRecord* map, int skill) override;
|
||||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio) override;
|
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||||
void SetTileProps(int til, int surf, int vox, int shade) override;
|
void SetTileProps(int til, int surf, int vox, int shade) override;
|
||||||
fixed_t playerHorizMin() override { return IntToFixed(-180); }
|
fixed_t playerHorizMin() override { return IntToFixed(-180); }
|
||||||
fixed_t playerHorizMax() override { return IntToFixed(120); }
|
fixed_t playerHorizMax() override { return IntToFixed(120); }
|
||||||
|
|
|
@ -472,9 +472,9 @@ static void DrawMap(DBloodActor* view)
|
||||||
tm = 1;
|
tm = 1;
|
||||||
}
|
}
|
||||||
VIEW* pView = &gPrevView[gViewIndex];
|
VIEW* pView = &gPrevView[gViewIndex];
|
||||||
auto xy = DVector2(interpolatedvalue(pView->x, view->int_pos().X, gInterpolate * (1. / MaxSmoothRatio)), interpolatedvalue(pView->y, view->int_pos().Y, gInterpolate * (1. / MaxSmoothRatio)))* inttoworld;
|
auto xy = DVector2(interpolatedvalue(pView->x, view->int_pos().X, gInterpolate * (1. / MaxSmoothRatio)), interpolatedvalue(pView->y, view->int_pos().Y, gInterpolate * (1. / MaxSmoothRatio))) * inttoworld;
|
||||||
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio));
|
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio));
|
||||||
DrawOverheadMap(xy, ang, gInterpolate);
|
DrawOverheadMap(xy, ang, gInterpolate * (1. / MaxSmoothRatio));
|
||||||
if (tm)
|
if (tm)
|
||||||
setViewport(hud_size);
|
setViewport(hud_size);
|
||||||
}
|
}
|
||||||
|
@ -862,7 +862,7 @@ std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio)
|
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac)
|
||||||
{
|
{
|
||||||
auto cangvect = cang.ToVector();
|
auto cangvect = cang.ToVector();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct GameInterface : public ::GameInterface
|
||||||
void NextLevel(MapRecord* map, int skill) override;
|
void NextLevel(MapRecord* map, int skill) override;
|
||||||
void NewGame(MapRecord* map, int skill, bool) override;
|
void NewGame(MapRecord* map, int skill, bool) override;
|
||||||
void LevelCompleted(MapRecord* map, int skill) override;
|
void LevelCompleted(MapRecord* map, int skill) override;
|
||||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio) override;
|
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||||
int playerKeyMove() override { return 40; }
|
int playerKeyMove() override { return 40; }
|
||||||
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
|
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
|
||||||
void ToggleThirdPerson() override;
|
void ToggleThirdPerson() override;
|
||||||
|
|
|
@ -280,7 +280,7 @@ void drawoverlays(double interpfrac)
|
||||||
cposxy = pp->opos.XY();
|
cposxy = pp->opos.XY();
|
||||||
cang = pp->angle.oang;
|
cang = pp->angle.oang;
|
||||||
}
|
}
|
||||||
DrawOverheadMap(cposxy, cang, interpfrac * MaxSmoothRatio);
|
DrawOverheadMap(cposxy, cang, interpfrac);
|
||||||
RestoreInterpolations();
|
RestoreInterpolations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ ReservedSpace GameInterface::GetReservedScreenSpace(int viewsize)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio)
|
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac)
|
||||||
{
|
{
|
||||||
// Pre-caculate incoming angle vector.
|
// Pre-caculate incoming angle vector.
|
||||||
auto cangvect = cang.ToVector();
|
auto cangvect = cang.ToVector();
|
||||||
|
@ -433,7 +433,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
|
||||||
double j = clamp(czoom * act->spr.yrepeat + abs(pp.truefz - pp.pos.Z), 21.5, 128.) * REPEAT_SCALE;
|
double j = clamp(czoom * act->spr.yrepeat + abs(pp.truefz - pp.pos.Z), 21.5, 128.) * REPEAT_SCALE;
|
||||||
|
|
||||||
auto const vec = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);
|
auto const vec = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);
|
||||||
auto const daang = -((!SyncInput() ? act->spr.angle : act->interpolatedangle(smoothratio * (1. / MaxSmoothRatio))) - cang).Normalized360().Degrees();
|
auto const daang = -((!SyncInput() ? act->spr.angle : act->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees();
|
||||||
|
|
||||||
DrawTexture(twod, tileGetTexture(i), vec.X, vec.Y, DTA_TranslationIndex, TRANSLATION(Translation_Remap + setpal(&pp), act->spr.pal), DTA_CenterOffset, true,
|
DrawTexture(twod, tileGetTexture(i), vec.X, vec.Y, DTA_TranslationIndex, TRANSLATION(Translation_Remap + setpal(&pp), act->spr.pal), DTA_CenterOffset, true,
|
||||||
DTA_Rotate, daang, DTA_Color, shadeToLight(act->spr.shade), DTA_ScaleX, j, DTA_ScaleY, j, TAG_DONE);
|
DTA_Rotate, daang, DTA_Color, shadeToLight(act->spr.shade), DTA_ScaleX, j, DTA_ScaleY, j, TAG_DONE);
|
||||||
|
|
|
@ -230,7 +230,7 @@ struct GameInterface : public ::GameInterface
|
||||||
void NewGame(MapRecord *map, int skill, bool) override;
|
void NewGame(MapRecord *map, int skill, bool) override;
|
||||||
void LevelCompleted(MapRecord *map, int skill) override;
|
void LevelCompleted(MapRecord *map, int skill) override;
|
||||||
void NextLevel(MapRecord *map, int skill) override;
|
void NextLevel(MapRecord *map, int skill) override;
|
||||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio) override;
|
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||||
fixed_t playerHorizMin() override { return IntToFixed(-150); }
|
fixed_t playerHorizMin() override { return IntToFixed(-150); }
|
||||||
fixed_t playerHorizMax() override { return IntToFixed(150); }
|
fixed_t playerHorizMax() override { return IntToFixed(150); }
|
||||||
int playerKeyMove() override { return 6; }
|
int playerKeyMove() override { return 6; }
|
||||||
|
|
|
@ -50,7 +50,7 @@ void DrawMap(double const interpfrac)
|
||||||
{
|
{
|
||||||
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
|
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
|
||||||
auto ang = !SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(interpfrac);
|
auto ang = !SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(interpfrac);
|
||||||
DrawOverheadMap(pPlayerActor->interpolatedpos(interpfrac).XY(), ang, interpfrac * MaxSmoothRatio);
|
DrawOverheadMap(pPlayerActor->interpolatedpos(interpfrac).XY(), ang, interpfrac);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void GetActorExtents(DExhumedActor* actor, int* top, int* bottom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio)
|
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac)
|
||||||
{
|
{
|
||||||
auto cangvect = cang.ToVector();
|
auto cangvect = cang.ToVector();
|
||||||
|
|
||||||
|
|
|
@ -1509,7 +1509,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DrawOverheadMap(DVector2(tx, ty) * inttoworld, tang, smoothratio);
|
DrawOverheadMap(DVector2(tx, ty) * inttoworld, tang, smoothratio * (1. / MaxSmoothRatio));
|
||||||
}
|
}
|
||||||
|
|
||||||
SWSpriteIterator it;
|
SWSpriteIterator it;
|
||||||
|
@ -1571,7 +1571,7 @@ bool GameInterface::GenerateSavePic()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio)
|
bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac)
|
||||||
{
|
{
|
||||||
static int pspr_ndx[8] = { 0,0,0,0,0,0,0,0 };
|
static int pspr_ndx[8] = { 0,0,0,0,0,0,0,0 };
|
||||||
bool sprisplayer = false;
|
bool sprisplayer = false;
|
||||||
|
@ -1592,7 +1592,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
|
||||||
// 1=white / 31=black / 44=green / 56=pink / 128=yellow / 210=blue / 248=orange / 255=purple
|
// 1=white / 31=black / 44=green / 56=pink / 128=yellow / 210=blue / 248=orange / 255=purple
|
||||||
PalEntry col = (actor->spr.cstat & CSTAT_SPRITE_BLOCK) > 0 ? GPalette.BaseColors[248] : actor == Player[screenpeek].actor ? GPalette.BaseColors[31] : GPalette.BaseColors[56];
|
PalEntry col = (actor->spr.cstat & CSTAT_SPRITE_BLOCK) > 0 ? GPalette.BaseColors[248] : actor == Player[screenpeek].actor ? GPalette.BaseColors[31] : GPalette.BaseColors[56];
|
||||||
auto statnum = actor->spr.statnum;
|
auto statnum = actor->spr.statnum;
|
||||||
auto sprxy = ((statnum >= 1) && (statnum <= 8) && (statnum != 2) ? actor->interpolatedpos(smoothratio * (1. / MaxSmoothRatio)) : actor->spr.pos).XY() - cpos;
|
auto sprxy = ((statnum >= 1) && (statnum <= 8) && (statnum != 2) ? actor->interpolatedpos(interpfrac) : actor->spr.pos).XY() - cpos;
|
||||||
|
|
||||||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||||
{
|
{
|
||||||
|
@ -1634,7 +1634,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
|
||||||
|
|
||||||
if (spnum >= 0)
|
if (spnum >= 0)
|
||||||
{
|
{
|
||||||
const auto daang = -((!SyncInput() ? actor->spr.angle : actor->interpolatedangle(smoothratio * (1. / MaxSmoothRatio))) - cang).Normalized360().Degrees();
|
const auto daang = -((!SyncInput() ? actor->spr.angle : actor->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees();
|
||||||
auto vect = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);
|
auto vect = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);
|
||||||
|
|
||||||
// This yrepeat scale is correct.
|
// This yrepeat scale is correct.
|
||||||
|
|
|
@ -2037,7 +2037,7 @@ struct GameInterface : public ::GameInterface
|
||||||
void LevelCompleted(MapRecord *map, int skill) override;
|
void LevelCompleted(MapRecord *map, int skill) override;
|
||||||
void NextLevel(MapRecord *map, int skill) override;
|
void NextLevel(MapRecord *map, int skill) override;
|
||||||
void NewGame(MapRecord *map, int skill, bool) override;
|
void NewGame(MapRecord *map, int skill, bool) override;
|
||||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const smoothratio) override;
|
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||||
int playerKeyMove() override { return 35; }
|
int playerKeyMove() override { return 35; }
|
||||||
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
|
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
|
||||||
void ToggleThirdPerson() override;
|
void ToggleThirdPerson() override;
|
||||||
|
|
Loading…
Reference in a new issue