Author Topic: Scripted Wizard renewed icons, and small refinements to a few wizard scripts  (Read 7229 times)

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Dear all,

I have been experimenting with replacing the icons of the "New Project" dialog, and updated all the "faulty" ones (with a white background) with more up to date alpha-channel versions. Some logo icons, such as the GNU logo, SFML logo, and wxWidgets logo, in particular, now look much better. I also replaced the wizard banner of the wxWidgets project wizard, to take advantage of the modern logo.

I attached all the images, placed in the corresponding paths Code::Blocks expects to find them, in a zip archive. If you wish to try them out, just unzip directly on your own installation.

In addition to the cosmetic changes, I also corrected the path verification and generated source for both the SDL and SFML project wizards. The SFML wizard was verifying the header files in the wrong place, forgetting that their inclusion is under the SFML directory, which was in conflict with what the generated source states (example):
Code
#include <SFML/Audio.hpp>

The SDL project wizard was also searching without taking into account that the header should be at $(#SDL)\include\SDL\SDL.h, as well as providing the user with a main.cpp that made the (wrong) inclusion
Code
#include <SDL.h>

Both project wizards were modified to make the default behaviour match that which the library authors recommend. The attached patch covers these subtle changes.

[attachment deleted by admin]
« Last Edit: March 28, 2010, 06:51:33 pm by ptDev »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
The SDL project wizard was also searching without taking into account that the header should be at $(#SDL)\include\SDL\SDL.h, as well as providing the user with a main.cpp that made the (wrong) inclusion
Code
#include <SDL.h>
I am not sure about this. I recall that SDL changed the default path where this file is found in one of it's releases. So while this might work with a recent release it won't work with an older version. However, I need to check myself as I am not 100% sure (probably it was another library in the end...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
I searched in the SDL official page to make sure, but couldn't find documentation using #include "SDL.h". In any case, if this is an old location for the headers, it probably is older than version 1.2. I would prefer the project wizard to reflect the behaviour of the most recent stable releases by default, rather than that of (likely) deprecated versions. As a compromise for users of older versions, perhaps it would be better to query the user about the SDL version?

If needed, I may adjust it in that way, but in that case, I would need to be sure about the SDL version at which the include path was modified.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
I am not sure about this. I recall that SDL changed the default path where this file is found in one of it's releases. So while this might work with a recent release it won't work with an older version. However, I need to check myself as I am not 100% sure (probably it was another library in the end...).

IIRC, the difference is that most MSVC packaged libs use <sdl.h> but the MinGW GCC SDL packages and examples use <sdl/sdl.h>.

That is why I posted the patch that checks both places.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
IIRC, the difference is that most MSVC packaged libs use <sdl.h> but the MinGW GCC SDL packages and examples use <sdl/sdl.h>.

That is why I posted the patch that checks both places.

Tim S.

I have always used SDL with MinGW, hence my confusion. Thank you for your patch.

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
I have submited the zipped images as a patch in berlios.de (patch number 002985). To apply to your working copy, extract and overwrite on the source.
Alternatively, you can extract the zip attached to the first post over your binaries.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Here's my patch again feel free to submit it; I just do not have time and energy to keep it up to date.
Tim S.

cb_SDL_Wizard.patch
Code
Index: src/plugins/scriptedwizard/resources/sdl/wizard.script
===================================================================
--- src/plugins/scriptedwizard/resources/sdl/wizard.script (revision 5680)
+++ src/plugins/scriptedwizard/resources/sdl/wizard.script (working copy)
@@ -47,8 +47,15 @@
         local dir_nomacro_inc = GetCompilerIncludeDir(dir, SDLPathDefault, SDLPathDefaultInc);
         if (dir_nomacro_inc.IsEmpty())
             return false;
-        if (!VerifyFile(dir_nomacro_inc, _T("SDL.h"), _T("SDL's include")))
-            return false;
+            
+        if (!IO.FileExists(dir_nomacro_inc + wxFILE_SEP_PATH + _T("SDL.h")))
+        {
+            if (VerifyFile(dir_nomacro_inc, _T("SDL/SDL.h"), _T("SDL's include")))
+                SDLPathDefaultInc = SDLPathDefaultInc + _T("/SDL");
+            else
+                return false;
+        }
+        
 
         // verify library dependencies
         local dir_nomacro_lib = GetCompilerLibDir(dir, SDLPathDefault, SDLPathDefaultLib);
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org