Files
ports/graphics/milton/files/patch-src_platform__linux.cc
T
Alexey Dokuchaev 0169659617 - Update `graphics/milton' to version 1.9.1
- Drop local fixes that were integrated upstream

Reported by:	portscout
2019-10-28 11:36:02 +00:00

36 lines
827 B
C++

--- src/platform_linux.cc.orig 2019-09-28 21:11:07 UTC
+++ src/platform_linux.cc
@@ -1,6 +1,8 @@
// Copyright (c) 2015 Sergio Gonzalez. All rights reserved.
// License: https://github.com/serge-rgb/milton#license
+#include <SDL_image.h>
+
#include "platform.h"
#include "common.h"
@@ -30,7 +32,7 @@ perf_counter()
milton_log("Something went wrong with clock_gettime\n");
}
- return tp.tv_nsec;
+ return tp.tv_sec * 1000 * 1000 * 1000 + tp.tv_nsec;
}
void
@@ -357,7 +359,14 @@ platform_deinit(PlatformState* platform)
void
platform_setup_cursor(Arena* arena, PlatformState* platform)
{
+ SDL_Surface *surface;
+ surface = IMG_Load("milton.png");
+ if (surface == NULL)
+ return;
+
+ SDL_SetWindowIcon(platform->window, surface);
+ SDL_FreeSurface(surface);
}
v2i