mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-17 19:22:32 +00:00
further libjava cleanup
This commit is contained in:
parent
ea539a7e58
commit
adb3adfb8a
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO
|
#include <vector>
|
||||||
|
|
||||||
class Arrays {
|
class Arrays {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO
|
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/Definitions.h" // 4jcraft TODO
|
#include "../../../Minecraft.World/ConsoleHelpers/Definitions.h" // 4jcraft TODO
|
||||||
|
|
||||||
class IntBuffer;
|
class IntBuffer;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO
|
|
||||||
|
|
||||||
class FloatBuffer : public Buffer {
|
class FloatBuffer : public Buffer {
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO
|
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
|
|
||||||
class IntBuffer : public Buffer {
|
class IntBuffer : public Buffer {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
class Random {
|
class Random {
|
||||||
private:
|
private:
|
||||||
int64_t seed;
|
int64_t seed;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO
|
|
||||||
|
class Biome;
|
||||||
|
class Node;
|
||||||
|
|
||||||
// 4J Jev, just thought it would be easier this way.
|
// 4J Jev, just thought it would be easier this way.
|
||||||
#define ArrayCopyFunctionDeclaration(x) \
|
#define ArrayCopyFunctionDeclaration(x) \
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "java/JavaMath.h"
|
#include "java/JavaMath.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
Random Math::rand = Random();
|
Random Math::rand = Random();
|
||||||
|
|
||||||
|
|
@ -41,11 +42,11 @@ int64_t Math::round(double d) {
|
||||||
d = std::floor(d + 0.5);
|
d = std::floor(d + 0.5);
|
||||||
|
|
||||||
// if smaller or bigger than representable int64 than return the max
|
// if smaller or bigger than representable int64 than return the max
|
||||||
if (d >= (double)INT64_MAX) {
|
if (d >= (double)std::numeric_limits<int64_t>::max()) {
|
||||||
return INT64_MAX;
|
return std::numeric_limits<int64_t>::max();
|
||||||
|
|
||||||
} else if (d <= (double)INT64_MIN) {
|
} else if (d <= (double)std::numeric_limits<int64_t>::min()) {
|
||||||
return INT64_MIN;
|
return std::numeric_limits<int64_t>::min();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int64_t)d;
|
return (int64_t)d;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue