1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-05-07 17:54:07 +00:00

hyperweb compiles

This commit is contained in:
Zeno Rogue 2019-09-13 03:47:55 +02:00
parent 978022025a
commit 334ffd644a
4 changed files with 20 additions and 1 deletions

View File

@ -358,7 +358,12 @@ void display_data::set_projection(int ed) {
} }
println(hlog, "maxd = ", maxd); println(hlog, "maxd = ", maxd);
#if !ISWEB
glTexImage3D(GL_TEXTURE_3D, 0, 34836 /*GL_RGBA32F*/, PRECX, PRECX, PRECZ, 0, GL_RGBA, GL_FLOAT, xbuffer); glTexImage3D(GL_TEXTURE_3D, 0, 34836 /*GL_RGBA32F*/, PRECX, PRECX, PRECZ, 0, GL_RGBA, GL_FLOAT, xbuffer);
#else
// glTexStorage3D(GL_TEXTURE_3D, 1, 34836 /*GL_RGBA32F*/, PRECX, PRECX, PRECZ);
// glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0, PRECX, PRECY, PRECZ, GL_RGBA, GL_FLOAT, xbuffer);
#endif
delete[] xbuffer; delete[] xbuffer;
} }

View File

@ -48,7 +48,7 @@ namespace hr {
const char *wheresounds; const char *wheresounds;
} }
#include "hyper.h" #include "hyper.cpp"
namespace hr { namespace hr {

View File

@ -1076,7 +1076,11 @@ EX namespace slr {
" float mina = 0.;" " float mina = 0.;"
" float maxa = PI/4.;" " float maxa = PI/4.;"
" lo_gphi = 0.; lo_s = r; lo_alpha = 0.;" " lo_gphi = 0.; lo_s = r; lo_alpha = 0.;"
#if ISWEB
" for(int it=0; it<50; it++) { if(it >= uIterations) break; "
#else
" for(int it=0; it<uIterations; it++) {" " for(int it=0; it<uIterations; it++) {"
#endif
" alpha = (mina + maxa) / 2.;" " alpha = (mina + maxa) / 2.;"
" c = sqrt(cos(2. * alpha));" " c = sqrt(cos(2. * alpha));"
" s = asinh(sinh(r) / cos(alpha) * c) / c;" " s = asinh(sinh(r) / cos(alpha) * c) / c;"
@ -1090,7 +1094,11 @@ EX namespace slr {
" int next_nan = 1;" " int next_nan = 1;"
" float mina = PI/4.;" " float mina = PI/4.;"
" float maxa = PI/2.;" " float maxa = PI/2.;"
#if ISWEB
" for(int it=0; it<50; it++) { if(it >= uIterations) break; "
#else
" for(int it=0; it<uIterations; it++) {" " for(int it=0; it<uIterations; it++) {"
#endif
" alpha = (mina + maxa) / 2.;" " alpha = (mina + maxa) / 2.;"
" c = sqrt(-cos(2. * alpha));" " c = sqrt(-cos(2. * alpha));"
" if(sinh(r) * c > bound * cos(alpha)) { next_nan = 1; maxa = alpha; continue; }" " if(sinh(r) * c > bound * cos(alpha)) { next_nan = 1; maxa = alpha; continue; }"
@ -1101,7 +1109,11 @@ EX namespace slr {
" }" " }"
" if(next_nan != 0) {" " if(next_nan != 0) {"
" mina = PI/4.; " " mina = PI/4.; "
#if ISWEB
" for(int it=0; it<50; it++) { if(it >= uIterations) break; "
#else
" for(int it=0; it<uIterations; it++) {" " for(int it=0; it<uIterations; it++) {"
#endif
" alpha = (mina + maxa) / 2.;" " alpha = (mina + maxa) / 2.;"
" c = sqrt(-cos(2. * alpha));" " c = sqrt(-cos(2. * alpha));"
" float z = sinh(r) * c / cos(alpha);" " float z = sinh(r) * c / cos(alpha);"

View File

@ -695,6 +695,8 @@ void init() {
bool ball = (sp == shader_projection::ball); bool ball = (sp == shader_projection::ball);
bool flatten = (sp == shader_projection::flatten); bool flatten = (sp == shader_projection::flatten);
if(ssol && ISWEB) continue;
programs[i][j] = new GLprogram(stringbuilder( programs[i][j] = new GLprogram(stringbuilder(
1, "#define PI 3.14159265358979324\n", 1, "#define PI 3.14159265358979324\n",