J :
* Update for linux support.
This commit is contained in:
+114
-16
@@ -1,20 +1,118 @@
|
||||
all:
|
||||
$(MAKE) -f Makefile.1xx install
|
||||
$(MAKE) -f Makefile.hge install
|
||||
$(MAKE) -f Makefile.input install
|
||||
ifeq ($(MAKECMDGOALS),debug)
|
||||
DEBUG = true
|
||||
endif
|
||||
|
||||
1xx:
|
||||
$(MAKE) -f Makefile.1xx install
|
||||
$(MAKE) -f Makefile.hge install
|
||||
$(MAKE) -f Makefile.input install
|
||||
|
||||
3xx:
|
||||
$(MAKE) -f Makefile.3xx install
|
||||
$(MAKE) -f Makefile.hge install
|
||||
$(MAKE) -f Makefile.input install
|
||||
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:
|
||||
$(MAKE) -f Makefile.1xx clean
|
||||
$(MAKE) -f Makefile.3xx clean
|
||||
$(MAKE) -f Makefile.hge clean
|
||||
$(MAKE) -f Makefile.input 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
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ CFLAGS = -O2 -G0 -Wall -DDEVHOOK -DPSPFW3XX
|
||||
|
||||
LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++
|
||||
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
#include $(PSPSDK)/lib/build.mak
|
||||
|
||||
install: $(TARGET_LIB)
|
||||
@cp libjge300.a lib/psp
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
TARGET_LIB = libjge300.a
|
||||
OBJS = src/JApp.o src/JGBKFont.o \
|
||||
src/linux/JGfx.o \
|
||||
src/JGui.o \
|
||||
src/JGE.o \
|
||||
src/JLBFont.o \
|
||||
src/linux/JSfx.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/linuxmain.o src/vram.o \
|
||||
src/Encoding.o src/JTTFont.o \
|
||||
src/JMD2Model.o src/JOBJModel.o
|
||||
|
||||
INCDIR = -I /usr/include/freetype2
|
||||
LIBDIR = lib/psp
|
||||
|
||||
CXXFLAGS = $(INCDIR) -W -Wall -Werror -DDEVHOOK -DLINUX -ggdb3
|
||||
|
||||
LIBS = -lgif -lfreetype -ljpeg -lpng -lz -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lm -lstdc++
|
||||
|
||||
#include $(PSPSDK)/lib/build.mak
|
||||
|
||||
install: $(TARGET_LIB)
|
||||
@cp libjge300.a lib/linux
|
||||
@echo "Done"
|
||||
|
||||
$(TARGET_LIB): $(OBJS)
|
||||
ar r $(TARGET_LIB) $(OBJS)
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
#else
|
||||
#include <pspiofilemgr.h>
|
||||
@@ -113,7 +113,7 @@ private:
|
||||
string mZipFileName;
|
||||
char *mPassword;
|
||||
bool mZipAvailable;
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
FILE *mFile;
|
||||
#else
|
||||
SceUID mFile;
|
||||
|
||||
+9
-2
@@ -32,6 +32,13 @@
|
||||
bool JGEGetButtonState(u32 button);
|
||||
bool JGEGetButtonClick(u32 button);
|
||||
|
||||
#elif LINUX
|
||||
|
||||
void JGEControl();
|
||||
BOOL JGEGetKeyState(int key);
|
||||
bool JGEGetButtonState(uint32_t button);
|
||||
bool JGEGetButtonClick(uint32_t button);
|
||||
|
||||
#else
|
||||
|
||||
#include <pspgu.h>
|
||||
@@ -73,7 +80,7 @@ private:
|
||||
// JMotionSystem* mMotionSystem;
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
float mDeltaTime;
|
||||
|
||||
JMusic *mCurrentMusic;
|
||||
@@ -206,7 +213,7 @@ public:
|
||||
|
||||
void Assert(const char *filename, long lineNumber);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
void SetDelta(int delta);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef _JGUI_H
|
||||
#define _JGUI_H
|
||||
|
||||
|
||||
|
||||
#include "JGE.h"
|
||||
#include "JSprite.h"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#ifndef _MD2MODEL_H
|
||||
#define _MD2MODEL_H
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
#else
|
||||
|
||||
@@ -236,7 +236,7 @@ private:
|
||||
|
||||
void CheckNextState();
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
void CalculateNormal(float *p1, float *p2, float *p3);
|
||||
#else
|
||||
void CalculateNormal(ScePspFVector3* normal, float *p1, float *p2, float *p3);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
#include "JTypes.h"
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#elif defined (LINUX)
|
||||
|
||||
#else
|
||||
|
||||
#include <pspgu.h>
|
||||
@@ -533,7 +535,7 @@ private:
|
||||
static JRenderer* mInstance;
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
GLuint mCurrentTex;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#elif defined (LINUX)
|
||||
#else
|
||||
|
||||
#include <pspgu.h>
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
JMusic();
|
||||
~JMusic();
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
FSOUND_SAMPLE *mTrack; // MP3 needed to be of "sample" type for FMOD, FMUSIC_MODULE is for MODs
|
||||
#else
|
||||
JCooleyesMP3* mTrack;
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
int mVoice;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
FSOUND_SAMPLE *mSample;
|
||||
#else
|
||||
WAVDATA *mSample;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#ifndef _SPRITE_H_
|
||||
#define _SPRITE_H_
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined(LINUX)
|
||||
#include <math.h>
|
||||
#else
|
||||
#include <fastmath.h>
|
||||
|
||||
+30
-15
@@ -11,7 +11,9 @@
|
||||
#ifndef _JTYPES_H
|
||||
#define _JTYPES_H
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#else
|
||||
|
||||
@@ -64,12 +66,19 @@
|
||||
#define BLEND_OPTION_BLEND GU_TFX_BLEND
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (WIN32)
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
#endif
|
||||
#ifdef LINUX
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned char BYTE;
|
||||
typedef bool BOOL;
|
||||
#endif
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#include "../Dependencies/include/fmod.h"
|
||||
|
||||
@@ -79,13 +88,20 @@
|
||||
//#define u8 BYTE
|
||||
//#define u16 WORD
|
||||
//#define u32 DWORD
|
||||
/*
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed long s32;
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
//Long ?
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned long u32;
|
||||
*/
|
||||
typedef int8_t s8;
|
||||
typedef int16_t s16;
|
||||
typedef int32_t s32;
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
|
||||
|
||||
#define BLEND_ZERO GL_ZERO
|
||||
@@ -103,7 +119,7 @@
|
||||
#define ARGB(a, r, g, b) ((a << 24) | (r << 16) | (g << 8) | b)
|
||||
#define RGBA(r, g, b, a) ((a << 24) | (b << 16) | (g << 8) | r)
|
||||
|
||||
enum PspCtrlButtons
|
||||
typedef enum PspCtrlButtons
|
||||
{
|
||||
PSP_CTRL_SELECT = 0x000001,
|
||||
PSP_CTRL_START = 0x000008,
|
||||
@@ -119,8 +135,8 @@
|
||||
PSP_CTRL_SQUARE = 0x008000,
|
||||
PSP_CTRL_HOME = 0x010000,
|
||||
PSP_CTRL_HOLD = 0x020000,
|
||||
PSP_CTRL_NOTE = 0x800000,
|
||||
};
|
||||
PSP_CTRL_NOTE = 0x800000
|
||||
} PspCtrlButtons;
|
||||
|
||||
|
||||
#define PIXEL_TYPE DWORD
|
||||
@@ -191,8 +207,7 @@
|
||||
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
|
||||
|
||||
#define SLICE_SIZE_F 64.0f
|
||||
//LONG ???
|
||||
typedef unsigned int DWORD;
|
||||
typedef unsigned long DWORD;
|
||||
|
||||
#define BLEND_ZERO 0x1000
|
||||
#define BLEND_ONE 0x1002
|
||||
@@ -304,7 +319,7 @@ public:
|
||||
|
||||
int mFilter;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
GLuint mTexId;
|
||||
#else
|
||||
|
||||
@@ -414,7 +429,7 @@ public:
|
||||
|
||||
JTexture* mTex;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined(LINUX)
|
||||
float mTX0;
|
||||
float mTY0;
|
||||
float mTX1;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#include <math.h>
|
||||
#elif defined LINUX
|
||||
#include <math.h>
|
||||
#else
|
||||
#include <fastmath.h>
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3186,7 +3186,7 @@ static int _gbk_mbtowc(ucs4_t *pwc, const u8 *s, int n)
|
||||
return RET_ILSEQ;
|
||||
}
|
||||
|
||||
static int ascii_mbtowc ( ucs4_t *pwc, const u8 *s, int n)
|
||||
static int ascii_mbtowc ( ucs4_t *pwc, const u8 *s, int n __attribute__((unused)))
|
||||
{
|
||||
u8 c = *s;
|
||||
if (c < 0x80) {
|
||||
|
||||
@@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile)
|
||||
element = script->ToElement();
|
||||
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
|
||||
|
||||
char *type[] =
|
||||
const char *type[] =
|
||||
{
|
||||
"ANIMATION_TYPE_LOOPING",
|
||||
"ANIMATION_TYPE_ONCE_AND_STAY",
|
||||
@@ -317,7 +317,7 @@ void JAnimator::SetHotSpot(float x, float y)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JAnimatorFrame::JAnimatorFrame(JAnimator* parent)
|
||||
JAnimatorFrame::JAnimatorFrame(JAnimator* parent __attribute__((unused)))
|
||||
{
|
||||
mTimer = 0.0f;
|
||||
mFrameTime = 100.0f;
|
||||
@@ -390,7 +390,7 @@ JAnimatorObject::~JAnimatorObject()
|
||||
|
||||
}
|
||||
|
||||
void JAnimatorObject::Update(float dt)
|
||||
void JAnimatorObject::Update(float dt __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#pragma warning(disable : 4786)
|
||||
#ifndef LINUX
|
||||
#pragma warning(disable : 4786)
|
||||
#endif
|
||||
|
||||
#include "../include/JGE.h"
|
||||
#include "../include/JFileSystem.h"
|
||||
@@ -47,7 +49,7 @@ void JFileSystem::Destroy()
|
||||
JFileSystem::JFileSystem()
|
||||
{
|
||||
mZipAvailable = false;
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mFile = NULL;
|
||||
#else
|
||||
mFile = -1;
|
||||
@@ -124,7 +126,7 @@ bool JFileSystem::OpenFile(const string &filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mFile = fopen(path.c_str(), "rb");
|
||||
if (mFile != NULL)
|
||||
{
|
||||
@@ -156,7 +158,7 @@ void JFileSystem::CloseFile()
|
||||
if (mZipAvailable && mZipFile != NULL)
|
||||
return;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
if (mFile != NULL)
|
||||
fclose(mFile);
|
||||
#else
|
||||
@@ -174,7 +176,7 @@ int JFileSystem::ReadFile(void *buffer, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
return fread(buffer, 1, size, mFile);
|
||||
#else
|
||||
return sceIoRead(mFile, buffer, size);
|
||||
|
||||
+10
-10
@@ -89,7 +89,7 @@ bool JGBKFont::Init(const char* engFileName, const char* chnFileName, int fontsi
|
||||
mSprites = new JQuad*[mCacheSize];
|
||||
mGBCode = new int[mCacheSize];
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mCharBuffer = new DWORD[mFontSize*mFontSize];
|
||||
#endif
|
||||
|
||||
@@ -136,7 +136,7 @@ bool JGBKFont::Init(const char* engFileName, const char* chnFileName, int fontsi
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
#else
|
||||
void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width, unsigned int height)
|
||||
{
|
||||
@@ -188,7 +188,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
if (mCurr >= mCacheSize)
|
||||
mCurr = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
@@ -213,7 +213,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
|
||||
bitCount = mFontSize;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
x = 0;
|
||||
#else
|
||||
x = (int)mSprites[index]->mX;
|
||||
@@ -225,7 +225,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
BYTE bitMask = 0x80;
|
||||
for (int z=0;z<8&&bitCount;z++)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
if ((bits & bitMask) != 0)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(255,255,255,255);
|
||||
else
|
||||
@@ -257,7 +257,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
for (int i=0;i<size;)
|
||||
{
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
x = 0;
|
||||
#else
|
||||
x = (int)mSprites[index]->mX;
|
||||
@@ -269,7 +269,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
|
||||
for (n=0;n<(mFontSize-8)/2;n++)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#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);
|
||||
@@ -286,7 +286,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
BYTE bitMask = 0x80;
|
||||
for (int z=0;z<8&&bitCount;z++)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
if ((bits & bitMask) != 0)
|
||||
mCharBuffer[y*mFontSize+x] = ARGB(255,255,255,255);
|
||||
else
|
||||
@@ -308,7 +308,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
|
||||
for (n=0;n<(mFontSize-8)/2;n++)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#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);
|
||||
@@ -324,7 +324,7 @@ int JGBKFont::PreCacheChar(const BYTE *ch)
|
||||
|
||||
mGBCode[index] = code;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
x = (int)mSprites[index]->mX;
|
||||
y = (int)mSprites[index]->mY;
|
||||
|
||||
|
||||
+57
-25
@@ -19,11 +19,66 @@
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#ifdef WIN32
|
||||
|
||||
#if defined (WIN32) // WIN32 specific code
|
||||
#include "../../Dependencies/include/png.h"
|
||||
#include "../../Dependencies/include/fmod.h"
|
||||
|
||||
int JGE::GetTime(void)
|
||||
{
|
||||
return (int)GetTickCount();
|
||||
}
|
||||
|
||||
u8 JGE::GetAnalogX()
|
||||
{
|
||||
if (JGEGetKeyState(VK_LEFT)) return 0;
|
||||
if (JGEGetKeyState(VK_RIGHT)) return 0xff;
|
||||
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
|
||||
u8 JGE::GetAnalogY()
|
||||
{
|
||||
if (JGEGetKeyState(VK_UP)) return 0;
|
||||
if (JGEGetKeyState(VK_DOWN)) return 0xff;
|
||||
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
#elif defined (LINUX) // Unix specific code
|
||||
#include "png.h"
|
||||
#include "../Dependencies/include/fmod.h"
|
||||
|
||||
int JGE::GetTime(void)
|
||||
{
|
||||
return (int)time(NULL);
|
||||
}
|
||||
|
||||
u8 JGE::GetAnalogX()
|
||||
{
|
||||
/* FIXME
|
||||
if (JGEGetKeyState(VK_LEFT)) return 0;
|
||||
if (JGEGetKeyState(VK_RIGHT)) return 0xff;
|
||||
*/
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
|
||||
u8 JGE::GetAnalogY()
|
||||
{
|
||||
/* FIXME
|
||||
if (JGEGetKeyState(VK_UP)) return 0;
|
||||
if (JGEGetKeyState(VK_DOWN)) return 0xff;
|
||||
*/
|
||||
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined (WIN32) || defined (LINUX) // Non-PSP code
|
||||
|
||||
JGE::JGE()
|
||||
{
|
||||
@@ -91,12 +146,6 @@ void JGE::SetDelta(int delta)
|
||||
mDeltaTime = (float)delta / 1000.0f; // change to second
|
||||
}
|
||||
|
||||
int JGE::GetTime(void)
|
||||
{
|
||||
return (int)GetTickCount();
|
||||
}
|
||||
|
||||
|
||||
float JGE::GetDelta()
|
||||
{
|
||||
return mDeltaTime;
|
||||
@@ -125,23 +174,6 @@ bool JGE::GetButtonClick(u32 button)
|
||||
}
|
||||
|
||||
|
||||
u8 JGE::GetAnalogX()
|
||||
{
|
||||
if (JGEGetKeyState(VK_LEFT)) return 0;
|
||||
if (JGEGetKeyState(VK_RIGHT)) return 0xff;
|
||||
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
|
||||
u8 JGE::GetAnalogY()
|
||||
{
|
||||
if (JGEGetKeyState(VK_UP)) return 0;
|
||||
if (JGEGetKeyState(VK_DOWN)) return 0xff;
|
||||
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#else ///// PSP specified code
|
||||
|
||||
+3
-3
@@ -25,10 +25,10 @@ JGuiObject::JGuiObject(int id): mId(id)
|
||||
JGuiObject::~JGuiObject()
|
||||
{
|
||||
// JGERelease();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
bool JGuiObject::Leaving(u32 key)
|
||||
bool JGuiObject::Leaving(u32 key __attribute__((unused)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ int JGuiObject::GetId()
|
||||
}
|
||||
|
||||
|
||||
void JGuiObject::Update(float dt)
|
||||
void JGuiObject::Update(float dt __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ bool JMD2Model::Load(char *filename, char *textureName)
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// given 3 points, calculates the normal to the points
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3)
|
||||
#else
|
||||
void JMD2Model::CalculateNormal(ScePspFVector3 *normal, float *p1, float *p2, float *p3)
|
||||
@@ -243,7 +243,7 @@ void JMD2Model::CalculateNormal(ScePspFVector3 *normal, float *p1, float *p2, fl
|
||||
// calculate the length of the normal
|
||||
length = (float)sqrt(result[0]*result[0] + result[1]*result[1] + result[2]*result[2]);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
// normalize and specify the normal
|
||||
glNormal3f(result[0]/length, result[1]/length, result[2]/length);
|
||||
|
||||
@@ -273,7 +273,7 @@ void JMD2Model::Render(int frameNum)
|
||||
mRenderer->BindTexture(mModel->modelTex);
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
|
||||
// display the textured model with proper lighting normals
|
||||
@@ -465,7 +465,7 @@ void JMD2Model::Render()
|
||||
|
||||
mRenderer->BindTexture(mModel->modelTex);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
@@ -34,7 +34,7 @@ int JOBJModel::ReadLine(char *output, const char *buffer, int start, int size)
|
||||
while (start < size && buffer[start] != '\n' && buffer[start] != '\r')
|
||||
output[index++] = buffer[start++];
|
||||
|
||||
while (start < size && buffer[start] == '\n' || buffer[start] == '\r')
|
||||
while ((start < size && buffer[start] == '\n') || buffer[start] == '\r')
|
||||
start++;
|
||||
|
||||
output[index] = 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename)
|
||||
// FIELD_COUNT
|
||||
// };
|
||||
|
||||
char* lifeValues[] =
|
||||
const char* lifeValues[] =
|
||||
{
|
||||
"speed",
|
||||
"size",
|
||||
@@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename)
|
||||
"gravity"
|
||||
};
|
||||
|
||||
char* typeNames[] =
|
||||
const char* typeNames[] =
|
||||
{
|
||||
"POINT",
|
||||
"AREA",
|
||||
@@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename)
|
||||
"CIRCLE"
|
||||
};
|
||||
|
||||
char* modeNames[] =
|
||||
const char* modeNames[] =
|
||||
{
|
||||
"REPEAT",
|
||||
"ONCE",
|
||||
@@ -121,8 +121,6 @@ bool JParticleEffect::Load(const char* filename)
|
||||
"CONTINUOUS"
|
||||
};
|
||||
|
||||
int i;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// One effect per file only, well, we may extend it later to permit
|
||||
// multiple effect definitions:
|
||||
@@ -159,7 +157,7 @@ bool JParticleEffect::Load(const char* filename)
|
||||
else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0)
|
||||
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
|
||||
|
||||
for (i=0;i<sizeof(modeNames)/sizeof(char*);i++)
|
||||
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
|
||||
{
|
||||
if (strcmp(element->Attribute("mode"), modeNames[i])==0)
|
||||
{
|
||||
@@ -170,7 +168,7 @@ bool JParticleEffect::Load(const char* filename)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i=0;i<sizeof(typeNames)/sizeof(char*);i++)
|
||||
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
|
||||
{
|
||||
if (strcmp(element->Attribute("type"), typeNames[i])==0)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ void JParticleEmitter::SetQuad(JQuad *quad)
|
||||
|
||||
void JParticleEmitter::Update(float dt)
|
||||
{
|
||||
JParticleSystem* particleSys = mParent->GetParticleSystem();
|
||||
// JParticleSystem* particleSys = mParent->GetParticleSystem();
|
||||
|
||||
mActiveParticleCount = 0;
|
||||
|
||||
@@ -185,7 +185,7 @@ void JParticleEmitter::Update(float dt)
|
||||
|
||||
void JParticleEmitter::EmitParticles(int count)
|
||||
{
|
||||
JParticleSystem* particleSys = mParent->GetParticleSystem();
|
||||
// JParticleSystem* particleSys = mParent->GetParticleSystem();
|
||||
|
||||
JParticleData *dataPtr;
|
||||
JParticle* particle;
|
||||
|
||||
+4
-4
@@ -144,7 +144,7 @@ void JSprite::Render()
|
||||
// //mQuad->SetColor(ARGB(alpha,255,255,255));
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
mFrames[mCurrentFrame]->SetColor(alpha<<24 | mColor);
|
||||
// mQuad->SetFlip(mFlipped[mCurrentFrame], false);
|
||||
#else
|
||||
@@ -305,7 +305,7 @@ void JSprite::SetHotSpot(float x, float y, int index)
|
||||
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&0x00ffffff); }
|
||||
#else
|
||||
void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&~MASK_ALPHA); }
|
||||
@@ -344,7 +344,7 @@ void JSprite::SetCurrentFrameIndex(int frame)
|
||||
|
||||
JQuad* JSprite::GetCurrentFrame()
|
||||
{
|
||||
if (mCurrentFrame < mFrames.size())
|
||||
if (mCurrentFrame < (signed int)mFrames.size())
|
||||
return mFrames[mCurrentFrame];
|
||||
else
|
||||
return NULL;
|
||||
@@ -358,7 +358,7 @@ int JSprite::GetFrameCount()
|
||||
|
||||
JQuad* JSprite::GetFrame(int index)
|
||||
{
|
||||
if (index < mFrames.size())
|
||||
if (index < (signed int)mFrames.size())
|
||||
return mFrames[index];
|
||||
else
|
||||
return NULL;
|
||||
|
||||
+9
-8
@@ -19,8 +19,9 @@
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#pragma comment( lib, "freetype.lib" )
|
||||
|
||||
#ifndef LINUX
|
||||
#pragma comment( lib, "freetype.lib" )
|
||||
#endif
|
||||
|
||||
#include "../include/JGE.h"
|
||||
#include "../include/JRenderer.h"
|
||||
@@ -257,7 +258,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
|
||||
FT_GlyphSlot slot = mFace->glyph;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
DWORD *texBuffer = new DWORD[mMaxCharWidth*mMaxCharHeight];
|
||||
memset(texBuffer, 0, mMaxCharWidth*mMaxCharHeight*sizeof(DWORD));
|
||||
#else
|
||||
@@ -277,7 +278,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
int top = mSize-slot->bitmap_top+1;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
int offset = top*mMaxCharWidth + slot->bitmap_left + 2;
|
||||
#else
|
||||
int xx = x + slot->bitmap_left + 2;
|
||||
@@ -302,7 +303,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
grey = slot->bitmap.buffer[i * slot->bitmap.width + j];
|
||||
|
||||
#ifdef WIN32
|
||||
#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);
|
||||
@@ -325,7 +326,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
if (bits&mask)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#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);
|
||||
@@ -343,7 +344,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
|
||||
mXAdvance[mCurr] = (u8)(slot->advance.x>>6);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mMaxCharWidth, mMaxCharHeight, GL_RGBA, GL_UNSIGNED_BYTE, texBuffer);
|
||||
#else
|
||||
sceKernelDcacheWritebackAll();
|
||||
@@ -357,7 +358,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
if (mCurr >= mMaxCharCount)
|
||||
mCurr = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
delete [] texBuffer;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void hgeDistortionMesh::SetTextureRect(float x, float y, float w, float h)
|
||||
}
|
||||
}
|
||||
|
||||
void hgeDistortionMesh::SetBlendMode(int blend)
|
||||
void hgeDistortionMesh::SetBlendMode(int blend __attribute__((unused)))
|
||||
{
|
||||
// quad.blend=blend;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ const char FNTCHARTAG[] = "Char";
|
||||
char hgeFont::buffer[256];
|
||||
|
||||
|
||||
hgeFont::hgeFont(const char *szFont, bool bMipmap)
|
||||
hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused)))
|
||||
{
|
||||
//void *data;
|
||||
DWORD size;
|
||||
|
||||
@@ -35,7 +35,7 @@ distribution.
|
||||
const TiXmlString::size_type TiXmlString::npos = static_cast< size_type >(-1);
|
||||
|
||||
// Null rep.
|
||||
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, '\0' };
|
||||
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
|
||||
|
||||
|
||||
void TiXmlString::reserve (size_type cap)
|
||||
|
||||
@@ -353,7 +353,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' )
|
||||
while ( ( *p && IsWhiteSpace( *p ) ) || *p == '\n' || *p =='\r' )
|
||||
++p;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user