Resolved "ALOT" of typos.

This commit is contained in:
cola98765
2021-10-10 11:09:15 +02:00
parent 72737a56c1
commit ecb01c731e
17 changed files with 62 additions and 67 deletions
@@ -103,7 +103,7 @@ public class LodBufferBuilder
/** used to debug how the buildableStorageBuffers are growing */
public int[][][] bufferPreviousCapacity;
/**
* This is toggled when the buffers are swapped so we only
* This is toggled when the buffers are swapped, so we only
* display the expansion log for one set of buffers
*/
public boolean printExpansionLog = true;
@@ -285,7 +285,7 @@ public class LodBufferBuilder
// keep a local version so we don't have to worry about indexOutOfBounds Exceptions
// keep a local version, so we don't have to worry about indexOutOfBounds Exceptions
// if it changes in the LodRenderer while we are working here
boolean[][] vanillaRenderedChunks = renderer.vanillaRenderedChunks;
short gameChunkRenderDistance = (short) (vanillaRenderedChunks.length / 2 - 1);
@@ -592,7 +592,7 @@ public class LodBufferBuilder
// variables passed into a lambda expression
// need to be effectively final, so we have
// to use a else statement here
// to use an else statement here
if (buildableVbos[i][j][k] != null)
buildableId = buildableVbos[i][j][k].id;
else
@@ -697,7 +697,7 @@ public class LodBufferBuilder
finally
{
// close the context so it can be re-used later.
// I'm guessing we can't just leave it because the executer service
// I'm guessing we can't just leave it because the executor service
// does something that invalidates the OpenGL context.
glProxy.setGlContext(GlProxyContext.NONE);
}
@@ -730,7 +730,7 @@ public class LodBufferBuilder
if (previousCapacity != 0 && allowBufferExpansion)
{
// the buffer(s) aren't big enough, expand them.
// This does cause lag/stuttering so it should be avoided!
// This does cause lag/stuttering, so it should be avoided!
// expand the buffer in system memory
GL45.glBufferData(GL45.GL_ARRAY_BUFFER, (int) (uploadBuffer.capacity() * BUFFER_EXPANSION_MULTIPLIER), GL45.GL_DYNAMIC_DRAW);
@@ -803,7 +803,7 @@ public class LodBufferBuilder
drawableStorageBufferIds = buildableStorageBufferIds;
buildableStorageBufferIds = tmpStorage;
// we only want to print the exapnsion log for
// we only want to print the expansion log for
// one set of buffers, not both
printExpansionLog = !printExpansionLog;
@@ -837,7 +837,7 @@ public class LodBufferBuilder
* buffers have been generated and are ready to be
* sent to the LodRenderer.
*/
public boolean newBuffersAvaliable()
public boolean newBuffersAvailable()
{
return switchVbos;
}
@@ -90,7 +90,7 @@ public class Box
/**
* This indicate which position is invariable in the DIRECTION_VERTEX_MAP.
* This indicates which position is invariable in the DIRECTION_VERTEX_MAP.
* Is used to extract the vertex
*/
public static final Map<Direction, int[]> FACE_DIRECTION = new HashMap<Direction, int[]>()
@@ -106,7 +106,7 @@ public class Box
/**
* This is a map from Direction to the relative normal vector
* we are using this since i'm not sure if the getNormal create new object at every call
* we are using this since I'm not sure if the getNormal create new object at every call
*/
public static final Map<Direction, Vector3i> DIRECTION_NORMAL_MAP = new HashMap<Direction, Vector3i>()
{{
@@ -155,7 +155,7 @@ public class Box
public boolean[] culling;
/** creates a empty box */
/** creates an empty box */
public Box()
{
boxOffset = new int[3];
@@ -185,7 +185,7 @@ public class Box
/**
* Set the color of the columns
* @param color color to add
* @param adjShadeDisabled this array indicate which face does not need shading
* @param adjShadeDisabled this array indicates which face does not need shading
*/
public void setColor(int color, boolean[] adjShadeDisabled)
{
@@ -216,7 +216,7 @@ public class Box
}
/** clears this box, reseting everything to default values */
/** clears this box, resetting everything to default values */
public void reset()
{
Arrays.fill(boxWidth, 0);
@@ -426,7 +426,7 @@ public class Box
/**
* This method return the position of a face in the axis of the face
* This is usefull for the face culling
* This is useful for the face culling
* @param direction that we want to check
* @return position in the axis of the face
*/
@@ -93,7 +93,7 @@ public class CubicLodTemplate extends AbstractLodTemplate
height++;
}
// offset the AABB by it's x/z position in the world since
// offset the AABB by its x/z position in the world since
// it uses doubles to specify its location, unlike the model view matrix
// which only uses floats
double x = -bufferCenterBlockPos.getX();
@@ -114,7 +114,7 @@ public class LodConfig
fogDistance = builder
.comment("\n\n"
+ " At what distance should Fog be drawn on the LODs? \n"
+ " If the fog cuts off ubruptly or you are using Optifine's \"fast\" fog option \n"
+ " If the fog cuts off abruptly or you are using Optifine's \"fast\" fog option \n"
+ " set this to " + FogDistance.NEAR + " or " + FogDistance.FAR + ". \n")
.defineEnum("fogDistance", FogDistance.NEAR_AND_FAR);
@@ -168,7 +168,7 @@ public class LodConfig
+ " If true all LODs are drawn, even those behind \n"
+ " the player's camera, decreasing performance. \n\n"
+ ""
+ " Disable this if you see LODs disapearing. \n"
+ " Disable this if you see LODs disappearing. \n"
+ " (Which may happen if you are using a camera mod) \n")
.define("disableDirectionalCulling", false);
@@ -295,7 +295,7 @@ public class LodConfig
+ " This will show player made structures, which can \n"
+ " be useful if you are adding the mod to a pre-existing world. \n"
+ " This is the most compatible, but causes server/simulation lag. \n"
+ " Singlethreaded - Slow (15-50 ms, with spikes up to 200 ms) \n")
+ " SingleThreaded - Slow (15-50 ms, with spikes up to 200 ms) \n")
.defineEnum("distanceGenerationMode", DistanceGenerationMode.SURFACE);
allowUnstableFeatureGeneration = builder
@@ -346,7 +346,7 @@ public class LodConfig
.comment("\n\n"
+ " This is how many threads are used when building vertex buffers \n"
+ " (The things sent to your GPU to draw the LODs). \n"
+ " If you experience high CPU useage when NOT generating distant \n"
+ " If you experience high CPU usage when NOT generating distant \n"
+ " LODs, lower this number. \n"
+ " \n"
+ " The maximum value is the number of logical processors on your CPU. \n"
@@ -158,7 +158,7 @@ public class LodDimensionFileHandler
{
// the file we are reading is a newer version,
// close the reader and ignore the file, we don't
// want to accidently delete anything the user may want.
// want to accidentally delete anything the user may want.
inputStream.close();
ClientProxy.LOGGER.info("Newer LOD region file for region: (" + regionX + "," + regionZ + ")"
+ " version found: " + fileVersion
@@ -292,7 +292,7 @@ public class LodDimensionFileHandler
if (fileVersion > LOD_SAVE_FILE_VERSION)
{
// the file we are reading is a newer version,
// don't write anything, we don't want to accidently
// don't write anything, we don't want to accidentally
// delete anything the user may want.
return;
}
@@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* This class is used to mix in my rendering code
* before Minecraft starts rendering blocks.
* If this wasn't done and we used Forge's
* If this wasn't done, and we used Forge's
* render last event, the LODs would render on top
* of the normal terrain.
*
@@ -428,7 +428,7 @@ public class LodDimension
// try to get the region from file
regions[x][z] = getRegionFromFile(regionPos, levelToGen, generationMode, verticalQuality);
// if there is no region file create a empty region
// if there is no region file create an empty region
if (regions[x][z] == null)
regions[x][z] = new LodRegion(levelToGen, regionPos, generationMode, verticalQuality);
@@ -474,7 +474,7 @@ public class LodDimension
{
try
{
// mark the region as dirty so it will be saved to disk
// mark the region as dirty, so it will be saved to disk
int xIndex = (regionPosX - center.x) + halfWidth;
int zIndex = (regionPosZ - center.z) + halfWidth;
@@ -34,7 +34,7 @@ public class NearFarFogSettings
public NearOrFarSetting far = new NearOrFarSetting(FogDistance.FAR);
/** If true that means Minecraft is
* rendering fog along side us */
* rendering fog alongside us */
public boolean vanillaIsRenderingFog = true;
public NearFarFogSettings()
@@ -150,7 +150,7 @@ public class PosToGenerateContainer
@Override
public String toString()
{
// TOOD is this commented code still useful?
// TODO is this commented code still useful?
// if so why have it commented out?
@@ -35,7 +35,7 @@ public class PosToRenderContainer
public void addPosToRender(byte detailLevel, int posX, int posZ)
{
// When rapidly changing dimensions the bufferBuidler can cause this,
// When rapidly changing dimensions the bufferBuilder can cause this,
// James isn't sure why, but this will prevent an exception at
// the very least (while stilling logging the problem).
if (numberOfPosToRender >= posToRender.length)
@@ -268,7 +268,7 @@ public class ClientProxy
renderer = new LodRenderer(lodBufferBuilder);
// make sure the nulled objects are freed.
// make sure the nilled objects are freed.
// (this prevents an out of memory error when
// changing worlds)
System.gc();
@@ -327,7 +327,7 @@ public class ClientProxy
/**
* Re-sizes all LodDimensions if they needs to be.
* Re-sizes all LodDimensions if they need to be.
*/
private void viewDistanceChangedEvent()
{
@@ -374,7 +374,7 @@ public class ClientProxy
}
/**
* this method reset some of the static data everytime we change world
* this method reset some static data everytime we change world
**/
private void resetMod()
{
@@ -163,7 +163,7 @@ public class GlProxy
else
// hopefully this shouldn't happen, but
// at least now we will be notified if it does happen
throw new IllegalStateException(Thread.currentThread().getName() + " has a unkown OpenGl context: [" + currentContext + "]. Minecraft context [" + minecraftGlContext + "], LodBuilder context [" + lodBuilderGlContext + "], no context [0].");
throw new IllegalStateException(Thread.currentThread().getName() + " has a unknown OpenGl context: [" + currentContext + "]. Minecraft context [" + minecraftGlContext + "], LodBuilder context [" + lodBuilderGlContext + "], no context [0].");
}
@@ -64,7 +64,7 @@ public class LodRenderer
{
/**
* this is the light used when rendering the LODs,
* it should be something different than what is used by Minecraft
* it should be something different from what is used by Minecraft
*/
private static final int LOD_GL_LIGHT_NUMBER = GL11.GL_LIGHT2;
@@ -88,7 +88,7 @@ public class LodRenderer
/**
* the OpenGL IDs for the vbos of the same indices.
* These have to be separate because we can't override the
* buffers in the VBOs (and we don't want too)
* buffers in the VBOs (and we don't want to)
*/
private int[][][] storageBufferIds;
@@ -183,13 +183,13 @@ public class LodRenderer
// 2. we aren't already regenerating the LODs
// 3. we aren't waiting for the build and draw buffers to swap
// (this is to prevent thread conflicts)
if ((partialRegen || fullRegen) && !lodBufferBuilder.generatingBuffers && !lodBufferBuilder.newBuffersAvaliable())
if ((partialRegen || fullRegen) && !lodBufferBuilder.generatingBuffers && !lodBufferBuilder.newBuffersAvailable())
{
// generate the LODs on a separate thread to prevent stuttering or freezing
lodBufferBuilder.generateLodBuffersAsync(this, lodDim, mc.getPlayer().blockPosition(), true);
// the regen process has been started,
// it will be done when lodBufferBuilder.newBuffersAvaliable()
// it will be done when lodBufferBuilder.newBuffersAvailable()
// is true
fullRegen = false;
partialRegen = false;
@@ -198,7 +198,7 @@ public class LodRenderer
// TODO move the buffer regeneration logic into its own class (probably called in the client proxy instead)
// ...ending here
if (lodBufferBuilder.newBuffersAvaliable())
if (lodBufferBuilder.newBuffersAvailable())
{
swapBuffers();
}
@@ -228,12 +228,12 @@ public class LodRenderer
GL11.glDisable(GL11.GL_LIGHT0);
GL11.glDisable(GL11.GL_LIGHT1);
// get the default projection matrix so we can
// get the default projection matrix, so we can
// reset it after drawing the LODs
float[] mcProjMatrixRaw = new float[16];
GL11.glGetFloatv(GL11.GL_PROJECTION_MATRIX, mcProjMatrixRaw);
Matrix4f mcProjectionMatrix = new Matrix4f(mcProjMatrixRaw);
// OpenGl outputs their matricies in col,row form instead of row,col
// OpenGl outputs their matrices in col,row form instead of row,col
// (or maybe vice versa I have no idea :P)
mcProjectionMatrix.transpose();
@@ -248,7 +248,7 @@ public class LodRenderer
NearFarFogSettings fogSettings = determineFogSettings();
// determine the current fog settings so they can be
// determine the current fog settings, so they can be
// reset after drawing the LODs
float defaultFogStartDist = GL11.glGetFloat(GL11.GL_FOG_START);
float defaultFogEndDist = GL11.glGetFloat(GL11.GL_FOG_END);
@@ -393,15 +393,10 @@ public class LodRenderer
{
// for more realistic fog when using FAR
if (LodConfig.CLIENT.graphics.fogDistance.get() == FogDistance.NEAR_AND_FAR)
{
RenderSystem.fogStart(farPlaneBlockDistance * 0.9f);
RenderSystem.fogEnd(farPlaneBlockDistance * 1.0f);
}
else
{
RenderSystem.fogStart(farPlaneBlockDistance * 0.1f);
RenderSystem.fogEnd(farPlaneBlockDistance * 1.0f);
}
RenderSystem.fogEnd(farPlaneBlockDistance * 1.0f);
}
else if (fogQuality == FogQuality.FAST)
{
@@ -446,7 +441,7 @@ public class LodRenderer
RenderSystem.fogMode(defaultFogMode);
GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, defaultFogDistance);
// disable fog if Minecraft wasn't rendering fog
// disable fog if Minecraft wasn't rendering fog,
// but we were
if (!fogSettings.vanillaIsRenderingFog &&
(fogSettings.near.quality != FogQuality.OFF ||
@@ -507,7 +502,7 @@ public class LodRenderer
boolean lodProjUseFov;
boolean defaultMcProjUseFov;
private FovTest(boolean newLodProjUseFov, boolean newDefaultMcProjUseFov)
FovTest(boolean newLodProjUseFov, boolean newDefaultMcProjUseFov)
{
lodProjUseFov = newLodProjUseFov;
defaultMcProjUseFov = newDefaultMcProjUseFov;
@@ -536,7 +531,7 @@ public class LodRenderer
// true here means use "use fov setting" (probably)
// this logic strips away the defaultMcProj matrix so we
// this logic strips away the defaultMcProj matrix, so we
// can get the distortionMatrix, which represents all
// transformations, zooming, distortions, etc. done
// to Minecraft's Projection matrix
@@ -556,7 +551,7 @@ public class LodRenderer
}
/** setup the lighting to be used for the LODs */
///** setup the lighting to be used for the LODs */
/*private void setupLighting(LodDimension lodDimension, float partialTicks)
{
// Determine if the player has night vision
@@ -42,7 +42,7 @@ public class RenderUtil
/**
* Returns if the given ChunkPos is in the loaded area of the world.
* @param centerCoordinate the center of the loaded world (probably the player's ChunkPos)
* @param center the center of the loaded world (probably the player's ChunkPos)
*/
public static boolean isChunkPosInLoadedArea(ChunkPos pos, ChunkPos center)
{
@@ -101,9 +101,9 @@ public class RenderUtil
* Returns the maxViewDistanceMultiplier for the given LodTemplate
* at the given LodDetail level.
*/
/*public static int getMaxRadiusMultiplierWithAvaliableMemory(LodTemplate lodTemplate, int detailLevel)
/*public static int getMaxRadiusMultiplierWithAvailableMemory(LodTemplate lodTemplate, int detailLevel)
{
int maxNumberOfLods = LodRenderer.MAX_ALOCATEABLE_DIRECT_MEMORY / lodTemplate.getBufferMemoryForSingleLod();
int maxNumberOfLods = LodRenderer.MAX_ALLOCATABLE_DIRECT_MEMORY / lodTemplate.getBufferMemoryForSingleLod();
int numbLodsWide = (int) Math.sqrt(maxNumberOfLods);
return numbLodsWide / (2 * mc.getRenderDistance());
@@ -144,9 +144,9 @@ public class RenderUtil
*/
private static boolean isNormalizedVectorInViewFrustum(Vector3d objectVector, Vector3d cameraDir)
{
// the -0.1 is to offer a slight buffer so we are
// the -0.1 is to offer a slight buffer, so we are
// more likely to render LODs and thus, hopefully prevent
// flickering or odd disappearences
// flickering or odd disappearances
return objectVector.dot(cameraDir) > -0.1;
}
}
@@ -57,7 +57,7 @@ public class ColorUtil
}
/**
* Edit the given color as a HSV (Hue Saturation Value) color.
* Edit the given color as an HSV (Hue Saturation Value) color.
*/
public static int applySaturationAndBrightnessMultipliers(int color, float saturationMultiplier, float brightnessMultiplier)
{
@@ -69,7 +69,7 @@ public class ColorUtil
}
/**
* Edit the given color as a HSV (Hue Saturation Value) color.
* Edit the given color as an HSV (Hue Saturation Value) color.
*/
public static int changeBrightness(int color, float brightness)
{
@@ -81,7 +81,7 @@ public class ColorUtil
}
/**
* Edit the given color as a HSV (Hue Saturation Value) color.
* Edit the given color as an HSV (Hue Saturation Value) color.
*/
public static int changeBrightnessValue(int color, int brightnessColor)
{
@@ -26,7 +26,7 @@ public class DataPointUtil
*/
// Reminder: bytes have range of [-128, 127].
// When converting to or from a int a 128 should be added or removed.
// When converting to or from an int a 128 should be added or removed.
// If there is a bug with color then it's probably caused by this.
//To be used in the future for negative value
@@ -193,7 +193,7 @@ public class DataPointUtil
}
/**
* This is used to convert a dataPoint to string (usefull for the print function)
* This is used to convert a dataPoint to string (useful for the print function)
* @param dataPoint
* @return
*/
@@ -204,9 +204,9 @@ public class LodUtil
/**
* Convert a 2D absolute position into a quad tree relative position.
*/
public static int convertLevelPos(int pos, int currectDetailLevel, int targetDetailLevel)
public static int convertLevelPos(int pos, int currentDetailLevel, int targetDetailLevel)
{
return Math.floorDiv(pos, (int) Math.pow(2, targetDetailLevel - currectDetailLevel));
return Math.floorDiv(pos, (int) Math.pow(2, targetDetailLevel - currentDetailLevel));
}
/**
@@ -352,7 +352,7 @@ public class LodUtil
/**
* Returns the GPU memory needed if all LODs in
* a the given region are rendered.
* the given region are rendered.
*
* @param regionPosX x region position to check
* @param regionPosZ z region position to check
@@ -444,7 +444,7 @@ public class LodUtil
if (playerPos.getY() <= lodAverageHeight)
{
// don't draw Lod's that are taller than the player
// don't draw LODs that are taller than the player
// to prevent LODs being drawn on top of the player
posToSkip.add(new ChunkPos(x, z));
}
@@ -467,17 +467,17 @@ public class LodUtil
{
HashSet<ChunkPos> loadedPos = new HashSet<>();
// Wow those are some long names!
// Wow, those are some long names!
// go through every RenderInfo to get the compiled chunks
WorldRenderer renderer = mc.getLevelRenderer();
for (WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer : renderer.renderChunks)
for (WorldRenderer.LocalRenderInformationContainer worldRenderer$LocalRenderInformationContainer : renderer.renderChunks)
{
CompiledChunk compiledChunk = worldrenderer$localrenderinformationcontainer.chunk.getCompiledChunk();
CompiledChunk compiledChunk = worldRenderer$LocalRenderInformationContainer.chunk.getCompiledChunk();
if (!compiledChunk.hasNoRenderableLayers())
{
// add the ChunkPos for every rendered chunk
BlockPos bpos = worldrenderer$localrenderinformationcontainer.chunk.getOrigin();
BlockPos bpos = worldRenderer$LocalRenderInformationContainer.chunk.getOrigin();
loadedPos.add(new ChunkPos(bpos));
}
@@ -492,7 +492,7 @@ public class LodUtil
* @param vanillaRenderedChunks matrix of the vanilla rendered chunks
* @param x relative (to the matrix) x chunk to check
* @param z relative (to the matrix) z chunk to check
* @return true if and only if the chunk is a the border of the rendereble chunks
* @return true if and only if the chunk is a border of the renderable chunks
*/
public static boolean isBorderChunk(boolean[][] vanillaRenderedChunks, int x, int z)
{