mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-06 08:43:02 +00:00
mymake now works with Emscripten
This commit is contained in:
23
hyperweb.cpp
23
hyperweb.cpp
@@ -2,19 +2,14 @@
|
||||
// This is the main file when the online version of HyperRogue is compiled with Emscripten.
|
||||
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
|
||||
|
||||
#ifndef ISWEB
|
||||
#define ISWEB 1
|
||||
#define ISMINI 0
|
||||
#define CAP_AUDIO 0
|
||||
#define CAP_SDLGFX 0
|
||||
#define CAP_PNG 0
|
||||
#define CAP_TOUR 1
|
||||
#define CAP_SDLTTF 0
|
||||
#define CAP_SHMUP 0
|
||||
#define CAP_RUG 1
|
||||
#define CAP_INV 0
|
||||
#define CAP_URL 1
|
||||
#define GLES_ONLY
|
||||
#define CAP_COMPLEX2 1
|
||||
#define SCU
|
||||
#endif
|
||||
|
||||
#if CAP_ROGUEVIZ
|
||||
#define MAXMDIM 4
|
||||
@@ -53,7 +48,11 @@ namespace hr {
|
||||
void offer_download(std::string sfilename, std::string smimetype);
|
||||
}
|
||||
|
||||
#ifdef SCU
|
||||
#include "hyper.cpp"
|
||||
#else
|
||||
#include "hyper.h"
|
||||
#endif
|
||||
|
||||
namespace hr {
|
||||
|
||||
@@ -72,7 +71,7 @@ string get_value(string name) {
|
||||
return res;
|
||||
}
|
||||
|
||||
void offer_download(string sfilename, string smimetype) {
|
||||
EX void offer_download(string sfilename, string smimetype) {
|
||||
|
||||
EM_ASM({
|
||||
var name = UTF8ToString($0, $1);
|
||||
@@ -105,7 +104,7 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
void offer_choose_file(reaction_t r) {
|
||||
EX void offer_choose_file(reaction_t r) {
|
||||
on_use_file = r;
|
||||
EM_ASM({
|
||||
fileElem.click();
|
||||
@@ -221,7 +220,7 @@ EM_BOOL fsc_callback(int eventType, const EmscriptenFullscreenChangeEvent *fulls
|
||||
return true;
|
||||
}
|
||||
|
||||
void initweb() {
|
||||
EX void initweb() {
|
||||
// toggleanim(false);
|
||||
emscripten_set_fullscreenchange_callback(0, NULL, false, fsc_callback);
|
||||
printf("showstartmenu = %d\n", showstartmenu);
|
||||
@@ -241,7 +240,7 @@ transmatrix getOrientation() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void emscripten_get_commandline() {
|
||||
EX void emscripten_get_commandline() {
|
||||
#ifdef EMSCRIPTEN_FIXED_ARG
|
||||
string s = EMSCRIPTEN_FIXED_ARG;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user