summaryrefslogtreecommitdiffstats
path: root/src/fakerw/fake.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/fakerw/fake.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 2e04aed2..366dcf3e 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -1,5 +1,5 @@
#define _CRT_SECURE_NO_WARNINGS
-#define WITH_D3D
+#define WITH_D3D // not WITHD3D, so it's librw define
#include <rwcore.h>
#include <rpworld.h>
#include <rpmatfx.h>
@@ -14,7 +14,7 @@
using namespace rw;
RwUInt8 RwObjectGetType(const RwObject *obj) { return obj->type; }
-
+RwFrame* rwObjectGetParent(const RwObject *obj) { return (RwFrame*)obj->parent; }
void *RwMalloc(size_t size) { return engine->memfuncs.rwmalloc(size, 0); }
void *RwCalloc(size_t numObj, size_t sizeObj) {
@@ -171,8 +171,8 @@ RwFrame *RwCameraGetFrame(const RwCamera *camera) { return camera->getFrame(
RwImage *RwImageCreate(RwInt32 width, RwInt32 height, RwInt32 depth) { return Image::create(width, height, depth); }
RwBool RwImageDestroy(RwImage * image) { image->destroy(); return true; }
-RwImage *RwImageAllocatePixels(RwImage * image);
-RwImage *RwImageFreePixels(RwImage * image);
+RwImage *RwImageAllocatePixels(RwImage * image) { image->allocate(); return image; }
+RwImage *RwImageFreePixels(RwImage * image) { image->free(); return image; }
RwImage *RwImageCopy(RwImage * destImage, const RwImage * sourceImage);
RwImage *RwImageResize(RwImage * image, RwInt32 width, RwInt32 height);
RwImage *RwImageApplyMask(RwImage * image, const RwImage * mask);
@@ -187,10 +187,10 @@ RwImage *RwImageSetPixels(RwImage * image, RwUInt8 * pixels) { image->pixels
RwImage *RwImageSetPalette(RwImage * image, RwRGBA * palette) { image->palette = (uint8*)palette; return image; }
RwInt32 RwImageGetWidth(const RwImage * image) { return image->width; }
RwInt32 RwImageGetHeight(const RwImage * image) { return image->height; }
-RwInt32 RwImageGetDepth(const RwImage * image);
-RwInt32 RwImageGetStride(const RwImage * image);
-RwUInt8 *RwImageGetPixels(const RwImage * image);
-RwRGBA *RwImageGetPalette(const RwImage * image);
+RwInt32 RwImageGetDepth(const RwImage * image) { return image->depth; }
+RwInt32 RwImageGetStride(const RwImage * image) { return image->stride; }
+RwUInt8 *RwImageGetPixels(const RwImage * image) { return image->pixels; }
+RwRGBA *RwImageGetPalette(const RwImage * image) { return (RwRGBA*)image->palette; }
RwUInt32 RwRGBAToPixel(RwRGBA * rgbIn, RwInt32 rasterFormat);
RwRGBA *RwRGBASetFromPixel(RwRGBA * rgbOut, RwUInt32 pixelValue, RwInt32 rasterFormat);
RwBool RwImageSetGamma(RwReal gammaValue);
@@ -962,3 +962,12 @@ RtCharset *RtCharsetSetColors(RtCharset * charSet, const RwRGBA * foreGround,
RtCharset *RtCharsetGetDesc(RtCharset * charset, RtCharsetDesc * desc) { *desc = charset->desc; return charset; }
RtCharset *RtCharsetCreate(const RwRGBA * foreGround, const RwRGBA * backGround) { return Charset::create(foreGround, backGround); }
RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return true; }
+
+
+
+#include <rpanisot.h>
+
+RwInt8 RpAnisotGetMaxSupportedMaxAnisotropy(void) { return rw::getMaxSupportedMaxAnisotropy(); }
+RwTexture *RpAnisotTextureSetMaxAnisotropy(RwTexture *tex, RwInt8 val) { tex->setMaxAnisotropy(val); return tex; }
+RwInt8 RpAnisotTextureGetMaxAnisotropy(RwTexture *tex) { return tex->getMaxAnisotropy(); }
+RwBool RpAnisotPluginAttach(void) { rw::registerAnisotropyPlugin(); return true; }