1
Programming / Re: Strange Display Errors
« on: November 17, 2012, 04:36:27 AM »I could well be wrong, but I am suspicious of those offsets.
How have you defined 'con'? At what size?
Just looking at the code - you seem to be putting things (console_put_char_ex) at up to MAP_WIDTH + offset, but only blitting up to MAP_WIDTH (for example) - at the very least that will mean you can't see all the changes you have made - and if you haven't made 'con' big enough, you could be printing outside this console.
Ahh, you were right! I was adding the offset to the offscreen console, instead I should've been adding it when I flushed it to the main screen.
Changed this;Code: [Select]#blit the contents of "con" to the root console
#libtcod.console_blit(srcConsole, srcX, srcY, scrWidth, scrHeight, trgtConsole, trgtX, trgtY)
libtcod.console_blit(con, 0, 0, MAP_WIDTH, MAP_HEIGHT, 0, 0, 0)
to this;Code: [Select]#blit the contents of "con" to the root console
#libtcod.console_blit(srcConsole, srcX, srcY, scrWidth, scrHeight, trgtConsole, trgtX, trgtY)
libtcod.console_blit(con, 0, 0, MAP_WIDTH, MAP_HEIGHT, 0, MAP_X_OFFSET, MAP_Y_OFFSET)
Did you changed the offset? Is it working now?