mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Patched fcs, parse_imagepath extensions
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -96,15 +97,10 @@ double getSolution(double initSpeed, double airFriction, double angleTarget, dou
|
|||||||
return a2 - angleTarget;
|
return a2 - angleTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
// i like to live dangerously. jk, fix strncpy sometime pls.
|
|
||||||
#pragma warning( push )
|
|
||||||
#pragma warning( disable : 4996 )
|
|
||||||
|
|
||||||
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
||||||
ZERO_OUTPUT();
|
ZERO_OUTPUT();
|
||||||
|
|
||||||
if (!strcmp(function, "version")) {
|
if (!strcmp(function, "version")) {
|
||||||
strncpy(output, ACE_FULL_VERSION_STR, outputSize);
|
strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE);
|
||||||
} else {
|
} else {
|
||||||
std::vector<std::string> argStrings = splitString(function);
|
std::vector<std::string> argStrings = splitString(function);
|
||||||
double initSpeed = std::stod(argStrings[0]);
|
double initSpeed = std::stod(argStrings[0]);
|
||||||
@ -117,10 +113,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
|||||||
std::stringstream sstream;
|
std::stringstream sstream;
|
||||||
sstream << result;
|
sstream << result;
|
||||||
|
|
||||||
strcpy(output, sstream.str().c_str());
|
strncpy_s(output, outputSize, sstream.str().c_str(), _TRUNCATE);
|
||||||
output[outputSize - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
EXTENSION_RETURN();
|
EXTENSION_RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning( pop )
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "shared.hpp"
|
#include "shared.hpp"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -36,19 +37,12 @@ std::string getImagePathFromStructuredText(const std::string & input) {
|
|||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// i like to live dangerously. jk, fix strncpy sometime pls.
|
|
||||||
#pragma warning( push )
|
|
||||||
#pragma warning( disable : 4996 )
|
|
||||||
|
|
||||||
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
||||||
ZERO_OUTPUT();
|
ZERO_OUTPUT();
|
||||||
if (!strcmp(function, "version")) {
|
if (!strcmp(function, "version")) {
|
||||||
strncpy(output, ACE_FULL_VERSION_STR, outputSize);
|
strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE);
|
||||||
} else {
|
} else {
|
||||||
strncpy(output, getImagePathFromStructuredText(function).c_str(), outputSize);
|
strncpy_s(output, outputSize, getImagePathFromStructuredText(function).c_str(), _TRUNCATE);
|
||||||
output[outputSize - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
EXTENSION_RETURN();
|
EXTENSION_RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning( pop )
|
|
||||||
|
Reference in New Issue
Block a user