FINALLY fixed the bug that caused rendering to suck
This commit is contained in:
parent
a5416d098c
commit
afdd6589a7
|
|
@ -288,28 +288,55 @@ WASM_IMPORT_IMPL(env, __emscripten_get_now_is_monotonic) = []() {
|
||||||
/* __gmtime_js */
|
/* __gmtime_js */
|
||||||
WASM_IMPORT_IMPL(env, __gmtime_js) = [](u32 a, u32 b) {
|
WASM_IMPORT_IMPL(env, __gmtime_js) = [](u32 a, u32 b) {
|
||||||
// FIXME:
|
// FIXME:
|
||||||
// puts("__gmtime_js is not implemented yet.");
|
auto& t = fugg::module_ref<const time_t>(a);
|
||||||
|
const auto& info = gmtime(&t);
|
||||||
|
|
||||||
|
auto& result = fugg::module_ref<tm>(b);
|
||||||
|
result.tm_sec = info->tm_sec;
|
||||||
|
result.tm_min = info->tm_min;
|
||||||
|
result.tm_hour = info->tm_hour;
|
||||||
|
result.tm_mday = info->tm_mday;
|
||||||
|
result.tm_mon = info->tm_mon;
|
||||||
|
result.tm_year = info->tm_year;
|
||||||
|
result.tm_wday = info->tm_wday;
|
||||||
|
result.tm_yday = info->tm_yday;
|
||||||
};
|
};
|
||||||
/* import: 'a' 'Kb' */
|
/* import: 'a' 'Kb' */
|
||||||
/* __localtime_js */
|
/* __localtime_js */
|
||||||
WASM_IMPORT_IMPL(env, __localtime_js) = [](u32 a, u32 b) {
|
WASM_IMPORT_IMPL(env, __localtime_js) = [](u32 a, u32 b) {
|
||||||
// FIXME:
|
// FIXME:
|
||||||
// puts("__localtime_js is not implemented yet.");
|
auto& t = fugg::module_ref<const time_t>(a);
|
||||||
|
const auto& info = gmtime(&t);
|
||||||
|
|
||||||
|
auto& result = fugg::module_ref<tm>(b);
|
||||||
|
result.tm_sec = info->tm_sec;
|
||||||
|
result.tm_min = info->tm_min;
|
||||||
|
result.tm_hour = info->tm_hour;
|
||||||
|
result.tm_mday = info->tm_mday;
|
||||||
|
result.tm_mon = info->tm_mon;
|
||||||
|
result.tm_year = info->tm_year;
|
||||||
|
result.tm_wday = info->tm_wday;
|
||||||
|
result.tm_yday = info->tm_yday;
|
||||||
|
result.tm_isdst = info->tm_isdst;
|
||||||
|
result.tm_gmtoff = info->tm_gmtoff;
|
||||||
};
|
};
|
||||||
/* import: 'a' 'Lb' */
|
/* import: 'a' 'Lb' */
|
||||||
/* __mktime_js */
|
/* __mktime_js */
|
||||||
WASM_IMPORT_IMPL(env, __mktime_js) = [](u32 a) {
|
WASM_IMPORT_IMPL(env, __mktime_js) = [](u32 a) {
|
||||||
// FIXME:
|
// FIXME:
|
||||||
// puts("__mktime_js is not implemented yet.");
|
// puts("__mktime_js is not implemented yet.");
|
||||||
|
auto& t = fugg::module_ref<tm>(a);
|
||||||
|
|
||||||
return static_cast<u32>(0);
|
auto result = mktime(&t);
|
||||||
|
|
||||||
|
return static_cast<u32>(result);
|
||||||
};
|
};
|
||||||
/* import: 'a' 'Mb' */
|
/* import: 'a' 'Mb' */
|
||||||
/* __tzset_js */
|
/* __tzset_js */
|
||||||
WASM_IMPORT_IMPL(env, __tzset_js) = [](u32 a, u32 b, u32 c) {
|
WASM_IMPORT_IMPL(env, __tzset_js) = [](u32 a, u32 b, u32 c) {
|
||||||
// FIXME:
|
// FIXME:
|
||||||
// puts("__tzset_js is not implemented yet.");
|
// Not sure if this is correct...
|
||||||
|
tzset();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* import: 'a' 'Rb' */
|
/* import: 'a' 'Rb' */
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ WASM_IMPORT_IMPL(env, _glBindFramebuffer) = [](u32 a, u32 b) {
|
||||||
/* import: 'a' 'D' */
|
/* import: 'a' 'D' */
|
||||||
/* _glDrawElements */
|
/* _glDrawElements */
|
||||||
WASM_IMPORT_IMPL(env, _glDrawElements) = [](u32 a, u32 b, u32 c, u32 d) {
|
WASM_IMPORT_IMPL(env, _glDrawElements) = [](u32 a, u32 b, u32 c, u32 d) {
|
||||||
const auto& indices = fugg::ModulePointer<const void*>(d);
|
const auto& indices = reinterpret_cast<const void*>(d);
|
||||||
|
|
||||||
#if TRACE_GL_CALLS
|
#if TRACE_GL_CALLS
|
||||||
std::cout << "_glDrawElements("
|
std::cout << "_glDrawElements("
|
||||||
|
|
|
||||||
Reference in New Issue