Skip to content

Commit

Permalink
Also split the arrow into multiple images.
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed May 13, 2024
1 parent 4c5b8dc commit 43ab696
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Binary file added resources/radar/missile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/radar/ship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/shipTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ REGISTER_SCRIPT_CLASS(ShipTemplate)
/// Sets the default radar trace image for ShipTemplateBasedObjects created from this ShipTemplate.
/// Valid values are filenames of PNG images relative to the resources/radar/ directory.
/// Radar trace images should be white with a transparent background.
/// Defaults to arrow.png. ShipTemplate:setType("station") sets this to blip.png.
/// Defaults to ship.png. ShipTemplate:setType("station") sets this to blip.png.
/// Example: template:setRadarTrace("cruiser.png")
REGISTER_SCRIPT_CLASS_FUNCTION(ShipTemplate, setRadarTrace);
/// Sets the long-range radar range of SpaceShips created from this ShipTemplate.
Expand Down Expand Up @@ -350,7 +350,7 @@ ShipTemplate::ShipTemplate()
weapon_storage[n] = 0;
long_range_radar_range = 30000.0f;
short_range_radar_range = 5000.0f;
radar_trace = "radar/arrow.png";
radar_trace = "radar/ship.png";
impulse_sound_file = "sfx/engine.wav";
default_ai_name = "default";
}
Expand Down Expand Up @@ -415,7 +415,7 @@ void ShipTemplate::setTubeSize(int index, EMissileSizes size)

void ShipTemplate::setType(TemplateType type)
{
if (radar_trace == "radar/arrow.png" && type == Station)
if (radar_trace == "radar/ship.png" && type == Station)
{
radar_trace = "radar/blip.png";
}
Expand Down
2 changes: 1 addition & 1 deletion src/spaceObjects/missiles/missileWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void MissileWeapon::drawOnRadar(sp::RenderTarget& renderer, glm::vec2 position,
{
if (long_range) return;

renderer.drawRotatedSprite("radar/arrow.png", position, 32 * (0.25f + 0.25f * category_modifier), getRotation()-rotation, data.color);
renderer.drawRotatedSprite("radar/missile.png", position, 32 * (0.25f + 0.25f * category_modifier), getRotation()-rotation, data.color);
}

void MissileWeapon::update(float delta)
Expand Down

0 comments on commit 43ab696

Please sign in to comment.