Erwan
- 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:
236
JGE/Makefile
236
JGE/Makefile
@@ -1,118 +1,118 @@
|
||||
ifeq ($(MAKECMDGOALS),debug)
|
||||
DEBUG = true
|
||||
endif
|
||||
|
||||
|
||||
GENERIC_OBJS = src/JApp.o src/JGBKFont.o \
|
||||
src/JGE.o src/JGui.o src/JLBFont.o \
|
||||
src/JGameObject.o src/JSpline.o src/JAnimator.o \
|
||||
src/JResourceManager.o src/JFileSystem.o \
|
||||
src/JParticle.o src/JParticleEmitter.o src/JParticleEffect.o \
|
||||
src/JParticleSystem.o \
|
||||
src/unzip/ioapi.o src/unzip/mztools.o src/unzip/unzip.o \
|
||||
src/JSprite.o src/Vector2D.o \
|
||||
src/tinyxml/tinystr.o src/tinyxml/tinyxml.o \
|
||||
src/tinyxml/tinyxmlparser.o src/tinyxml/tinyxmlerror.o \
|
||||
src/Encoding.o src/JTTFont.o \
|
||||
src/JMD2Model.o src/JOBJModel.o src/vram.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
|
||||
|
||||
|
||||
HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
|
||||
src/hge/hgerect.o src/hge/hgevector.o \
|
||||
src/hge/hgedistort.o src/hge/hgefont.o
|
||||
|
||||
|
||||
CXXFLAGS = -W -Wall -Werror
|
||||
|
||||
ifdef DEBUG
|
||||
CXXFLAGS += -ggdb3
|
||||
endif
|
||||
|
||||
# Determination of target.
|
||||
# TARGET_ARCHITECTURE variable will then be set to either linux or psp.
|
||||
|
||||
RESULT = $(shell which psp-config)
|
||||
ifeq ($(RESULT),)
|
||||
DEFAULT_RULE = linux
|
||||
TARGET_ARCHITECTURE = linux
|
||||
else
|
||||
DEFAULT_RULE = 3xx
|
||||
TARGET_ARCHITECTURE = psp
|
||||
TARGET_LIB = libjge300.a
|
||||
endif
|
||||
|
||||
ifeq ($(MAKECMDGOALS),linux)
|
||||
DEFAULT_RULE = linux
|
||||
TARGET_ARCHITECTURE = linux
|
||||
endif
|
||||
ifeq ($(MAKECMDGOALS),3xx)
|
||||
DEFAULT_RULE = 3xx
|
||||
TARGET_ARCHITECTURE = psp
|
||||
TARGET_LIB = libjge300.a
|
||||
endif
|
||||
ifeq ($(MAKECMDGOALS),1xx)
|
||||
DEFAULT_RULE = 1xx
|
||||
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
|
||||
TARGET_LIB = libjge100.a
|
||||
TARGET_ARCHITECTURE = psp
|
||||
CXXFLAGS += -DDEVHOOK -DPSPFW3XX
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||
PSPSDK = $(shell psp-config --pspsdk-path)
|
||||
PSPDIR = $(shell psp-config --psp-prefix)
|
||||
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
|
||||
TARGET_HGE = libhgetools.a
|
||||
INCDIR = -I include/psp include/psp/freetype2
|
||||
CXXFLAGS += -G0
|
||||
LIBDIR = lib/psp
|
||||
LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++
|
||||
endif
|
||||
ifeq ($(TARGET_ARCHITECTURE),linux)
|
||||
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
||||
TARGET_LIB = libjge.a
|
||||
TARGET_HGE = libhgetools.a
|
||||
INCDIR = $(shell freetype-config --cflags)
|
||||
CXXFLAGS += -DLINUX
|
||||
LIBDIR = lib/linux
|
||||
endif
|
||||
|
||||
# Set definitive values for variables.
|
||||
CXXFLAGS := $(INCDIR) $(CXXFLAGS)
|
||||
LDFLAGS := $(LIBS)
|
||||
TARGET_LIB := $(LIBDIR)/$(TARGET_LIB)
|
||||
TARGET_HGE := $(LIBDIR)/$(TARGET_HGE)
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
endif
|
||||
|
||||
all: $(DEFAULT_RULE) hge
|
||||
|
||||
debug: $(DEFAULT_RULE) hge
|
||||
|
||||
linux: $(TARGET_LIB)
|
||||
@echo Making for Linux.
|
||||
|
||||
3xx: $(TARGET_LIB)
|
||||
@echo Making for 3xx.
|
||||
|
||||
1xx: $(TARGET_LIB)
|
||||
@echo Making for 1xx.
|
||||
|
||||
install: $(TARGET_LIB) hge
|
||||
|
||||
hge: $(TARGET_HGE)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(HGE_OBJS)
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),linux)
|
||||
$(TARGET_LIB): $(OBJS)
|
||||
ar r $(TARGET_LIB) $(OBJS)
|
||||
|
||||
$(TARGET_HGE): $(HGE_OBJS)
|
||||
ar r $(TARGET_HGE) $(HGE_OBJS)
|
||||
endif
|
||||
ifeq ($(MAKECMDGOALS),debug)
|
||||
DEBUG = true
|
||||
endif
|
||||
|
||||
|
||||
GENERIC_OBJS = src/JApp.o src/JGBKFont.o \
|
||||
src/JGE.o src/JGui.o src/JLBFont.o \
|
||||
src/JGameObject.o src/JSpline.o src/JAnimator.o \
|
||||
src/JResourceManager.o src/JFileSystem.o \
|
||||
src/JParticle.o src/JParticleEmitter.o src/JParticleEffect.o \
|
||||
src/JParticleSystem.o \
|
||||
src/unzip/ioapi.o src/unzip/mztools.o src/unzip/unzip.o \
|
||||
src/JSprite.o src/Vector2D.o \
|
||||
src/tinyxml/tinystr.o src/tinyxml/tinyxml.o \
|
||||
src/tinyxml/tinyxmlparser.o src/tinyxml/tinyxmlerror.o \
|
||||
src/Encoding.o src/JTTFont.o \
|
||||
src/JMD2Model.o src/JOBJModel.o src/vram.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
|
||||
|
||||
|
||||
HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
|
||||
src/hge/hgerect.o src/hge/hgevector.o \
|
||||
src/hge/hgedistort.o src/hge/hgefont.o
|
||||
|
||||
|
||||
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
||||
|
||||
ifdef DEBUG
|
||||
CXXFLAGS += -ggdb3
|
||||
endif
|
||||
|
||||
# Determination of target.
|
||||
# TARGET_ARCHITECTURE variable will then be set to either linux or psp.
|
||||
|
||||
RESULT = $(shell which psp-config)
|
||||
ifeq ($(RESULT),)
|
||||
DEFAULT_RULE = linux
|
||||
TARGET_ARCHITECTURE = linux
|
||||
else
|
||||
DEFAULT_RULE = 3xx
|
||||
TARGET_ARCHITECTURE = psp
|
||||
TARGET_LIB = libjge300.a
|
||||
endif
|
||||
|
||||
ifeq ($(MAKECMDGOALS),linux)
|
||||
DEFAULT_RULE = linux
|
||||
TARGET_ARCHITECTURE = linux
|
||||
endif
|
||||
ifeq ($(MAKECMDGOALS),3xx)
|
||||
DEFAULT_RULE = 3xx
|
||||
TARGET_ARCHITECTURE = psp
|
||||
TARGET_LIB = libjge300.a
|
||||
endif
|
||||
ifeq ($(MAKECMDGOALS),1xx)
|
||||
DEFAULT_RULE = 1xx
|
||||
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
|
||||
TARGET_LIB = libjge100.a
|
||||
TARGET_ARCHITECTURE = psp
|
||||
CXXFLAGS += -DDEVHOOK -DPSPFW3XX
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||
PSPSDK = $(shell psp-config --pspsdk-path)
|
||||
PSPDIR = $(shell psp-config --psp-prefix)
|
||||
OBJS = $(GENERIC_OBJS) $(PSP_OBJS)
|
||||
TARGET_HGE = libhgetools.a
|
||||
INCDIR = -I include/psp include/psp/freetype2
|
||||
CXXFLAGS += -G0
|
||||
LIBDIR = lib/psp
|
||||
LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++
|
||||
endif
|
||||
ifeq ($(TARGET_ARCHITECTURE),linux)
|
||||
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
||||
TARGET_LIB = libjge.a
|
||||
TARGET_HGE = libhgetools.a
|
||||
INCDIR = $(shell freetype-config --cflags)
|
||||
CXXFLAGS += -DLINUX
|
||||
LIBDIR = lib/linux
|
||||
endif
|
||||
|
||||
# Set definitive values for variables.
|
||||
CXXFLAGS := $(INCDIR) $(CXXFLAGS)
|
||||
LDFLAGS := $(LIBS)
|
||||
TARGET_LIB := $(LIBDIR)/$(TARGET_LIB)
|
||||
TARGET_HGE := $(LIBDIR)/$(TARGET_HGE)
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
endif
|
||||
|
||||
all: $(DEFAULT_RULE) hge
|
||||
|
||||
debug: $(DEFAULT_RULE) hge
|
||||
|
||||
linux: $(TARGET_LIB)
|
||||
@echo Making for Linux.
|
||||
|
||||
3xx: $(TARGET_LIB)
|
||||
@echo Making for 3xx.
|
||||
|
||||
1xx: $(TARGET_LIB)
|
||||
@echo Making for 1xx.
|
||||
|
||||
install: $(TARGET_LIB) hge
|
||||
|
||||
hge: $(TARGET_HGE)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(HGE_OBJS)
|
||||
|
||||
ifeq ($(TARGET_ARCHITECTURE),linux)
|
||||
$(TARGET_LIB): $(OBJS)
|
||||
ar r $(TARGET_LIB) $(OBJS)
|
||||
|
||||
$(TARGET_HGE): $(HGE_OBJS)
|
||||
ar r $(TARGET_HGE) $(HGE_OBJS)
|
||||
endif
|
||||
|
||||
@@ -211,7 +211,7 @@ typedef uint32_t u32;
|
||||
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
|
||||
|
||||
#define SLICE_SIZE_F 64.0f
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned int DWORD;
|
||||
|
||||
#define BLEND_ZERO 0x1000
|
||||
#define BLEND_ONE 0x1002
|
||||
|
||||
Binary file not shown.
@@ -8,7 +8,7 @@
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef LINUX
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable : 4786)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ bool JGBKFont::Init(const char* engFileName, const char* chnFileName, int fontsi
|
||||
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
#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);
|
||||
|
||||
@@ -232,9 +232,9 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
|
||||
#else
|
||||
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
|
||||
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
|
||||
bitMask >>= 1;
|
||||
x++;
|
||||
@@ -272,7 +272,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
|
||||
#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
|
||||
x++;
|
||||
}
|
||||
@@ -293,9 +293,9 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
|
||||
#else
|
||||
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
|
||||
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
|
||||
x++;
|
||||
bitMask >>= 1;
|
||||
@@ -311,7 +311,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0);
|
||||
#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
|
||||
x++;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ extern "C" {
|
||||
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)
|
||||
@@ -119,11 +119,12 @@ JTexture::~JTexture()
|
||||
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 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;
|
||||
int bufferwidth;
|
||||
int pixelformat;
|
||||
int unknown;
|
||||
int i, x, y;
|
||||
png_structp png_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);
|
||||
// pixel ** image_data=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_color32(c) ARGB(255,palette->Colors[c].Red,palette->Colors[c].Green, palette->Colors[c].Blue)
|
||||
GifRecordType RecordType;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifndef LINUX
|
||||
#ifdef WIN32
|
||||
#pragma comment( lib, "freetype.lib" )
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#ifndef WIN32
|
||||
|
||||
// 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
|
||||
|
||||
@@ -288,7 +288,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
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
|
||||
@@ -306,7 +306,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey);
|
||||
#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
|
||||
}
|
||||
rows--;
|
||||
@@ -329,7 +329,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255);
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user