BUG: Region's memory isn't being zeroed by the looks of it
This commit is contained in:
+18
-1
@@ -34,7 +34,8 @@ using namespace std;
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
EditorScene::EditorScene(ConfigUtility* const arg1):
|
EditorScene::EditorScene(ConfigUtility* const arg1):
|
||||||
config(*arg1)
|
config(*arg1),
|
||||||
|
region(20, 20, 1, 0, 0)
|
||||||
{
|
{
|
||||||
//create the debugging "window"
|
//create the debugging "window"
|
||||||
debugInfo.CreateSurface(256, 256);
|
debugInfo.CreateSurface(256, 256);
|
||||||
@@ -54,6 +55,12 @@ EditorScene::EditorScene(ConfigUtility* const arg1):
|
|||||||
{"Edit", "-Set Tile", "-Load Sheet", "-Delete Sheet", "-Metadata", "-Run Script"},
|
{"Edit", "-Set Tile", "-Load Sheet", "-Delete Sheet", "-Metadata", "-Run Script"},
|
||||||
{"Debugging", "Debug On", "Debug Off", "Toggle Debug", "Testificate"}
|
{"Debugging", "Debug On", "Debug Off", "Toggle Debug", "Testificate"}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//debug
|
||||||
|
tsheet.Load("rsc\\graphics\\tilesets\\sand.bmp", 12, 3);
|
||||||
|
cout << region.GetWidth() << endl;
|
||||||
|
cout << region.GetHeight() << endl;
|
||||||
|
cout << region.GetDepth() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorScene::~EditorScene() {
|
EditorScene::~EditorScene() {
|
||||||
@@ -77,6 +84,16 @@ void EditorScene::FrameEnd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EditorScene::Render(SDL_Surface* const screen) {
|
void EditorScene::Render(SDL_Surface* const screen) {
|
||||||
|
//debug
|
||||||
|
for (int i = 0; i < region.GetWidth(); i++) {
|
||||||
|
for (int j = 0; j < region.GetHeight(); j++) {
|
||||||
|
// for (int k = 0; k < region.GetDepth(); k++) {
|
||||||
|
cout << region.GetTile(i,j,0) << endl;
|
||||||
|
tsheet.DrawTo(screen, i*tsheet.GetTileW(), j*tsheet.GetTileH(), region.GetTile(i,j,0));
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//draw a big bar across the top
|
//draw a big bar across the top
|
||||||
buttonImage.SetClipY(0);
|
buttonImage.SetClipY(0);
|
||||||
for (int i = 0; i < screen->w; i += buttonImage.GetClipW()) {
|
for (int i = 0; i < screen->w; i += buttonImage.GetClipW()) {
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
#include "raster_font.hpp"
|
#include "raster_font.hpp"
|
||||||
#include "menu_bar.hpp"
|
#include "menu_bar.hpp"
|
||||||
|
|
||||||
//#include "map_loader.hpp"
|
#include "region_pager.hpp"
|
||||||
|
#include "tile_sheet.hpp"
|
||||||
|
|
||||||
class EditorScene : public BaseScene {
|
class EditorScene : public BaseScene {
|
||||||
public:
|
public:
|
||||||
@@ -66,6 +67,9 @@ protected:
|
|||||||
struct {
|
struct {
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
} camera;
|
} camera;
|
||||||
|
|
||||||
|
Region region;
|
||||||
|
TileSheet tsheet;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user