Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream #6

Open
wants to merge 216 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
94a14e3
- initial "frack you google monopholy" version of RockDroid
protoman Dec 22, 2018
346b2b1
- initial "frack you google monopholy" version of RockDroid
protoman Dec 22, 2018
1f830fd
- continue conversion to RockDroid
protoman Dec 24, 2018
d0d1f21
- continue conversion to RockDroid
protoman Dec 24, 2018
0a2914a
- continue conversion to RockDroid
protoman Dec 24, 2018
b5e30dc
- continue conversion to RockDroid
protoman Dec 24, 2018
c0c2aaa
- continue conversion to RockDroid
protoman Dec 24, 2018
37570c8
- continue conversion to RockDroid
protoman Dec 24, 2018
248f15b
- continue conversion to RockDroid
protoman Dec 24, 2018
bf16c87
- continue conversion to RockDroid
protoman Dec 24, 2018
5633b1c
- continue conversion to RockDroid
protoman Dec 24, 2018
7aca701
- continue conversion to RockDroid
protoman Dec 24, 2018
24ec50d
- continue conversion to RockDroid
protoman Dec 24, 2018
63aeea1
- continue conversion to RockDroid
protoman Dec 24, 2018
646eb09
- continue conversion to RockDroid
protoman Dec 24, 2018
d9251d5
- continue conversion to RockDroid
protoman Dec 24, 2018
c7452ba
- continue conversion to RockDroid
protoman Dec 24, 2018
461fb0b
- continue conversion to RockDroid
protoman Dec 24, 2018
5e7fb6b
- continue conversion to RockDroid
protoman Dec 24, 2018
c301694
- continue conversion to RockDroid
protoman Dec 24, 2018
ad7c9e0
- continue conversion to RockDroid
protoman Dec 24, 2018
f0012fa
- continue conversion to RockDroid
protoman Dec 24, 2018
dead1ff
- continue conversion to RockDroid
protoman Dec 24, 2018
231ae7e
- continue conversion to RockDroid
protoman Dec 24, 2018
a635430
- continue conversion to RockDroid
protoman Dec 24, 2018
1923053
- continue conversion to RockDroid
protoman Dec 24, 2018
132a0b6
- continue conversion to RockDroid
protoman Dec 24, 2018
ff367c9
- continue conversion to RockDroid
protoman Dec 24, 2018
adf5bc2
- continue conversion to RockDroid
protoman Dec 24, 2018
98668fc
- continue conversion to RockDroid
protoman Dec 24, 2018
61105b0
- continue conversion to RockDroid
protoman Dec 24, 2018
c677a61
- continue conversion to RockDroid
protoman Dec 24, 2018
a622558
- continue conversion to RockDroid
protoman Dec 24, 2018
61e9abf
- continue conversion to RockDroid
protoman Dec 24, 2018
4affd7b
- continue conversion to RockDroid
protoman Dec 24, 2018
85f4dfc
- continue conversion to RockDroid
protoman Dec 24, 2018
096945e
- continue conversion to RockDroid
protoman Dec 24, 2018
416f67f
- continue conversion to RockDroid
protoman Dec 24, 2018
bbc98f8
- continue conversion to RockDroid
protoman Dec 24, 2018
b16c3dc
- continue conversion to RockDroid
protoman Dec 24, 2018
a4d9bf8
- continue conversion to RockDroid
protoman Dec 24, 2018
fd94c53
- continue conversion to RockDroid
protoman Dec 24, 2018
a5d7e28
- continue conversion to RockDroid
protoman Dec 24, 2018
2b95348
- continue conversion to RockDroid
protoman Dec 24, 2018
7bc49f7
- continue conversion to RockDroid
protoman Dec 24, 2018
c8b722e
- continue conversion to RockDroid
protoman Dec 24, 2018
b8e0b66
-update copyright year
protoman Dec 24, 2018
565674f
- remove unused scripts
protoman Dec 27, 2018
7c3a957
- remove more tilesets, fix crash on last stage
protoman Dec 27, 2018
1e646fd
- add info on rockbot removal by google
protoman Dec 27, 2018
5c1c69e
- fixes for PS2
protoman Feb 19, 2019
0f5c822
- more fixes and improvements for PS2 version
protoman Feb 20, 2019
c912f97
Add missing files
protoman Apr 23, 2019
34c4c21
- update graphics
protoman May 27, 2019
cd8197e
- change compiler from gcc to clang
protoman Jun 18, 2019
ba4ead7
- fix a bug in object collision that was made aparent because of clan…
protoman Jun 19, 2019
0c45c7c
- new icon for android v2
protoman Jun 19, 2019
cce29ce
- Fixes for RockDroid2 ending
protoman Oct 14, 2019
e65f1ab
- 1 e 2: às vezes, o diálogo de mudança de arma fica abaixo dos tiles…
protoman Mar 11, 2020
71b781d
- adjusts for release
protoman Mar 11, 2020
bbad3cb
- fix getting stuck in invalid place after dying and returning to che…
protoman Mar 19, 2020
672889c
- increase audio buffer size
protoman Mar 25, 2020
8d57906
- add missing font file
protoman Mar 28, 2020
d82de50
- Fixes for WIN32 build.
protoman Mar 28, 2020
8797616
Re-add ports like Dingux.
protoman Mar 29, 2020
0b8f13e
- update 1up icon in RockBot2
protoman Mar 31, 2020
57befd3
Show boss name in stage selection
protoman Mar 31, 2020
a93e509
- fix crash in number picker (really this time)
protoman Apr 7, 2020
a94b617
- add 30 fps mode for older/slower platforms such as PS2 and Dingux.
protoman Apr 8, 2020
3a3c075
- add back Playstation2 build support
protoman Apr 8, 2020
c6d084c
- Add frameskip option for slow systems such as Dingoo/PS2 (will late…
protoman Apr 9, 2020
6503798
- merge back frixes from old rockbot branch
protoman Apr 11, 2020
d074559
- add configs for on-screen controls spacing and audio buffer size
protoman Apr 20, 2020
0712c7a
Fix ghost flag being unset in NPC.
protoman May 4, 2020
bf47b31
- use ogg files for Android version to fix audio issue with mikmod
protoman May 24, 2020
4ab1f3e
- add music in mod format to fix Android issues with mikmod player
protoman Jun 16, 2020
bd603cc
- add support for PocketGo build
protoman Jun 19, 2020
65b400a
Rockbot1:
protoman Jun 21, 2020
d8cb1b8
- some fixes for warnings
protoman Jun 21, 2020
999b8e3
- fix ending stopping stars animation while waits for keypress
protoman Jun 21, 2020
dec6ef0
- fixes in AI
protoman Jun 25, 2020
19e8955
- tradução de créditos do motor de jogo
protoman Jun 25, 2020
a52de66
- fixes in strings
protoman Jun 25, 2020
f2f5a33
- more translations for in-game weapons menu
protoman Jun 25, 2020
d78ea3a
- code cleanup
protoman Jun 25, 2020
ce71a04
- more code-cleanup
protoman Jun 25, 2020
90bb805
- fix coil teleporting on roof
protoman Jul 8, 2020
f467b70
- improvements in character/map collision code
protoman Jul 13, 2020
4d39090
- add a folder to store old-style music
protoman Jul 13, 2020
327ab84
- fix enemy moving when top is out of water and bottom in-it.
protoman Jul 14, 2020
844fe1a
- add anim-tile for mansion windows
protoman Jul 14, 2020
b4a80b3
- add old music as optional
protoman Jul 15, 2020
c64f696
- remove unused files
protoman Jul 15, 2020
565e3a6
- move ogg files to its own folder
protoman Jul 15, 2020
b1ef7b7
- fix audio menu not updating with changes
protoman Jul 15, 2020
5971681
- re-add intro scene
protoman Jul 21, 2020
60e98cc
- finish about screen
protoman Jul 21, 2020
cb4193f
- removed unused fonts
protoman Jul 22, 2020
f2952dc
- add music in mp3 format, replacing ogg to make file smaller
protoman Jul 23, 2020
50160d5
- add a placeholder in sprites/enemies/background folder, so we don't…
protoman Jul 26, 2020
298d199
- try to fix a crash in option-picker in some Android devices.
protoman Aug 2, 2020
342b284
- add extra check to prevent crash in option-picker
protoman Aug 2, 2020
53f7eb7
- add boss intro image for intro-stage
protoman Sep 1, 2020
560878d
- option to auto-detect language
protoman Sep 3, 2020
95fd444
- set default language in config as auto-detect
protoman Sep 3, 2020
32977d1
add log class to better handle android logging, add missing boss-intr…
protoman Sep 4, 2020
b06fda9
- fixes for Rockbot2 stages and bricks-boss
protoman Sep 4, 2020
232f6a7
- boss dialog cleanup
protoman Nov 15, 2020
70329e7
- code cleanup
protoman Nov 15, 2020
0705b34
- code cleanup
protoman Nov 17, 2020
aec39be
- add intro scene
protoman Nov 19, 2020
f0b17df
- fix vertical wall-walking that was checking position with the wrong…
protoman Nov 20, 2020
1e3be46
- Rockbot2: improve last stage
protoman Nov 22, 2020
98bdb50
- stage improvements
protoman Nov 26, 2020
4b4d908
- remove unused graphic file
protoman Nov 26, 2020
71cb8d1
- fix easy/hard blocks not allowing player to move over it when the d…
protoman Nov 27, 2020
cdde653
- fix issue with map 2 of castle 5 in Rockbot 1
protoman Nov 27, 2020
e777906
- adjust in the endings.
protoman Nov 27, 2020
b0addce
- adjusts in ending dialogs
protoman Nov 27, 2020
ecf862f
- adjusts in ending dialogs
protoman Nov 27, 2020
71e3652
- add anbimated tiles for Daisie stage
protoman Nov 28, 2020
acbdcee
- remove sub-boss wasp from castole #1, it is a boss on castle #4, no…
protoman Nov 28, 2020
97c20a4
- new water splash animation and position fix
protoman Nov 29, 2020
a7ee776
- Add missing files, update for release .38
protoman Nov 29, 2020
9ae5355
- art update
protoman Dec 1, 2020
ce77143
- update art
protoman Dec 1, 2020
dd780fe
- add new animated tile for moon stage (castle 5)
protoman Dec 2, 2020
ed9e07d
- add frameskip to PSP
protoman Dec 3, 2020
fe0a2e3
Update PSP makefile
protoman Dec 3, 2020
fae0f09
- add quit callbacks to psp main
protoman Dec 3, 2020
c080112
- fix typo
protoman Dec 4, 2020
0336669
New icon and background for Rockbot 1 PSP
protoman Dec 4, 2020
08f4c3f
- better making system for PSP
protoman Dec 4, 2020
c9d794d
- improve lighting attack (fix vertical position, show animation indi…
protoman Dec 17, 2020
1e6fd6c
- #2: improve lighting attack, show where it will land before, fix ve…
protoman Feb 28, 2021
4981968
- text adjust
protoman Feb 28, 2021
d2e6174
- add missing translations and dialog cleanup
protoman Apr 23, 2021
5a562db
- EDITOR: set default zoom to 2 and show overlay tiles as translucent…
protoman Apr 24, 2021
6cdc6a6
- add option in view to hide the overlay tiles if they are in the way…
protoman Apr 24, 2021
f9a1b39
- update win32 makefiles with most recent qt5 path
protoman Apr 24, 2021
e88315b
EDITOR:
protoman Apr 24, 2021
9ff2a0b
- update roadmap and code organization
protoman May 3, 2021
60fcf58
- Fix qt5 path
protoman May 3, 2021
580b6f6
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman May 3, 2021
1ca60b5
- fix collision on water when there is a single block ahead
protoman Jun 12, 2021
94d28ae
- fix animation timer that made the stairs attack to last just a few …
protoman Jun 13, 2021
8f68c7a
- change 1up animation graphic style
protoman Jun 13, 2021
f597872
- do not change to default weapon after calling coil or jet
protoman Jun 19, 2021
a288476
- jet item should only start moving once player set foot on it
protoman Jun 19, 2021
ae685b6
https://github.com/protoman/rockbot/issues/62 - Non player character …
protoman Jun 19, 2021
8dfcaca
close #62
protoman Jun 19, 2021
cc128e7
Fix #75
protoman Jun 20, 2021
dfe5bf3
Fix #117 - show nice dialog and create directory if one is missing fo…
protoman Jun 20, 2021
b56dd3a
Fix #60 - when activated, checkpoint must continue to other objects i…
protoman Jun 20, 2021
c4d201b
Fix #73 - change giant fly to UFO and improve it's AI.
protoman Jun 20, 2021
01b0846
Fix #120 set parabola when no target is defined.
protoman Jul 11, 2021
c3cc8c8
Fix #119 - adjust so all projectiles from bomb rain fall into the scr…
protoman Jul 11, 2021
b6227dd
EDITOR: fix layer number in parallax tab in movie editor to be filled…
protoman Jul 20, 2021
0aac252
EDITOR: Add mousewheel zoom adjust in tileset selector and projectile…
protoman Jul 21, 2021
89713ec
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman Jul 21, 2021
ed10ca3
EDITOR: fix issue with tileset selection when using zoom and save/loa…
protoman Jul 21, 2021
fa528f6
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman Jul 21, 2021
f89698a
Add license details in docs, fixes #124
protoman Jul 30, 2021
3971c90
Fix #128
Aug 30, 2021
8f56f69
Fix #130
Aug 30, 2021
1ec2fbc
Fix #127
Aug 30, 2021
6e8a519
Fix #126
Aug 30, 2021
0d95e73
Fix run on windows
protoman Aug 31, 2021
184b106
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman Aug 31, 2021
ff90555
Cleanup code for .050 release. Remove some unecessary methods in Adnd…
Sep 4, 2021
8587deb
- use background to clear player name in player selection screen
Sep 7, 2021
6608b59
Fix #134
Oct 22, 2021
9c1d3cd
Fix crash with old-style energy bar.
Oct 27, 2021
2e1f853
- fix drill-down AI
Nov 2, 2021
c9495fa
- fix drill-down AI
Nov 2, 2021
752dc37
- set correct music for stages like Dragon Bot's.
Dec 17, 2021
aeb3349
- revert player selection screen to use background-color to erase bet…
Dec 20, 2021
c1a05ac
Remove path from process execution to avoid space in path issues in w…
protoman Dec 24, 2021
d4311e4
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman Dec 24, 2021
5643fa3
- improvements in editor UX
Aug 9, 2022
38b7baf
Merge branch 'rockdroid' of https://github.com/protoman/rockbot into …
protoman Aug 9, 2022
f66736b
Fix #141 by resetting the reaction type selector when changing NPC.
protoman Aug 12, 2022
cada762
Fix #137. Do not use rotated surface if there is no target.
protoman Aug 12, 2022
21013ce
Fix #140 by checking if npc has the final boss as replace-itself AI a…
protoman Aug 12, 2022
776cfe2
- add android sdk project files
protoman Dec 18, 2022
6c8ed7b
- Rename log class due to conflicts in Android.
protoman Jul 12, 2023
4447ebb
Add Android config file
Jul 12, 2023
9947116
Fixes for Android build
Jul 13, 2023
253e134
Adjusts to use Pelya's SDL latest version.
protoman Jul 17, 2023
863946e
Fix for issue #138, do not reflect certain types of projectiles.
protoman Jul 18, 2023
03c8da6
- Fix hitboxes when facing left.
protoman Jul 19, 2023
055d785
- start a new in-game menu, move the code fromg raphLib to draw class.
protoman Jul 20, 2023
69f9a65
- bring back lifes and game-over.
protoman Jul 21, 2023
7c01466
- fix vulnerable-area like was done in hit-area.
protoman Jul 24, 2023
1a82d8c
- remove debug.
protoman Jul 24, 2023
3024798
- fix bosses names in ending.
protoman Jul 24, 2023
50e9e3c
- #2: add Destrin Ship after beating Destrin Machine.
protoman Jul 26, 2023
ed53d7c
- add missing files
protoman Jul 27, 2023
fc97e57
- add music from SIMONE "JMD" BERNACCHIA
protoman Jul 27, 2023
fa63cff
- fix one music that had issues in amiga-mod file format.
protoman Jul 27, 2023
16e54c9
Changer back Android app name to RockBot.
protoman Jul 29, 2023
df4d201
- Fix boss HP text position in HUD.
protoman Jul 31, 2023
f98d381
- update
protoman Jul 31, 2023
df33685
add missing files
protoman Jul 31, 2023
447b9b2
- EDITOR: adicionada opção view->tileset
protoman Aug 29, 2023
0a3a84f
- dercrease enemies intangible time after hit to 200ms
protoman Oct 4, 2023
3e90bc4
-update script
protoman Oct 4, 2023
eb01af0
- implement timed-bombs
protoman Oct 11, 2023
298dfbc
- classic in-game menu
protoman Oct 22, 2023
95ab923
- convert boss hp to classic style also.
protoman Oct 31, 2023
c70c354
- update roadmap
protoman Oct 31, 2023
93a4b6f
- remove template, as it is very outdated and not good anymore
protoman Oct 31, 2023
b75e977
- always reload stage music on stage-restart, fixed music playing a p…
protoman Nov 1, 2023
6ca5c91
Resolve conflicts
protoman Jan 14, 2024
40941c4
Merge pull request #142 from protoman/rockdroid
protoman Jan 14, 2024
981f747
Delete build/games/Rockbot1 directory
protoman Jan 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
329 changes: 329 additions & 0 deletions AndroidAppSettings.cfg

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions Makefile.psp
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
PSPSDK=/opt/pspsdk/psp/
PSPSDK=/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/
export PATH=$PATH:/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/bin

TARGET = rockbot
OBJS = main.o options/key_map.o inputlib.o timerlib.o soundlib.o file/file_io.o collision_detection.o graphicslib.o \
TARGET = rockbot_psp
OBJS = main.o data/datautil.o options/key_map.o inputlib.o timerlib.o soundlib.o file/file_io.o collision_detection.o graphicslib.o \
sceneslib.o stage_select.o graphic/option_picker.o classmap.o objects/object.o character/character.o projectilelib.o \
graphic/animation.o stage.o stage_select.o class_config.o scenes/dialogs.o game.o character/classplayer.o \
character/classnpc.o character/artificial_inteligence.o aux_tools/trajectory_parabola.o file/convert.o \
graphic/draw.o graphic/gfx_sin_wave.o character/movement/jump.o character/movement/inertia.o scenes/sceneshow.o \
game_mediator.o ports/psp/psp_ram.o strings_map.o file/fio_strings.o file/fio_common.o \
file/fio_scenes.o aux_tools/stringutils.o aux_tools/fps_control.o docs/game_manual.o aux_tools/exception_manager.o \
character/character_animation.o scenes/game_menu.o
file/fio_scenes.o aux_tools/stringutils.o aux_tools/fps_control.o aux_tools/exception_manager.o \
character/character_animation.o scenes/game_menu.o shareddata.o logger.o


INCDIR = /opt/pspsdk/psp/sdk/include
INCDIR = /media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/include/
CFLAGS = -G0 -Wall -O3 -DPSP -DHANDHELD -g -fexceptions
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -g -fexceptions
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -g -fexceptions -I/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/sdk/include -I/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/include/ -I/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/include/SDL/
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS = -lm -lc -lstdc++ -lc -lSDL_gfx -lSDL_mixer -lvorbisidec -logg -lmikmod -lmmio -lsmpeg -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng -lz `$(PSPSDK)/bin/sdl-config --libs` -lpspirkeyb -lpsppower -L$(PSPSDK)/sdk/lib
LIBS = -lm -lc -lstdc++ -lc -lSDL_gfx -lSDL_mixer -logg -lmikmod -lsmpeg -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng -lz \
-lSDLmain -lSDL -lm -lGL -lm -L/usr/local/pspdev/psp/sdk/lib -L/usr/local/pspdev/psp -lpspirkeyb -lpsppower -lpspvfpu -lpspdebug \
-lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspaudio \
-L$(PSPSDK)/sdk/lib -L/media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/sdk/lib

BUILD_PRX=1
PSP_LARGE_MEMORY = 1


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Rockbot 1.0
PSP_EBOOT_ICON= ./build/packages/files/psp_icon.png
PSP_EBOOT_PIC1= ./build/packages/files/psp_background.png

include /opt/pspsdk/psp/sdk/lib/build.mak
PSP_EBOOT_TITLE = Rockbot $(VERSIONNAME)
PSP_EBOOT_ICON= ./build/packages/files/psp_icon$($version_number).png
PSP_EBOOT_PIC1= ./build/packages/files/psp_background$($version_number).png

include /media/iuri/SamsungEXT4/development/SDK/PSP/sdk/psp/sdk/lib/build.mak
431 changes: 431 additions & 0 deletions RockDroid.pro

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Rockbot.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ QT -= gui


#CONFIG += linux
CONFIG += raspberry
#CONFIG += raspberry
#CONFIG += android
#CONFIG += win32
#CONFIG += playstation2
CONFIG += playstation2
#CONFIG += dingux
#CONFIG += open_pandora
#CONFIG += wii
Expand All @@ -25,6 +25,7 @@ CONFIG += raspberry
# -m64 problem in android build:
# NOTE for android build on 64: /usr/share/qt4/mkspecs/default/qmake.conf
# or, in QT5, /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf
# or, in a install in home (qt5),


### BETA VERSION ###
Expand Down Expand Up @@ -224,6 +225,7 @@ dingux {


playstation2 {
QMAKESPEC=./ports/ps2/g++-ps2.conf
DEFINES+= PLAYSTATION2=1
TARGET = rockbot.elf

Expand Down
23 changes: 10 additions & 13 deletions aux_tools/exception_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#include "exception_manager.h"

#include <cstdio>
#include <cstdlib>
#include <string>
#include <sstream>


exception_manager::exception_manager()
{

Expand All @@ -14,26 +8,29 @@ exception_manager::exception_manager()

void exception_manager::throw_param_exception(std::string prefix, std::string param)
{
std::cout << "### PARAM-EXCEPTION - prefix[" << prefix << "], param[" << param << "]" << std::endl;
std::string backtrace = get_backtrace();
char error_msg[512+backtrace.size()];
sprintf(error_msg, "Exception: Invalid parameter [%s] - value[%s]\nBacktrace:\n[%s]", prefix.c_str(), param.c_str(), backtrace.c_str());
throw std::invalid_argument(error_msg);
//throw std::invalid_argument(error_msg);
}

void exception_manager::throw_file_not_found_exception(std::string prefix, std::string param)
{
std::cout << "### FILE-NOT-FOUND-EXCEPTION - prefix[" << prefix << "], param[" << param << "]" << std::endl;
std::string backtrace = get_backtrace();
char error_msg[512+backtrace.size()];
sprintf(error_msg, "Exception: file not found[%s] - file[%s]\nBacktrace:\n[%s]", prefix.c_str(), param.c_str(), backtrace.c_str());
throw std::invalid_argument(error_msg);
//throw std::invalid_argument(error_msg);
}

void exception_manager::throw_general_exception(std::string prefix, std::string param)
{
std::cout << "### -GENERAL-EXCEPTION - prefix[" << prefix << "], param[" << param << "]" << std::endl;
std::string backtrace = get_backtrace();
char error_msg[512+backtrace.size()];
sprintf(error_msg, "Exception: runtime error[%s] - code[%s]\nBacktrace:\n[%s]", prefix.c_str(), param.c_str(), backtrace.c_str());
throw std::runtime_error(error_msg);
//throw std::runtime_error(error_msg);
}

#ifdef ANDROID
Expand All @@ -51,16 +48,16 @@ _Unwind_Reason_Code exception_manager::unwindCallback(struct _Unwind_Context* co
}

size_t exception_manager::captureBacktrace(void** buffer, size_t max) {
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT2###", "exception_manager::captureBacktrace #1");
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT###", "exception_manager::captureBacktrace #1");
BacktraceState state = {buffer, buffer + max};
_Unwind_Backtrace(unwindCallback, &state);

__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT2###", "exception_manager::captureBacktrace #2");
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT###", "exception_manager::captureBacktrace #2");
return state.current - buffer;
}

void exception_manager::dumpBacktrace(std::ostream& os, void** buffer, size_t count) {
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT2###", "exception_manager::dumpBacktrace #1");
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT###", "exception_manager::dumpBacktrace #1");
for (size_t idx = 0; idx < count; ++idx) {
const void* addr = buffer[idx];
const char* symbol = "";
Expand All @@ -72,7 +69,7 @@ void exception_manager::dumpBacktrace(std::ostream& os, void** buffer, size_t co

os << " #" << std::setw(2) << idx << ": " << addr << " " << symbol << "\n";
}
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT2###", "exception_manager::dumpBacktrace #2");
__android_log_print(ANDROID_LOG_INFO, "###ROCKBOT###", "exception_manager::dumpBacktrace #2");
}

void exception_manager::getBacktrace(std::ostringstream &oss, const size_t max)
Expand Down
5 changes: 5 additions & 0 deletions aux_tools/exception_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#include <unwind.h>
#include <dlfcn.h>
#include <android/log.h>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <sstream>

#endif

struct BacktraceState
Expand Down
59 changes: 43 additions & 16 deletions aux_tools/fps_control.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#include "fps_control.h"

#include <iostream>
#include <algorithm> // std::find



#include "timerlib.h"
#include "../timerlib.h"
extern timerLib timer;

#include "graphicslib.h"
#include "../graphicslib.h"
extern graphicsLib graphLib;


fps_control::fps_control() : fps_timer(0)
{
fps_max = DEFAULT_FPS_MAX;
fps_max = SharedData::get_instance()->get_max_fps();
fps_counter = 0;
fps_min_fail_count = 0;
failed_min_fps = false;
Expand All @@ -25,12 +23,6 @@ void fps_control::initialize()
max_frame_ticks = (1000.0/(float)fps_max)+0.00001;
frame_count = 0;
last_second_ticks = timer.getTimer();
/*
fps_max = max;
float percent = (100 * fps_max) / DEFAULT_FPS_MAX;
std::cout << "FPS_CONTROL.set_max_fps[" << max << "], percent[" << percent << "]" << std::endl;
max_frame_ticks = (1000.0/(float)fps_max)+0.00001;
*/
}

bool fps_control::limit()
Expand All @@ -41,7 +33,6 @@ bool fps_control::limit()
++frame_count;
target_ticks = last_second_ticks + static_cast<unsigned int>(frame_count * max_frame_ticks);
current_ticks = timer.getTimer();
//std::cout << "fps_control::limit::timer.ticks[" << timer.getTimer() << "], sdl.ticks[" << current_ticks << "]" << std::endl;

average_ticks += current_ticks - last_frame_ticks;
if (current_ticks - last_frame_ticks <= min_ticks)
Expand Down Expand Up @@ -93,16 +84,16 @@ void fps_control::fps_count()
fps_counter++;
if (fps_timer <= timer.getTimer()) {
sprintf(_fps_buffer, "FPS: %d", fps_counter);
if (fps_counter <= DEFAULT_FPS_MAX-4) {
frame_drop_period = DEFAULT_FPS_MAX/(DEFAULT_FPS_MAX-fps_counter);
//std::cout << "frame_drop_period[" << frame_drop_period << "], fps_counter[" << fps_counter << "]" << std::endl;
if (fps_counter <= fps_timer-4) {
frame_drop_period = fps_timer/(fps_timer-fps_counter);
} else {
frame_drop_period = 0;
}
fps_counter = 0;
fps_timer = timer.getTimer()+1000;
}
if (fps_counter > 1) {
/*
if (fps_counter <= FPS_MINIMAL_LIMIT) {
fps_min_fail_count++;
} else {
Expand All @@ -111,6 +102,7 @@ void fps_control::fps_count()
if (fps_min_fail_count >= FPS_MINIMAL_MAX_FAIL) {
failed_min_fps = true;
}
*/
std::string temp_str(_fps_buffer);
graphLib.draw_text(12, 2, temp_str);
}
Expand Down Expand Up @@ -139,3 +131,38 @@ void fps_control::reset_failed_min_fps()
failed_min_fps = false;
}

void fps_control::set_frameskip(int skip_n)
{
frameskip_list.clear();
if (skip_n == 1) {
frameskip_list.push_back(1);
} else if (skip_n == 2) {
frameskip_list.push_back(1);
frameskip_list.push_back(6);
} else if (skip_n == 3) {
frameskip_list.push_back(1);
frameskip_list.push_back(4);
frameskip_list.push_back(7);
} else if (skip_n == 4) {
frameskip_list.push_back(1);
frameskip_list.push_back(3);
frameskip_list.push_back(6);
frameskip_list.push_back(9);
} else if (skip_n == 5) {
frameskip_list.push_back(1);
frameskip_list.push_back(3);
frameskip_list.push_back(5);
frameskip_list.push_back(7);
frameskip_list.push_back(9);
}
}

bool fps_control::must_skip_frame()
{
int frame_unit_part = frame_count % 10;
if (std::find(frameskip_list.begin(), frameskip_list.end(), frame_unit_part) != frameskip_list.end()) {
return true;
}
return false;
}

10 changes: 7 additions & 3 deletions aux_tools/fps_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
#define FPS_CONTROL_H

#define DEFULT_PLAYER_SPEED 1.2
#define DEFAULT_FPS_MAX 60
#define FPS_MINIMAL_LIMIT 50 // if fps is lower or equal this value, we increment fail-count
#define FPS_MINIMAL_MAX_FAIL 10 // if we have 10 consecutive times fps is under limit, we take action

#include <iostream>
#include <SDL/SDL.h>
#include <vector>
#include "shareddata.h"

// === FPS limiter by Felipe Zacani === //

Expand All @@ -30,7 +32,8 @@ class fps_control
int get_frame_drop_n();
bool get_failed_min_fps();
void reset_failed_min_fps();

void set_frameskip(int skip_n);
bool must_skip_frame();

private:
st_fps_data data;
Expand All @@ -48,7 +51,7 @@ class fps_control

unsigned short fps_max;

unsigned int fps_timer;
unsigned long fps_timer;
int fps_counter;
// if we are getting less than 60 fps, this will tell main loop how many times it will run full until drop one
unsigned short frame_drop_period;
Expand All @@ -57,6 +60,7 @@ class fps_control
unsigned int fps_min_fail_count; // counts the number of sequential times the FPS is under minumal limit
bool failed_min_fps;

std::vector<int> frameskip_list;
};

#endif // FPS_CONTROL_H
2 changes: 0 additions & 2 deletions aux_tools/stringutils.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "stringutils.h"



StringUtils::StringUtils()
{

Expand Down
3 changes: 1 addition & 2 deletions aux_tools/stringutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <string.h>
#include <cstring>

class StringUtils
{
Expand Down
4 changes: 0 additions & 4 deletions aux_tools/trajectory_parabola.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void trajectory_parabola::set_distance(int dist)
if (_reducefactor <= 0) {
_reducefactor = 0.4;
}
//std::cout << ">>>> DEBUG #2 _reducefactor: " << _reducefactor << ", _max_point: " << _max_point << " speed: " << _v << " <<<<<" << std::endl;
}

int trajectory_parabola::get_y_point(int n) const
Expand All @@ -51,9 +50,6 @@ int trajectory_parabola::get_y_point(int n) const
if (_reducefactor != 0) {
reduced_y = (int)(y/_reducefactor);
}
if (reduced_y <= -21474834) {
std::cout << ">>>parabola::get_y_point - n: " << n << ", _max_point: " << _reducefactor << ", y: " << y << ", reduced_y: " << reduced_y << std::endl;
}
return reduced_y;
}

Expand Down
Binary file removed build/fonts/dlxfont.ttf
Binary file not shown.
Binary file removed build/fonts/gamegirl.ttf
Binary file not shown.
Binary file added build/fonts/kapel.ttf
Binary file not shown.
Binary file removed build/fonts/kongtext.ttf
Binary file not shown.
Binary file added build/games/RockDroid1/anim_block_list.dat
Binary file not shown.
Loading