mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
Stub GLES 1.1 backend
This commit is contained in:
parent
f6a5685de8
commit
feefe2e742
28 changed files with 272 additions and 31 deletions
4
TODO.md
4
TODO.md
|
|
@ -15,6 +15,6 @@
|
|||
- [ ] Menu
|
||||
- [ ] Config
|
||||
|
||||
S60v3 (?):
|
||||
- [ ] Backport to STLport v4
|
||||
S60v3 / GLES 1.1:
|
||||
- [x] Use STLport v4
|
||||
- [ ] GLES 1.1 engine
|
||||
|
|
@ -4,5 +4,7 @@ DEFAULT ARMV6
|
|||
PRJ_MMPFILES
|
||||
gnumakefile Icons_scalable_dc.mk
|
||||
gnumakefile shaders.mk
|
||||
librw.mmp
|
||||
re3.mmp
|
||||
librw_gles2.mmp
|
||||
re3_gles2.mmp
|
||||
librw_gles1.mmp
|
||||
re3_gles1.mmp
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
SYSTEMINCLUDE /epoc32/include
|
||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
|
||||
SYSTEMINCLUDE /epoc32/include/stdapis
|
||||
SYSTEMINCLUDE /epoc32/include/mw
|
||||
SYSTEMINCLUDE /epoc32/include/platform
|
||||
SYSTEMINCLUDE /epoc32/include/platform/mw
|
||||
SYSTEMINCLUDE /epoc32/include/gles
|
||||
|
||||
USERINCLUDE .
|
||||
|
||||
MACRO LIBRW
|
||||
MACRO RW_GL3
|
||||
MACRO MASTER
|
||||
|
||||
DEBUGGABLE
|
||||
|
|
@ -25,4 +22,12 @@ OPTION_REPLACE ARMCC -O2 -O3
|
|||
ALWAYS_BUILD_AS_ARM
|
||||
#endif
|
||||
|
||||
#ifdef SYMBIAN_3
|
||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
|
||||
STDCPP
|
||||
MACRO RW_GL3
|
||||
#else
|
||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport
|
||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl
|
||||
MACRO RW_GLES1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
#include "common.mmh"
|
||||
|
||||
TARGET librw.lib
|
||||
TARGETTYPE lib
|
||||
|
||||
|
||||
USERINCLUDE ../vendor/librw
|
||||
USERINCLUDE ../vendor/librw/src
|
||||
|
||||
|
|
@ -15,6 +13,8 @@ SOURCEPATH ../vendor/librw/src
|
|||
SOURCE engine.cpp error.cpp frame.cpp geometry.cpp geoplg.cpp
|
||||
SOURCEPATH ../vendor/librw/src/gl
|
||||
SOURCE gl3.cpp gl3device.cpp gl3immed.cpp gl3matfx.cpp gl3pipe.cpp gl3raster.cpp gl3render.cpp gl3shader.cpp gl3skin.cpp wdgl.cpp
|
||||
SOURCEPATH ../vendor/librw/src/gles1
|
||||
SOURCE rwgles1.cpp
|
||||
SOURCEPATH ../vendor/librw/src
|
||||
SOURCE hanim.cpp image.cpp light.cpp
|
||||
SOURCEPATH ../vendor/librw/src/lodepng
|
||||
4
group/librw_gles1.mmp
Normal file
4
group/librw_gles1.mmp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#undef SYMBIAN3
|
||||
#define S60V3
|
||||
TARGET librw_gles1.lib
|
||||
#include "librw.mmh"
|
||||
4
group/librw_gles2.mmp
Normal file
4
group/librw_gles2.mmp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#undef S60V3
|
||||
#define SYMBIAN_3
|
||||
TARGET librw_gles2.lib
|
||||
#include "librw.mmh"
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
#include "common.mmh"
|
||||
|
||||
TARGET re3.exe
|
||||
TARGETTYPE exe
|
||||
UID 0 0xe0d67647
|
||||
|
||||
LIBRARY euser.lib
|
||||
LIBRARY libstdcppv5.lib
|
||||
LIBRARY libc.lib
|
||||
LIBRARY libm.lib
|
||||
LIBRARY libpthread.lib
|
||||
LIBRARY libglesv2.lib
|
||||
LIBRARY libegl.lib
|
||||
LIBRARY apparc.lib
|
||||
LIBRARY cone.lib
|
||||
LIBRARY eikcore.lib
|
||||
|
|
@ -22,8 +18,6 @@ LIBRARY platformver.lib
|
|||
EPOCSTACKSIZE 0x14000
|
||||
EPOCHEAPSIZE 0x80000 0x4000000
|
||||
|
||||
STATICLIBRARY librw.lib
|
||||
|
||||
SYSTEMINCLUDE ../vendor/librw
|
||||
|
||||
SOURCEPATH .
|
||||
7
group/re3_gles1.mmp
Normal file
7
group/re3_gles1.mmp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#undef SYMBIAN_3
|
||||
#define S60V3
|
||||
TARGET re3_gles1.exe
|
||||
LIBRARY libstdcpp.lib
|
||||
LIBRARY libgles_cm.lib
|
||||
STATICLIBRARY librw_gles1.lib
|
||||
#include "re3.mmh"
|
||||
8
group/re3_gles2.mmp
Normal file
8
group/re3_gles2.mmp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#undef S60V3
|
||||
#define SYMBIAN_3
|
||||
TARGET re3_gles2.exe
|
||||
LIBRARY libstdcppv5.lib
|
||||
LIBRARY libglesv2.lib
|
||||
LIBRARY libegl.lib
|
||||
STATICLIBRARY librw_gles2.lib
|
||||
#include "re3.mmh"
|
||||
|
|
@ -5,7 +5,8 @@ do_nothing :
|
|||
|
||||
MAKMAKE: do_nothing
|
||||
|
||||
BLD: do_nothing
|
||||
BLD:
|
||||
$(MAKE) -C ../vendor/librw/src/gl/shaders/ -f Makefile all
|
||||
|
||||
CLEAN:
|
||||
rm ../vendor/librw/src/gl/shaders/*.inc
|
||||
|
|
@ -14,8 +15,7 @@ LIB: do_nothing
|
|||
|
||||
CLEANLIB: do_nothing
|
||||
|
||||
RESOURCE:
|
||||
$(MAKE) -C ../vendor/librw/src/gl/shaders/ -f Makefile all
|
||||
RESOURCE: do_nothing
|
||||
|
||||
FREEZE: do_nothing
|
||||
|
||||
|
|
|
|||
1
sis/incompatible_openc.txt
Normal file
1
sis/incompatible_openc.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
OpenC version 1.5 or later is required for installation.
|
||||
12
sis/re3.pkg
12
sis/re3.pkg
|
|
@ -1,11 +1,21 @@
|
|||
#{"GTA III"},(0xe0d67647),1,0,0
|
||||
|
||||
[0x101F7961], 0, 0, 0, {"S60ProductID"}
|
||||
[0x1028315F], 0, 0, 0, {"S60ProductID"}
|
||||
[0x20022E6D], 0, 0, 0, {"S60ProductID"}
|
||||
|
||||
%{"nnproject"}
|
||||
:"nnproject"
|
||||
|
||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe"
|
||||
IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) ; old or missing openc
|
||||
"incompatible_openc.txt"-"", FT, FORCEABORT
|
||||
ENDIF
|
||||
|
||||
IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll")
|
||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles2.exe"-"!:\sys\bin\re3.exe"
|
||||
ELSE
|
||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
||||
ENDIF
|
||||
"$(EPOCROOT)\epoc32\data\z\private\10003a3f\import\apps\re3_reg.rsc" - "!:\private\10003a3f\import\apps\re3_reg.rsc"
|
||||
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3.rsc" - "!:\resource\apps\re3.rsc"
|
||||
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif"
|
||||
|
|
|
|||
|
|
@ -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,7 +219,7 @@ public:
|
|||
void ResetSettingOrder (e_ControllerAction action);
|
||||
};
|
||||
|
||||
#ifndef RW_GL3
|
||||
#if !defined RW_GL3 && !defined RW_GLES1
|
||||
VALIDATE_SIZE(CControllerConfigManager, 0x143C);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,8 +9,11 @@
|
|||
#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>
|
||||
|
||||
|
|
@ -356,13 +359,17 @@ public:
|
|||
EGL_SAMPLES, 0,
|
||||
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
#ifdef SYMBIAN3
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
#endif
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
eglInitialize(eglDisplay, NULL, NULL);
|
||||
#ifdef SYMBIAN3
|
||||
eglBindAPI(EGL_OPENGL_ES_API);
|
||||
#endif
|
||||
|
||||
EGLint numConfigs;
|
||||
eglChooseConfig(eglDisplay, attribs, &eglConfig, 1, &numConfigs);
|
||||
|
|
|
|||
1
vendor/librw/rw.h
vendored
1
vendor/librw/rw.h
vendored
|
|
@ -25,3 +25,4 @@
|
|||
#include "src/gl/rwgl3.h"
|
||||
#include "src/gl/rwgl3shader.h"
|
||||
#include "src/gl/rwgl3plg.h"
|
||||
#include "src/gles1/rwgles1.h"
|
||||
|
|
|
|||
2
vendor/librw/src/base.cpp
vendored
2
vendor/librw/src/base.cpp
vendored
|
|
@ -32,6 +32,8 @@ int32 build = 0xFFFF;
|
|||
int32 platform = PLATFORM_WDGL;
|
||||
#elif RW_GL3
|
||||
int32 platform = PLATFORM_GL3;
|
||||
#elif RW_GLES1
|
||||
int32 platform = PLATFORM_GLES1;
|
||||
#elif RW_D3D9
|
||||
int32 platform = PLATFORM_D3D9;
|
||||
#else
|
||||
|
|
|
|||
1
vendor/librw/src/charset.cpp
vendored
1
vendor/librw/src/charset.cpp
vendored
|
|
@ -12,6 +12,7 @@
|
|||
#include "ps2/rwps2.h"
|
||||
#include "d3d/rwd3d.h"
|
||||
#include "gl/rwgl3.h"
|
||||
#include "gles1/rwgles1.h"
|
||||
|
||||
|
||||
#define PLUGIN_ID 1000 // TODO: find a better ID
|
||||
|
|
|
|||
3
vendor/librw/src/engine.cpp
vendored
3
vendor/librw/src/engine.cpp
vendored
|
|
@ -17,6 +17,7 @@
|
|||
#include "d3d/rwd3d9.h"
|
||||
#include "gl/rwgl3.h"
|
||||
#include "gl/rwwdgl.h"
|
||||
#include "gles1/rwgles1.h"
|
||||
|
||||
#define PLUGIN_ID 0
|
||||
|
||||
|
|
@ -268,6 +269,8 @@ Engine::open(EngineOpenParams *p)
|
|||
engine->device = ps2::renderdevice;
|
||||
#elif RW_GL3
|
||||
engine->device = gl3::renderdevice;
|
||||
//#elif RW_GLES1 // TODO
|
||||
// engine->device = gles1::renderdevice;
|
||||
#elif RW_D3D9
|
||||
engine->device = d3d::renderdevice;
|
||||
#else
|
||||
|
|
|
|||
5
vendor/librw/src/geoplg.cpp
vendored
5
vendor/librw/src/geoplg.cpp
vendored
|
|
@ -18,6 +18,7 @@
|
|||
#include "d3d/rwd3d9.h"
|
||||
#include "gl/rwwdgl.h"
|
||||
#include "gl/rwgl3.h"
|
||||
#include "gles1/rwgles1.h"
|
||||
|
||||
#define PLUGIN_ID 2
|
||||
|
||||
|
|
@ -251,6 +252,10 @@ destroyNativeData(void *object, int32 offset, int32 size)
|
|||
return d3d9::destroyNativeData(object, offset, size);
|
||||
if(geometry->instData->platform == PLATFORM_GL3)
|
||||
return gl3::destroyNativeData(object, offset, size);
|
||||
#ifdef RW_GLES1
|
||||
if(geometry->instData->platform == PLATFORM_GLES1)
|
||||
return gles1::destroyNativeData(object, offset, size);
|
||||
#endif
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
|
|||
58
vendor/librw/src/gles1/rwgles1.cpp
vendored
Normal file
58
vendor/librw/src/gles1/rwgles1.cpp
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#include "rwgles1.h"
|
||||
|
||||
#ifdef RW_GLES1
|
||||
|
||||
namespace rw {
|
||||
|
||||
namespace gles1 {
|
||||
|
||||
// --- Funciones dummy (para linkear después) ---
|
||||
|
||||
inline void im2DRenderPrimitive(int, void*, int) {}
|
||||
inline void im2DRenderIndexedPrimitive(int, void*, int, void*, int) {}
|
||||
inline void im3DTransform(void*, int, void*, unsigned int) {}
|
||||
inline void im3DRenderPrimitive(int) {}
|
||||
inline void im3DRenderIndexedPrimitive(int, void*, int) {}
|
||||
inline void im3DEnd(void) {}
|
||||
|
||||
// --- Driver lifecycle ---
|
||||
static void*
|
||||
driverOpen(void* object, int32 offset, int32 size)
|
||||
{
|
||||
// stub: no hace nada
|
||||
return object;
|
||||
}
|
||||
|
||||
static void*
|
||||
driverClose(void* object, int32 offset, int32 size)
|
||||
{
|
||||
// stub: no hace nada
|
||||
return object;
|
||||
}
|
||||
|
||||
// --- Raster ---
|
||||
static void
|
||||
registerNativeRaster(void)
|
||||
{
|
||||
// stub por ahora
|
||||
}
|
||||
|
||||
void
|
||||
registerPlatformPlugins(void)
|
||||
{
|
||||
Driver::registerPlugin(PLATFORM_GLES1, 0, PLATFORM_GLES1,
|
||||
driverOpen, driverClose);
|
||||
registerNativeRaster();
|
||||
}
|
||||
|
||||
void*
|
||||
destroyNativeData(void *object, int32, int32)
|
||||
{
|
||||
//freeInstanceData((Geometry*)object);
|
||||
return object;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
108
vendor/librw/src/gles1/rwgles1.h
vendored
Normal file
108
vendor/librw/src/gles1/rwgles1.h
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../rwbase.h"
|
||||
#include "../rwerror.h"
|
||||
#include "../rwplg.h"
|
||||
#include "../rwpipeline.h"
|
||||
#include "../rwobjects.h"
|
||||
#include "../rwengine.h"
|
||||
|
||||
#ifdef RW_GLES1
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/egl.h>
|
||||
#ifdef __SYMBIAN32__
|
||||
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace rw {
|
||||
|
||||
#ifdef RW_GLES1
|
||||
struct EngineOpenParams
|
||||
{
|
||||
int width, height;
|
||||
const char *windowtitle;
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace gles1 {
|
||||
|
||||
// --- Tipos básicos que charset.cpp y otros esperan ---
|
||||
|
||||
struct Im2DVertex {
|
||||
float x, y, z, w;
|
||||
float camZ;
|
||||
float recipCamZ;
|
||||
unsigned char r, g, b, a;
|
||||
float u, v;
|
||||
|
||||
// --- setters esperados por librw ---
|
||||
|
||||
void setScreenX(float v) { x = v; }
|
||||
void setScreenY(float v) { y = v; }
|
||||
void setScreenZ(float v) { z = v; }
|
||||
|
||||
void setCameraZ(float v) { camZ = v; }
|
||||
void setRecipCameraZ(float v) { recipCamZ = v; }
|
||||
|
||||
void setColor(unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a) {
|
||||
r = _r; g = _g; b = _b; a = _a;
|
||||
}
|
||||
|
||||
void setU(float val, float recipZ) { u = val; }
|
||||
void setV(float val, float recipZ) { v = val; }
|
||||
};
|
||||
|
||||
struct Im3DVertex {
|
||||
float x, y, z;
|
||||
float u, v;
|
||||
uint32 color;
|
||||
|
||||
void setX(float v) { x = v; }
|
||||
void setY(float v) { y = v; }
|
||||
void setZ(float v) { z = v; }
|
||||
|
||||
void setU(float v) { u = v; }
|
||||
void setV(float v) { this->v = v; }
|
||||
|
||||
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) {
|
||||
color = (a<<24) | (r<<16) | (g<<8) | b;
|
||||
}
|
||||
};
|
||||
|
||||
// --- Funciones dummy (para linkear después) ---
|
||||
|
||||
inline void im2DRenderPrimitive(int, void*, int);
|
||||
inline void im2DRenderIndexedPrimitive(int, void*, int, void*, int);
|
||||
inline void im3DTransform(void*, int, void*, unsigned int);
|
||||
inline void im3DRenderPrimitive(int);
|
||||
inline void im3DRenderIndexedPrimitive(int, void*, int);
|
||||
inline void im3DEnd(void);
|
||||
|
||||
// --- Driver lifecycle ---
|
||||
static void*
|
||||
driverOpen(void* object, int32 offset, int32 size);
|
||||
|
||||
static void*
|
||||
driverClose(void* object, int32 offset, int32 size);
|
||||
|
||||
// --- Raster ---
|
||||
static void
|
||||
registerNativeRaster(void);
|
||||
|
||||
void registerPlatformPlugins(void);
|
||||
|
||||
void *destroyNativeData(void *object, int32, int32);
|
||||
|
||||
}
|
||||
}
|
||||
7
vendor/librw/src/rwbase.h
vendored
7
vendor/librw/src/rwbase.h
vendored
|
|
@ -9,6 +9,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
#undef stderr
|
||||
#define stderr stdout
|
||||
#endif
|
||||
|
||||
|
|
@ -46,6 +47,11 @@
|
|||
#define RW_OPENGL
|
||||
#endif
|
||||
|
||||
#ifdef RW_GLES1
|
||||
//#define RW_OPENGL
|
||||
#define RWDEVICE gles1
|
||||
#endif
|
||||
|
||||
namespace rw {
|
||||
|
||||
#ifdef RW_PS2
|
||||
|
|
@ -546,6 +552,7 @@ enum Platform
|
|||
|
||||
PLATFORM_WDGL = 11, // WarDrum OpenGL
|
||||
PLATFORM_GL3 = 12, // my GL3 implementation
|
||||
PLATFORM_GLES1 = 13,
|
||||
|
||||
NUM_PLATFORMS,
|
||||
|
||||
|
|
|
|||
12
vendor/librw/src/texture.cpp
vendored
12
vendor/librw/src/texture.cpp
vendored
|
|
@ -481,6 +481,10 @@ Texture::streamReadNative(Stream *stream)
|
|||
return xbox::readNativeTexture(stream);
|
||||
if(platform == PLATFORM_GL3)
|
||||
return gl3::readNativeTexture(stream);
|
||||
#ifdef RW_GLES1
|
||||
// if(platform == PLATFORM_GLES1) // TODO
|
||||
// return gles1::readNativeTexture(stream);
|
||||
#endif
|
||||
assert(0 && "unsupported platform");
|
||||
return nil;
|
||||
}
|
||||
|
|
@ -498,6 +502,10 @@ Texture::streamWriteNative(Stream *stream)
|
|||
xbox::writeNativeTexture(this, stream);
|
||||
else if(this->raster->platform == PLATFORM_GL3)
|
||||
gl3::writeNativeTexture(this, stream);
|
||||
#ifdef RW_GLES1
|
||||
// else if(this->raster->platform == PLATFORM_GLES1)
|
||||
// gles1::writeNativeTexture(this, stream);
|
||||
#endif
|
||||
else
|
||||
assert(0 && "unsupported platform");
|
||||
}
|
||||
|
|
@ -515,6 +523,10 @@ Texture::streamGetSizeNative(void)
|
|||
return xbox::getSizeNativeTexture(this);
|
||||
if(this->raster->platform == PLATFORM_GL3)
|
||||
return gl3::getSizeNativeTexture(this);
|
||||
#ifdef RW_GLES1
|
||||
// if(this->raster->platform == PLATFORM_GLES1)
|
||||
// return gles1::getSizeNativeTexture(this);
|
||||
#endif
|
||||
assert(0 && "unsupported platform");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue