1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-05-21 05:22:07 +00:00

made it compile with RUG on emscripten (at least it should -- it does not work for me because of an emscripten bug apparently)

This commit is contained in:
Zeno Rogue
2018-02-03 14:31:17 +01:00
parent 84b7f73920
commit ad172724e8
10 changed files with 59 additions and 38 deletions
+30 -33
View File
@@ -21,6 +21,36 @@ namespace mapeditor {
} ew, ewsearch;
bool autochoose = ISMOBILE;
void scaleall(ld z) {
// (mx,my) = (xcb,ycb) + ss * (xpos,ypos) + (mrx,mry) * scale
// (mrx,mry) * (scale-scale') =
// ss * ((xpos',ypos')-(xpos,ypos))
// mx = xb + ssiz*xpos + mrx * scale
// mx = xb + ssiz*xpos' + mrx * scale'
ld mrx = (.0 + mousex - vid.xcenter) / vid.scale;
ld mry = (.0 + mousey - vid.ycenter) / vid.scale;
if(vid.xres > vid.yres) {
vid.xposition += (vid.scale - vid.scale*z) * mrx / vid.scrsize;
vid.yposition += (vid.scale - vid.scale*z) * mry / vid.scrsize;
}
vid.scale *= z;
printf("scale = " LDF "\n", vid.scale);
#if CAP_TEXTURE
texture::itt = xyscale(texture::itt, 1/z);
display(texture::itt);
if(texture::tstate) {
calcparam();
texture::perform_mapping();
}
#endif
}
#if CAP_EDIT
map<int, cell*> modelcell;
@@ -427,9 +457,6 @@ namespace mapeditor {
bool choosefile = false;
#define CDIR 0xC0C0C0
#define CFILE forecolor
void displayFunctionKeys() {
int fs = min(vid.fsize + 5, vid.yres/26);
displayButton(8, vid.yres-8-fs*11, XLAT("F1 = help"), SDLK_F1, 0);
@@ -1348,36 +1375,6 @@ namespace mapeditor {
return true;
}
void scaleall(ld z) {
// (mx,my) = (xcb,ycb) + ss * (xpos,ypos) + (mrx,mry) * scale
// (mrx,mry) * (scale-scale') =
// ss * ((xpos',ypos')-(xpos,ypos))
// mx = xb + ssiz*xpos + mrx * scale
// mx = xb + ssiz*xpos' + mrx * scale'
ld mrx = (.0 + mousex - vid.xcenter) / vid.scale;
ld mry = (.0 + mousey - vid.ycenter) / vid.scale;
if(vid.xres > vid.yres) {
vid.xposition += (vid.scale - vid.scale*z) * mrx / vid.scrsize;
vid.yposition += (vid.scale - vid.scale*z) * mry / vid.scrsize;
}
vid.scale *= z;
printf("scale = " LDF "\n", vid.scale);
#if CAP_TEXTURE
texture::itt = xyscale(texture::itt, 1/z);
display(texture::itt);
if(texture::tstate) {
calcparam();
texture::perform_mapping();
}
#endif
}
hyperpoint lstart;
cell *lstartcell;