Skip to content
This repository has been archived by the owner on Oct 13, 2019. It is now read-only.

Commit

Permalink
General fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CTurt committed Sep 6, 2015
1 parent bc4e333 commit 52ffb97
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 124 deletions.
2 changes: 1 addition & 1 deletion PC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SDIR := source
IDIR := include
LDIR := lib
CFLAGS := -I$(IDIR) -fms-extensions -O2 -Wall
LFLAGS := -L$(LDIR) -lvJoyInterface -lws2_32 -lGdi32 -lgdiplus -static-libgcc -static-libstdc++
LFLAGS := $(LDIR)/vJoyInterface.lib -lws2_32 -lGdi32 -lgdiplus -static-libgcc
CFILES := $(wildcard $(SDIR)/*.c)
CPPFILES := $(wildcard $(SDIR)/*.cpp)
OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c))
Expand Down
2 changes: 2 additions & 0 deletions PC/include/keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#define KEYEVENTF_SCANCODE 0x08
#endif

#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
#endif

#define newpress(key) ((currentKeys & key) && !(lastKeys & key))
#define release(key) (!(currentKeys & key) && (lastKeys & key))
Expand Down
16 changes: 0 additions & 16 deletions PC/include/screenshot.h

This file was deleted.

5 changes: 0 additions & 5 deletions PC/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "joystick.h"
#include "settings.h"
#include "keyboard.h"
#include "screenshot.h"

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) {
printf("3DS Controller Server %.1f\n", VERSION);
Expand All @@ -23,8 +22,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
double widthMultiplier = screenWidth / 320.0;
double heightMultiplier = screenHeight / 240.0;

//screenshot(SCREENSHOT_NAMEL, TRUE, 0, 0, 18);

bool vJoy = true;
UINT iInterface = 1;

Expand Down Expand Up @@ -221,8 +218,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
}

if(vJoy) updateJoystick();

//sendScreenshot();
}

error("accept()");
Expand Down
80 changes: 0 additions & 80 deletions PC/source/screenshot.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions PC/source/wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "general.h"

#include "settings.h"
#include "screenshot.h"

#include "wireless.h"

Expand Down Expand Up @@ -79,24 +78,3 @@ void sendBuffer(int length) {
int receiveBuffer(int length) {
return recvfrom(listener, (char *)&buffer, length, 0, (struct sockaddr *)&client_in, &sockaddr_in_sizePtr);
}

void sendScreenshot(void) {
FILE *f = fopen(SCREENSHOT_NAME, "rb");
fseek(f, 0, SEEK_END);
size_t len = ftell(f);
unsigned char *screenshotData = malloc(len);
rewind(f);
fread(screenshotData, len, 1, f);
fclose(f);

buffer.command = SCREENSHOT;

while(1) {
int tl = len - buffer.offset > SCREENSHOT_CHUNK ? SCREENSHOT_CHUNK : len - buffer.offset;
memcpy(buffer.data, screenshotData + buffer.offset, tl);
sendBuffer(tl + offsetof(struct packet, screenshotPacket));
if(tl < SCREENSHOT_CHUNK) break;
}

free(screenshotData);
}

0 comments on commit 52ffb97

Please sign in to comment.