diff --git a/premake5.lua b/premake5.lua index 2ba0da9..2ffb718 100755 --- a/premake5.lua +++ b/premake5.lua @@ -130,6 +130,7 @@ project "clumpview" skeltool("clumpview") flags { "WinMain" } removeplatforms { "*null" } + removeplatforms { "ps2" } -- for now project "ps2test" kind "ConsoleApp" @@ -148,11 +149,11 @@ project "ps2test" -- "c -lc" is a hack because we need -lc twice for some reason links { "c -lc", "kernel", "mf" } -project "ps2rastertest" - kind "ConsoleApp" - targetdir (Bindir) - removeplatforms { "*gl3", "*d3d9" } - files { "tools/ps2rastertest/*.cpp" } - includedirs { "." } - libdirs { Libdir } - links { "librw" } +--project "ps2rastertest" +-- kind "ConsoleApp" +-- targetdir (Bindir) +-- removeplatforms { "*gl3", "*d3d9" } +-- files { "tools/ps2rastertest/*.cpp" } +-- includedirs { "." } +-- libdirs { Libdir } +-- links { "librw" } diff --git a/skeleton/glfw.cpp b/skeleton/glfw.cpp index 095a77c..8a6dc37 100644 --- a/skeleton/glfw.cpp +++ b/skeleton/glfw.cpp @@ -1,4 +1,3 @@ -#include #include #include "skeleton.h" diff --git a/skeleton/win.cpp b/skeleton/win.cpp index d1648af..d93c53b 100644 --- a/skeleton/win.cpp +++ b/skeleton/win.cpp @@ -1,4 +1,5 @@ -#include +#ifdef _WIN32 +#include #include #include "skeleton.h" @@ -221,3 +222,4 @@ WinMain(HINSTANCE instance, HINSTANCE, return main(__argc, __argv); } #endif +#endif diff --git a/src/d3d/xboxskin.cpp b/src/d3d/xboxskin.cpp index 1aa8b66..a7c7203 100644 --- a/src/d3d/xboxskin.cpp +++ b/src/d3d/xboxskin.cpp @@ -134,13 +134,13 @@ skinInstanceCB(Geometry *geo, InstanceDataHeader *header) int32 w[4]; int sum; - float *weights = skin->weights; + float32 *weights = skin->weights; uint8 *p = vbuf; int32 numVertices = header->numVertices; while(numVertices--){ sum = 0; for(int i = 1; i < skin->numWeights; i++){ - w[i] = weights[i]*255.0f + 0.5f; + w[i] = (int32)(weights[i]*255.0f + 0.5f); sum += w[i]; } w[0] = 255 - sum; diff --git a/src/geometry.cpp b/src/geometry.cpp index 40835d2..f678caa 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -517,7 +517,7 @@ Geometry::buildMeshes(void) // count indices per mesh tri = this->triangles; for(int32 i = 0; i < this->numTriangles; i++){ - assert(tri->matId >= 0 && tri->matId < numMeshes); + assert(tri->matId < numMeshes); numIndices[tri->matId] += 3; tri++; } diff --git a/src/gl/gl3device.cpp b/src/gl/gl3device.cpp index 6288535..51f9194 100755 --- a/src/gl/gl3device.cpp +++ b/src/gl/gl3device.cpp @@ -628,3 +628,4 @@ Device renderdevice = { } #endif + diff --git a/src/gl/gl3matfx.cpp b/src/gl/gl3matfx.cpp index 4a9f7ae..38705c5 100644 --- a/src/gl/gl3matfx.cpp +++ b/src/gl/gl3matfx.cpp @@ -240,3 +240,4 @@ void initMatFX(void) { } } } + diff --git a/src/gl/gl3render.cpp b/src/gl/gl3render.cpp index ec688ca..8f5c68b 100644 --- a/src/gl/gl3render.cpp +++ b/src/gl/gl3render.cpp @@ -115,3 +115,4 @@ defaultRenderCB(Atomic *atomic, InstanceDataHeader *header) } #endif + diff --git a/src/gl/gl3skin.cpp b/src/gl/gl3skin.cpp index 7d73d1e..3f588a2 100644 --- a/src/gl/gl3skin.cpp +++ b/src/gl/gl3skin.cpp @@ -305,3 +305,4 @@ void initSkin(void) { } } } + diff --git a/src/ps2/ps2device.cpp b/src/ps2/ps2device.cpp index f40a9b6..b2e7285 100755 --- a/src/ps2/ps2device.cpp +++ b/src/ps2/ps2device.cpp @@ -32,6 +32,9 @@ Device renderdevice = { null::setRenderState, null::getRenderState, null::im2DRenderIndexedPrimitive, + null::im3DTransform, + null::im3DRenderIndexed, + null::im3DEnd, null::deviceSystem }; diff --git a/src/render.cpp b/src/render.cpp index 543c910..656f13d 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -48,4 +48,5 @@ End(void) } -} \ No newline at end of file +} + diff --git a/src/rwobjects.h b/src/rwobjects.h index f7af000..e31a4f5 100755 --- a/src/rwobjects.h +++ b/src/rwobjects.h @@ -269,6 +269,8 @@ struct Texture static Texture *(*findCB)(const char *name); static Texture *(*readCB)(const char *name, const char *mask); + static void setLoadTextures(bool32); + static void setCreateDummies(bool32); #ifndef RWPUBLIC static void registerModule(void); diff --git a/src/rwrender.h b/src/rwrender.h index 6277c84..2ca5256 100644 --- a/src/rwrender.h +++ b/src/rwrender.h @@ -68,4 +68,5 @@ void End(void); } -} \ No newline at end of file +} + diff --git a/src/texture.cpp b/src/texture.cpp index 33eb082..74f7705 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -63,6 +63,18 @@ Texture::registerModule(void) Engine::registerPlugin(sizeof(TextureGlobals), ID_TEXTUREMODULE, textureOpen, textureClose); } +void +Texture::setLoadTextures(bool32 b) +{ + TEXTUREGLOBAL(loadTextures) = b; +} + +void +Texture::setCreateDummies(bool32 b) +{ + TEXTUREGLOBAL(makeDummies) = b; +} + // // TexDictionary // diff --git a/src/userdata.cpp b/src/userdata.cpp index 0a5f8a1..a87224e 100644 --- a/src/userdata.cpp +++ b/src/userdata.cpp @@ -284,33 +284,33 @@ remove(UserDataExtension *ext, int32 n) #define ACCESSOR(TYPE, NAME) \ int32 \ -UserDataArray::##NAME##Add(TYPE *t, const char *name, int32 datatype, int32 numElements) \ +UserDataArray::NAME##Add(TYPE *t, const char *name, int32 datatype, int32 numElements) \ { \ - return add(PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset), \ + return add(PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset), \ name, datatype, numElements); \ } \ void \ -UserDataArray::##NAME##Remove(TYPE *t, int32 n) \ +UserDataArray::NAME##Remove(TYPE *t, int32 n) \ { \ - remove(PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset), n); \ + remove(PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset), n); \ } \ int32 \ -UserDataArray::##NAME##GetCount(TYPE *t) \ +UserDataArray::NAME##GetCount(TYPE *t) \ { \ - return PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset)->numArrays; \ + return PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset)->numArrays; \ } \ UserDataArray* \ -UserDataArray::##NAME##Get(TYPE *t, int32 n) \ +UserDataArray::NAME##Get(TYPE *t, int32 n) \ { \ - if(n >= PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset)->numArrays) \ + if(n >= PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset)->numArrays) \ return nil; \ - return &PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset)->arrays[n]; \ + return &PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset)->arrays[n]; \ } \ int32 \ -UserDataArray::##NAME##FindIndex(TYPE *t, const char *name) \ +UserDataArray::NAME##FindIndex(TYPE *t, const char *name) \ { \ int32 i; \ - UserDataExtension *ext = PLUGINOFFSET(UserDataExtension, t, userDataGlobals.##NAME##Offset); \ + UserDataExtension *ext = PLUGINOFFSET(UserDataExtension, t, userDataGlobals.NAME##Offset); \ for(i = 0; i < ext->numArrays; i++) \ if(strcmp(ext->arrays[i].name, name) == 0) \ return i; \ diff --git a/tools/clumpview/main.cpp b/tools/clumpview/main.cpp index ef85023..e0eaa72 100644 --- a/tools/clumpview/main.cpp +++ b/tools/clumpview/main.cpp @@ -167,7 +167,7 @@ InitRW(void) tex = rw::Texture::read("maze", nil); - char *filename = "teapot.dff"; + const char *filename = "teapot.dff"; if(sk::args.argc > 1) filename = sk::args.argv[1]; rw::StreamFile in; diff --git a/tools/ps2test/main.cpp b/tools/ps2test/main.cpp index 864ce9b..8dcd1e3 100755 --- a/tools/ps2test/main.cpp +++ b/tools/ps2test/main.cpp @@ -658,7 +658,7 @@ initrw(void) return 0; if(!rw::Engine::start(&engineStartParams)) return 0; - rw::engine->loadTextures = 0; + rw::Texture::setLoadTextures(0); rw::TexDictionary::setCurrent(rw::TexDictionary::create()); rw::Image::setSearchPath(".");