Small improvements to performance
This commit is contained in:
@@ -26,7 +26,7 @@ typedef enum {
|
||||
*/
|
||||
typedef union {
|
||||
const cutscene_t *cutscene;
|
||||
char_t message[32];
|
||||
const char_t *message;
|
||||
} entityinteractdata_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "display/spritebatch/spritebatch.h"
|
||||
|
||||
// #define CHUNK_MESH_COUNT_MAX 3
|
||||
#define CHUNK_VERTEX_COUNT (QUAD_VERTEX_COUNT * CHUNK_TILE_COUNT)
|
||||
#define CHUNK_VERTEX_COUNT (QUAD_VERTEX_COUNT * CHUNK_WIDTH * CHUNK_HEIGHT * 2)
|
||||
#define CHUNK_ENTITY_COUNT_MAX 10
|
||||
|
||||
typedef struct chunk_s {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MAP_CHUNK_DEPTH 3
|
||||
#define MAP_CHUNK_COUNT (MAP_CHUNK_WIDTH * MAP_CHUNK_HEIGHT * MAP_CHUNK_DEPTH)
|
||||
|
||||
#define ENTITY_COUNT 64
|
||||
#define ENTITY_COUNT 32
|
||||
|
||||
typedef int16_t worldunit_t;
|
||||
typedef int16_t chunkunit_t;
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ errorret_t rpgInit(void) {
|
||||
entityInit(npc, ENTITY_TYPE_NPC);
|
||||
npc->position = (worldpos_t){ 3, 3, 0 };
|
||||
npc->interact.type = ENTITY_INTERACT_PRINT;
|
||||
stringCopy(npc->interact.data.message, "hello world", 32);
|
||||
npc->interact.data.message = "hello world";
|
||||
|
||||
// All Good!
|
||||
errorOk();
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
|
||||
#define UI_BUTTON_LABEL_MAX 32
|
||||
|
||||
typedef struct {
|
||||
const char_t *label;
|
||||
bool_t highlighted;
|
||||
|
||||
@@ -223,23 +223,24 @@ errorret_t shaderSetTextureGL(
|
||||
"Only one texture supported in legacy opengl."
|
||||
);
|
||||
|
||||
// glActiveTexture(GL_TEXTURE0);
|
||||
errorChain(errorGLCheck());
|
||||
|
||||
if(texture == NULL) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
|
||||
if(SHADER_LEGACY.boundTextureId != 0) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
SHADER_LEGACY.boundTextureId = 0;
|
||||
}
|
||||
errorOk();
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
glBindTexture(GL_TEXTURE_2D, texture->id);
|
||||
errorChain(errorGLCheck());
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
errorChain(errorGLCheck());
|
||||
if(texture->id != SHADER_LEGACY.boundTextureId) {
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
glBindTexture(GL_TEXTURE_2D, texture->id);
|
||||
errorChain(errorGLCheck());
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
errorChain(errorGLCheck());
|
||||
SHADER_LEGACY.boundTextureId = texture->id;
|
||||
}
|
||||
|
||||
// glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||
// errorChain(errorGLCheck());
|
||||
|
||||
@@ -48,6 +48,7 @@ typedef struct shadergl_s {
|
||||
typedef struct {
|
||||
shadergl_t *boundShader;
|
||||
uint_fast8_t dirty;
|
||||
GLuint boundTextureId;
|
||||
} shaderlegacygl_t;
|
||||
|
||||
extern shaderlegacygl_t SHADER_LEGACY;
|
||||
|
||||
Reference in New Issue
Block a user