summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
Diffstat (limited to 'src/video')
-rw-r--r--src/video/cocoa_v.h8
-rw-r--r--src/video/cocoa_v.m12
-rw-r--r--src/video/dedicated_v.cpp2
-rw-r--r--src/video/null_v.cpp2
-rw-r--r--src/video/sdl_v.cpp4
-rw-r--r--src/video/win32_v.cpp14
6 files changed, 22 insertions, 20 deletions
diff --git a/src/video/cocoa_v.h b/src/video/cocoa_v.h
index 93d7b2639..c3f533467 100644
--- a/src/video/cocoa_v.h
+++ b/src/video/cocoa_v.h
@@ -5,6 +5,14 @@
#include "../hal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif //__cplusplus
+
extern const HalVideoDriver _cocoa_video_driver;
+#ifdef __cplusplus
+} // extern "C"
+#endif //__cplusplus
+
#endif
diff --git a/src/video/cocoa_v.m b/src/video/cocoa_v.m
index 46518445b..79551c865 100644
--- a/src/video/cocoa_v.m
+++ b/src/video/cocoa_v.m
@@ -46,18 +46,11 @@ extern void HideMenuBar(void);
# endif
#endif
+
#include "../stdafx.h"
-#include "../openttd.h"
#include "../debug.h"
-#include "../functions.h"
-#include "../gfx.h"
#include "../macros.h"
-#include "../sdl.h"
-#include "../window.h"
-#include "../network/network.h"
-#include "../variables.h"
#include "../os/macosx/splash.h"
-
#include "cocoa_v.h"
#include "cocoa_keys.h"
@@ -65,6 +58,7 @@ extern void HideMenuBar(void);
#undef Rect
+
/* Subclass of NSWindow to fix genie effect and support resize events */
@interface OTTD_QuartzWindow : NSWindow
- (void)miniaturize:(id)sender;
@@ -162,7 +156,7 @@ static struct CocoaVideoData {
NSQuickDrawView *qdview;
#define MAX_DIRTY_RECTS 100
- OTTDRect dirty_rects[MAX_DIRTY_RECTS];
+ Rect dirty_rects[MAX_DIRTY_RECTS];
int num_dirty_rects;
uint16 palette16[256];
diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp
index 764df3afd..043414945 100644
--- a/src/video/dedicated_v.cpp
+++ b/src/video/dedicated_v.cpp
@@ -277,7 +277,7 @@ static void DedicatedVideoMainLoop(void)
next_tick = cur_ticks + 30;
GameLoop();
- _screen.dst_ptr = _dedicated_video_mem;
+ _screen.dst_ptr = (Pixel*)_dedicated_video_mem;
UpdateWindows();
}
CSleep(1);
diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp
index ecdd3486c..8916dadbc 100644
--- a/src/video/null_v.cpp
+++ b/src/video/null_v.cpp
@@ -27,7 +27,7 @@ static void NullVideoMainLoop(void)
for (i = 0; i < 1000; i++) {
GameLoop();
- _screen.dst_ptr = _null_video_mem;
+ _screen.dst_ptr = (Pixel*)_null_video_mem;
UpdateWindows();
}
}
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 3e776d29f..1f9910565 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -469,7 +469,7 @@ static void SdlVideoMainLoop(void)
(keys[SDLK_DOWN] ? 8 : 0);
GameLoop();
- _screen.dst_ptr = _sdl_screen->pixels;
+ _screen.dst_ptr = (Pixel*)_sdl_screen->pixels;
UpdateWindows();
if (++pal_tick > 4) {
CheckPaletteAnim();
@@ -478,7 +478,7 @@ static void SdlVideoMainLoop(void)
DrawSurfaceToScreen();
} else {
SDL_CALL SDL_Delay(1);
- _screen.dst_ptr = _sdl_screen->pixels;
+ _screen.dst_ptr = (Pixel*)_sdl_screen->pixels;
DrawTextMessage();
DrawMouseCursor();
DrawSurfaceToScreen();
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index eab832ae5..28e5f5e62 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -42,7 +42,7 @@ static void MakePalette(void)
LOGPALETTE *pal;
uint i;
- pal = alloca(sizeof(LOGPALETTE) + (256-1) * sizeof(PALETTEENTRY));
+ pal = (LOGPALETTE*)alloca(sizeof(LOGPALETTE) + (256-1) * sizeof(PALETTEENTRY));
pal->palVersion = 0x300;
pal->palNumEntries = 256;
@@ -169,7 +169,7 @@ int RedrawScreenDebug(void)
dc = GetDC(_wnd.main_wnd);
dc2 = CreateCompatibleDC(dc);
- old_bmp = SelectObject(dc2, _wnd.dib_sect);
+ old_bmp = (HBITMAP)SelectObject(dc2, _wnd.dib_sect);
old_palette = SelectPalette(dc, _wnd.gdi_palette, FALSE);
BitBlt(dc, 0, 0, _wnd.width, _wnd.height, dc2, 0, 0, SRCCOPY);
SelectPalette(dc, old_palette, TRUE);
@@ -222,7 +222,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
BeginPaint(hwnd, &ps);
dc = ps.hdc;
dc2 = CreateCompatibleDC(dc);
- old_bmp = SelectObject(dc2, _wnd.dib_sect);
+ old_bmp = (HBITMAP)SelectObject(dc2, _wnd.dib_sect);
old_palette = SelectPalette(dc, _wnd.gdi_palette, FALSE);
if (_pal_last_dirty != -1) {
@@ -358,7 +358,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
GetKeyboardState(ks);
if (ToUnicode(wParam, 0, ks, &w, 1, 0) != 1) {
/* On win9x ToUnicode always fails, so fall back to ToAscii */
- if (ToAscii(wParam, 0, ks, &w, 0) != 1) w = 0; // no translation was possible
+ if (ToAscii(wParam, 0, ks, (LPWORD)&w, 0) != 1) w = 0; // no translation was possible
}
pressed_key = w | MapWindowsKey(wParam) << 16;
@@ -496,7 +496,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
}
case WM_ACTIVATEAPP:
- _wnd.has_focus = (bool)wParam;
+ _wnd.has_focus = (wParam != 0);
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -622,13 +622,13 @@ static bool AllocateDibSection(int w, int h)
_wnd.alloced_bits = NULL;
}
- bi = alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256);
+ bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256);
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
if (_wnd.double_size) {
w = ALIGN(w, 4);
- _wnd.alloced_bits = _wnd.buffer_bits = malloc(w * h);
+ _wnd.alloced_bits = _wnd.buffer_bits = (Pixel*)malloc(w * h);
w *= 2;
h *= 2;
}