commit
7f76c7f362
|
@ -29,9 +29,9 @@ by using templates.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../BiomeDef.h"
|
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include "../BiomeDef.h"
|
||||||
|
#include "../Noise/Noise.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,25 @@ overhead; this however means that there's (an arbitrary) limit to the size of th
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Maximum size of the generated area.
|
||||||
|
This value is used only if there isn't an override in place.
|
||||||
|
To adjust the actual buffer size, just do a "#define PROT_INT_BUFFER_SIZE 9000" before including this header.
|
||||||
|
Note, however, that you should use a consistent value throughout a single project. */
|
||||||
|
#ifndef PROT_INT_BUFFER_SIZE
|
||||||
|
#define PROT_INT_BUFFER_SIZE 900
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Interface that all the generator classes provide. */
|
/** Interface that all the generator classes provide. */
|
||||||
class cProtIntGen
|
class cProtIntGen
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
/** Maximum size of the generated area.
|
/** Maximum size of the generated area.
|
||||||
Adjust the constant if you need larger areas, these are just so that we can use fixed-size buffers. */
|
Adjust the constant if you need larger areas, these are just so that we can use fixed-size buffers. */
|
||||||
static const int m_BufferSize = 900;
|
static const int m_BufferSize = PROT_INT_BUFFER_SIZE;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -99,26 +99,11 @@
|
||||||
|
|
||||||
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
|
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
|
||||||
|
|
||||||
/*
|
|
||||||
// Copy and uncomment this into another #elif section based on your compiler identification
|
|
||||||
|
|
||||||
// Explicitly mark classes as abstract (no instances can be created)
|
|
||||||
#define abstract
|
|
||||||
|
|
||||||
// Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class)
|
|
||||||
#define override
|
|
||||||
|
|
||||||
// Mark functions as obsolete, so that their usage results in a compile-time warning
|
|
||||||
#define OBSOLETE
|
|
||||||
|
|
||||||
// Mark types / variables for alignment. Do the platforms need it?
|
|
||||||
#define ALIGN_8
|
|
||||||
#define ALIGN_16
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define NORETURNDEBUG NORETURN
|
#define NORETURNDEBUG NORETURN
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -92,8 +92,8 @@ template <typename TYPE> void LinearUpscale2DArray(
|
||||||
{
|
{
|
||||||
// For optimization reasons, we're storing the upscaling ratios in a fixed-size arrays of these sizes
|
// For optimization reasons, we're storing the upscaling ratios in a fixed-size arrays of these sizes
|
||||||
// Feel free to enlarge them if needed, but keep in mind that they're on the stack
|
// Feel free to enlarge them if needed, but keep in mind that they're on the stack
|
||||||
const int MAX_UPSCALE_X = 128;
|
const int MAX_UPSCALE_X = 129;
|
||||||
const int MAX_UPSCALE_Y = 128;
|
const int MAX_UPSCALE_Y = 129;
|
||||||
|
|
||||||
ASSERT(a_Src != nullptr);
|
ASSERT(a_Src != nullptr);
|
||||||
ASSERT(a_Dst != nullptr);
|
ASSERT(a_Dst != nullptr);
|
||||||
|
@ -101,8 +101,8 @@ template <typename TYPE> void LinearUpscale2DArray(
|
||||||
ASSERT(a_SrcSizeY > 0);
|
ASSERT(a_SrcSizeY > 0);
|
||||||
ASSERT(a_UpscaleX > 0);
|
ASSERT(a_UpscaleX > 0);
|
||||||
ASSERT(a_UpscaleY > 0);
|
ASSERT(a_UpscaleY > 0);
|
||||||
ASSERT(a_UpscaleX <= MAX_UPSCALE_X);
|
ASSERT(a_UpscaleX < MAX_UPSCALE_X);
|
||||||
ASSERT(a_UpscaleY <= MAX_UPSCALE_Y);
|
ASSERT(a_UpscaleY < MAX_UPSCALE_Y);
|
||||||
|
|
||||||
// Pre-calculate the upscaling ratios:
|
// Pre-calculate the upscaling ratios:
|
||||||
TYPE RatioX[MAX_UPSCALE_X];
|
TYPE RatioX[MAX_UPSCALE_X];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user