thanks, i dont think i'll ever find a need to use these anyway. :P
Printable View
thanks, i dont think i'll ever find a need to use these anyway. :P
const, yesh that would be better, didn't notice he was only reading the array..Zitat:
Zitat von AdjutantReflex
an array of chars works good as pointer to the start of a char array.
Myself, I think its a load of toss and the C++ & the String library should be used, much better.
Guys,
I'm useing LTE 2.2, right? So, I'm coding a shell for myself, I'm trying to add a button, and when I use the code I need to add the button:
" gui->addImage(menuicon, core::position2d<s32>(0,0 ), 0, 101, 0); "
I get this error:
" main.cpp:202: error: expected primary-expression before "->" token. "
Line 202 is the code I posted above.
--------
Here's the class refrence, if you need it:
virtual IGUIImage * addImage (video::ITexture *image, core::position2d< s32 > pos, bool useAlphaChannel=true, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds an image element.
So what is my problem?
---------
Im not sure about your exact problem, but i looked that this in teh Hello World example:maybe it should look something like that? I dunno, i have been looking at this LTE package for about 10 mins.Code:gui::IGUIStaticText* statusText = guienv->addStaticText(L"Hello World!",
rect<int>(10,10,260,22), true);
I also looked at IGUIImage.h:
Code:namespace engine
{
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
public:
//! constructor
IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {}
//! destructor
~IGUIImage() {};
//! sets an image
virtual void setImage(video::ITexture* image) = 0;
//! sets if the image should use its alpha channel to draw itself
virtual void setUseAlphaChannel(bool use) = 0;
};
} // end namespace gui
} // end namespace engine
EDIT: Nvm, Fixed it.
I'm having a problem, in my game every time I access the menu my game crashes, according to PSPLink, I have an FPU exception.
I was just wondering if the FPU exception is due to a lack of memory? Or something else? The thread works fine when its loaded on its own, and only throws up this error when its loaded after the rest of the program, also if I remove the blitting process it works fine, but I can't understand why, as the images have already been loaded in memory by that time.
Thanks or any help.
-Aura
And FPU exception means that something bad happened inside of the floating point unit. Generally, this is something like 1.0f/0.0f (division by zero error), which is of course impossible, but it can be other things, too.
Total 12 conditions:
---
Which one is faster?
If or else if
or
Switch
Edit: I do see it's faster for X86 platform but for Mips?
So do you have:
with 12 "somethingElse"s? In that case, switch is faster, I'd imagine.Code:if (something == somethingElse) { ...
} else if (something == somethingElse2) { ..
} else if (something == somethingElse3) {...
} ...
can some1 up umd.h. i dont want to download the new toolchain just to get on header so can someone hook me up
Well, by the fact it loads prefectly if the menu loads before the game, but not during the game, I'm guessing its not something to do with a divison... so... what are the "other things" that it could be?Zitat:
Zitat von Archaemic
Cheers.
-Aura
the libs have to be installed with it, you cant just use UMD.hZitat:
Zitat von vodkkaa
then again, if youve just LOST it, heres the code for pspumd.h:
Spoiler for pspumd.h:
I have an idea for a plugin. I'm assuming there's some function the VSH uses to get some sort of list of eboots to display in the game list (which dark_alex hooks to return eboots from GAME, GAME150, GAME3XX and the iso's in the ISO folder, as well as leaving out corrupt eboots). My idea is to hook this function so you you can get eboots from folders of the user's choice. When you press some button in the XMB you get an interface that lets you show/hide folders. That way, you could sort homebrew into folders (like "Games", "Applications" and "Emulators") and show/hide them at will, making a large amount of eboots easier to manage. Of course, once you change which folders are hidden you have to re-enter game->memorystick for it to refresh. Is this feasible?
Although I don't have nearly enough experience to actually do it myself...
coincidentally, i've already planned on it.Zitat:
Zitat von coolguy5678
-= Double Post =-
it also requires a total rewrite of the prx. upd: develop't wont begn for quite some time from my part.
When i try to install SDL_mixer, afetr i type this:
it goes through some lines then trys to detect SDL, ive installed SDL already with no errors but it comes up '***SDL Version 1.2.4 not found!' How do i resolve this?Code:LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser"
./configure --host psp --with-sdl-prefix=$(psp-config --psp-prefix) --disable-music-mp3 --prefix=$(psp-config --psp-prefix) --disable-music-libmikmod --enable-music-mod
You probably have SDL installed in the wrong place.
i followed exactly what it said here Unless, theres a specific location that you can tell me about? Scroll down to the bottom to see the SDL libs. Should i re-install SDL changing some of those lines??Zitat:
Zitat von Archaemic
Wait, ignore what this post used to say. The navigation on that page is funky. Anyway, if you typed everything in properly, it should work.
i copied it, even better precision, and anyway, i just found out what was wrong, i hadnt set the environmental variables when installing SDL
I'm back with another LTE 2.2 question.
How do I add an image to a button?
(Like make the button an image).
EDIT: Omg, I figured it out..I'll edit again if I get a problem.
EDIT2: Yep...Problem:
setImage(video::ITexture *image);
Ther's the code I need.
What do I use for the *image?
I was wondering if I could use sceIoAssign to be able to run certain bits of flash0 from ms0/flash0 without hex editing. I found a post a while back on ps2dev.org, but I can't find it anymore, so if it can be done like this, could someone explain to me how I would go about it?
Cheers
-Aura
nevermind
A pointer to a video::ITexture struct/class?Zitat:
Zitat von MrChaos
EDIT: Here we go:
If that isn't relevant, i'll eat my hat.Code:class ITexture : public IUnknown
{
public:
virtual ~ITexture() {};
virtual void* lock() = 0;
virtual void unlock() = 0;
virtual const core::dimension2d<s32>& getOriginalSize() = 0;
virtual const core::dimension2d<s32>& getSize() = 0;
virtual E_DRIVER_TYPE getDriverType() = 0;
virtual ECOLOR_FORMAT getColorFormat() = 0;
virtual s32 getPitch() = 0;
virtual void regenerateMipMapLevels() = 0;
};
I don't know if anyone here has tested PSPLock, but I'm having a problem with it that I can't seem to flush out.
I've replaced vshmain.prx, and made it load vshmain_real.prx, but by doing so, I can't get plugins to load properly. CXMB and SCEP and a couple of plugins of my own don't function correctly. I've not actually tested other plugins yet, but I'm assuming they are likely to be the same.
My question is, is there a prx I have to load in flash0 that activates the plugins? And if so what is it?
Thanks.
-Aura
-= Double Post =-
Just been scouring my flash0 backups and google, and I've had a thought... would I be able to solve all my problems by editing the pspbtcnf.txt file in the KN folder?
-Aura
Spoiler for origenal:
Spoiler for rewritten:
someone sees what i doe wrong?
-= Double Post =-
it crashes at
nandPageSize = sceNandGetPageSize();
anyone figure out how to make vshex load up image files like png format?
i know bmp files are possible because someone did it before but i lost all my old source code to dig that up. but it would be nice if png in vshex was possible too
i know this is really basic aura but did you add it to vsh.txt
:) :P iono otherwise i don't think there is a plugin you have to load
Zitat:
Zitat von A-Sylum
PSPLock isn't a plugin, it replaces vshmain.prx, and because of this plugins don't load correclty... or at least didn't load correctly... my above post can now be ignored because of solved that problem :Jump:
My only problem now is that I can't get cxmb to load correctly, after that, everything should be working correctly.
-Aura
This is my first try at using dirents. But my application freezes, nothing gets printed on the screen either. Anyone know why? :
Code:#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspiofilemgr.h>
#include "callbacks.h"
#define printf pspDebugScreenPrintf
#define MAX_DIRS 256
PSP_MODULE_INFO( "File Mgr", 0, 1, 1 );
int main()
{
pspDebugScreenInit();
SetupCallbacks();
SceUID directoryID;
SceIoDirent directoryEntry[MAX_DIRS];
int DirLeft = 1;
int DirCount = 0;
int i;
directoryID = sceIoDopen( "ms0:/" );
if( directoryID < 0 )
{
printf( "Error opening directory\n" );
sceKernelExitGame();
}
while( DirLeft != 0 )
{
DirLeft = sceIoDread( directoryID, &directoryEntry[DirCount] );
if( DirLeft == 0 )
{
break;
}
if( DirLeft < 0 )
{
printf( "Error reading directory entries\n" );
sceKernelExitGame();
}
DirCount++;
}
for( i = 0; i <= DirCount; i++ )
{
printf( "%s\n", directoryEntry[DirCount].d_name );
}
sceIoDclose( directoryID );
printf( "There is a total of %d directory entries", (DirCount + 1) );
sceKernelSleepThread();
return 0;
}
:Argh:
What do you have to put in your makefile if you're using c++ ?
Been searching for an hour and havent found it.
Or dont you actually need to add anything to your makefile ?
Try that instead. Not only is it hugely more efficient, it should work now. If it doesn't, insert traces or use PSPLink. That way you won't have to ask all the time for help. C'mon, basic debugging skills here.Code:#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspiofilemgr.h>
#include "callbacks.h"
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO( "File Mgr", 0, 1, 1 );
int main()
{
pspDebugScreenInit();
SetupCallbacks();
SceUID directoryID;
SceIoDirent directoryEntry;
int DirLeft = 1;
int DirCount = 0;
int i;
directoryID = sceIoDopen( "ms0:/" );
if( directoryID < 0 )
{
printf( "Error opening directory\n" );
sceKernelExitGame();
}
while( DirLeft != 0 )
{
DirLeft = sceIoDread( directoryID, &directoryEntry);
if( DirLeft == 0 )
{
break;
}
if( DirLeft < 0 )
{
printf( "Error reading directory entries\n" );
sceKernelExitGame();
}
printf( "%s\n", directoryEntry.d_name );
DirCount++;
}
sceIoDclose( directoryID );
printf( "There is a total of %d directory entries", (DirCount + 1) );
sceKernelSleepThread();
return 0;
}
But the struct only holds information for ONE Dirent, i want more than one Dirent to be listed on the screen :|Zitat:
Zitat von Archaemic
do you have to put anything in your makefile if you're using c++ ?
That WILL list more than one Dirent on the screen :dry:Zitat:
Zitat von JaSo PsP
-lstdc++ under libs, i think...Zitat:
Zitat von eldiablov
i love you. In a non homosexual way
Yeh, but say i wanted to enter one of the directories listed, what do i do then, 'int sceIoChdir(const char *path);' Then how would i list the directories inside that? use sceIoDopen again?Zitat:
Zitat von Archaemic
Okay, so copy the d_name members into an array of char*s.
(Make sure to allocate a new char* with the same length as d_name, because the pointer contained in d_name will become invalid.)
ok, the code above still freezes? how do i trace, i haven done it before. :P
you have to create your own trace function i believe as i haven't seen any function on the psp that does this, although it's fairly simple just create a function that well write text to a file