Salve a tutti, ho un problema durante la compilazione dei sorgenti di uno splash screen che ho creato.
Sono partito dai sorgenti del tema di ubuntu, tuttavia quando vado a compilarli il risultato è uno splash screen completamente NERO. >:(
Sapreste aiutarmi? :'(
Il codice del file usplash_theme.c è il seguente:
/* usplash
*
*
* Copyright © 2006 Dennis Kaarsemaker
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
/* Needed for the custom drawing functions */
#include
extern struct usplash_pixmap pixmap_usplash_640_480;
extern struct usplash_pixmap pixmap_throbber_back;
extern struct usplash_pixmap pixmap_throbber_fore;
void t_init(struct usplash_theme* theme);
void t_clear_progressbar(struct usplash_theme* theme);
void t_draw_progressbar(struct usplash_theme* theme, int percentage);
void t_animate_step(struct usplash_theme* theme, int pulsating);
struct usplash_theme usplash_theme_640_480;
/* Theme definition */
struct usplash_theme usplash_theme_640_480 = {
.version = THEME_VERSION, /* ALWAYS set this to THEME_VERSION,
it's a compatibility check */
.next = NULL,
.ratio = USPLASH_4_3,
/* Background and font */
.pixmap = &pixmap_usplash_640_480,
/* Palette indexes */
.background = 0,
.progressbar_background = 32,
.progressbar_foreground = 131,
.text_background = 0,
.text_foreground = 117,
.text_success = 189,
.text_failure = 55,
/* Progress bar position and size in pixels */
.progressbar_x = 110,
.progressbar_y = 284,
.progressbar_width = 420,
.progressbar_height = 28,
/* Text box position and size in pixels */
.text_x = 110,
.text_y = 312,
.text_width = 360,
.text_height = 100,
/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,
/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};
void t_init(struct usplash_theme *theme) {
int x, y;
usplash_getdimensions(&x, &y);
theme->progressbar_x = (x - theme->pixmap->width)/2 + theme->progressbar_x;
theme->progressbar_y = (y - theme->pixmap->height)/2 + theme->progressbar_y;
}
void t_clear_progressbar(struct usplash_theme *theme) {
usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back);
}
void t_draw_progressbar(struct usplash_theme *theme, int percentage) {
int w = (pixmap_throbber_back.width * percentage / 100);
if(percentage == 0)
usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back);
if(percentage progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height,
&pixmap_throbber_back, 0, 0);
/* Draw foreground to right of background */
usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, pixmap_throbber_back.width - w,
pixmap_throbber_back.height, &pixmap_throbber_fore, w, 0);
}
else{/* Loading */
/* Draw foreground to left of background */
usplash_put_part(theme->progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height,
&pixmap_throbber_fore, 0, 0);
/* Draw background ot right of foreground */
usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, pixmap_throbber_back.width - w, pixmap_throbber_back.height,
&pixmap_throbber_back, w, 0);
}
}
void t_animate_step(struct usplash_theme* theme, int pulsating) {
static int pulsate_step = 0;
static int pulse_width = 56;
static int step_width = 2;
static int num_steps = 0;
int x1;
int x2;
num_steps = (pixmap_throbber_fore.width - pulse_width)/2;
if (pulsating) {
if(pulsate_step progressbar_x, theme->progressbar_y, x1,
pixmap_throbber_back.height, &pixmap_throbber_back, 0, 0);
/* Draw progress bar foreground 'pulse' */
usplash_put_part(theme->progressbar_x + x1, theme->progressbar_y, pulse_width,
pixmap_throbber_back.height, &pixmap_throbber_fore, x1, 0);
/* Draw progress bar background on right side of foreground 'pulse' */
usplash_put_part(theme->progressbar_x + x2, theme->progressbar_y, pixmap_throbber_back.width - x2,
pixmap_throbber_back.height, &pixmap_throbber_back, x2, 0);
pulsate_step = (pulsate_step + 1) % num_steps;
}
}
Mentre il Makefile è questo:
CC=gcc
CFLAGS=-g -Wall -fPIC
LDFLAGS=
INCLUDES=
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS)
INSTALL = /usr/bin/install -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROGRAM = $(INSTALL) -m 755
usplash-theme.so: throbber_back.png.c.o throbber_fore.png.c.o \
usplash_640_480.png.c.o usplash-theme.c.o
$(COMPILE) -shared -o $@ $^
%.png.c: %.png
pngtousplash $ $@
%.bdf.c: %.bdf
bdftousplash $ $@
%.c.o: %.c
$(COMPILE) -o $@ -c $<
install:
$(INSTALL) -d $(DESTDIR)/usr/lib/usplash
$(INSTALL_PROGRAM) usplash-theme.so $(DESTDIR)/usr/lib/usplash/usplash-theme.so
clean:
rm -f *.png.c *.bdf.c *.c.o
[Usplash] Problemi durante la compilazione
-
Morpheus90
- Prode Principiante
- Messaggi: 3
- Iscrizione: martedì 26 agosto 2008, 12:05
- jepessen
- Imperturbabile Insigne

- Messaggi: 3569
- Iscrizione: lunedì 26 dicembre 2005, 11:49
- Desktop: KDevelop
- Distribuzione: Ubuntu 20.04
- Sesso: Maschile
- Località: Somma Lombardo
Re: [Usplash] Problemi durante la compilazione
ed esattamente quali sono le operazioni che segui da terminale? Gli eventuali messaggi e tutto il resto. Solo il sorgente non è utile.
Daniele
Daniele
Compiz l'ha creato Chuck Norris quando ha colpito un computer con un calcio rotante.
http://www.renderosity.com/mod/gallery/ ... e=Jepessen
http://jepessen.wordpress.com/
http://www.renderosity.com/mod/gallery/ ... e=Jepessen
http://jepessen.wordpress.com/
-
Morpheus90
- Prode Principiante
- Messaggi: 3
- Iscrizione: martedì 26 agosto 2008, 12:05
Re: [Usplash] Problemi durante la compilazione
Il classicojepessen ha scritto: ed esattamente quali sono le operazioni che segui da terminale? Gli eventuali messaggi e tutto il resto. Solo il sorgente non è utile.
Daniele
cd /percorso/dei/sorgenti && make
Poi installo lo splash screen con Start-Up Manager...
A quel punto quando provo a visualizzare lo spash screen non va... Nonostante la risoluzione dello schermo al boot sia quella giusta (640x480).
-
Morpheus90
- Prode Principiante
- Messaggi: 3
- Iscrizione: martedì 26 agosto 2008, 12:05
Re: [Usplash] Problemi durante la compilazione
up 
Vi prego è urgentissimo!
Appena è possibile posto anche i sorgenti!
Vi prego è urgentissimo!
Appena è possibile posto anche i sorgenti!
Chi c’è in linea
Visualizzano questa sezione: 0 utenti iscritti e 8 ospiti