source: network-game/common/Common.h@ 373089e

Last change on this file since 373089e was 6319311, checked in by Dmitry Portnoy <dportnoy@…>, 11 years ago

Some redfinition issues related to winsock2 are fixed and a few allegro rendering functions are now in GameRender

  • Property mode set to 100644
File size: 657 bytes
Line 
1#ifndef _COMMON_H
2#define _COMMON_H
3
4#include "Compiler.h"
5
6#if defined WINDOWS
7 #include <winsock2.h>
8 #include <ws2tcpip.h>
9#elif defined LINUX
10 #include <fcntl.h>
11 #include <assert.h>
12#endif
13
14#include <string>
15
16using namespace std;
17
18struct FLOAT_POSITION;
19
20struct POSITION {
21 int x;
22 int y;
23 FLOAT_POSITION toFloat();
24};
25
26struct FLOAT_POSITION {
27 float x;
28 float y;
29 POSITION toInt();
30};
31
32void set_nonblock(int sock);
33unsigned long long getCurrentMillis();
34string getCurrentDateTimeString();
35
36POSITION screenToMap(POSITION pos);
37POSITION mapToScreen(POSITION pos);
38float posDistance(FLOAT_POSITION pos1, FLOAT_POSITION pos2);
39
40#endif
Note: See TracBrowser for help on using the repository browser.