From: Daniel Karbach Date: Wed, 23 Jan 2013 00:11:25 +0000 (-0600) Subject: consistent naming of graphics drawing functions X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=f6548c2aabfb371bd81382d7800e6e2cdb826e06;p=l2e.git consistent naming of graphics drawing functions --- diff --git a/src/graphics/Frame.cpp b/src/graphics/Frame.cpp index f9d8825..4ba8f4a 100644 --- a/src/graphics/Frame.cpp +++ b/src/graphics/Frame.cpp @@ -35,7 +35,7 @@ void Frame::Draw(SDL_Surface *dest, const Vector &position, int width, int // top border Texture(surface, Vector(RepeatWidth(), BorderHeight()), Vector(offset.X() + BorderWidth(), offset.Y())) - .Render(dest, Vector(position.X() + BorderWidth(), position.Y()), Vector(position.X() + width - BorderWidth(), position.Y() + BorderHeight())); + .Draw(dest, Vector(position.X() + BorderWidth(), position.Y()), Vector(position.X() + width - BorderWidth(), position.Y() + BorderHeight())); // top-right corner srcRect.x = offset.X() + RepeatWidth() + BorderWidth(); @@ -45,15 +45,15 @@ void Frame::Draw(SDL_Surface *dest, const Vector &position, int width, int // left border Texture(surface, Vector(BorderWidth(), RepeatHeight()), Vector(offset.X(), offset.Y() + BorderHeight())) - .Render(dest, Vector(position.X(), position.Y() + BorderHeight()), Vector(position.X() + BorderWidth(), position.Y() + height - BorderHeight())); + .Draw(dest, Vector(position.X(), position.Y() + BorderHeight()), Vector(position.X() + BorderWidth(), position.Y() + height - BorderHeight())); // center fill Texture(surface, RepeatSize(), Vector(offset.X() + BorderWidth(), offset.Y() + BorderHeight())) - .Render(dest, position + BorderSize(), position + Vector(width, height) - BorderSize()); + .Draw(dest, position + BorderSize(), position + Vector(width, height) - BorderSize()); // right border Texture(surface, Vector(BorderWidth(), RepeatHeight()), Vector(offset.X() + BorderWidth() + RepeatWidth(), offset.Y() + BorderHeight())) - .Render(dest, Vector(position.X() + width - BorderWidth(), position.Y() + BorderHeight()), Vector(position.X() + width, position.Y() + height - BorderHeight())); + .Draw(dest, Vector(position.X() + width - BorderWidth(), position.Y() + BorderHeight()), Vector(position.X() + width, position.Y() + height - BorderHeight())); // bottom-left corner srcRect.x = offset.X(); @@ -66,7 +66,7 @@ void Frame::Draw(SDL_Surface *dest, const Vector &position, int width, int // bottom border Texture(surface, Vector(RepeatWidth(), BorderHeight()), Vector(offset.X() + BorderWidth(), offset.Y() + BorderHeight() + RepeatHeight())) - .Render(dest, Vector(position.X() + BorderWidth(), position.Y() + height - BorderHeight()), Vector(position.X() + width - BorderWidth(), position.Y() + height)); + .Draw(dest, Vector(position.X() + BorderWidth(), position.Y() + height - BorderHeight()), Vector(position.X() + width - BorderWidth(), position.Y() + height)); // bottom-right corner srcRect.x = offset.X() + BorderWidth() + RepeatWidth(); diff --git a/src/graphics/Texture.cpp b/src/graphics/Texture.cpp index 97094bc..9c49db4 100644 --- a/src/graphics/Texture.cpp +++ b/src/graphics/Texture.cpp @@ -26,7 +26,7 @@ Texture::~Texture() { } -void Texture::Render(SDL_Surface *dest, const Vector &from, const Vector &to) const { +void Texture::Draw(SDL_Surface *dest, const Vector &from, const Vector &to) const { SDL_Rect destRect; destRect.x = from.X(); destRect.y = from.Y(); diff --git a/src/graphics/Texture.h b/src/graphics/Texture.h index b3b9208..283be3e 100644 --- a/src/graphics/Texture.h +++ b/src/graphics/Texture.h @@ -19,7 +19,7 @@ public: static const int TYPE_ID = 410; public: - void Render(SDL_Surface *dest, const math::Vector &from, const math::Vector &to) const; + void Draw(SDL_Surface *dest, const math::Vector &from, const math::Vector &to) const; public: void SetSurface(SDL_Surface *s) { surface = s; } diff --git a/src/menu/CapsuleChangeMenu.cpp b/src/menu/CapsuleChangeMenu.cpp index 3897cb6..47c7b2e 100644 --- a/src/menu/CapsuleChangeMenu.cpp +++ b/src/menu/CapsuleChangeMenu.cpp @@ -153,7 +153,7 @@ void CapsuleChangeMenu::RenderClasses(SDL_Surface *screen, const Vector &of Vector target( cursor.X() + parent->Res().capsuleSelectTopLeft->Width(), cursor.Y() + numClasses * parent->Res().capsuleSelectLadder->Height()); - parent->Res().capsuleSelectLeftRepeat->Render(screen, cursor, target); + parent->Res().capsuleSelectLeftRepeat->Draw(screen, cursor, target); cursor.Y() = target.Y(); parent->Res().capsuleSelectBottomLeft->Draw(screen, cursor); cursor.X() += parent->Res().capsuleSelectTopLeft->Width(); @@ -185,7 +185,7 @@ void CapsuleChangeMenu::RenderClasses(SDL_Surface *screen, const Vector &of target = Vector( cursor.X() + parent->Res().capsuleSelectTopRight->Width(), cursor.Y() + numClasses * parent->Res().capsuleSelectLadder->Height()); - parent->Res().capsuleSelectRightRepeat->Render(screen, cursor, target); + parent->Res().capsuleSelectRightRepeat->Draw(screen, cursor, target); cursor.Y() = target.Y(); parent->Res().capsuleSelectBottomRight->Draw(screen, cursor); } diff --git a/src/menu/CapsuleMenu.cpp b/src/menu/CapsuleMenu.cpp index b45a204..e2a983e 100644 --- a/src/menu/CapsuleMenu.cpp +++ b/src/menu/CapsuleMenu.cpp @@ -117,7 +117,7 @@ void CapsuleMenu::Render(SDL_Surface *screen) { } void CapsuleMenu::RenderBackground(SDL_Surface *screen) const { - Res().capsulebg->Render(screen, Vector(), Vector(screen->w, screen->h)); + Res().capsulebg->Draw(screen, Vector(), Vector(screen->w, screen->h)); } void CapsuleMenu::RenderCapsule(SDL_Surface *screen, const Vector &offset) const { diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 4a347c5..8e627ee 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -153,7 +153,7 @@ int PartyMenu::Height() const { } void PartyMenu::RenderBackground(SDL_Surface *screen) const { - Res().menubg->Render(screen, Vector(), Vector(screen->w, screen->h)); + Res().menubg->Draw(screen, Vector(), Vector(screen->w, screen->h)); } void PartyMenu::RenderHeros(SDL_Surface *screen, const Vector &offset) const {