This commit is contained in:
2025-06-08 17:22:30 +02:00
parent 64cac7578d
commit 79c8b747cd
16 changed files with 686 additions and 79 deletions

View File

@@ -74,26 +74,26 @@ inline void adjustRect(SDL_Rect *rect, SDL_Rect playerRect) {
// return x > 0 && y > 0 && x < DISPLAY_WIDTH && y < DISPLAY_HEIGHT;
//}
//bool isInboundsRect(SDL_Rect rect) {
// if (isInbounds(rect.x, rect.y)) {
//bool isInboundsRect(SDL_Rect tileRect) {
// if (isInbounds(tileRect.x, tileRect.y)) {
// return true;
// }
// if (rect.x < 0) {
// rect.x += rect.w;
// if (tileRect.x < 0) {
// tileRect.x += tileRect.w;
// }
// if (rect.y < 0) {
// rect.y += rect.h;
// if (tileRect.y < 0) {
// tileRect.y += tileRect.h;
// }
// if (isInbounds(rect.x, rect.y)) {
// if (isInbounds(tileRect.x, tileRect.y)) {
// return true;
// }
// if (rect.x > DISPLAY_WIDTH) {
// rect.x -= rect.w;
// if (tileRect.x > DISPLAY_WIDTH) {
// tileRect.x -= tileRect.w;
// }
// if (rect.y > DISPLAY_HEIGHT) {
// rect.y -= rect.h;
// if (tileRect.y > DISPLAY_HEIGHT) {
// tileRect.y -= tileRect.h;
// }
// return isInbounds(rect.x, rect.y);
// return isInbounds(tileRect.x, tileRect.y);
//}
void initPlayer(Player *plr) {
@@ -163,7 +163,6 @@ void renderPlayer(Player *plr) {
SDL_SetRenderDrawColor(mainRenderer, 0, 0, 0, 0);
SDL_SetRenderTarget(mainRenderer, entityTexture);
SDL_RenderClear(mainRenderer);
SDL_RenderCopy(mainRenderer, atlasTexture, &playerTextureRect, &PlayerRect);
//SDL_RenderCopy(mainRenderer, PlayerTexture, NULL, &PlayerRect);
SDL_SetRenderTarget(mainRenderer, hudTexture);