Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve issue 5 #24

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const int items[] = {
SUN_FLOWER,
WHITE_FLOWER,
BLUE_FLOWER,
STAR,
DARK_AND_LIGHT,
COLOR_FUL,
STONE_CEMENT_MIX,
COLOR_00,
COLOR_01,
COLOR_02,
Expand Down Expand Up @@ -61,6 +65,11 @@ const int items[] = {

const int item_count = sizeof(items) / sizeof(int);

/**
* numbers refer to position in the texture.png file, 1
* 6x16 pixel units are parsed into blocks
* a new 16x16 texture was added for a 'star' block
*/
const int blocks[256][6] = {
// w => (left, right, top, bottom, front, back) tiles
{0, 0, 0, 0, 0, 0}, // 0 - empty
Expand All @@ -80,21 +89,25 @@ const int blocks[256][6] = {
{13, 13, 13, 13, 13, 13}, // 14 - chest
{14, 14, 14, 14, 14, 14}, // 15 - leaves
{15, 15, 15, 15, 15, 15}, // 16 - cloud
{0, 0, 0, 0, 0, 0}, // 17
{0, 0, 0, 0, 0, 0}, // 17
{0, 0, 0, 0, 0, 0}, // 18
{0, 0, 0, 0, 0, 0}, // 19
{0, 0, 0, 0, 0, 0}, // 20
{0, 0, 0, 0, 0, 0}, // 21
{0, 0, 0, 0, 0, 0}, // 22
{0, 0, 0, 0, 0, 0}, // 23
{0, 0, 0, 0, 0, 0}, // 24
//defining new block star
{55, 55, 55, 55, 55, 55}, // 24
{0, 0, 0, 0, 0, 0}, // 25
{0, 0, 0, 0, 0, 0}, // 26
{0, 0, 0, 0, 0, 0}, // 27
{0, 0, 0, 0, 0, 0}, // 28
{0, 0, 0, 0, 0, 0}, // 29
{0, 0, 0, 0, 0, 0}, // 30
{0, 0, 0, 0, 0, 0}, // 31
//defining new block dark and light stone
{11, 11, 11, 12, 12, 12}, // 29
//defining new block combo of colors
{176, 179, 183, 185, 187, 196}, // 30
//defining new block stone/cement mix
{2, 2, 5, 5, 2, 2}, // 31
{176, 176, 176, 176, 176, 176}, // 32
{177, 177, 177, 177, 177, 177}, // 33
{178, 178, 178, 178, 178, 178}, // 34
Expand Down
4 changes: 4 additions & 0 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#define SUN_FLOWER 21
#define WHITE_FLOWER 22
#define BLUE_FLOWER 23
#define STAR 24
#define DARK_AND_LIGHT 29
#define COLOR_FUL 30
#define STONE_CEMENT_MIX 31
#define COLOR_00 32
#define COLOR_01 33
#define COLOR_02 34
Expand Down
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,8 @@ int main(int argc, char **argv) {
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
load_png_texture("textures/texture.png");
//updated to new texture file that was edited to include a new block texture
load_png_texture("textures/texture2.png");

GLuint font;
glGenTextures(1, &font);
Expand Down
Binary file added textures/texture2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.