Rotatable and scalable backgrounds

Scroll background bug fix, room persistency demo bug fix
This commit is contained in:
CTurt 2014-09-21 16:19:42 +01:00
parent 51abd66b77
commit 19a0761b2c
6 changed files with 16 additions and 5 deletions

Binary file not shown.

View File

@ -107,7 +107,7 @@ void DSGM_ScrollBackgroundFull(DSGM_View *view, DSGM_Layer *layer) {
if(layer != NULL/* && background != DSGM_DEFAULT_FONT*/) {
if(layer->background != NULL) {
if(layer->vramId != 0) {
bgSetScroll(layer->vramId, layer->x - layer->attachedToView ? view->x : 0, layer->y - layer->attachedToView ? view->y : 0);
bgSetScroll(layer->vramId, layer->x - (layer->attachedToView ? view->x : 0), layer->y - (layer->attachedToView ? view->y : 0));
}
}
}

View File

@ -19,7 +19,18 @@ void DSGM_LoadRoom(DSGM_Room *room) {
DSGM_invalidateRoom = 0;
DSGM_InitCustomGFX(room->layers[DSGM_TOP][3].background == DSGM_DRAWABLE_BACKGROUND, room->layers[DSGM_BOTTOM][3].background == DSGM_DRAWABLE_BACKGROUND);
{
bool requiresMode3[2] = {false, false};
for(screen = 0; screen < 2; screen++) {
if(room->layers[screen][3].background == DSGM_DRAWABLE_BACKGROUND || room->layers[screen][3].background->type == BgType_ExRotation) {
DSGM_Log(false, "Screen %d requires Mode 3\n", screen);
requiresMode3[screen] = true;
}
}
DSGM_InitCustomGFX(requiresMode3[DSGM_TOP], requiresMode3[DSGM_BOTTOM]);
}
for(screen = 0; screen < 2; screen++) {
// Load backgrounds

View File

@ -3,10 +3,10 @@
#include "DSGM_projectHelper.h"
// User variables / declarations
#define LEFT 0
#define RIGHT 1
#define LEFT 1
#define RIGHT 3
#define UP 2
#define DOWN 3
#define DOWN 0
bool walkableTile(u16 tile) {
switch(tile) {