SILLY Improvments

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

forumer
Just popping in
Just popping in
Posts: 4
Joined: Tue Oct 07, 2008 21:15

SILLY Improvments

Postby forumer » Tue Oct 07, 2008 21:26

HI,

I wanted to use SILLY on wince but on this platform strings are natively unicode and I find it stupid to always convert it to ANSI while it would be so simple to add UNICODE.
Why don't you declare a SillyTchar.h defined like this :

Code: Select all

#ifndef SILLYTCHAR_H
#define SILLYTCHAR_H

#ifdef __cplusplus
extern "C" {
#endif

#if defined(_WIN32) || defined(_WIN32_WCE)
   #include <stdio.h>
   #include <tchar.h>

        // _T("") macro is defined in tchar.h
#else
        // On other systems we use ANSI
   #define _T(x)       x

        #define _tmain      main
   #define _tWinMain   WinMain
   #ifdef  _POSIX_
      #define _tenviron   environ
   #else
   #define _tenviron  _environ
   #endif
   #define __targv     __argv

   #define _tcsclen    strlen
   #define _topen      open
        ....

   #endif
#ifdef __cplusplus
}
#endif

#endif // SILLYTCHAR_H


And in functions needing strings :

DevILImageCodec::DevILImageCodec()
: ImageCodec("DevILImageCodec - Official DevIL based image codec")

should be replaced by:

DevILImageCodec::DevILImageCodec()
: ImageCodec(_T("DevILImageCodec - Official DevIL based image codec"))
{
}

On Windows and Windows CE, _T("") is defined and on other system (linux, BSD, ...) we use standard ansi functions.
I have never understood why open source project don't rely on this ?

Then replace char* by TCHAR* or if u don't like this naming you could decalre a SILTCHAR for instance

forumer
Just popping in
Just popping in
Posts: 4
Joined: Tue Oct 07, 2008 21:15

Other improvments

Postby forumer » Tue Oct 07, 2008 21:34

I was also thinking it would be interesting to modify tree hierarchy like this :

Code: Select all

SILLY
+build
    +msvc2005
    +msvc2005-ce
    +msvc2008
    +msvc2008-ce
    +mingw32
    +xcode
    +codeblocks
+inc
+src
Makefile.in
configure


like this I would be able to provide Visual studio projects, CodeBlocks, ....

forumer
Just popping in
Just popping in
Posts: 4
Joined: Tue Oct 07, 2008 21:15

Re: Other improvments

Postby forumer » Wed Oct 08, 2008 12:46

forumer wrote:I was also thinking it would be interesting to modify tree hierarchy like this :

Code: Select all

SILLY
+build
    +msvc2005
    +msvc2005-ce
    +msvc2008
    +msvc2008-ce
    +mingw32
    +xcode
    +codeblocks
+inc
+src
Makefile.in
configure


like this I would be able to provide Visual studio projects, CodeBlocks, ....


It could be also interesting to rename .icpp into .inl because inl is a more recognized and widespread extension for inline definitions.

forumer
Just popping in
Just popping in
Posts: 4
Joined: Tue Oct 07, 2008 21:15

Compilation under CE

Postby forumer » Wed Oct 08, 2008 14:32

I have modified SILLY-0.1.0\src\SILLYFileDataSource.cpp because on WINCE
rewind is not implemented.

#ifndef UNDER_CE
rewind(data);
#else
fseek ( data , 0L , SEEK_SET );
#endif

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Oct 09, 2008 08:07

Hi,

Thanks for the suggestions for SILLY. I will contact Dalfy to see if he wants to have a say on these modifications (SILLY is his sub-project). Depending on the outcome of that, I'll make a (final) decision.

Thanks again :)

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 11 guests