From dc8b7e5a77ba9c2cdb36fc1f1e43110ccb0207d5 Mon Sep 17 00:00:00 2001 From: CicTec Date: Sun, 27 Nov 2016 20:59:24 +0100 Subject: [PATCH] Fixed SET_SECTOR_TEXTURE fade params, not working propely as documentation says. (#2) * Fixed SET_SECTOR_TEXTURE fade param not working properly --- src/runtime/vpe/vpedll.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/vpe/vpedll.c b/src/runtime/vpe/vpedll.c index 2b7dc3c..96ff671 100644 --- a/src/runtime/vpe/vpedll.c +++ b/src/runtime/vpe/vpedll.c @@ -679,7 +679,7 @@ void get_point_m8(void) void set_sector_texture(void) { - int fade =( 15-pila[sp--] )%16; + int fade=pila[sp--]; int techo=pila[sp--]; int suelo=pila[sp--]; int num_region=pila[sp]; @@ -689,9 +689,11 @@ void set_sector_texture(void) if (!vpe_inicializada) return; + if (fade < -1 || fade > 15) return; + new_region=(struct Region *)Regions.ptr[num_region]; - if( fade !=-1 ) new_region->Fade=fade; + if( fade !=-1 ) new_region->Fade= 15 - fade; if( suelo!=-1 ) TexAlloc(&new_region->FloorTC,suelo,num_fpg_aux); if( techo!=-1 ) TexAlloc(&new_region->CeilTC,techo,num_fpg_aux); }