Skip to content
Open
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
12 changes: 4 additions & 8 deletions game/assets/patches/patch_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@
# * The X and Y destination coordinates will be multiplied by 16.
# * The texture doesn't have to be 16x16, all of it will be patched on to terrain.png.

grass_sides_tint|true

# Add festive patches
terrain|2|14|n_rocket_launcher.png
terrain|3|14|n_rocket_launched.png
items|14|2|n_rocket.png

# Add plant veggie patches
terrain|7|2|tall_grass.png
terrain|7|3|dead_bush.png
# terrain|8|3|fern.png
terrain|15|3|spruce_sapling.png
terrain|15|4|birch_sapling.png
# Add pocket patches
terrain|12|0|p_rose.png
terrain|14|1|p_crying_obsidian.png
items|2|15|p_camera.png

# Stop now to ignore the below commands. They're for a patch I'm working on that I don't want to release yet.
stop_now
Expand Down
13 changes: 3 additions & 10 deletions source/client/gui/components/OptionList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ void OptionList::initDefaultMenu()
void OptionList::initVideoMenu()
{
Options* pOptions = m_pMinecraft->getOptions();
int currentIndex = -1;
int idxGrass = -1, idxBiome = -1;
int currentIndex = false;

OPTION(Distance, m_iViewDistance, "Render Distance");
OPTION(Boolean, m_bThirdPerson, "Third Person View");
Expand All @@ -301,16 +300,10 @@ void OptionList::initVideoMenu()
OPTION(Boolean, m_bViewBobbing, "View Bobbing");
OPTION(Boolean, m_bAnaglyphs, "3D Anaglyph");
OPTION(Boolean, m_bBlockOutlines, "Block Outlines");
OPTION(Render, m_bFancyGrass, "Fancy Grass"); idxGrass = currentIndex; // renders colored grass side overlay
OPTION(Render, m_bBiomeColors, "Biome Colors"); idxBiome = currentIndex; // colors the grass based on the current biome
OPTION(Render, m_bFancyGrass, "Fancy Grass");
OPTION(Render, m_bBiomeColors, "Biome Colors");
OPTION(Boolean, m_bDontRenderGui, "Hide GUI");
OPTION(Boolean, m_bDynamicHand, "Dynamic Hand Movement");

if (!GetPatchManager()->IsGrassSidesTinted())
m_items[idxGrass]->setDisabled(true);

if (!GrassColor::isAvailable() || !FoliageColor::isAvailable())
m_items[idxBiome]->setDisabled(true);
}

void OptionList::initControlsMenu()
Expand Down
1 change: 1 addition & 0 deletions source/client/gui/screens/IngameBlockSelectionScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ IngameBlockSelectionScreen::IngameBlockSelectionScreen() :
addCreativeItem(Tile::treeTrunk->m_ID, 1);
addCreativeItem(Tile::treeTrunk->m_ID, 2);
addCreativeItem(Tile::cactus->m_ID);
addCreativeItem(Tile::tallGrass->m_ID);
addCreativeItem(Tile::deadBush->m_ID);
addCreativeItem(Tile::pumpkin->m_ID);
addCreativeItem(Tile::pumpkinLantern->m_ID);
Expand Down
7 changes: 1 addition & 6 deletions source/client/options/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,7 @@ void Options::_load()
else if (key == "gfx_blockoutlines")
m_bBlockOutlines = readBool(value);
else if (key == "gfx_fancygrass")
{
if (!(GetPatchManager()->IsGrassSidesTinted()))
m_bFancyGrass = false;
else
m_bFancyGrass = readBool(value);
}
m_bFancyGrass = readBool(value);
else if (key == "gfx_biomecolors")
{
if (!GrassColor::isAvailable() && !FoliageColor::isAvailable())
Expand Down
21 changes: 0 additions & 21 deletions source/client/renderer/PatchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,6 @@ void PatchManager::LoadPatchData(const std::string& patchData)
ReadInt(lineStream, m_nMetalSideYOffset);
continue;
}
if (command == "grass_sides_tint")
{
ReadBool(lineStream, m_bGrassSidesTinted);

if (m_bGrassSidesTinted)
// push a magic value so we can determine whether to disable it if the file doesn't exist
m_patchData.push_back(PatchData(TYPE_TERRAIN, 100, 100, "grass_side_transparent.png"));

continue;
}

LOG_W("Unknown command %s from patch data.", command.c_str());
}
Expand All @@ -185,24 +175,18 @@ void PatchManager::PatchTextures(TextureData& texture, ePatchType patchType)
if (pd.m_type != patchType)
continue;

bool bDisableFancyGrassIfFailed = false;

// got the magic value, we can determine whether to disable fancy pants grass if the file doesn't exist
if (pd.m_destX == 1600 && pd.m_destY == 1600 && pd.m_type == TYPE_TERRAIN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you said you removed this? I don't think this is needed.

{
pd.m_destX = 4 * 16;
pd.m_destY = 5 * 16;

bDisableFancyGrassIfFailed = true;
}

// N.B. Well, in some cases, you do want things to fail nicely.
TextureData patchTex = Resource::loadTexture("patches/" + pd.m_filename);
if (patchTex.isEmpty())
{
LOG_W("Image %s was not found?! Skipping", pd.m_filename.c_str());
if (bDisableFancyGrassIfFailed)
m_bGrassSidesTinted = false;
continue;
}

Expand Down Expand Up @@ -253,11 +237,6 @@ bool PatchManager::IsGlassSemiTransparent()
return m_bGlassSemiTransparent;
}

bool PatchManager::IsGrassSidesTinted()
{
return m_bGrassSidesTinted;
}

void PatchManager::ReadBool(std::istream& is, bool& b)
{
std::string flag;
Expand Down
2 changes: 0 additions & 2 deletions source/client/renderer/PatchManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class PatchManager
bool IsGrassTinted();
int GetMetalSideYOffset();
bool IsGlassSemiTransparent();
bool IsGrassSidesTinted();

private:
void ReadBool(std::istream& is, bool& b);
Expand All @@ -91,7 +90,6 @@ class PatchManager
bool m_bGrassTinted;
bool m_bGlassSemiTransparent;
int m_nMetalSideYOffset;
bool m_bGrassSidesTinted;
std::vector<PatchData> m_patchData;
};

Expand Down
20 changes: 10 additions & 10 deletions source/client/renderer/TileRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r
if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0)
{
t.color(topR * 0.8f * fLight, topG * 0.8f * fLight, topB * 0.8f * fLight);
renderNorth(tile, pos, TEXTURE_NONE84);
renderNorth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
}
}

Expand All @@ -741,7 +741,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r
if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0)
{
t.color(topR * 0.8f * fLight, topG * 0.8f * fLight, topB * 0.8f * fLight);
renderSouth(tile, pos, TEXTURE_NONE84);
renderSouth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
}
}

Expand All @@ -760,7 +760,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r
if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0)
{
t.color(topR * 0.6f * fLight, topG * 0.6f * fLight, topB * 0.6f * fLight);
renderWest(tile, pos, TEXTURE_NONE84);
renderWest(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
}
}

Expand All @@ -779,7 +779,7 @@ bool TileRenderer::tesselateBlockInWorld(Tile* tile, const TilePos& pos, float r
if (m_bFancyGrass && texture == TEXTURE_GRASS_SIDE && this->m_fixedTexture < 0)
{
t.color(topR * 0.6f * fLight, topG * 0.6f * fLight, topB * 0.6f * fLight);
renderEast(tile, pos, TEXTURE_NONE84);
renderEast(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
}
}

Expand Down Expand Up @@ -2965,22 +2965,22 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionV2(Tile* tile, cons
switch (dir)
{
case Facing::DOWN:
renderFaceUp(tile, pos, TEXTURE_NONE84);
renderFaceUp(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
case Facing::UP:
renderFaceDown(tile, pos, TEXTURE_NONE84);
renderFaceDown(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
case Facing::NORTH:
renderNorth(tile, pos, TEXTURE_NONE84);
renderNorth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
case Facing::SOUTH:
renderSouth(tile, pos, TEXTURE_NONE84);
renderSouth(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
case Facing::WEST:
renderWest(tile, pos, TEXTURE_NONE84);
renderWest(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
case Facing::EAST:
renderEast(tile, pos, TEXTURE_NONE84);
renderEast(tile, pos, TEXTURE_GRASS_SIDE_OVERLAY);
break;
}
}
Expand Down
37 changes: 24 additions & 13 deletions source/common/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ enum eTileID
TILE_RAIL_ACTIVATOR,
TILE_PISTON_STICKY,
TILE_COBWEB,
TILE_TALLGRASS,
TILE_TALL_GRASS,
TILE_DEAD_BUSH,
TILE_PISTON,
TILE_PISTON_HEAD,
Expand Down Expand Up @@ -229,7 +229,7 @@ enum eTileID
TILE_STONE_BRICKS,
TILE_MUSHROOM1_BLOCK,
TILE_MUSHROOM2_BLOCK,
TILE_CLOTH_00 = 101, // @TODO: make these save on newer worlds
TILE_CLOTH_00 = 101,
TILE_CLOTH_10,
TILE_CLOTH_20,
TILE_CLOTH_30,
Expand Down Expand Up @@ -354,7 +354,9 @@ enum eTileID
ITEM_BED,
ITEM_DIODE,
ITEM_COOKIE,
ITEM_RECORD_01,
ITEM_MAP,
ITEM_SHEARS,
ITEM_RECORD_01 = 2000,
ITEM_RECORD_02,
ITEM_CAMERA = 456,

Expand Down Expand Up @@ -395,16 +397,16 @@ enum // Textures
TEXTURE_CHEST_ONE_FRONT,
TEXTURE_MUSHROOM_RED,
TEXTURE_MUSHROOM_BROWN,
TEXTURE_NONE30,
TEXTURE_OBSIDIAN_CRYING,
TEXTURE_FIRE1,
TEXTURE_ORE_GOLD,
TEXTURE_ORE_IRON,
TEXTURE_ORE_COAL,
TEXTURE_BOOKSHELF,
TEXTURE_MOSSY_STONE,
TEXTURE_OBSIDIAN,
TEXTURE_OBSIDIAN_CRYING, // would become grass side overlay after removel
TEXTURE_NONE39, // tall grass
TEXTURE_GRASS_SIDE_OVERLAY,
TEXTURE_TALL_GRASS,
TEXTURE_NONE40,
TEXTURE_CHEST_TWO_FRONT_LEFT,
TEXTURE_CHEST_TWO_FRONT_RIGHT,
Expand All @@ -420,7 +422,7 @@ enum // Textures
TEXTURE_LEAVES_TRANSPARENT,
TEXTURE_LEAVES_OPAQUE,
TEXTURE_NONE54,
TEXTURE_NONE55, // dead bush
TEXTURE_DEAD_BUSH,
TEXTURE_NONE56,
TEXTURE_CHEST_TWO_BACK_LEFT,
TEXTURE_CHEST_TWO_BACK_RIGHT,
Expand Down Expand Up @@ -449,7 +451,7 @@ enum // Textures
TEXTURE_DOOR_TOP,
TEXTURE_DOOR_IRON_TOP,
TEXTURE_LADDER,
TEXTURE_NONE84,
TEXTURE_TRAPDOOR,
TEXTURE_NONE85,
TEXTURE_FARMLAND,
TEXTURE_FARMLAND_DRY,
Expand All @@ -471,8 +473,8 @@ enum // Textures
TEXTURE_BLOODSTONE,
TEXTURE_SOULSAND,
TEXTURE_GLOWSTONE,
TEXTURE_NONE106,
TEXTURE_NONE107,
TEXTURE_STICKY_PISTON,
TEXTURE_PISTON,
TEXTURE_NONE108,
TEXTURE_NONE109,
TEXTURE_NONE110,
Expand All @@ -493,9 +495,13 @@ enum // Textures
TEXTURE_NONE125,
TEXTURE_NONE126,
TEXTURE_NONE127,
TEXTURE_RAIL,

TEXTURE_LAPIS = 144,
TEXTURE_ORE_LAPIS = 160,
TEXTURE_POWERED_RAIL = 163,
TEXTURE_REDSTONE_DUST,
TEXTURE_DETECTOR_RAIL = 195,

TEXTURE_SANDSTONE_TOP = 176,
TEXTURE_SANDSTONE_SIDE = 192,
Expand All @@ -518,14 +524,19 @@ enum eRenderShape
SHAPE_TORCH,
SHAPE_FIRE,
SHAPE_WATER,
SHAPE_UNK5,
SHAPE_UNK6,
SHAPE_DUST,
SHAPE_CROPS,
SHAPE_DOOR,
SHAPE_LADDER,
SHAPE_UNK9,
SHAPE_RAIL,
SHAPE_STAIRS,
SHAPE_FENCE,
SHAPE_LEVER,
SHAPE_CACTUS,
SHAPE_BED,
SHAPE_REPEATER,
SHAPE_PISTON,
SHAPE_PISTON_HEAD,
SHAPE_RANDOM_CROSS
};

Expand Down
5 changes: 3 additions & 2 deletions source/world/item/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ void Inventory::prepareSurvivalInventory()
addTestItem(Tile::obsidian->m_ID, 64);
addTestItem(Tile::fire->m_ID, 64);*/

// 0.2.1 items
#ifdef MOD_POCKET_SURVIVAL
addCreativeItem(ITEM_SHOVEL_STONE);
addCreativeItem(ITEM_PICKAXE_STONE);
addCreativeItem(ITEM_HATCHET_STONE);
//addCreativeItem(ITEM_SHEARS);
addCreativeItem(ITEM_SHEARS);
addCreativeItem(ITEM_SWORD_STONE);
addCreativeItem(TILE_LADDER);
addCreativeItem(TILE_TORCH);
Expand Down Expand Up @@ -98,7 +100,6 @@ void Inventory::prepareSurvivalInventory()
addCreativeItem(TILE_CACTUS);
addCreativeItem(ITEM_REEDS);

#ifdef MOD_POCKET_SURVIVAL
for (size_t i = 0; i < m_items.size(); i++)
{
ItemStack& item = m_items[i];
Expand Down
Loading
Loading