- fixed a few warnings with the PSP compilation
- changed definition of DWORD to unsinged int rather than unsigned long for PSP
- fixed make 3xx. the call to "which" in the makefile still needs to be corrected with a DOS compatible call
This commit is contained in:
wagic.the.homebrew
2008-11-10 11:07:33 +00:00
parent 163512a802
commit 37220f9e24
7 changed files with 135 additions and 136 deletions

View File

@@ -1,118 +1,118 @@
ifeq ($(MAKECMDGOALS),debug) ifeq ($(MAKECMDGOALS),debug)
DEBUG = true DEBUG = true
endif endif
GENERIC_OBJS = src/JApp.o src/JGBKFont.o \ GENERIC_OBJS = src/JApp.o src/JGBKFont.o \
src/JGE.o src/JGui.o src/JLBFont.o \ src/JGE.o src/JGui.o src/JLBFont.o \
src/JGameObject.o src/JSpline.o src/JAnimator.o \ src/JGameObject.o src/JSpline.o src/JAnimator.o \
src/JResourceManager.o src/JFileSystem.o \ src/JResourceManager.o src/JFileSystem.o \
src/JParticle.o src/JParticleEmitter.o src/JParticleEffect.o \ src/JParticle.o src/JParticleEmitter.o src/JParticleEffect.o \
src/JParticleSystem.o \ src/JParticleSystem.o \
src/unzip/ioapi.o src/unzip/mztools.o src/unzip/unzip.o \ src/unzip/ioapi.o src/unzip/mztools.o src/unzip/unzip.o \
src/JSprite.o src/Vector2D.o \ src/JSprite.o src/Vector2D.o \
src/tinyxml/tinystr.o src/tinyxml/tinyxml.o \ src/tinyxml/tinystr.o src/tinyxml/tinyxml.o \
src/tinyxml/tinyxmlparser.o src/tinyxml/tinyxmlerror.o \ src/tinyxml/tinyxmlparser.o src/tinyxml/tinyxmlerror.o \
src/Encoding.o src/JTTFont.o \ src/Encoding.o src/JTTFont.o \
src/JMD2Model.o src/JOBJModel.o src/vram.o src/JMD2Model.o src/JOBJModel.o src/vram.o
PSP_OBJS = src/JGfx.o src/JSfx.o src/main.o PSP_OBJS = src/JGfx.o src/JSfx.o src/main.o
LINUX_OBJS = src/linux/JGfx.o src/linux/JSfx.o src/linuxmain.o LINUX_OBJS = src/linux/JGfx.o src/linux/JSfx.o src/linuxmain.o
HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
src/hge/hgerect.o src/hge/hgevector.o \ src/hge/hgerect.o src/hge/hgevector.o \
src/hge/hgedistort.o src/hge/hgefont.o src/hge/hgedistort.o src/hge/hgefont.o
CXXFLAGS = -W -Wall -Werror CXXFLAGS = -W -Wall -Werror -Wno-unused
ifdef DEBUG ifdef DEBUG
CXXFLAGS += -ggdb3 CXXFLAGS += -ggdb3
endif endif
# Determination of target. # Determination of target.
# TARGET_ARCHITECTURE variable will then be set to either linux or psp. # TARGET_ARCHITECTURE variable will then be set to either linux or psp.
RESULT = $(shell which psp-config) RESULT = $(shell which psp-config)
ifeq ($(RESULT),) ifeq ($(RESULT),)
DEFAULT_RULE = linux DEFAULT_RULE = linux
TARGET_ARCHITECTURE = linux TARGET_ARCHITECTURE = linux
else else
DEFAULT_RULE = 3xx DEFAULT_RULE = 3xx
TARGET_ARCHITECTURE = psp TARGET_ARCHITECTURE = psp
TARGET_LIB = libjge300.a TARGET_LIB = libjge300.a
endif endif
ifeq ($(MAKECMDGOALS),linux) ifeq ($(MAKECMDGOALS),linux)
DEFAULT_RULE = linux DEFAULT_RULE = linux
TARGET_ARCHITECTURE = linux TARGET_ARCHITECTURE = linux
endif endif
ifeq ($(MAKECMDGOALS),3xx) ifeq ($(MAKECMDGOALS),3xx)
DEFAULT_RULE = 3xx DEFAULT_RULE = 3xx
TARGET_ARCHITECTURE = psp TARGET_ARCHITECTURE = psp
TARGET_LIB = libjge300.a TARGET_LIB = libjge300.a
endif endif
ifeq ($(MAKECMDGOALS),1xx) ifeq ($(MAKECMDGOALS),1xx)
DEFAULT_RULE = 1xx DEFAULT_RULE = 1xx
OBJS = $(GENERIC_OBJS) $(PSP_OBJS) OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
TARGET_LIB = libjge100.a TARGET_LIB = libjge100.a
TARGET_ARCHITECTURE = psp TARGET_ARCHITECTURE = psp
CXXFLAGS += -DDEVHOOK -DPSPFW3XX CXXFLAGS += -DDEVHOOK -DPSPFW3XX
endif endif
ifeq ($(TARGET_ARCHITECTURE),psp) ifeq ($(TARGET_ARCHITECTURE),psp)
PSPSDK = $(shell psp-config --pspsdk-path) PSPSDK = $(shell psp-config --pspsdk-path)
PSPDIR = $(shell psp-config --psp-prefix) PSPDIR = $(shell psp-config --psp-prefix)
OBJS = $(GENERIC_OBJS) $(PSP_OBJS) OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
TARGET_HGE = libhgetools.a TARGET_HGE = libhgetools.a
INCDIR = -I include/psp include/psp/freetype2 INCDIR = -I include/psp include/psp/freetype2
CXXFLAGS += -G0 CXXFLAGS += -G0
LIBDIR = lib/psp LIBDIR = lib/psp
LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++ LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++
endif endif
ifeq ($(TARGET_ARCHITECTURE),linux) ifeq ($(TARGET_ARCHITECTURE),linux)
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS) OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
TARGET_LIB = libjge.a TARGET_LIB = libjge.a
TARGET_HGE = libhgetools.a TARGET_HGE = libhgetools.a
INCDIR = $(shell freetype-config --cflags) INCDIR = $(shell freetype-config --cflags)
CXXFLAGS += -DLINUX CXXFLAGS += -DLINUX
LIBDIR = lib/linux LIBDIR = lib/linux
endif endif
# Set definitive values for variables. # Set definitive values for variables.
CXXFLAGS := $(INCDIR) $(CXXFLAGS) CXXFLAGS := $(INCDIR) $(CXXFLAGS)
LDFLAGS := $(LIBS) LDFLAGS := $(LIBS)
TARGET_LIB := $(LIBDIR)/$(TARGET_LIB) TARGET_LIB := $(LIBDIR)/$(TARGET_LIB)
TARGET_HGE := $(LIBDIR)/$(TARGET_HGE) TARGET_HGE := $(LIBDIR)/$(TARGET_HGE)
ifeq ($(TARGET_ARCHITECTURE),psp) ifeq ($(TARGET_ARCHITECTURE),psp)
include $(PSPSDK)/lib/build.mak include $(PSPSDK)/lib/build.mak
endif endif
all: $(DEFAULT_RULE) hge all: $(DEFAULT_RULE) hge
debug: $(DEFAULT_RULE) hge debug: $(DEFAULT_RULE) hge
linux: $(TARGET_LIB) linux: $(TARGET_LIB)
@echo Making for Linux. @echo Making for Linux.
3xx: $(TARGET_LIB) 3xx: $(TARGET_LIB)
@echo Making for 3xx. @echo Making for 3xx.
1xx: $(TARGET_LIB) 1xx: $(TARGET_LIB)
@echo Making for 1xx. @echo Making for 1xx.
install: $(TARGET_LIB) hge install: $(TARGET_LIB) hge
hge: $(TARGET_HGE) hge: $(TARGET_HGE)
clean: clean:
rm -f $(OBJS) $(HGE_OBJS) rm -f $(OBJS) $(HGE_OBJS)
ifeq ($(TARGET_ARCHITECTURE),linux) ifeq ($(TARGET_ARCHITECTURE),linux)
$(TARGET_LIB): $(OBJS) $(TARGET_LIB): $(OBJS)
ar r $(TARGET_LIB) $(OBJS) ar r $(TARGET_LIB) $(OBJS)
$(TARGET_HGE): $(HGE_OBJS) $(TARGET_HGE): $(HGE_OBJS)
ar r $(TARGET_HGE) $(HGE_OBJS) ar r $(TARGET_HGE) $(HGE_OBJS)
endif endif

View File

@@ -211,7 +211,7 @@ typedef uint32_t u32;
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE #define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
#define SLICE_SIZE_F 64.0f #define SLICE_SIZE_F 64.0f
typedef unsigned long DWORD; typedef unsigned int DWORD;
#define BLEND_ZERO 0x1000 #define BLEND_ZERO 0x1000
#define BLEND_ONE 0x1002 #define BLEND_ONE 0x1002

Binary file not shown.

View File

@@ -8,7 +8,7 @@
// //
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
#ifndef LINUX #ifdef WIN32
#pragma warning(disable : 4786) #pragma warning(disable : 4786)
#endif #endif

View File

@@ -138,7 +138,7 @@ bool JGBKFont::Init(const char* engFileName, const char* chnFileName, int fontsi
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
#else #else
void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width, unsigned int height) void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width)
{ {
unsigned int rowblocks = (width >> 4); unsigned int rowblocks = (width >> 4);
@@ -232,9 +232,9 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
#else #else
if ((bits & bitMask) != 0) if ((bits & bitMask) != 0)
SwizzlePlot(pTexture, ARGB(255,255,255,255), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(255,255,255,255), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
else else
SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
#endif #endif
bitMask >>= 1; bitMask >>= 1;
x++; x++;
@@ -272,7 +272,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
#else #else
SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
#endif #endif
x++; x++;
} }
@@ -293,9 +293,9 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
#else #else
if ((bits & bitMask) != 0) if ((bits & bitMask) != 0)
SwizzlePlot(pTexture, ARGB(255,255,255,255), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(255,255,255,255), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
else else
SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
#endif #endif
x++; x++;
bitMask >>= 1; bitMask >>= 1;
@@ -311,7 +311,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
#else #else
SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE, mCacheImageHeight); SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE);
#endif #endif
x++; x++;
} }

View File

@@ -38,7 +38,7 @@ extern "C" {
static unsigned int __attribute__((aligned(16))) list[262144]; static unsigned int __attribute__((aligned(16))) list[262144];
extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width, unsigned int height); extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width);
void Swap(float *a, float *b) void Swap(float *a, float *b)
@@ -119,11 +119,12 @@ JTexture::~JTexture()
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits) void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
{ {
//TODO: Is this normal that width is not used ??
for (int i=0;i<height;i++) for (int i=0;i<height;i++)
{ {
for (int j=0;j<height;j++) for (int j=0;j<height;j++)
{ {
SwizzlePlot((u8*)mBits, *(bits++), (x+j)*PIXEL_SIZE, y+i, mTexWidth*PIXEL_SIZE, mTexHeight); SwizzlePlot((u8*)mBits, *(bits++), (x+j)*PIXEL_SIZE, y+i, mTexWidth*PIXEL_SIZE);
} }
} }
@@ -814,7 +815,6 @@ void JRenderer::ScreenShot(const char* filename)
void* temp; void* temp;
int bufferwidth; int bufferwidth;
int pixelformat; int pixelformat;
int unknown;
int i, x, y; int i, x, y;
png_structp png_ptr; png_structp png_ptr;
png_infop info_ptr; png_infop info_ptr;
@@ -1347,7 +1347,6 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM);
// pixel ** image_data=NULL; // pixel ** image_data=NULL;
DWORD *p32=NULL; DWORD *p32=NULL;
DWORD *buff=NULL;
//#define gif_color(c) RGB(palette->Colors[c].Red, palette->Colors[c].Green, palette->Colors[c].Blue) //#define gif_color(c) RGB(palette->Colors[c].Red, palette->Colors[c].Green, palette->Colors[c].Blue)
#define gif_color32(c) ARGB(255,palette->Colors[c].Red,palette->Colors[c].Green, palette->Colors[c].Blue) #define gif_color32(c) ARGB(255,palette->Colors[c].Red,palette->Colors[c].Green, palette->Colors[c].Blue)
GifRecordType RecordType; GifRecordType RecordType;

View File

@@ -19,7 +19,7 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifndef LINUX #ifdef WIN32
#pragma comment( lib, "freetype.lib" ) #pragma comment( lib, "freetype.lib" )
#endif #endif
@@ -30,7 +30,7 @@
#ifndef WIN32 #ifndef WIN32
// in JGBKFont.cpp // in JGBKFont.cpp
extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width, unsigned int height); extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width);
#endif #endif
@@ -288,7 +288,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
{ {
for (int j=0;j<mMaxCharWidth;j++) for (int j=0;j<mMaxCharWidth;j++)
{ {
SwizzlePlot(pTexture, ARGB(0,0,0,0), (x+j)*PIXEL_SIZE, y+i, mTexWidth*PIXEL_SIZE, mTexHeight); SwizzlePlot(pTexture, ARGB(0,0,0,0), (x+j)*PIXEL_SIZE, y+i, mTexWidth*PIXEL_SIZE);
} }
} }
#endif #endif
@@ -306,7 +306,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey); texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey);
#else #else
SwizzlePlot(pTexture, ARGB(grey,255,255,255), (xx+j)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE, mTexHeight); SwizzlePlot(pTexture, ARGB(grey,255,255,255), (xx+j)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE);
#endif #endif
} }
rows--; rows--;
@@ -329,7 +329,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255); texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255);
#else #else
SwizzlePlot(pTexture, ARGB(255,255,255,255), (xx+j*8+k)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE, mTexHeight); SwizzlePlot(pTexture, ARGB(255,255,255,255), (xx+j*8+k)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE);
#endif #endif
} }