projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
load in preview images to dynamic rt textures
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_render.c
diff --git
a/world_render.c
b/world_render.c
index 0584415a74d6a2e7f1bacba90b5eb0a366226152..3f87a12d1ebdcbdd85a3801a6c798facb5fdd707 100644
(file)
--- a/
world_render.c
+++ b/
world_render.c
@@
-12,6
+12,7
@@
#include "respawn.h"
#include "ent_miniworld.h"
#include "player_remote.h"
#include "respawn.h"
#include "ent_miniworld.h"
#include "player_remote.h"
+#include "ent_skateshop.h"
static int ccmd_set_time( int argc, const char *argv[] ){
world_instance *world = world_current_instance();
static int ccmd_set_time( int argc, const char *argv[] ){
world_instance *world = world_current_instance();
@@
-278,18
+279,25
@@
void world_render_both_stages( world_instance *world, struct world_pass *pass )
glEnable( GL_CULL_FACE );
}
glEnable( GL_CULL_FACE );
}
+static GLuint world_get_texture( world_instance *world, u32 id ){
+ if( id & 0x80000000 )
+ return skaterift.rt_textures[id & ~0x80000000];
+ else
+ return world->textures[ id ];
+}
+
static void bindpoint_diffuse_texture1( world_instance *world,
static void bindpoint_diffuse_texture1( world_instance *world,
- struct world_surface *mat )
-
-{
+ struct world_surface *mat ){
glActiveTexture( GL_TEXTURE1 );
glActiveTexture( GL_TEXTURE1 );
- glBindTexture( GL_TEXTURE_2D, world->textures[ mat->info.tex_diffuse ] );
+ glBindTexture( GL_TEXTURE_2D,
+ world_get_texture(world,mat->info.tex_diffuse) );
}
static void bindpoint_diffuse1_and_cubemap10( world_instance *world,
struct world_surface *mat ){
glActiveTexture( GL_TEXTURE1 );
}
static void bindpoint_diffuse1_and_cubemap10( world_instance *world,
struct world_surface *mat ){
glActiveTexture( GL_TEXTURE1 );
- glBindTexture( GL_TEXTURE_2D, world->textures[ mat->info.tex_diffuse ] );
+ glBindTexture( GL_TEXTURE_2D,
+ world_get_texture(world,mat->info.tex_diffuse) );
u32 cubemap_id = mat->info.tex_none0,
cubemap_index = 0;
u32 cubemap_id = mat->info.tex_none0,
cubemap_index = 0;
@@
-645,7
+653,8
@@
static void bindpoint_terrain( world_instance *world,
struct world_surface *mat )
{
glActiveTexture( GL_TEXTURE1 );
struct world_surface *mat )
{
glActiveTexture( GL_TEXTURE1 );
- glBindTexture( GL_TEXTURE_2D, world->textures[ mat->info.tex_diffuse ] );
+ glBindTexture( GL_TEXTURE_2D,
+ world_get_texture(world,mat->info.tex_diffuse) );
shader_scene_terrain_uSandColour( mat->info.colour );
shader_scene_terrain_uBlendOffset( mat->info.colour1 );
shader_scene_terrain_uSandColour( mat->info.colour );
shader_scene_terrain_uBlendOffset( mat->info.colour1 );
@@
-658,7
+667,8
@@
static void bindpoint_override( world_instance *world,
}
else{
glActiveTexture( GL_TEXTURE1 );
}
else{
glActiveTexture( GL_TEXTURE1 );
- glBindTexture( GL_TEXTURE_2D, world->textures[ mat->info.tex_diffuse ] );
+ glBindTexture( GL_TEXTURE_2D,
+ world_get_texture(world,mat->info.tex_diffuse) );
shader_scene_override_uAlphatest(1);
}
}
shader_scene_override_uAlphatest(1);
}
}