Odilitime 5 years ago
parent
commit
ead9f69fd8
  1. 4
      src/graphics/components/AnimeComponent.cpp
  2. 1
      src/graphics/components/Component.cpp
  3. 26
      src/networking/HTTPRequest.cpp
  4. 28
      visualc/NetRunner.sln

4
src/graphics/components/AnimeComponent.cpp

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
#include "AnimeComponent.h"
#ifndef _MSC_VER
#include "../../../anime.h"
#endif
#include <cmath>
AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int passedWindowWidth, const int passedWindowHeight) : BoxComponent(rawX, rawY, rawWidth, rawHeight, passedWindowWidth, passedWindowHeight){
@ -8,6 +10,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r @@ -8,6 +10,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r
width = rawWidth;
height = rawHeight;
#ifndef _MSC_VER
if (width == 512) {
for (int py = 0; py < 1024; py++) {
for (int px = 0; px < 1024; px++) {
@ -17,6 +20,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r @@ -17,6 +20,7 @@ AnimeComponent::AnimeComponent(const float rawX, const float rawY, const float r
}
}
}
#endif
float vx = rawX;
float vy = rawY;

1
src/graphics/components/Component.cpp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "Component.h"
#include <iostream>
#include <algorithm>
#include "TextComponent.h"
Component::~Component() {

26
src/networking/HTTPRequest.cpp

@ -1,13 +1,35 @@ @@ -1,13 +1,35 @@
#include "HTTPRequest.h"
#include <errno.h>
#include <iostream>
#include <netdb.h>
#include <string.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN 1
#include <winsock2.h>
#include <windows.h>
#include <WS2tcpip.h>
#define ssize_t intptr_t
#else
// unix includes here
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#endif
#ifdef WIN32
// Initialize Winsock
WSADATA wsaData;
int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif
HTTPRequest::HTTPRequest(const std::string &hostName, const std::string &doc) {
document = doc;
#ifdef WIN32
if (iResult != 0) {
std::cout << "WSAStartup failed: " << iResult << std::endl;
return;
}
#endif
document = doc;
version = Version::HTTP10;
method = Method::GET;
host = hostName;

28
visualc/NetRunner.sln

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetRunner", "NetRunner\NetRunner.vcxproj", "{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Debug|x64.ActiveCfg = Debug|x64
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Debug|x64.Build.0 = Debug|x64
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Debug|x86.ActiveCfg = Debug|Win32
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Debug|x86.Build.0 = Debug|Win32
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Release|x64.ActiveCfg = Release|x64
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Release|x64.Build.0 = Release|x64
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Release|x86.ActiveCfg = Release|Win32
{0ECC8CA1-2094-4A51-BD89-8AEC9A6B6A43}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading…
Cancel
Save