Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/enigma-dev/enigma-dev int…

…o generic-render-state
  • Loading branch information...
RobertBColton committed Mar 22, 2019
2 parents 654f10f + 780ffe9 commit 70b194334b0572908b75255883058a041c62f454
@@ -34,23 +34,21 @@
#include <string>
#include <vector>
#include <map>
#include <sstream> // std::stringstream
#include <fstream> // std::ifstream
#include <iostream> // std::cerr

inline std::string fc(const char* fn) {
FILE* pt = fopen(fn, "rb");
if (pt == NULL)
std::ifstream t(fn);

if (!t.is_open()) {
std::cerr << "Failed to open " << fn << std::endl;
return "";
else {
fseek(pt, 0, SEEK_END);
size_t sz = ftell(pt);
fseek(pt, 0, SEEK_SET);

char a[sz + 1];
sz = fread(a, 1, sz, pt);
fclose(pt);

a[sz] = 0;
return a;
}

std::stringstream buffer;
buffer << t.rdbuf();
return buffer.str();
}

inline int rdir_system(std::string x, std::string y) { return system((x + " " + y).c_str()); }
@@ -230,11 +230,10 @@ void display_reset(int samples, bool vsync) {
enigma::Reset(&d3dpp);
}

void set_synchronization(bool enable)
{
void set_synchronization(bool enable) {
D3DPRESENT_PARAMETERS d3dpp;
get_d3d_present_params(&d3dpp);
d3dpp.PresentationInterval = enable ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.PresentationInterval = enable?D3DPRESENT_INTERVAL_DEFAULT:D3DPRESENT_INTERVAL_IMMEDIATE;

enigma::Reset(&d3dpp);
}
@@ -29,19 +29,19 @@
#define X86_WIN32
#endif

#include <map>
#include <string>
#include <windows.h>

#include <ffi.h>
#include "Universal_System/var4.h"
#include "Universal_System/estring.h"

#include "Platforms/platforms_mandatory.h"
#include "Widget_Systems/widgets_mandatory.h"
#include "Platforms/General/PFexternals.h"

#include <vector>
#include <cstdio>
#include <map>
#include <string>
#include <windows.h>
#include <ffi.h>

using namespace std;

@@ -159,8 +159,8 @@ variant external_call(int id,variant a1,variant a2, variant a3, variant a4, vari
}
external* a=it->second;

ambiguous array[a->argc];
void *arg_values[a->argc];
std::vector<ambiguous> array(a->argc);
std::vector<void *> arg_values(a->argc);

variant args[] = { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 };
for (int i = 0; i < a->argc; ++i)
@@ -175,7 +175,7 @@ variant external_call(int id,variant a1,variant a2, variant a3, variant a4, vari
}

ambiguous result;
ffi_call(&(a->cif), a->functionptr, &result, arg_values);
ffi_call(&(a->cif), a->functionptr, &result, arg_values.data());
if (a->restype==ty_string) return result.s;
return result.d;
}

0 comments on commit 70b1943

Please sign in to comment.
You can’t perform that action at this time.