You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
730 B
C++

1 year ago
#include <raylib.h>
#include "Chunk.h"
#include <map>
#include <string>
#include <memory>
#include <iostream>
#include <raylib.h>
Chunk::Chunk(int x, int y, int size, Color color)
: m_x(x), m_y(y), m_size(size), m_color(color)
{}
void Chunk::LoadTextures(std::map<std::string, Texture2D*> textures) {
// Access and process the textures
myMap = textures;
}
void Chunk::Draw()
{
if (myMap["grass"]) DrawTexturePro(*(myMap["grass"]), { 0, 0, static_cast<float>(myMap["grass"]->width), static_cast<float>(myMap["grass"]->height) },
{ 0, 0, static_cast<float>(myMap["grass"]->width * 2), static_cast<float>(myMap["grass"]->height * 2) },
{ 0, 0 }, 0.0f, WHITE);
}