#pragma once
#include "module3.h"
#include <stdio.h>
#include <windows.h>
#include <iostream>
#include <io.h>
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "Gdi32.lib")
#pragma comment (lib, "Msimg32.lib")
#define _LEFT 0x01
#define _UP 0x02
#define _DOWN 0x04
#define _RIGHT 0x08
#define _LEFT2 0x11
#define _UP2 0x12
#define _DOWN2 0x14
#define _RIGHT2 0x18

#define _RECTANGLE 10
#define _RECTANGLE2 11
#define _RECTANGLE3 12
#define _REGION1 13
#define _REGION2 14

int fDrawText(HWND hWnd,int x, int y, int Wm, int Hm, int width, int height, char *text, COLORREF color, int _Flag);
int fDrawObj(HWND hwnd,int x, int y, int Wm, int Hm, int width, int height, int type_obj, COLORREF color);

int fOpenFile(char* pFullPath, BYTE* &pTemp, int &Size);
int fOpenFileRes(int IdRes, WCHAR *TypeRes, BYTE* &pTemp, int &Size);
void fResetCarriageReturn(BYTE* pTemp, int Size);
int fSysStringToChar(System::String^ Str, char *&pStr);
int fCharToSysString(char* pStr, System::String^ &Str);
int fCheckInteger(char *pStr);
int fCheckDouble(char *pStr, char Sep);
int fCheckInteger2(System::String ^_Str);
int fCheckDouble2(System::String ^_Str, char Sep);

int fLoadingData1();
int fRefreshFieldDrawing(HWND hWnd, int view, int _FlagR);

void fOnInitialUpdate();
int fMode(int _Mode);
void fDoodadWrite(float x, float y, int _Object);
void fGetMapCoordinatCenter(float &_x, float &_y);
void fDoodadRemove(float x, float y);

void fAddRegion(RegionMap _Rect);
void fEditRegion(RegionMap _Rect);
void fDelRegion(int _Id);
void fDelRegions(int _Type);
void fGetRegion(RegionMap &_Rect, int _Id);
int fDrawRegion(HWND hwnd, RECT Region, int _Wm, int _Hm, int _W, int _H, int type_obj, COLORREF color, BYTE AlphaValue);
void fGetListIdRegions(int *&pListId, int &_N);
void fGetRegion(RegionMap &_Region, int _Id);