Files
Work/ddraw/TEXTURE.HPP
2024-08-07 09:16:27 -04:00

72 lines
1.9 KiB
C++

#ifndef _DDRAW_TEXTURE_HPP_
#define _DDRAW_TEXTURE_HPP_
#ifndef _COMMON_VECTOR2D_HPP_
#include <common/vector2d.hpp>
#endif
#ifndef _ENGINE_VECTOR3D_HPP_
#include <engine/vector3d.hpp>
#endif
#ifndef _ENGINE_DEVICE3D_HPP_
#include <engine/device3d.hpp>
#endif
#ifndef _ENGINE_PUREEDGE_HPP_
#include <engine/pureedge.hpp>
#endif
#ifndef _ENGINE_PUREMAP_HPP_
#include <engine/puremap.hpp>
#endif
class Bitmap;
class DrawingSurface;
class Triangle3D;
extern "C"
{
void directMapTexture(PureMap *lpEdgeMap);
void directInitEdge(int edgeType,PureEdge *lpPureEdge);
void directSetSrcBitmapInfo(WORD width,WORD height,UHUGE *lpSrcBitmapImage);
void directSetDstBitmapInfo(WORD width,WORD height,WORD pitch,UHUGE *lpDstBitmapImage);
void directSetMaskInfo(WORD useMask,BYTE maskValue);
}
class DirectTexture
{
public:
enum TriMap{MapCenter,MapLowerLeft,MapUpperRight};
typedef void (DirectTexture::*PMFI)(long pixelPoint,long imagePoint);
DirectTexture(const Vector3D &dstPoints,Bitmap &textureBitmap,DrawingSurface &drawingSurface,Device3D &displayDevice);
DirectTexture(const Vector2D &dstPoints,Bitmap &textureBitmap,DrawingSurface &drawingSurface);
DirectTexture(const Triangle3D &angle3D,Bitmap &textureBitmap,DrawingSurface &drawingSurface,Device3D &displayDevice,TriMap triMap=MapCenter);
virtual ~DirectTexture();
void mapTexture(void);
private:
enum EdgeType{LeftEdge=-1,RightEdge=1};
DirectTexture &operator=(const DirectTexture &someTexture);
PureEdge mLeftEdge;
PureEdge mRightEdge;
PureMap mEdgeMap;
Vector2D mTexturePoints;
Vector2D mDstPoints2D;
Vector3D mDstPoints3D;
};
inline
DirectTexture &DirectTexture::operator=(const DirectTexture &/*someTexture*/)
{ // undefined
return *this;
}
inline
DirectTexture::~DirectTexture()
{
}
inline
void DirectTexture::mapTexture(void)
{
::directInitEdge(LeftEdge,&mLeftEdge);
::directInitEdge(RightEdge,&mRightEdge);
::directMapTexture(&mEdgeMap);
}
#endif