mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
Compare commits
29 commits
v1.0.0-alp
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
653d313413 | ||
|
|
ad5d8af63b | ||
|
|
78e6740735 | ||
|
|
3bec747ea6 | ||
|
|
7e3f0685a3 | ||
|
|
0f1389bb3e | ||
|
|
4029e8ac5d | ||
|
|
8cdae37d6e | ||
|
|
a3847a9768 | ||
|
|
2829feffad | ||
|
|
fa86cdc880 | ||
|
|
52c4681c0c | ||
|
|
6c644421fd | ||
|
|
dfdd037ed3 | ||
|
|
6992f313a9 | ||
|
|
e3ad2108f1 | ||
|
|
7f9b635431 | ||
|
|
20c7bf7818 | ||
|
|
67cd77edf8 | ||
|
|
4e180c1051 | ||
|
|
0588e8866f | ||
|
|
d49730b827 | ||
|
|
fa4776192b | ||
|
|
124ea7befd | ||
|
|
5f33056f5a | ||
|
|
0d9599fd52 | ||
|
|
e81dbee77a | ||
|
|
baa6d4e1c2 | ||
|
|
85d6e68889 |
42 changed files with 413 additions and 247 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,6 +1,7 @@
|
||||||
.cproject
|
.cproject
|
||||||
.project
|
.project
|
||||||
*.bat
|
*.bat
|
||||||
|
!/printHash.bat
|
||||||
*.sis
|
*.sis
|
||||||
*.sisx
|
*.sisx
|
||||||
*.d
|
*.d
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -1,7 +1,6 @@
|
||||||
# re3-symbian
|
# re3-symbian
|
||||||
|
|
||||||
Work-in-progress port of GTA III for Symbian devices.\
|
Work-in-progress port of GTA III for Symbian devices.
|
||||||
Supports S60 3rd Edition FP1, S60 5th edition Symbian^3 and later.
|
|
||||||
|
|
||||||
Based on re3, uses some code from [Dreamcast](https://gitlab.com/skmp/dca3-game) and [Vita](https://github.com/Rinnegatamante/librw-vita) ports.
|
Based on re3, uses some code from [Dreamcast](https://gitlab.com/skmp/dca3-game) and [Vita](https://github.com/Rinnegatamante/librw-vita) ports.
|
||||||
|
|
||||||
|
|
@ -9,6 +8,13 @@ Based on re3, uses some code from [Dreamcast](https://gitlab.com/skmp/dca3-game)
|
||||||
|
|
||||||
See [TODO.md](/TODO.md) for more details on project state.
|
See [TODO.md](/TODO.md) for more details on project state.
|
||||||
|
|
||||||
|
## Device requirements
|
||||||
|
|
||||||
|
- S60 3rd Edition FP1, S60 5th Edition (non-Nokia), Symbian^3 or later
|
||||||
|
- GPU
|
||||||
|
- 128 MB RAM with at least 50 MB free (won't run on regular 64 MB N95 unless you disable all textures)
|
||||||
|
- Functional E: drive with 400 MB of free space (will be more as it'll start to support audio)
|
||||||
|
|
||||||
Tested devices:
|
Tested devices:
|
||||||
- Belle with BCM2763 (700) - GLES 2.0
|
- Belle with BCM2763 (700) - GLES 2.0
|
||||||
- Anna/Belle with BCM2727 (E7, N8, E6) - GLES 2.0
|
- Anna/Belle with BCM2727 (E7, N8, E6) - GLES 2.0
|
||||||
|
|
|
||||||
17
TODO.md
17
TODO.md
|
|
@ -10,27 +10,32 @@ Common:
|
||||||
- [x] Merge S60v3 and ^3 branches
|
- [x] Merge S60v3 and ^3 branches
|
||||||
- [ ] Simplify geometry
|
- [ ] Simplify geometry
|
||||||
- [ ] Move map to top left corner
|
- [ ] Move map to top left corner
|
||||||
- [ ] Do something with sprites, they're still taking too much frame time
|
- [ ] Too many draw calls
|
||||||
- [ ] Audio
|
- [ ] Audio
|
||||||
|
|
||||||
GLES 2.0 specific:
|
GLES 2.0 specific:
|
||||||
- [x] Optimize to always run 10+ fps
|
- [x] Optimize to always run 10+ fps
|
||||||
- [x] Fix skinning shader (cutscene heads require it)
|
- [x] Fix skinning shader (cutscene heads require it)
|
||||||
|
- [x] Fix face animations in optimized builds
|
||||||
|
- [x] Disappearing background in cutscenes
|
||||||
|
- [x] Huge lag spikes on VC4
|
||||||
|
- [x] Skinning shader is still broken on VC4
|
||||||
- [ ] Optimize to always run 20+ fps
|
- [ ] Optimize to always run 20+ fps
|
||||||
- [ ] Use etc1 compression
|
- [ ] Use etc1 compression
|
||||||
- [ ] Fix face animations in optimized builds
|
- [ ] HUD still disappearing sometimes on VC3
|
||||||
- [ ] Skinning shader is still broken on VC4
|
- [ ] Effects are slowing the render on VC4
|
||||||
- [ ] Disappearing background in cutscenes
|
|
||||||
|
|
||||||
GLES 1.1 specific:
|
GLES 1.1 specific:
|
||||||
- [x] Backport to STLport v4
|
- [x] Backport to STLport v4
|
||||||
- [x] GLES 1.1 engine
|
- [x] GLES 1.1 engine
|
||||||
- [x] Keyboard mappings for both QWERTY/12-keys
|
- [x] Keyboard mappings for both QWERTY/12-keys
|
||||||
|
- [x] Fix cutscene heads
|
||||||
- [ ] Use pvrtc compression
|
- [ ] Use pvrtc compression
|
||||||
- [ ] Optimize to always run 10+ fps
|
- [ ] Optimize to always run 10+ fps
|
||||||
|
- [ ] Fix z-buffer issues (world clips through hud)
|
||||||
|
- [ ] Fix lighting
|
||||||
|
|
||||||
Issues:
|
Issues:
|
||||||
- [x] Fix crash in Texture::destroy on exit
|
- [ ] Fix crash in Texture::destroy on exit
|
||||||
- [x] Save menu is too slow
|
- [x] Save menu is too slow
|
||||||
- [x] HUD disappearing on GLES 2.0 (mostly fixed, was caused by OOM)
|
|
||||||
- [x] Crash when picking up a bat
|
- [x] Crash when picking up a bat
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ SRCDBG
|
||||||
|
|
||||||
OPTION ARMCC --gnu -Otime --diag_suppress 1,68,111,174,381,1293
|
OPTION ARMCC --gnu -Otime --diag_suppress 1,68,111,174,381,1293
|
||||||
OPTION_REPLACE ARMCC --cpu 6
|
OPTION_REPLACE ARMCC --cpu 6
|
||||||
OPTION_REPLACE ARMCC --fpu softvfp+vfpv2 --fpmode fast
|
OPTION_REPLACE ARMCC --fpu vfpv2 --fpmode fast
|
||||||
|
// too dangerous!
|
||||||
OPTION_REPLACE ARMCC -O2 -O3
|
OPTION_REPLACE ARMCC -O2 -O3
|
||||||
#ifdef ARMCC
|
#ifdef ARMCC
|
||||||
ALWAYS_BUILD_AS_ARM
|
ALWAYS_BUILD_AS_ARM
|
||||||
|
|
@ -32,5 +33,5 @@ MACRO RW_OPENGL
|
||||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport
|
SYSTEMINCLUDE /epoc32/include/stdapis/stlport
|
||||||
SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl
|
SYSTEMINCLUDE /epoc32/include/stdapis/stlport/stl
|
||||||
MACRO RW_GLES1
|
MACRO RW_GLES1
|
||||||
MACRO S60V5
|
MACRO S60V3
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,4 @@ SOURCEPATH ../vendor/librw/src/ps2
|
||||||
SOURCE pds.cpp ps2.cpp ps2device.cpp ps2matfx.cpp ps2raster.cpp ps2skin.cpp
|
SOURCE pds.cpp ps2.cpp ps2device.cpp ps2matfx.cpp ps2raster.cpp ps2skin.cpp
|
||||||
SOURCEPATH ../vendor/librw/src
|
SOURCEPATH ../vendor/librw/src
|
||||||
SOURCE raster.cpp render.cpp skin.cpp texture.cpp tga.cpp tristrip.cpp userdata.cpp uvanim.cpp world.cpp
|
SOURCE raster.cpp render.cpp skin.cpp texture.cpp tga.cpp tristrip.cpp userdata.cpp uvanim.cpp world.cpp
|
||||||
SOURCE assert.cpp
|
SOURCE assert.cpp printf_stub.c
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#undef SYMBIAN3
|
#undef SYMBIAN3
|
||||||
#define S60V3
|
|
||||||
TARGET librw_gles1.lib
|
TARGET librw_gles1.lib
|
||||||
#include "librw.mmh"
|
#include "librw.mmh"
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#undef S60V3
|
|
||||||
#define SYMBIAN_3
|
#define SYMBIAN_3
|
||||||
TARGET librw_gles2.lib
|
TARGET librw_gles2.lib
|
||||||
#include "librw.mmh"
|
#include "librw.mmh"
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#undef SYMBIAN_3
|
#undef SYMBIAN_3
|
||||||
#define S60V3
|
|
||||||
//TARGET re3_gles1.exe
|
//TARGET re3_gles1.exe
|
||||||
TARGET re3_gles1.exe
|
TARGET re3_gles1.exe
|
||||||
LIBRARY libstdcpp.lib
|
LIBRARY libstdcpp.lib
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#undef S60V3
|
|
||||||
#define SYMBIAN_3
|
#define SYMBIAN_3
|
||||||
TARGET re3.exe
|
TARGET re3.exe
|
||||||
LIBRARY libstdcppv5.lib
|
LIBRARY libstdcppv5.lib
|
||||||
|
|
@ -6,5 +5,6 @@ LIBRARY libglesv2.lib
|
||||||
LIBRARY libegl.lib
|
LIBRARY libegl.lib
|
||||||
LIBRARY platformver.lib
|
LIBRARY platformver.lib
|
||||||
STATICLIBRARY librw_gles2.lib
|
STATICLIBRARY librw_gles2.lib
|
||||||
ARMFPU softvfp+vfpv2
|
ARMFPU vfpv2
|
||||||
|
SMPSAFE
|
||||||
#include "re3.mmh"
|
#include "re3.mmh"
|
||||||
26
printHash.bat
Normal file
26
printHash.bat
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
REM creates version.h with HEAD commit hash
|
||||||
|
REM params: $1=full path to output file (usually points version.h)
|
||||||
|
|
||||||
|
setlocal enableextensions enabledelayedexpansion
|
||||||
|
|
||||||
|
cd /d "%~dp0"
|
||||||
|
|
||||||
|
break> %1
|
||||||
|
|
||||||
|
<nul set /p=^"#define GIT_SHA1 ^"^"> %1
|
||||||
|
|
||||||
|
where git
|
||||||
|
if "%errorlevel%" == "0" ( goto :havegit ) else ( goto :writeending )
|
||||||
|
|
||||||
|
:havegit
|
||||||
|
for /f %%v in ('git rev-parse --short HEAD') do set version=%%v
|
||||||
|
<nul set /p="%version%" >> %1
|
||||||
|
|
||||||
|
:writeending
|
||||||
|
|
||||||
|
echo ^" >> %1
|
||||||
|
echo const char* g_GIT_SHA1 = GIT_SHA1; >> %1
|
||||||
|
|
||||||
|
EXIT /B
|
||||||
14
printHash.sh
Normal file
14
printHash.sh
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
if [ -z "${1}" ]
|
||||||
|
then
|
||||||
|
printf "%s\n" "Input the path to the file for writing the commit hash to."
|
||||||
|
else
|
||||||
|
printf "%s" "#define GIT_SHA1 \"" > $1
|
||||||
|
|
||||||
|
if (command -v "git" >/dev/null) then
|
||||||
|
git rev-parse --short HEAD | tr -d '\n' >> $1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "%s\n" "\"" >> $1
|
||||||
|
printf "%s\n" "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
|
||||||
|
fi
|
||||||
|
|
@ -1,22 +1,26 @@
|
||||||
#{"GTA III"},(0xe0d67647),1,0,0
|
#{"GTA III"},(0xe0d67647),1,0,3
|
||||||
|
|
||||||
[0x101F7961], 0, 0, 0, {"S60ProductID"}
|
[0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3
|
||||||
[0x1028315F], 0, 0, 0, {"S60ProductID"}
|
[0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1
|
||||||
[0x20022E6D], 0, 0, 0, {"S60ProductID"}
|
[0x20022E6D], 0, 0, 0, {"S60ProductID"} ; ^3
|
||||||
|
|
||||||
%{"nnproject"}
|
%{"nnproject"}
|
||||||
:"nnproject"
|
:"nnproject"
|
||||||
|
|
||||||
;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.exe"-"!:\sys\bin\re3.exe"
|
|
||||||
;ELSE
|
|
||||||
; "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
|
||||||
;ENDIF
|
|
||||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
||||||
"$(EPOCROOT)\epoc32\data\z\private\10003a3f\import\apps\re3_reg.rsc" - "!:\private\10003a3f\import\apps\re3_reg.rsc"
|
"$(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.rsc" - "!:\resource\apps\re3.rsc"
|
||||||
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif"
|
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif"
|
||||||
|
|
||||||
|
"..\gamefiles\data\PARTICLE.CFG" - "E:\data\gta3\data\PARTICLE.CFG"
|
||||||
|
"..\gamefiles\models\fonts_j.txd" - "E:\data\gta3\models\fonts_j.txd"
|
||||||
|
"..\gamefiles\models\fonts_p.txd" - "E:\data\gta3\models\fonts_p.txd"
|
||||||
|
"..\gamefiles\models\fonts_r.txd" - "E:\data\gta3\models\fonts_r.txd"
|
||||||
|
"..\gamefiles\TEXT\american.gxt" - "E:\data\gta3\TEXT\american.gxt"
|
||||||
|
"..\gamefiles\TEXT\english.gxt" - "E:\data\gta3\TEXT\english.gxt"
|
||||||
|
"..\gamefiles\TEXT\french.gxt" - "E:\data\gta3\TEXT\french.gxt"
|
||||||
|
"..\gamefiles\TEXT\german.gxt" - "E:\data\gta3\TEXT\german.gxt"
|
||||||
|
"..\gamefiles\TEXT\italian.gxt" - "E:\data\gta3\TEXT\italian.gxt"
|
||||||
|
"..\gamefiles\TEXT\JAPANESE.gxt" - "E:\data\gta3\TEXT\JAPANESE.gxt"
|
||||||
|
"..\gamefiles\TEXT\polish.gxt" - "E:\data\gta3\TEXT\polish.gxt"
|
||||||
|
"..\gamefiles\TEXT\spanish.gxt" - "E:\data\gta3\TEXT\spanish.gxt"
|
||||||
|
|
|
||||||
28
sis/re3.pkg
28
sis/re3.pkg
|
|
@ -1,22 +1,34 @@
|
||||||
#{"GTA III"},(0xe0d67647),1,0,0
|
#{"GTA III"},(0xe0d67647),1,0,3
|
||||||
|
|
||||||
[0x101F7961], 0, 0, 0, {"S60ProductID"}
|
[0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3
|
||||||
[0x1028315F], 0, 0, 0, {"S60ProductID"}
|
[0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1
|
||||||
[0x20022E6D], 0, 0, 0, {"S60ProductID"}
|
[0x20022E6D], 0, 0, 0, {"S60ProductID"} ; ^3
|
||||||
|
|
||||||
%{"nnproject"}
|
%{"nnproject"}
|
||||||
:"nnproject"
|
:"nnproject"
|
||||||
|
|
||||||
IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) ; old or missing openc
|
IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) OR (NOT package(0x10282872)) ; old or missing openc
|
||||||
"incompatible_openc.txt"-"", FT, FORCEABORT
|
"incompatible_openc.txt"-"", FT, FORCEABORT
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll")
|
IF exists("z:\system\install\Series60v5.2.sis") AND exists("z:\sys\bin\libGLESv2.dll") ; ^3
|
||||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe"
|
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe"
|
||||||
ELSE
|
ELSE ; everything else
|
||||||
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3_gles1.exe"-"!:\sys\bin\re3.exe"
|
||||||
ENDIF
|
ENDIF
|
||||||
;"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\re3.exe"-"!:\sys\bin\re3.exe"
|
|
||||||
"$(EPOCROOT)\epoc32\data\z\private\10003a3f\import\apps\re3_reg.rsc" - "!:\private\10003a3f\import\apps\re3_reg.rsc"
|
"$(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.rsc" - "!:\resource\apps\re3.rsc"
|
||||||
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif"
|
"$(EPOCROOT)\epoc32\data\z\resource\apps\re3_icon.mif" - "!:\resource\apps\re3_icon.mif"
|
||||||
|
|
||||||
|
"..\gamefiles\data\PARTICLE.CFG" - "E:\data\gta3\data\PARTICLE.CFG"
|
||||||
|
"..\gamefiles\models\fonts_j.txd" - "E:\data\gta3\models\fonts_j.txd"
|
||||||
|
"..\gamefiles\models\fonts_p.txd" - "E:\data\gta3\models\fonts_p.txd"
|
||||||
|
"..\gamefiles\models\fonts_r.txd" - "E:\data\gta3\models\fonts_r.txd"
|
||||||
|
"..\gamefiles\TEXT\american.gxt" - "E:\data\gta3\TEXT\american.gxt"
|
||||||
|
"..\gamefiles\TEXT\english.gxt" - "E:\data\gta3\TEXT\english.gxt"
|
||||||
|
"..\gamefiles\TEXT\french.gxt" - "E:\data\gta3\TEXT\french.gxt"
|
||||||
|
"..\gamefiles\TEXT\german.gxt" - "E:\data\gta3\TEXT\german.gxt"
|
||||||
|
"..\gamefiles\TEXT\italian.gxt" - "E:\data\gta3\TEXT\italian.gxt"
|
||||||
|
"..\gamefiles\TEXT\JAPANESE.gxt" - "E:\data\gta3\TEXT\JAPANESE.gxt"
|
||||||
|
"..\gamefiles\TEXT\polish.gxt" - "E:\data\gta3\TEXT\polish.gxt"
|
||||||
|
"..\gamefiles\TEXT\spanish.gxt" - "E:\data\gta3\TEXT\spanish.gxt"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
* Arrays grouping together all the EAX presets in a scenario *
|
* Arrays grouping together all the EAX presets in a scenario *
|
||||||
* *
|
* *
|
||||||
************************************************************************************************/
|
************************************************************************************************/
|
||||||
|
#if 0
|
||||||
#include "eax-util.h"
|
#include "eax-util.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
@ -704,3 +704,4 @@ EAXLISTENERPROPERTIES EAX30_MISC_PRESETS[] =
|
||||||
EAX30_PRESET_SMALLWATERROOM
|
EAX30_PRESET_SMALLWATERROOM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
* *
|
* *
|
||||||
\*******************************************************************/
|
\*******************************************************************/
|
||||||
|
|
||||||
#ifndef EAXUTIL_INCLUDED
|
#if !defined EAXUTIL_INCLUDED && 0
|
||||||
#define EAXUTIL_INCLUDED
|
#define EAXUTIL_INCLUDED
|
||||||
|
|
||||||
#include <eax.h>
|
#include <eax.h>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* *
|
* *
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef EAX_H_INCLUDED
|
#if !defined EAX_H_INCLUDED && 0
|
||||||
#define EAX_H_INCLUDED
|
#define EAX_H_INCLUDED
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef AUDIO_OAL
|
||||||
|
#undef AUDIO_OAL
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AUDIO_OAL
|
#ifdef AUDIO_OAL
|
||||||
#include "eax.h"
|
#include "eax.h"
|
||||||
#include "AL/efx.h"
|
#include "AL/efx.h"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//#define JUICY_OAL
|
//#define JUICY_OAL
|
||||||
|
|
||||||
#ifdef AUDIO_OAL
|
#if defined AUDIO_OAL && 0
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "eax.h"
|
#include "eax.h"
|
||||||
|
|
|
||||||
|
|
@ -3689,6 +3689,7 @@ const char* controllerTypesPaths[] = {
|
||||||
void
|
void
|
||||||
CMenuManager::LoadController(int8 type)
|
CMenuManager::LoadController(int8 type)
|
||||||
{
|
{
|
||||||
|
#ifdef BUTTON_ICONS
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case CONTROLLER_DUALSHOCK2:
|
case CONTROLLER_DUALSHOCK2:
|
||||||
|
|
@ -3703,7 +3704,8 @@ CMenuManager::LoadController(int8 type)
|
||||||
CFont::LoadButtons("MODELS/X360BTNS.TXD");
|
CFont::LoadButtons("MODELS/X360BTNS.TXD");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Unload current textures
|
// Unload current textures
|
||||||
for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++)
|
for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++)
|
||||||
m_aFrontEndSprites[i].Delete();
|
m_aFrontEndSprites[i].Delete();
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,6 @@ int32 islandLODcomSub;
|
||||||
int32 islandLODsubInd;
|
int32 islandLODsubInd;
|
||||||
int32 islandLODsubCom;
|
int32 islandLODsubCom;
|
||||||
|
|
||||||
#define STREAMING_MEM_SIZE (10 * 1024 * 1024)
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CStreamingInfo::GetCdPosnAndSize(uint32 &posn, uint32 &size)
|
CStreamingInfo::GetCdPosnAndSize(uint32 &posn, uint32 &size)
|
||||||
{
|
{
|
||||||
|
|
@ -221,15 +219,14 @@ CStreaming::Init2(void)
|
||||||
#ifdef GTA_PC
|
#ifdef GTA_PC
|
||||||
#define MB (1024*1024)
|
#define MB (1024*1024)
|
||||||
#ifdef __SYMBIAN32__
|
#ifdef __SYMBIAN32__
|
||||||
extern bool moreVram;
|
extern size_t streamingMemSize;
|
||||||
if (moreVram) {
|
ms_memoryAvailable = streamingMemSize;
|
||||||
|
#else
|
||||||
extern size_t _dwMemAvailPhys;
|
extern size_t _dwMemAvailPhys;
|
||||||
ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2;
|
ms_memoryAvailable = (_dwMemAvailPhys - 10 * MB) / 2;
|
||||||
if(ms_memoryAvailable < 10*MB)
|
if (ms_memoryAvailable < 10 * MB)
|
||||||
ms_memoryAvailable = 10*MB;
|
ms_memoryAvailable = 10 * MB;
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
ms_memoryAvailable = STREAMING_MEM_SIZE;
|
|
||||||
desiredNumVehiclesLoaded = 12;
|
desiredNumVehiclesLoaded = 12;
|
||||||
if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
|
if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
|
||||||
desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
|
desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
|
||||||
|
|
@ -642,7 +639,9 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId)
|
||||||
if(ms_aInfoForModel[streamId].m_loadState != STREAMSTATE_STARTED){
|
if(ms_aInfoForModel[streamId].m_loadState != STREAMSTATE_STARTED){
|
||||||
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED;
|
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED;
|
||||||
#ifndef USE_CUSTOM_ALLOCATOR
|
#ifndef USE_CUSTOM_ALLOCATOR
|
||||||
ms_memoryUsed += ms_aInfoForModel[streamId].GetCdSize() * CDSTREAM_SECTOR_SIZE;
|
if(streamId < STREAM_OFFSET_TXD) {
|
||||||
|
ms_memoryUsed += ms_aInfoForModel[streamId].GetCdSize() * CDSTREAM_SECTOR_SIZE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -708,7 +707,9 @@ CStreaming::FinishLoadingLargeFile(int8 *buf, int32 streamId)
|
||||||
|
|
||||||
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED; // only done if success on PS2
|
ms_aInfoForModel[streamId].m_loadState = STREAMSTATE_LOADED; // only done if success on PS2
|
||||||
#ifndef USE_CUSTOM_ALLOCATOR
|
#ifndef USE_CUSTOM_ALLOCATOR
|
||||||
ms_memoryUsed += ms_aInfoForModel[streamId].GetCdSize() * CDSTREAM_SECTOR_SIZE;
|
if(streamId < STREAM_OFFSET_TXD) {
|
||||||
|
ms_memoryUsed += ms_aInfoForModel[streamId].GetCdSize() * CDSTREAM_SECTOR_SIZE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!success){
|
if(!success){
|
||||||
|
|
@ -954,7 +955,9 @@ CStreaming::RemoveModel(int32 id)
|
||||||
#ifdef USE_CUSTOM_ALLOCATOR
|
#ifdef USE_CUSTOM_ALLOCATOR
|
||||||
UpdateMemoryUsed();
|
UpdateMemoryUsed();
|
||||||
#else
|
#else
|
||||||
ms_memoryUsed -= ms_aInfoForModel[id].GetCdSize()*CDSTREAM_SECTOR_SIZE;
|
if (id < STREAM_OFFSET_TXD) {
|
||||||
|
ms_memoryUsed -= ms_aInfoForModel[id].GetCdSize()*CDSTREAM_SECTOR_SIZE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2696,14 +2699,13 @@ CStreaming::MakeSpaceFor(int32 size)
|
||||||
#define MB (1024 * 1024)
|
#define MB (1024 * 1024)
|
||||||
if(ms_memoryAvailable == 0) {
|
if(ms_memoryAvailable == 0) {
|
||||||
#ifdef __SYMBIAN32__
|
#ifdef __SYMBIAN32__
|
||||||
extern bool moreVram;
|
extern size_t streamingMemSize;
|
||||||
if (moreVram) {
|
ms_memoryAvailable = streamingMemSize;
|
||||||
extern size_t _dwMemAvailPhys;
|
#else
|
||||||
ms_memoryAvailable = (_dwMemAvailPhys - 10 * MB) / 2;
|
extern size_t _dwMemAvailPhys;
|
||||||
if(ms_memoryAvailable < 10 * MB) ms_memoryAvailable = 10 * MB;
|
ms_memoryAvailable = (_dwMemAvailPhys - 10 * MB) / 2;
|
||||||
} else
|
if (ms_memoryAvailable < 10 * MB) ms_memoryAvailable = 10 * MB;
|
||||||
#endif
|
#endif
|
||||||
ms_memoryAvailable = STREAMING_MEM_SIZE;
|
|
||||||
}
|
}
|
||||||
#undef MB
|
#undef MB
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
|
||||||
#if defined __ARMCC_VERSION && !defined _DEBUG
|
#if defined __ARMCC_VERSION && !defined _DEBUG
|
||||||
#pragma O2 // fixes crash
|
// fixes crash
|
||||||
|
#pragma O2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32 CCullZones::NumCullZones;
|
int32 CCullZones::NumCullZones;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
#define LOGS
|
#define LOGS
|
||||||
|
#ifdef __SYMBIAN32__
|
||||||
#define LOGS_RDEBUG
|
#define LOGS_RDEBUG
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIO_OAL
|
||||||
|
#undef AUDIO_OAL
|
||||||
|
#endif
|
||||||
|
|
||||||
// disables (most) stuff that wasn't in original gta3.exe
|
// disables (most) stuff that wasn't in original gta3.exe
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
|
@ -342,7 +350,7 @@ enum Config {
|
||||||
#define ALT_DODO_CHEAT
|
#define ALT_DODO_CHEAT
|
||||||
#define REGISTER_START_BUTTON
|
#define REGISTER_START_BUTTON
|
||||||
#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
|
#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
|
||||||
#define BUTTON_ICONS // use textures to show controller buttons
|
//#define BUTTON_ICONS // use textures to show controller buttons
|
||||||
|
|
||||||
// Hud, frontend and radar
|
// Hud, frontend and radar
|
||||||
//#define PS2_HUD
|
//#define PS2_HUD
|
||||||
|
|
@ -386,9 +394,9 @@ enum Config {
|
||||||
#define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script
|
#define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script
|
||||||
#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely
|
#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely
|
||||||
#ifdef PC_MENU
|
#ifdef PC_MENU
|
||||||
//# define MISSION_REPLAY // mobile feature
|
# define MISSION_REPLAY // mobile feature
|
||||||
#endif
|
#endif
|
||||||
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
|
#define SIMPLIER_MISSIONS // apply simplifications from mobile
|
||||||
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||||
#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log
|
#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log
|
||||||
|
|
||||||
|
|
@ -438,8 +446,8 @@ enum Config {
|
||||||
//#define AUDIO_CACHE
|
//#define AUDIO_CACHE
|
||||||
#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 44 (PC has 28 originally)
|
#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 44 (PC has 28 originally)
|
||||||
#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
|
#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
|
||||||
#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder
|
//#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder
|
||||||
#define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files
|
//#define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files
|
||||||
#define PAUSE_RADIO_IN_FRONTEND // pause radio when game is paused
|
#define PAUSE_RADIO_IN_FRONTEND // pause radio when game is paused
|
||||||
#define ATTACH_RELEASING_SOUNDS_TO_ENTITIES // sounds would follow ped and vehicles coordinates if not being queued otherwise
|
#define ATTACH_RELEASING_SOUNDS_TO_ENTITIES // sounds would follow ped and vehicles coordinates if not being queued otherwise
|
||||||
#define USE_TIME_SCALE_FOR_AUDIO // slow down/speed up sounds according to the speed of the game
|
#define USE_TIME_SCALE_FOR_AUDIO // slow down/speed up sounds according to the speed of the game
|
||||||
|
|
|
||||||
|
|
@ -1403,10 +1403,10 @@ RenderScene(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
PUSH_RENDERGROUP("RenderScene");
|
PUSH_RENDERGROUP("RenderScene");
|
||||||
// CClouds::Render();
|
CClouds::Render();
|
||||||
DoRWRenderHorizon();
|
DoRWRenderHorizon();
|
||||||
CRenderer::RenderRoads();
|
CRenderer::RenderRoads();
|
||||||
// CCoronas::RenderReflections();
|
CCoronas::RenderReflections();
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
CRenderer::RenderEverythingBarRoads();
|
CRenderer::RenderEverythingBarRoads();
|
||||||
CRenderer::RenderBoats();
|
CRenderer::RenderBoats();
|
||||||
|
|
@ -1416,7 +1416,7 @@ RenderScene(void)
|
||||||
#ifndef SQUEEZE_PERFORMANCE
|
#ifndef SQUEEZE_PERFORMANCE
|
||||||
CRenderer::RenderVehiclesButNotBoats();
|
CRenderer::RenderVehiclesButNotBoats();
|
||||||
#endif
|
#endif
|
||||||
// CWeather::RenderRainStreaks();
|
CWeather::RenderRainStreaks();
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1448,17 +1448,21 @@ RenderEffects(void)
|
||||||
CGlass::Render();
|
CGlass::Render();
|
||||||
CWaterCannons::Render();
|
CWaterCannons::Render();
|
||||||
CSpecialFX::Render();
|
CSpecialFX::Render();
|
||||||
// CShadows::RenderStaticShadows();
|
#ifdef RW_GLES1
|
||||||
// CShadows::RenderStoredShadows();
|
CShadows::RenderStaticShadows();
|
||||||
// CSkidmarks::Render();
|
CShadows::RenderStoredShadows();
|
||||||
// CAntennas::Render();
|
CSkidmarks::Render();
|
||||||
// CRubbish::Render();
|
CAntennas::Render();
|
||||||
// CCoronas::Render();
|
CRubbish::Render();
|
||||||
|
CCoronas::Render();
|
||||||
|
#endif
|
||||||
CParticle::Render();
|
CParticle::Render();
|
||||||
CPacManPickups::Render();
|
CPacManPickups::Render();
|
||||||
// CWeaponEffects::Render();
|
#ifdef RW_GLES1
|
||||||
// CPointLights::RenderFogEffect();
|
CWeaponEffects::Render();
|
||||||
// CMovingThings::Render();
|
CPointLights::RenderFogEffect();
|
||||||
|
CMovingThings::Render();
|
||||||
|
#endif
|
||||||
CRenderer::RenderFirstPersonVehicle();
|
CRenderer::RenderFirstPersonVehicle();
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,6 @@ void tbEndTimer(Const char* name)
|
||||||
}
|
}
|
||||||
assert(n != 1500);
|
assert(n != 1500);
|
||||||
TimerBar.Timers[n].endTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerFrame();
|
TimerBar.Timers[n].endTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerFrame();
|
||||||
if (strcmp(name, "EndOfFrame")) {
|
|
||||||
endOfFrameTime = TimerBar.Timers[n].endTime - TimerBar.Timers[n].startTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float Diag_GetFPS()
|
float Diag_GetFPS()
|
||||||
|
|
@ -94,7 +91,9 @@ float Diag_GetFPS()
|
||||||
return 39000.0f / (msCollected[(curMS - 1) % MAX_MS_COLLECTED] - msCollected[curMS % MAX_MS_COLLECTED]);
|
return 39000.0f / (msCollected[(curMS - 1) % MAX_MS_COLLECTED] - msCollected[curMS % MAX_MS_COLLECTED]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LOGS_RDEBUG
|
||||||
extern "C" void RDebug_Printf(const char*, ...);
|
extern "C" void RDebug_Printf(const char*, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
void tbDisplay()
|
void tbDisplay()
|
||||||
{
|
{
|
||||||
|
|
@ -117,6 +116,7 @@ void tbDisplay()
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
sprintf(temp, "FPS: %.2f", Diag_GetFPS());
|
sprintf(temp, "FPS: %.2f", Diag_GetFPS());
|
||||||
if (frames >= 15) {
|
if (frames >= 15) {
|
||||||
|
//#ifdef LOGS_RDEBUG
|
||||||
// RDebug_Printf("FPS: %.2f", Diag_GetFPS());
|
// RDebug_Printf("FPS: %.2f", Diag_GetFPS());
|
||||||
// RDebug_Printf("vbo: %d, draw: %d, render: %d, matfx: %d, skin: %d, im2d: %d, im3d: %d", vboUploads, draw, render, matfx, skin, im2d, im3d);
|
// RDebug_Printf("vbo: %d, draw: %d, render: %d, matfx: %d, skin: %d, im2d: %d, im3d: %d", vboUploads, draw, render, matfx, skin, im2d, im3d);
|
||||||
// for (uint32 i = 0; i < TimerBar.count; i++) {
|
// for (uint32 i = 0; i < TimerBar.count; i++) {
|
||||||
|
|
@ -127,6 +127,7 @@ void tbDisplay()
|
||||||
// RDebug_Printf("EndOfFrame: %.2f", endOfFrameTime);
|
// RDebug_Printf("EndOfFrame: %.2f", endOfFrameTime);
|
||||||
// RDebug_Printf("Frame Time: %.2f", MaxFrameTime);
|
// RDebug_Printf("Frame Time: %.2f", MaxFrameTime);
|
||||||
// RDebug_Printf(" ");
|
// RDebug_Printf(" ");
|
||||||
|
//#endif
|
||||||
frames = 0;
|
frames = 0;
|
||||||
} else frames++;
|
} else frames++;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,12 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const RwV3d *in,
|
||||||
": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
|
": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
|
||||||
#else
|
#else
|
||||||
while(n--){
|
while(n--){
|
||||||
|
#ifdef S60V3
|
||||||
|
const RwV3d i = *in;
|
||||||
|
*out = mat * i;
|
||||||
|
#else
|
||||||
*out = mat * *in;
|
*out = mat * *in;
|
||||||
|
#endif
|
||||||
in = (RwV3d*)((uint8*)in + stride);
|
in = (RwV3d*)((uint8*)in + stride);
|
||||||
out++;
|
out++;
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +115,12 @@ void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector
|
||||||
": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
|
": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
|
||||||
#else
|
#else
|
||||||
while(n--){
|
while(n--){
|
||||||
|
#ifdef S60V3
|
||||||
|
const RwV3d i = *in;
|
||||||
|
*out = mat * i;
|
||||||
|
#else
|
||||||
*out = mat * *in;
|
*out = mat * *in;
|
||||||
|
#endif
|
||||||
in++;
|
in++;
|
||||||
out++;
|
out++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#if defined __ARMCC_VERSION && !defined _DEBUG
|
#if defined __ARMCC_VERSION && !defined _DEBUG
|
||||||
#pragma O2 // fixes crash
|
// fixes crash
|
||||||
|
#pragma O2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
|
||||||
|
|
@ -1325,6 +1325,7 @@ void CHud::DrawAfterFade()
|
||||||
if (touch) {
|
if (touch) {
|
||||||
// FIXME
|
// FIXME
|
||||||
int w = 640;
|
int w = 640;
|
||||||
|
int h = 360;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
{
|
{
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
|
|
@ -1349,11 +1350,30 @@ void CHud::DrawAfterFade()
|
||||||
CSprite2d::DrawRect(CRECT(w - 180 - 90, 6 + y, 90, 20), CRGBA(0, 0, 0, 128));
|
CSprite2d::DrawRect(CRECT(w - 180 - 90, 6 + y, 90, 20), CRGBA(0, 0, 0, 128));
|
||||||
PRINT("R2", w - 180 - 90, 12 + y, 90);
|
PRINT("R2", w - 180 - 90, 12 + y, 90);
|
||||||
|
|
||||||
// select, start
|
int cy = (h * 2) / 5;
|
||||||
CSprite2d::DrawRect(CRECT(320 - 80, 286 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
int b = 14; //(40 - 12) / 2;
|
||||||
PRINT("select", 320 - 80, 290 + y, 60);
|
|
||||||
CSprite2d::DrawRect(CRECT(320 + 20, 286 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
// dpad
|
||||||
PRINT("start", 320 + 20, 290 + y, 60);
|
int cx = w / 8;
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 20, cy - 60, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("\"", cx - 15, cy - 60 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 20, cy + 30, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("v", cx - 15, cy + 30 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 75, cy - 20, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("<", cx - 75 + 8, cy - 20 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx + 35, cy - 20, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT(">", cx + 35 + 10, cy - 20 + b, 30);
|
||||||
|
|
||||||
|
// abxy
|
||||||
|
cx = w - w / 8;
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 20, cy - 60, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("\"", cx - 15, cy - 60 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 20, cy + 30, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("X", cx - 15, cy + 30 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx - 75, cy - 20, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("[]", cx - 75 + 12, cy - 20 + b, 30);
|
||||||
|
CSprite2d::DrawRect(CRECT(cx + 35, cy - 20, 40, 40), CRGBA(0, 0, 0, 128));
|
||||||
|
PRINT("|", cx + 35 + 10, cy - 20 + b, 30);
|
||||||
|
|
||||||
// l3, r3
|
// l3, r3
|
||||||
CSprite2d::DrawRect(CRECT(320 - 80, 254 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
CSprite2d::DrawRect(CRECT(320 - 80, 254 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
||||||
|
|
@ -1361,19 +1381,13 @@ void CHud::DrawAfterFade()
|
||||||
CSprite2d::DrawRect(CRECT(320 + 20, 254 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
CSprite2d::DrawRect(CRECT(320 + 20, 254 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
||||||
PRINT("R3", 320 + 20, 258 + y, 60);
|
PRINT("R3", 320 + 20, 258 + y, 60);
|
||||||
|
|
||||||
// dpad
|
CFont::SetScale(0.65f, 0.65f);
|
||||||
CSprite2d::DrawRect(CRECT(0, 80 + y, w / 4, 120), CRGBA(0, 0, 0, 128));
|
|
||||||
PRINT("\"", w / 8 - 15, 90 + y, 30);
|
|
||||||
PRINT("v", w / 8 - 15, 160 + y, 30);
|
|
||||||
PRINT("<", w / 8 - 60, 125 + y, 30);
|
|
||||||
PRINT(">", w / 8 + 30, 125 + y, 30);
|
|
||||||
|
|
||||||
// abxy
|
// select, start
|
||||||
CSprite2d::DrawRect(CRECT(w - w / 4, 80 + y, w / 4, 120), CRGBA(0, 0, 0, 128));
|
CSprite2d::DrawRect(CRECT(320 - 80, 286 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
||||||
PRINT("\"", w - w / 8 - 15, 90 + y, 30);
|
PRINT("SELECT", 320 - 80, 290 + y, 60);
|
||||||
PRINT("X", w - w / 8 - 15, 160 + y, 30);
|
CSprite2d::DrawRect(CRECT(320 + 20, 286 + y, 60, 20), CRGBA(0, 0, 0, 128));
|
||||||
PRINT("[]", w - w / 8 - 60, 125 + y, 30);
|
PRINT("START", 320 + 20, 290 + y, 60);
|
||||||
PRINT("|", w - w / 8 + 30, 125 + y, 30);
|
|
||||||
#undef PRINT
|
#undef PRINT
|
||||||
#undef CRECT
|
#undef CRECT
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,10 +137,10 @@ void
|
||||||
CSpecialFX::Render(void)
|
CSpecialFX::Render(void)
|
||||||
{
|
{
|
||||||
PUSH_RENDERGROUP("CSpecialFX::Render");
|
PUSH_RENDERGROUP("CSpecialFX::Render");
|
||||||
// CMotionBlurStreaks::Render();
|
CMotionBlurStreaks::Render();
|
||||||
// CBulletTraces::Render();
|
CBulletTraces::Render();
|
||||||
// CBrightLights::Render();
|
CBrightLights::Render();
|
||||||
// CShinyTexts::Render();
|
CShinyTexts::Render();
|
||||||
CMoneyMessages::Render();
|
CMoneyMessages::Render();
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
if(!(gbNewRenderer && FredIsInFirstPersonCam()))
|
if(!(gbNewRenderer && FredIsInFirstPersonCam()))
|
||||||
|
|
|
||||||
|
|
@ -95,67 +95,69 @@ static int clamp(int size, int targetSize)
|
||||||
|
|
||||||
static void halveTexture(RwTexture *texture){
|
static void halveTexture(RwTexture *texture){
|
||||||
if(texture == nil)
|
if(texture == nil)
|
||||||
return;
|
return;
|
||||||
|
debug("halving %s", texture->name);
|
||||||
|
|
||||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||||
if(oldRaster == nil)
|
if(oldRaster == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int oldWidth = RwRasterGetWidth(oldRaster);
|
int oldWidth = RwRasterGetWidth(oldRaster);
|
||||||
int oldHeight = RwRasterGetHeight(oldRaster);
|
int oldHeight = RwRasterGetHeight(oldRaster);
|
||||||
|
|
||||||
// dividir a la mitad, mínimo 16x16
|
// dividir a la mitad, mínimo 16x16
|
||||||
int newWidth = oldWidth > 16 ? oldWidth / 2 : oldWidth;
|
int newWidth = oldWidth > 16 ? oldWidth / 2 : oldWidth;
|
||||||
int newHeight = oldHeight > 16 ? oldHeight / 2 : oldHeight;
|
int newHeight = oldHeight > 16 ? oldHeight / 2 : oldHeight;
|
||||||
|
|
||||||
// si ya es suficientemente chica, no hacer nada
|
// si ya es suficientemente chica, no hacer nada
|
||||||
if(newWidth == oldWidth && newHeight == oldHeight)
|
if(newWidth == oldWidth && newHeight == oldHeight)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// toImage() funciona porque el backingStore está populado
|
// toImage() funciona porque el backingStore está populado
|
||||||
RwImage *image = oldRaster->toImage();
|
RwImage *image = oldRaster->toImage();
|
||||||
if(image == nil){
|
if(image == nil){
|
||||||
debug("downscaleTexture: toImage FAILED for %dx%d", oldWidth, oldHeight);
|
debug("downscaleTexture: toImage FAILED for %dx%d", oldWidth, oldHeight);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
RwImage *resized = resizeImage(image, newWidth, newHeight);
|
||||||
RwImageDestroy(image);
|
RwImageDestroy(image);
|
||||||
if(resized == nil){
|
if(resized == nil){
|
||||||
debug("downscaleTexture: resizeImage FAILED");
|
debug("downscaleTexture: resizeImage FAILED");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// crear nuevo raster en formato compatible con GLES1
|
// crear nuevo raster en formato compatible con GLES1
|
||||||
int32 w, h, d, f;
|
int32 w, h, d, f;
|
||||||
rw::Raster::imageFindRasterFormat(resized, rw::Raster::TEXTURE, &w, &h, &d, &f);
|
rw::Raster::imageFindRasterFormat(resized, rw::Raster::TEXTURE, &w, &h, &d, &f);
|
||||||
#ifdef RW_GLES1
|
#ifdef RW_GLES1
|
||||||
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GLES1);
|
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GLES1);
|
||||||
#else
|
#else
|
||||||
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GL3);
|
RwRaster *newRaster = rw::Raster::create(w, h, d, f | rw::Raster::TEXTURE, rw::PLATFORM_GL3);
|
||||||
#endif
|
#endif
|
||||||
if(newRaster == nil){
|
if(newRaster == nil){
|
||||||
debug("downscaleTexture: raster create FAILED");
|
debug("downscaleTexture: raster create FAILED");
|
||||||
RwImageDestroy(resized);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newRaster->setFromImage(resized) == nil){
|
|
||||||
debug("downscaleTexture: setFromImage FAILED");
|
|
||||||
RwRasterDestroy(newRaster);
|
|
||||||
RwImageDestroy(resized);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RwImageDestroy(resized);
|
RwImageDestroy(resized);
|
||||||
RwTextureSetRaster(texture, newRaster);
|
return;
|
||||||
RwRasterDestroy(oldRaster);
|
}
|
||||||
|
|
||||||
|
if(newRaster->setFromImage(resized) == nil){
|
||||||
|
debug("downscaleTexture: setFromImage FAILED");
|
||||||
|
RwRasterDestroy(newRaster);
|
||||||
|
RwImageDestroy(resized);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RwImageDestroy(resized);
|
||||||
|
RwTextureSetRaster(texture, newRaster);
|
||||||
|
RwRasterDestroy(oldRaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void downscaleTexture(RwTexture *texture) {
|
static void downscaleTexture(RwTexture *texture) {
|
||||||
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
RwRaster *oldRaster = RwTextureGetRaster(texture);
|
||||||
if (oldRaster == nil)
|
if (oldRaster == nil)
|
||||||
return;
|
return;
|
||||||
|
debug("downscaling %s", texture->name);
|
||||||
|
|
||||||
extern bool moreVram;
|
extern bool moreVram;
|
||||||
int targetSize = moreVram ? 64 : 32;
|
int targetSize = moreVram ? 64 : 32;
|
||||||
|
|
@ -207,12 +209,14 @@ RwTextureGtaStreamRead(RwStream *stream)
|
||||||
if (gGameState == GS_INIT_PLAYING_GAME) {
|
if (gGameState == GS_INIT_PLAYING_GAME) {
|
||||||
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
||||||
texNumLoaded++;
|
texNumLoaded++;
|
||||||
} else if (gGameState != GS_PLAYING_GAME || FrontEndMenuManager.m_bMenuActive) {
|
}
|
||||||
|
#ifdef __SYMBIAN32__
|
||||||
|
else if (gGameState != GS_PLAYING_GAME || FrontEndMenuManager.m_bMenuActive) {
|
||||||
if (tex != nil && tex->raster != nil && (RwRasterGetWidth(tex->raster) > 128 || RwRasterGetHeight(tex->raster) > 128)) {
|
if (tex != nil && tex->raster != nil && (RwRasterGetWidth(tex->raster) > 128 || RwRasterGetHeight(tex->raster) > 128)) {
|
||||||
// debug("downscaling %s", tex->name);
|
|
||||||
halveTexture(tex);
|
halveTexture(tex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ANISOTROPIC_FILTERING
|
#ifdef ANISOTROPIC_FILTERING
|
||||||
if(tex && RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense
|
if(tex && RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense
|
||||||
|
|
@ -529,6 +533,8 @@ CreateTxdImageForVideoCard()
|
||||||
// only works for textures that are not yet loaded
|
// only works for textures that are not yet loaded
|
||||||
// so let's hope that is the case for all
|
// so let's hope that is the case for all
|
||||||
rw::gl3::needToReadBackTextures = true;
|
rw::gl3::needToReadBackTextures = true;
|
||||||
|
#elif defined RW_GLES1
|
||||||
|
rw::gles1::needToReadBackTextures = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
|
#ifdef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
|
||||||
|
|
@ -579,6 +585,8 @@ CreateTxdImageForVideoCard()
|
||||||
CStreaming::RemoveTxd(i);
|
CStreaming::RemoveTxd(i);
|
||||||
#ifdef RW_GL3
|
#ifdef RW_GL3
|
||||||
rw::gl3::needToReadBackTextures = false;
|
rw::gl3::needToReadBackTextures = false;
|
||||||
|
#elif defined RW_GLES1
|
||||||
|
rw::gles1::needToReadBackTextures = false;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -614,6 +622,8 @@ CreateTxdImageForVideoCard()
|
||||||
|
|
||||||
#ifdef RW_GL3
|
#ifdef RW_GL3
|
||||||
rw::gl3::needToReadBackTextures = false;
|
rw::gl3::needToReadBackTextures = false;
|
||||||
|
#elif defined RW_GLES1
|
||||||
|
rw::gles1::needToReadBackTextures = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!pDir->WriteDirFile("models\\txd.dir")) {
|
if (!pDir->WriteDirFile("models\\txd.dir")) {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ psGlobalType psGlobal;
|
||||||
uint32 gGameState = 0;
|
uint32 gGameState = 0;
|
||||||
long _dwOperatingSystemVersion = 0;
|
long _dwOperatingSystemVersion = 0;
|
||||||
uint32 _dwMemAvailPhys = 0;
|
uint32 _dwMemAvailPhys = 0;
|
||||||
|
size_t streamingMemSize;
|
||||||
|
|
||||||
static EGLDisplay eglDisplay;
|
static EGLDisplay eglDisplay;
|
||||||
static EGLContext eglContext;
|
static EGLContext eglContext;
|
||||||
|
|
@ -95,6 +96,7 @@ static bool spinning;
|
||||||
bool qwerty;
|
bool qwerty;
|
||||||
bool touch;
|
bool touch;
|
||||||
bool moreVram;
|
bool moreVram;
|
||||||
|
bool powervr;
|
||||||
|
|
||||||
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) {
|
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) {
|
||||||
}
|
}
|
||||||
|
|
@ -445,10 +447,9 @@ public:
|
||||||
TRACE("gGameState = GS_PLAYING_GAME;");
|
TRACE("gGameState = GS_PLAYING_GAME;");
|
||||||
break;
|
break;
|
||||||
case GS_PLAYING_GAME:
|
case GS_PLAYING_GAME:
|
||||||
if (!ForegroundApp) break;
|
// float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||||
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
if (RwInitialised && ForegroundApp) {
|
||||||
if ( RwInitialised ) {
|
// if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
||||||
if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
|
|
||||||
RsEventHandler(rsIDLE, (void *)TRUE);
|
RsEventHandler(rsIDLE, (void *)TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -516,17 +517,24 @@ public:
|
||||||
|
|
||||||
SetFocus(ETrue);
|
SetFocus(ETrue);
|
||||||
|
|
||||||
#ifdef RW_GL3
|
#ifndef S60V3
|
||||||
Window().EnableAdvancedPointers();
|
Window().EnableAdvancedPointers();
|
||||||
#endif
|
#endif
|
||||||
EnableDragEvents();
|
EnableDragEvents();
|
||||||
ActivateL();
|
ActivateL();
|
||||||
|
|
||||||
#ifdef RW_GL3
|
#ifndef S60V3
|
||||||
// VC4 check
|
// VC4 check
|
||||||
VersionInfo::TPlatformVersion platformVersion;
|
VersionInfo::TPlatformVersion platformVersion;
|
||||||
VersionInfo::GetVersion(platformVersion);
|
VersionInfo::GetVersion(platformVersion);
|
||||||
moreVram = platformVersion.iMajorVersion == 5 && platformVersion.iMinorVersion >= 4;
|
moreVram = platformVersion.iMajorVersion == 5 && platformVersion.iMinorVersion >= 4;
|
||||||
|
if (moreVram) {
|
||||||
|
streamingMemSize = 12 * 1024 * 1024;
|
||||||
|
} else {
|
||||||
|
streamingMemSize = 10 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
streamingMemSize = 8 * 1024 * 1024;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TSize size = Size();
|
TSize size = Size();
|
||||||
|
|
@ -567,6 +575,17 @@ public:
|
||||||
|
|
||||||
eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
|
eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
|
||||||
|
|
||||||
|
const char* renderer = (const char *)glGetString(GL_RENDERER);
|
||||||
|
if (strstr(renderer, "MBX") || strstr(renderer, "SGX")) {
|
||||||
|
// use pvrtc
|
||||||
|
powervr = true;
|
||||||
|
} else if (strstr(renderer, "VideoCore")) {
|
||||||
|
// use etc1
|
||||||
|
} else {
|
||||||
|
User::Leave(KErrNotSupported);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
setlocale(LC_CTYPE, "C");
|
setlocale(LC_CTYPE, "C");
|
||||||
setlocale(LC_COLLATE, "C");
|
setlocale(LC_COLLATE, "C");
|
||||||
|
|
@ -618,6 +637,10 @@ public:
|
||||||
RestartTimerL(10000);
|
RestartTimerL(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool c(int px, int py, int x, int y, int w, int h) {
|
||||||
|
return px >= x && py >= y && px <= x + w && py <= y + h;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent) {
|
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent) {
|
||||||
touch = true;
|
touch = true;
|
||||||
int x = aPointerEvent.iPosition.iX;
|
int x = aPointerEvent.iPosition.iX;
|
||||||
|
|
@ -641,7 +664,7 @@ public:
|
||||||
// CCoeControl::HandlePointerEventL(aPointerEvent);
|
// CCoeControl::HandlePointerEventL(aPointerEvent);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
#ifdef RW_GL3
|
#ifndef S60V3
|
||||||
const TAdvancedPointerEvent* advpointer = aPointerEvent.AdvancedPointerEvent();
|
const TAdvancedPointerEvent* advpointer = aPointerEvent.AdvancedPointerEvent();
|
||||||
int i = advpointer != NULL ? advpointer->PointerNumber() : 0;
|
int i = advpointer != NULL ? advpointer->PointerNumber() : 0;
|
||||||
#else
|
#else
|
||||||
|
|
@ -676,7 +699,7 @@ public:
|
||||||
activeZone[i] = JOY_R2 + 1;
|
activeZone[i] = JOY_R2 + 1;
|
||||||
virtualButtons[JOY_R2] = 1;
|
virtualButtons[JOY_R2] = 1;
|
||||||
}
|
}
|
||||||
} else if (y > 200 && y <= 360 && (x < 200 || x > w - 200)) {
|
} else if (y > 220 && y <= 360 && (x < 200 || x > w - 200)) {
|
||||||
if (x < 200) {
|
if (x < 200) {
|
||||||
activeZone[i] = -1;
|
activeZone[i] = -1;
|
||||||
stickCenterX[i] = x;
|
stickCenterX[i] = x;
|
||||||
|
|
@ -705,35 +728,44 @@ public:
|
||||||
virtualButtons[JOY_R3] = 1;
|
virtualButtons[JOY_R3] = 1;
|
||||||
}
|
}
|
||||||
} else if (y >= 80 && y <= 80 + 120) {
|
} else if (y >= 80 && y <= 80 + 120) {
|
||||||
if (x < w / 4) {
|
do {
|
||||||
// dpad
|
int cy = (h * 2) / 5;
|
||||||
int b = 0;
|
if (x < w / 4) {
|
||||||
if (y < 125) {
|
// dpad
|
||||||
b = JOY_DPAD_UP;
|
int b = 0;
|
||||||
} else if (y > 155) {
|
int cx = w / 8;
|
||||||
b = JOY_DPAD_DOWN;
|
if (c(x, y, cx - 20, cy - 60, 40, 30)) {
|
||||||
} else if (x < w / 8) {
|
b = JOY_DPAD_UP;
|
||||||
b = JOY_DPAD_LEFT;
|
} else if (c(x, y, cx - 20, cy + 30, 40, 40)) {
|
||||||
} else {
|
b = JOY_DPAD_DOWN;
|
||||||
b = JOY_DPAD_RIGHT;
|
} else if (c(x, y, cx - 75, cy - 20, 40, 40)) {
|
||||||
|
b = JOY_DPAD_LEFT;
|
||||||
|
} else if (c(x, y, cx + 35, cy - 20, 40, 40)) {
|
||||||
|
b = JOY_DPAD_RIGHT;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
activeZone[i] = b + 1;
|
||||||
|
virtualButtons[b] = 1;
|
||||||
|
} else if (x > w - w / 4) {
|
||||||
|
// abxy
|
||||||
|
int cx = w - w / 8;
|
||||||
|
int b = 0;
|
||||||
|
if (c(x, y, cx - 20, cy - 60, 40, 40)) {
|
||||||
|
b = JOY_Y;
|
||||||
|
} else if (c(x, y, cx - 20, cy + 30, 40, 40)) {
|
||||||
|
b = JOY_B;
|
||||||
|
} else if (c(x, y, cx - 75, cy - 20, 40, 40)) {
|
||||||
|
b = JOY_X;
|
||||||
|
} else if (c(x, y, cx + 35, cy - 20, 40, 40)) {
|
||||||
|
b = JOY_A;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
activeZone[i] = b + 1;
|
||||||
|
virtualButtons[b] = 1;
|
||||||
}
|
}
|
||||||
activeZone[i] = b + 1;
|
} while (0);
|
||||||
virtualButtons[b] = 1;
|
|
||||||
} else if (x > w - w / 4) {
|
|
||||||
// abxy
|
|
||||||
int b = 0;
|
|
||||||
if (y < 125) {
|
|
||||||
b = JOY_Y;
|
|
||||||
} else if (y > 155) {
|
|
||||||
b = JOY_B;
|
|
||||||
} else if (x < w - w / 8) {
|
|
||||||
b = JOY_X;
|
|
||||||
} else {
|
|
||||||
b = JOY_A;
|
|
||||||
}
|
|
||||||
activeZone[i] = b + 1;
|
|
||||||
virtualButtons[b] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (aPointerEvent.iType == TPointerEvent::EDrag) {
|
} else if (aPointerEvent.iType == TPointerEvent::EDrag) {
|
||||||
if (activeZone[i] == -1 || activeZone[i] == -2) {
|
if (activeZone[i] == -1 || activeZone[i] == -2) {
|
||||||
|
|
|
||||||
7
vendor/librw/src/base.cpp
vendored
7
vendor/librw/src/base.cpp
vendored
|
|
@ -137,6 +137,9 @@ slerp(const Quat &q, const Quat &p, float32 a)
|
||||||
c = -c;
|
c = -c;
|
||||||
q1 = negate(q1);
|
q1 = negate(q1);
|
||||||
}
|
}
|
||||||
|
if(c > 1.0f) {
|
||||||
|
c = 1.0f;
|
||||||
|
}
|
||||||
float32 phi = acosf(c);
|
float32 phi = acosf(c);
|
||||||
if(phi > 0.00001f){
|
if(phi > 0.00001f){
|
||||||
float32 s = sinf(phi);
|
float32 s = sinf(phi);
|
||||||
|
|
@ -547,7 +550,7 @@ Matrix::invertGeneral(Matrix *dst, const Matrix *src)
|
||||||
// get the determinant from that
|
// get the determinant from that
|
||||||
det = src->up.x * dst->right.y + src->at.x * dst->right.z + dst->right.x * src->right.x;
|
det = src->up.x * dst->right.y + src->at.x * dst->right.z + dst->right.x * src->right.x;
|
||||||
invdet = 1.0;
|
invdet = 1.0;
|
||||||
if(det != 0.0f)
|
if(fabsf(det) > 0.00001f)
|
||||||
invdet = 1.0f/det;
|
invdet = 1.0f/det;
|
||||||
dst->right.x *= invdet;
|
dst->right.x *= invdet;
|
||||||
dst->right.y *= invdet;
|
dst->right.y *= invdet;
|
||||||
|
|
@ -570,7 +573,7 @@ Matrix::makeRotation(Matrix *dst, const V3d *axis, float32 angle)
|
||||||
{
|
{
|
||||||
// V3d v = normalize(*axis);
|
// V3d v = normalize(*axis);
|
||||||
float32 len = dot(*axis, *axis);
|
float32 len = dot(*axis, *axis);
|
||||||
if(len != 0.0f) len = 1.0f/sqrtf(len);
|
if(len > 0.00001f) len = 1.0f/sqrtf(len);
|
||||||
V3d v = rw::scale(*axis, len);
|
V3d v = rw::scale(*axis, len);
|
||||||
angle = angle*(float)M_PI/180.0f;
|
angle = angle*(float)M_PI/180.0f;
|
||||||
float32 s = sinf(angle);
|
float32 s = sinf(angle);
|
||||||
|
|
|
||||||
52
vendor/librw/src/gl/gl3immed.cpp
vendored
52
vendor/librw/src/gl/gl3immed.cpp
vendored
|
|
@ -113,18 +113,15 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
|
||||||
glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0);
|
glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0);
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r));
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, r));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, u));
|
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||||
#endif
|
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||||
|
|
||||||
glDrawArrays(primTypeMap[primType], 0, numVertices);
|
glDrawArrays(primTypeMap[primType], 0, numVertices);
|
||||||
|
|
||||||
|
|
@ -154,18 +151,15 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
|
||||||
glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0);
|
glVertexAttribPointer(ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + 0);
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r));
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, r));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, r));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + offsetof(Im2DVertex, u));
|
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||||
#endif
|
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||||
|
|
||||||
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
||||||
|
|
||||||
|
|
@ -232,18 +226,15 @@ im3DRenderPrimitive(PrimitiveType primType)
|
||||||
glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0);
|
glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0);
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r));
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, r));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, u));
|
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||||
#endif
|
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||||
|
|
||||||
glDrawArrays(primTypeMap[primType], 0, num3DVertices);
|
glDrawArrays(primTypeMap[primType], 0, num3DVertices);
|
||||||
|
|
||||||
|
|
@ -264,18 +255,15 @@ im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndic
|
||||||
glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0);
|
glVertexAttribPointer(ATTRIB_POS, 3, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + 0);
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_COLOR);
|
glEnableVertexAttribArray(ATTRIB_COLOR);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r));
|
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, r));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, r));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
||||||
#else
|
|
||||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + offsetof(Im3DVertex, u));
|
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||||
#endif
|
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||||
|
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||||
|
|
||||||
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
||||||
|
|
||||||
|
|
|
||||||
4
vendor/librw/src/gl/gl3raster.cpp
vendored
4
vendor/librw/src/gl/gl3raster.cpp
vendored
|
|
@ -630,7 +630,7 @@ rasterUnlock(Raster *raster, int32 level)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
// convert to 16-bit
|
// convert to 16-bit
|
||||||
uint16_t* pixels16 = (uint16_t*)malloc(raster->width * raster->height * sizeof(uint16_t));
|
uint16_t* pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * sizeof(uint16_t), MEMDUR_FUNCTION | ID_DRIVER);
|
||||||
uint8_t* pixels8 = (uint8_t*)raster->pixels;
|
uint8_t* pixels8 = (uint8_t*)raster->pixels;
|
||||||
|
|
||||||
for (int i = 0; i < raster->width * raster->height; i++) {
|
for (int i = 0; i < raster->width * raster->height; i++) {
|
||||||
|
|
@ -642,7 +642,7 @@ rasterUnlock(Raster *raster, int32 level)
|
||||||
pixels16[i] = ((r >> 4) << 12) | ((g >> 4) << 8) | ((b >> 4) << 4) | (a >> 4);
|
pixels16[i] = ((r >> 4) << 12) | ((g >> 4) << 8) | ((b >> 4) << 4) | (a >> 4);
|
||||||
}
|
}
|
||||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, raster->width, raster->height, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, pixels16);
|
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, raster->width, raster->height, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, pixels16);
|
||||||
free(pixels16);
|
rwFree(pixels16);
|
||||||
CHECK_GL_ERROR("glTexImage2D 1");
|
CHECK_GL_ERROR("glTexImage2D 1");
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
5
vendor/librw/src/gl/gl3shader.cpp
vendored
5
vendor/librw/src/gl/gl3shader.cpp
vendored
|
|
@ -189,8 +189,13 @@ compileshader(GLenum type, const char **src, GLuint *shader)
|
||||||
glShaderSource(shdr, n, src, nil);
|
glShaderSource(shdr, n, src, nil);
|
||||||
glCompileShader(shdr);
|
glCompileShader(shdr);
|
||||||
glGetShaderiv(shdr, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(shdr, GL_COMPILE_STATUS, &success);
|
||||||
|
#ifdef _DEBUG
|
||||||
printShaderSource(src);
|
printShaderSource(src);
|
||||||
|
#endif
|
||||||
if(!success){
|
if(!success){
|
||||||
|
#ifndef _DEBUG
|
||||||
|
printShaderSource(src);
|
||||||
|
#endif
|
||||||
fprintf(stderr, "Error in %s shader\n",
|
fprintf(stderr, "Error in %s shader\n",
|
||||||
type == GL_VERTEX_SHADER ? "vertex" : "fragment");
|
type == GL_VERTEX_SHADER ? "vertex" : "fragment");
|
||||||
glGetShaderiv(shdr, GL_INFO_LOG_LENGTH, &len);
|
glGetShaderiv(shdr, GL_INFO_LOG_LENGTH, &len);
|
||||||
|
|
|
||||||
1
vendor/librw/src/gl/gl3skin.cpp
vendored
1
vendor/librw/src/gl/gl3skin.cpp
vendored
|
|
@ -342,7 +342,6 @@ skinClose(void *o, int32, int32)
|
||||||
void
|
void
|
||||||
initSkin(void)
|
initSkin(void)
|
||||||
{
|
{
|
||||||
if (moreVram) return; // TODO
|
|
||||||
u_boneMatrices = registerUniform("u_boneMatrices", UNIFORM_MAT4, MAX_BONES);
|
u_boneMatrices = registerUniform("u_boneMatrices", UNIFORM_MAT4, MAX_BONES);
|
||||||
|
|
||||||
Driver::registerPlugin(PLATFORM_GL3, 0, ID_SKIN,
|
Driver::registerPlugin(PLATFORM_GL3, 0, ID_SKIN,
|
||||||
|
|
|
||||||
2
vendor/librw/src/gl/rwgl3.h
vendored
2
vendor/librw/src/gl/rwgl3.h
vendored
|
|
@ -18,7 +18,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#ifdef _DEBUG
|
||||||
extern void re3_debug(const char *format, ...);
|
extern void re3_debug(const char *format, ...);
|
||||||
extern void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...);
|
extern void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...);
|
||||||
#define CHECK_GL_ERROR(trace) do { \
|
#define CHECK_GL_ERROR(trace) do { \
|
||||||
|
|
|
||||||
2
vendor/librw/src/gl/shaders/skin.vert
vendored
2
vendor/librw/src/gl/shaders/skin.vert
vendored
|
|
@ -13,7 +13,7 @@ main(void)
|
||||||
SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;
|
SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;
|
||||||
SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;
|
SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;
|
||||||
SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;
|
SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;
|
||||||
SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;
|
//SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;
|
||||||
|
|
||||||
vec4 Vertex = u_world * vec4(SkinVertex, 1.0);
|
vec4 Vertex = u_world * vec4(SkinVertex, 1.0);
|
||||||
gl_Position = u_proj * u_view * Vertex;
|
gl_Position = u_proj * u_view * Vertex;
|
||||||
|
|
|
||||||
2
vendor/librw/src/gl/shaders/skin_gl.inc
vendored
2
vendor/librw/src/gl/shaders/skin_gl.inc
vendored
|
|
@ -14,7 +14,7 @@ const char *skin_vert_src =
|
||||||
" SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;\n"
|
" SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;\n"
|
||||||
" SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;\n"
|
" SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;\n"
|
||||||
" SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;\n"
|
" SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;\n"
|
||||||
" SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n"
|
" //SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n"
|
||||||
|
|
||||||
" vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n"
|
" vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n"
|
||||||
" gl_Position = u_proj * u_view * Vertex;\n"
|
" gl_Position = u_proj * u_view * Vertex;\n"
|
||||||
|
|
|
||||||
29
vendor/librw/src/gles1/gl1raster.cpp
vendored
29
vendor/librw/src/gles1/gl1raster.cpp
vendored
|
|
@ -395,11 +395,8 @@ rasterLock(Raster *raster, int32 level, int32 lockMode)
|
||||||
px = (uint8*)rwMalloc(allocSz, MEMDUR_EVENT | ID_DRIVER);
|
px = (uint8*)rwMalloc(allocSz, MEMDUR_EVENT | ID_DRIVER);
|
||||||
assert(raster->pixels == nil);
|
assert(raster->pixels == nil);
|
||||||
raster->pixels = px;
|
raster->pixels = px;
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
memset(px, 0, allocSz);
|
memset(px, 0, allocSz);
|
||||||
#else
|
|
||||||
glReadBuffer(GL_BACK);
|
|
||||||
#endif
|
|
||||||
glReadPixels(0, 0, raster->width, raster->height, GL_RGB, GL_UNSIGNED_BYTE, px);
|
glReadPixels(0, 0, raster->width, raster->height, GL_RGB, GL_UNSIGNED_BYTE, px);
|
||||||
|
|
||||||
raster->privateFlags = lockMode;
|
raster->privateFlags = lockMode;
|
||||||
|
|
@ -456,7 +453,7 @@ void rasterUnlock(Raster *raster, int32 level){
|
||||||
// flip vertical (igual que antes)
|
// flip vertical (igual que antes)
|
||||||
{
|
{
|
||||||
int stride = raster->width * natras->bpp;
|
int stride = raster->width * natras->bpp;
|
||||||
uint8_t *tmp = (uint8_t*)malloc(stride);
|
uint8_t *tmp = (uint8_t*)rwMalloc(stride, MEMDUR_FUNCTION | ID_DRIVER);
|
||||||
for(int y = 0; y < raster->height / 2; y++){
|
for(int y = 0; y < raster->height / 2; y++){
|
||||||
uint8_t *a = (uint8_t*)raster->pixels + y * stride;
|
uint8_t *a = (uint8_t*)raster->pixels + y * stride;
|
||||||
uint8_t *b = (uint8_t*)raster->pixels + (raster->height - 1 - y) * stride;
|
uint8_t *b = (uint8_t*)raster->pixels + (raster->height - 1 - y) * stride;
|
||||||
|
|
@ -464,13 +461,13 @@ void rasterUnlock(Raster *raster, int32 level){
|
||||||
memcpy(a, b, stride);
|
memcpy(a, b, stride);
|
||||||
memcpy(b, tmp, stride);
|
memcpy(b, tmp, stride);
|
||||||
}
|
}
|
||||||
free(tmp);
|
rwFree(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!natras->isCompressed){
|
if(!natras->isCompressed){
|
||||||
if(natras->format == GL_RGBA && natras->type == GL_UNSIGNED_BYTE){
|
if(natras->format == GL_RGBA && natras->type == GL_UNSIGNED_BYTE){
|
||||||
// convertir RGBA8888 → RGBA4444
|
// convertir RGBA8888 → RGBA4444
|
||||||
uint16_t *pixels16 = (uint16_t*)malloc(raster->width * raster->height * 2);
|
uint16_t *pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * 2, MEMDUR_FUNCTION | ID_DRIVER);
|
||||||
uint8_t *pixels8 = (uint8_t*)raster->pixels;
|
uint8_t *pixels8 = (uint8_t*)raster->pixels;
|
||||||
for(int i = 0; i < raster->width * raster->height; i++){
|
for(int i = 0; i < raster->width * raster->height; i++){
|
||||||
uint8_t r = pixels8[i*4+0];
|
uint8_t r = pixels8[i*4+0];
|
||||||
|
|
@ -482,7 +479,7 @@ void rasterUnlock(Raster *raster, int32 level){
|
||||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA,
|
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA,
|
||||||
raster->width, raster->height, 0,
|
raster->width, raster->height, 0,
|
||||||
GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, pixels16);
|
GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, pixels16);
|
||||||
free(pixels16);
|
rwFree(pixels16);
|
||||||
} else {
|
} else {
|
||||||
glTexImage2D(GL_TEXTURE_2D, level, natras->internalFormat,
|
glTexImage2D(GL_TEXTURE_2D, level, natras->internalFormat,
|
||||||
raster->width, raster->height, 0,
|
raster->width, raster->height, 0,
|
||||||
|
|
@ -501,11 +498,11 @@ void rasterUnlock(Raster *raster, int32 level){
|
||||||
rwFree(raster->pixels);
|
rwFree(raster->pixels);
|
||||||
raster->pixels = nil;
|
raster->pixels = nil;
|
||||||
#endif
|
#endif
|
||||||
raster->width = raster->originalWidth;
|
raster->width = raster->originalWidth;
|
||||||
raster->height = raster->originalHeight;
|
raster->height = raster->originalHeight;
|
||||||
raster->stride = raster->originalStride;
|
raster->stride = raster->originalStride;
|
||||||
raster->pixels = raster->originalPixels;
|
raster->pixels = raster->originalPixels;
|
||||||
raster->privateFlags = 0;
|
raster->privateFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
int32
|
||||||
|
|
@ -751,8 +748,8 @@ void evictRaster(Raster *raster);
|
||||||
static void*
|
static void*
|
||||||
destroyNativeRaster(void *object, int32 offset, int32)
|
destroyNativeRaster(void *object, int32 offset, int32)
|
||||||
{
|
{
|
||||||
Raster *raster = (Raster*)object;
|
Raster *raster = (Raster*)object;
|
||||||
Gl1Raster *natras = PLUGINOFFSET(Gl1Raster, object, offset);
|
Gl1Raster *natras = PLUGINOFFSET(Gl1Raster, object, offset);
|
||||||
#ifdef RW_GLES1
|
#ifdef RW_GLES1
|
||||||
evictRaster(raster);
|
evictRaster(raster);
|
||||||
switch(raster->type){
|
switch(raster->type){
|
||||||
|
|
@ -786,7 +783,7 @@ destroyNativeRaster(void *object, int32 offset, int32)
|
||||||
natras->backingStore = nil;
|
natras->backingStore = nil;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
|
|
|
||||||
5
vendor/librw/src/gles1/gl1skin.cpp
vendored
5
vendor/librw/src/gles1/gl1skin.cpp
vendored
|
|
@ -33,6 +33,10 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header)
|
||||||
InstanceData *inst = header->inst;
|
InstanceData *inst = header->inst;
|
||||||
int32 n = header->numMeshes;
|
int32 n = header->numMeshes;
|
||||||
|
|
||||||
|
//test rapido a ver si es la textura
|
||||||
|
glDisableClientState(GL_COLOR_ARRAY);
|
||||||
|
glColor4f(1,1,1,1);
|
||||||
|
|
||||||
while(n--){
|
while(n--){
|
||||||
m = inst->material;
|
m = inst->material;
|
||||||
setMaterial(flags, m->color, m->surfaceProps);
|
setMaterial(flags, m->color, m->surfaceProps);
|
||||||
|
|
@ -47,6 +51,7 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header)
|
||||||
|
|
||||||
// skinInstanceCB: igual que defaultInstanceCB, sin pesos/indices
|
// skinInstanceCB: igual que defaultInstanceCB, sin pesos/indices
|
||||||
// porque GLES1 no puede hacer skinning en GPU
|
// porque GLES1 no puede hacer skinning en GPU
|
||||||
|
// aunque... capaz podemos hacerloc on el PowerVR y las extensiones
|
||||||
void
|
void
|
||||||
skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
|
skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
11
vendor/librw/src/printf_stub.c
vendored
Normal file
11
vendor/librw/src/printf_stub.c
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef _DEBUG
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int printf(const char * __restrict s, ...) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int puts(const char *s) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
10
vendor/librw/src/rwbase.h
vendored
10
vendor/librw/src/rwbase.h
vendored
|
|
@ -11,13 +11,15 @@
|
||||||
#ifdef __SYMBIAN32__
|
#ifdef __SYMBIAN32__
|
||||||
#undef stderr
|
#undef stderr
|
||||||
#define stderr stdout
|
#define stderr stdout
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef OFFSET_OF
|
#ifdef OFFSET_OF
|
||||||
#undef OFFSET_OF
|
#undef OFFSET_OF
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __SYMBIAN32__
|
||||||
#define OFFSET_OF(type, member) \
|
#define OFFSET_OF(type, member) ((size_t)&(((type*)0)->member))
|
||||||
((size_t)((char*)&(((type*)0)->member) - (char*)0))
|
#else
|
||||||
|
#define OFFSET_OF offsetof
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: clean up the opengl defines
|
// TODO: clean up the opengl defines
|
||||||
|
|
@ -562,7 +564,7 @@ enum Platform
|
||||||
|
|
||||||
PLATFORM_WDGL = 11, // WarDrum OpenGL
|
PLATFORM_WDGL = 11, // WarDrum OpenGL
|
||||||
PLATFORM_GL3 = 12, // my GL3 implementation
|
PLATFORM_GL3 = 12, // my GL3 implementation
|
||||||
PLATFORM_GLES1 = 13,
|
PLATFORM_GLES1 = 14,
|
||||||
|
|
||||||
NUM_PLATFORMS,
|
NUM_PLATFORMS,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue