1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-04 23:37:10 +02:00
Commit Graph

846 Commits

Author SHA1 Message Date
Xiangfu Liu
b3a73d2675 nanonote remote -b in mc 2011-07-19 13:58:11 +08:00
Ayla
3a85cabf37 The SurfaceCollection won't load the files selection.png, bottombar.png or topbar.png from the Default skin if they are missing in the current skin. 2011-07-11 18:16:38 +02:00
Ayla
11e58c8ca5 Revert "GMenu2X now won't load skin files from the Default skin when using another skin."
This reverts commit 439d25c292.
Refusing to load files of the Default skin for a different one is a bad idea; it requires
that skin to provide every single PNG file needed by gmenu2x.
2011-07-11 18:14:27 +02:00
Ayla
00d8a04e00 Removed a bug where the Default skin was chosen even if another (working) skin was defined on the config file. 2011-07-11 12:39:31 +02:00
Ayla
0993a48eca Add a function which unlocks the virtual terminal before and after each execution of a binary.
It ensures that GMenu2X can restart after a SDL program segfaulted or crashed.
It also allow GMenu2X to exit without clearing the screen, so that the "loading" screen appears
until the launched binary starts using the framebuffer.
2011-07-11 11:27:38 +02:00
Ayla
55dad4171d Merge branch 'install_locations'
Conflicts:
	configure.in
2011-07-11 11:19:18 +02:00
Ayla
f7817b19ab The links will now be loaded from both the system and the user-specific directories. 2011-07-11 02:49:44 +02:00
Ayla
439d25c292 GMenu2X now won't load skin files from the Default skin when using another skin.
This was causing trouble when the current skin does not provide graphical files on purpose (ie. skin with no top/bottom bar).
2011-07-09 01:49:09 +02:00
David Kühling
31e1f3c426 add icon and starter for ASE (aseprite) image/animation editor 2011-06-14 23:13:34 +02:00
Sergey Kukunin
28fe39ce54 Fix segmentation fault when try show Manual on Explorer or other service apps 2011-06-11 02:41:52 +03:00
David Kühling
97adb066a3 add launcher for alex4 2011-06-07 13:50:47 +02:00
David Kühling
c619514bb7 remove allegro-setup launcher: don't want people to accidentally break sound playback 2011-06-07 13:49:43 +02:00
David Kühling
e5452e5ac2 add icons and shortcuts for allegro shooter demo and allegro setup program 2011-06-06 21:21:45 +02:00
kyak
6646525731 Zero-pad hex values when saving config
writeSkinConfig() had a very naughty bug when RGBA values were written
to config file unpadded. This lead to a problem that, for example,
0x00000080 was written as 0x00080 in config file (Somehow gmenu2x
reads and re-saves config on selection). This, in turn, led
to problem when reading skin config file in strtorgba function,
because it parses the color string in token of two symbols
(substr(0,2) and etc).
2011-06-06 11:38:26 +04:00
kyak
4b22318b09 Update gmenu2x.sh for install_locations changes 2011-06-06 10:05:48 +04:00
Maarten ter Huurne
7aeb7a4f0a PNG: Use libpng directly instead of via SDL_image.
This eliminates the build-time dependency on SDL_image and the run-time
dependencies on all libraries used by SDL_image except SDL and libpng.

In addition we now let libpng convert to ARGB format while decoding the
image, rather than letting SDL convert the surface afterwards.
2011-06-05 05:58:47 +02:00
Maarten ter Huurne
2394a075d7 Surface: Work around bug in SDL that loses per-surface alpha.
A bug in SDL_ConvertSurface() leaves the per-surface alpha undefined when
converting from RGBA to RGBA. This can cause problems if the surface is
later converted to a format without an alpha channel, such as the display
format.
2011-06-05 05:27:28 +02:00
Maarten ter Huurne
36260e999d PNG: Only add alpha channel on surface if loaded image has an alpha channel.
This fixes a bug where a loaded image could have an alpha of 0.
Also it avoids expensive alpha blending where it is unnecessary.
2011-06-03 12:47:49 +02:00
Maarten ter Huurne
8a81837c04 Surface: Make pixel format conversion explicit.
Instead of having the copy constructor convert to display format, the new
copy constructor preserves the pixel format and a separate method was
introduced to convert surfaces to display format.

The code was made more robust as well: it should no longer crash if the
wallpaper cannot be loaded.
2011-06-03 11:46:36 +02:00
Maarten ter Huurne
7861e07eb0 Surface: Made "raw" field private.
I cheated a bit by declaring ASFont as friend, but all other outside
access now happens via methods.

I removed the "saveScreenshot" method since the code calling it is
commented out and I never heard anyone complain about missing this
feature.
2011-06-02 22:44:04 +02:00
Maarten ter Huurne
25e8e62622 Surface: Minor cleanups.
Removed unused "locked" field.
Inlined format() private method: since "raw" can no longer be NULL, the method became trivial.
2011-06-02 22:32:08 +02:00
Maarten ter Huurne
52f4686e4a Surface: Load image with factory method instead of constructor.
If loading fails, the factory method returns NULL, while previously the
constructor would create a Surface object with a NULL "raw" field.
However, since most of the methods dereference "raw" without checking,
such a Surface would likely crash the application when used.
2011-06-02 22:09:03 +02:00
Maarten ter Huurne
0a9229ff3f Surface: Use the destructor as intended.
There is no reason to have an explicit free() method instead of just
destructing the Surface object and doing cleanup in the destructor.
2011-06-02 18:15:15 +02:00
Maarten ter Huurne
0c867aabbf Surface: Fixed memory leak in previous commit.
I forgot to initialize freeWhenDone in two of the three constructors.
2011-06-02 18:07:17 +02:00
Maarten ter Huurne
7dac306c16 Surface: Removed fake double buffering.
Use real double buffering instead.

I checked the SDL code and if the hardware cannot provide double buffering
it will use a shadow surface to ensure that a frame is not displayed until
it has been fully painted.

Also disable mouse cursor before opening the output surface. The reason it
was disabled after the surface was opened is that SDL on GP2X has a bug.
However, this means the cursor is visible for a short time during startup
which looks ugly.
2011-06-02 17:59:26 +02:00
Ayla
ef4b012026 Merge branch 'master' of projects.qi-hardware.com:gmenu2x into install_locations
Conflicts:
	data/platform/nanonote/sections/terminals/ash
	src/gmenu2x.cpp
	src/surface.cpp
2011-06-02 12:16:26 +02:00
Maarten ter Huurne
5b6d922f11 Fixed bug: wallpaper does not use alpha channel.
The unnecessary alpha channel might harm performance but is not a big deal.
However, the fact that the alpha flag (bool) is somehow automatically
converted by C++ into a skin name (string) causes the entire screen to
stay black.

The black screen was fixed by removing the alpha flag.
For optimum blitting performance, the wallpaper surface is then converted
to the pixel format of the frame buffer.

Bug was introduced in 52c89d6005.
2011-06-02 07:13:59 +02:00
Maarten ter Huurne
8b17e2ef62 PNG: Make loadPNG() responsible for creating an RGBA surface.
Before this commit loadPNG() could return any surface format and the caller
was responsible for converting it to the desired format. However, in practice
all callers want a surface with an alpha channel and SDL only supports that
with 32bpp surfaces, so RGBA or a permutation thereof. So I changed the
contract for loadPNG() so it is required to return an RGBA surface, and
removed the conversion code in the callers.

The next step is to replace IMG_Load() by a function that calls libpng
directly and loads a fixed 32bpp pixel format. That way, we can drop the
SDL_image dependency and avoid unnecessary pixel format conversions.
2011-06-02 06:19:21 +02:00
Maarten ter Huurne
7877fee3fa Surface: Remove alpha flag.
As for SurfaceCollection, the alpha flag passed to the Surface constructor
was also always true. Therefore there is no need to have the flag.
2011-06-02 06:02:45 +02:00
Maarten ter Huurne
44ca4e3460 SurfaceCollection: Removed alpha flag.
In the existing code the alpha flag is always true, so there is no point
in passing it around.
2011-06-02 05:52:47 +02:00
Maarten ter Huurne
af3ed78496 Merge branch 'master' of projects.qi-hardware.com:gmenu2x 2011-06-02 05:46:25 +02:00
Sergey Kukunin
240286df11 Add powersaver class 2011-06-02 06:32:39 +03:00
Maarten ter Huurne
52c89d6005 Surface: Removed duplicate constructor.
There were two constructors that took an image path, skin name and alpha flag
as their arguments, but in different orders. We need only one of them.
2011-06-02 04:57:21 +02:00
Maarten ter Huurne
b2896d6bac ASFont: Refactored string drawing methods.
Renamed methods that draw a single line from write() to writeLine().
There is now only one write() method left: the public method.

Pass surface to draw on as wrapped Surface instead of SDL_Surface.
At the end of the call chain we still use SDL directly though.
2011-06-02 04:29:19 +02:00
Maarten ter Huurne
b6a5d89bc8 Surface: Removed unused code and restricted access.
Removed all methods that are never called.
Made methods that are only called by Surface itself private.

One ugly thing remaining is outside access to the "raw" field.
2011-06-02 03:39:34 +02:00
Ayla
b646c33080 The ./configure will now accept the --enable-platform switch.
It takes as its parameter the name of the targeted platform.
Currently, those are nanonote, dingux, pandora, gp2x and pc.
The makefiles will install the data accordingly to the platform specs
(e.g. install the 800x480 skins for the pandora platform).
2011-06-01 01:07:00 +02:00
Ayla
34af938ce1 Moved the pandora's "input.conf" file lying in the top directory to the pandora/data directory, replacing the previous (obsolete) one. 2011-06-01 01:05:14 +02:00
Ayla
47a4e5c3ab Moved all the data files (translations, skins...) to the "data" folder.
On the "platform" sub-folder are located one folder for each platform gmenu2x supports.
The "translations" folder is now the same for all platforms.
The "skins" sub-folder contains directories which names defines the screen resolution of the contained skins (e.g. "320x240").
2011-06-01 00:59:01 +02:00
Xiangfu Liu
b068aa04d4 nanonote: using color font 2011-05-31 09:01:16 +08:00
Xiangfu Liu
6087e23d4d nanonote: fix setfont path 2011-05-30 09:53:59 +08:00
Xiangfu Liu
e0831be4a3 add color ash shell, add the method to gmenu2x.sh as comment 2011-05-27 21:41:35 +08:00
Maarten ter Huurne
a382a425a9 ASFont: access font pixels efficiently.
Previous commit ensures that the font surface is always 32 bpp.
Therefore we can read font pixels directly through a pointer.
2011-05-12 02:10:40 +02:00
Maarten ter Huurne
41e6e4693e ASFont: only convert font surface if it is not already in a 32bpp format. 2011-05-12 01:20:26 +02:00
Maarten ter Huurne
db5ebff16f Fixed debug print.
GCC 4.5.1 has stricter checking of format strings and refused to compile this.
2011-05-11 02:31:41 +02:00
Maarten ter Huurne
8592038f95 Merge branch 'master' of projects.qi-hardware.com:gmenu2x 2011-05-11 01:37:57 +02:00
Maarten ter Huurne
bff04d2418 ASFont: removed duplication of horizontal alignment code. 2011-05-10 02:43:15 +02:00
Maarten ter Huurne
b4f3cde526 ASFont: merged SFontPlus class into ASFont class. 2011-05-10 02:37:10 +02:00
Maarten ter Huurne
1bc55392cd ASFont: cleanups in text write methods. 2011-05-10 02:23:13 +02:00
Maarten ter Huurne
ff546cdcb0 ASFont: have a single routine for computing text width that also handles newlines.
This way the text has to be scanned only once and no copying is needed.
2011-05-10 02:08:14 +02:00
Maarten ter Huurne
e4b71138b9 ASFont: removed precalculation of half heights.
There is no point in precalculating something so cheap to recalculate.
Also, the majority of uses was to compensate for passing the wrong alignment argument.
2011-05-10 00:31:45 +02:00