1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Remove some more unused cruft

This commit is contained in:
fgenesis 2016-06-26 00:39:48 +02:00
parent 7494529bd0
commit e2e7753226
5 changed files with 4 additions and 170 deletions

View file

@ -4100,7 +4100,6 @@ void DSQ::onUpdate(float dt)
os << "FPS: " << core->fps << " | ROC: " << core->renderObjectCount << " | RC: " << Core::dbg_numRenderCalls << " | RES: " << core->resources.size(); os << "FPS: " << core->fps << " | ROC: " << core->renderObjectCount << " | RC: " << Core::dbg_numRenderCalls << " | RES: " << core->resources.size();
os << " | p: " << core->processedRenderObjectCount << " | t: " << core->totalRenderObjectCount; os << " | p: " << core->processedRenderObjectCount << " | t: " << core->totalRenderObjectCount;
os << " | s: " << dsq->continuity.seconds; os << " | s: " << dsq->continuity.seconds;
os << " | evQ: " << core->eventQueue.getSize();
os << " | sndQ: " << core->dbg_numThreadDecoders; os << " | sndQ: " << core->dbg_numThreadDecoders;
os << " | dt: " << core->get_current_dt(); os << " | dt: " << core->get_current_dt();

View file

@ -272,7 +272,7 @@ public:
std::string fn = "scripts/entities/" + entName + ".lua"; std::string fn = "scripts/entities/" + entName + ".lua";
#ifdef BBGE_BUILD_WINDOWS #ifdef BBGE_BUILD_WINDOWS
debugLog("SHELL EXECUTE!"); debugLog("SHELL EXECUTE!");
ShellExecute(dsq->hWnd, "open", fn.c_str(), NULL, NULL, SW_SHOWNORMAL); ShellExecute(0, "open", fn.c_str(), NULL, NULL, SW_SHOWNORMAL);
#endif #endif
} }
} }

View file

@ -213,42 +213,6 @@ RenderObjectLayer *Core::getRenderObjectLayer(int i)
return &renderObjectLayers[i]; return &renderObjectLayers[i];
} }
void Core::setColor(float r, float g, float b, float a)
{
glColor4f(r, g, b, a);
}
void Core::bindTexture(int stage, unsigned int handle)
{
}
void Core::translateMatrixStack(float x, float y, float z)
{
glTranslatef(x, y, z);
}
void Core::scaleMatrixStack(float x, float y, float z)
{
glScalef(x, y, z);
}
void Core::rotateMatrixStack(float x, float y, float z)
{
glRotatef(0, 0, 1, z);
}
void Core::applyMatrixStackToWorld()
{
}
void Core::rotateMatrixStack(float z)
{
glRotatef(0, 0, 1, z);
}
bool Core::getShiftState() bool Core::getShiftState()
{ {
return getKeyState(KEY_LSHIFT) || getKeyState(KEY_RSHIFT); return getKeyState(KEY_LSHIFT) || getKeyState(KEY_RSHIFT);
@ -409,8 +373,6 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
aspectY = 3; aspectY = 3;
virtualOffX = virtualOffY = 0; virtualOffX = virtualOffY = 0;
vw2 = 0;
vh2 = 0;
viewOffX = viewOffY = 0; viewOffX = viewOffY = 0;
@ -426,14 +388,12 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
mouseCircle = 0; mouseCircle = 0;
overrideStartLayer = 0; overrideStartLayer = 0;
overrideEndLayer = 0; overrideEndLayer = 0;
coreVerboseDebug = false;
frameOutputMode = false; frameOutputMode = false;
updateMouse = true; updateMouse = true;
particlesPaused = false; particlesPaused = false;
joystickAsMouse = false; joystickAsMouse = false;
currentLayerPass = 0; currentLayerPass = 0;
flipMouseButtons = 0; flipMouseButtons = 0;
joystickOverrideMouse = false;
joystickEnabled = false; joystickEnabled = false;
doScreenshot = false; doScreenshot = false;
baseCullRadius = 1; baseCullRadius = 1;
@ -447,18 +407,11 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
minimized = false; minimized = false;
numSavedScreenshots = 0; numSavedScreenshots = 0;
shuttingDown = false; shuttingDown = false;
clearedGarbageFlag = false;
nestedMains = 0; nestedMains = 0;
afterEffectManager = 0; afterEffectManager = 0;
loopDone = false; loopDone = false;
core = this; core = this;
#ifdef BBGE_BUILD_WINDOWS
hRC = 0;
hDC = 0;
hWnd = 0;
#endif
for (int i = 0; i < KEY_MAXARRAY; i++) for (int i = 0; i < KEY_MAXARRAY; i++)
{ {
keys[i] = 0; keys[i] = 0;
@ -710,7 +663,6 @@ void Core::init()
loopDone = false; loopDone = false;
clearedGarbageFlag = false;
initInputCodeMap(); initInputCodeMap();
@ -1265,8 +1217,6 @@ bool Core::createWindow(int width, int height, int bits, bool fullscreen, std::s
{ {
this->width = width; this->width = width;
this->height = height; this->height = height;
redBits = greenBits = blueBits = alphaBits = 0;
return true; return true;
@ -1317,12 +1267,8 @@ void Core::setPixelScale(int pixelScaleX, int pixelScaleY)
os << "virtual(" << virtualWidth << ", " << virtualHeight << ")"; os << "virtual(" << virtualWidth << ", " << virtualHeight << ")";
debugLog(os.str()); debugLog(os.str());
vw2 = virtualWidth/2;
vh2 = virtualHeight/2;
center = Vector(baseVirtualWidth/2, baseVirtualHeight/2); center = Vector(baseVirtualWidth/2, baseVirtualHeight/2);
virtualOffX = 0; virtualOffX = 0;
virtualOffY = 0; virtualOffY = 0;
@ -1488,11 +1434,6 @@ void Core::updateRenderObjects(float dt)
if (loopDone) if (loopDone)
return; return;
if (clearedGarbageFlag)
{
clearedGarbageFlag = false;
}
} }
std::string Core::getEnqueuedJumpState() std::string Core::getEnqueuedJumpState()
@ -1520,21 +1461,6 @@ unsigned Core::getTicks()
return 0; return 0;
} }
float Core::stopWatch(int d)
{
if (d)
{
stopWatchStartTime = getTicks()/1000.0f;
return stopWatchStartTime;
}
else
{
return (getTicks()/1000.0f) - stopWatchStartTime;
}
return 0;
}
bool Core::isWindowFocus() bool Core::isWindowFocus()
{ {
#ifdef BBGE_BUILD_SDL2 #ifdef BBGE_BUILD_SDL2
@ -1552,8 +1478,6 @@ void Core::onBackgroundUpdate()
void Core::main(float runTime) void Core::main(float runTime)
{ {
bool verbose = coreVerboseDebug;
if (verbose) debugLog("entered Core::main");
// cannot nest loops when the game is over // cannot nest loops when the game is over
if (loopDone) return; if (loopDone) return;
@ -1580,7 +1504,6 @@ void Core::main(float runTime)
dt = (nowTicks-thenTicks)/1000.0; dt = (nowTicks-thenTicks)/1000.0;
thenTicks = nowTicks; thenTicks = nowTicks;
if (verbose) debugLog("avgFPS");
if (!avgFPS.empty()) if (!avgFPS.empty())
{ {
@ -1610,7 +1533,6 @@ void Core::main(float runTime)
} }
#if !defined(_DEBUG) && defined(BBGE_BUILD_SDL) #if !defined(_DEBUG) && defined(BBGE_BUILD_SDL)
if (verbose) debugLog("checking window active");
if (lib_graphics && (wasInactive || !settings.runInBackground)) if (lib_graphics && (wasInactive || !settings.runInBackground))
{ {
@ -1679,13 +1601,10 @@ void Core::main(float runTime)
old_dt = dt; old_dt = dt;
if (verbose) debugLog("modify dt");
modifyDt(dt); modifyDt(dt);
current_dt = dt; current_dt = dt;
if (verbose) debugLog("check runtime/quit");
if (quitNestedMainFlag) if (quitNestedMainFlag)
{ {
quitNestedMainFlag = false; quitNestedMainFlag = false;
@ -1699,25 +1618,15 @@ void Core::main(float runTime)
} }
// UPDATE // UPDATE
if (verbose) debugLog("post processing fx update");
postProcessingFx.update(dt); postProcessingFx.update(dt);
if (verbose) debugLog("update eventQueue");
eventQueue.update(dt);
if (verbose) debugLog("Update render objects");
updateRenderObjects(dt); updateRenderObjects(dt);
if (verbose) debugLog("Update particle manager");
if (particleManager) if (particleManager)
particleManager->update(dt); particleManager->update(dt);
if (verbose) debugLog("sound update");
sound->update(dt); sound->update(dt);
if (verbose) debugLog("onUpdate");
onUpdate(dt); onUpdate(dt);
if (nestedMains == 1) if (nestedMains == 1)
@ -1732,26 +1641,20 @@ void Core::main(float runTime)
if (settings.renderOn) if (settings.renderOn)
{ {
if (verbose) debugLog("dark layer prerender");
if (darkLayer.isUsed()) if (darkLayer.isUsed())
{ {
darkLayer.preRender(); darkLayer.preRender();
} }
if (verbose) debugLog("render");
render(); render();
if (verbose) debugLog("showBuffer");
showBuffer(); showBuffer();
BBGE_PROF(STOP); BBGE_PROF(STOP);
if (verbose) debugLog("clearGarbage");
if (nestedMains == 1) if (nestedMains == 1)
clearGarbage(); clearGarbage();
if (verbose) debugLog("frame counter");
frames++; frames++;
counter += dt; counter += dt;
@ -1766,20 +1669,16 @@ void Core::main(float runTime)
if (doScreenshot) if (doScreenshot)
{ {
if (verbose) debugLog("screenshot");
doScreenshot = false; doScreenshot = false;
saveScreenshotTGA(getScreenshotFilename()); saveScreenshotTGA(getScreenshotFilename());
prepScreen(0); prepScreen(0);
} }
} }
if (verbose) debugLog("bottom of function");
quitNestedMainFlag = false; quitNestedMainFlag = false;
if (nestedMains==1) if (nestedMains==1)
clearGarbage(); clearGarbage();
nestedMains--; nestedMains--;
if (verbose) debugLog("exit Core::main");
} }
void Core::clearBuffers() void Core::clearBuffers()
@ -2994,14 +2893,14 @@ void Core::clearGarbage()
BBGE_PROF(Core_clearGarbage); BBGE_PROF(Core_clearGarbage);
// HACK: optimize this (use a list instead of a queue) // HACK: optimize this (use a list instead of a queue)
for (RenderObjectList::iterator i = garbage.begin(); i != garbage.end(); i++) for (RenderObjects::iterator i = garbage.begin(); i != garbage.end(); i++)
{ {
removeRenderObject(*i, DO_NOT_DESTROY_RENDER_OBJECT); removeRenderObject(*i, DO_NOT_DESTROY_RENDER_OBJECT);
(*i)->destroy(); (*i)->destroy();
} }
for (RenderObjectList::iterator i = garbage.begin(); i != garbage.end(); i++) for (RenderObjects::iterator i = garbage.begin(); i != garbage.end(); i++)
{ {
deleteRenderObjectMemory(*i); deleteRenderObjectMemory(*i);
} }

View file

@ -250,14 +250,7 @@ enum FollowCameraLock
FCL_VERT = 2 FCL_VERT = 2
}; };
#define RLT_FIXED
typedef std::vector <RenderObject*> RenderObjects; typedef std::vector <RenderObject*> RenderObjects;
typedef std::list <RenderObject*> RenderObjectList;
typedef std::map <intptr_t, RenderObject*> RenderObjectMap;
class RenderObjectLayer class RenderObjectLayer
{ {
@ -439,12 +432,6 @@ public:
unsigned getTicks(); unsigned getTicks();
float stopWatch(int d);
float stopWatchStartTime;
void resetGraphics(int w, int h, int fullscreen=-1, int vsync=-1, int bpp=-1); void resetGraphics(int w, int h, int fullscreen=-1, int vsync=-1, int bpp=-1);
@ -454,23 +441,10 @@ public:
Vector getGameCursorPosition(); Vector getGameCursorPosition();
Vector getGamePosition(const Vector &v); Vector getGamePosition(const Vector &v);
Vector joystickPosition;
bool coreVerboseDebug;
Vector screenCenter; Vector screenCenter;
void print(int x, int y, const char *str, float sz=1); void print(int x, int y, const char *str, float sz=1);
// windows variables
#ifdef BBGE_BUILD_WINDOWS
HDC hDC; // Private GDI Device Context
HGLRC hRC; // Permanent Rendering Context
HWND hWnd; // Holds Our Window Handle
HINSTANCE hInstance; // Holds The Instance Of The Application
#endif
std::vector<Texture*> resources; std::vector<Texture*> resources;
RenderObjectLayer *getRenderObjectLayer(int i); RenderObjectLayer *getRenderObjectLayer(int i);
@ -479,7 +453,7 @@ public:
typedef std::vector<RenderObjectLayer> RenderObjectLayers; typedef std::vector<RenderObjectLayer> RenderObjectLayers;
RenderObjectLayers renderObjectLayers; RenderObjectLayers renderObjectLayers;
RenderObjectList garbage; RenderObjects garbage;
SoundManager *sound; SoundManager *sound;
@ -552,17 +526,6 @@ public:
void clearRenderObjects(); void clearRenderObjects();
void applyMatrixStackToWorld();
void translateMatrixStack(float x, float y, float z=0);
void rotateMatrixStack(float x, float y, float z);
void scaleMatrixStack(float x, float y, float z=1);
void rotateMatrixStack(float z);
void setColor(float r, float g, float b, float a);
void bindTexture(int stage, unsigned int handle);
bool getKeyState(int k); bool getKeyState(int k);
bool getMouseButtonState(int m); bool getMouseButtonState(int m);
@ -580,8 +543,6 @@ public:
DarkLayer darkLayer; DarkLayer darkLayer;
int redBits, greenBits, blueBits, alphaBits;
void setupRenderPositionAndScale(); void setupRenderPositionAndScale();
void setupGlobalResolutionScale(); void setupGlobalResolutionScale();
@ -590,8 +551,6 @@ public:
bool joystickEnabled; bool joystickEnabled;
bool joystickOverrideMouse;
bool debugLogTextures; bool debugLogTextures;
@ -619,8 +578,6 @@ public:
bool hasFocus(); bool hasFocus();
EventQueue eventQueue;
float aspectX, aspectY; float aspectX, aspectY;
float get_old_dt() { return old_dt; } float get_old_dt() { return old_dt; }
@ -639,7 +596,6 @@ public:
void centerMouse(); void centerMouse();
int vw2, vh2;
Vector center; Vector center;
void enable2DWide(int rx, int ry); void enable2DWide(int rx, int ry);
@ -724,7 +680,6 @@ protected:
bool shuttingDown; bool shuttingDown;
bool quitNestedMainFlag; bool quitNestedMainFlag;
bool clearedGarbageFlag;
int nestedMains; int nestedMains;
std::string baseTextureDirectory; std::string baseTextureDirectory;

View file

@ -104,31 +104,18 @@ void DarkLayer::toggle(bool on)
void DarkLayer::preRender() void DarkLayer::preRender()
{ {
bool verbose = core->coreVerboseDebug;
if (layer != -1) if (layer != -1)
{ {
if (verbose) debugLog("viewport");
glViewport(0,0,quality,quality); glViewport(0,0,quality,quality);
if (verbose) debugLog("startCapture");
if (useFrameBuffer) if (useFrameBuffer)
frameBuffer.startCapture(); frameBuffer.startCapture();
if (verbose) debugLog("clearColor");
glClearColor(1,1,1,1); glClearColor(1,1,1,1);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
if (verbose) debugLog("render");
core->render(layer, layer, false); core->render(layer, layer, false);
if (verbose) debugLog("endCapture");
if (useFrameBuffer) if (useFrameBuffer)
frameBuffer.endCapture(); frameBuffer.endCapture();
else else
@ -138,14 +125,8 @@ void DarkLayer::preRender()
glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, quality, quality, 0); glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, quality, quality, 0);
} }
if (verbose) debugLog("viewport");
glViewport(0, 0, core->width, core->height); glViewport(0, 0, core->width, core->height);
glClearColor(0,0,0,0); glClearColor(0,0,0,0);
if (verbose) debugLog("done");
} }
} }