equal
deleted
inserted
replaced
4 |
4 |
5 #ifdef ENABLE_NETWORK |
5 #ifdef ENABLE_NETWORK |
6 |
6 |
7 #include "../openttd.h" |
7 #include "../openttd.h" |
8 #include "../debug.h" |
8 #include "../debug.h" |
9 #include "../functions.h" |
9 #include "../gfx_func.h" |
10 #include "../gfx.h" |
|
11 #include "../network/network.h" |
10 #include "../network/network.h" |
12 #include "../window.h" |
11 #include "../network/network_internal.h" |
13 #include "../console.h" |
12 #include "../console.h" |
14 #include "../variables.h" |
13 #include "../variables.h" |
15 #include "../genworld.h" |
14 #include "../genworld.h" |
16 #include "../fileio.h" |
15 #include "../fileio.h" |
|
16 #include "../fios.h" |
17 #include "../blitter/factory.hpp" |
17 #include "../blitter/factory.hpp" |
|
18 #include "../core/alloc_func.hpp" |
|
19 #include "../player_func.h" |
18 #include "dedicated_v.h" |
20 #include "dedicated_v.h" |
19 |
21 |
20 #ifdef BEOS_NET_SERVER |
22 #ifdef BEOS_NET_SERVER |
21 #include <net/socket.h> |
23 #include <net/socket.h> |
22 #endif |
24 #endif |
131 |
133 |
132 const char *VideoDriver_Dedicated::Start(const char * const *parm) |
134 const char *VideoDriver_Dedicated::Start(const char * const *parm) |
133 { |
135 { |
134 int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(); |
136 int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(); |
135 if (bpp == 0) _dedicated_video_mem = NULL; |
137 if (bpp == 0) _dedicated_video_mem = NULL; |
136 else _dedicated_video_mem = malloc(_cur_resolution[0] * _cur_resolution[1] * (bpp / 8)); |
138 else _dedicated_video_mem = MallocT<byte>(_cur_resolution[0] * _cur_resolution[1] * (bpp / 8)); |
137 |
139 |
138 _screen.width = _screen.pitch = _cur_resolution[0]; |
140 _screen.width = _screen.pitch = _cur_resolution[0]; |
139 _screen.height = _cur_resolution[1]; |
141 _screen.height = _cur_resolution[1]; |
140 |
142 |
141 SetDebugString("net=6"); |
143 SetDebugString("net=6"); |
166 free(_dedicated_video_mem); |
168 free(_dedicated_video_mem); |
167 } |
169 } |
168 |
170 |
169 void VideoDriver_Dedicated::MakeDirty(int left, int top, int width, int height) {} |
171 void VideoDriver_Dedicated::MakeDirty(int left, int top, int width, int height) {} |
170 bool VideoDriver_Dedicated::ChangeResolution(int w, int h) { return false; } |
172 bool VideoDriver_Dedicated::ChangeResolution(int w, int h) { return false; } |
171 void VideoDriver_Dedicated::ToggleFullscreen(bool fs) {} |
173 bool VideoDriver_Dedicated::ToggleFullscreen(bool fs) { return false; } |
172 |
174 |
173 #if defined(UNIX) || defined(__OS2__) || defined(PSP) |
175 #if defined(UNIX) || defined(__OS2__) || defined(PSP) |
174 static bool InputWaiting() |
176 static bool InputWaiting() |
175 { |
177 { |
176 struct timeval tv; |
178 struct timeval tv; |