Skip to content

Fix merge conflicts from develop sync: Vector2 Scale and rendering features#15

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/update-render-changes-fix-errors
Closed

Fix merge conflicts from develop sync: Vector2 Scale and rendering features#15
Copilot wants to merge 3 commits into
masterfrom
copilot/update-render-changes-fix-errors

Conversation

Copy link
Copy Markdown

Copilot AI commented May 19, 2026

Checklist

Links to issue(s) this pull request concerns (if applicable)

N/A

Pull request description

Merge with develop introduced breaking changes to renderer string API. The original PR changed Scale from float to Vector2 but merge left inconsistent types causing C2446/C2440 errors.

Core Type Changes

  • RendererStringToDraw: Scale changed from float to Vector2; added Rotation, Priority, Blend, HasScissor, ScissorRect
  • RendererString.cpp: All scale math now uses Vector2 (stringScale.y for scalar operations, full Vector2 for DrawString)
  • DrawString calls: Updated to accept Vector2 scale and float rotation parameters

Feature Additions

  • Priority-based rendering: Strings now sorted by priority before draw
  • Per-string blend modes: Each string can specify blend mode; SpriteBatch restarted on mode change
  • Scissor rectangle support: Per-string clipping regions with state tracking
    • Added HasActiveDisplayScissor() / GetActiveDisplayScissor() to DisplaySprite
    • Applied to both RendererStringToDraw and RendererDisplaySpriteToDraw

API Changes

// New string methods
void AddString(const std::string& string, const Vector2& pos, const Vector2& prevPos, 
               const Vector2& area, const Color& color, const Vector2& scale, 
               float rotation, int flags, int priority, BlendMode blendMode);

Vector2 GetDisplayStringSize(const std::string& text, const Vector2& scale = Vector2::One) const;

// Scissor API (DisplaySprite namespace)
void SetActiveDisplayScissor(const RendererRectangle& rect);
bool HasActiveDisplayScissor();

Implementation Notes

  • DrawAllStrings() now manages blend state and scissor state per string with SpriteBatch restart on change
  • Internal AddStringInternal() handles both float and Vector2 scale overloads
  • SpriteBatch::Begin() signature updated to include rasterizer state parameter

Copilot AI and others added 3 commits May 19, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants