mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
removed init.cpp
This commit is contained in:
parent
9df8f76b53
commit
98ddecc63e
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
|
EX int fontscale = 100;
|
||||||
|
|
||||||
#if HDR
|
#if HDR
|
||||||
/** configuration of the current view */
|
/** configuration of the current view */
|
||||||
struct display_data {
|
struct display_data {
|
||||||
|
@ -3350,7 +3350,7 @@ EX colortable nestcolors = { 0x800000, 0x008000, 0x000080, 0x404040, 0x700070, 0
|
|||||||
|
|
||||||
color_t floorcolors[landtypes];
|
color_t floorcolors[landtypes];
|
||||||
|
|
||||||
void init_floorcolors() {
|
EX void init_floorcolors() {
|
||||||
for(int i=0; i<landtypes; i++)
|
for(int i=0; i<landtypes; i++)
|
||||||
floorcolors[i] = linf[i].color;
|
floorcolors[i] = linf[i].color;
|
||||||
|
|
||||||
|
@ -27,6 +27,10 @@ EX FILE *debugfile;
|
|||||||
#define DF_KEYS "imwesxufgbtopl"
|
#define DF_KEYS "imwesxufgbtopl"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EX int debugflags = DF_INIT | DF_ERROR | DF_WARN | DF_MSG | DF_TIME | DF_LOG;
|
||||||
|
|
||||||
|
EX string s0;
|
||||||
|
|
||||||
EX string its(int i) { char buf[64]; sprintf(buf, "%d", i); return buf; }
|
EX string its(int i) { char buf[64]; sprintf(buf, "%d", i); return buf; }
|
||||||
|
|
||||||
EX string itsh8(int i) {static char buf[16]; sprintf(buf, "%08X", i); return buf; }
|
EX string itsh8(int i) {static char buf[16]; sprintf(buf, "%08X", i); return buf; }
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* \brief the hyper_main function
|
* \brief the hyper_main function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "init.cpp"
|
#include "compileunits.h"
|
||||||
|
|
||||||
#if CU_HYPER
|
#if CU_HYPER
|
||||||
|
|
||||||
|
@ -5,69 +5,9 @@
|
|||||||
* \brief initialization, and stuff related to mobiles
|
* \brief initialization, and stuff related to mobiles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "compileunits.h"
|
|
||||||
|
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
#if CU_INIT
|
#if CU_INIT
|
||||||
EX int fontscale = 100;
|
|
||||||
|
|
||||||
EX int debugflags = DF_INIT | DF_ERROR | DF_WARN | DF_MSG | DF_TIME | DF_LOG;
|
|
||||||
|
|
||||||
EX string s0;
|
|
||||||
|
|
||||||
EX bool fixseed = false;
|
|
||||||
EX int startseed = 0;
|
|
||||||
|
|
||||||
EX eLand firstland0;
|
|
||||||
|
|
||||||
EX void initAll() {
|
|
||||||
init_floorcolors();
|
|
||||||
showstartmenu = true;
|
|
||||||
ca::init();
|
|
||||||
#if CAP_COMMANDLINE
|
|
||||||
arg::read(1);
|
|
||||||
#endif
|
|
||||||
srand(time(NULL));
|
|
||||||
shrand(fixseed ? startseed : time(NULL));
|
|
||||||
|
|
||||||
achievement_init(); // not in ANDROID
|
|
||||||
|
|
||||||
firstland0 = firstland;
|
|
||||||
|
|
||||||
// initlanguage();
|
|
||||||
initgraph();
|
|
||||||
#if CAP_SAVE
|
|
||||||
loadsave();
|
|
||||||
if(IRREGULAR) irr::auto_creator();
|
|
||||||
#endif
|
|
||||||
start_game();
|
|
||||||
|
|
||||||
if(!shmup::on) {
|
|
||||||
restoreGolems(items[itOrbLife], moGolem); items[itOrbLife] = 0;
|
|
||||||
restoreGolems(items[itOrbFriend], moTameBomberbird); items[itOrbFriend] = 0;
|
|
||||||
restoreGolems(kills[moPrincessMoved], moPrincess, princess::saveHP); kills[moPrincessMoved] = 0;
|
|
||||||
restoreGolems(kills[moPrincessArmedMoved], moPrincessArmed, princess::saveArmedHP); kills[moPrincessArmedMoved] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
firstland = firstland0;
|
|
||||||
polygonal::solve();
|
|
||||||
}
|
|
||||||
|
|
||||||
EX void finishAll() {
|
|
||||||
achievement_final(!items[itOrbSafety]);
|
|
||||||
|
|
||||||
#if CAP_SAVE
|
|
||||||
saveStats();
|
|
||||||
#endif
|
|
||||||
offscreen.clear();
|
|
||||||
clearMemory();
|
|
||||||
#if ISMOBILE==0
|
|
||||||
cleargraph();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
achievement_close();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ISANDROID
|
#if ISANDROID
|
||||||
string buildScoreDescription() {
|
string buildScoreDescription() {
|
54
system.cpp
54
system.cpp
@ -1417,6 +1417,60 @@ EX void clearMemory() {
|
|||||||
callhooks(clearmemory);
|
callhooks(clearmemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX bool fixseed = false;
|
||||||
|
EX int startseed = 0;
|
||||||
|
|
||||||
|
EX eLand firstland0;
|
||||||
|
|
||||||
|
EX void initAll() {
|
||||||
|
init_floorcolors();
|
||||||
|
showstartmenu = true;
|
||||||
|
ca::init();
|
||||||
|
#if CAP_COMMANDLINE
|
||||||
|
arg::read(1);
|
||||||
|
#endif
|
||||||
|
srand(time(NULL));
|
||||||
|
shrand(fixseed ? startseed : time(NULL));
|
||||||
|
|
||||||
|
achievement_init(); // not in ANDROID
|
||||||
|
|
||||||
|
firstland0 = firstland;
|
||||||
|
|
||||||
|
// initlanguage();
|
||||||
|
initgraph();
|
||||||
|
#if CAP_SAVE
|
||||||
|
loadsave();
|
||||||
|
if(IRREGULAR) irr::auto_creator();
|
||||||
|
#endif
|
||||||
|
start_game();
|
||||||
|
|
||||||
|
if(!shmup::on) {
|
||||||
|
restoreGolems(items[itOrbLife], moGolem); items[itOrbLife] = 0;
|
||||||
|
restoreGolems(items[itOrbFriend], moTameBomberbird); items[itOrbFriend] = 0;
|
||||||
|
restoreGolems(kills[moPrincessMoved], moPrincess, princess::saveHP); kills[moPrincessMoved] = 0;
|
||||||
|
restoreGolems(kills[moPrincessArmedMoved], moPrincessArmed, princess::saveArmedHP); kills[moPrincessArmedMoved] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstland = firstland0;
|
||||||
|
polygonal::solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
EX void finishAll() {
|
||||||
|
achievement_final(!items[itOrbSafety]);
|
||||||
|
|
||||||
|
#if CAP_SAVE
|
||||||
|
saveStats();
|
||||||
|
#endif
|
||||||
|
offscreen.clear();
|
||||||
|
clearMemory();
|
||||||
|
#if ISMOBILE==0
|
||||||
|
cleargraph();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
achievement_close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
auto cgm = addHook(clearmemory, 40, [] () {
|
auto cgm = addHook(clearmemory, 40, [] () {
|
||||||
pathq.clear();
|
pathq.clear();
|
||||||
dcal.clear();
|
dcal.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user