From e6e7dbc637e3a9bb76f33e3e860399b564135117 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 20 Sep 2024 17:50:42 +0300
Subject: [PATCH 42/42] sdl2: Rename getpixel() as get_pixel()

See RM #890

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-sdl2/graphics.c     |  4 ++--
 client/gui-sdl2/graphics.h     |  2 +-
 client/gui-sdl2/gui_mouse.c    |  2 +-
 client/gui-sdl2/widget_label.c | 12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/client/gui-sdl2/graphics.c b/client/gui-sdl2/graphics.c
index aa1f35a254..ca849198fa 100644
--- a/client/gui-sdl2/graphics.c
+++ b/client/gui-sdl2/graphics.c
@@ -427,7 +427,7 @@ int blit_entire_src(SDL_Surface *psrc, SDL_Surface *pdest,
   Return the pixel value at (x, y)
   NOTE: The surface must be locked before calling this!
 **************************************************************************/
-Uint32 getpixel(SDL_Surface *surf, Sint16 x, Sint16 y)
+Uint32 get_pixel(SDL_Surface *surf, Sint16 x, Sint16 y)
 {
   if (!surf) {
     return 0x0;
@@ -456,7 +456,7 @@ Uint32 getpixel(SDL_Surface *surf, Sint16 x, Sint16 y)
     return *((Uint32 *)surf->pixels + y * surf->pitch / sizeof(Uint32) + x);
 
   default:
-    return 0; /* shouldn't happen, but avoids warnings */
+    return 0; /* Shouldn't happen, but avoids warnings */
   }
 }
 
diff --git a/client/gui-sdl2/graphics.h b/client/gui-sdl2/graphics.h
index 1e6cdf4b93..19c01f857d 100644
--- a/client/gui-sdl2/graphics.h
+++ b/client/gui-sdl2/graphics.h
@@ -269,7 +269,7 @@ SDL_Surface *copy_surface(SDL_Surface *src);
 int blit_entire_src(SDL_Surface *psrc,
                     SDL_Surface *pdest, Sint16 dest_x, Sint16 dest_y);
 
-Uint32 getpixel(SDL_Surface *surf, Sint16 x, Sint16 y);
+Uint32 get_pixel(SDL_Surface *surf, Sint16 x, Sint16 y);
 Uint32 get_first_pixel(SDL_Surface *surf);
 
 void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top,
diff --git a/client/gui-sdl2/gui_mouse.c b/client/gui-sdl2/gui_mouse.c
index 5c879666d5..b6647e2eda 100644
--- a/client/gui-sdl2/gui_mouse.c
+++ b/client/gui-sdl2/gui_mouse.c
@@ -73,7 +73,7 @@ static SDL_Cursor *SurfaceToCursor(SDL_Surface *image, int hx, int hy)
     d = data + y * w;
     m = mask + y * w;
     for (x = 0; x < image->w; x++) {
-      color = getpixel(image, x, y);
+      color = get_pixel(image, x, y);
       SDL_GetRGBA(color, image->format, &r, &g, &b, &a);
       if (a != 0) {
         color = (r + g + b) / 3;
diff --git a/client/gui-sdl2/widget_label.c b/client/gui-sdl2/widget_label.c
index d8e8e13876..78aafa9980 100644
--- a/client/gui-sdl2/widget_label.c
+++ b/client/gui-sdl2/widget_label.c
@@ -279,17 +279,17 @@ struct widget *create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest,
   area = label->size;
   label->dst = gui_layer_new(0, 0, ptheme);
 
-  /* normal */
+  /* Normal */
   redraw_iconlabel(label);
 
-  /* selected */
+  /* Selected */
   area.x = 0;
   area.y = label->size.h;
 
   if (flags & WF_RESTORE_BACKGROUND) {
     SDL_FillRect(ptheme, &area, map_rgba(ptheme->format, bg_color));
     store = pstr->bgcol;
-    SDL_GetRGBA(getpixel(ptheme, area.x , area.y), ptheme->format,
+    SDL_GetRGBA(get_pixel(ptheme, area.x , area.y), ptheme->format,
                 &pstr->bgcol.r, &pstr->bgcol.g,
                 &pstr->bgcol.b, &pstr->bgcol.a);
   } else {
@@ -342,17 +342,17 @@ struct widget *convert_iconlabel_to_themeiconlabel2(struct widget *icon_label)
   pdest = icon_label->dst->surface;
   icon_label->dst->surface = ptheme;
 
-  /* normal */
+  /* Normal */
   redraw_iconlabel(icon_label);
 
-  /* selected */
+  /* Selected */
   area.x = 0;
   area.y = icon_label->size.h;
 
   if (flags & WF_RESTORE_BACKGROUND) {
     SDL_FillRect(ptheme, &area, map_rgba(ptheme->format, bg_color));
     store = icon_label->string_utf8->bgcol;
-    SDL_GetRGBA(getpixel(ptheme, area.x , area.y), ptheme->format,
+    SDL_GetRGBA(get_pixel(ptheme, area.x , area.y), ptheme->format,
                 &icon_label->string_utf8->bgcol.r,
                 &icon_label->string_utf8->bgcol.g,
                 &icon_label->string_utf8->bgcol.b,
-- 
2.45.2

