Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
b55fb4f2
Commit
b55fb4f2
authored
12 years ago
by
kwolekr
Committed by
Perttu Ahola
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Last set of minor cleanups
parent
1cd83510
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/biome.cpp
+12
-7
12 additions, 7 deletions
src/biome.cpp
src/biome.h
+5
-5
5 additions, 5 deletions
src/biome.h
src/irrlichttypes.h
+2
-1
2 additions, 1 deletion
src/irrlichttypes.h
src/porting.h
+14
-0
14 additions, 0 deletions
src/porting.h
src/settings.h
+1
-17
1 addition, 17 deletions
src/settings.h
with
34 additions
and
30 deletions
src/biome.cpp
+
12
−
7
View file @
b55fb4f2
...
@@ -181,7 +181,8 @@ int Biome::getSurfaceHeight(float noise_terrain) {
...
@@ -181,7 +181,8 @@ int Biome::getSurfaceHeight(float noise_terrain) {
}
}
void
Biome
::
genColumn
(
MapgenV7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
void
Biome
::
genColumn
(
Mapgen
*
mapgen
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
MapgenV7
*
mg
=
(
MapgenV7
*
)
mapgen
;
int
i
=
(
z
-
mg
->
node_min
.
Z
)
*
mg
->
csize
.
Z
+
(
x
-
mg
->
node_min
.
X
);
int
i
=
(
z
-
mg
->
node_min
.
Z
)
*
mg
->
csize
.
Z
+
(
x
-
mg
->
node_min
.
X
);
int
surfaceh
=
np
->
offset
+
np
->
scale
*
mg
->
map_terrain
[
i
];
int
surfaceh
=
np
->
offset
+
np
->
scale
*
mg
->
map_terrain
[
i
];
...
@@ -214,7 +215,8 @@ void Biome::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
...
@@ -214,7 +215,8 @@ void Biome::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
///////////////////////////// [ Ocean biome ] /////////////////////////////////
///////////////////////////// [ Ocean biome ] /////////////////////////////////
void
BiomeLiquid
::
genColumn
(
MapgenV7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
void
BiomeLiquid
::
genColumn
(
Mapgen
*
mapgen
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
MapgenV7
*
mg
=
(
MapgenV7
*
)
mapgen
;
int
i
=
(
z
-
mg
->
node_min
.
Z
)
*
mg
->
csize
.
Z
+
(
x
-
mg
->
node_min
.
X
);
int
i
=
(
z
-
mg
->
node_min
.
Z
)
*
mg
->
csize
.
Z
+
(
x
-
mg
->
node_min
.
X
);
int
surfaceh
=
np
->
offset
+
np
->
scale
*
mg
->
map_terrain
[
i
];
int
surfaceh
=
np
->
offset
+
np
->
scale
*
mg
->
map_terrain
[
i
];
int
y
=
y1
;
int
y
=
y1
;
...
@@ -239,8 +241,9 @@ int BiomeHell::getSurfaceHeight(float noise_terrain) {
...
@@ -239,8 +241,9 @@ int BiomeHell::getSurfaceHeight(float noise_terrain) {
}
}
void
BiomeHell
::
genColumn
(
MapgenV7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
void
BiomeHell
::
genColumn
(
Mapgen
*
mapgen
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
MapgenV7
*
mg
=
(
MapgenV7
*
)
mapgen
;
//stub
}
}
...
@@ -252,8 +255,9 @@ int BiomeAether::getSurfaceHeight(float noise_terrain) {
...
@@ -252,8 +255,9 @@ int BiomeAether::getSurfaceHeight(float noise_terrain) {
}
}
void
BiomeAether
::
genColumn
(
MapgenV7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
void
BiomeAether
::
genColumn
(
Mapgen
*
mapgen
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
MapgenV7
*
mg
=
(
MapgenV7
*
)
mapgen
;
//stub
}
}
...
@@ -265,7 +269,8 @@ int BiomeSuperflat::getSurfaceHeight(float noise_terrain) {
...
@@ -265,7 +269,8 @@ int BiomeSuperflat::getSurfaceHeight(float noise_terrain) {
}
}
void
BiomeSuperflat
::
genColumn
(
MapgenV7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
void
BiomeSuperflat
::
genColumn
(
Mapgen
*
mapgen
,
int
x
,
int
z
,
int
y1
,
int
y2
)
{
MapgenV7
*
mg
=
(
MapgenV7
*
)
mapgen
;
int
surfaceh
=
ntopnodes
;
int
surfaceh
=
ntopnodes
;
int
y
=
y1
;
int
y
=
y1
;
...
...
This diff is collapsed.
Click to expand it.
src/biome.h
+
5
−
5
View file @
b55fb4f2
...
@@ -53,26 +53,26 @@ class Biome {
...
@@ -53,26 +53,26 @@ class Biome {
std
::
string
name
;
std
::
string
name
;
NoiseParams
*
np
;
NoiseParams
*
np
;
virtual
void
genColumn
(
Mapgen
V7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
void
genColumn
(
Mapgen
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
};
};
class
BiomeLiquid
:
public
Biome
{
class
BiomeLiquid
:
public
Biome
{
virtual
void
genColumn
(
Mapgen
V7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
void
genColumn
(
Mapgen
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
};
};
class
BiomeHell
:
public
Biome
{
class
BiomeHell
:
public
Biome
{
virtual
void
genColumn
(
Mapgen
V7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
void
genColumn
(
Mapgen
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
};
};
class
BiomeAether
:
public
Biome
{
class
BiomeAether
:
public
Biome
{
virtual
void
genColumn
(
Mapgen
V7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
void
genColumn
(
Mapgen
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
};
};
class
BiomeSuperflat
:
public
Biome
{
class
BiomeSuperflat
:
public
Biome
{
virtual
void
genColumn
(
Mapgen
V7
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
void
genColumn
(
Mapgen
*
mg
,
int
x
,
int
z
,
int
y1
,
int
y2
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
virtual
int
getSurfaceHeight
(
float
noise_terrain
);
};
};
...
...
This diff is collapsed.
Click to expand it.
src/irrlichttypes.h
+
2
−
1
View file @
b55fb4f2
...
@@ -28,12 +28,13 @@ using namespace irr;
...
@@ -28,12 +28,13 @@ using namespace irr;
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
#ifdef _MSC_VER
#ifdef _MSC_VER
// Windows
// Windows
typedef
long
long
s64
;
typedef
unsigned
long
long
u64
;
typedef
unsigned
long
long
u64
;
#else
#else
// Posix
// Posix
#include
<stdint.h>
#include
<stdint.h>
typedef
int64_t
s64
;
typedef
uint64_t
u64
;
typedef
uint64_t
u64
;
//typedef unsigned long long u64;
#endif
#endif
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
src/porting.h
+
14
−
0
View file @
b55fb4f2
...
@@ -35,14 +35,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -35,14 +35,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define SWPRINTF_CHARSTRING L"%s"
#define SWPRINTF_CHARSTRING L"%s"
#endif
#endif
//currently not needed
//template<typename T> struct alignment_trick { char c; T member; };
//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
#ifdef _WIN32
#ifdef _WIN32
#include
<windows.h>
#include
<windows.h>
#define ALIGNOF(x) __alignof(x)
#define sleep_ms(x) Sleep(x)
#define sleep_ms(x) Sleep(x)
#define strtok_r(x, y, z) strtok_s(x, y, z)
#define strtof(x, y) (float)strtod(x, y)
#define strtoll(x, y, z) _strtoi64(x, y, z)
#define strtoull(x, y, z) _strtoui64(x, y, z)
#else
#else
#include
<unistd.h>
#include
<unistd.h>
#define ALIGNOF(x) __alignof__(x)
#define sleep_ms(x) usleep(x*1000)
#define sleep_ms(x) usleep(x*1000)
#endif
#endif
#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
namespace
porting
namespace
porting
{
{
...
...
This diff is collapsed.
Click to expand it.
src/settings.h
+
1
−
17
View file @
b55fb4f2
...
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include
"debug.h"
#include
"debug.h"
#include
"log.h"
#include
"log.h"
#include
"util/string.h"
#include
"util/string.h"
#include
"porting.h"
enum
ValueType
enum
ValueType
{
{
...
@@ -566,23 +567,6 @@ class Settings
...
@@ -566,23 +567,6 @@ class Settings
return
value
;
return
value
;
}
}
//template<typename T> struct alignment_trick { char c; T member; };
//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
#ifdef _WIN32
#define ALIGNOF(x) __alignof(x)
#else
#define ALIGNOF(x) __alignof__(x)
#endif
#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
#ifdef _WIN32
#define strtok_r(x, y, z) strtok_s(x, y, z)
#define strtof(x, y) (float)strtod(x, y)
#define strtoll(x, y, z) _strtoi64(x, y, z)
#define strtoull(x, y, z) _strtoui64(x, y, z)
#endif
typedef
long
long
int
s64
;
//to be added to src/irrlichttypes.h later
template
<
class
T
>
T
*
getStruct
(
std
::
string
name
,
std
::
string
format
)
template
<
class
T
>
T
*
getStruct
(
std
::
string
name
,
std
::
string
format
)
{
{
size_t
len
=
sizeof
(
T
);
size_t
len
=
sizeof
(
T
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment