Spash.cpp patch close to done?
#1
i have modified splash.cpp.
this file is responsible for the handling of the display of splash.png duing startup. the original had hardcoded the display dimensions of the splash to always be 1/4 the current screen res, which severly hindered people who wanted to customize this graphic.

as per some discussion on x-s, this patch does not resize the image,just paints it to the center of the screen.

here is the code:
http://www.skinjob.net/tsp/splash.cpp

i have not added any logic to check for the size of the image. should it resize the image to current screen res if it is larger than current screen res?
Catchy Signature Here
Reply
#2
this will show up at differing sizes for differing resolutions.

the only solution is to fix the "full size" to 720 pixels wide and scale based on that. height can be set to whatever you like (eg fullscreen) as the keep aspect ratio will fix that up.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
i'm sorry jon, but i don't really quite understand.

i believe what you're saying is that when scaling a graphic so that it'll be fullscreen, i should set its width to 720 pixels and leave the height alone?
if the aspect ratio keeps height appropriate to width, wouldn't i want to use g_graphicscontext.getwidth() to get the "fullscreen" width value (since that returns the current resolution)?

here's what i thought the new code would look like:

void csplash::process()
{
d3dgammaramp newramp;
d3dgammaramp oldramp;

g_graphicscontext.lock();
g_graphicscontext.get3ddevice()->clear(0, null, d3dclear_target, 0, 0, 0);
int sw = g_graphicscontext.getwidth();
int sh = g_graphicscontext.getheight();
cguiimage* image = new cguiimage(0, 0, 0, 0, 0, 0, m_imagename);
image->allocresources();
image->setaspectratio(cguiimage::aspect_ratio_keep);
int tw = image->gettexturewidth();
int th = image->gettextureheight();
if (tw > sw)
{
image->settexturewidth(sw);
}
int tx = (sw/2)-(tw/2);
int ty = (sh/2)-(th/2);
image->setposition(tx,ty);
Catchy Signature Here
Reply
#4
the problem with that is it will not scale based on resolution.

eg an image which is 360x288 will look 1/4 the size of the screen on pal 720x576, but will be tiny on 1080i (1920x1080).

thus my suggestion to have some sort of pre-defined size that will be regarded as fullscreen.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
wouldn't my code work regardless of resolution since it fetches the current res?
-edit-
wait a second. when you talk about aspect ratio are you talking about the aspect ratio of the texture, or the display?

i was assuming you meant the texture, so like if you told it "scale this 300x200 image up so that the width is 600", then the height would be set 400 automatically, thus maintaining the image's aspect ratio.



Catchy Signature Here
Reply

Logout Mark Read Team Forum Stats Members Help
Spash.cpp patch close to done?0