diff --git a/configure.ac b/configure.ac index 3b3b77a..4f56655 100644 --- a/configure.ac +++ b/configure.ac @@ -13,15 +13,16 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB +# AC_PROG_LIBTOOL # Checks for libraries. AC_CHECK_LIB([Xxf86vm], [main], [], [echo "ERROR: Xxf86vm library not found." && exit 1]) AC_CHECK_LIB([GL], [main], [], [echo "ERROR: GL library not found." && exit 1]) AC_CHECK_LIB([GLU], [main], [], [echo "ERROR: GLU library not found." && exit 1]) -AC_CHECK_LIB([Irrlicht], [main], [], [echo "ERROR: Irrlicht library not found." && exit 1]) +# AC_CHECK_LIB([Irrlicht], [main], [], [echo "ERROR: Irrlicht library not found." && exit 1]) AC_CHECK_LIB([ssl], [main], [], [echo "ERROR: ssl library not found." && exit 1]) AC_CHECK_LIB([crypto], [main], [], [echo "ERROR: ssl crypto library not found." && exit 1]) -AC_CHECK_LIB([ZThread], [main], [], [echo "ERROR: ZThread library not found." && exit 1]) +# AC_CHECK_LIB([ZThread], [main], [], [echo "ERROR: ZThread library not found." && exit 1]) # Checks for header files. AC_PATH_X @@ -65,6 +66,10 @@ AC_CHECK_FUNCS([floor ftime ftruncate getcwd gethostbyaddr gethostbyname gethost # src/dep/src/irrlicht/libpng]) AC_CONFIG_FILES([Makefile src/Makefile + src/dep/Makefile + src/dep/src/Makefile + src/dep/src/zlib/Makefile + src/dep/src/zthread/Makefile src/tools/Makefile src/tools/stuffextract/Makefile src/tools/stuffextract/StormLib/Makefile diff --git a/src/Client/GUI/CM2MeshFileLoader.cpp b/src/Client/GUI/CM2MeshFileLoader.cpp index 3d0dd2d..f3183f4 100644 --- a/src/Client/GUI/CM2MeshFileLoader.cpp +++ b/src/Client/GUI/CM2MeshFileLoader.cpp @@ -1,32 +1,7 @@ #include #include "CM2MeshFileLoader.h" #include "SSkinnedMesh.h" -#define _DEBUG #include "common.h" -#ifdef _DEBUG -#define DEBUG(code) code; -#else -#define DEBUG(code) ; -#endif - -/* - -void logdebug(const char *str, ...) -{ - if(!str) - return; - va_list ap; -// _log_setcolor(true,LBLUE); - va_start(ap, str); - vprintf( str, ap ); - va_end(ap); -// _log_resetcolor(true); - - - printf("\n"); - - fflush(stdout); -}*/ namespace irr { @@ -207,7 +182,7 @@ for(u32 i=0;iread(&tempM2TexLookup,sizeof(u16)); M2MTextureLookup.push_back(tempM2TexLookup); - printf("Texture %u Type %u\n",i,tempM2TexLookup); + DEBUG(logdebug("Texture %u Type %u\n",i,tempM2TexLookup)); } DEBUG(logdebug("Read %u Texture lookup entries",M2MTextureLookup.size())); @@ -222,7 +197,7 @@ for(u32 i=0;iread(&tempM2TexDef,sizeof(TextureDefinition)); M2MTextureDef.push_back(tempM2TexDef); - printf("Texture %u Type %u\n",i,tempM2TexDef.texType); + DEBUG(logdebug("Texture %u Type %u\n",i,tempM2TexDef.texType)); } DEBUG(logdebug("Read %u Texture Definition entries",M2MTextureDef.size())); @@ -241,10 +216,6 @@ for(u32 i=0;iIndices.push_back(M2MIndices[M2MTriangles[j]]-M2MSubmeshes[i].ofsVertex); } - // std::cout << i << ": " << MeshBuffer->Indices.size() << "\n"; + for(u32 j=M2MSubmeshes[i].ofsVertex;jVertices_Standard.push_back(M2Vertices[j]); diff --git a/src/Client/GUI/Makefile.am b/src/Client/GUI/Makefile.am index 5a8c8f1..03a144b 100644 --- a/src/Client/GUI/Makefile.am +++ b/src/Client/GUI/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall -D_DEBUG +AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -I$(top_builddir)/src/dep/include -Wall -D_DEBUG ## Build pseuwow noinst_LIBRARIES = libgui.a libgui_a_SOURCES =CCursorController.cpp DrawObject.cpp MInput.h Scene.h SImage.h\ diff --git a/src/Client/GUI/SImage.cpp b/src/Client/GUI/SImage.cpp index a789b11..64bcbb5 100644 --- a/src/Client/GUI/SImage.cpp +++ b/src/Client/GUI/SImage.cpp @@ -185,6 +185,7 @@ void SImage::setPixel(u32 x, u32 y, const SColor &color ) } + //! returns a pixel SColor SImage::getPixel(u32 x, u32 y) const { @@ -269,6 +270,40 @@ void SImage::copyToScaling(void* target, s32 width, s32 height, ECOLOR_FORMAT fo } } + +//! copies this surface into another, using the alpha mask, an cliprect and a color to add with +void SImage::copyToWithAlpha(IImage* target, const core::position2d& pos, const core::rect& sourceRect, const SColor &color, const core::rect* clipRect) +{ + // color blend only necessary on not full spectrum aka. color.color != 0xFFFFFFFF +// Blit(color.color == 0xFFFFFFFF ? BLITTER_TEXTURE_ALPHA_BLEND: BLITTER_TEXTURE_ALPHA_COLOR_BLEND, target, clipRect, &pos, this, &sourceRect, color.color); +} + +//! fills the surface with given color +void SImage::fill(const SColor &color) +{ + u32 c; + + switch ( Format ) + { + case ECF_A1R5G5B5: + c = video::A8R8G8B8toA1R5G5B5( color.color ); + c |= c << 16; + break; + case ECF_R5G6B5: + c = video::A8R8G8B8toR5G6B5( color.color ); + c |= c << 16; + break; + case ECF_A8R8G8B8: + c = color.color; + break; + default: +// os::Printer::log("CImage::Format not supported", ELL_ERROR); + return; + } + + //memset32( Data, c, getImageDataSizeInBytes() ); +} + //! copies this surface into another, scaling it to the target image size // note: this is very very slow. (i didn't want to write a fast version. // but hopefully, nobody wants to scale surfaces every frame. diff --git a/src/Client/GUI/SImage.h b/src/Client/GUI/SImage.h index ef09481..ba7a093 100644 --- a/src/Client/GUI/SImage.h +++ b/src/Client/GUI/SImage.h @@ -64,6 +64,14 @@ public: //! copies this surface into another void copyTo(IImage* target, const core::position2d& pos, const core::rect& sourceRect, const core::rect* clipRect=0); + //! copies this surface into another, using the alpha mask, an cliprect and a color to add with + virtual void copyToWithAlpha(IImage* target, const core::position2d& pos, + const core::rect& sourceRect, const SColor &color, + const core::rect* clipRect = 0); + + //! fills the surface with black or white + virtual void fill(const SColor &color); + //! copies this surface into another, scaling it to fit. void copyToScaling(void* target, s32 width, s32 height, ECOLOR_FORMAT format, u32 pitch=0); diff --git a/src/Client/GUI/SSkinnedMesh.cpp b/src/Client/GUI/SSkinnedMesh.cpp index 475626f..ef061bd 100755 --- a/src/Client/GUI/SSkinnedMesh.cpp +++ b/src/Client/GUI/SSkinnedMesh.cpp @@ -70,7 +70,7 @@ IMesh* CSkinnedMesh::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 //! Animates this mesh's joints based on frame input //! blend: {0-old position, 1-New position} void CSkinnedMesh::animateMesh(f32 frame, f32 blend) -{ +{ // std::cout<<"Frame "<Material.setFlag(flag,newvalue); } +//! set the hardware mapping hint, for driver +void CSkinnedMesh::setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, + E_BUFFER_TYPE buffer) +{ + for (u32 i=0; isetHardwareMappingHint(newMappingHint, buffer); +} + + +//! flags the meshbuffer as changed, reloads hardware buffers +void CSkinnedMesh::setDirty(E_BUFFER_TYPE buffer) +{ + for (u32 i=0; isetDirty(buffer); +} + //! uses animation from another mesh bool CSkinnedMesh::useAnimationFrom(const ISkinnedMesh *mesh) @@ -837,7 +853,6 @@ void CSkinnedMesh::checkForAnimation() //! called by loader after populating with mesh and bone data void CSkinnedMesh::finalize() { - std::cout<<"Finalize has been called\n"; u32 i; LastAnimatedFrame=-1; @@ -913,8 +928,8 @@ void CSkinnedMesh::finalize() //Todo: optimise keys here... checkForAnimation(); - printf("Has Animation %u\n",HasAnimation); - if (HasAnimation) + +if (HasAnimation) { //--- optimize and check keyframes --- for(i=0;igetHeading()); str += L" Pos: "; - str += ((((((str + wp.x) + L" | ") + wp.y) + L" | ") + wp.z) + L" | OR:") + wp.o; + str += wp.x; + str += L" | "; + str += wp.y; + str += L" | "; + str += wp.z; + str += L" | OR:"; + str += wp.o; +// str += ((((((str + wp.x) + L" | ") + wp.y) + L" | ") + wp.z) + L" | OR:") + wp.o;// WTF? str += L" -- Terrain: Sectors: "; str += (int)terrain->getSectorsRendered(); str += L" / "; diff --git a/src/Client/Makefile.am b/src/Client/Makefile.am index aa3e976..4013837 100644 --- a/src/Client/Makefile.am +++ b/src/Client/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = DefScript Realm World GUI -AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall +AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -I$(top_builddir)/src/dep/include -Wall ## Build pseuwow bin_PROGRAMS = pseuwow pseuwow_SOURCES = Cli.cpp\ @@ -18,5 +18,15 @@ pseuwow_SOURCES = Cli.cpp\ World/MapMgr.cpp -pseuwow_LDADD = ../shared/libshared.a ../shared/Auth/libauth.a ../shared/Network/libnetwork.a DefScript/libdefscript.a World/libworld.a GUI/libgui.a /usr/local/lib/libIrrKlang.so +pseuwow_LDADD = ../shared/libshared.a\ + ../shared/Auth/libauth.a\ + ../shared/Network/libnetwork.a\ + DefScript/libdefscript.a\ + World/libworld.a \ + GUI/libgui.a\ + $(prefix)/libIrrKlang.so\ + ../dep/lib/linux-gcc/libIrrlicht.a\ + ../dep/src/zlib/libzlib.a\ + ../dep/src/zthread/libZThread.a + pseuwow_LDFLAGS =-pthread \ No newline at end of file diff --git a/src/Client/Realm/Makefile.am b/src/Client/Realm/Makefile.am index 3c68f12..d0b34ea 100644 --- a/src/Client/Realm/Makefile.am +++ b/src/Client/Realm/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall +AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -I$(top_builddir)/src/dep/include -Wall ## Build pseuwow noinst_LIBRARIES = librealm.a librealm_a_SOURCES =RealmSession.cpp RealmSession.h RealmSocket.cpp RealmSocket.h diff --git a/src/Client/World/Makefile.am b/src/Client/World/Makefile.am index 3e2d7e9..52cc27e 100644 --- a/src/Client/World/Makefile.am +++ b/src/Client/World/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall +AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -I$(top_builddir)/src/dep/include -Wall ## Build pseuwow noinst_LIBRARIES = libworld.a libworld_a_SOURCES =Bag.cpp DynamicObject.cpp MovementMgr.cpp Player.cpp World.cpp\ diff --git a/src/Makefile.am b/src/Makefile.am index e213cde..2b1c49d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ ## Makefile.am - process this file with automake AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall -SUBDIRS = shared Client tools +SUBDIRS = dep shared Client tools ## End Makefile.am diff --git a/src/PseuWoW.cbp b/src/PseuWoW.cbp index 432709a..e155e32 100644 --- a/src/PseuWoW.cbp +++ b/src/PseuWoW.cbp @@ -8,7 +8,7 @@