mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 17:17:09 -04:00
Remove unused Matrix_Orthographic method
This commit is contained in:
parent
bbfcfba18a
commit
8987e6b3e5
18
src/Game.c
18
src/Game.c
@ -55,8 +55,8 @@ cc_bool Game_ViewBobbing, Game_HideGui;
|
||||
cc_bool Game_BreakableLiquids, Game_ScreenshotRequested;
|
||||
float Game_RawHotbarScale, Game_RawChatScale, Game_RawInventoryScale;
|
||||
|
||||
static struct ScheduledTask Game_Tasks[6];
|
||||
static int Game_TasksCount, entTaskI;
|
||||
static struct ScheduledTask tasks[6];
|
||||
static int tasksCount, entTaskI;
|
||||
|
||||
static char usernameBuffer[FILENAME_SIZE];
|
||||
static char mppassBuffer[STRING_SIZE];
|
||||
@ -79,11 +79,11 @@ int ScheduledTask_Add(double interval, ScheduledTaskCallback callback) {
|
||||
task.Interval = interval;
|
||||
task.Callback = callback;
|
||||
|
||||
if (Game_TasksCount == Array_Elems(Game_Tasks)) {
|
||||
if (tasksCount == Array_Elems(tasks)) {
|
||||
Logger_Abort("ScheduledTask_Add - hit max count");
|
||||
}
|
||||
Game_Tasks[Game_TasksCount++] = task;
|
||||
return Game_TasksCount - 1;
|
||||
tasks[tasksCount++] = task;
|
||||
return tasksCount - 1;
|
||||
}
|
||||
|
||||
|
||||
@ -522,15 +522,15 @@ static void PerformScheduledTasks(double time) {
|
||||
struct ScheduledTask task;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Game_TasksCount; i++) {
|
||||
task = Game_Tasks[i];
|
||||
for (i = 0; i < tasksCount; i++) {
|
||||
task = tasks[i];
|
||||
task.Accumulator += time;
|
||||
|
||||
while (task.Accumulator >= task.Interval) {
|
||||
task.Callback(&task);
|
||||
task.Accumulator -= task.Interval;
|
||||
}
|
||||
Game_Tasks[i] = task;
|
||||
tasks[i] = task;
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,7 +598,7 @@ static void Game_RenderFrame(double delta) {
|
||||
}
|
||||
|
||||
PerformScheduledTasks(delta);
|
||||
entTask = Game_Tasks[entTaskI];
|
||||
entTask = tasks[entTaskI];
|
||||
t = (float)(entTask.Accumulator / entTask.Interval);
|
||||
LocalPlayer_SetInterpPosition(t);
|
||||
|
||||
|
@ -878,7 +878,7 @@ void Gfx_LoadIdentityMatrix(MatrixType type) {
|
||||
#define d3d9_zN -10000.0f
|
||||
#define d3d9_zF 10000.0f
|
||||
void Gfx_CalcOrthoMatrix(float width, float height, struct Matrix* matrix) {
|
||||
Matrix_OrthographicOffCenter(matrix, 0.0f, width, height, 0.0f, d3d9_zN, d3d9_zF);
|
||||
Matrix_Orthographic(matrix, 0.0f, width, 0.0f, height, d3d9_zN, d3d9_zF);
|
||||
matrix->Row2.Z = 1.0f / (d3d9_zN - d3d9_zF);
|
||||
matrix->Row3.Z = d3d9_zN / (d3d9_zN - d3d9_zF);
|
||||
}
|
||||
@ -1212,7 +1212,7 @@ void Gfx_SetDepthWrite(cc_bool enabled) { glDepthMask(enabled); }
|
||||
void Gfx_SetDepthTest(cc_bool enabled) { gl_Toggle(GL_DEPTH_TEST); }
|
||||
|
||||
void Gfx_CalcOrthoMatrix(float width, float height, struct Matrix* matrix) {
|
||||
Matrix_OrthographicOffCenter(matrix, 0.0f, width, height, 0.0f, -10000.0f, 10000.0f);
|
||||
Matrix_Orthographic(matrix, 0.0f, width, 0.0f, height, -10000.0f, 10000.0f);
|
||||
}
|
||||
void Gfx_CalcPerspectiveMatrix(float fov, float aspect, float zNear, float zFar, struct Matrix* matrix) {
|
||||
Matrix_PerspectiveFieldOfView(matrix, fov, aspect, zNear, zFar);
|
||||
|
@ -314,8 +314,8 @@ static void LInput_TickCaret(void* widget) {
|
||||
cc_bool caretShow;
|
||||
Rect2D r;
|
||||
|
||||
elapsed = (int)(DateTime_CurrentUTC_MS() - caretStart);
|
||||
if (!caretStart) return;
|
||||
elapsed = (int)(DateTime_CurrentUTC_MS() - caretStart);
|
||||
|
||||
caretShow = (elapsed % 1000) < 500;
|
||||
if (caretShow == lastCaretShow) return;
|
||||
|
@ -166,11 +166,7 @@ void Matrix_Mul(struct Matrix* result, const struct Matrix* left, const struct M
|
||||
result->Row3.W = (((lM41 * rM14) + (lM42 * rM24)) + (lM43 * rM34)) + (lM44 * rM44);
|
||||
}
|
||||
|
||||
void Matrix_Orthographic(struct Matrix* result, float width, float height, float zNear, float zFar) {
|
||||
Matrix_OrthographicOffCenter(result, -width * 0.5f, width * 0.5f, -height * 0.5f, height * 0.5f, zNear, zFar);
|
||||
}
|
||||
|
||||
void Matrix_OrthographicOffCenter(struct Matrix* result, float left, float right, float bottom, float top, float zNear, float zFar) {
|
||||
void Matrix_Orthographic(struct Matrix* result, float left, float right, float top, float bottom, float zNear, float zFar) {
|
||||
/* Transposed, source https://msdn.microsoft.com/en-us/library/dd373965(v=vs.85).aspx */
|
||||
*result = Matrix_Identity;
|
||||
|
||||
|
@ -121,8 +121,7 @@ CC_API void Matrix_Scale(struct Matrix* result, float x, float y, float z);
|
||||
/* NOTE: result can be the same pointer as left or right. */
|
||||
CC_API void Matrix_Mul(struct Matrix* result, const struct Matrix* left, const struct Matrix* right);
|
||||
|
||||
void Matrix_Orthographic(struct Matrix* result, float width, float height, float zNear, float zFar);
|
||||
void Matrix_OrthographicOffCenter(struct Matrix* result, float left, float right, float bottom, float top, float zNear, float zFar);
|
||||
void Matrix_Orthographic(struct Matrix* result, float left, float right, float top, float bottom, float zNear, float zFar);
|
||||
void Matrix_PerspectiveFieldOfView(struct Matrix* result, float fovy, float aspect, float zNear, float zFar);
|
||||
void Matrix_PerspectiveOffCenter(struct Matrix* result, float left, float right, float bottom, float top, float zNear, float zFar);
|
||||
void Matrix_LookRot(struct Matrix* result, Vec3 pos, Vec2 rot);
|
||||
|
@ -3667,7 +3667,7 @@ static const JNINativeMethod methods[18] = {
|
||||
|
||||
void Window_Init(void) {
|
||||
JNIEnv* env;
|
||||
/* TODO: ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_FULLSCREEN, 0); */
|
||||
/* TODO: ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_FULLSCREEN, 0); */
|
||||
JavaGetCurrentEnv(env);
|
||||
JavaRegisterNatives(env, methods);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user