![]() |
|
|
|
#1
|
|||
|
|||
|
i Googled around and found a newer version of oslib(2.10) then the one I have, but it didn't seem to have any newer features for maps of sprites. any ideas?
Last edited by CrazedPimp; 01-03-2009 at 01:54 PM. |
|
#2
|
||||
|
||||
|
That's cause that site I gave you has the tutorials for it -.-
__________________
|
|
#3
|
|||
|
|||
|
Dark_Sabre the site is back up but i didn't find anything about using maps to hold sprites.
|
|
#4
|
||||
|
||||
|
__________________
|
|
#5
|
|||
|
|||
|
Maybe i'm asking the wrong thing. i know how to use maps for backgrounds, but i don't know how to use maps for sprites. what i would like to know is how to draw say (50x50) sprite of a (1024x512) map
|
|
#6
|
||||
|
||||
|
Oh... right.... look in PSDonkey's oslib tutorials on animations, it shows you how. or you could look in my platformer example, it uses PSDonkey's animation.
__________________
|
|
#7
|
|||
|
|||
|
In the makefile for lesson #1 could someone explain to me exactly what some of the things do and the same with the main.c
In the makefile Code:
TARGET = Donkey_Lesson1 OBJS = main.o INCDIR = CFLAGS = -G4 -Wall -O2 CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LDFLAGS = STDLIBS= -losl -lpng -lz \ -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm LIBS=$(STDLIBS)$(YOURLIBS) EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Donkey_Lesson1 PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak Code:
LIBDIR = LDFLAGS = STDLIBS= -losl -lpng -lz \ -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm LIBS=$(STDLIBS)$(YOURLIBS) Could someone also explain Code:
INCDIR = CFLAGS = -G4 -Wall -O2 CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) In the main.c: Code:
//OSlib header file
#include <oslib/oslib.h>
//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int main()
{
//Initialization of the Oslib library
oslInit(0);
//Initialization of the graphics mode
oslInitGfx(OSL_PF_8888, 0);
//Initialization of the text console
oslInitConsole();
//Print on the screen this text
oslPrintf("Hello World");
//Wait for a button to be pressed
oslWaitKey();
//terminate the program
oslEndGfx();
oslQuit();
return 0;
}
Code:
//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
Code:
//Initialization of the Oslib library
oslInit(0);
Finally what does the bit in brackets mean/do: Code:
//Initialization of the graphics mode
oslInitGfx(OSL_PF_8888, 0);
__________________
lol@sigs Last edited by Aaron*1; 01-26-2009 at 05:04 PM. |
|
#8
|
||||||
|
||||||
|
Quote:
INCDIR is the .h files directory These are just needed if you want to have another folder with a custom sdk (besides the one you have in pspdev/psp/sdk/) STDLIBS is the same as LIBS I guess. e.g. -losl is the oslib.a file. (the libraries that are used while compiling your source code) Instead of what you have above, I would just use: Code:
LIBS= -losl -lpng -lz \ -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm Code:
STDLIBS= -losl -lpng -lz \ -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm LIBS=$(STDLIBS)$(YOURLIBS) Quote:
I don't remember what CFLAGS, CXXFLAGS and ASFLAGS, I used to know when I was more into PSP programming but now, I don't ![]() In that code ASFLAGS = CFLAGS Quote:
PSP_MODULE_INFO just tells the compiler the module info, the module name is "OSLib Sample", flag for mode is 0 (user mode) there are other flags like 0x1000, 0x0800, 0x1006, etc. The 3rd argument is the major version (I think it's the major) The 4th is the minor version. (the callbacks are used to "enable" the home button) Quote:
Instead of 0 you could have: OSL_IF_USEOWNCALLBACKS OSL_IF_NOVBLANKIRQ both can be or'd together. Take a look here for more information: http://www.sakya.it/OSLib_MOD/doc/ht...80288ae432b488 Quote:
Quote:
Its parameters are as following: int pixelFormat, int bDoubleBuffer in the code you posted, it initializes the pixel format with 32bits by pixels (8888) and the 0 means that it will use simple buffering. I hope that helps. Last edited by pirata nervo; 01-26-2009 at 05:40 PM. |
|
#9
|
|||
|
|||
|
That actually helped me loads. Thanks a lot!
+rep
__________________
lol@sigs |
|
#10
|
|||
|
|||
|
I've seen comments about changing following entry in Makefile:
CFLAGS = -G4 ... to: CFLAGS = -G0 ... to get stuff to compile. Most of the other settings I can understand, or at least google, but this one I don't get and can't find. Can anyone enlighten me on the difference between G4 and G0? Thanks, PQ. |
![]() |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|