diff options
-rw-r--r-- | extensions/makefile | 13 | ||||
-rw-r--r-- | extensions/smanim.cpp | 1 | ||||
-rw-r--r-- | extensions/smbmfont.cpp | 2 | ||||
-rw-r--r-- | extensions/smdatapack.cpp | 18 | ||||
-rw-r--r-- | smelt/sdl/CxImage/makefile | 12 | ||||
-rw-r--r-- | smelt/sdl/gfx_sdl.cpp | 40 | ||||
-rw-r--r-- | smelt/sdl/inp_sdl.cpp | 2 | ||||
-rw-r--r-- | smelt/sdl/makefile | 13 | ||||
-rw-r--r-- | smelt/sdl/sfx_sdl.cpp | 16 | ||||
-rw-r--r-- | smelt/sdl/sys_sdl.cpp | 34 |
10 files changed, 98 insertions, 53 deletions
diff --git a/extensions/makefile b/extensions/makefile new file mode 100644 index 0000000..4c6b3fe --- /dev/null +++ b/extensions/makefile @@ -0,0 +1,13 @@ +CC= g++ +CXXFLAGS= -c -std=c++11 -Wall -I../include -I/usr/include/freetype2 + +all: objects archive clean + +objects: + $(CC) *.cpp $(CXXFLAGS) +archive: + $(AR) rcs libsmeltext.a *.o +clean: + if ( test smanim.o ); then rm *.o; fi +clean-all: clean + rm *.a
\ No newline at end of file diff --git a/extensions/smanim.cpp b/extensions/smanim.cpp index d57292b..69bf8e0 100644 --- a/extensions/smanim.cpp +++ b/extensions/smanim.cpp @@ -111,6 +111,7 @@ bool smAnmFile::loadAnmFromMemory(const char* ptr,DWORD size) DWORD msez=anm.getFileSize("content.meta"); parseMeta(mptr,msez); anm.releaseFilePtr("content.meta"); + return true; } void smAnmFile::close() { diff --git a/extensions/smbmfont.cpp b/extensions/smbmfont.cpp index 22f9280..97b7fdb 100644 --- a/extensions/smbmfont.cpp +++ b/extensions/smbmfont.cpp @@ -55,6 +55,7 @@ bool smBMFont::loadAnmFromMemory(const char* ptr,DWORD size) anm.releaseFilePtr("content.meta"); setBlend(BLEND_ALPHABLEND); setColor(0xFFFFFFFF); + return true; } void smBMFont::close() { @@ -155,6 +156,7 @@ bool smBMFontw::loadAnmFromMemory(char* ptr,DWORD size) DWORD msez=anm.getFileSize("content.meta"); parseMeta(mptr,msez); anm.releaseFilePtr("content.meta"); + return true; } void smBMFontw::close() { diff --git a/extensions/smdatapack.cpp b/extensions/smdatapack.cpp index 2e77324..8b2c12b 100644 --- a/extensions/smdatapack.cpp +++ b/extensions/smdatapack.cpp @@ -11,9 +11,11 @@ #include "smdatapack.hpp" #include <cstdio> #include <cstring> -#define gzgetDWORD(f) ((gzgetc(f)<<24)|(gzgetc(f)<<16)|(gzgetc(f)<<8)|(gzgetc(f)))&0xFFFFFFFF -#define gch ((*(cp++))&0xFF) -#define mmgetDWORD ((gch<<24)|(gch<<16)|(gch<<8)|(gch))&0xFFFFFFFF +inline int gzgch(gzFile f){return gzgetc(f);} +inline DWORD gzgetDWORD(gzFile f) +{return ((gzgch(f)<<24)|(gzgch(f)<<16)|(gzgch(f)<<8)|gzgch(f))&0xFFFFFFFF;} +inline DWORD gch(const char *&cp){return (DWORD)((*(cp++))&0xFF);} +inline DWORD mmgetDWORD(const char *&cp){return ((gch(cp)<<24)|(gch(cp)<<16)|(gch(cp)<<8)|(gch(cp)))&0xFFFFFFFF;} #define gzputDWORD(f,a) gzputc(f,a>>24);gzputc(f,(a>>16)&0xFF);gzputc(f,(a>>8)&0xFF);gzputc(f,a&0xFF); bool smDtpFileR::openDtp(const char* path) { @@ -35,6 +37,7 @@ bool smDtpFileR::openDtp(const char* path) f.crc=gzgetDWORD(file); m[std::string(f.path)]=f; } + return true; } bool smDtpFileR::openDtpFromMemory(const char* ptr,DWORD size) { @@ -50,11 +53,12 @@ bool smDtpFileR::openDtpFromMemory(const char* ptr,DWORD size) f.path=new char[pl+1];f.data=NULL; for(int j=0;j<pl;++j)f.path[j]=*(cp++); f.path[pl]='\0'; - f.size=mmgetDWORD; - f.offset=mmgetDWORD; - f.crc=mmgetDWORD; + f.size=mmgetDWORD(cp); + f.offset=mmgetDWORD(cp); + f.crc=mmgetDWORD(cp); m[std::string(f.path)]=f; } + return true; } void smDtpFileR::closeDtp() { @@ -97,7 +101,7 @@ char* smDtpFileR::getFilePtr(const char* path) if(!enmemory) { int r=gzread(file,m[fns].data,m[fns].size); - if(r<m[fns].size){delete[] m[fns].data;printf("error: file size mismatch.\n");return m[fns].data=NULL;} + if((unsigned)r<m[fns].size){delete[] m[fns].data;printf("error: file size mismatch.\n");return m[fns].data=NULL;} } else { diff --git a/smelt/sdl/CxImage/makefile b/smelt/sdl/CxImage/makefile new file mode 100644 index 0000000..6dcb28b --- /dev/null +++ b/smelt/sdl/CxImage/makefile @@ -0,0 +1,12 @@ +CC= g++ +CXXFLAGS= -c -Os -D_LINUX +AR= ar + +all: objects archive clean + +objects: + $(CC) *.cpp $(CXXFLAGS) +archive: + $(AR) rcs libCxImage.a *.o +clean: + rm *.o && mv libCxImage.a ../ diff --git a/smelt/sdl/gfx_sdl.cpp b/smelt/sdl/gfx_sdl.cpp index 8c028ca..47b6999 100644 --- a/smelt/sdl/gfx_sdl.cpp +++ b/smelt/sdl/gfx_sdl.cpp @@ -24,7 +24,7 @@ bool SMELT_IMPL::smRenderBegin2D(bool ztest,SMTRG trg) { TRenderTargetList *targ=(TRenderTargetList*)trg; if(vertexArray) - {smLog("%s:"SLINE": Last frame not closed.\n",GFX_SDL_SRCFN);return false;} + {smLog("%s:" SLINE ": Last frame not closed.\n",GFX_SDL_SRCFN);return false;} if(pOpenGLDevice->have_GL_EXT_framebuffer_object) pOpenGLDevice->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,(targ)?targ->frame:0); pOpenGLDevice->glDepthFunc(GL_GEQUAL); @@ -51,7 +51,7 @@ bool SMELT_IMPL::smRenderBegin3D(float fov,SMTRG trg) { TRenderTargetList *targ=(TRenderTargetList*)trg; if(vertexArray) - {smLog("%s:"SLINE": Last frame not closed.\n",GFX_SDL_SRCFN);return false;} + {smLog("%s:" SLINE ": Last frame not closed.\n",GFX_SDL_SRCFN);return false;} if(pOpenGLDevice->have_GL_EXT_framebuffer_object) pOpenGLDevice->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,(targ)?targ->frame:0); pOpenGLDevice->glDepthFunc(GL_LESS); @@ -230,7 +230,7 @@ SMTRG SMELT_IMPL::smTargetCreate(int w,int h) ok=buildTarget(pTarget,gltex->name,w,h); if(!ok) { - smLog("%s:"SLINE": Failed to create render target.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": Failed to create render target.\n",GFX_SDL_SRCFN); smTextureFree(pTarget->tex); delete pTarget; return 0; @@ -642,7 +642,7 @@ void SMELT_IMPL::batchOGL(bool endScene) { printf("idxbuf:%d\n",indexBuf[i]); printf("QUAD'S TRIANGLE:\n"); -#define printVertex(a) printf("(%.2f,%.2f,%.2f),0x%lX,(%.2f,%.2f)\n",a.x,a.y,a.z,a.col,a.tx,a.ty); +#define printVertex(a) printf("(%.2f,%.2f,%.2f),0x%X,(%.2f,%.2f)\n",a.x,a.y,a.z,a.col,a.tx,a.ty); printf("#%d: ",indexBuf[i+0]);printVertex(vertexBuf[indexBuf[i+0]]); printf("#%d: ",indexBuf[i+1]);printVertex(vertexBuf[indexBuf[i+1]]); printf("#%d: ",indexBuf[i+2]);printVertex(vertexBuf[indexBuf[i+2]]); @@ -694,7 +694,7 @@ bool SMELT_IMPL::checkGLExtension(const char *extlist,const char *ext) } bool SMELT_IMPL::loadGLEntryPoints() { - smLog("%s:"SLINE": OpenGL: loading entry points and examining extensions...\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: loading entry points and examining extensions...\n",GFX_SDL_SRCFN); pOpenGLDevice->have_base_opengl=true; pOpenGLDevice->have_GL_ARB_texture_rectangle=true; pOpenGLDevice->have_GL_ARB_texture_non_power_of_two=true; @@ -717,15 +717,15 @@ bool SMELT_IMPL::loadGLEntryPoints() unloadGLEntryPoints(); return false; } - smLog("%s:"SLINE": GL_RENDERER: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_RENDERER)); - smLog("%s:"SLINE": GL_VENDOR: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_VENDOR)); - smLog("%s:"SLINE": GL_VERSION: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_VERSION)); + smLog("%s:" SLINE ": GL_RENDERER: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_RENDERER)); + smLog("%s:" SLINE ": GL_VENDOR: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_VENDOR)); + smLog("%s:" SLINE ": GL_VERSION: %s\n",GFX_SDL_SRCFN,(const char *)pOpenGLDevice->glGetString(GL_VERSION)); const char *verstr=(const char*)pOpenGLDevice->glGetString(GL_VERSION); int maj=0,min=0; sscanf(verstr,"%d.%d",&maj,&min); if((maj<1)||((maj==1)&&(min<2))) { - smLog("%s:"SLINE": OpenGL implementation must be at least version 1.2.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL implementation must be at least version 1.2.\n",GFX_SDL_SRCFN); unloadGLEntryPoints(); return false; } @@ -738,35 +738,35 @@ bool SMELT_IMPL::loadGLEntryPoints() maj>=2||checkGLExtension(exts,"GL_ARB_texture_non_power_of_two"); if(pOpenGLDevice->have_GL_ARB_texture_rectangle) { - smLog("%s:"SLINE": OpenGL: Using GL_ARB_texture_rectangle.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using GL_ARB_texture_rectangle.\n",GFX_SDL_SRCFN); pOpenGLDevice->TextureTarget=GL_TEXTURE_RECTANGLE_ARB; } else if(pOpenGLDevice->have_GL_ARB_texture_non_power_of_two) { - smLog("%s:"SLINE": OpenGL: Using GL_ARB_texture_non_power_of_two.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using GL_ARB_texture_non_power_of_two.\n",GFX_SDL_SRCFN); pOpenGLDevice->TextureTarget=GL_TEXTURE_2D; } else { - smLog("%s:"SLINE": OpenGL: Using power-of-two textures. This costs more memory!\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using power-of-two textures. This costs more memory!\n",GFX_SDL_SRCFN); pOpenGLDevice->TextureTarget=GL_TEXTURE_2D; } if(pOpenGLDevice->have_GL_EXT_framebuffer_object) pOpenGLDevice->have_GL_EXT_framebuffer_object= checkGLExtension(exts, "GL_EXT_framebuffer_object"); if(pOpenGLDevice->have_GL_EXT_framebuffer_object) - smLog("%s:"SLINE": OpenGL: Using GL_EXT_framebuffer_object.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using GL_EXT_framebuffer_object.\n",GFX_SDL_SRCFN); else - smLog("%s:"SLINE": OpenGL: WARNING! No render-to-texture support. Things may render badly.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: WARNING! No render-to-texture support. Things may render badly.\n",GFX_SDL_SRCFN); if(pOpenGLDevice->have_GL_EXT_texture_compression_s3tc) pOpenGLDevice->have_GL_EXT_texture_compression_s3tc= checkGLExtension(exts,"GL_ARB_texture_compression")&& checkGLExtension(exts,"GL_EXT_texture_compression_s3tc"); if(pOpenGLDevice->have_GL_EXT_texture_compression_s3tc) - smLog("%s:"SLINE": OpenGL: Using GL_EXT_texture_compression_s3tc.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using GL_EXT_texture_compression_s3tc.\n",GFX_SDL_SRCFN); else if (true) { - smLog("%s:"SLINE": OpenGL: Texture compression disabled!\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Texture compression disabled!\n",GFX_SDL_SRCFN); } if(pOpenGLDevice->have_GL_ARB_vertex_buffer_object) { @@ -774,18 +774,18 @@ bool SMELT_IMPL::loadGLEntryPoints() checkGLExtension(exts,"GL_ARB_vertex_buffer_object"); } if(pOpenGLDevice->have_GL_ARB_vertex_buffer_object) - smLog("%s:"SLINE": OpenGL: Using GL_ARB_vertex_buffer_object.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: Using GL_ARB_vertex_buffer_object.\n",GFX_SDL_SRCFN); else - smLog("%s:"SLINE": OpenGL: WARNING! No VBO support; performance may suffer.\n",GFX_SDL_SRCFN); + smLog("%s:" SLINE ": OpenGL: WARNING! No VBO support; performance may suffer.\n",GFX_SDL_SRCFN); return true; } bool SMELT_IMPL::initOGL() { primTex=0; - if(pOpenGLDevice){smLog("%s:"SLINE": Multiple initialization!\n",GFX_SDL_SRCFN);return false;} + if(pOpenGLDevice){smLog("%s:" SLINE ": Multiple initialization!\n",GFX_SDL_SRCFN);return false;} pOpenGLDevice=new TOpenGLDevice; if(!loadGLEntryPoints())return false; - smLog("%s:"SLINE": Mode: %d x %d\n",GFX_SDL_SRCFN,scrw,scrh); + smLog("%s:" SLINE ": Mode: %d x %d\n",GFX_SDL_SRCFN,scrw,scrh); vertexArray=NULL;textures=NULL;IndexBufferObject=0; if(!confOGL())return false; pOpenGLDevice->glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); diff --git a/smelt/sdl/inp_sdl.cpp b/smelt/sdl/inp_sdl.cpp index a18baa9..c1e05de 100644 --- a/smelt/sdl/inp_sdl.cpp +++ b/smelt/sdl/inp_sdl.cpp @@ -9,7 +9,7 @@ * */ #include "smelt_internal.hpp" -static const char* INP_SDL_SRCFN="smelt/sdl/inp_sdl.cpp"; +//static const char* INP_SDL_SRCFN="smelt/sdl/inp_sdl.cpp"; bool SMELT_IMPL::smGetInpEvent(smInpEvent *e) { TInputEventList *eptr; diff --git a/smelt/sdl/makefile b/smelt/sdl/makefile new file mode 100644 index 0000000..aa9acb8 --- /dev/null +++ b/smelt/sdl/makefile @@ -0,0 +1,13 @@ +CC= g++ +CXXFLAGS= -c -std=c++11 -Wall -I/usr/include/SDL/ -I../include -D_LINUX + +all: objects archive clean + +objects: + $(CC) *.cpp $(CXXFLAGS) +archive: + $(AR) rcs libsmelt.a *.o +clean: + if ( test gfx_sdl.o ); then rm *.o; fi +clean-all: clean + rm *.a
\ No newline at end of file diff --git a/smelt/sdl/sfx_sdl.cpp b/smelt/sdl/sfx_sdl.cpp index 10a207c..b61a8a0 100644 --- a/smelt/sdl/sfx_sdl.cpp +++ b/smelt/sdl/sfx_sdl.cpp @@ -287,28 +287,28 @@ bool SMELT_IMPL::initOAL() { if(pOpenALDevice)return true; scnt=0;memset(src,0,sizeof(src)); - smLog("%s:"SLINE": Initializing OpenAL...\n",SFX_SDL_SRCFN); + smLog("%s:" SLINE ": Initializing OpenAL...\n",SFX_SDL_SRCFN); ALCdevice *dev=alcOpenDevice(NULL); if(!dev) { - smLog("%s:"SLINE": alcOpenDevice() failed.\n",SFX_SDL_SRCFN); + smLog("%s:" SLINE ": alcOpenDevice() failed.\n",SFX_SDL_SRCFN); return mute=true; } ALint caps[]={ALC_FREQUENCY,44100,0}; ALCcontext *ctx=alcCreateContext(dev,caps); if(!ctx) { - smLog("%s:"SLINE": alcCreateContext() failed.\n",SFX_SDL_SRCFN); + smLog("%s:" SLINE ": alcCreateContext() failed.\n",SFX_SDL_SRCFN); return mute=true; } alcMakeContextCurrent(ctx);alcProcessContext(ctx); - smLog("%s:"SLINE": Done OpenAL initialization\n",SFX_SDL_SRCFN); - smLog("%s:"SLINE": AL_VENDOR: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VENDOR)); - smLog("%s:"SLINE": AL_RENDERER: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_RENDERER)); - smLog("%s:"SLINE": AL_VERSION: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VERSION)); + smLog("%s:" SLINE ": Done OpenAL initialization\n",SFX_SDL_SRCFN); + smLog("%s:" SLINE ": AL_VENDOR: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VENDOR)); + smLog("%s:" SLINE ": AL_RENDERER: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_RENDERER)); + smLog("%s:" SLINE ": AL_VERSION: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VERSION)); const char* ext=(const char*)alGetString(AL_EXTENSIONS); lpp=strstr(ext,"AL_SOFT_loop_points")!=NULL; - if(!lpp)smLog("%s:"SLINE": Warning: loop points not supported. Please recompile with OpenAL Soft.\n",SFX_SDL_SRCFN); + if(!lpp)smLog("%s:" SLINE ": Warning: loop points not supported. Please recompile with OpenAL Soft.\n",SFX_SDL_SRCFN); pOpenALDevice=(void*)dev; return true; } diff --git a/smelt/sdl/sys_sdl.cpp b/smelt/sdl/sys_sdl.cpp index 190f3bb..27a9e7b 100644 --- a/smelt/sdl/sys_sdl.cpp +++ b/smelt/sdl/sys_sdl.cpp @@ -38,15 +38,15 @@ void SMELT_IMPL::smRelease() bool SMELT_IMPL::smInit() { - smLog("%s:"SLINE": Initalizing SMELT...\n",SYS_SDL_SRCFN); - smLog("%s:"SLINE": SMELT api version %d\n",SYS_SDL_SRCFN,SMELT_APILEVEL); + smLog("%s:" SLINE ": Initalizing SMELT...\n",SYS_SDL_SRCFN); + smLog("%s:" SLINE ": SMELT api version %d\n",SYS_SDL_SRCFN,SMELT_APILEVEL); time_t t=time(NULL); - smLog("%s:"SLINE": Date %s",SYS_SDL_SRCFN,asctime(localtime(&t))); + smLog("%s:" SLINE ": Date %s",SYS_SDL_SRCFN,asctime(localtime(&t))); #ifdef WIN32 OSVERSIONINFO os_ver; MEMORYSTATUS mem_st; os_ver.dwOSVersionInfoSize=sizeof(os_ver); GetVersionEx(&os_ver); - smLog("%s:"SLINE": OS: Windows %ld.%ld.%ld\n", SYS_SDL_SRCFN,os_ver.dwMajorVersion,os_ver.dwMinorVersion,os_ver.dwBuildNumber); + smLog("%s:" SLINE ": OS: Windows %ld.%ld.%ld\n", SYS_SDL_SRCFN,os_ver.dwMajorVersion,os_ver.dwMinorVersion,os_ver.dwBuildNumber); int CPUInfo[4]={-1}; __cpuid(CPUInfo,0x80000000); @@ -63,50 +63,50 @@ bool SMELT_IMPL::smInit() memcpy(cpuName+32, CPUInfo, sizeof(CPUInfo)); } while(*cpuName=' ')++cpuName; - smLog("%s:"SLINE": CPU: %s\n", SYS_SDL_SRCFN,cpuName); + smLog("%s:" SLINE ": CPU: %s\n", SYS_SDL_SRCFN,cpuName); free(loced); GlobalMemoryStatus(&mem_st); - smLog("%s:"SLINE": Memory: %ldK total, %ldK free\n", SYS_SDL_SRCFN,mem_st.dwTotalPhys/1024L,mem_st.dwAvailPhys/1024L); + smLog("%s:" SLINE ": Memory: %ldK total, %ldK free\n", SYS_SDL_SRCFN,mem_st.dwTotalPhys/1024L,mem_st.dwAvailPhys/1024L); #else system("uname -svm > os.out"); char osv[100];FILE* a=fopen("os.out","r");fgets(osv,100,a);fclose(a); osv[strlen(osv)-1]='\0'; - smLog("%s:"SLINE": OS: %s\n",SYS_SDL_SRCFN,osv); + smLog("%s:" SLINE ": OS: %s\n",SYS_SDL_SRCFN,osv); system("rm os.out"); system("cat /proc/cpuinfo | grep name -m 1 > cpu.out"); a=fopen("cpu.out","r");fgets(osv,100,a);fclose(a); osv[strlen(osv)-1]='\0';char *ptr=osv;while(*ptr!=':')++ptr;ptr+=2; - smLog("%s:"SLINE": CPU: %s\n",SYS_SDL_SRCFN,osv); + smLog("%s:" SLINE ": CPU: %s\n",SYS_SDL_SRCFN,osv); system("rm cpu.out"); a=fopen("/proc/meminfo","r"); unsigned totalm,freem; fscanf(a,"MemTotal: %u kB\n",&totalm); fscanf(a,"MemFree: %u kB\n",&freem); - smLog("%s:"SLINE": RAM: %ukB installed, %ukB free\n",SYS_SDL_SRCFN,totalm,freem); + smLog("%s:" SLINE ": RAM: %ukB installed, %ukB free\n",SYS_SDL_SRCFN,totalm,freem); fclose(a); #endif if(SDL_Init(SDL_INIT_VIDEO)==-1) { - smLog("%s:"SLINE": SDL_Init() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); + smLog("%s:" SLINE ": SDL_Init() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); return false; } if(SDL_GL_LoadLibrary(NULL)==-1) { - smLog("%s:"SLINE": SDL_GL_LoadLibrary() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); + smLog("%s:" SLINE ": SDL_GL_LoadLibrary() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); return false; } SDL_DisplayMode vidinfo; if(SDL_GetDesktopDisplayMode(0,&vidinfo)) { - smLog("%s:"SLINE": SDL_GetDesktopDisplayMode() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); + smLog("%s:" SLINE ": SDL_GetDesktopDisplayMode() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); SDL_Quit(); return false; } dispw=vidinfo.w;disph=vidinfo.h; - smLog("%s:"SLINE": Screen: %d x %d\n",SYS_SDL_SRCFN,dispw,disph); + smLog("%s:" SLINE ": Screen: %d x %d\n",SYS_SDL_SRCFN,dispw,disph); Uint32 flags=SDL_WINDOW_OPENGL; if(!windowed)flags|=SDL_WINDOW_FULLSCREEN; SDL_Window *screen=SDL_CreateWindow(winTitle,SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,scrw,scrh,flags); @@ -122,7 +122,7 @@ bool SMELT_IMPL::smInit() SDL_GL_SetSwapInterval(vsync?1:0); if(!hwnd) { - smLog("%s:"SLINE": SDL_CreateWindow() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); + smLog("%s:" SLINE ": SDL_CreateWindow() failed with error %s\n",SYS_SDL_SRCFN,SDL_GetError()); SDL_Quit(); return false; } @@ -142,15 +142,15 @@ bool SMELT_IMPL::smInit() void SMELT_IMPL::smFinale() { - smLog("%s:"SLINE": Cleaning up...\n",SYS_SDL_SRCFN); + smLog("%s:" SLINE ": Cleaning up...\n",SYS_SDL_SRCFN); clearQueue();finiOAL();finiOGL(); SDL_Quit();hwnd=0; } void SMELT_IMPL::smMainLoop() { - if(!hwnd)return smLog("%s:"SLINE": Error: SMELT is not initialized.\n",SYS_SDL_SRCFN); - if(!pUpdateFunc) return smLog("%s:"SLINE": UpdateFunc is not defined.\n",SYS_SDL_SRCFN); + if(!hwnd)return smLog("%s:" SLINE ": Error: SMELT is not initialized.\n",SYS_SDL_SRCFN); + if(!pUpdateFunc) return smLog("%s:" SLINE ": UpdateFunc is not defined.\n",SYS_SDL_SRCFN); Active=true; for(;;) { |