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

Renamed cFinishGenSingleBiomeSingleTopBlock to cFinishGenSingleTopBlock #1254

Merged
merged 6 commits into from
Jul 29, 2014

Conversation

NiLSPACE
Copy link
Member

Now accepts a vector of biomes and a vector of allowed blocks.
Also the deadbushes finisher generates in mesa biomes as well.

// Returns true if the given blocktype may be below m_BlockType
bool IsAllowedBlockBelow(BLOCKTYPE a_BlockBelow)
{
for (BlockList::iterator itr = m_AllowedBelow.begin(); itr != m_AllowedBelow.end(); ++itr)
Copy link
Member

Choose a reason for hiding this comment

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

I think you can change this to a std::find.

@madmaxoft
Copy link
Member

Do not use std::find as @tigerw is trying to force you, but rather use a fixed-size flat array for constant-time lookup:

/** Each allowed biome has a true value here, all the others are false. */
bool m_IsBiomeAllowed[256];

inline bool IsAllowedBiome(EMCSBiome a_Biome)
{
  return m_IsBiomeAllowed[a_Biome];
}

@tigerw
Copy link
Member

tigerw commented Jul 28, 2014

trying to force you

Slander! Misrepresentation of the truth!


Compilation failed.

@NiLSPACE
Copy link
Member Author

How can I create a flat array?

@madmaxoft
Copy link
Member

That's the first declaration in my code example, bool m_IsBiomeAllowed[256]. Of course, you need to fill it with proper data before using it, that's what your constructor should take care of.

@NiLSPACE
Copy link
Member Author

How did I not see that part. Sorry :S

@NiLSPACE
Copy link
Member Author

Done.

@@ -456,12 +456,12 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
////////////////////////////////////////////////////////////////////////////////
// cFinishGenLilypads:

int cFinishGenSingleBiomeSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
int cFinishGenSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
Copy link
Member

Choose a reason for hiding this comment

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

Change the comment above, too, will you?

@NiLSPACE
Copy link
Member Author

Done

AllowedBiomes.push_back(biMesaPlateauFM);
AllowedBiomes.push_back(biMesaPlateauM);

// A list with all the allowed blocks that can be below the lilypad.
Copy link
Member

Choose a reason for hiding this comment

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

lilypad -> dead bush (or death bush? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops ;)

Removed whitespace
fixed dead bush comment
@NiLSPACE
Copy link
Member Author

Done

madmaxoft added a commit that referenced this pull request Jul 29, 2014
Renamed cFinishGenSingleBiomeSingleTopBlock to cFinishGenSingleTopBlock
@madmaxoft madmaxoft merged commit d715eb7 into master Jul 29, 2014
@NiLSPACE NiLSPACE deleted the SingleTopBlockFinisher branch July 29, 2014 20:04
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

3 participants