Removed many useless variables
This commit is contained in:
@@ -5,7 +5,7 @@ int const Globals::gen = 0;
|
|||||||
int const Globals::major = 0;
|
int const Globals::major = 0;
|
||||||
int const Globals::minor = 4;
|
int const Globals::minor = 4;
|
||||||
int const Globals::patch = 2;
|
int const Globals::patch = 2;
|
||||||
|
bool Globals::showMouse = true;
|
||||||
Globals::Globals(void){}
|
Globals::Globals(void){}
|
||||||
|
|
||||||
Globals::~Globals(void){}
|
Globals::~Globals(void){}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ public:
|
|||||||
Globals(void);
|
Globals(void);
|
||||||
~Globals(void);
|
~Globals(void);
|
||||||
static DataModelInstance* dataModel;
|
static DataModelInstance* dataModel;
|
||||||
|
static bool showMouse;
|
||||||
static const int gen;
|
static const int gen;
|
||||||
static const int major;
|
static const int major;
|
||||||
static const int minor;
|
static const int minor;
|
||||||
|
|||||||
60
main.cpp
60
main.cpp
@@ -40,45 +40,22 @@ static DataModelInstance* dataModel;
|
|||||||
GFontRef fntdominant = NULL;
|
GFontRef fntdominant = NULL;
|
||||||
GFontRef fntlighttrek = NULL;
|
GFontRef fntlighttrek = NULL;
|
||||||
Ray testRay;
|
Ray testRay;
|
||||||
static bool democ = true;
|
|
||||||
static std::string message = "";
|
static std::string message = "";
|
||||||
static G3D::RealTime messageTime = 0;
|
static G3D::RealTime messageTime = 0;
|
||||||
static std::string tempPath = "";
|
static std::string tempPath = "";
|
||||||
static G3D::RealTime inputTime = 0;
|
|
||||||
static int FPSVal[8] = {10, 20, 30, 60, 120, 240, INT_MAX,1};
|
|
||||||
static int index = 2;
|
|
||||||
static std::string cameraSound = "";
|
static std::string cameraSound = "";
|
||||||
static std::string clickSound = "";
|
static std::string clickSound = "";
|
||||||
static std::string dingSound = "";
|
static std::string dingSound = "";
|
||||||
static G3D::TextureRef go = NULL;
|
|
||||||
static G3D::TextureRef go_ovr = NULL;
|
|
||||||
static G3D::TextureRef go_dn = NULL;
|
|
||||||
VARAreaRef varStatic = NULL;
|
|
||||||
//static float dataModel->mousex = 0;
|
|
||||||
//static float dataModel->mousey = 0;
|
|
||||||
static int cursorid = 0;
|
static int cursorid = 0;
|
||||||
static G3D::TextureRef cursor = NULL;
|
static G3D::TextureRef cursor = NULL;
|
||||||
//static bool dataModel->mouseButton1Down = false;
|
|
||||||
static bool running = true;
|
static bool running = true;
|
||||||
static bool mouseMovedBeginMotion = false;
|
static bool mouseMovedBeginMotion = false;
|
||||||
static bool showMouse = true;
|
|
||||||
//Controller
|
|
||||||
static bool forwards = false;
|
|
||||||
static bool backwards = false;
|
|
||||||
static bool left = false;
|
|
||||||
static bool right = false;
|
|
||||||
static bool centerCam = false;
|
|
||||||
static bool panRight = false;
|
|
||||||
static bool panLeft = false;
|
|
||||||
static bool tiltUp = false;
|
|
||||||
static const int CURSOR = 0;
|
static const int CURSOR = 0;
|
||||||
static const int ARROWS = 1;
|
static const int ARROWS = 1;
|
||||||
static const int RESIZE = 2;
|
static const int RESIZE = 2;
|
||||||
static POINT oldGlobalMouse;
|
static POINT oldGlobalMouse;
|
||||||
|
|
||||||
static int mode = CURSOR;
|
static int mode = CURSOR;
|
||||||
bool dragging = false;
|
bool dragging = false;
|
||||||
Vector3 cameraPos = Vector3(0,2,10);
|
|
||||||
Vector2 oldMouse = Vector2(0,0);
|
Vector2 oldMouse = Vector2(0,0);
|
||||||
float moveRate = 0.5;
|
float moveRate = 0.5;
|
||||||
Instance* selectedInstance = NULL;
|
Instance* selectedInstance = NULL;
|
||||||
@@ -86,7 +63,6 @@ Instance* selectedInstance = NULL;
|
|||||||
Demo *usableApp = NULL;
|
Demo *usableApp = NULL;
|
||||||
|
|
||||||
Demo::Demo(const GAppSettings& settings,Win32Window* window) : GApp(settings,window) {
|
Demo::Demo(const GAppSettings& settings,Win32Window* window) : GApp(settings,window) {
|
||||||
varStatic = VARArea::create(1024 * 1024);
|
|
||||||
hWndMain = window->hwnd();
|
hWndMain = window->hwnd();
|
||||||
quit=false;
|
quit=false;
|
||||||
rightButtonHolding=false;
|
rightButtonHolding=false;
|
||||||
@@ -452,15 +428,16 @@ void Demo::initGUI()
|
|||||||
button->name = "Duplicate";
|
button->name = "Duplicate";
|
||||||
button->setButtonListener(new GUDButtonListener());
|
button->setButtonListener(new GUDButtonListener());
|
||||||
|
|
||||||
|
ImageButtonInstance* instance = makeImageButton(
|
||||||
ImageButtonInstance* instance = makeImageButton(go, go_ovr, go_dn);
|
Texture::fromFile(GetFileInPath("/content/images/Run.png")),
|
||||||
|
Texture::fromFile(GetFileInPath("/content/images/Run_ovr.png")),
|
||||||
|
Texture::fromFile(GetFileInPath("/content/images/Run_dn.png")));
|
||||||
instance->name = "go";
|
instance->name = "go";
|
||||||
instance->size = Vector2(65,65);
|
instance->size = Vector2(65,65);
|
||||||
instance->position = Vector2(6.5, 25);
|
instance->position = Vector2(6.5, 25);
|
||||||
instance->setParent(dataModel->getGuiRoot());
|
instance->setParent(dataModel->getGuiRoot());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
instance = makeImageButton(
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool.png")),
|
Texture::fromFile(GetFileInPath("/content/images/ArrowTool.png")),
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ovr.png")),
|
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ovr.png")),
|
||||||
@@ -614,7 +591,7 @@ void Demo::initGUI()
|
|||||||
void Demo::onInit() {
|
void Demo::onInit() {
|
||||||
|
|
||||||
// Called before Demo::run() beings
|
// Called before Demo::run() beings
|
||||||
cameraController.setFrame(cameraPos);
|
cameraController.setFrame(Vector3(0,2,10));
|
||||||
dataModel = new DataModelInstance();
|
dataModel = new DataModelInstance();
|
||||||
dataModel->setParent(NULL);
|
dataModel->setParent(NULL);
|
||||||
dataModel->name = "undefined";
|
dataModel->name = "undefined";
|
||||||
@@ -721,15 +698,6 @@ void Demo::onInit() {
|
|||||||
|
|
||||||
void Demo::onCleanup() {
|
void Demo::onCleanup() {
|
||||||
clearInstances();
|
clearInstances();
|
||||||
go->~Texture();
|
|
||||||
go_ovr->~Texture();
|
|
||||||
go_dn->~Texture();
|
|
||||||
go_dn.~ReferenceCountedPointer();
|
|
||||||
delete go_dn.pointer();
|
|
||||||
go.~ReferenceCountedPointer();
|
|
||||||
delete go.pointer();
|
|
||||||
go_ovr.~ReferenceCountedPointer();
|
|
||||||
delete go_ovr.pointer();
|
|
||||||
sky->~Sky();
|
sky->~Sky();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,15 +774,16 @@ void Demo::onUserInput(UserInput* ui) {
|
|||||||
if(debugMode())
|
if(debugMode())
|
||||||
message = "Debug Mode Disabled";
|
message = "Debug Mode Disabled";
|
||||||
else
|
else
|
||||||
message = "Debug Mode Enabled, Soon to be depricated";
|
message = "Debug Mode Enabled";
|
||||||
setDebugMode(!debugMode());
|
setDebugMode(!debugMode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(ui->keyPressed(SDLK_F8))
|
if(GetHoldKeyState(VK_F8))
|
||||||
//{
|
{
|
||||||
// messageTime = System::time();
|
messageTime = System::time();
|
||||||
// message = "FPS has been locked at " + Convert(FPSVal[index]);
|
message = "FOV Set to 10";
|
||||||
//setDesiredFrameRate(FPSVal[index]);
|
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//dataModel->mousex = ui->getMouseX();
|
//dataModel->mousex = ui->getMouseX();
|
||||||
@@ -1111,7 +1080,7 @@ void Demo::onGraphics(RenderDevice* rd) {
|
|||||||
rd->pushState();
|
rd->pushState();
|
||||||
rd->beforePrimitive();
|
rd->beforePrimitive();
|
||||||
|
|
||||||
if(showMouse && mouseOnScreen)
|
if(Globals::showMouse && mouseOnScreen)
|
||||||
{
|
{
|
||||||
glEnable( GL_TEXTURE_2D );
|
glEnable( GL_TEXTURE_2D );
|
||||||
glEnable(GL_BLEND);// you enable blending function
|
glEnable(GL_BLEND);// you enable blending function
|
||||||
@@ -1381,9 +1350,6 @@ void Demo::main() {
|
|||||||
UpdateWindow(hWndMain);
|
UpdateWindow(hWndMain);
|
||||||
|
|
||||||
// Load objects here=
|
// Load objects here=
|
||||||
go = Texture::fromFile(GetFileInPath("/content/images/Run.png"));
|
|
||||||
go_ovr = Texture::fromFile(GetFileInPath("/content/images/Run_ovr.png"));
|
|
||||||
go_dn = Texture::fromFile(GetFileInPath("/content/images/Run_dn.png"));
|
|
||||||
cursor = Texture::fromFile(GetFileInPath("/content/cursor2.png"));
|
cursor = Texture::fromFile(GetFileInPath("/content/cursor2.png"));
|
||||||
fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
|
fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
|
||||||
fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
|
fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
|
||||||
|
|||||||
Reference in New Issue
Block a user