Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comments #1282

Merged
merged 8 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions NAS2D/Renderer/Fade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ Fade::Fade(Color fadeColor, DelegateType onFadeComplete) :
}


// Fade in from fadeColor
void Fade::fadeIn(Duration fadeTime)
{
setDuration(fadeTime);
mDirection = FadeDirection::In;
}


// Fade out to fadeColor
void Fade::fadeOut(Duration fadeTime)
{
setDuration(fadeTime);
Expand Down
3 changes: 0 additions & 3 deletions NAS2D/Renderer/RendererOpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,6 @@ void RendererOpenGL::initVideo(Vector<int> resolution, bool fullscreen, bool vsy
Utility<EventHandler>::get().windowResized().connect({this, &RendererOpenGL::onResize});
}

// ==================================================================================
// = NON PUBLIC IMPLEMENTATION
// ==================================================================================

namespace
{
Expand Down
2 changes: 0 additions & 2 deletions NAS2D/Resource/AnimationSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,12 @@ namespace
throw std::runtime_error("Sprite file has malformed XML: Row: " + std::to_string(xmlDoc.errorRow()) + " Column: " + std::to_string(xmlDoc.errorCol()) + " : " + xmlDoc.errorDesc());
}

// Find the Sprite node.
const auto* xmlRootElement = xmlDoc.firstChildElement("sprite");
if (!xmlRootElement)
{
throw std::runtime_error("Sprite file does not contain required <sprite> tag");
}

// Get the Sprite version.
const auto version = xmlRootElement->attribute("version");
if (version.empty())
{
Expand Down
2 changes: 1 addition & 1 deletion NAS2D/Resource/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace
}
case 4:
return *reinterpret_cast<const uint32_t*>(pixelAddress);
default: // Should never be possible.
default:
throw std::runtime_error("Unknown pixel format with bytesPerPixel: " + std::to_string(bytesPerPixel));
}
}
Expand Down
1 change: 0 additions & 1 deletion NAS2D/StateManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace NAS2D
class StateManager
{
public:
// Constructor & destructor
StateManager();
~StateManager();

Expand Down
7 changes: 3 additions & 4 deletions NAS2D/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ namespace NAS2D
*
* \code{.cpp}
* // Keep a reference to use multiple times in a code block.
* Renderer& r Utility<Renderer>::get();
* Renderer& renderer = Utility<Renderer>::get();
*
* r.drawBox(0, 0, 10, 10, 255, 255, 255, 255);
* r.drawLine( 10, 10, 400, 200, 255, 0, 0, 255, 4);
* renderer.drawBox(0, 0, 10, 10, 255, 255, 255, 255);
* renderer.drawLine( 10, 10, 400, 200, 255, 0, 0, 255, 4);
* // and so on
* \endcode
*
Expand Down Expand Up @@ -132,7 +132,6 @@ namespace NAS2D
template <typename Type = T, typename... Args>
static Type& init(Args&&... args)
{
// Instantiate a new object with forwarded constructor arguments
auto newInstance = std::make_unique<Type>(std::forward<Args>(args)...);
// The new instance may be a sub-type of T, so return as sub-type
auto typedNewInstance = newInstance.release();
Expand Down