mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
Merge gles1 and master
# Conflicts: # TODO.md # group/bld.inf # group/common.mmh # src/skel/symbian/symbian.cpp
This commit is contained in:
commit
55aecc66f3
82 changed files with 4082 additions and 129 deletions
|
|
@ -84,7 +84,7 @@ public:
|
|||
inline float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
|
||||
|
||||
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
|
||||
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
|
||||
return (CAnimBlendAssociation*)((uint8*)l - OFFSET_OF(CAnimBlendAssociation, link));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,4 @@ public:
|
|||
void MoveMemory(bool onlyone = false);
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CAnimBlendHierarchy, 0x28);
|
||||
VALIDATE_SIZE(CAnimBlendHierarchy, 0x28);
|
||||
|
|
|
|||
|
|
@ -207,4 +207,4 @@ enum AnimationId
|
|||
ANIM_STD_PHONE_TALK,
|
||||
|
||||
ANIM_STD_NUM
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -670,4 +670,4 @@ static char StreamedNameTable[][25] =
|
|||
"AUDIO\\k1_b.WAV",
|
||||
"AUDIO\\cat1.WAV"
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@ struct CColBox
|
|||
CVector GetSize(void) { return max - min; }
|
||||
|
||||
CColBox& operator=(const CColBox &other);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@ struct CColLine
|
|||
CColLine(void) { };
|
||||
CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; };
|
||||
void Set(const CVector &p0, const CVector &p1);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,4 +34,4 @@ struct CColModel
|
|||
void GetTrianglePoint(CVector &v, int i) const;
|
||||
|
||||
CColModel& operator=(const CColModel& other);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ struct CColSphere
|
|||
uint8 surface;
|
||||
uint8 piece;
|
||||
void Set(float radius, const CVector ¢er, uint8 surf = SURFACE_DEFAULT, uint8 piece = 0);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -65,4 +65,4 @@ struct CColTrianglePlane
|
|||
void GetNormal(CVector &n) const { n = normal; }
|
||||
float CalcPoint(const CVector &v) const { return DotProduct(normal, v) - dist; };
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,4 +33,4 @@ struct CompressedVector
|
|||
CVector Get(void) const { return CVector(x, y, z); };
|
||||
void Set(float x, float y, float z) { this->x = x; this->y = y; this->z = z; };
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,4 +28,4 @@ public:
|
|||
bool WorkToDoForMedics();
|
||||
};
|
||||
|
||||
extern CAccidentManager gAccidentManager;
|
||||
extern CAccidentManager gAccidentManager;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ void CControllerConfigManager::MakeControllerActionsBlank()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef RW_GL3
|
||||
#if defined RW_GL3 || defined RW_GLES1
|
||||
int MapIdToButtonId(int mapId) {
|
||||
#ifdef __SYMBIAN32__
|
||||
// TODO
|
||||
|
|
@ -102,7 +102,7 @@ int32 CControllerConfigManager::GetJoyButtonJustDown()
|
|||
if (m_NewState.rgbButtons[i] & 0x80 && !(m_OldState.rgbButtons[i] & 0x80))
|
||||
return i + 1;
|
||||
}
|
||||
#elif defined RW_GL3
|
||||
#elif defined RW_GL3 || defined RW_GLES1
|
||||
if (m_NewState.isGamepad) {
|
||||
for (int32 i = 0; i < MAX_BUTTONS; i++) {
|
||||
if (m_NewState.mappedButtons[i] && !(m_OldState.mappedButtons[i]))
|
||||
|
|
@ -2773,7 +2773,7 @@ void CControllerConfigManager::UpdateJoyButtonState(int32 padnumber)
|
|||
else
|
||||
m_aButtonStates[i] = false;
|
||||
}
|
||||
#elif defined RW_GL3
|
||||
#elif defined RW_GL3 || defined RW_GLES1
|
||||
if (m_NewState.isGamepad) {
|
||||
for (int32 i = 0; i < MAX_BUTTONS; i++) {
|
||||
#if !defined __SYMBIAN32__
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class CControllerState;
|
|||
|
||||
#define ACTIONNAME_LENGTH 40
|
||||
|
||||
#ifdef RW_GL3
|
||||
#if defined RW_GL3 || defined RW_GLES1
|
||||
struct GlfwJoyState {
|
||||
int8 id;
|
||||
bool isGamepad;
|
||||
|
|
@ -129,7 +129,7 @@ public:
|
|||
};
|
||||
|
||||
bool m_bFirstCapture;
|
||||
#if defined RW_GL3
|
||||
#if defined RW_GL3 || defined RW_GLES1
|
||||
GlfwJoyState m_OldState;
|
||||
GlfwJoyState m_NewState;
|
||||
#else
|
||||
|
|
@ -219,8 +219,8 @@ public:
|
|||
void ResetSettingOrder (e_ControllerAction action);
|
||||
};
|
||||
|
||||
#ifndef RW_GL3
|
||||
#if !defined RW_GL3 && !defined RW_GLES1
|
||||
VALIDATE_SIZE(CControllerConfigManager, 0x143C);
|
||||
#endif
|
||||
|
||||
extern CControllerConfigManager ControlsManager;
|
||||
extern CControllerConfigManager ControlsManager;
|
||||
|
|
|
|||
|
|
@ -62,4 +62,4 @@ public:
|
|||
static void ReportCrimeForEvent(eEventType type, intptr, bool);
|
||||
};
|
||||
|
||||
extern CEvent gaEvent[NUMEVENTS];
|
||||
extern CEvent gaEvent[NUMEVENTS];
|
||||
|
|
|
|||
|
|
@ -5138,7 +5138,7 @@ CMenuManager::ProcessButtonPresses(void)
|
|||
ControlsManager.MakeControllerActionsBlank();
|
||||
ControlsManager.InitDefaultControlConfiguration();
|
||||
ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
|
||||
#if !defined RW_GL3
|
||||
#if !defined RW_GL3 && !defined RW_GLES1
|
||||
if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) {
|
||||
DIDEVCAPS devCaps;
|
||||
devCaps.dwSize = sizeof(DIDEVCAPS);
|
||||
|
|
|
|||
|
|
@ -1124,7 +1124,7 @@ CRadar::LoadTextures()
|
|||
|| (x2 < 1 && y2 == 1)) // one pixel on each side of second to first/last line is transparent
|
||||
pixels[x + y * 16] = 0;
|
||||
else if((x2 == 2 && y2 >= 2)|| (y2 == 2 && x2 >= 2) )// colored square inside
|
||||
#ifdef RW_GL3
|
||||
#if defined RW_GL3 || defined RW_GLES1
|
||||
pixels[x + y * 16] = WAYPOINT_R | (WAYPOINT_G << 8) | (WAYPOINT_B << 16) | (255 << 24);
|
||||
#else
|
||||
pixels[x + y * 16] = WAYPOINT_B | (WAYPOINT_G << 8) | (WAYPOINT_R << 16) | (255 << 24);
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ public:
|
|||
bool IsInRange(CVector2D vec);
|
||||
void DebugShowRange(float, int);
|
||||
CVector2D GetRandomPointInRange();
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
|
|||
#else
|
||||
#define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__)
|
||||
#define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__)
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__)
|
||||
#define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__)
|
||||
#else
|
||||
|
|
@ -367,7 +367,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
|
|||
#undef ASSERT
|
||||
#endif
|
||||
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
|
||||
#else
|
||||
#define assert(_Expression) (_Expression)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#define LOGS
|
||||
#define LOGS_RDEBUG
|
||||
|
||||
// disables (most) stuff that wasn't in original gta3.exe
|
||||
#ifdef __MWERKS__
|
||||
#define VANILLA_DEFINES
|
||||
|
|
|
|||
|
|
@ -1140,6 +1140,8 @@ DisplayGameDebugText()
|
|||
"D3D8 "
|
||||
#elif defined RW_GL3
|
||||
"OpenGL "
|
||||
#elif defined RW_GLES1
|
||||
"GLES1 "
|
||||
#endif
|
||||
#if defined AUDIO_OAL
|
||||
"OAL "
|
||||
|
|
@ -1633,7 +1635,7 @@ Idle(void *arg)
|
|||
if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu) &&
|
||||
TheCamera.GetScreenFadeStatus() != FADE_2)
|
||||
{
|
||||
#if defined(GTA_PC) && !defined(RW_GL3) && defined(FIX_BUGS)
|
||||
#if defined(GTA_PC) && !defined(RW_GL3) && !defined(RW_GLES1) && defined(FIX_BUGS)
|
||||
// This is from SA, but it's nice for windowed mode
|
||||
if (!FrontEndMenuManager.m_bRenderGameInMenu) {
|
||||
RwV2d pos;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ myrand(void)
|
|||
{
|
||||
#ifdef USE_PS2_RAND
|
||||
// Use our own implementation of rand, stolen from PS2
|
||||
myrand_seed = 0x5851F42D4C957F2D * myrand_seed + 1;
|
||||
myrand_seed = 0x5851F42D4C957F2DULL * myrand_seed + 1;
|
||||
return ((myrand_seed >> 32) & 0x7FFFFFFF);
|
||||
#else
|
||||
// or original codewarrior rand
|
||||
|
|
@ -1105,12 +1105,12 @@ extern bool gbRenderWorld2;
|
|||
#endif
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
const int re3_buffsize = 1024;
|
||||
static char re3_buff[re3_buffsize];
|
||||
#endif
|
||||
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
@ -1166,9 +1166,13 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOGS_RDEBUG
|
||||
extern "C" void RDebug_Printf(const char*, ...);
|
||||
#endif
|
||||
|
||||
void re3_debug(const char *format, ...)
|
||||
{
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
#ifdef _WIN32
|
||||
|
|
@ -1179,11 +1183,15 @@ void re3_debug(const char *format, ...)
|
|||
va_end(va);
|
||||
|
||||
printf("%s", re3_buff);
|
||||
#ifdef LOGS_RDEBUG
|
||||
RDebug_Printf("%s", re3_buff);
|
||||
#else
|
||||
CDebug::DebugAddText(re3_buff);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...)
|
||||
{
|
||||
char buff[re3_buffsize *2];
|
||||
|
|
@ -1205,7 +1213,7 @@ void re3_trace(const char *filename, unsigned int lineno, const char *func, cons
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef MASTER
|
||||
#if !defined MASTER || defined LOGS
|
||||
void re3_usererror(const char *format, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
|
|
|||
|
|
@ -201,4 +201,4 @@ inline DebugMenuEntry *DebugMenuAddVarBool8(const char *path, const char *name,
|
|||
{
|
||||
return DebugMenuAddVarBool8(path, name, (int8_t*)ptr, triggerFunc);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -541,4 +541,4 @@ CCompressedMatrixNotAligned::DecompressIntoFullMatrix(CMatrix &other)
|
|||
other.GetUp() = CrossProduct(other.GetRight(), other.GetForward());
|
||||
other.GetPosition() = m_vecPos;
|
||||
other.Reorthogonalise();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,4 +174,4 @@ CQuaternion::Set(float f1, float f2, float f3)
|
|||
y = ((s1 * c2) * c3) + ((s2 * c1) * s3);
|
||||
z = ((s2 * c1) * c3) - ((s1 * c2) * s3);
|
||||
w = ((c2 * c1) * c3) + ((s2 * s1) * s3);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ CRect::CRect(float l, float t, float r, float b)
|
|||
top = t;
|
||||
right = r;
|
||||
bottom = b;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,4 +126,4 @@ class CMatrix;
|
|||
|
||||
CVector Multiply3x3(const CMatrix &mat, const CVector &vec);
|
||||
CVector Multiply3x3(const CVector &vec, const CMatrix &mat);
|
||||
CVector operator*(const CMatrix &mat, const CVector &vec);
|
||||
CVector operator*(const CMatrix &mat, const CVector &vec);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const RwV3d *in,
|
|||
": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
|
||||
#else
|
||||
while(n--){
|
||||
*out = mat * *in;
|
||||
const RwV3d i = *in;
|
||||
*out = mat * i;
|
||||
in = (RwV3d*)((uint8*)in + stride);
|
||||
out++;
|
||||
}
|
||||
|
|
@ -110,7 +111,8 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector
|
|||
": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
|
||||
#else
|
||||
while(n--){
|
||||
*out = mat * *in;
|
||||
const RwV3d i = *in;
|
||||
*out = mat * i;
|
||||
in++;
|
||||
out++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@ public:
|
|||
public:
|
||||
CMloModelInfo(void) : CClumpModelInfo(MITYPE_MLO) {}
|
||||
void ConstructClump();
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -506,4 +506,4 @@ IsFence(int16 id)
|
|||
{
|
||||
return id == MI_FENCE ||
|
||||
id == MI_FENCE2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,4 @@ public:
|
|||
};
|
||||
#ifndef PED_SKIN
|
||||
VALIDATE_SIZE(CPedModelInfo, 0x48);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ public:
|
|||
void Shutdown(void) {};
|
||||
RwObject *CreateInstance(void) { return nil; }
|
||||
void SetClump(RpClump*) {};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -464,4 +464,4 @@ CPed::RunToReportCrime(eCrimeType crimeToReport)
|
|||
m_phoneId = phoneId;
|
||||
m_crimeToReportOnPhone = crimeToReport;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,4 +149,4 @@ CPed::Say(uint16 audio)
|
|||
m_queuedSound = audio;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,4 +307,4 @@ CPed::DebugRenderClosePedText()
|
|||
{
|
||||
// TODO: mobile code
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ public:
|
|||
static void FindZCoorForPed(CVector* pos);
|
||||
static CEntity* IsPositionClearOfCars(Const CVector*);
|
||||
static bool IsPositionClearForPed(CVector*);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -170,4 +170,4 @@ public:
|
|||
static ePedStats GetPedStatType(char *name);
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CPedStats, 0x34);
|
||||
VALIDATE_SIZE(CPedStats, 0x34);
|
||||
|
|
|
|||
|
|
@ -24,4 +24,4 @@ public:
|
|||
|
||||
extern CConsole TheConsole;
|
||||
|
||||
void cprintf(char*, ...);
|
||||
void cprintf(char*, ...);
|
||||
|
|
|
|||
|
|
@ -60,4 +60,4 @@ void RestoreAlphaTest();
|
|||
#else
|
||||
#define SetAlphaTest(a) (0)
|
||||
#define RestoreAlphaTest() (0)
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -93,36 +93,106 @@ static int clamp(int size, int targetSize)
|
|||
return size;
|
||||
}
|
||||
|
||||
static void downscaleTexture(RwTexture *texture)
|
||||
{
|
||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||
if (oldRaster == nil)
|
||||
return;
|
||||
void debugRaster(RwRaster *r){
|
||||
if(!r){
|
||||
debug("Raster NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
extern bool moreVram;
|
||||
int targetSize = moreVram ? 64 : 32;
|
||||
|
||||
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||
if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
||||
debug("Raster: %dx%d | depth: %d | format: 0x%X | stride: %d | platform: %d | pixels: %p",
|
||||
r->width,
|
||||
r->height,
|
||||
r->depth,
|
||||
r->format,
|
||||
r->stride,
|
||||
r->platform,
|
||||
r->pixels);
|
||||
}
|
||||
|
||||
int newWidth = clamp(oldWidth, targetSize);
|
||||
int newHeight = clamp(oldHeight, targetSize);
|
||||
if (newWidth == oldWidth && newHeight == oldHeight) return;
|
||||
static void downscaleTexture(RwTexture *texture){
|
||||
#ifdef RW_GLES1
|
||||
if(texture == nil)
|
||||
return;
|
||||
|
||||
RwImage *image = oldRaster->toImage();
|
||||
if (image == nil) return;
|
||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||
if(oldRaster == nil)
|
||||
return;
|
||||
|
||||
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||
RwImageDestroy(image);
|
||||
if (resized == nil) return;
|
||||
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||
|
||||
RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
||||
RwImageDestroy(resized);
|
||||
if (newRaster == nil) return;
|
||||
// dividir a la mitad, mínimo 16x16
|
||||
int newWidth = oldWidth > 16 ? oldWidth / 2 : oldWidth;
|
||||
int newHeight = oldHeight > 16 ? oldHeight / 2 : oldHeight;
|
||||
|
||||
RwTextureSetRaster(texture, newRaster);
|
||||
RwRasterDestroy(oldRaster);
|
||||
// si ya es suficientemente chica, no hacer nada
|
||||
if(newWidth == oldWidth && newHeight == oldHeight)
|
||||
return;
|
||||
|
||||
// toImage() funciona porque el backingStore está populado
|
||||
RwImage *image = oldRaster->toImage();
|
||||
if(image == nil){
|
||||
debug("downscaleTexture: toImage FAILED for %dx%d", oldWidth, oldHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||
RwImageDestroy(image);
|
||||
if(resized == nil){
|
||||
debug("downscaleTexture: resizeImage FAILED");
|
||||
return;
|
||||
}
|
||||
|
||||
// crear nuevo raster en formato compatible con GLES1
|
||||
int32 w, h, d, f;
|
||||
rw::Raster::imageFindRasterFormat(resized, rw::Raster::TEXTURE, &w, &h, &d, &f);
|
||||
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GLES1);
|
||||
if(newRaster == nil){
|
||||
debug("downscaleTexture: raster create FAILED");
|
||||
RwImageDestroy(resized);
|
||||
return;
|
||||
}
|
||||
|
||||
if(newRaster->setFromImage(resized) == nil){
|
||||
debug("downscaleTexture: setFromImage FAILED");
|
||||
RwRasterDestroy(newRaster);
|
||||
RwImageDestroy(resized);
|
||||
return;
|
||||
}
|
||||
|
||||
RwImageDestroy(resized);
|
||||
RwTextureSetRaster(texture, newRaster);
|
||||
RwRasterDestroy(oldRaster);
|
||||
#else
|
||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||
if (oldRaster == nil)
|
||||
return;
|
||||
|
||||
extern bool moreVram;
|
||||
int targetSize = moreVram ? 64 : 32;
|
||||
|
||||
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||
if (oldWidth <= targetSize && oldHeight <= targetSize) return;
|
||||
|
||||
int newWidth = clamp(oldWidth, targetSize);
|
||||
int newHeight = clamp(oldHeight, targetSize);
|
||||
if (newWidth == oldWidth && newHeight == oldHeight) return;
|
||||
|
||||
RwImage *image = oldRaster->toImage();
|
||||
if (image == nil) return;
|
||||
|
||||
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||
RwImageDestroy(image);
|
||||
if (resized == nil) return;
|
||||
|
||||
RwRaster *newRaster = rw::Raster::createFromImage(resized);
|
||||
RwImageDestroy(resized);
|
||||
if (newRaster == nil) return;
|
||||
|
||||
RwTextureSetRaster(texture, newRaster);
|
||||
RwRasterDestroy(oldRaster);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -70,4 +70,4 @@ ZeroSaveBuf(uint8 *&buf, uint32 length)
|
|||
} while(0)
|
||||
#else
|
||||
#define CheckSaveHeader(buf, a, b, c, d, size) SkipSaveBuf(buf, 8);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ int _caserename(const char *old_filename, const char *new_filename);
|
|||
#define caserename _caserename
|
||||
#endif
|
||||
|
||||
#ifdef RW_GL3
|
||||
#if defined RW_GL3 || defined RW_GLES1
|
||||
typedef struct
|
||||
{
|
||||
#ifndef __SYMBIAN32__
|
||||
|
|
|
|||
|
|
@ -9,11 +9,19 @@
|
|||
#include <eikstart.h>
|
||||
#include <hal.h>
|
||||
#include <pthread.h>
|
||||
#include <gles2/gl2.h>
|
||||
#ifdef RW_GL3
|
||||
#include <EGL/egl.h>
|
||||
#else
|
||||
#include <GLES/egl.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
#include <versioninfo.h>
|
||||
#include <aknwseventobserver.h>
|
||||
#include <featdiscovery.h>
|
||||
#include <aknutils.h>
|
||||
#ifndef KFeatureIdQwertyInput
|
||||
#include <featureinfo.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "rwcore.h"
|
||||
|
|
@ -79,10 +87,12 @@ static psGlobalType PsGlobal;
|
|||
|
||||
static TBool foreground;
|
||||
|
||||
bool moreVram;
|
||||
|
||||
static bool spinning;
|
||||
|
||||
bool qwerty;
|
||||
bool touch;
|
||||
bool moreVram;
|
||||
|
||||
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) {
|
||||
}
|
||||
|
||||
|
|
@ -292,22 +302,40 @@ static int MapScanCode(TInt aScanCode, TInt aModifiers) {
|
|||
return JOY_DPAD_RIGHT;
|
||||
}
|
||||
return JOY_DPAD_DOWN;
|
||||
|
||||
case 'z':
|
||||
case 'Z':
|
||||
case '1':
|
||||
return JOY_B;
|
||||
case 'x':
|
||||
case 'X':
|
||||
case '2':
|
||||
return JOY_X;
|
||||
case 'c':
|
||||
case 'C':
|
||||
case 'a':
|
||||
case 'A':
|
||||
case '4':
|
||||
return JOY_A;
|
||||
case 's':
|
||||
case 'S':
|
||||
case '3':
|
||||
return JOY_Y;
|
||||
|
||||
case '5':
|
||||
return JOY_L1;
|
||||
case '6':
|
||||
return JOY_R1;
|
||||
case '7':
|
||||
return JOY_L2;
|
||||
case '8':
|
||||
return JOY_R2;
|
||||
|
||||
case EStdKeyDevice0:
|
||||
return JOY_BACK;
|
||||
case EStdKeyDevice1:
|
||||
case EStdKeySpace:
|
||||
case ' ':
|
||||
return JOY_START;
|
||||
case EStdKeyEnter:
|
||||
case EStdKeyNkpEnter:
|
||||
case EStdKeyDevice3:
|
||||
return JOY_Y;
|
||||
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -414,39 +442,54 @@ public:
|
|||
CreateWindowL();
|
||||
iAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
|
||||
SetExtentToWholeScreen();
|
||||
|
||||
SetFocus(ETrue);
|
||||
|
||||
#ifdef RW_GL3
|
||||
Window().EnableAdvancedPointers();
|
||||
#endif
|
||||
EnableDragEvents();
|
||||
ActivateL();
|
||||
|
||||
|
||||
#ifdef RW_GL3
|
||||
// VC4 check
|
||||
VersionInfo::TPlatformVersion platformVersion;
|
||||
VersionInfo::GetVersion(platformVersion);
|
||||
moreVram = platformVersion.iMajorVersion == 5 && platformVersion.iMinorVersion >= 4;
|
||||
#endif
|
||||
|
||||
TSize size = Size();
|
||||
RsGlobal.width = size.iWidth;
|
||||
RsGlobal.height = size.iHeight;
|
||||
|
||||
EGLint attribs[] = {
|
||||
EGL_BUFFER_SIZE, 16,
|
||||
EGL_BUFFER_SIZE, 24,
|
||||
EGL_DEPTH_SIZE, 16,
|
||||
EGL_STENCIL_SIZE, 0,
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
#ifdef RW_GL3
|
||||
EGL_SAMPLES, 0,
|
||||
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
#endif
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
eglInitialize(eglDisplay, NULL, NULL);
|
||||
#ifdef RW_GL3
|
||||
eglBindAPI(EGL_OPENGL_ES_API);
|
||||
#endif
|
||||
|
||||
EGLint numConfigs;
|
||||
eglChooseConfig(eglDisplay, attribs, &eglConfig, 1, &numConfigs);
|
||||
|
||||
#ifdef RW_GL3
|
||||
EGLint contextAttribs[ 3 ] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
|
||||
eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, contextAttribs);
|
||||
#else
|
||||
eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, NULL);
|
||||
#endif
|
||||
|
||||
RWindow& window = Window();
|
||||
eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, &window, NULL);
|
||||
|
|
@ -458,6 +501,9 @@ public:
|
|||
setlocale(LC_COLLATE, "C");
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
touch = AknLayoutUtils::PenEnabled();
|
||||
TRAP_IGNORE(qwerty = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdQwertyInput));
|
||||
|
||||
chdir("E:\\Data\\gta3\\");
|
||||
gGameState = GS_START_UP;
|
||||
FrontEndMenuManager.LoadSettings();
|
||||
|
|
@ -471,7 +517,6 @@ public:
|
|||
|
||||
openParams.width = RsGlobal.width;
|
||||
openParams.height = RsGlobal.height;
|
||||
openParams.windowtitle = RsGlobal.appName;
|
||||
|
||||
ControlsManager.MakeControllerActionsBlank();
|
||||
ControlsManager.InitDefaultControlConfiguration();
|
||||
|
|
@ -523,9 +568,12 @@ public:
|
|||
// CCoeControl::HandlePointerEventL(aPointerEvent);
|
||||
// return;
|
||||
// }
|
||||
|
||||
#ifdef RW_GL3
|
||||
const TAdvancedPointerEvent* advpointer = aPointerEvent.AdvancedPointerEvent();
|
||||
int i = advpointer != NULL ? advpointer->PointerNumber() : 0;
|
||||
#else
|
||||
int i = 0;
|
||||
#endif
|
||||
|
||||
static int activeZone[10];
|
||||
static int stickCenterX[10];
|
||||
|
|
|
|||
|
|
@ -78,4 +78,4 @@ VALIDATE_SIZE(CBoat, 0x484);
|
|||
|
||||
extern float MAX_WAKE_LENGTH;
|
||||
extern float MIN_WAKE_INTERVAL;
|
||||
extern float WAKE_LIFETIME;
|
||||
extern float WAKE_LIFETIME;
|
||||
|
|
|
|||
|
|
@ -75,4 +75,4 @@ public:
|
|||
};
|
||||
VALIDATE_SIZE(CWeapon, 0x18);
|
||||
|
||||
void FireOneInstantHitRound(CVector *source, CVector *target, int32 damage);
|
||||
void FireOneInstantHitRound(CVector *source, CVector *target, int32 damage);
|
||||
|
|
|
|||
|
|
@ -49,4 +49,4 @@ public:
|
|||
bool IsFlagSet(uint32 flag) const { return (m_Flags & flag) != 0; }
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CWeaponInfo, 0x54);
|
||||
VALIDATE_SIZE(CWeaponInfo, 0x54);
|
||||
|
|
|
|||
|
|
@ -46,4 +46,4 @@ enum eWeaponState
|
|||
WEAPONSTATE_RELOADING,
|
||||
WEAPONSTATE_OUT_OF_AMMO,
|
||||
WEAPONSTATE_MELEE_MADECONTACT
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue