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

Added new texture for NPC #251

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
branching into my respiratory
Turah09 committed Apr 29, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 162cf3dbd2f28ed9250479fd7b018dbf793c3eea
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
#define SHOW_INFO_TEXT 1
#define SHOW_CHAT_TEXT 1
#define SHOW_PLAYER_NAMES 1
#define SHOW_NPC 1

// key bindings
#define CRAFT_KEY_FORWARD 'W'
3 changes: 2 additions & 1 deletion src/cube.c
Original file line number Diff line number Diff line change
@@ -4,13 +4,14 @@
#include "matrix.h"
#include "util.h"


void make_cube_faces(
float *data, float ao[6][4], float light[6][4],
int left, int right, int top, int bottom, int front, int back,
int wleft, int wright, int wtop, int wbottom, int wfront, int wback,
float x, float y, float z, float n)
{
static const float positions[6][4][3] = {
positions[6][4][3] = {
{{-1, -1, -1}, {-1, -1, +1}, {-1, +1, -1}, {-1, +1, +1}},
{{+1, -1, -1}, {+1, -1, +1}, {+1, +1, -1}, {+1, +1, +1}},
{{-1, +1, -1}, {-1, +1, +1}, {+1, +1, -1}, {+1, +1, +1}},
4 changes: 1 addition & 3 deletions src/item.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "item.h"
#include "util.h"

=
const int items[] = {
// items the user can build
GRASS,
17 changes: 17 additions & 0 deletions src/npc.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
#ifndef _npc_h_
#define _npc_h_

void make_cube_faces(
float *data, float ao[6][4], float light[6][4],
int left, int right, int top, int bottom, int front, int back,
int wleft, int wright, int wtop, int wbottom, int wfront, int wback,
float x, float y, float z, float n);

void make_cube(
float *data, float ao[6][4], float light[6][4],
int left, int right, int top, int bottom, int front, int back,
float x, float y, float z, float n, int w);

void make_cube_wireframe(
float *data, float x, float y, float z, float n);

void make_npc(
float *data,
float x, float y, float n, float m, char c);

void make_character_3d(
float *data, float x, float y, float z, float n, int face, char c);

void make_sphere(float *data, float r, int detail);
#endif