made switching platforms a little nicer

This commit is contained in:
aap
2015-12-17 22:15:59 +01:00
parent 32dfcf0fd2
commit 66e67d5aff
3 changed files with 55 additions and 3 deletions

View File

@@ -16,6 +16,40 @@
using namespace std;
namespace rw {
int32
findPlatform(Clump *c)
{
for(int32 i = 0; i < c->numAtomics; i++){
Geometry *g = c->atomicList[i]->geometry;
if(g->instData)
return g->instData->platform;
}
return 0;
}
void
switchPipes(Clump *c, int32 platform)
{
for(int32 i = 0; i < c->numAtomics; i++){
Atomic *a = c->atomicList[i];
if(a->pipeline && a->pipeline->platform != platform){
uint32 plgid = a->pipeline->pluginID;
switch(plgid){
case ID_SKIN:
a->pipeline = skinGlobals.pipelines[platform];
break;
case ID_MATFX:
a->pipeline = matFXGlobals.pipelines[platform];
break;
}
}
}
}
}
namespace gta {
void
@@ -579,6 +613,7 @@ static void
readPipeline(Stream *stream, int32, void *object, int32 offset, int32)
{
*PLUGINOFFSET(uint32, object, offset) = stream->readU32();
printf("%x\n", *PLUGINOFFSET(uint32, object, offset));
}
static void

View File

@@ -1,3 +1,8 @@
namespace rw {
int32 findPlatform(Clump *c);
void switchPipes(Clump *c, int32 platform);
};
namespace gta {
using namespace rw;