Skip to content

Commit

Permalink
Merge branch 'hotfix/mcu_crash'
Browse files Browse the repository at this point in the history
  • Loading branch information
StuntHacks committed Oct 8, 2018
2 parents 782e784 + 8b00925 commit dcc8d60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions m3dialib/source/core/applet.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <3ds.h>
#include <citro3d.h>
#include <cstring>
#include "m3d/core/applet.hpp"
#include "m3d/core/ledPattern.hpp"
Expand All @@ -15,6 +16,8 @@ namespace m3d {
acInit();
romfsInit();
sdmcInit();
gfxInitDefault();
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);

Result res;
res = ndspInit();
Expand All @@ -34,6 +37,8 @@ namespace m3d {
Applet::~Applet() {
m3d::LEDPattern::stop();
if (m3d::priv::ndsp::initialized) ndspExit();
C3D_Fini();
gfxExit();
sdmcExit();
romfsExit();
acExit();
Expand All @@ -43,7 +48,10 @@ namespace m3d {
}

bool Applet::isRunning() {
if (!aptMainLoop()) return false;

hidScanInput(); // scan input since this gets called every frame
C3D_FrameEnd(0);
m_currentFrame++;
return m_running;
}
Expand Down
4 changes: 0 additions & 4 deletions m3dialib/source/graphics/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace m3d {
m_useFogBottom(false),
m_fogDensityTop(0.05),
m_fogDensityBottom(0.05) {
gfxInitDefault();
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
C2D_Init(C2D_DEFAULT_MAX_OBJECTS);
gfxSet3D(m_3dEnabled);
m_targetTopLeft = new m3d::RenderTarget(400, 240);
Expand Down Expand Up @@ -68,8 +66,6 @@ namespace m3d {

Screen::~Screen() {
C2D_Fini();
C3D_Fini();
gfxExit();
shaderProgramFree(&m_shader);
DVLB_Free(m_dvlb);
delete m_targetTopLeft;
Expand Down

0 comments on commit dcc8d60

Please sign in to comment.