Skip to content

Commit

Permalink
SetCalculationRatio added (calculation ratio is 800 x 600 by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrippa1994 committed Feb 28, 2015
1 parent d43e344 commit 0b03d9c
Show file tree
Hide file tree
Showing 40 changed files with 494 additions and 469 deletions.
Binary file modified bin/dx9_overlay.dll
Binary file not shown.
Binary file modified bin/dx9_overlay.exp
Binary file not shown.
Binary file modified bin/dx9_overlay.lib
Binary file not shown.
9 changes: 9 additions & 0 deletions include/ahk/overlay.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ HideAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "HideAllVi
GetFrameRate_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetFrameRate")
GetScreenSpecs_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetScreenSpecs")

SetCalculationRatio_func:= DllCall("GetProcAddress", UInt, hModule, Str, "SetCalculationRatio")

Init()
{
global Init_func
Expand Down Expand Up @@ -306,6 +308,13 @@ GetScreenSpecs(ByRef width, ByRef height)
return res
}

SetCalculationRatio(width, height)
{
global SetCalculationRatio_func
res := DllCall(SetCalculationRatio_func, Int, width, Int, height);
return res
}

RelToAbs(root, dir, s = "\") {
pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
, root := SubStr(root, len + 1), sk := 0
Expand Down
5 changes: 4 additions & 1 deletion include/c#/Overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ class DX9Overlay
[DllImport(PATH, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetScreenSpecs(out int width, out int height);

[DllImport(PATH, CallingConvention = CallingConvention.Cdecl)]
public static extern int SetCalculationRatio(int width, int height);

[DllImport(PATH, CallingConvention = CallingConvention.Cdecl)]
public static extern int Init();
[DllImport(PATH, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetParam(string _szParamName, string _szParamValue);

}
}

4 changes: 3 additions & 1 deletion include/c++/overlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ IMPORT int HideAllVisual();
IMPORT int GetFrameRate();
IMPORT int GetScreenSpecs(int& width, int& height);

IMPORT int SetCalculationRatio(int width, int height);

IMPORT int Init();
IMPORT void SetParam(const char *_szParamName, const char *_szParamValue);
IMPORT void SetParam(const char *_szParamName, const char *_szParamValue);
8 changes: 4 additions & 4 deletions src/dx9_overlay/Client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ stParamInfo g_paramArray[3] =

bool IsServerAvailable()
{
CSerializer bsIn, bsOut;
Serializer bsIn, bsOut;

bsIn << PipeMessages::Ping;

return CNamedPipeClient(bsIn, bsOut).Success();
return PipeClient(bsIn, bsOut).success();
}

EXPORT void SetParam(char *_szParamName, char *_szParamValue)
Expand Down Expand Up @@ -61,12 +61,12 @@ EXPORT int Init()
if (!atoi(GetParam("use_window").c_str()))
{
std::string szSearchName = GetParam("process");
dwPId = GetProcIdByProcName(szSearchName);
dwPId = procIdByProcName(szSearchName);
}
else
{
std::string szSearchName = GetParam("window");
dwPId = GetProcIdByWindowName(szSearchName);
dwPId = procIdByWindowName(szSearchName);
}

if (dwPId == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/dx9_overlay/Client/Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Utils/Windows.h>
#include <Utils/NamedPipeClient.h>
#include <Utils/PipeClient.h>
#include <Utils/Bitstream.h>

#define EXPORT extern "C" __declspec(dllexport)
Expand Down
Loading

0 comments on commit 0b03d9c

Please sign in to comment.