diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 979b825..7dfcbf9 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/assets/terrainmap.png b/assets/terrainmap.png index c672029..8fdc84a 100644 Binary files a/assets/terrainmap.png and b/assets/terrainmap.png differ diff --git a/assets/terrainmap.xcf b/assets/terrainmap.xcf index ee2ec7e..becd070 100644 Binary files a/assets/terrainmap.xcf and b/assets/terrainmap.xcf differ diff --git a/main.cpp b/main.cpp index e5d9a02..c684849 100644 --- a/main.cpp +++ b/main.cpp @@ -179,6 +179,7 @@ int CHAPTER_NUMBER=0; int SAVE_FILE_CURSOR=0; std::string CUTSCENE_DISPLAY_TEXT=""; int CUTSCENE_DISPLAY_TEXT_DELAY_TIME=0; +int TILEMAP_EDITOR_OFFSET=0; /* [Choice1,Choice2,Choice3] @@ -1331,11 +1332,17 @@ void SeasonI::updateGame(){ } if (GetMouse(0).bHeld) { int selectedTileX=GetMouseX()/TILEMAP_EDITOR_TILESIZE; - int selectedTileY=GetMouseY()/TILEMAP_EDITOR_TILESIZE; - if (selectedTileX*TILEMAP_EDITOR_DRAW_MULT>=0&&selectedTileX*TILEMAP_EDITOR_DRAW_MULT=0) { + int selectedTileY=GetMouseY()/TILEMAP_EDITOR_TILESIZE+TILEMAP_EDITOR_OFFSET/TILEMAP_EDITOR_TILESIZE; + if (selectedTileX*TILEMAP_EDITOR_DRAW_MULT>=0&&selectedTileX*TILEMAP_EDITOR_DRAW_MULTtileset->sprite->width&&selectedTileY*TILEMAP_EDITOR_DRAW_MULTtileset->sprite->height&&selectedTileY*TILEMAP_EDITOR_DRAW_MULT>=0) { SELECTED_TILE={selectedTileX,selectedTileY}; } } + if ((GetMouseWheel()<0||GetKey(PGDN).bHeld)&&TILEMAP_EDITOR_OFFSETtileset->sprite->height-TILEMAP_EDITOR_TILESIZE) { + TILEMAP_EDITOR_OFFSET+=TILEMAP_EDITOR_TILESIZE; + } else + if ((GetMouseWheel()>0||GetKey(PGUP).bHeld)&&TILEMAP_EDITOR_OFFSET>0) { + TILEMAP_EDITOR_OFFSET-=TILEMAP_EDITOR_TILESIZE; + } }break; case GameState::ENCOUNTER_SELECT:{ if (!GetKey(SHIFT).bHeld) { @@ -3048,8 +3055,10 @@ void SeasonI::drawGame(){ case GameState::TILE_SELECT:{ //14x14 pixels per tile. Clear(Pixel(64,64,128)); - DrawDecal({0,0},SPRITES["terrainmap.png"],{TILEMAP_EDITOR_DRAW_MULT,TILEMAP_EDITOR_DRAW_MULT}); - DrawRectDecal(SELECTED_TILE*(TILEMAP_EDITOR_TILESIZE),{TILEMAP_EDITOR_TILESIZE,TILEMAP_EDITOR_TILESIZE},RED); + vi2d drawpos={0,-TILEMAP_EDITOR_OFFSET}; + DrawDecal(drawpos,SPRITES["terrainmap.png"],{TILEMAP_EDITOR_DRAW_MULT,TILEMAP_EDITOR_DRAW_MULT}); + vi2d calculatedTile={SELECTED_TILE.x,SELECTED_TILE.y-(int)(TILEMAP_EDITOR_OFFSET/TILEMAP_EDITOR_TILESIZE)}; + DrawRectDecal(calculatedTile*(TILEMAP_EDITOR_TILESIZE),{TILEMAP_EDITOR_TILESIZE,TILEMAP_EDITOR_TILESIZE},RED); }break; case GameState::OBJ_SELECT:{ vd2d drawpos={0,0}; @@ -3178,6 +3187,7 @@ void SeasonI::drawGame(){ GetMousePos().y>=drawpos.y&& GetMousePos().y