Bringing in some more realistic textures that are open source from https://opengameart.org/content/nekkrobox-world-textures

master
Zed A. Shaw 2 months ago
parent 1d6458ba19
commit 942bd052d4
  1. BIN
      pics/chess.png
  2. BIN
      pics/tile01.png
  3. BIN
      pics/tile02.png
  4. BIN
      pics/tile03.png
  5. BIN
      pics/tile05.png
  6. BIN
      pics/tile06.png
  7. BIN
      pics/tile07.png
  8. BIN
      pics/tile08.png
  9. BIN
      pics/tile09.png
  10. BIN
      pics/tile10.png
  11. BIN
      pics/tile11.png
  12. BIN
      pics/tile12.png
  13. BIN
      pics/tile13.png
  14. BIN
      pics/tile15.png
  15. BIN
      pics/tile16.png
  16. BIN
      pics/tile17.png
  17. BIN
      pics/tile30.png
  18. BIN
      pics/tile31.png
  19. BIN
      pics/tile32.png
  20. 25
      sfmlcaster.cpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

@ -57,8 +57,8 @@ double planeY = 0.66;
#define gray_color(c) rgba_color(c, c, c, 255)
std::vector<uint32_t> texture[8];
#define texWidth 64 // must be power of two
#define texHeight 64 // must be power of two
#define texWidth 256 // must be power of two
#define texHeight 256 // must be power of two
#define pixcoord(X, Y) ((Y) * SCREEN_HEIGHT) + (X)
@ -80,14 +80,14 @@ void load_textures() {
texture[i].resize(texWidth * texHeight);
}
loadImage(texture[0], "pics/eagle.png");
loadImage(texture[1], "pics/redbrick.png");
loadImage(texture[2], "pics/purplestone.png");
loadImage(texture[3], "pics/greystone.png");
loadImage(texture[4], "pics/bluestone.png");
loadImage(texture[5], "pics/mossy.png");
loadImage(texture[6], "pics/wood.png");
loadImage(texture[7], "pics/colorstone.png");
loadImage(texture[0], "pics/tile16.png");
loadImage(texture[1], "pics/tile02.png");
loadImage(texture[2], "pics/tile03.png");
loadImage(texture[3], "pics/tile32.png");
loadImage(texture[4], "pics/tile05.png");
loadImage(texture[5], "pics/tile17.png");
loadImage(texture[6], "pics/tile10.png");
loadImage(texture[7], "pics/tile01.png");
}
void draw_sfml_rect(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, uint8_t color) {
@ -274,7 +274,6 @@ void ray_casting(sf::RenderWindow &window, Matrix& map) {
double texPos = (drawStart - PITCH - h / 2 + lineHeight / 2) * step;
for(int y = drawStart; y < drawEnd; y++) {
// BUG? Why bitwise and here?
int texY = (int)texPos & (texHeight - 1);
texPos += step;
uint32_t color = texture[texNum][texHeight * texY + texX];
@ -315,9 +314,7 @@ void draw_ceiling_floor(sf::RenderWindow &window) {
floorX += floorStepX;
floorY += floorStepY;
int checkerBoardPattern = int(cellX + cellY) & 1;
int floorTexture = checkerBoardPattern == 0 ? 3 : 4;
int floorTexture = 3;
int ceilingTexture = 6;
uint32_t color;

Loading…
Cancel
Save