forked from OctaForge/OctaCore
drop menus.cc
This commit is contained in:
parent
a3cd090fb8
commit
a986fdb2df
|
@ -15,7 +15,6 @@ client_src = [
|
||||||
'../engine/light.cc',
|
'../engine/light.cc',
|
||||||
'../engine/main.cc',
|
'../engine/main.cc',
|
||||||
'../engine/material.cc',
|
'../engine/material.cc',
|
||||||
'../engine/menus.cc',
|
|
||||||
'../engine/movie.cc',
|
'../engine/movie.cc',
|
||||||
'../engine/normal.cc',
|
'../engine/normal.cc',
|
||||||
'../engine/octa.cc',
|
'../engine/octa.cc',
|
||||||
|
|
|
@ -225,6 +225,11 @@ extern void writebinds(stream *f);
|
||||||
extern void writecompletions(stream *f);
|
extern void writecompletions(stream *f);
|
||||||
|
|
||||||
// main
|
// main
|
||||||
|
|
||||||
|
extern int mainmenu;
|
||||||
|
|
||||||
|
extern void clearmainmenu();
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
NOT_INITING = 0,
|
NOT_INITING = 0,
|
||||||
|
@ -234,13 +239,7 @@ enum
|
||||||
};
|
};
|
||||||
extern int initing, numcpus;
|
extern int initing, numcpus;
|
||||||
|
|
||||||
enum
|
extern bool initwarning(const char *desc, int level = INIT_RESET, int type = 0);
|
||||||
{
|
|
||||||
CHANGE_GFX = 1<<0,
|
|
||||||
CHANGE_SOUND = 1<<1,
|
|
||||||
CHANGE_SHADERS = 1<<2
|
|
||||||
};
|
|
||||||
extern bool initwarning(const char *desc, int level = INIT_RESET, int type = CHANGE_GFX);
|
|
||||||
|
|
||||||
extern bool grabinput, minimized;
|
extern bool grabinput, minimized;
|
||||||
|
|
||||||
|
@ -340,15 +339,6 @@ extern bool hasskybox();
|
||||||
extern bool limitsky();
|
extern bool limitsky();
|
||||||
extern void cleanupsky();
|
extern void cleanupsky();
|
||||||
|
|
||||||
// menus
|
|
||||||
|
|
||||||
extern int mainmenu;
|
|
||||||
|
|
||||||
extern void addchange(const char *desc, int type);
|
|
||||||
extern void clearchanges(int type);
|
|
||||||
extern void menuprocess();
|
|
||||||
extern void clearmainmenu();
|
|
||||||
|
|
||||||
// grass
|
// grass
|
||||||
extern void loadgrassshaders();
|
extern void loadgrassshaders();
|
||||||
extern void generategrass();
|
extern void generategrass();
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
#include "engine.hh"
|
#include "engine.hh"
|
||||||
|
|
||||||
|
VAR(mainmenu, 1, 1, 0);
|
||||||
|
|
||||||
void clientkeepalive() {}
|
void clientkeepalive() {}
|
||||||
|
|
||||||
bool multiplayer(bool msg)
|
bool multiplayer(bool msg)
|
||||||
|
@ -22,6 +24,15 @@ bool isconnected(bool attempt, bool local)
|
||||||
return haslocalclients();
|
return haslocalclients();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearmainmenu()
|
||||||
|
{
|
||||||
|
if(mainmenu && isconnected())
|
||||||
|
{
|
||||||
|
mainmenu = 0;
|
||||||
|
//UI::hideui(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void localdisconnect(bool cleanup)
|
void localdisconnect(bool cleanup)
|
||||||
{
|
{
|
||||||
game::gamedisconnect(cleanup);
|
game::gamedisconnect(cleanup);
|
||||||
|
@ -114,7 +125,7 @@ bool initwarning(const char *desc, int level, int type)
|
||||||
{
|
{
|
||||||
if(initing < level)
|
if(initing < level)
|
||||||
{
|
{
|
||||||
addchange(desc, type);
|
//addchange(desc, type);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -606,7 +617,7 @@ void setupscreen()
|
||||||
|
|
||||||
void resetgl()
|
void resetgl()
|
||||||
{
|
{
|
||||||
clearchanges(CHANGE_GFX|CHANGE_SHADERS);
|
//clearchanges(CHANGE_GFX|CHANGE_SHADERS);
|
||||||
|
|
||||||
renderbackground("resetting OpenGL");
|
renderbackground("resetting OpenGL");
|
||||||
|
|
||||||
|
@ -1178,7 +1189,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
checkinput();
|
checkinput();
|
||||||
//UI::update();
|
//UI::update();
|
||||||
menuprocess();
|
//menuprocess();
|
||||||
tryedit();
|
tryedit();
|
||||||
|
|
||||||
if(lastmillis) game::updateworld();
|
if(lastmillis) game::updateworld();
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
#include "engine.hh"
|
|
||||||
|
|
||||||
void notifywelcome()
|
|
||||||
{
|
|
||||||
//UI::hideui("servers");
|
|
||||||
}
|
|
||||||
|
|
||||||
struct change
|
|
||||||
{
|
|
||||||
int type;
|
|
||||||
const char *desc;
|
|
||||||
|
|
||||||
change() {}
|
|
||||||
change(int type, const char *desc) : type(type), desc(desc) {}
|
|
||||||
};
|
|
||||||
static vector<change> needsapply;
|
|
||||||
|
|
||||||
VARP(applydialog, 0, 1, 1);
|
|
||||||
VAR(hidechanges, 0, 0, 1);
|
|
||||||
|
|
||||||
void addchange(const char *desc, int type)
|
|
||||||
{
|
|
||||||
if(!applydialog) return;
|
|
||||||
loopv(needsapply) if(!strcmp(needsapply[i].desc, desc)) return;
|
|
||||||
needsapply.add(change(type, desc));
|
|
||||||
//if(!hidechanges) UI::showui("changes");
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearchanges(int type)
|
|
||||||
{
|
|
||||||
loopvrev(needsapply)
|
|
||||||
{
|
|
||||||
change &c = needsapply[i];
|
|
||||||
if(c.type&type)
|
|
||||||
{
|
|
||||||
c.type &= ~type;
|
|
||||||
if(!c.type) needsapply.remove(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if(needsapply.empty()) UI::hideui("changes");
|
|
||||||
}
|
|
||||||
|
|
||||||
void applychanges()
|
|
||||||
{
|
|
||||||
int changetypes = 0;
|
|
||||||
loopv(needsapply) changetypes |= needsapply[i].type;
|
|
||||||
if(changetypes&CHANGE_GFX) execident("resetgl");
|
|
||||||
else if(changetypes&CHANGE_SHADERS) execident("resetshaders");
|
|
||||||
if(changetypes&CHANGE_SOUND) execident("resetsound");
|
|
||||||
}
|
|
||||||
|
|
||||||
COMMAND(applychanges, "");
|
|
||||||
ICOMMAND(pendingchanges, "b", (int *idx), { if(needsapply.inrange(*idx)) result(needsapply[*idx].desc); else if(*idx < 0) intret(needsapply.length()); });
|
|
||||||
|
|
||||||
static int lastmainmenu = -1;
|
|
||||||
|
|
||||||
void menuprocess()
|
|
||||||
{
|
|
||||||
if(lastmainmenu != mainmenu)
|
|
||||||
{
|
|
||||||
lastmainmenu = mainmenu;
|
|
||||||
execident("mainmenutoggled");
|
|
||||||
}
|
|
||||||
//if(mainmenu && !isconnected(true) && !UI::hascursor()) UI::showui("main");
|
|
||||||
}
|
|
||||||
|
|
||||||
VAR(mainmenu, 1, 1, 0);
|
|
||||||
|
|
||||||
void clearmainmenu()
|
|
||||||
{
|
|
||||||
hidechanges = 0;
|
|
||||||
if(mainmenu && isconnected())
|
|
||||||
{
|
|
||||||
mainmenu = 0;
|
|
||||||
//UI::hideui(NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "engine.hh"
|
#include "engine.hh"
|
||||||
|
|
||||||
|
#define CHANGE_SHADERS 0
|
||||||
|
|
||||||
int gw = -1, gh = -1, bloomw = -1, bloomh = -1, lasthdraccum = 0;
|
int gw = -1, gh = -1, bloomw = -1, bloomh = -1, lasthdraccum = 0;
|
||||||
GLuint gfbo = 0, gdepthtex = 0, gcolortex = 0, gnormaltex = 0, gglowtex = 0, gdepthrb = 0, gstencilrb = 0;
|
GLuint gfbo = 0, gdepthtex = 0, gcolortex = 0, gnormaltex = 0, gglowtex = 0, gdepthrb = 0, gstencilrb = 0;
|
||||||
bool gdepthinit = false;
|
bool gdepthinit = false;
|
||||||
|
|
|
@ -1559,7 +1559,7 @@ void reloadshaders()
|
||||||
|
|
||||||
void resetshaders()
|
void resetshaders()
|
||||||
{
|
{
|
||||||
clearchanges(CHANGE_SHADERS);
|
//clearchanges(CHANGE_SHADERS);
|
||||||
|
|
||||||
cleanuplights();
|
cleanuplights();
|
||||||
cleanupmodels();
|
cleanupmodels();
|
||||||
|
|
Loading…
Reference in a new issue