From 5247d1c26ec1af73b86cd0d2e2c69a9d8bd857f8 Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 26 Jan 2015 20:23:45 +0100 Subject: [PATCH] Some fixes. --- src/image.cpp | 5 +++-- tests/gl/main.cpp | 4 +++- tests/ps2/Makefile | 6 +++--- tests/ps2/main.cpp | 18 +++++++++--------- 4 files changed, 18 insertions(+), 15 deletions(-) mode change 100644 => 100755 src/image.cpp diff --git a/src/image.cpp b/src/image.cpp old mode 100644 new mode 100755 index ce8e3a5..5ea3bc3 --- a/src/image.cpp +++ b/src/image.cpp @@ -75,7 +75,7 @@ Texture::read(const char *name, const char *mask) Raster *raster = NULL; Texture *tex; - if((tex = currentTexDictionary->find(name))) + if(currentTexDictionary && (tex = currentTexDictionary->find(name))) return tex; tex = new Texture; strncpy(tex->name, name, 32); @@ -90,7 +90,8 @@ Texture::read(const char *name, const char *mask) delete img; } tex->raster = raster; - currentTexDictionary->add(tex); + if(currentTexDictionary) + currentTexDictionary->add(tex); return tex; } diff --git a/tests/gl/main.cpp b/tests/gl/main.cpp index 24d2b19..e06c570 100755 --- a/tests/gl/main.cpp +++ b/tests/gl/main.cpp @@ -187,9 +187,11 @@ init(void) rw::Image::setSearchPath( "/home/aap/gamedata/ps2/gta3/MODELS/gta3_archive/txd_extracted/;//home/aap/gamedata/ps2/gtavc/MODELS/gta3_archive/txd_extracted/;/home/aap/gamedata/ps2/gtasa/models/gta3_archive/txd_extracted/"); //"D:\\rockstargames\\ps2\\gtavc\\MODELS\\gta3_archive\\txd_extracted\\;D:\\rockstargames\\ps2\\gtasa\\models\\gta3_archive\\txd_extracted\\"); + rw::gl::registerNativeRaster(); - rw::registerMaterialRightsPlugin(); + gta::registerEnvSpecPlugin(); rw::registerMatFXPlugin(); + rw::registerMaterialRightsPlugin(); rw::registerAtomicRightsPlugin(); rw::registerHAnimPlugin(); gta::registerNodeNamePlugin(); diff --git a/tests/ps2/Makefile b/tests/ps2/Makefile index 653a894..8f1b54c 100755 --- a/tests/ps2/Makefile +++ b/tests/ps2/Makefile @@ -1,13 +1,13 @@ CC=ee-gcc CXX=ee-g++ AS=ee-g++ -LD=ee-g++ -v +LD=ee-g++ DVPAS=ee-dvp-as LINK=-T$(PS2SDK)/ee/startup/linkfile LIBPATH=-L$(PS2SDK)/ee/lib -INCPATH=-I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I$(HOME)/src/librw -LIBS=$(HOME)/src/librw/librw-ps2.a -lc -lc -lkernel -lmf # g++ throws one -lc away, why? (unless -nostdlib) +INCPATH=-I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I../.. +LIBS=../../librw-ps2.a -lc -lc -lkernel -lmf # g++ throws one -lc away, why? (unless -nostdlib) CFLAGS = -c -Wall -nostdlib -fno-common -DPS2_EE $(INCPATH) ASFLAGS = -c -xassembler-with-cpp diff --git a/tests/ps2/main.cpp b/tests/ps2/main.cpp index d947c62..57353b9 100755 --- a/tests/ps2/main.cpp +++ b/tests/ps2/main.cpp @@ -1,9 +1,8 @@ -//#include -//#include -//#define _USE_MATH_DEFINES -//#include -//#include -#include +#include +#include +#define _USE_MATH_DEFINES +#include +#include #include #include @@ -121,18 +120,19 @@ main() gsCurState->clearcol = 0x80404040; gsInit(); - printf("hallo\n"); - rw::registerMaterialRightsPlugin(); + gta::registerEnvSpecPlugin(); rw::registerMatFXPlugin(); + rw::registerMaterialRightsPlugin(); rw::registerAtomicRightsPlugin(); + rw::registerHAnimPlugin(); gta::registerNodeNamePlugin(); gta::registerBreakableModelPlugin(); gta::registerExtraVertColorPlugin(); rw::ps2::registerADCPlugin(); rw::registerSkinPlugin(); rw::registerNativeDataPlugin(); -// rw::ps2::registerNativeDataPlugin(); +// rw::ps2::registerNativeDataPlugin(); rw::registerMeshPlugin(); // rw::StreamFile in;