Page 1 of 2

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 07 Jan 2017, 00:43
by Tricob1974
By changing the third plane of your map.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 07 Jan 2017, 15:40
by Officer-Michael John
I changed to the third plane,but can't work. :(

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 08 Jan 2017, 00:30
by Tricob1974
You need to add floor and ceiling tiles, too. And you need to do it to the entire map.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 08 Jan 2017, 15:14
by Officer-Michael John
I gived with Wood texture,but now not work too.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 09 Jan 2017, 02:55
by Tricob1974
"Not working" doesn't tell me much.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 09 Jan 2017, 15:08
by Officer-Michael John
I selected a texture (floor/ceiling) and I saved with Map Editor. Log and nothing changes. It still remains the problem. I doing something wrong?

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 10 Jan 2017, 03:32
by Tricob1974
You have to put those textures in the map. Go to the 3D Editor and you'll see where you should put them.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 10 Jan 2017, 23:39
by Officer-Michael John
I go to 3D edit and I selected a texture.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 11 Jan 2017, 05:01
by Tricob1974
You still have to do more. If you're not seeing the texture on the floor or ceiling, then you didn't put it there. You have to put these things in every square of the map that you see.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 11 Jan 2017, 19:23
by Officer-Michael John
I maked a file for DarkOne's Textured floor/ceiling as Multiple floor/ceiling. I not find bug,but I can't get texture only normal floor and ceiling as in Wolf 3D.

My combination code:

VERSION.H:

Code: Select all
#define USE_DRAWFLATSTEX      // Enables floor and ceiling textures (see wl_drawflatstex.cpp)


WL_DEF.H:

Code: Select all
#ifdef USE_DRAWFLATSTEX
    void DrawFlats(unsigned tex_f, unsigned tex_c);
#endif


WL_DRAW.CPP:

Code: Select all
#ifdef USE_DRAWFLATSTEX
#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/

byte texCeiling[]=
{
#ifndef SPEAR
USE_TEX(1),USE_TEX(2),USE_TEX(3),USE_TEX(4),USE_TEX(5),USE_TEX(6),USE_TEX(7),USE_TEX(8),USE_TEX(9),USE_TEX(10),
USE_TEX(11),USE_TEX(12),USE_TEX(13),USE_TEX(14),USE_TEX(15),USE_TEX(16),USE_TEX(17),USE_TEX(18),USE_TEX(19),USE_TEX(20),
USE_TEX(21),USE_TEX(22),USE_TEX(23),USE_TEX(24),USE_TEX(25),USE_TEX(26),USE_TEX(27),USE_TEX(28),USE_TEX(29),USE_TEX(30),

USE_TEX(31),USE_TEX(32),USE_TEX(33),USE_TEX(34),USE_TEX(35),USE_TEX(36),USE_TEX(37),USE_TEX(38),USE_TEX(39),USE_TEX(40),
USE_TEX(41),USE_TEX(42),USE_TEX(43),USE_TEX(44),USE_TEX(45),USE_TEX(46),USE_TEX(47),USE_TEX(48),USE_TEX(49),USE_TEX(50),
USE_TEX(51),USE_TEX(52),USE_TEX(53),USE_TEX(54),USE_TEX(55),USE_TEX(56),USE_TEX(57),USE_TEX(58),USE_TEX(59),USE_TEX(60),
#else
USE_TEX(1),USE_TEX(2),USE_TEX(3),USE_TEX(4),USE_TEX(5),USE_TEX(6),USE_TEX(7),USE_TEX(8),USE_TEX(9),USE_TEX(10),
USE_TEX(11),USE_TEX(12),USE_TEX(13),USE_TEX(14),USE_TEX(15),USE_TEX(16),USE_TEX(17),USE_TEX(18),USE_TEX(19),USE_TEX(20),USE_TEX(21),
#endif
};

/*
=====================
=
= TEXClearScreen
=
=====================
*/

void TEXClearScreen (byte texture)
{       
    int y;
    byte *ptr = vbuf;
}   
#endif   

#ifdef USE_DRAWFLATSTEX       
    byte texture;
    boolean flats;   
#endif

#ifdef USE_DRAWFLATSTEX
    texture=texCeiling[gamestate.episode*10+mapon];
    if((texture>>8)==(texture&0xFF))
    {
          TEXClearScreen(texture);
          flats=false;
    }
    else
    {
          flats=true;
          texture=((texture&0xFF)-1)<<1;
    }
#endif 

#ifdef USE_DRAWFLATSTEX
  if(flats)
    DrawFlats(texture, texture+1); // draw textured floor/ceiling
#endif


WL_DRAWFLATS.CPP:

Code: Select all
#include "version.h"

#ifdef USE_DRAWFLATSTEX

#include "wl_def.h"

// Textured Floor and Ceiling by DarkOne
void DrawFlats(unsigned tex_f, unsigned tex_c)
{   
    unsigned   vbufPitch;
    int   min_wallheight;
    byte  color;
    byte  *toptex, *bottex;
    fixed dist;                                // distance to row projection
    fixed tex_step;                            // global step per one screen pixel
    fixed gu, gv, du, dv;                      // global texture coordinates
    int u, v;                                  // local texture coordinates

    int halfheight = viewheight >> 1;
    int y0 = min_wallheight >> 3;              // starting y value
    if(y0 > halfheight)
        return;                                // view obscured by walls
    if(!y0) y0 = 1;                            // don't let division by zero
    unsigned bot_offset0 = vbufPitch * (halfheight + y0);
    unsigned top_offset0 = vbufPitch * (halfheight - y0 - 1);
   
    bottex = PM_GetPage(tex_f); // load floor texture
    toptex = PM_GetPage(tex_c); // load ceiling texture

    // draw horizontal lines
    for(int y = y0, bot_offset = bot_offset0, top_offset = top_offset0;
        y < halfheight; y++, bot_offset += vbufPitch, top_offset -= vbufPitch)
    {
        dist = (heightnumerator / (y + 1)) << 5;
        gu =  viewx + FixedMul(dist, viewcos);
        gv = -viewy + FixedMul(dist, viewsin);
        tex_step = (dist << 8) / viewwidth / 175;
        du =  FixedMul(tex_step, viewsin);
        dv = -FixedMul(tex_step, viewcos);
        gu -= (viewwidth >> 1) * du;
        gv -= (viewwidth >> 1) * dv; // starting point (leftmost)
       
        for(int x = 0, bot_add = bot_offset, top_add = top_offset;
            x < viewwidth; x++, bot_add++, top_add++)
        {
            if(wallheight[x] >> 3 <= y)
            {                   
                    u = (gu >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);
                    color = *(toptex+((63-u)<<6)+(63-v));
                    v = (gv >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);
                    color = *(bottex+((63-u)<<6)+(63-v));
            }
            gu += du;
            gv += dv;
        }
    } 
}
#endif


WL_DRAWFLATS.CPP Link:http://www.mediafire.com/file/0mw8ky1j2st212d/wl_drawflats.cpp

Note:This is code tutorial need to correct.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 12 Jan 2017, 01:17
by Tricob1974
The code is not your problem. You need to change what's in your maps. I've told you what you need to do.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 12 Jan 2017, 23:39
by Officer-Michael John
I changed the Map with selected texture,but nothing.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 13 Jan 2017, 04:11
by Tricob1974
Then you did something wrong. If you follow the instructions you were given, the game will work right.

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 15 Jan 2017, 00:10
by Officer-Michael John
I uploaded File. You can downloading and you see the Problem. Link:http://www.mediafire.com/file/t8pu8uqze2sy70g/Wolf+3D+DarkOne%27s+Texture+floor+and+ceiling+SDL.rar

Re: (help) DarkOne's Textured floor and ceiling

PostPosted: 15 Jan 2017, 03:48
by Tricob1974
The problem is in your map. ChaosEdit says that the Third Plane of your map isn't even enabled.