fix background rendering

This commit is contained in:
Hunter 2023-05-28 12:35:48 -04:00
parent ae1e3e5aa3
commit f04bdc6e31
11 changed files with 335 additions and 18 deletions

View file

@ -1,8 +1,8 @@
#pragma once
// GFX constants
#define SCREEN_WIDTH 1000
#define SCREEN_HEIGHT 1000
//#define SCREEN_WIDTH 1000
//#define SCREEN_HEIGHT 1000
// 32x32 textures
#define TEXTURE_WIDTH 32

View file

@ -1,4 +1,5 @@
#pragma once
#include <SDL.h>
#include <string>
#include <vector>
@ -27,3 +28,5 @@ Map PLoadMapFromFile(std::string filepath);
Map PCreateNewMap(std::string filepath);
void PSaveMapToFile(Map *map, std::string filepath);
void PRenderMap(Map *map, bool debug = false);
void PRenderMapBackground(Map *map);
SDL_Rect PGetMapRect(Map *map);

View file

@ -15,6 +15,9 @@ struct GlobalState {
std::vector<PCollisionRect> collisions;
PhoenixAssets assets;
int scale = 20;
int screenWidth = 1000;
int screenHeight = 1000;
};
extern GlobalState state;