1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 09:44:02 +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 << " | p: " << core->processedRenderObjectCount << " | t: " << core->totalRenderObjectCount;
os << " | s: " << dsq->continuity.seconds;
os << " | evQ: " << core->eventQueue.getSize();
os << " | sndQ: " << core->dbg_numThreadDecoders;
os << " | dt: " << core->get_current_dt();

View file

@ -272,7 +272,7 @@ public:
std::string fn = "scripts/entities/" + entName + ".lua";
#ifdef BBGE_BUILD_WINDOWS
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
}
}

View file

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

View file

@ -250,14 +250,7 @@ enum FollowCameraLock
FCL_VERT = 2
};
#define RLT_FIXED
typedef std::vector <RenderObject*> RenderObjects;
typedef std::list <RenderObject*> RenderObjectList;
typedef std::map <intptr_t, RenderObject*> RenderObjectMap;
class RenderObjectLayer
{
@ -439,12 +432,6 @@ public:
unsigned getTicks();
float stopWatch(int d);
float stopWatchStartTime;
void resetGraphics(int w, int h, int fullscreen=-1, int vsync=-1, int bpp=-1);
@ -454,23 +441,10 @@ public:
Vector getGameCursorPosition();
Vector getGamePosition(const Vector &v);
Vector joystickPosition;
bool coreVerboseDebug;
Vector screenCenter;
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;
RenderObjectLayer *getRenderObjectLayer(int i);
@ -479,7 +453,7 @@ public:
typedef std::vector<RenderObjectLayer> RenderObjectLayers;
RenderObjectLayers renderObjectLayers;
RenderObjectList garbage;
RenderObjects garbage;
SoundManager *sound;
@ -552,17 +526,6 @@ public:
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 getMouseButtonState(int m);
@ -580,8 +543,6 @@ public:
DarkLayer darkLayer;
int redBits, greenBits, blueBits, alphaBits;
void setupRenderPositionAndScale();
void setupGlobalResolutionScale();
@ -590,8 +551,6 @@ public:
bool joystickEnabled;
bool joystickOverrideMouse;
bool debugLogTextures;
@ -619,8 +578,6 @@ public:
bool hasFocus();
EventQueue eventQueue;
float aspectX, aspectY;
float get_old_dt() { return old_dt; }
@ -639,7 +596,6 @@ public:
void centerMouse();
int vw2, vh2;
Vector center;
void enable2DWide(int rx, int ry);
@ -724,7 +680,6 @@ protected:
bool shuttingDown;
bool quitNestedMainFlag;
bool clearedGarbageFlag;
int nestedMains;
std::string baseTextureDirectory;

View file

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