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

Blocks up to Minecraft 1.4 #41

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open

Conversation

akudeukie
Copy link

Added code to handle drawing of new block tiles. Also added handling of cobblestone wall intersections while rendering world tiles.

Following blocks are included:

  • Carrot crops;
  • Potato crops;
  • Cobblestone/Moss stone walls;
  • Command block;
  • Beacon;
  • Anvil;
  • Wooden button;
  • Flower pots.

Following things are NOT included:

  • Head (would require additional prerequisites - mob textures);
  • Item frames (they are entities, not blocks?).

Moved deinterpolate() method higher, so it is declared before new functions for drawing new blocks.

Changed how fence gate is being drawn (it's a bit taller now, but still crappy).

slicedlime and others added 28 commits October 27, 2012 00:25
-f sets the format (png, jpeg or both)
-j sets jpeq quality
- Optimized former macro functions a fair bit.
- Use a struct with id/data to simplify code a lot.
- Got rid of uninitialized variables by using the above struct as return value.
- Fixed crash bug when trying to shadow the bottom block in a row (access block -1)
- Added a few asserts to sanity check function inputs/outputs.
Added new blocks:
- carrot crops
- potato crops
- Simplified some access code that was doing things in over-complex ways or using needless branching.
- Moved common early-outs earlier to avoid doing calculations.
- Delay doing some calculations until really needed.
- Store block data in uint16 internally, instead of doing conversion from source format (mcr/anvil). This takes up 4 bits of wasted space per block but speeds up access. Complexity of access has now been moved to load time, but we access blocks far more often than we load chunks.
Added new blocks:
- Command Block
- Implemented rendering of Cobblestone/Moss walls (acceptable, but with
minor anomalies in rendered tiles in blocks-X.png)
Added new blocks:
- Anvil;
- Beacon;
- Wooden button.
Improved cobblestone wall sprite generation (final).
Cleaned up hardcoded values in Beacon drawing code;
Added extra detail to Anvil block.
- Added flower pots!
- Made fence gate more prominent (taller);
- Cleaned up and reworked base tile drawing code; Now it draws precise
and correct base tiles; Also made it easier to reuse.
Conflicts:
	Makefile
	blockimages.cpp
	blockimages.h
	chunk.cpp
	chunk.h
	map.cpp
	map.h
	pigmap.cpp
	region.h
	render.cpp
	rgba.cpp
	rgba.h
	tables.cpp
	tables.h
	template.html
	utils.cpp
@toomuchpete
Copy link

For the record: I can't get this to run with a custom graphics library. No matter what I try, it tells me it can't find one of the required image files (but not which one).

I have tried copying an entire tileset (with the chest pngs in items/), I've tried moving those pngs into the main folder, I've tried symlinks, no symlinks, etc. Nothing works for me. Haven't actually been able to get this to render anything yet because of that problem.

Major changes:
- Rewrote & refactored block tile generation code;
- Block IDs are no more hard-coded (for the most part);
- Added external block configuration files;
- Added ability to apply few filters to textures (when generating block
tiles);
New blocks from upcoming Minecraft 1.5:
- Trapped Chest;
- Weighted pressure plates (light + heavy);
- Redstone comparator;
- Daylight Sensor;
- Block of Redstone;
- Nether Quartz Ore;
- Hopper;
- Block of Quartz;
- Quartz Stairs;
- Quartz Slab;
- Activator Rail;
- Dropper.
Other changes:
- Added few functions for manipulating RGBAImage;
- Changed to UNIX EOL formatting in modified files.
@noidexe
Copy link

noidexe commented Jan 27, 2013

@akudeukie I'm trying to compile your fork but I get the following error:

rgba.cpp: In member function ‘bool RGBAImage::writeJPEG(const string&)’:
rgba.cpp:267:29: error: ‘uint’ was not declared in this scope
rgba.cpp:267:34: error: expected ‘;’ before ‘w’
rgba.cpp:267:34: warning: for increment expression has no effect [-Wunused-value]
rgba.cpp:267:35: error: expected ‘)’ before ‘;’ token
rgba.cpp:267:39: error: name lookup of ‘x’ changed for ISO ‘for’ scoping [-fpermissive]
rgba.cpp:267:39: note: (if you use ‘-fpermissive’ G++ will accept your code)
rgba.cpp:267:40: error: expected ‘;’ before ‘)’ token
rgba.cpp:418:1: error: expected ‘}’ at end of input
rgba.cpp:266:14: warning: unused variable ‘p’ [-Wunused-variable]
rgba.cpp:418:1: error: expected ‘}’ at end of input
rgba.cpp:418:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [rgba.o] Error 1

Using -fpermissive i get:

rgba.cpp: In member function ‘bool RGBAImage::writeJPEG(const string&)’:
rgba.cpp:267:29: error: ‘uint’ was not declared in this scope
rgba.cpp:267:34: error: expected ‘;’ before ‘w’
rgba.cpp:267:34: warning: for increment expression has no effect [-Wunused-value]
rgba.cpp:267:35: error: expected ‘)’ before ‘;’ token
rgba.cpp:267:39: warning: name lookup of ‘x’ changed for ISO ‘for’ scoping [-fpermissive]
rgba.cpp:267:17: warning:   using obsolete binding at ‘x’ [-fpermissive]
rgba.cpp:267:40: error: expected ‘;’ before ‘)’ token
rgba.cpp:418:1: error: expected ‘}’ at end of input
rgba.cpp:266:14: warning: unused variable ‘p’ [-Wunused-variable]
rgba.cpp:418:1: error: expected ‘}’ at end of input
rgba.cpp:418:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [rgba.o] Error 1

The last commit I managed to compile was 3e903d1 . Is there anything I'm doing worng?

My distro is an up-to-date Manjaro Linux(Arch based)

@akudeukie
Copy link
Author

@noidexe

What version of g++ are you using? I was able to compile latest commit on Windows 7 under cygwin environment (g++ 4.5.3), and on Ubuntu Server distribution (g++ 4.7.2).

Also, those compile warnings are result of compiling de8c7de commit? Because I can't find in code anything, that relates to the provided error messages. Try pulling latest commit into new directory and compiling from scratch (with make command).

@noidexe
Copy link

noidexe commented Jan 30, 2013

Well, this is embarrasing. It seems that at some point I changed the remote to dominickpastore's and I forgot. I pulled de8c7de and it compiled with no errors.
Thanks for the help! 👍

UniversE and others added 25 commits March 19, 2013 20:35
Updated documentation + blocklist location changed (by UniversE)
New blocks from upcoming Minecraft 1.6:
- Hay Block;
- Carpet;
- Hardened Clay;
- Block of Coal.
-Updated up to 13w19a snapshot changes;
-Added Stained Hardened Clay block;
-Aligned wool carpet height to 1 unit/pixel down from 2
- Draw unused hay tiles (data bits) invisible
Minecraft 1.6 (1.6.2) - merging back to master branch
- Aligned all texture names with minecraft 1.6+ resources;
- Fixed comparator rendering (on/off uses same block ID);
- Added new block type for tall flowers (does not affect rendering);
- Added new tile directive - OVERLAY - to combine multiple textures in
one;
- Added special case for rendering tall flowers;
- Added new blocks: packed iced, tall flowers;
- Updated blocks: poppy(ID:38).
- Converting RGB to RGBA images (for few textures, that have no alpha
channel; yay! happy times!);
- Removed unnecessary textures.
- Added stained glass & stained glass pane;
- Glass panes connect with iron bars;
- Cleaned up README.
- New wood, leaves, planks, stairs, slabs & saplings related to new
trees: Acacia, Dark Oak;
- Some changes to block description types;
- Error output clean-up.
Minecraft 1.7 (1.7.2) features - merging to master
Texture names are now aligned to 1.7.2
- Added andesite, granite, diorite (+smooth variants)
- Added slime block
- Added prismarine blocks (rough, bricks, dark variants);
- Added sea lantern;
- Added wet sponge;
- Changed grassless dirt to coarse dirt;
- Fixed farmland (added hydrated farmland).
- Added new fence variants (acacia, birch, dark oak, jungle, spruce);
- Added new fence gate variants (acacia, birch, dark oak, jungle,
spruce);
- Added inverted daylight sensor;
- Added red sandstone blocks;
- Fixed sandstone/quartz inverted stairs showing wrong texture at the
top of the block;
- New fences and fence gates connect properly.
- Added chorus plant (kinda) and chorus flower;
- Added purpur block, stair and slab;
- Added end stone bricks;
Blocks from 1.9:
- Added end stone bricks;
- Added beetroot;
- Added grass path;
- Added end gateway;
- Added chained & repeating command blocks; also adjusted standard
command block;
- Added frosted ice;

Blocks from snapshots:
- Added magma block;
- Added nether wart block;
- Added red nether brick;
- Added bone block.
Blocks from 1.9:
- Added end rod;

Blocks from 1.11:
- Added observer (crude approximation);
- Added shulker boxes;

Blocks from snapshots (1.12):
- Added concrete and concrete powder blocks;
- Added glazed terracotta blocks;
- No colored beds :<

Other notes:
- Fixed EXPAND operator for texture list;
- Fixed import of PNG palette files;
- Archive with textures updated (link in README)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants