I'm a noob with C++ but I think I have a pretty good understandind of C, Java, C# and overs.
When I try to compile this :
Sprite.h
Code: Select all
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "Fonctions/graphics.h"
class Sprite
{
private:
Image * image;
public:
Sprite();
};
Code: Select all
#include "Sprite.hpp"
#define printf pspDebugScreenPrintf
Sprite::Sprite()
{
initGraphics();
image = loadImage("Images/Joueur/Lancer01_Down.png");
int x = 0;
int y = 0;
blitAlphaImageToScreen(0,0,29,44,image, x, y);
flipScreen();
}
PSP_MODULE_INFO("Sprite", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main()
{
pspDebugScreenInit();
SetupCallbacks();
new Sprite();
sceKernelSleepThread();
return 0;
}
Code: Select all
TARGET = Sprite
OBJS = Fonctions/framebuffer.o Fonctions/graphics.o Sprite.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lstdc++
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Sprite
PSPSDK = /usr/local/pspdev/psp/sdk/
include $(PSPSDK)/lib/build.mak
psp-g++ -I. -I/usr/local/pspdev/psp/sdk//include -O2 -G0 -Wall -I. -I/usr/local/pspdev/psp/sdk//include -O2 -G0 -Wall -fno-exceptions -fno-rtti -c -o Sprite.o Sprite.cpp
Sprite.cpp:7: erreur: expected unqualified-id before ‘asm’
make: *** [Sprite.o] Erreur 1
[1]+ Done clear
I don't have a clue about where I made an error, if someone could help me ^^