More small compilation fixes.

This commit is contained in:
Dario 2021-04-09 14:32:14 -03:00
parent 5f4af45334
commit 4f07be13b6
6 changed files with 33 additions and 26 deletions

View File

@ -202,7 +202,7 @@ typedef void (*DestroyMeshPtr)(RT64_MESH* meshPtr);
typedef RT64_INSTANCE* (*CreateInstancePtr)(RT64_SCENE* scenePtr);
typedef void (*SetInstancePtr)(RT64_INSTANCE* instancePtr, RT64_MESH* meshPtr, RT64_MATRIX4 transform, RT64_TEXTURE* diffuseTexture, RT64_TEXTURE* normalTexture, RT64_MATERIAL material);
typedef void (*DestroyInstancePtr)(RT64_INSTANCE* instancePtr);
typedef RT64_TEXTURE* (*CreateTextureFromRGBA8Ptr)(RT64_DEVICE* devicePtr, void* bytes, int width, int height, int stride);
typedef RT64_TEXTURE* (*CreateTextureFromRGBA8Ptr)(RT64_DEVICE* devicePtr, const void* bytes, int width, int height, int stride);
typedef void(*DestroyTexturePtr)(RT64_TEXTURE* texture);
typedef RT64_INSPECTOR* (*CreateInspectorPtr)(RT64_DEVICE* devicePtr);
typedef bool(*HandleMessageInspectorPtr)(RT64_INSPECTOR* inspectorPtr, UINT msg, WPARAM wParam, LPARAM lParam);

View File

@ -7,7 +7,7 @@
#include "types.h"
#include "game/memory.h"
#include "pc/gfx/gfx_pc.h"
#include "pc/gfx/gfx_rendering_api_config.h"
#define GRAPH_RENDER_ACTIVE (1 << 0)
#define GRAPH_RENDER_CHILDREN_FIRST (1 << 1)

View File

@ -1,8 +1,9 @@
#ifndef GFX_PC_H
#define GFX_PC_H
#include "gfx_rendering_api.h"
#include "gfx_rendering_api_config.h"
struct GfxRenderingAPI;
struct GfxWindowManagerAPI;
struct GfxDimensions {

View File

@ -1,24 +1,12 @@
#ifndef GFX_RENDERING_API_H
#define GFX_RENDERING_API_H
#include "gfx_rendering_api_config.h"
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef RAPI_RT64
# define GFX_MAX_BUFFERED 16384
# define GFX_DISABLE_SHADOWS
# define GFX_DISABLE_FRUSTUM_CULLING
# define GFX_DISABLE_LIGHTING
# define GFX_DISABLE_CLIP_REJECT
# define GFX_FLUSH_ON_ENDDL
# define GFX_OUTPUT_NORMALS_TO_VBO
# define GFX_SEPARATE_PROJECTIONS
# define GFX_SEPARATE_FOG
# define GFX_REQUIRE_TEXTURE_HASH
# define GFX_ENABLE_GRAPH_NODE_MODS
#endif
struct ShaderProgram;
struct GfxRenderingAPI {

View File

@ -0,0 +1,18 @@
#ifndef GFX_RENDERING_API_CONFIG_H
#define GFX_RENDERING_API_CONFIG_H
#ifdef RAPI_RT64
# define GFX_MAX_BUFFERED 16384
# define GFX_DISABLE_SHADOWS
# define GFX_DISABLE_FRUSTUM_CULLING
# define GFX_DISABLE_LIGHTING
# define GFX_DISABLE_CLIP_REJECT
# define GFX_FLUSH_ON_ENDDL
# define GFX_OUTPUT_NORMALS_TO_VBO
# define GFX_SEPARATE_PROJECTIONS
# define GFX_SEPARATE_FOG
# define GFX_REQUIRE_TEXTURE_HASH
# define GFX_ENABLE_GRAPH_NODE_MODS
#endif
#endif

View File

@ -6,6 +6,14 @@
#error "RT64 requires EXTERNAL_DATA to be enabled."
#endif
extern "C" {
# include "../../game/area.h"
# include "../../game/level_update.h"
# include "../fs/fs.h"
# include "../pc_main.h"
# include "gfx_cc.h"
}
#include <cassert>
#include <fstream>
#include <iomanip>
@ -22,14 +30,6 @@ using json = nlohmann::json;
#include "gfx_rt64_geo_map.h"
#include "rt64/rt64.h"
extern "C" {
# include "gfx_cc.h"
# include "../fs/fs.h"
# include "../pc_main.h"
# include "../../game/area.h"
# include "../../game/level_update.h"
}
#ifndef _LANGUAGE_C
# define _LANGUAGE_C
#endif
@ -1181,7 +1181,7 @@ static void gfx_rt64_rapi_select_texture(int tile, uint32_t texture_id) {
RT64.currentTextureIds[tile] = texture_id;
}
static void gfx_rt64_rapi_upload_texture(uint8_t *rgba32_buf, int width, int height) {
static void gfx_rt64_rapi_upload_texture(const uint8_t *rgba32_buf, int width, int height) {
RT64_TEXTURE *texture = RT64.lib.CreateTextureFromRGBA8(RT64.device, rgba32_buf, width, height, 4);
uint32_t textureKey = RT64.currentTextureIds[RT64.currentTile];
RT64.textures[textureKey].texture = texture;