Clean bloat comments

Please make sure these were bloat and not important.
This commit is contained in:
Modnark
2022-10-08 21:05:09 -04:00
parent 9f741e0df7
commit 415ea71664
13 changed files with 16 additions and 265 deletions

View File

@@ -33,10 +33,7 @@
#include "Listener/RotateButtonListener.h"
#include "Faces.h"
#define LEGACY_LOAD_G3DFUN_LEVEL
//Ray testRay;
//static int cursorid = 0;
//static int cursorOvrid = 0;
//static int currentcursorid = 0;
static bool mouseMovedBeginMotion = false;
static POINT oldGlobalMouse;
Vector2 oldMouse = Vector2(0,0);
@@ -291,16 +288,6 @@ void Application::onInit() {
_dataModel->getSelectionService()->clearSelection();
_dataModel->getSelectionService()->addSelected(_dataModel);
//setDesiredFrameRate(60);
//GApplet::onInit();
}
void Application::onCleanup() {
@@ -316,12 +303,6 @@ void Application::onNetwork() {
// Poll net messages here
}
//double getVectorDistance(Vector3 vector1, Vector3 vector2)
//{
// return pow(pow((double)vector1.x - (double)vector2.x, 2) + pow((double)vector1.y - (double)vector2.y, 2) + pow((double)vector1.z - (double)vector2.z, 2), 0.5);
//}
void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
if(_dataModel->isRunning())
@@ -428,7 +409,7 @@ int Application::getMode()
void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, LightingParameters lighting, Vector3 size, Vector3 pos, CoordinateFrame c)
{
rd->disableLighting();
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
Color3 outline = Color3::cyan();
float offsetSize = 0.05F;
//X
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
@@ -503,8 +484,6 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
void Application::exitApplication()
{
//endApplet = true;
//endProgram = true;
}
@@ -518,27 +497,18 @@ void Application::onGraphics(RenderDevice* rd) {
if (GetCursorPos(&mousepos))
{
POINT pointm = mousepos;
if (ScreenToClient(_hWndMain, &mousepos))
{
//mouseOnScreen = true;
//POINT pointm;
///GetCursorPos(&pointm);
if(_hwndRenderer != WindowFromPoint(pointm)) //OLD: mousepos.x < 1 || mousepos.y < 1 || mousepos.x >= rd->getViewport().width()-1 || mousepos.y >= rd->getViewport().height()-1
if (ScreenToClient(_hWndMain, &mousepos))
{
mouseOnScreen = false;
//ShowCursor(true);
//_window->setMouseVisible(true);
//rd->window()->setInputCaptureCount(0);
if(_hwndRenderer != WindowFromPoint(pointm))
{
mouseOnScreen = false;
}
else
{
mouseOnScreen = true;
}
}
else
{
mouseOnScreen = true;
//SetCursor(NULL);
//_window->setMouseVisible(false);
//rd->window()->setInputCaptureCount(1);
}
}
}
if(Globals::useMousePoint)
@@ -556,8 +526,6 @@ void Application::onGraphics(RenderDevice* rd) {
renderDevice->clear(sky.isNull(), true, true);
if (sky.notNull()) sky->render(renderDevice, lighting);
} else {
printf("ThumbnailGenerator::click\n");
rd->setColorClearValue(Color4(0.0f, 0.0f, 0.0f, 0.0f));
renderDevice->clear(true, true, true);
toggleSky();
@@ -572,41 +540,18 @@ void Application::onGraphics(RenderDevice* rd) {
renderDevice->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor, true, true));
renderDevice->setAmbientLightColor(lighting.ambient);
//renderDevice->setBlendFunc(RenderDevice::BLEND_ONE, RenderDevice::BLEND_ONE);
//renderDevice->setShininess(70);
//renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F));
//float lightAmbient[] = { 0.5F, 0.5F, 0.5F, 1.0F };
//float lightDiffuse[] = { 0.6F, 0.6F, 0.6F, 1.0F };
//float lightSpecular[] = { 0.8F, 0.8F, 0.8F, 1.0F };
//glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, lightAmbient);
//glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, lightDiffuse);
//glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, lightSpecular);
//glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 70);
rd->beforePrimitive();
CoordinateFrame forDraw = rd->getObjectToWorldMatrix();
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
//if(_dataModel->getWorkspace() != NULL)
_dataModel->getWorkspace()->render(rd);
//else throw std::exception("Workspace not found");
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
rd->setObjectToWorldMatrix(forDraw);
rd->afterPrimitive();
//Draw::box(G3D::Box(mouse.getPosition()-Vector3(2,0.5F,1),mouse.getPosition()+Vector3(2,0.5F,1)), rd, Color3::cyan(), Color4::clear());
for(size_t i = 0; i < _dataModel->getSelectionService()->getSelection().size(); i++)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
@@ -616,18 +561,6 @@ void Application::onGraphics(RenderDevice* rd) {
drawOutline(Vector3(0+size.x/2, 0+size.y/2, 0+size.z/2) ,Vector3(0-size.x/2,0-size.y/2,0-size.z/2), rd, lighting, Vector3(size.x/2, size.y/2, size.z/2), Vector3(pos.x, pos.y, pos.z), part->getCFrame());
}
}
//Vector3 gamepoint = Vector3(0, 5, 0);
//Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
//float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
//if(distance < 50 && distance > -50)
//{
// if(distance < 0)
// distance = distance*-1;
// fntdominant->draw3D(rd, "Testing", CoordinateFrame(rd->getCameraToWorldMatrix().rotation, gamepoint), 0.04*distance, Color3::yellow(), Color3::black(), G3D::GFont::XALIGN_CENTER, G3D::GFont::YALIGN_CENTER);
//}
renderDevice->disableLighting();
@@ -636,51 +569,6 @@ void Application::onGraphics(RenderDevice* rd) {
}
renderDevice->push2D();
_dataModel->getGuiRoot()->renderGUI(renderDevice, m_graphicsWatch.FPS());
/*rd->pushState();
rd->beforePrimitive();
if(Globals::showMouse && mouseOnScreen)
{
glEnable( GL_TEXTURE_2D );
glEnable(GL_BLEND);// you enable blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/*
std::vector<Instance*> instances = _dataModel->getWorkspace()->getAllChildren();
currentcursorid = cursorid;
for(size_t i = 0; i < instances.size(); i++)
{
if(PartInstance* test = dynamic_cast<PartInstance*>(instances.at(i)))
{
float time = cameraController.getCamera()->worldRay(_dataModel->mousex, _dataModel->mousey, renderDevice->getViewport()).intersectionTime(test->getBox());
//float time = testRay.intersectionTime(test->getBox());
if (time != inf())
{
currentcursorid = cursorOvrid;
break;
}
}
}
*/
/*glBindTexture( GL_TEXTURE_2D, tool->getCursorId());
glBegin( GL_QUADS );
glTexCoord2d(0.0,0.0);
glVertex2f(mousepos.x-64, mousepos.y-64);
glTexCoord2d( 1.0,0.0 );
glVertex2f(mousepos.x+64, mousepos.y-64);
glTexCoord2d(1.0,1.0 );
glVertex2f(mousepos.x+64, mousepos.y+64 );
glTexCoord2d( 0.0,1.0 );
glVertex2f( mousepos.x-64, mousepos.y+64 );
glEnd();
glDisable( GL_TEXTURE_2D );*/
//}
/*rd->afterPrimitive();
rd->popState();*/
renderDevice->pop2D();
}
@@ -739,7 +627,6 @@ void Application::onMouseMoved(int x,int y)
mouse.oldy = mouse.y;
mouse.x = x;
mouse.y = y;
//tool->onMouseMoved(mouse);
mouseMoveState = true;
}
@@ -755,26 +642,9 @@ void Application::onMouseWheel(int x,int y,short delta)
void Application::run() {
g_usableApp = this;
//setDebugMode(false);
//debugController.setActive(false);
/*
if (!createWindowClass("ToolWindowClass",ToolProc,GetModuleHandle(0)))
{
return;
}
HWND propertyHWnd = CreateWindowEx(
WS_EX_TOOLWINDOW,"ToolWindowClass", "ToolWindow",
WS_SYSMENU | WS_VISIBLE | WS_CHILD,
0, 0, 800, 64,
hWndMain, NULL, GetModuleHandle(0), NULL);
ShowWindow(propertyHWnd,SW_SHOW);
*/
UpdateWindow(_hWndMain);
// Load objects here=
Globals::surface = Texture::fromFile(GetFileInPath("/content/images/surfacebr.png"));
Globals::surfaceId = Globals::surface->getOpenGLID();
cameraSound = GetFileInPath("/content/sounds/SWITCH3.wav");
@@ -790,12 +660,7 @@ void Application::run() {
RealTime lastWaitTime=0;
MSG messages;
//RECT cRect;
//GetClientRect(_hWndMain,&cRect);
//renderDevice->notifyResize(cRect.right,cRect.bottom);
//Rect2D viewportRect = Rect2D::xywh(0,0,cRect.right,cRect.bottom);
//renderDevice->setViewport(viewportRect);
//window()->setInputCaptureCount(1);
resizeWithParent(_hWndMain);
glEnable(GL_CULL_FACE);
while (!quit)
@@ -807,21 +672,15 @@ void Application::run() {
m_userInputWatch.tick();
onUserInput(userInput);
//m_moduleManager->onUserInput(_userInput);
m_userInputWatch.tock();
m_simulationWatch.tick();
//debugController.doSimulation(clamp(timeStep, 0.0, 0.1));
//g3dCamera.setCoordinateFrame
//(debugController.getCoordinateFrame());
double rate = simTimeRate;
RealTime rdt = timeStep;
SimTime sdt = timeStep * rate;
SimTime idt = desiredFrameDuration * rate;
onSimulation(rdt,sdt,idt);
m_simulationWatch.tock();
@@ -896,7 +755,4 @@ void Application::QuitApp()
void Application::onCreate(HWND parentWindow)
{
//SetWindowLongPtr(hwndRenderer,GWL_USERDATA,(LONG)this);
//SetWindowLongPtr(hwndToolbox,GWL_USERDATA,(LONG)this);
//SetWindowLongPtr(hwndMain,GWL_USERDATA,(LONG)&app);
}