Hi,

The previous diff overwrote existing patches, here's revised diff.

timo

Index: patches/patch-font_cpp
===================================================================
RCS file: patches/patch-font_cpp
diff -N patches/patch-font_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-font_cpp      11 Apr 2018 05:03:23 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Index: font.cpp
+--- font.cpp.orig
++++ font.cpp
+@@ -67,15 +67,15 @@ void Font::draw(SDL_Surface *s, int x, int y, int r, i
+     if (shadow) {
+         SDL_Color color = { 1, 1, 1, 1 };
+         SDL_Surface *surface = TTF_RenderUNICODE_Blended(font, str, color);
+-        SDL_Rect src = { 0, 0, surface->w, surface->h };
+-        SDL_Rect dst = { x+1, y+1, surface->w, surface->h };
++        SDL_Rect src = { 0, 0, static_cast<Uint16>(surface->w), 
static_cast<Uint16>(surface->h) };
++        SDL_Rect dst = { static_cast<Sint16>(x+1), static_cast<Sint16>(y+1), 
static_cast<Uint16>(surface->w), static_cast<Uint16>(surface->h) };
+         SDL_BlitSurface(surface, &src, s, &dst);
+         SDL_FreeSurface(surface);
+     }
+-    SDL_Color color = { r, g, b, 0 };
++    SDL_Color color = { static_cast<Uint8>(r), static_cast<Uint8>(g), 
static_cast<Uint8>(b), 0 };
+     SDL_Surface *surface = TTF_RenderUNICODE_Blended(font, str, color);
+-    SDL_Rect src = { 0, 0, surface->w, surface->h };
+-    SDL_Rect dst = { x, y, surface->w, surface->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(surface->w), 
static_cast<Uint16>(surface->h) };
++    SDL_Rect dst = { static_cast<Sint16>(x), static_cast<Sint16>(y), 
static_cast<Uint16>(surface->w), static_cast<Uint16>(surface->h) };
+     SDL_BlitSurface(surface, &src, s, &dst);
+     SDL_FreeSurface(surface);
+ }
Index: patches/patch-game_cpp
===================================================================
RCS file: patches/patch-game_cpp
diff -N patches/patch-game_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-game_cpp      11 Apr 2018 05:03:23 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Index: game.cpp
+--- game.cpp.orig
++++ game.cpp
+@@ -139,7 +139,12 @@ void Watch::draw()
+     int y = 24;
+     int w, h;
+     font->getSize(s, w, h);
+-    SDL_Rect rect = { x-2, y-2, w+4, h+4 };
++    SDL_Rect rect = {
++        static_cast<Sint16>(x-2),
++        static_cast<Sint16>(y-2),
++        static_cast<Uint16>(w+4),
++        static_cast<Uint16>(h+4)
++    };
+     SDL_FillRect(screen.getSurface(), &rect, 
+             SDL_MapRGB(screen.getSurface()->format, 0, 0, 255));
+     font->draw(x, y, 255,255,255, true, s);
Index: patches/patch-topscores_cpp
===================================================================
RCS file: patches/patch-topscores_cpp
diff -N patches/patch-topscores_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-topscores_cpp 11 Apr 2018 05:03:23 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: topscores.cpp
+--- topscores.cpp.orig
++++ topscores.cpp
+@@ -122,7 +122,7 @@ ScoresWindow::ScoresWindow(int x, int y, TopScores *sc
+         int w = entryFont.getWidth(s);
+         int c = ((no - 1) == highlight) ? 0 : 255;
+         entryFont.draw(background, 30 - w, pos, 255,255,c, true, s);
+-        SDL_Rect rect = { 40, pos-20, 180, 40 };
++        SDL_Rect rect = { 40, static_cast<Sint16>(pos-20), 180, 40 };
+         SDL_SetClipRect(background, &rect);
+         entryFont.draw(background, 40, pos, 255,255,c, true, e.name);
+         SDL_SetClipRect(background, NULL);
Index: patches/patch-utils_cpp
===================================================================
RCS file: /cvs/ports/games/einstein/patches/patch-utils_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-utils_cpp
--- patches/patch-utils_cpp     3 Apr 2009 17:56:41 -0000       1.1.1.1
+++ patches/patch-utils_cpp     11 Apr 2018 05:03:23 -0000
@@ -1,6 +1,18 @@
 $OpenBSD: patch-utils_cpp,v 1.1.1.1 2009/04/03 17:56:41 landry Exp $
---- utils.cpp.orig     Thu Apr  2 09:00:22 2009
-+++ utils.cpp  Thu Apr  2 09:14:42 2009
+Index: utils.cpp
+--- utils.cpp.orig
++++ utils.cpp
+@@ -101,8 +101,8 @@ int gettimeofday(struct timeval* tp)
+ void drawWallpaper(const std::wstring &name)
+ {
+     SDL_Surface *tile = loadImage(name);
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int y = 0; y < screen.getHeight(); y += tile->h)
+         for (int x = 0; x < screen.getWidth(); x += tile->w) {
+             dst.x = x;
 @@ -275,7 +275,16 @@ std::wstring secToStr(int time)
  #ifdef WIN32
      swprintf(buf, L"%02i:%02i:%02i", hours, minutes, seconds);
Index: patches/patch-widgets_cpp
===================================================================
RCS file: patches/patch-widgets_cpp
diff -N patches/patch-widgets_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-widgets_cpp   11 Apr 2018 05:03:23 -0000
@@ -0,0 +1,80 @@
+$OpenBSD$
+
+Index: widgets.cpp
+--- widgets.cpp.orig
++++ widgets.cpp
+@@ -38,8 +38,8 @@ Button::Button(int x, int y, int w, int h, Font *font,
+ 
+     SDL_Surface *s = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
+             24, 0x00FF0000, 0x0000FF00, 0x000000FF, 0/*0xFF000000*/);
+-    SDL_Rect src = { x, y, width, height };
+-    SDL_Rect dst = { 0, 0, width, height };
++    SDL_Rect src = { static_cast<Sint16>(x), static_cast<Sint16>(y), 
static_cast<Uint16>(width), static_cast<Uint16>(height) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(width), 
static_cast<Uint16>(height) };
+     SDL_BlitSurface(screen.getSurface(), &src, s, &dst);
+     
+     int tW, tH;
+@@ -71,8 +71,8 @@ Button::Button(int x, int y, int w, int h, Font *font,
+             s->format->Bmask, s->format->Amask);
+ 
+     SDL_Surface *tile = loadImage(bg, true);
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int j = 0; j < height; j += tile->h)
+         for (int i = 0; i < width; i += tile->w) {
+             dst.x = i;
+@@ -117,8 +117,8 @@ Button::Button(int x, int y, int w, int h, Font *font,
+             s->format->Bmask, s->format->Amask);
+ 
+     SDL_Surface *tile = loadImage(bg);
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int j = 0; j < height; j += tile->h)
+         for (int i = 0; i < width; i += tile->w) {
+             dst.x = i;
+@@ -436,8 +436,8 @@ Window::Window(int x, int y, int w, int h, const std::
+             s->format->Bmask, s->format->Amask);
+ 
+     SDL_Surface *tile = loadImage(bg);
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int j = 0; j < height; j += tile->h)
+         for (int i = 0; i < width; i += tile->w) {
+             dst.x = i;
+@@ -582,7 +582,7 @@ void InputField::draw()
+ {
+     Window::draw();
+ 
+-    SDL_Rect rect = { left+1, top+1, width-2, height-2 };
++    SDL_Rect rect = { static_cast<Sint16>(left+1), 
static_cast<Sint16>(top+1), static_cast<Uint16>(width-2), 
static_cast<Uint16>(height-2) };
+     SDL_SetClipRect(screen.getSurface(), &rect);
+     
+     font->draw(left+1, top+1, red,green,blue, true, text);
+@@ -721,8 +721,8 @@ Checkbox::Checkbox(int x, int y, int w, int h, Font *f
+             s->format->Bmask, s->format->Amask);
+ 
+     SDL_Surface *tile = loadImage(bg);
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int j = 0; j < height; j += tile->h)
+         for (int i = 0; i < width; i += tile->w) {
+             dst.x = i;
+@@ -917,8 +917,8 @@ void Slider::createSlider(int size)
+             s->format->Bmask, s->format->Amask);
+ 
+     SDL_Surface *tile = loadImage(L"blue.bmp");
+-    SDL_Rect src = { 0, 0, tile->w, tile->h };
+-    SDL_Rect dst = { 0, 0, tile->w, tile->h };
++    SDL_Rect src = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
++    SDL_Rect dst = { 0, 0, static_cast<Uint16>(tile->w), 
static_cast<Uint16>(tile->h) };
+     for (int j = 0; j < size; j += tile->h)
+         for (int i = 0; i < size; i += tile->w) {
+             dst.x = i;

Reply via email to