diff --git a/CitizenClass.pde b/CitizenClass.pde index 89206be..2972665 100644 --- a/CitizenClass.pde +++ b/CitizenClass.pde @@ -45,7 +45,7 @@ void initCitizen() { if (i != i_selectedCitizen) citizen[i].spawn(citizen[i].i_home); - else citizen[i].spawn(100, 100); + else citizen[i].spawn(8, 8); if (citizen[i].b_randomRun) citizen[i].goTo(int(random(0, pg_map.width)), int(random(0, pg_map.height)), 10); //bad } @@ -73,7 +73,6 @@ class Citizen extends Entity { float f_FOV = PI / 4.0; int i_visionDistance = 60; boolean b_randomRun; - GraphNode startNode, endNode; int startNodeID, endNodeID; GraphNode[] rNodes; @@ -91,7 +90,7 @@ class Citizen extends Entity { i_age = age; i_diameter = 15; pathFinder = makePathFinder(gs, pathAlgorithm); - f_movementSpeed = random(0.1, 2); + f_movementSpeed = random(0.05, 1); rNodes = pathFinder.getRoute(); c_selected = color(128, 50, 50); @@ -115,20 +114,15 @@ class Citizen extends Entity { void update() { f_angle = v2_direction.heading(); + + turn(); + + if (b_moving) { //if rNodes.length > 0 move(); } - - watch(); - //look collision detection } - void lookAt (int x, int y, int prio) { - } - void watch() { - if (b_moving) { - } - } void goTo(int x, int y, int prio) { //add: go to node? go to house? int i_goToX = x; @@ -164,14 +158,12 @@ class Citizen extends Entity { if (rNodes.length > 0) { nextNode = 0; b_moving = true; - //for (int i = 0; i < rNodes.length; i++) { - // rNodesList.add(rNodes[i]); - //} } else { //implement more intelligent design which calls goTo not in this frame (this can cause infinite loops), but in the next 120 frames or so //also at this point i can move recalculating the nodes into the next frames if no route is found (not only random).. if (b_randomRun) goTo(int(random(0, pg_map.width)), int(random(0, pg_map.height)), 10); } } + void move() { if (rNodes.length > nextNode) { float f_xPosNext = rNodes[nextNode].xf(); @@ -182,8 +174,7 @@ class Citizen extends Entity { f_xPos += i_direction(f_xPosNext-f_xPos, f_movementVelo) * f_movementVelo; f_yPos += i_direction(f_yPosNext-f_yPos, f_movementVelo) * f_movementVelo; - v2_direction.x = f_xPos - f_xPosNext; - v2_direction.y = f_yPos - f_yPosNext; + turnTo(f_xPos-f_xPosNext, f_yPos-f_yPosNext, .3); if (abs(f_yPos - f_yPosNext) < f_movementVelo && abs(f_xPos - f_xPosNext) < f_movementVelo) { f_yPos = f_yPosNext; diff --git a/Entities.pde b/Entities.pde index 61939e6..d5274cb 100644 --- a/Entities.pde +++ b/Entities.pde @@ -1,6 +1,6 @@ int i_interactableAmount = 10; - //entitiy-subklassen: papier .. computer .. mobiles ... books ... lamps ... tables ... +//entitiy-subklassen: papier .. computer .. mobiles ... books ... lamps ... tables ... Interactable[] interactables = new Interactable[10]; @@ -22,6 +22,12 @@ class Entity { }; boolean b_selected; boolean b_moving; + boolean b_turning; + PVector v2_turnBuffer = new PVector(0, 0); + float f_turnSpeed; + + int i_turning; + float f_xPos, f_yPos, f_xSpawn, f_ySpawn; float f_angle; int i_diameter = 10; @@ -29,11 +35,7 @@ class Entity { color c_selected = color(128, 50, 50); color c_color = color(50, 200, 80); color c_stroke = color(255, 255, 255); - //PVector v2_direction(int x, int y){ - // PVector pv = new PVector(f_xPos+x,f_yPos+y); - // return (pv); - //}; - PVector v2_direction = new PVector(0,0); + PVector v2_direction = new PVector(0, 0); void spawn(int house) { //generic spawn PVector v2_spawnPoint = houses.get(house).v2_randomSpawnPoint(); @@ -41,24 +43,50 @@ class Entity { f_ySpawn = v2_spawnPoint.y; f_xPos = f_xSpawn; f_yPos = f_ySpawn; - v2_direction.x = f_xPos; - v2_direction.y = f_yPos + 10; + turnTo(0, 10, 0); f_angle = 0; b_linked = true; } + + + void spawn(int x, int y) { //specific spawn f_xSpawn = x; f_ySpawn = y; f_xPos = f_xSpawn; f_yPos = f_ySpawn; - v2_direction.x = f_xPos; - v2_direction.y = f_yPos + 10; + turnTo(0, 10, 0); b_linked = true; } void despawn() { b_linked = false; } - + + void turnTo(float x, float y, float speed) { + f_turnSpeed = speed; + if (f_turnSpeed > 0) { + b_turning = true; + v2_turnBuffer.x = x; + v2_turnBuffer.y = y; + float difference = v2_direction.heading() - v2_turnBuffer.heading(); + if (difference < -PI) difference += TWO_PI; + if (difference > PI) difference -= TWO_PI; + if (difference > 0.0) i_turning = -1; + if (difference < 0.0) i_turning = 1; + f_turnSpeed*=4*abs(difference); + } else { + v2_direction.x = x; + v2_direction.y = y; + } + } + void turn() { + if (!(abs(int(v2_direction.heading() * 1000) - int(v2_turnBuffer.heading()*1000)) < 100)) { + v2_direction = v2_direction.rotate(i_turning*PI/180*f_turnSpeed); + } else { + b_turning = false; + } + } + void display() { pg_map.stroke(c_stroke); pg_map.fill(c_color); diff --git a/Map.pde b/Map.pde index 775014d..8241147 100644 --- a/Map.pde +++ b/Map.pde @@ -11,8 +11,17 @@ int i_biggestHouseSize; ArrayList houses = new ArrayList(); - void initHouses() { + + s_map = new String[img_houses.height/i_sMapReso]; + + for (int y = 0; y < s_map.length; y++) { + s_map[y] = str('.'); //because += char on string delivers "null" as first stringentry in each arrayentry?! + for (int x = 0; x < img_houses.width/i_sMapReso; x++) { + s_map[y]+= '.'; + } + } + img_houses.loadPixels(); for (int x = 0; x < img_houses.width; x++) { for (int y = 0; y < img_houses.height; y++) { @@ -23,12 +32,23 @@ void initHouses() { } } } + img_houses.updatePixels(); for (House house : houses) { + //give houses their respective relative size (biggest house = 100) house.i_size = int(map(house.i_size, 0, i_biggestHouseSize, 0, 100)); + //create ascii map in s_map + for (PVector point : house.v2d_points) { //create ascii map in s_map + s_map[int(point.y/i_sMapReso)] = replaceCharAt_v1(s_map[int(point.y/i_sMapReso)], int(point.x/i_sMapReso), '#'); + } } } - +String replaceCharAt_v1(String s, int pos, char c) { + char[] ch = new char[s.length()]; + s.getChars(0, ch.length, ch, 0); + ch[pos] = c; + return new String(ch); +} class House { PVector v2_center; int i_size; diff --git a/Server.pde b/Server.pde new file mode 100644 index 0000000..8f3dc55 --- /dev/null +++ b/Server.pde @@ -0,0 +1,30 @@ + +String s_map[]; //send this via tcp +int i_sMapReso =1; //the higher the smaller the reso +void clientCommunication() { + client = server.available(); + if (client != null) { + s_fromClient = client.readString(); + if (s_fromClient.equals("give locx")) { + server.write(str(citizen[i_selectedCitizen].f_xPos/i_sMapReso)); + } + if (s_fromClient.equals("give locy")) { + server.write(str(citizen[i_selectedCitizen].f_yPos/i_sMapReso)); + } + if (s_fromClient.equals("give a")) { + server.write(str(citizen[i_selectedCitizen].f_angle)); + } + if (s_fromClient.equals("give mapw")) { + server.write(str(img_houses.width/i_sMapReso)); + } + if (s_fromClient.equals("give maph")) { + server.write(str(img_houses.height/i_sMapReso)); + } + if (i_mapLevelTransferC >= img_houses.height/i_sMapReso) i_mapLevelTransferC = 0; + if (s_fromClient.equals("give map")) { + server.write(s_map[i_mapLevelTransferC]); + //println(s_map[i_mapLevelTransferC]); + i_mapLevelTransferC++; + } + } +} diff --git a/UI.pde b/UI.pde index 18f8b53..f204109 100644 --- a/UI.pde +++ b/UI.pde @@ -1,5 +1,5 @@ -Button buttons[] = new Button[3]; +Button buttons[] = new Button[4]; int i_uiTransparency = 200; @@ -12,6 +12,7 @@ void initUI() { buttons[0] = new Button(15, 50, 100, i_debugTextSize, 5, "Autoplay", 0); buttons[1] = new Button(15, 70, 100, i_debugTextSize, 5, "Lock Camera", 1); buttons[2] = new Button(15, 90, 100, i_debugTextSize, 5, "Debug", 2); + buttons[3] = new Button(15, 110, 100, i_debugTextSize, 5, "Control Eyes", 3); } @@ -69,6 +70,7 @@ void drawUI() { "Angle: " + citizen[i_selectedCitizen].f_angle, "Movement speed: " + round(citizen[i_selectedCitizen].f_movementSpeed*100), "Random Run: " + citizen[i_selectedCitizen].b_randomRun, + "Turning: " + citizen[i_selectedCitizen].b_turning, " ", "Sunrise: " + S_sunrise, "Sunset: " + S_sunset, @@ -118,6 +120,7 @@ void buttonFunctions(int s) { } break; case(3): + b_controlEyeWithMouse = !b_controlEyeWithMouse; break; default: break; @@ -197,11 +200,14 @@ void mousePressed() { } } if (mouseButton == RIGHT) { + // if(citizen[i_selectedCitizen].hover){ + //} if (!b_autoPlayAfterSelect) { citizen[i_selectedCitizen].b_randomRun = false; citizen[i_selectedCitizen].b_moving = false; } citizen[i_selectedCitizen].goTo(constrain(i_mapViewToMap(mouseX, i_mapOffsetX), 0, pg_map.width), constrain(i_mapViewToMap(mouseY, i_mapOffsetY), 0, pg_map.height), 10); + citizen[i_selectedCitizen].turnTo(citizen[i_selectedCitizen].f_xPos-constrain(i_mapViewToMap(mouseX, i_mapOffsetX), 0, pg_map.width), citizen[i_selectedCitizen].f_yPos-constrain(i_mapViewToMap(mouseY, i_mapOffsetY), 0, pg_map.height),4); } } int i_mapViewToMap(int mouse, int offset) { diff --git a/citizen_server.pde b/citizen_server.pde new file mode 100644 index 0000000..761bd31 --- /dev/null +++ b/citizen_server.pde @@ -0,0 +1,124 @@ +import processing.net.*; + + +//settings +boolean b_smallerImage = false; //use a cropped, smaller version of the 1920x1080 image for faster development +boolean b_loadSun = false; //load sun from web-api instead of local json file (local file is adressed to january 4th 2019. might implement a check that downloads today's information only once... + + +boolean b_cameraFollow = true; +boolean b_autoPlayAfterSelect = false; + + +boolean b_controlEyeWithMouse; + + +boolean b_debug = true; +boolean b_drawNodes = false; + +float f_nodeResolution = 0.2; //defines density of path-finding nodes, multiplied with resolution +int i_pathAlgorithm = 3; +int i_debugTextSize = 10; +int i_mapW, i_mapH; +int i_windowW, i_windowH; +int i_viewportW, i_viewportH; + +//void mousePressed() { +// citizen[0].goTo(constrain(mouseX, 0, img_houses.width), constrain(mouseY, 0, img_houses.height)); +//} + +void spawnCitizen() { //happens after construction +} + +Server server; +Client client; + + +void setup() { + size(700, 600); + server = new Server(this, 5210); + //blendMode(MULTIPLY); + i_windowW = width; + i_windowH = height; + img_map = loadImage(dataPath("map/map.png")); + if (b_smallerImage) img_houses = loadImage(dataPath("map/houses_with_borders_small.png")); + else img_houses = loadImage(dataPath("map/houses_with_borders.png")); + img_streets = loadImage(dataPath("map/streets.png")); + + pg_map = createGraphics(img_houses.width, img_houses.height); + pg_map.beginDraw(); + //pg_map.blendMode(MULTIPLY); + pg_map.endDraw(); + + + surface.setResizable(true); + registerMethod("pre", this); + + i_mapW = pg_map.width; + i_mapH = pg_map.height; + + initHouses(); + initPathFinding(); + initWeather(); + initCitizen(); + initInteractables(); + initUI(); +} + +void pre() { + if (i_windowW != width || i_windowH != height) { + // Sketch window has resized + i_windowW = width; + i_windowH = height; + i_uiY = height - i_uiH; + i_uiW = width; + i_uiH = height - i_uiY; + } +} +String s_fromClient; +int i_mapLevelTransferC; +void draw() { + background(127); + clientCommunication(); + + pg_map.beginDraw(); + pg_map.background(127); + + if (b_debug) pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height); + else pg_map.image(img_map, 0, 0, img_houses.width, img_houses.height); + //pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height); + //image(img_streets, 0, 0, img_houses.width, img_houses.height); + + pg_map.fill(0); + pg_map.textSize(7); + pg_map.textAlign(CENTER); + //for (House house : houses) { + // house.display(); + //} + + if (b_drawNodes) drawNodes(); + + for (int i = 0; i < interactables.length; i++) { + interactables[i].update(); + interactables[i].display(); + } + + for (int i = 0; i < citizen.length; i++) { + if (citizen[i].b_linked) { + citizen[i].update(); + if (i != i_selectedCitizen) + citizen[i].display(); + if (b_debug) + citizen[i].debug(); + } + } + + if (b_controlEyeWithMouse) { + citizen[i_selectedCitizen].turnTo(citizen[i_selectedCitizen].f_xPos-(float)constrain(i_mapViewToMap(mouseX, i_mapOffsetX), 0, pg_map.width), citizen[i_selectedCitizen].f_yPos-(float)constrain(i_mapViewToMap(mouseY, i_mapOffsetY), 0, pg_map.height), 0) ; + } + citizen[i_selectedCitizen].display(); + + pg_map.endDraw(); + image(pg_map, i_mapOffsetX, i_mapOffsetY, i_mapW, i_mapH); + drawUI(); +} diff --git a/client/client b/client/client new file mode 100755 index 0000000..e3fb1ac Binary files /dev/null and b/client/client differ diff --git a/client/main.cpp b/client/main.cpp new file mode 100644 index 0000000..3fcd6bf --- /dev/null +++ b/client/main.cpp @@ -0,0 +1,362 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#define PORT 5210 + +using namespace std; +using namespace std::chrono; + +string debugMsg; + +bool bGameLoop = true; +int nScreenWidth; +int nScreenHeight; +string screen; + +float fPlayerX = 8.0f; +float fPlayerY = 8.0f; +float fPlayerA = 0.0f; +float fElapsedTime; +bool bMoveForward; +bool bMoveBackwards; +bool bTurnLeft; +bool bTurnRight; + +void *keyListener(void *tid){ + long id = (long) tid; + initscr(); + noecho(); + //raw(); + //cbreak(); + //nodelay(stdscr, TRUE); + //scrollok(stdscr, TRUE); + //raw(); + int c; + while ((c = getch()) != ERR){ + debugMsg = ""; + debugMsg+=to_string(c); + switch (c) { + case 119: //w + bMoveForward = true; + break; + case 97: //a + bTurnLeft = true; + break; + case 115: //s + bMoveBackwards = true; + break; + case 100: //d + bTurnRight = true; + break; + default: + break; + } + } + endwin(); + pthread_exit(NULL); +} + +void writeStringToScreen(int x, int y, string text){ + int s = (y*nScreenWidth)+x; + for (int i = s; i < s+text.length(); i++){ + screen[i] = text[i-s]; + } +} + +int main(int argc, char const *argv[]){ + + //CLIENT STUFF + struct sockaddr_in address; + int sock = 0; + struct sockaddr_in serv_addr; + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { printf("\n Socket creation error \n");return -1; } + memset(&serv_addr, '0', sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; + serv_addr.sin_port = htons(PORT); + if(inet_pton(AF_INET, "127.0.0.1", &serv_addr.sin_addr)<=0){ printf("\nInvalid address/ Address not supported \n"); return -1; } + if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0){ printf("\nConnection Failed \n"); return -1; } + + + + ///I HAVE TO LOOK INTO THIS MORE + struct termios ttystate; + tcgetattr(STDIN_FILENO, &ttystate); + ttystate.c_lflag &= (~ICANON & ~ECHO); //Not display character + ttystate.c_cc[VMIN] = 1; + tcsetattr(STDIN_FILENO, TCSANOW, &ttystate); + /// + + //cInput = {'a','b'}; + //fputs("\e[?25h", stdout); //get cursor back /on signal abort ~ + //setterm(1); + pthread_t pThread[1]; + pthread_create(&pThread[0], NULL, keyListener, 0); + + struct winsize size; + ioctl(STDOUT_FILENO,TIOCGWINSZ,&size); + nScreenWidth = size.ws_col; + nScreenHeight = size.ws_row; + int nFrameRate = 60; + + + float fFOV = 3.14159 / 4.0; + float fDepth = 32.0f; + + char *mapwRequest = (char*)"give mapw"; + char bufferMapw[32] = {0}; + send(sock , mapwRequest , strlen(mapwRequest) , 0 ); + int getmapw = read( sock , bufferMapw, 32); + string s_MapWidth = ("%s\n",bufferMapw); + int nMapWidth = stoi(s_MapWidth); + + char *maphRequest = (char*)"give maph"; + char bufferMaph[32] = {0}; + send(sock , maphRequest , strlen(maphRequest) , 0 ); + int getmaph = read( sock , bufferMaph, 32); + string s_MapHeight = ("%s\n",bufferMaph); + int nMapHeight = stoi(s_MapHeight); + + + string map = ""; + + for (int i = 0; i < nMapHeight; i ++){ + char *mapRequest = (char*)"give map"; + char bufferMap[4096] = {0}; + send(sock , mapRequest , strlen(mapRequest) , 0 ); + int getmap = read( sock , bufferMap, 4096); + map += ("%s\n",bufferMap ); + } + /* + map += "################"; + map += "#..............#"; + map += "#####......#####"; + map += "#..............#"; + map += "#..........#####"; + map += "#..............#"; + map += "#####......#####"; + map += "#####......#####"; + map += "#####......#####"; + map += "#####......#####"; + map += "#####......#####"; + map += "#..............#"; + map += "#..............#"; + map += "#####......#####"; + map += "#..............#"; + map += "################"; */ + + system("kbdrate -d 250 -r 10"); + + + using clock = steady_clock; + auto tp1 = clock::now(); + auto tp2 = clock::now(); + + fputs("\e[?25l", stdout); //remove cursor*/ + + float fSpeedFactor = 20.0f; + + /////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////// + ////////BEGINDRAW///// + /////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////// + while(bGameLoop){ + + + tp2 = clock::now(); + duration elapsedTime = tp2 - tp1; + tp1 = tp2; + fElapsedTime = elapsedTime.count(); + + + //dynamic terminal window size (on Window Resize) + ioctl(STDOUT_FILENO,TIOCGWINSZ,&size); + nScreenWidth = size.ws_col; + nScreenHeight = size.ws_row; + screen.clear(); + screen.resize(nScreenWidth*nScreenHeight); + cout << "\x1B[0;0H"; //reset cursor to 0,0 + + + //fun part + + + + char *locxRequest = (char*)"give locx"; + char *locyRequest = (char*)"give locy"; + char *aRequest = (char*)"give a"; + + char buffer[32] = {0}; + + + + send(sock , locxRequest , strlen(locxRequest) , 0 ); + int getlocx = read( sock , buffer, 32); + string s_xPos = ("%s\n",buffer ); + + buffer[32] = {0}; + send(sock , locyRequest , strlen(locyRequest) , 0 ); + int getlocy = read( sock , buffer, 32); + string s_yPos = ("%s\n",buffer ); + + buffer[32] = {0}; + send(sock , aRequest , strlen(aRequest) , 0 ); + int geta = read( sock , buffer, 32); + string s_angle = ("%s\n",buffer ); + + + fPlayerA = stof(s_angle)+3.14159*0.5; + fPlayerX = stof(s_xPos); + fPlayerY = stof(s_yPos); + //this would be much better as class + if(bMoveForward){ + fPlayerX += fSpeedFactor*sinf(fPlayerA) * 5.0f * fElapsedTime; + fPlayerY += fSpeedFactor*cosf(fPlayerA) * 5.0f * fElapsedTime; + if(map[(int)fPlayerY * nMapWidth + (int)fPlayerX] == '#') + { + fPlayerX -= fSpeedFactor*sinf(fPlayerA) * 5.0f * fElapsedTime; + fPlayerY -= fSpeedFactor*cosf(fPlayerA) * 5.0f * fElapsedTime; + } + bMoveForward = false; + } + if(bMoveBackwards){ + fPlayerX -= fSpeedFactor*sinf(fPlayerA) * 5.0f * fElapsedTime; + fPlayerY -= fSpeedFactor*cosf(fPlayerA) * 5.0f * fElapsedTime; + if(map[(int)fPlayerY * nMapWidth + (int)fPlayerX] == '#') { + fPlayerX += fSpeedFactor*sinf(fPlayerA) * 5.0f * fElapsedTime; + fPlayerY += fSpeedFactor*cosf(fPlayerA) * 5.0f * fElapsedTime; + } + bMoveBackwards = false; + } + if(bTurnLeft){ + fPlayerA -= 0.15f; + bTurnLeft = false; + } + if(bTurnRight){ + fPlayerA += 0.15f; + bTurnRight = false; + } + + //shading part + for (int x = 0; x < nScreenWidth; x++){ + float fRayAngle = (fPlayerA - fFOV / 2.0f) + ((float)x / (float)nScreenWidth) * fFOV; + float fDistanceToWall = 0; + + bool bHitWall = false; + bool bBoundary = false; + + float fEyeX = -sinf(fRayAngle); + float fEyeY = cosf(fRayAngle); + + while(!bHitWall && fDistanceToWall < fDepth){ + fDistanceToWall += 0.1f; + + int nTestX = (int)(fPlayerX + fEyeX * fDistanceToWall); + int nTestY = (int)(fPlayerY + fEyeY * fDistanceToWall); + + if(nTestX < 0 || nTestX >= nMapWidth || nTestY < 0 || nTestY >= nMapHeight){ + bHitWall = true; + fDistanceToWall = fDepth; + } else { + if(map[nTestY * nMapWidth + nTestX] == '#') + { + bHitWall = true; + vector> p; //distance, dot + for (int tx = 0; tx < 2; tx++) + for (int ty = 0; ty < 2; ty++) + { + float vy = (float)nTestY + ty - fPlayerY; + float vx = (float)nTestX + tx - fPlayerX; + float d = sqrt(vx*vx + vy*vy); + float dot = (fEyeX * vx / d) + (fEyeY * vy / d); + p.push_back(make_pair(d,dot)); + } + + sort(p.begin(), p.end(), [](const pair &left, const pair &right) { return left.first < right.first; }); + + float fBound = 0.005; + if (acos(p.at(0).second) < fBound) bBoundary = true; + if (acos(p.at(1).second) < fBound) bBoundary = true; + if (acos(p.at(2).second) < fBound) bBoundary = true; + } + + } + } + + int nCeiling = (float)(nScreenHeight / 2.0) - nScreenHeight / ((float)fDistanceToWall); + int nFloor = nScreenHeight - nCeiling; + + short nShade = 32; + + + for(int y = 0; y < nScreenHeight; y++){ + if(y < nCeiling) + screen[y*nScreenWidth+x] = ' '; + if(y > nCeiling && y <= nFloor){ + if (fDistanceToWall <= fDepth / 4.0f) nShade = 77; //very close + else if (fDistanceToWall < fDepth / 3.5f) nShade = 72; + else if (fDistanceToWall < fDepth / 3.0f) nShade = 84; + else if (fDistanceToWall < fDepth / 2.5f) nShade = 73; + else if (fDistanceToWall < fDepth / 2.0f) nShade = 105; + else if (fDistanceToWall < fDepth / 1.5f) nShade = 58; + else if (fDistanceToWall < fDepth) nShade = 46; + else nShade = 32; // too far + if(bBoundary) nShade = '-'; + screen[y*nScreenWidth+x] = nShade; + } + else + { + float b = 1.0f - (((float)y - nScreenHeight / 2.0f) / ((float)nScreenHeight / 2.0f)); + if (b < 0.3) nShade = 32; //32 //very close + else if (b < 0.55) nShade = 96; //96 + else if (b < 0.8) nShade = 94; //94 + else if (b < 0.9) nShade = 42; //42 + else nShade = 32; //64 too far + screen[y*nScreenWidth+x] = nShade; + + } + } + } + + + + + + writeStringToScreen(0, nScreenHeight-3,"Received from server: " + s_xPos+ " "+s_yPos+ " "+s_angle + " " + to_string(nMapWidth)+ " " + to_string(nMapHeight) + " "); + + + //writeStringToScreen(0, 0, "Key pressed: " + to_string(123) + " Key code: " + to_string(cInput)); + //writeStringToScreen(0, nScreenHeight-3, debugMsg); + writeStringToScreen(0, nScreenHeight-2, "Frame rate: " + to_string(1.0f / fElapsedTime) + " "); + writeStringToScreen(0, nScreenHeight-1, "Key pressed: " + debugMsg + " Angle: " + to_string(fPlayerA) + " X: " + to_string(fPlayerX) + " Y: " + to_string(fPlayerY) + " "); + + //string sInput(1, cInput[0]); + + cout << screen; //this is the renderer + //cout << ; + + + tp1 += milliseconds(1000 / nFrameRate); + this_thread::sleep_until(tp1); + + } + return 0; +} diff --git a/data/server/map.txt b/data/server/map.txt new file mode 100644 index 0000000..2f4f9bb --- /dev/null +++ b/data/server/map.txt @@ -0,0 +1,270 @@ + #### ######## ## ###### ######### ###### + ## ######## ## #### # ######## #### + # ##### #### ## ### ##### ## ## + #### ### ###### ##### ### ##### + ##### ######## ######## ####### + ####### ######## ######## ##### + ####### # #### ###### ####### ### + ##### #### ###### #### #### # + ### ###### ###### # ### ## ## + # ####### ####### #### ##### + ######## ####### ##### ##### + ####### #### ### ##### ##### + # # #### ##### #### ### + ####### ##### ## #### ### +######### ##### #### ###### ######## +######### ##### ########## ###### ##### ########## +########## ##### ########## ###### ###### ### ########## +## ### ###### ###### ###### ###### ## ##### ########### + ###### ###### ###### #### ########### ######## + ## ### ## # # ################### # #### + ##### ## ### ########## ###### # ##### ## ########## + ##### #### #### ########## ### ###### #### ############## # + #### ##### # ## ######## # ###### ####### ########## ### ### #### + # ####### #### ###### ###### ###### ####### # ###### #### ###### + ##### ############# ###### ### ######## #### ###### ##### # ######## # + ### # ####### ### ###### ####### ###### ###### ##### ### ########## ### + ### ##### ######## #### ###### ######### ####### ### #### ##### ########## ##### + ###### ##### ####### ####### ###### ##################### ##### ###### ######## ####### + ######## ###### ## ####### # ######## ######## ################# ### #### ##### ##### ####### + ######## ##### ####### ####### ############## ################# ### ##### #### ### ####### ### ###### + ####### #### ####### ####### ############## ##### ###### #### ### ### ######## #### + ### ##### ####### ####### ####### ##### ######## ########## ### ########### ###### ## ### # + ## ##### ####### ######## ####### ############ ##### ## ####### ####### ##### + ######## ####### #### ##### ##### #### ### ### ###### ### ##### ###### ###### + ######## ###### ##### # #### ## ## ###### ##### #### #### #### ###### +# ######## ##### ##### #### #### #### ### ####### ##### ###### #### # ###### +## ####### ##### #### ##### ##### ####### # ######### ### ##### ######## ## ###### # ###### +## ### ##### #### ##### ###### ##### ######## ########## ###### ##### ####### ##### +## ## ##### #### ##### ###### ### ## ####### ########### ######## ###### #### #### ## + ##### ##### ##### ####### ##### #### ##### ## ######### ###### # ### ### ##### + ## ####### ##### ##### ### ###### ###### ## ############## #### #### # ##### + #### ########### ##### ##### ### ##### ###### # ###### ## ######## ### # ##### ###### #### + ###### ############ ##### ##### ###### ##### ### #### ####### #### ############ ####### ###### ####### + ## ###### ############# ##### #### ###### ##### ###### #### ######## ### ###### ########## ## ## ####### ## ###### ##### ####### + #### #### ############# ## ##### ##### ##### ###### ##### ####### ## ######### ######## ######## ##### ### ##### ### #### ###### #### ######### # ####### # + ####### ### ########## #### ##### ###### #### ##### ### ###### ############ ################### ##### ##### ### #### #### ##### ########### ###### ###### ##### + ####### # ######## ##### ##### ###### #### ##### ###### ### ############ ################### # ##### ## ### ##### ### ###### ########### ### # ####### ## ##### + ####### ### ##### ##### ###### ##### ## #### ###### ### ######## #################### ## ##### ## ##### #### ##### ###### #### ####### #### ##### + ####### ##### ### ### ##### ###### ##### ##### ### ####### ####### #### #################### #### ##### ###### #### ## ##### ###### #### ######## ####### ### + ######## ##### ##### ##### ###### #### ##### ##### ##### ######### ## ## ### #### ###### ######## ## ##### ##### #### #### ##### ######## ###### + ####### ### ######## ### ## #### ##### ## ##### ## ########### ################## ######### ####### # ### ## ## ###### #### ######## ### + ###### # ########## ###### ### #### ##### #### ##### ############# ###### ############### ### ## # ######### ######### ######## ###### ######## ## # + #### ############# ####### ###### ##### ##### ##### ############# ########## ################### #### ############# ############# ######### ##### ######## ##### ### #### # + ## ############## ####### ######## ##### #### ### ############ ############## ## ################### ################ ############### ########## ##### ### ######## #### ###### ### #### # + ############## ####### ######## ####### ###### ## #### ############ ############## #### ################## ################## ###### #### ############# #### ### ######## ###### #### ### #### # + ############## ####### ######## ####### ######## ###### ##### # ### ######## # #### #### ##### # ################ ###### ## ## ################ ### #### ######## ####### ## # ### ### # + ################ ####### ######### ####### ######## ### ##### ### ###### ### #### #### ###### ############ #### ################# #### ### ##### ######## ####### ##### ### ## # + ################## #### ######## ####### ######## ##### ###### ### ##### # ######## ###### # #### ################# ######## #### ###### ######## ###### ##### ### ### + ################### # ######### ####### ######## ### ######## #### ##### ######### # ### ####### ####### ############## ########### ### ############ ######## ## ##### #### ### ### + ################ #### ######### ####### ######## ####### ##### ##### ############# ################## ############ ## ########### ################ ######## ## #### ### ## + ########### ##### ######## ######## #### ### # #### ###### ############# ############ #### ##################### #### ########## ################ ################ ###### #### # + ######## ##### ######### ##### ## ##### ###### # ############## ############ #### ##################### # ######## ######## ########## ### ####### ##### # #### + ###### ##### ######### ##### #### ## ### ########### ############ #### ################### ##### # ######## ########## #### ###### ##### #### + ### ##### ######### ##### ##### ### ######### ############ #### ################## # #################### ##### ##### #### ### ### + ## ## #### #### ########### ############ #### ####### ############# ### #### ##### ### ### ## + ##### #### ##### ########## # #### ############### ### #### #### ### #### #### + ####### #### ######### ### ## # ########### # ###### # # ##### #### #### ####### + ####### ##### ######## ##### #### ## ######## ####### ######### ####### #### ##### ##### ######### + ###### ############# #### ######## #### ##### ##### ############# ####### ######### ####### ###### ### ##### ##### ######### + ### ############# ## ##### ######## ##### ######## ########### ############## ######## ######### ## #### ####### ###### ## #### ##### ######### + # ############# #### ### ####### ####### ######### ############ ############# ######## ## ## ### #### ###### #### ## ##### ######## ######## + ############# ###### #### ####### ######### ######## ############ ############# ######## ## ### ##### #### ###### ##### ##### ########## ###### + #### ######## ## ####### ####### ####### ######### ########## ########## ####### ### ## ##### ## ###### #### ##### #### ########## ### ### + #### ######## #### ######## #### ##### ######### ### ### ### #### ## ##### ###### #### ######## ### ### # + #### #### ## ##### ######### # ###### ####### ######## # #### ##### # ###### # ### ######### ### ### # + ### ##### ## ####### ######### ###### ######## ### #### #### # ##### #### ###### # ######### ##### ###### ### ## ## +### #### ########## ### ### ##### ######## ######### ##### ######## ### ##### ##### #### ## ####### ##### ### ############## ##### ### ### ### ## +### ###### ################ ### #### ######## ######### ###### ####### ###### # ### ### ######## ## ##### ############## ##### ## ##### ## +### ######### ############################## ######## ########## ### ##### ######## ######### ### ## ####### ######## ############## ##### ######## ######### ## + ########### ############################## ######## ########### ##### #### ##### ######## ######### #### ### #### ### ## ########## ############### ##### ######## ### ######### # + ############# ########################### ## #################### ###### #### ##### ######## ###### # ### #### #### #### ############ ######## ## ######## ### ######## # + ############### ## ############ #### ##################### ####### #### ## ########## ######## ### ##### #### # ############ ### ######## #### ####### # + ################# #### #### ####### ##################### ######### ## ########## ######### #### #### ######### #### #### ###### # + #################### ###### #### ######### #################### ##### #### ########## ######## # #### ###### ### #### ### #### ######### + ##################### ######### #### ########## ################# ### #### ## ###### ## ###### ##### #### # ####### #### ###### #### ##### ###### #### ######### + # ################## ######### #### ## ## ## ########## ######## ###### ########## ### ######### ####### ### ## #### ####### # ###### ##### #### ##### ###### ### ###### + #### ################# ### ######## ######## # ############# ######## # ## ######## ###### ######### ####### ## ############# ## ##### ##### #### ##### ###### + ###### ############### ##### ############# ####### ####### #### ########### ############ ######## ##### ########### ####### ############### #### ## # ##### ##### +######### ############ ################### ####### ####### ####### ######### ############## ##### #### ######### ####### ######## ####### ##### #### ##### ##### ####### +# ####### ############ ################## ##### ### ### ###### ####### ####### ######## ##### ######## # # ###### ######## ##### #### ###### ##### ## ######### +######## ############ ### ######################## ####### ### ####### ###### ######## #### ####### ##### ##### #### ######### #### ####### ###### ### #### ##### ### +## ### ########### ########################## ####### ####### #### ######## #### ################ ##### #### # ########## # ##### ## ###### ####### ### #### ######### +##### ############ ############################# #### ## ###### #### #### ## ########### ###### ###### ######## #### ##### ##### ######## ### ##### ######### +### ########### ############################## ## # ###### #### ###### ########## ###### ####### ########## ### ## ##### ## ######## ##### ####### ## ##### #### +### ######## ########################## #### ##### ### ######### ### ### ###### ################# ###### ### ##### ######### ##### #### ### ##### #### + # ###### #################### ######## #### ######### ### #### ### ################# ### ### ########### #### ######### ##### #### + ##### ############### ########## ##### ########### ####### ######## ### ################ ##### #### ### ########### ##### #### ######### ### #### #### + ## ##### ##### ############## ### ##### ######## ######## ######## ### ### ######## ###### #### ### ###### ### #### ##### ##### #### #### ## #### + ## ######### ############## #### #### ##### ###### ####### #### ### ### ### ## # ####### #### ### ### ### # ###### ### #### #### #### + ############## ########### ##### ### ##### ### ####### ### ### ##### ### ####### #### #### #### # ###### ### #### #### #### + ################### #### ######## #### ### # # ##### # ####### #### ### ##### ## ###### ### ###### ### #### ##### ### # #### #### + ##################### ###### ##### ##### ### #### ### ##### ##### ####### ### ###### ###### #### ###### #### ##### ## ###### ## ######## #### #### ### + #### ################## ######## ## ##### ##### ##### #### ####### ####### #### ######## ### #### #### ###### ##### ##### ### ############ ############# #### #### ### + ###### ############### ############ ### ###### ############# ## ########## ######## ########### ### ###### # ### #### ###### ##### ##### ###### ########### ### ####### ##### ### ##### + ######## ############ ###### ######## ### ###### #### ####### ############ ####### ####### ###### ######## ### ### ### # ##### ###### ############# ### ###### ###### ##### # + ####### ######### ######## #### #### ### ###### # ## ##### ############ ####### ######## ######### ######## ##### ### ### #### #### #### #### #################### ###### ###### #### #### #### ##### # + ###### ###### ### ###### ############ #### ## #### ### ##### ############ ############# ################## ############ ###### #### ####### ### ## ###################### ###### ## ###### #### ###### #### #### ##### # + ## ############### ####### #### ########### ## #### #### ##### ## ######## ### ####### ########## ######## ######## ###### ###### ### ######### #### ########### ######### ### ######### ##### ## #### ###### #### #### #### # + ######################## ####### ############## ### #### #### ###### ########### ######## ################### ########### ###### ###### ############### ### ##### ######## #### ### ### ######### ##### ### ### ###### #### ### + ## # ######################### ####### ############ ### ### #### ###### ############ ####### ################## ############## ####### ###### ############### ##### ##### ###### ### ## ### ######## ##### ### ### ###### + ###### #### ######################### ####### # # ######### ### ######## ###### ### ########### #### ########## ##### ## ################ ###### ###### ########## ###### ######## ## ## ### ##### # #### ### ######## ##### ### # + ###### ######## ##################### ####### ######### ####### ## ####### ######## ###### ########## ## # ############# ##### ####### ###### # ##### ############## ###### ######## #### # ### #### ###### ### ######### # ## + ###### ########### ######## # ####### ########### #### ###### ######### ####### ###### ##### ########## ####### ##### ###### #### ######## ###### ######## ##### ####### ###### ## ######## # ###### + ###### ############## # ###### ############## ### ##### ####### ####### ##### ####### ########## ####### #### ####### ##### ##### ##### # ###### ######## ############# ##### ### ## #### ##### ###### + ###### ################ ## ################# ## #### # ##### ######## ############# ########### ####### ##### ########## ##### ### ## #### ### ### ######### ############# ### ## #### #### #### # + ##### ################# ######## ########### #### #### ########### ############# #### ######### ## #### ############### #### ##### #### ###### ## ########## ############ ## # ####### #### #### #### + #### ################ #### ###### ### ###### ## ########### ############## ###### #### ######## ####### ############### ## ## ####### ##### ######## #### ######## ########### #### ############# ### #### + ### ################ ## ## ###### ### ## ### ####### ## ########### ############### ######## #### ################ ############## ###### ###### #### ########## ###### ######## ### ##### ##### #### ################# + #### ############# ##### ## #### ### ##### ####### ### ######### ### ######### ####### #### ############# ### ############ ######### ###### ############## ####### #### ## #### ##### #### #### ############# + ### ########## ###### ##### ### #### ###### # ####### ###### ###### ########### ####### ####### ######## ### ############ ########### ####### #### #### ###### ###### # ### #### #### # #### #### #### ####### # + ## ###### ###### ##### ######## ################ ######## ### ################## ######## ####### ######## ### ########## ########### ########### ####### # ####### #### ## ## ## #### ##### #### #### #### #### ### # +# ## ##### ####### ########### #### # ############## ########### ### ################## ################ ## ###### ######## ########### ########### #### ### # #### ###### ###### #### #### ###### #### #### ### #### ### # +# # # ###### ######### # #### # ### ###### #################### ###### ################# ################ ####### # ###### ########## ########## ############ ###### # ####### ##### ##### ###### #### ### #### ### ### # +## ###### ##### #### ## ### ####### ### ################## ####### ############# ### ################# ############## ### ### ####### ###### ############### ######## ###### ###### ##### ###### #### ### ### +## ### # ### ########### ###### ######## ### ################ ######## ###### ####### ############# ################# # #### ##### # ### ################ ########## ### ###### ###### ### ## + ###### #### ## #### ####### ######### ################ ### ####### #### ########## ############################### ###### ### ##### ############ # ############ ## # ###### # #### #### ### ## + ###### ###### ### ######## ######## ########### ##### ######## ######### ############################## ###### ####### ########### ############ #### ### ###### ### #### #### ###### + ####### ######## ####### ###### ##### #### ####### ##### ##### ########### ####### ## ###### ######## ############ ############## #### ###### ###### ##### #### #### ##### # + ###### ############ ###### ### ## ### #### ####### ## ## ############# #### ##### ###### ######## ############ ################ #### ####### ###### #### #### ## #### #### #### ###### ### + ###### ############# ### ##### ##### ######## ######## ########## #### ### ####### ###### ####### ####### ############### # ###### ###### ## #### #### ### ### ###### #### #### #### #### ### + ###### ############ #### ## ### #### ####### ############# ##### ####### ##### ######### ###### ####### ####### ################# ###### ###### ##### #### #### ##### ###### #### #### ### ### ## ### + ####### ########## ####### ##### ######## ########### ## ######## ############# ## ## ##### ######## ############ ###### ######## ##### ################# #### #### ##### #### ### #### ###### #### #### ###### + ####### ######### ####### ##### ######## ############ #### ###### ############## ###### ### ##### ## ###################### ######## # ################## # ## ## ##### #### ### #### ##### ### ### ## ### + ###### ###### ###### #### ####### ########### ###### ### ############## ######### ######## ############# #### ###### ####### ################## #### ## ### #### ### # ###### + ###### ##### ### ## ####### ########### ######## ############# ############# ####### ################# #### ##### ### ######## ################# ### ###### ### #### ## ### + ###### ## ####### ########### ## ######## #### ############## ################ ##### ################## ######## ############ ######### ## #### ###### #### ## ## + ###### ####### ############ ##### ########## ##### # ############## ################ ## ################## #### # ############# ######### #### # #### #### ### ### + #### ######## ########## ###### ########## ##### #### ############## ################ ### ################## #### ### ####### ## ####### ####### ## ###### #### ### ### + #### ### ######## ### ######### ## ###### ### #### ############# ############## ##### ############### ############## ##### ##### ### ###### ############ #### ## ### + #### ##### ######## #### ############# ##### ### #### ############## ######### ##### ####### #### # ########### ##### ##### #### ###### ## ############ #### ### + ###### ####### #### ############### ### ### #### ############## ###### ### ###### ###### ## #### ###### ####### #### #### ##### #### ############ #### #### ##### ## +# ##### ####### #### ################ ### #### #### ################# ## # ####### ##### ####### ## ###### ##### ########### ##### #### #### ###### ######## #### ######### ###### ##### +# #### ####### # ################ ####### ### #### ################ ##### ######## ##### ####### ##### ####### ## ############# #### #### ## ## ##### ## ## #### ######### ##### ### #### +## # ####### ############### ######## #### #### ################# ####### ######### ####### ############## ####### ########### #### ### ## #### ### #### ################# ## # #### +# ####### #### ##### #### ####### #### #### ################# ###### ######### ####### ############## ########## ############ ## #### ##### ## ##### ### # ################# # #### #### + # #### ##### ####### ##### #### ############ #### ######### ###### # ############# ######### #### #### ##### ###### ## ###### ### #### ################ #### + ## ## ### ##### ###### ###### #### #### ########### #### ######### ######## #### ############ ###### # ###### ###### #### #### #### #### ############### ##### #### + #### ## #### ########### ##### #### ##### ### ######## ##### # ################# ###### ########### ### ###### ### ###### ## ##### ### #### ######### ##### #### + ##### #### ##### ###### ### ### # ######### ##### ### #### #### ###### ################# ####### ########## #### # #### # # ####### ### #### ### #### ######### #### # + ### ###### ##### #### #### #### ##### ######## #### ##### ########## ##### #### ######### ######## ## ###### ########### ###### ### ### ### ###### #### #### #### ######### #### ##### + # ###### ### #### ## ## #### ######## #### ## ####### ### ### ########### ########### ###### ######## ############# ############ ####### ##### ##### #### ###### ######### ### #### + #### # #### ## ### ############ ############# ######### ########### ############ ####### ### ############## ## ###### ####### ###### ##### ## ## ##### ######### # #### + ## ####### ###### ###### ## ####### ####### ##################### ############ ####### ## # ###### ###### ### ##### ####### #### #### #### ### ######### #### #### + ####### ### ######## ## ## ### ## ################# #################### ############ ####### #### ### ############## ##### ###### ###### ## ## # ## ###### #### ######### #### ##### + ####### #### ######### ###### ### #### ########################### #### #### ##### ####### ############# ################## ###### ##### ## ####### #### ### ######## ######## ########## # #### ### + ## ## #### ###################### ######## ################## ### ########## ##### ####### ############ ##### ###### ###### ###### ######## ####### ### ##### ##### ######### ############# ######### ### ### + ###### #### ###################### ######## ################## ########## ###### ################## ###### ### ####### ######## ####### ###### ##### ###### ######### #### ################## #### ###### # + ###### ##### ### ############ ## ####### ################ #### ##### ### ###### ########## #### #### # ################ ####### ###### ### ##### ####### ####### ###################### #### ####### + ###### ######## #### ######## #### ########## ## ##### ######## ####### ########## # ######## ############### ### ###### # # ### ##### ################################ ### ###### + ### ## # ##### ##### #### ######## ## ########## #### ## ########### ####### ########## ####### ############# ### ##### ### ### ### ######################## ###### #### + ##### #### ### ###### #### ### ############# ## ######### ######## ############## ## ####### ### ####### ########## ###### ## ##### ##### #### #################### ##### ## + ####### ##### ##### ###### ####### #### ### ########## #### ####### ######## ############## #### ###### ####### ####### ####### ##### ###### ####### ############### ###### # +######## ### ####### ###### ######### #### ############ ##### ###### ####### ####### ########### ### ######## ### #### #### ######## ####### ##### # #### ####### ########### ###### ###### +####### ####### ###### ########### ##### ########### ## ######### ####### ######## ######## ##### ####### ### ###### ######## ##### ##### ### ## ##### ####### ##### ######## +###### ##### ##### ############ #### ############## ########### ####### ####### ##### ######## ## ######## ####### ######## ##### ##### ##### ### ####### ###### ######## +##### ## ### ### ##### ############ ##### ############## ########### ###### ######## ## ########## #### ######## ####### ######### # ## ###### ####### ## ########## ##### ### ######## +#### ###### ##### # ## ############ #### ############## ######## #### ####### ############# #### ####### ####### ######## ### # ##### ####### #### ########## ##### ###### #### +### ######## ####### ############ #### ############# ###### # # ##### ############### ### ##### ### ####### ######## #### #### ####### ###### ########## ### ####### +## ######## ####### ## ######## # ############### # #### #### ### ################### ### ### # ##### ####### ############# ###### ####### ######## ######### ####### +# # ######## #### ###### ###### #### ##### ### ######### ### #### ##### #################### ###### ######## ####### ########## ######## ## ####### ######### # #### ###### ###### + ### ######## ############ #### ###### ####### ## ####### ##### #### ######## #################### ###### ######### ####### ######### ######### #### ####### ########## #### #### ### ### #### + ##### ####### ############## ## ######## ## #### #### #### ######## ##### ########## #################### ###### ######## ####### ###### ######## ###### ##### ########## ###### #### ###### + ####### ######### ############### ######## #### #### ######## ### ########## #### ########## ################## ##### ### ### ####### ###### ######## ###### ### ######### ###### ##### ###### + ######### ########### # ################## ##### ###### # ##### ## ######## ############ ################ ################ # ### ####### #### ###### ####### # ####### ###### ####### ##### + ######## ############## ################### ## ### ####### ###### ##### #### ###### ############## ################# ## ############# ### ###### ### ######## ##### ###### ####### ##### + ######## ############### ################## ##### # ###### ###### ##### ## ####### #### ################# ################ ##### ########## ## #### ###### ### ## ## ####### ### ### ######## ##### ### + ###### ############## #################### ###### ### ###### ###### ################# ### ################### # ########### ####### ####### #### ## #### ##### ###### ##### # # ########### # #### ### + ####### ################################ ##### #### ##### ###### ######### ######## ##################### #### ##### ######## ##### ####### ### ### ##### ### ################# ## #### + ####### ############################# ## ### ############# ###### ################# # ##################### ### ##### ######## ## ######### #### ###### ## ################# + ####### ############################ ### ############## ###### ########## #### ### ########### ### ##### ##### ##### ####### ############ ## ######## ### ###### #### ################# + ####### ############################# ###### ############### ###### ######## # ###### ########### ##### ## ##### ##### ##### ############ ##### ########## ##### ##### ###### ################# + ####### ### ############################ ###### ############### ###### ######## ########## ####### ##### ##### ## ########## ###### ############ ##### ###### ######### ################# +###### ##### ########################## ###### ############## ### ############ #### # ####### ##### ##### ######## ######## ####### #### ##### ##### ## ########## ################## +##### ##### ######################### ### ############### ############## ##### ####### ##### ###### ##### ####### #### #### ##### ##### ###### #### ########## ##### +#### ##### ######################## # ############## ################# #### ## ####### ##### ######## ##### ###### # #### ##### ##### ## ##### ###### # ######## ## +### ##### ###################### ## ############## ######## ## #### ##### ##### ####### ############# ## ## ### #### ##### ##### #### #### ####### #### ###### #### ##### +## ##### ####################### #### ############# ##### ##### #### ###### ###### ########### ##### # # #### ##### ####### ###### ## ###### ###### #### ###### ###### + ##### ####################### ###### ############## ### #### ##### ###### ##### ######## ####### ### ##### #### ####### ###### ### ####### ## ######## ####### + ##### ##################### ####### ############## ### # ##### #### ####### ## ###### ######## ### ##### #### ####### ###### # ####### ####### ####### + ##### ################### ##### ############## ####### ####### ## ###### # ### ######## ##### #### ####### ##### ###### ###### ##### ### + ##### ################# ## ############ ###### ######### ###### ## ### # # ####### ###### ##### ####### ### ### ### #### #### # ###### + ##### ################ # ########## ####### ######## ################ #### ####### ##### ##### # ## ##### ##### ## ## ####### + ##### ############### ## #### ######## ## ###### ### ##### ############### ##### ##### ## ## #### ### ###### ##### ####### + ##### ############# ##### ###### ###### ##### ##### #### ############# ###### ###### #### ### ##### ###### ##### ##### # ###### + ####### ############ ###### ######## ### ####### # ## ## ########## # ###### ####### ###### ###### ## ### ######## # ### ### ### ### + ######### ##### ################## ## ####### ##### ### ######### #### ##### ###### ####### ########### ######## ### ## # ##### ### + ########## # ################# ####### ###### ### ########## ##### ##### # #### ## ####### ##### ###### ####### ###### #### ### ####### ###### ## + ######### ################## ###### ###### #### ######### ###### ###### #### ####### #### ##### # #### ## ### ###### #### ##### ###### ###### #### + ########## ################## ### #### # ### ########## ##### ###### ####### ####### ### ##### ###### ######## ###### ### ###### ### #### ### ##### + ########## # ############### ### # #### #### ## ########### # ##### ###### ######## ##### # ##### ### # ############ ####### # ###### #### ## ### ## ##### + ######### ## ################ #### ###### ### ################# ##### ## ## ###### ######### ### ### ## ####### ################ ####### #### ### ### #### #### + ########## ### ## ########### ######## ####### #### ################# ##### ### ######## ## ######## ##### ####### ########### #### ####### ## #### ## ##### ##### + ########## ##### ########### ########### ####### # ################## #### ###### ############ ######## ##### ###################### ###### ######## #### ##### # ##### + ######### ###### ########### ############# ###### ################## ## ####### ########## #### ##### ## ##### ###################### ###### ######## # ## ###### ### + ########## ####### ########### ############ #### ## ################## ###### ######### ### ### ##### ##### #################### ### ######## ### ###### #### +########## ####### ########### ########### # ##### ################## # ## ######### ### ## ###### #### ####### ## ###### # ####### ##### ##### #### +######## ####### ########### ###### ## ###### ################ #### ####### #### ####### ##### ## ###### ## # ###### ###### #### + ###### ###### ########### ### ### ### ####### ############## # ###### ##### ### # ####### #### ### ##### ##### ### + ##### ###### ########## ###### # ##### ####### ########## #### ###### ### ######## ####### # ###### ### #### ##### ###### + ###### ###### ########### ######## ######## ###### # ######### ##### ###### ####### ##### ######## ###### #### ####### + ##### ################# ####### ######### #### #### ####### ######## ###### ######## ### ######## ###### ### ### ###### #### + ###### ############## #### ########## # ###### ## ## ########## ###### ########## ###### ######### ###### # ### ####### + ###### ########### ## ######### ######## ########### #### ############ #### ########### ############### ####### + ###### ###### # ########## ### #### ############# # ############ ## # ########### ##### ############## + ##### ###### ######### ## ###### ################ ########## #### ########### ###################### # + ## ###### ####### ######## ########### ##### # ####### ### ######## ############# ############ ###### #### ## + #### #### ## ######### # ########### ####### ##### #### ########### #### ####### ########## ##### ##### ###### ##### + ### ## ### ##### ####### ### ########## ####### ## ##### ########### # ######### ####### ### ###### ###### ####### ###### + ####### #### ###### ###### ###### ######## ###### ### ## ############ ########## ### ### ##### ###### ##### ####### ###### + ############## ####### ###### ### ######## ###### ###### #### ## ##### ##### ########### ### ##### ### ###### ###### ##### ####### ## #### + ## # ############### ####### ##### # ######## #### ##### ####### ##### #### ##### ############ ######## ##### ###### ## ##### ##### #### ## + ######################### ## ##### # ## ######## # #### ######### ###### ############ ######### ######## ####### ##### ### ##### ###### ####### + ########################## ### ### #### ######### # ########## ####### ########### ##### ### ### ######## ###### ###### ### ###### ###### ###### + ############### ######## ###### ##### ####### ############# ####### ########### # ##### ### ## ######## ###### ####### ###### ##### ## ###### #### + ############ ########## ######## ###### ###### ## ############# ####### ############## #### ## #### ## #### ####### ##### ###### ## ###### ## ## ##### ##### #### + ########## ######### ########## ##### ###### #### ############# # ####### ###### ###### ########### ###### #### ###### ##### ### ###### ##### ###### ##### #### + ######## ######## ############ ##### ###### #### ############# ### ####### ### ####### ########### ### ####### ## ### # ## ##### ### ###### ###### ##### #### + ######## ###### ############## #### ###### ##### ############# ##### ####### ####### ########## #### ####### ### ###### ##### ##### ###### ## #### ##### #### + ######## ###### ################ ## # ########### ### ############## ######## ####### ####### ########## ####### ###### #### #### ##### ##### #### ###### # #### + ####### ###### ########## ######## ##### ## ########### #### ## ########## ######### ####### ###### #### ### ######## #### ##### ##### ## ### ##### ## ###### #### + ##### ###### ########## ######## ###### #### ########## ## #### ### ####### ######### ####### ##### ###### ## ###### ### ##### ## ##### ### ##### #### + ### ########### ######### ####### ## # ###### ###### ####### ######## ###### ####### ######## #### ### #### ###### ## ###### ## ###### ## + ########## ####### ####### #### ### ####### ### ####### ##### #### # ### ##### ######### ## ##### ## ### ##### ### ##### # ##### # ###### + # ########## ####### # ###### ##### ###### ###### ###### ###### ### ## ##### ## ## ######### ### ####### ##### ## #### ###### ### ##### #### ####### + ############# ##### ### #### ## ##### ####### ###### ####### #### ##### ## ##### ######### ## ##### ####### ####### ##### ###### ### ## ## ###### #### + ############# #### ##### # #### ## ######### ##### ####### ## ####### ####### ######### #### ##### ##### ####### ###### ### ### ###### ##### ## + ############# #### ######## ##### ######### ## ####### ######### ###### ## ## ##### ### ###### #### ## ###### ### ##### ######## ### # ## + # ########## ############ ###### ####### ##### ########### ### #### #### ###### ##### #### #### # ##### ############ ###### ### ######## ### #### + ## #### ########## ########## # #### ##### ### ### ########### ##### ## ##### ####### ##### ### ## ####### ######### ###### #### # #### #### #### + ########## ######### ######## #### # ## ### ## ##### # ########## ##### ############# ##### ### ####### ######## ##### #### ### ## ## #### ### ## + ############ ####### ##### ##### ##### # ### ####### ### #### ######### #### ############# ##### ###### #### ###### # ### # ##### ##### ## ### # ###### + ############ #### ###### ###### ###### ###### ##### #### ######## ## ############# ##### #### #### ##### ### ##### ###### ###### #### ###### + ############ ## ##### ######## ############# ####### ### ####### ########### ##### ## ## ## ### ## ##### ##### ##### ##### ### ##### ##### ## +############# ### ### ######## ####### #### ####### # ## ########## ##### # ###### ## ## ##### ####### ##### ## #### ##### ### ## ##### ##### +############ ##### ######## ######### ####### ### ############### ### #### ###### #### #### ####### ## ### ##### #### ##### # ##### ### ## ###### +######## ### ###### ######## ##### ##### ########### ######### ###### ##### #### ##### ####### ##### ########## ### ### #### #### # ##### ###### + #### #### ###### ####### # ### # ### ########## ######## ## ###### #### ###### ########### ##### ## #### ##### ## #### # ### ###### #### + # ##### ###### ## ######## #### # ### ### ########## ## #### ##### ###### #### ######## ## ###### ##### ## #### # #### ###### ######## ## + #### ####### #### ######## ##### ##### ##### ######### ## ####### ### # ############# ###### ##### ### ##### ###### # ########## + ### # ###### ###### ######## ### #### ##### ###### ##### ########## # ### ############### ##### ## ## ## #### ####### #### ########## + #### ## ############# ######## ### ##### #### ##### #### ########## ##### ### ####### ### ## ### ### # ##### # ##### ###### ######### + # ##### ### ############ ######## #### ##### ## #### ## ########## ##### ## ######## ###### ##### #### ### # ### ##### ## ###### ######## ### + ### #### ##### ########### ######## ##### #### ## ########## #### ###### ##### ###### ### ###### ### #### ##### ### ###### ##### #### + #### # ###### ######## ######## ######### ## #### ##### ### ## ##### ### ##### ###### # ## ##### ##### #### ##### ## #### ### ##### +# ##### #### ###### ######## #### ## #### ###### ####### ###### #### ### ### ##### ###### ### ######## #### ##### #### ##### #### ## # ## # ###### +# ### ### ## #### ####### #### ##### ## ####### ### # ###### ###### ######## ####### ##### ## ######### ##### #### ## ##### ##### ##### #### ### ##### # +# ##### ## ## ###### ### ### ####### #### ######## ##### ### ####### ##### ######## ####### ##### ######### #### # ###### ##### ## ##### #### ###### ## ## +# ####### #### ### # ###### ####### ##### ####### ##### ##### ######### ## ### ######## ####### ###### # ######## ## ##### ##### ##### #### #### ### ###### ## # + ####### #### ## # ### ####### ## ###### #### ####### #### ###### ########## ##### ## ### ######### ########## #### ### ##### ####### ### ## ##### #### ##### + ##### ##### ##### ##### ######### #### ##### #### #### ### ##### ########## ###### ## ######### #### ##### ## ### ####### ####### ## ###### + ## ### ## ####### # ############## ##### ### ##### ## ### ### ########## ##### ########## ## ###### #### ######## ###### ####### + #### ##### ######## #### ############ # #### ###### ##### # ########## ##### ########## ######## ###### ###### ##### ##### + ### #### ##### ######### ##### ########## #### ##### ## ##### ######### ##### ########### ####### ###### # #### ## ### + ######### #### ##### ######### ######## ####### ###### ### #### ## ##### ######## ###### ## ####### ##### #### ### # + ############## ## #### ######### ########## ####### ###### # # ######## #### ## #### ## ### #### ##### ## ####### ### ## #### + ################### ## ### ## # ######### ########### ####### ##### ### ### ##### ###### #### # #### ## ## ### #### ####### #### + ##################### #### #### ### ####### ############ ###### ## ###### ##### ### ###### #### #### ### #### # ##### # ####### # ## + ##################### ##### #### ###### ###### ########### ####### ######## ####### # ## ###### ### #### #### ###### ########## ###### #### + ###################### ##### # ######## ### ############ ####### ## ####### ###### #### ##### ## ### ## ### ####### ########## ##### ##### + ###################### ### ######### # ########### ###### ##### ###### #### ###### ## #### # #### ## ##### ########## ###### #####